Example #1
0
        /// <summary>
        /// Populates the NeedGroupUIs with all the needed elements
        /// </summary>
        public void DisplayObjects()
        {
            if (lastShownMapElement != selectedMapElement)
            {
                lastShownMapElement = selectedMapElement;

                List <PropertyOwnership> needs = selectedMapElement.propertyManager.GetPropertiesWithPriority(Property.NeedPriority.None);

                if (needs == null)
                {
                    return;
                }

                Debug.Log($"Setting up UI for group of needs (Properties) with length {needs.Count}:\n    ● {needs.ToStringAllElements("\n    ● ")}\n", gameObject);

                // Instantiate missing UI elements
                int missingUIElements = needs.Count - propertyUIs.Count;
                for (int e = 0; e < missingUIElements; e++)
                {
                    GameObject spawnedPropertyUI = Instantiate(propertyUIPrefab, propertiesArea.transform);
                    PropertyUI propertyUI        = spawnedPropertyUI.GetComponentRequired <PropertyUI>();
                    propertyUIs.Add(propertyUI);
                }

                // Configure the UI elements
                for (int e = 0; e < propertyUIs.Count; e++)
                {
                    PropertyOwnership propertyOwnershipToDisplay = needs.Count > e ? needs[e] : null;
                    propertyUIs[e].Setup(propertyOwnershipToDisplay);
                }
            }
        }
Example #2
0
        /// <summary>
        /// 生成扩展表单HTML
        /// </summary>
        /// <param name="sb"></param>
        /// <param name="field"></param>
        /// <param name="attrValue"></param>
        private void AppendExtendFormHtml(StringBuilder sb, IExtendField field, string attrValue)
        {
            PropertyUI uiType = (PropertyUI)int.Parse(field.Type);

            sb.Append("<dl><dt>").Append(field.Name).Append(":</dt><dd>");


            switch (uiType)
            {
            case PropertyUI.Text:
                sb.Append("<input type=\"text\" class=\"w300 ui-box\" field=\"extend_").Append(field.GetDomainId().ToString())
                .Append("\" value=\"").Append(attrValue).Append("\"/>");
                break;

            case PropertyUI.MultLine:
                sb.Append("<textarea class=\"w300 ui-box\" field=\"extend_").Append(field.GetDomainId().ToString())
                .Append("\">").Append(attrValue).Append("</textarea>");
                break;

            case PropertyUI.Integer:
                sb.Append("<input type=\"text\" class=\"w300 ui-box ui-validate\" isnum=\"true\" field=\"extend_")
                .Append(field.GetDomainId().ToString()).Append("\" value=\"").Append(attrValue).Append("\"/>");
                break;

            case PropertyUI.Upload:
                // sb.Append("<input type=\"text\" disabled=\"disabled\" class=\"tb_normal\" id=\"extend_").Append(field.ID.ToString())
                sb.Append("<input type=\"text\" class=\"w300 ui-box upload_value\" id=\"extend_")
                .Append(field.GetDomainId().ToString())
                .Append("\" field=\"extend_").Append(field.GetDomainId().ToString())
                .Append("\" value=\"").Append(attrValue).Append("\"/>&nbsp;&nbsp;<span class=\"ui-button w80 middle-button\" id=\"upload_")
                .Append(field.GetDomainId().ToString()).Append("\"><span class=\" button-inner\"><span class=\"button-txt\">选择文件</span>")
                .Append("<a href=\"javascript:;\"></a></span></span>")
                .Append("<script type=\"text/javascript\">jr.propertyUpload(")
                .Append("'upload_").Append(field.GetDomainId().ToString()).Append("','extend_")
                .Append(field.GetDomainId().ToString())
                .Append("');</script>");
                break;
            }
            sb.Append("</dd></dl>");
        }
Example #3
0
		public string BuildUIString(PropertyUI ui,string key,params string[] data)
		{
			return "";
		}
Example #4
0
    // Start is called before the first frame update
    void Start()
    {
        // Get an instance of the propUI object and set it to false ( we ain't using it yet ).
        propUI = GameObject.FindObjectOfType <PropertyUI>();
        propUI.gameObject.SetActive(false);

        // Get an instance of the buyRail object and set it to false ( we ain't using it yet ).
        buyRail = GameObject.FindObjectOfType <BuyRailRoadUI>();
        buyRail.gameObject.SetActive(false);

        // Get an instance of the railOwnedUI object and set it to false.
        railOwned = GameObject.FindObjectOfType <RailOwnedUI>();
        railOwned.gameObject.SetActive(false);

        // Get an instance of the ChanceCardUI object and set it to false.
        chanceCardUI = GameObject.FindObjectOfType <ChanceCardUI>();
        chanceCardUI.gameObject.SetActive(false);

        // Get an instance of the CommunityChestUI object and set it to false.
        commUI = GameObject.FindObjectOfType <CommunityChestUI>();
        commUI.gameObject.SetActive(false);

        // Get instance of property monopoly UI.
        propMonop = GameObject.FindObjectOfType <PropertyOwnMonopoly>();
        propMonop.gameObject.SetActive(false);

        // Get instance of property owned UI.
        propOwnedUi = GameObject.FindObjectOfType <PropertyOwnedUI>();
        propOwnedUi.gameObject.SetActive(false);

        // Get instance of pass go UI.
        passGoUi = GameObject.FindObjectOfType <PassGoUI>();
        passGoUi.gameObject.SetActive(false);

        // Get instance of TaxUI.
        taxUI = GameObject.FindObjectOfType <TaxUI>();
        taxUI.gameObject.SetActive(false);

        // Get instance of UtilUI.
        utilUI = GameObject.FindObjectOfType <UtilityUI>();
        utilUI.gameObject.SetActive(false);

        // Get instance of jailLandedUI.
        jailLanded = GameObject.FindObjectOfType <JailLandedUI>();
        jailLanded.gameObject.SetActive(false);

        // Get instance of GoToJailUI.
        goToJailUI = GameObject.FindObjectOfType <GoToJailUI>();
        goToJailUI.gameObject.SetActive(false);

        // Get instance of InJailUI
        inJailUI = GameObject.FindObjectOfType <InJailUI>();
        inJailUI.gameObject.SetActive(false);

        // Get instance of InJailUI
        doubleRollUI = GameObject.FindObjectOfType <DoubleRollUI>();
        doubleRollUI.gameObject.SetActive(false);

        menu = GameObject.FindObjectOfType <PauseMenu>();
        menu.gameObject.SetActive(false);

        // Get an instance of the ownership class.
        owner = GameObject.FindObjectOfType <Ownership>();

        // Check the players money.
        CheckPlayerMoney();
        Debug.Log("Current player is: " + (CurrentPlayerID + 1));
    }
Example #5
0
 public string BuildUIString(PropertyUI ui, string key, params string[] data)
 {
     return("");
 }