Browse Source

Fix message box font size not working with localization enabled

Geoffrey Horsington 4 years ago
parent
commit
4ca6a28f9a
1 changed files with 15 additions and 3 deletions
  1. 15 3
      MultipleMaids/CM3D2/MultipleMaids/Plugin/MultipleMaids.Gui.cs

+ 15 - 3
MultipleMaids/CM3D2/MultipleMaids/Plugin/MultipleMaids.Gui.cs

@@ -8821,7 +8821,7 @@ namespace CM3D2.MultipleMaids.Plugin
             {
                 mFontSize = fontSize;
                 GameObject gameObject = GameObject.Find("__GameMain__/SystemUI Root").transform.Find("MessageWindowPanel").gameObject;
-                MessageClass messageClass = new MessageClass(gameObject, GameMain.Instance.ScriptMgr.adv_kag.MessageWindowMgr);
+                //MessageClass messageClass = new MessageClass(gameObject, GameMain.Instance.ScriptMgr.adv_kag.MessageWindowMgr);
                 SetFieldValue2<UILabel, int>(UTY.GetChildObject(gameObject, "MessageViewer/MsgParent/Message", false)
                                                 .GetComponent<UILabel>(),
                                              "mFontSize",
@@ -8846,11 +8846,23 @@ namespace CM3D2.MultipleMaids.Plugin
                 GameObject gameObject1 = GameObject.Find("__GameMain__/SystemUI Root").transform.Find("MessageWindowPanel").gameObject;
                 MessageWindowMgr messageWindowMgr = GameMain.Instance.ScriptMgr.adv_kag.MessageWindowMgr;
                 messageWindowMgr.OpenMessageWindowPanel();
-                MessageClass inst = new MessageClass(gameObject1, messageWindowMgr);
+
                 UILabel component = UTY.GetChildObject(gameObject1, "MessageViewer/MsgParent/Message", false).GetComponent<UILabel>();
+                UILabel nameComponent = UTY.GetChildObject(gameObject1, "MessageViewer/MsgParent/SpeakerName/Name", false).GetComponent<UILabel>();
+
+                MessageClass inst = new MessageClass(gameObject1, messageWindowMgr);
+                // Fix for ENG version: reconfigure MessageClass to behave as in JP game
+                inst.subtitles_manager_.visible = false;
+                inst.subtitles_manager_ = null;
+                component.gameObject.SetActive(true);
+                nameComponent.gameObject.SetActive(true);
+                UTY.GetChildObject(gameObject1, "MessageViewer/MsgParent/MessageBox", false).SetActive(true);
+                SetFieldValue5<MessageClass, UILabel>(inst, "message_label_", component);
+                SetFieldValue5<MessageClass, UILabel>(inst, "name_label_", nameComponent);
+
                 component.ProcessText();
                 SetFieldValue2<UILabel, int>(component, "mFontSize", fontSize);
-                SetFieldValue5<MessageClass, UILabel>(inst, "message_label_", component);
+
                 inst.SetText(inName, inText, "", 0, AudioSourceMgr.Type.System);
                 inst.FinishChAnime();
             }