Exemplo n.º 1
0
    public void BuildShip()
    {
        bool canBuild = Manufactory.CanBuild();
        bool canStore = Manufactory.CanStore();

        if (!canStore)
        {
            PopUpManager.CreateSingleButtonTextPopUp("The ship cannot be built because there wont be enough space in the storage", "Ok");
            return;
        }

        if (!canBuild)
        {
            var description = "The ship cannot be built because you are at your maximum production capacity";

            var buttonText = "Ok";

            PopUpManager.CreateSingleButtonTextPopUp(description, buttonText);
            return;
        }

        CloseBuildShipView();

        Manufactory.StartBuildingShip(selectableController.GetSelectedCell().data.shipRecipe);
    }
Exemplo n.º 2
0
    public void Btn_Send()
    {
        List <Dock> destinationDocks = PlayerDataManager.Instance.GetDocksByPlanet(selectedDestination);

        foreach (var destinationDock in destinationDocks)
        {
            if (destinationDock.DockState == DockState.Empty)
            {
                // We need to substract the required fuel from the total fuel
                //dock.Ship.resourcesModule.IncreaseResource(ResourcesDSID.Fuel, -sendShipManager.CalculateReqFuel(selectedLaunchMethod == LaunchMethod.Skyhook));

                InstitutionsUIManager.Instance.CosmicPortUIManager.Back();

                var sendShipData = new SendShipData(dock, destinationDock, selectedDestination);
                Settlement.Instance.CosmicPort.LaunchShip(sendShipData, selectedLaunchMethod);

                // reserve this dock
                destinationDock.UpdateState(DockState.Reserved);
                ReserveDock(destinationDocks);

                return;
            }
        }

        string text = "No docks can receive the ship";

        PopUpManager.CreateSingleButtonTextPopUp(text, "Ok");
        return;
    }
Exemplo n.º 3
0
    private void ShowNoSkyhooksPopUp()
    {
        var description = "There are no Skyhooks in the storage";

        var buttonText = "Ok";

        PopUpManager.CreateSingleButtonTextPopUp(description, buttonText);
    }
    private void CreateCannotUnlockPopUp()
    {
        string text        = $"This study is already unlocked.";
        string button1Text = "Ok";

        PopUpManager.CreateSingleButtonTextPopUp(text,
                                                 button1Text,
                                                 new Action(() => { }));
    }