Example #1
0
    private void ConstructRequest()
    {
        UiPopupConfirm popupConfirm = Ui.ShowPopupConfirm();

        popupConfirm.SetData
        (
            _building.Name,
            _building.Description,
            _building.ActionNameConstruct,
            LocalizationKeys.CommonButtonCancel.Get()
        );

        popupConfirm.OnOk += () =>
        {
            if (Quest.Instance.Status.Resources.IsEnough(_building.Cost))
            {
                Ui.ShowPopupAssignWorker(_building);
                _building.ConstructionStart();
            }
            else
            {
                Ui.ShowPopupNotEnoughResources(LocalizationKeys.BuildingCommonNotEnoughResourcesToConstruct.Get());
            }
        };
    }
Example #2
0
    public static UiPopupConfirm ShowPopupNotEnoughResources(string message)
    {
        UiPopupConfirm popupConfirm = Ui.ShowPopupConfirm();

        popupConfirm.OnOk += Ui.ShowScreenMap;
        popupConfirm.SetData
        (
            "НЕХВАТАЕТ РЕСУРСОВ",
            message,
            "ДА",
            "НЕТ"
        );

        return(popupConfirm);
    }