Пример #1
0
    public void SetObservingDock(Dock d)
    {
        if (d == null)
        {
            SelfShutOff();
            return;
        }
        else
        {
            observingDock = d; isObserving = true;
            UIWorkbuildingObserver uwb = WorkBuilding.workbuildingObserver;
            if (uwb == null)
            {
                uwb = UIWorkbuildingObserver.InitializeWorkbuildingObserverScript();
            }
            else
            {
                uwb.gameObject.SetActive(true);
            }
            uwb.SetObservingWorkBuilding(observingDock);
            if (tradingListPanel.activeSelf)
            {
                PrepareTradingPanel();
            }
            else
            {
                PrepareImmigrationPanel();
            }

            STATUS_UPDATE_TIME = 1.5f; timer = STATUS_UPDATE_TIME;
        }
    }
Пример #2
0
 public void SetObservingDock(Dock d)
 {
     if (d == null)
     {
         SelfShutOff();
         return;
     }
     else
     {
         if (dockSystem == null)
         {
             dockSystem = DockSystem.GetCurrent();
         }
         observingDock = d; isObserving = true;
         UIWorkbuildingObserver uwb = WorkBuilding.workbuildingObserver;
         if (uwb == null)
         {
             uwb = UIWorkbuildingObserver.InitializeWorkbuildingObserverScript();
         }
         else
         {
             uwb.gameObject.SetActive(true);
         }
         uwb.SetObservingPlace(observingDock);
         if (tradingListPanel.activeSelf)
         {
             PrepareTradingPanel();
         }
         else
         {
             PrepareImmigrationPanel();
         }
         dockInfoLabel.text = observingDock.UI_GetInfo();
     }
 }
    public void SetObservingRCenter(RecruitingCenter rc)
    {
        if (fullProgressBarLength == -1)
        {
            fullProgressBarLength = progressBar.rect.width;
            startOffset           = progressBar.offsetMin.x;
        }
        if (rc == null)
        {
            SelfShutOff();
            return;
        }
        UIWorkbuildingObserver uwb = WorkBuilding.workbuildingObserver;

        if (uwb == null)
        {
            uwb = UIWorkbuildingObserver.InitializeWorkbuildingObserverScript();
        }
        else
        {
            uwb.gameObject.SetActive(true);
        }
        observingRCenter = rc; isObserving = true;
        uwb.SetObservingWorkBuilding(rc);

        PrepareCrewsWindow();

        STATUS_UPDATE_TIME = 1f; timer = STATUS_UPDATE_TIME;
    }
Пример #4
0
    public void SetObservingFactory(Factory f)
    {
        if (f == null)
        {
            SelfShutOff();
            return;
        }
        UIWorkbuildingObserver uwb = WorkBuilding.workbuildingObserver;

        if (uwb == null)
        {
            uwb = UIWorkbuildingObserver.InitializeWorkbuildingObserverScript();
        }
        else
        {
            uwb.gameObject.SetActive(true);
        }
        observingFactory = f; isObserving = true;
        uwb.SetObservingWorkBuilding(observingFactory);

        Recipe[] recipes = observingFactory.GetFactoryRecipes();
        recipesDropdown.enabled = true;
        Recipe r = observingFactory.recipe;
        int    positionInDropdown = -1;

        if (recipes.Length == 1)
        {
            recipesDropdown.interactable = false;
        }
        else
        {
            recipesDropdown.interactable = true;
            List <Dropdown.OptionData> recipeButtons = new List <Dropdown.OptionData>();
            for (int i = 0; i < recipes.Length; i++)
            {
                recipeButtons.Add(new Dropdown.OptionData(Localization.GetResourceName(recipes[i].input.ID) + " -> " + Localization.GetResourceName(recipes[i].output.ID)));
                if (recipes[i].ID == r.ID)
                {
                    positionInDropdown = i;
                }
            }
            recipesDropdown.options = recipeButtons;
        }

        inputIcon.uvRect       = ResourceType.GetTextureRect(r.input.ID);
        inputValueString.text  = r.inputValue.ToString();
        outputIcon.uvRect      = ResourceType.GetTextureRect(r.output.ID);
        outputValueString.text = r.outputValue.ToString();
        recipesDropdown.value  = positionInDropdown;

        STATUS_UPDATE_TIME = 0.1f; timer = STATUS_UPDATE_TIME;
    }
Пример #5
0
 public override UIObserver ShowOnGUI()
 {
     if (workbuildingObserver == null)
     {
         workbuildingObserver = UIWorkbuildingObserver.InitializeWorkbuildingObserverScript();
     }
     else
     {
         workbuildingObserver.gameObject.SetActive(true);
     }
     workbuildingObserver.SetObservingWorkBuilding(this);
     showOnGUI = true;
     return(workbuildingObserver);
 }
Пример #6
0
 public UIObserver ShowOnGUI()
 {
     if (observer == null)
     {
         observer = UIWorkbuildingObserver.InitializeWorkbuildingObserverScript();
     }
     else
     {
         observer.gameObject.SetActive(true);
     }
     observer.SetObservingPlace(this);
     showOnGUI = true;
     return(observer);
 }
Пример #7
0
 public override UIObserver ShowOnGUI()
 {
     if (workbuildingObserver == null)
     {
         workbuildingObserver = UIWorkbuildingObserver.InitializeWorkbuildingObserverScript();
     }
     else
     {
         workbuildingObserver.gameObject.SetActive(true);
     }
     workbuildingObserver.SetObservingPlace(this);
     colony.observer?.ActivateHospitalPanel();
     showOnGUI = true;
     return(workbuildingObserver);
 }
 public override UIObserver ShowOnGUI()
 {
     if (workbuildingObserver == null)
     {
         workbuildingObserver = UIWorkbuildingObserver.InitializeWorkbuildingObserverScript();
     }
     else
     {
         workbuildingObserver.gameObject.SetActive(true);
     }
     workbuildingObserver.SetObservingWorkBuilding(this);
     showOnGUI = true;
     colony.observer?.ChangeActiveWindow(ActiveWindowMode.ExpeditionPanel);
     return(workbuildingObserver);
 }
Пример #9
0
 public override UIObserver ShowOnGUI()
 {
     if (workbuildingObserver == null)
     {
         workbuildingObserver = UIWorkbuildingObserver.InitializeWorkbuildingObserverScript();
     }
     else
     {
         workbuildingObserver.gameObject.SetActive(true);
     }
     workbuildingObserver.SetObservingWorkBuilding(this);
     UIController.current.ActivateProgressPanel(ProgressPanelMode.Powerplant);
     showOnGUI = true;
     return(workbuildingObserver);
 }
Пример #10
0
 public override UIObserver ShowOnGUI()
 {
     if (workbuildingObserver == null)
     {
         UIWorkbuildingObserver.InitializeWorkbuildingObserverScript();
     }
     else
     {
         workbuildingObserver.gameObject.SetActive(true);
     }
     workbuildingObserver.SetObservingWorkBuilding(this);
     showOnGUI = true;
     UIController.current.ActivateRollingShopPanel();
     return(workbuildingObserver);
 }
Пример #11
0
    public override UIObserver ShowOnGUI()
    {
        if (workbuildingObserver == null)
        {
            workbuildingObserver = UIWorkbuildingObserver.InitializeWorkbuildingObserverScript();
        }
        else
        {
            workbuildingObserver.gameObject.SetActive(true);
        }
        workbuildingObserver.SetObservingWorkBuilding(this);
        showOnGUI = true;

        UIController.current.EnableTextfield(ID);

        return(workbuildingObserver);
    }
    public void SetObservingRCenter(RecruitingCenter rc)
    {
        if (rc == null)
        {
            SelfShutOff();
            return;
        }
        UIWorkbuildingObserver uwb = WorkBuilding.workbuildingObserver;

        if (uwb == null)
        {
            uwb = UIWorkbuildingObserver.InitializeWorkbuildingObserverScript();
        }
        else
        {
            uwb.gameObject.SetActive(true);
        }
        observingRCenter = rc; isObserving = true;
        uwb.SetObservingPlace(rc);
        PrepareWindow();
    }
    public void SetObservingHangar(Hangar h)
    {
        if (h == null)
        {
            SelfShutOff();
            return;
        }
        UIWorkbuildingObserver uwb = WorkBuilding.workbuildingObserver;

        if (uwb == null)
        {
            uwb = UIWorkbuildingObserver.InitializeWorkbuildingObserverScript();
        }
        else
        {
            uwb.gameObject.SetActive(true);
        }
        observingHangar = h; isObserving = true;
        uwb.SetObservingPlace(h);
        PrepareHangarWindow();
    }
Пример #14
0
 public void SetObservingDock(Dock d)
 {
     if (d == null)
     {
         SelfShutOff();
         return;
     }
     else
     {
         if (dockSystem == null)
         {
             dockSystem = DockSystem.GetCurrent();
         }
         observingDock = d; isObserving = true;
         UIWorkbuildingObserver uwb = WorkBuilding.workbuildingObserver;
         if (uwb == null)
         {
             uwb = UIWorkbuildingObserver.InitializeWorkbuildingObserverScript();
         }
         else
         {
             uwb.gameObject.SetActive(true);
         }
         uwb.SetObservingWorkBuilding(observingDock);
         if (tradingListPanel.activeSelf)
         {
             PrepareTradingPanel();
         }
         else
         {
             PrepareImmigrationPanel();
         }
         if (observingDock.correctLocation)
         {
             nextShipTimer.text = observingDock.shipArrivingTimer.ToString();
         }
     }
 }
Пример #15
0
    public void SetObservingFactory(Factory f)
    {
        if (f == null)
        {
            SelfShutOff();
            return;
        }
        UIWorkbuildingObserver uwb = WorkBuilding.workbuildingObserver;

        if (uwb == null)
        {
            uwb = UIWorkbuildingObserver.InitializeWorkbuildingObserverScript();
        }
        else
        {
            uwb.gameObject.SetActive(true);
        }
        observingFactory    = f; isObserving = true;
        ignoreSetRecipeCall = true;
        advancedFactoryMode = f is AdvancedFactory;
        uwb.SetObservingPlace(observingFactory);

        Recipe[] recipes = observingFactory.GetFactoryRecipes();
        recipesDropdown.enabled = false;

        int positionInDropdown = 0;

        if (recipes.Length == 1 && recipes[0] == Recipe.NoRecipe)
        {
            recipesDropdown.interactable = false;
        }
        else
        {
            List <Dropdown.OptionData> recipeButtons = new List <Dropdown.OptionData>();
            Recipe r;
            if (advancedFactoryMode)
            {
                AdvancedRecipe ar = (observingFactory as AdvancedFactory).GetRecipe(), arf;
                for (int i = 0; i < recipes.Length; i++)
                {
                    r   = recipes[i];
                    arf = r as AdvancedRecipe;
                    if (arf == null)
                    {
                        recipeButtons.Add(new Dropdown.OptionData(Localization.GetResourceName(r.input.ID) + " -> " + Localization.GetResourceName(r.output.ID)));
                    }
                    else
                    {
                        recipeButtons.Add(new Dropdown.OptionData(
                                              Localization.GetResourceName(arf.input.ID) + " + " + Localization.GetResourceName(arf.input2.ID) + " -> " + Localization.GetResourceName(arf.output.ID)
                                              ));
                    }
                    if (r.ID == ar.ID)
                    {
                        positionInDropdown = i;
                    }
                }
            }
            else
            {
                Recipe rx = observingFactory.GetRecipe();
                for (int i = 0; i < recipes.Length; i++)
                {
                    r = recipes[i];
                    recipeButtons.Add(new Dropdown.OptionData(Localization.GetResourceName(r.input.ID) + " -> " + Localization.GetResourceName(r.output.ID)));
                    if (r.ID == rx.ID)
                    {
                        positionInDropdown = i;
                    }
                }
            }
            recipesDropdown.options      = recipeButtons;
            recipesDropdown.interactable = true;
        }
        recipesDropdown.value = positionInDropdown;
        RedrawRecipeData();
        recipesDropdown.enabled = true;
        //
        modesDropdown.value = (int)observingFactory.productionMode;
        if (observingFactory.productionMode == FactoryProductionMode.NoLimit)
        {
            limitPanel.SetActive(false);
        }
        else
        {
            showingProductionValue = observingFactory.productionModeValue;
            limitInputField.text   = showingProductionValue.ToString();
            limitPanel.SetActive(true);
        }
        //
        ignoreSetRecipeCall = false;
    }