Exemplo n.º 1
0
    private BuildingDescriptionMenu _descriptionWindow; //the window tht will pop up msg

    // Use this for initialization
    private void Start()
    {
        //for this to work only one gameObj can have the HoverWindow attached
        if (_descriptionWindow == null)
        {
            _descriptionWindow = FindObjectOfType <BuildingDescriptionMenu>();
        }
    }
Exemplo n.º 2
0
    private void SetRequirementsNeededInfoMsg()
    {
        if (!string.IsNullOrEmpty(InfoMsg))
        {
            return;
        }
        string res     = Languages.ReturnString("To.Unlock");
        int    appends = 0;

        if (Persons != 0)
        {
            res += Persons + " " + Languages.ReturnString("People") + ". ";
            appends++;
        }
        if (Food != 0)
        {
            res += Unit.WeightConverted(Food) + " " + Unit.WeightUnit() + Languages.ReturnString("Of.Food");
            appends++;
        }
        if (Dollars != 0)
        {
            res += Dollars + " " + Languages.ReturnString("Dollars") + ". ";
            appends++;
        }
        if (PortReputation != 0)
        {
            res += Languages.ReturnString("Port.Reputation.Least") + PortReputation + ". ";
            appends++;
        }
        if (PirateThreat != 0)
        {
            res += Languages.ReturnString("Pirate.Threat.Less") + PirateThreat + ". ";
            appends++;
        }

        if (ProductRequired != null)
        {
            for (int i = 0; i < ProductRequired.Count; i++)
            {
                res += ProductRequired[i].Product + " " + Unit.WeightConverted(ProductRequired[i].Amount)
                       + " " + Unit.WeightUnit() + ". ";
                appends++;
            }
        }

        if (PriorBuilds != null)
        {
            for (int i = 0; i < PriorBuilds.Count; i++)
            {
                res += Languages.ReturnString(".At least 1: ") + PriorBuilds[i] + ". ";
                appends++;
            }
        }

        res = BuildingDescriptionMenu.CheckIfAppend3(ref appends, res, 1);

        InfoMsg = res;
    }
Exemplo n.º 3
0
 private string MaterialsGathered()
 {
     return(BuildingDescriptionMenu.CostOfABuilding(Building.HType, 1));
 }