Example #1
0
 public static void SetupHumanGui()
 {
     HumanWindowGameObject = new GameObject("HumanWindowGameObject");
     humanUI   = (HumanUI)HumanWindowGameObject.AddComponent(typeof(HumanUI));
     HumanInfo = UIView.Find <UIPanel>("(Library) CitizenWorldInfoPanel");
     if (HumanInfo == null)
     {
         DebugLog.LogToFileOnly("UIPanel not found (update broke the mod!): (Library) CitizenWorldInfoPanel\nAvailable panels are:\n");
     }
     humanUI.transform.parent          = HumanInfo.transform;
     humanUI.size                      = new Vector3(HumanInfo.size.x, HumanInfo.size.y);
     humanUI.baseBuildingWindow        = HumanInfo.gameObject.transform.GetComponentInChildren <CitizenWorldInfoPanel>();
     humanUI.position                  = new Vector3(HumanInfo.size.x, HumanInfo.size.y);
     HumanInfo.eventVisibilityChanged += HumanInfo_eventVisibilityChanged;
 }
Example #2
0
 public void HumanClicked(HumanUI humanUI)
 {
     if (FreeHumanList.Contains(humanUI.human))
     {
         if (HiredHumanList.Count < MaxHiredCount)
         {
             FreeHumanList.Remove(humanUI.human);
             FreeHumanUIList.Remove(humanUI);
             HiredHumanList.Add(humanUI.human);
             HiredHumanUIList.Add(humanUI);
             humanUI.transform.SetParent(HiredHumanContainer.transform, false);
         }
     }
     else
     {
         FreeHumanList.Add(humanUI.human);
         FreeHumanUIList.Add(humanUI);
         HiredHumanList.Remove(humanUI.human);
         HiredHumanUIList.Remove(humanUI);
         humanUI.transform.SetParent(MainHumanContainer.transform, false);
     }
 }