Sexperience had a bug where an optimizer/patcher could cause the static contructor of the dialog to be called before the GUI was ready. Just to be safe, delay the GUI calls until the first time the dialog is opened here, too.

This commit is contained in:
lutepickle 2022-07-30 08:55:21 -07:00
parent 3f739a12d9
commit 3362a1f0ca
2 changed files with 15 additions and 5 deletions

Binary file not shown.

View File

@ -32,11 +32,11 @@ namespace RJW_Menstruation
private Texture2D anal;
private Color cumcolor;
private readonly GUIStyle fontstylecenter = new GUIStyle() { alignment = TextAnchor.MiddleCenter };
private readonly GUIStyle fontstyleright = new GUIStyle() { alignment = TextAnchor.MiddleRight };
private readonly GUIStyle fontstyleleft = new GUIStyle() { alignment = TextAnchor.MiddleLeft };
private readonly GUIStyle boxstyle = new GUIStyle(GUI.skin.textArea);
private readonly GUIStyle buttonstyle = new GUIStyle(GUI.skin.button);
private static GUIStyle fontstylecenter = null;
private static GUIStyle fontstyleright = null;
private static GUIStyle fontstyleleft = null;
private static GUIStyle boxstyle = null;
private static GUIStyle buttonstyle = null;
public Pawn Pawn
{
@ -137,6 +137,16 @@ namespace RJW_Menstruation
}
public override void PreOpen()
{
base.PreOpen();
if (fontstylecenter == null) fontstylecenter = new GUIStyle() { alignment = TextAnchor.MiddleCenter };
if (fontstyleright == null) fontstyleright = new GUIStyle() { alignment = TextAnchor.MiddleRight };
if (fontstyleleft == null) fontstyleleft = new GUIStyle() { alignment = TextAnchor.MiddleLeft };
if (boxstyle == null) boxstyle = new GUIStyle(GUI.skin.textArea);
if (buttonstyle == null) buttonstyle = new GUIStyle(GUI.skin.button);
}
private void MainContents(Rect mainRect)
{