示例#1
0
        private string FormatMoney(long value)
        {
            UICurrencyWrapper uicw = new UICurrencyWrapper(long.MaxValue);

            uicw.Check(value * 100, Settings.moneyFormatNoCents);
            return(uicw.result);
        }
示例#2
0
        public void CheckUpdateUI(ushort buildingID)
        {
            if (m_currentSelectedBuildingID != buildingID)
            {
                return;
            }
            String buildinfo2 = Singleton <BuildingManager> .instance.GetBuildingName(m_currentSelectedBuildingID, default(InstanceID));

            //CODebug.Log(LogChannel.Modding, Mod.modName + " - CheckUpdateUI on building with id " + buildingID + " name  " + buildinfo2);

            int buildIndex = m_info.GetResilientBuildingIndex(m_currentSelectedBuildingID);

            if (buildIndex != -1)
            {
                BuildingInfo buildinfo = Singleton <BuildingManager> .instance.m_buildings.m_buffer[m_currentSelectedBuildingID].Info;
                switch (buildinfo.m_class.m_service)
                {
                case ItemClass.Service.Commercial:
                    m_statsLabel.text = Localization.trad.GetClientsAmount() + m_info.m_resilients [buildIndex].totalVisits;
                    break;

                case ItemClass.Service.Industrial:
                    bool extractor = buildinfo.m_buildingAI.GetType().Equals(typeof(IndustrialExtractorAI));

                    if (extractor)
                    {
                        //industryGoods.Check(m_info.m_resilients [buildIndex].goodsBuffer2, buildinfo.m_class.m_subService, true);
                        industryGoods2.Check(m_info.m_resilients [buildIndex].goodsBuffer3, buildinfo.m_class.m_subService, true);
                        m_statsLabel.text = Localization.trad.GetExtractedAmount() + industryGoods2.result;
                    }
                    else
                    {
                        //industryGoods.Check(m_info.m_resilients [buildIndex].goodsBuffer2, buildinfo.m_class.m_subService, false);
                        industryGoods2.Check(m_info.m_resilients [buildIndex].goodsBuffer4, buildinfo.m_class.m_subService, false);
                        m_statsLabel.text = Localization.trad.GetProducedAmount() + industryGoods2.result;
                    }
                    break;

                case ItemClass.Service.Office:
                    income.Check(m_info.m_resilients [buildIndex].totalIncome);
                    //CODebug.Log(LogChannel.Modding, Mod.modName + " - CheckUpdateUI office total income "+ income.result);
                    m_statsLabel.text = Localization.trad.GetAccumulatedIncome() + income.result;
                    break;
                }

                if (Singleton <BuildingManager> .instance.m_buildings.m_buffer[m_currentSelectedBuildingID].Info.m_class.m_service == ItemClass.Service.Residential)
                {
                    m_familiesHistoryLabel.text = m_info.GetFamiliesList(buildIndex);
                }
                else
                {
                    m_familiesHistoryLabel.text = m_info.GetWorkersHistoryList(buildIndex);
                }

                m_ageLabel.text = dateSpan(m_info.m_resilients [buildIndex].activatedDate, Singleton <SimulationManager> .instance.m_currentGameTime);
            }
        }