Exemplo n.º 1
0
 public void OnSelectBuilding(GameObject button_go, BuildingDef def)
 {
     if ((UnityEngine.Object)button_go == (UnityEngine.Object)null)
     {
         Debug.Log("Button gameObject is null", base.gameObject);
     }
     else if ((UnityEngine.Object)button_go == (UnityEngine.Object)selectedBuildingGameObject)
     {
         CloseRecipe(true);
     }
     else
     {
         ignoreToolChangeMessages++;
         selectedBuildingGameObject = button_go;
         currentlySelectedToggle    = button_go.GetComponent <KToggle>();
         KMonoBehaviour.PlaySound(GlobalAssets.GetSound("HUD_Click", false));
         HashedString category = tagCategoryMap[def.Tag];
         if (GetToggleEntryForCategory(category, out ToggleEntry toggleEntry) && toggleEntry.pendingResearchAttentions.Contains(def.Tag))
         {
             toggleEntry.pendingResearchAttentions.Remove(def.Tag);
             button_go.GetComponent <PlanCategoryNotifications>().ToggleAttention(false);
             if (toggleEntry.pendingResearchAttentions.Count == 0)
             {
                 toggleEntry.toggleInfo.toggle.GetComponent <PlanCategoryNotifications>().ToggleAttention(false);
             }
         }
         productInfoScreen.ClearProduct(false);
         ToolMenu.Instance.ClearSelection();
         PrebuildTool.Instance.Activate(def, BuildableState(def));
         productInfoScreen.Show(true);
         productInfoScreen.ConfigureScreen(def);
         ignoreToolChangeMessages--;
     }
 }
Exemplo n.º 2
0
 private void CloseProductInfoScreen()
 {
     productInfoScreen.ClearProduct(true);
     productInfoScreen.Show(false);
 }