Exemple #1
0
 private static void UIMainMenuContext_OnActivate_Patch(ref UIMainMenuContext __instance)
 {
     if (JapanX.jpX_Menu != null)
     {
         JapanX.jpX_Menu.BuildJpXMenu(__instance);
         return;
     }
     Debug.LogError("Error building JapanX Menu");
 }
Exemple #2
0
 // Token: 0x0600000B RID: 11 RVA: 0x000027E0 File Offset: 0x000009E0
 public void BuildJpXMenu(UIMainMenuContext context)
 {
     this.menuContext = context;
     if (this.menuContext && this.JapanXMenu == null)
     {
         GameObject gameObject  = this.menuContext.transform.Find("Menus/CenterMenu/SingleplayerMenu").gameObject;
         GameObject gameObject2 = this.menuContext.transform.Find("Menus/CenterMenu/MultiplayerMenuConsole").gameObject;
         this.JapanXMenu      = UnityEngine.Object.Instantiate <GameObject>(gameObject.gameObject);
         this.JapanXMenu.name = "JapanXMenu";
         this.JapanXMenu.transform.SetParent(gameObject.transform.parent, false);
         this.JapanXMenu.GetComponent <VisibilityBoolBinding>().reference = -1.0;
         foreach (object obj in this.JapanXMenu.transform)
         {
             UnityEngine.Object.Destroy(((Transform)obj).gameObject);
         }
         GameObject gameObject3 = this.CreateButton(gameObject.transform.Find("TrainingMode"), "jpXSingleplayer");
         this.FixOffsets(gameObject3, new Vector2(100f, -188f), new Vector2(645f, 0f));
         GameObject gameObject4 = this.CreateButton(gameObject2.transform.Find("Rooms"), "jpXMultiplayer");
         this.FixOffsets(gameObject4, new Vector2(100f, -383f), new Vector2(645f, -195f));
         GameObject      gameObject5 = this.CreateButton(gameObject.transform.Find("Garage"), "jpXGarage");
         ElementNavigate component   = gameObject3.GetComponent <ElementNavigate>();
         ElementNavigate component2  = gameObject4.GetComponent <ElementNavigate>();
         ElementNavigate component3  = gameObject5.GetComponent <ElementNavigate>();
         component.up     = null;
         component.down   = component2;
         component.left   = null;
         component.right  = null;
         component2.up    = component;
         component2.down  = component3;
         component2.left  = null;
         component2.right = null;
         component3.up    = component2;
         component3.down  = null;
         component3.left  = null;
         component3.right = null;
     }
 }