Exemple #1
0
        public Console()
            : base("Debug console", config.consoleRect, skin)
        {
            onDraw = DrawWindow;
            onException = HandleException;
            onUnityDestroy = HandleDestroy;

            headerArea = new GUIArea(this);
            consoleArea = new GUIArea(this);
            commandLineArea = new GUIArea(this);

            RecalculateAreas();

            vanillaPanel = UIView.library.Get<DebugOutputPanel>("DebugOutputPanel");
            oldVanillaPanelParent = vanillaPanel.transform.parent;
            vanillaPanel.transform.parent = transform;

            onUnityGUI = () => KeyboardCallback();
        }
Exemple #2
0
 public static void PrintError(string message)
 {
     DebugOutputPanel.AddMessage(PluginManager.MessageType.Error, prefix + message);
 }
Exemple #3
0
 public void NotifyPlayer(string message)
 {
     DebugOutputPanel.AddMessage(PluginManager.MessageType.Message, String.Format("{0}: {1}", Settings.Instance.Tag, message));
     Log(message);
 }
Exemple #4
0
        public static void Message(string format, params object[] args)
        {
#if DEBUG
            DebugOutputPanel.AddMessage(ColossalFramework.Plugins.PluginManager.MessageType.Message, "DeveloperUI Mod: " + string.Format(format, args));
#endif
        }
 /// <summary>
 /// Logs to the default output panel of the game.
 /// </summary>
 /// <param name="messageType">The message type to use.</param>
 /// <param name="message">The log message.</param>
 protected virtual void LogOP(PluginManager.MessageType messageType, string message)
 {
     DebugOutputPanel.AddMessage(messageType, string.Format("{0} {1}", this.Prefix, message));
 }
 void Update()
 {
     if (vanillaPanel == null)
     {
         var panel = UIView.library.Get<DebugOutputPanel>("DebugOutputPanel");
         if (panel == null)
         {
             return;
         }
         vanillaPanel = panel;
         oldVanillaPanelParent = vanillaPanel.transform.parent;
         vanillaPanel.transform.parent = transform;
     }
 }
Exemple #7
0
 public static void Warning(string message)
 {
     Debug.LogWarning(modPrefix + message);
     DebugOutputPanel.AddMessage(PluginManager.MessageType.Warning, modPrefix + message);
 }
Exemple #8
0
 public static void LogWarning(string msg)
 {
     DebugOutputPanel.AddMessage(PluginManager.MessageType.Warning, msg);
 }
 public override void OnCreated(ILoading loading)
 {
     base.OnCreated(loading);
     DebugOutputPanel.AddMessage(PluginManager.MessageType.Message, "LoadingExtension.OnCreated");
 }
Exemple #10
0
 public static void DebugLog(String p_message)
 {
     DebugOutputPanel.AddMessage(ColossalFramework.Plugins.PluginManager.MessageType.Message, "[OverLayer] " + p_message);
 }
        public void OnNewMessage(IChirperMessage message)
        {
            if (message != null && theBannerPanel != null)
            {
                try
                {
                    string citizenMessageID = string.Empty;

                    CitizenMessage cm = message as CitizenMessage;
                    if (cm != null)
                    {
                        //DebugOutputPanel.AddMessage(ColossalFramework.Plugins.PluginManager.MessageType.Message, string.Format("found citmess MessageID: {0} GetText: {1}", cm.m_messageID, cm.GetText()));
                        citizenMessageID = cm.m_messageID;
                    }

                    if (!string.IsNullOrEmpty(citizenMessageID))
                    {
                        // Integrate with ChirpFilter
                        if (ChirpFilter_FilterModule == null)
                        {
                            GameObject ChirpFilter_GameObject = GameObject.Find("ChirperFilterModule");

                            if (ChirpFilter_GameObject != null)
                            {
                                ChirpFilter_FilterModule = ChirpFilter_GameObject.GetComponent("ChirpFilter.FilterModule");
                            }
                        }

                        if (ChirpFilter_FilterModule != null)
                        {
                            bool bIsBlacklisted = false;

                            if (ChirpFilter_FilterModule is IFormattable)
                            {
                                IFormattable ifs = ChirpFilter_FilterModule as IFormattable;


                                string sresult = ifs.ToString(citizenMessageID, null);

                                if (string.IsNullOrEmpty(sresult) || sresult == "false")
                                {
                                    bIsBlacklisted = false;
                                }
                                else if (sresult == "true")
                                {
                                    bIsBlacklisted = true;
                                }
                            }

                            // see if ChirpFilter wants us to filter (not show) the message
                            if (bIsBlacklisted)
                            {
                                //DebugOutputPanel.AddMessage(ColossalFramework.Plugins.PluginManager.MessageType.Message, string.Format("msgid {0} msg {1} blacklisted", citizenMessageID, message.text));
                                return;
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    DebugOutputPanel.AddMessage(ColossalFramework.Plugins.PluginManager.MessageType.Message, string.Format("ChirpBanner.OnNewMessage threw Exception: {0}", ex.Message));
                }

                // use rich styled text
                // Colossal markup uses sliiiiiightly different tags than unity.
                // munge our config strings to fit
                string nameColorTag = CurrentConfig.NameColor;
                string textColorTag = CurrentConfig.MessageColor;

                if (nameColorTag.Length == 9)                    // ie: #001122FF
                {
                    nameColorTag = nameColorTag.Substring(0, 7); // drop alpha bits
                }

                if (textColorTag.Length == 9)                    // ie: #001122FF
                {
                    textColorTag = textColorTag.Substring(0, 7); // drop alpha bits
                }

                //DebugOutputPanel.AddMessage(ColossalFramework.Plugins.PluginManager.MessageType.Message, string.Format("chirp! {0}", message.text));

                string str = String.Format("<color{0}>{1}</color> : <color{2}>{3}</color>", nameColorTag, message.senderName, textColorTag, message.text);
                theBannerPanel.CreateBannerLabel(str, message.senderID);
            }
        }
 void Start()
 {
     DebugOutputPanel.AddMessage(PluginManager.MessageType.Message, "IT WORKS!!! SOO COOL");
 }
Exemple #13
0
        public static void UpdateSlopes(bool maybeDuringGame)
        {
            ulong incompatibleModID = getOtherActiveSlopeModID();

            if (incompatibleModID > 0)
            {
                DebugOutputPanel.AddMessage(PluginManager.MessageType.Message, "[" + incompatibleMods[incompatibleModID] + "] mod detected. >>>>> \"Maximum slope\" option is disabled.");
                return;
            }

            DifficultyManager d = Singleton <DifficultyManager> .instance;

            if (maybeDuringGame)
            {
                if (d.MaxSlope.Value == MaxSlope_old)
                {
                    return;
                }
            }
            else
            {
                if (d.MaxSlope.Value == 25)
                {
                    return;
                }
            }

            try
            {
                float newMaxSlope;
                float multiplier = d.MaxSlope.Value / 25f;

                DebugOutputPanel.AddMessage(PluginManager.MessageType.Message, "Difficulty tuning mod: changing road slopes...");

                foreach (NetCollection nc in UnityEngine.Object.FindObjectsOfType <NetCollection>())
                {
                    foreach (NetInfo ni in nc.m_prefabs)
                    {
                        string className = ni.m_class.name;

                        if (className.IndexOf("Road", StringComparison.OrdinalIgnoreCase) >= 0 ||
                            className.IndexOf("Highway", StringComparison.OrdinalIgnoreCase) >= 0 ||
                            className.IndexOf("Track", StringComparison.OrdinalIgnoreCase) >= 0
                            )
                        {
                            if (!maxSlopeOriginal.ContainsKey(ni.name))
                            {
                                maxSlopeOriginal.Add(ni.name, ni.m_maxSlope);
                            }

                            newMaxSlope = maxSlopeOriginal[ni.name] * multiplier;
                            Helper.ValueChangedMessage(ni.name + " (" + className + ")", "maximum slope", maxSlopeOriginal[ni.name], newMaxSlope);
                            ni.m_maxSlope = newMaxSlope;
                        }
                    }
                }

                MaxSlope_old = d.MaxSlope.Value;
            }
            catch (Exception ex)
            {
                DebugOutputPanel.AddMessage(PluginManager.MessageType.Message, ex.Message);
            }
        }
Exemple #14
0
 public static void Warning(string warning)
 {
     DebugOutputPanel.AddMessage(ColossalFramework.Plugins.PluginManager.MessageType.Warning, "[EPT] " + warning);
 }
Exemple #15
0
 public static void Message(string message)
 {
     Log(message);
     DebugOutputPanel.AddMessage(PluginManager.MessageType.Message, modPrefix + message);
 }
        public static void Generic(PluginManager.MessageType messageType, string text)
        {
            var msg = string.Format("[{0}] {1}", Prefix, text);

            DebugOutputPanel.AddMessage(messageType, msg);
        }
Exemple #17
0
 public static void Error(string error)
 {
     DebugOutputPanel.AddMessage(ColossalFramework.Plugins.PluginManager.MessageType.Error, "[EPT] " + error);
 }
Exemple #18
0
        public override void OnLevelLoaded(LoadMode mode)
        {
            LastSaveUsedPacking = false;
            if (OptionsWrapper <Configuration> .Options.IsLoggingEnabled() == true)
            {
                Logger.dbgLog("Map LoadMode:" + mode.ToString() + "  " + DateTime.Now.ToString(Mod.DTMilli));
            }
            try
            {
                if (Mod.IsEnabled == true & Mod.IsSetupActive == false)
                {
                    //should rarely, if ever, reach here as should be taken care of in onCreated().
                    // if we ran tried to run setup here we could but our Array was not expanded
                    // during the load deserialize process that came before us. Hence an attempt to save will produce
                    // a problem during custom serialze save as it'll exception error cause the buffer wasn't expanded.
                    // Will maybe enhance custom_serialzer to check for bigger buffer first,
                    // though let's avoid that problem entirely here.

                    if (mode != LoadMode.LoadAsset & mode != LoadMode.NewAsset)  //fire only on non Assett modes, we don't want it to get setup on assett mode anyway.
                    {
                        if (OptionsWrapper <Configuration> .Options.IsLoggingEnabled() == true)
                        {
                            Logger.dbgLog(" AssetModeNotDetcted");
                        }
                        string strmsg = "[TreeUnlimiter:OnLevelLoaded]  *** Enabled but not setup yet, why did this happen??\n" +
                                        "Did OnCreated() not fire?? did redirections exception error?\n If you see this please contact author or make sure other mods did not cause a critical errors prior to this one during the load process." +
                                        "\n We are now going to disable this mod from running during this map load attempt.";
                        Logger.dbgLog(strmsg);
                        DebugOutputPanel.AddMessage(PluginManager.MessageType.Warning, strmsg);
                        //1.2.0f3_Build007 above noted Bug - Mod.Setup();
                    }
                }

                if (Mod.IsEnabled == true & Mod.IsSetupActive == true)
                {
                    if (OptionsWrapper <Configuration> .Options.IsLoggingEnabled() == true)
                    {
                        Logger.dbgLog("Enabled and setup already.(expected)");
                    }

                    if (mode == LoadMode.LoadAsset || mode == LoadMode.NewAsset)
                    {
                        //if we are asseteditor then revert the redirects, and reset the treemanager data.
                        if (OptionsWrapper <Configuration> .Options.IsLoggingEnabled() == true)
                        {
                            Logger.dbgLog("AssetModeDetcted, removing redirects and resetting treemanager");
                        }

                        //1.6.0 commented out these 2 lines
                        //ResetTreeMananger(Mod.DEFAULT_TREE_COUNT, Mod.DEFAULT_TREEUPDATE_COUNT, true);
                        //Mod.ReveseSetup();

                        if (mode == LoadMode.NewAsset & (Singleton <TreeManager> .instance.m_treeCount < 0))
                        {
                            if (OptionsWrapper <Configuration> .Options.IsLoggingEnabled())
                            {
                                Logger.dbgLog("AssetModeDetcted, Treecount is less < then 0 !");
                            }
                            ;
                            //{ Singleton<TreeManager>.instance.m_treeCount = 0; }
                        }
                    }

                    if (mode == LoadMode.NewMap || mode == LoadMode.LoadMap || mode == LoadMode.NewGame || mode == LoadMode.LoadMap || mode == LoadMode.NewGameFromScenario || mode == LoadMode.NewScenarioFromGame || mode == LoadMode.NewScenarioFromMap)
                    {
                        //total hack to address wierd behavior of -1 m_treecount and 0 itemcount
                        // this hack attempts to jimmy things up the way things appear without the mod loaded in the map editor.
                        // somehow the defaulting of 1 'blank' item doesn't get set correctly when using redirected functions.
                        // really would still like to remove this hack and find actual cause.
                        //                    uint inum;
                        if (Singleton <TreeManager> .instance.m_trees.ItemCount() == 0 & Singleton <TreeManager> .instance.m_treeCount == -1)
                        {
                            if (OptionsWrapper <Configuration> .Options.IsLoggingEnabled() == true)
                            {
                                Logger.dbgLog(" New or LoadMap Detected & itemcount==0 treecount == -1");
                            }
                            //removed for 1 vs 0 fix in Deserialize routine that was causing hack problem.
                            //                        if (Singleton<TreeManager>.instance.m_trees.CreateItem(out inum))
                            //                        {
                            //                            if (OptionsWrapper<Configuration>.Options.IsLoggingEnabled() == true) { Debug.Log("[TreeUnlimiter:OnLevelLoaded]  New or Loadmap Detected - Added padding, createditem# " + inum.ToString()); }
                            //                            Singleton<TreeManager>.instance.m_treeCount = (int)(Singleton<TreeManager>.instance.m_trees.ItemCount() - 1u);
                            //                            if (OptionsWrapper<Configuration>.Options.IsLoggingEnabled() == true) { Debug.Log("[TreeUnlimiter:OnLevelLoaded]  New or Loadmap Detected - treecount updated: " + Singleton<TreeManager>.instance.m_treeCount.ToString()); }
                            //                        }
                        }
                    }
                }

                if (OptionsWrapper <Configuration> .Options.IsLoggingEnabled() == true)  //Debugging crap for the above stated hack.
                {
                    if (Singleton <SimulationManager> .instance.m_metaData != null)
                    {
                        Logger.dbgLog(String.Format("Mapname: {0}  Cityname: {1}", Singleton <SimulationManager> .instance.m_metaData.m_MapName, Singleton <SimulationManager> .instance.m_metaData.m_CityName));
                    }
                    TreeManager TreeMgr        = Singleton <TreeManager> .instance;
                    int         mtreecountr    = TreeMgr.m_treeCount;
                    uint        mtreebuffsize  = TreeMgr.m_trees.m_size;
                    int         mtreebuffleg   = TreeMgr.m_trees.m_buffer.Length;
                    uint        mtreebuffcount = TreeMgr.m_trees.ItemCount();
                    int         mupdtreenum    = TreeMgr.m_updatedTrees.Length;
                    int         mburntreenum   = TreeMgr.m_burningTrees.m_size;
                    Logger.dbgLog("Debugging-TreeManager: treecount=" + mtreecountr.ToString() + " msize=" + mtreebuffsize.ToString() + " mbuffleg=" + mtreebuffleg.ToString() + " buffitemcount=" + mtreebuffcount.ToString() + " UpdatedTreesSize=" + mupdtreenum.ToString() + " burntrees=" + mburntreenum.ToString() + "\r\n");
                    //Debug.Log("[TreeUnlimiter:OnLevelLoaded]  Done. ModStatus: " + Mod.IsEnabled.ToString() + "    RedirectStatus: " + Mod.IsSetupActive.ToString());
                }
            }

            catch (Exception ex)
            {
                Logger.dbgLog("Onlevelload Exception:", ex, true);
            }
            base.OnLevelLoaded(mode);
        }
        public void OnNewMessage(IChirperMessage message)
        {
            bool important = false;

            if (message != null && theBannerPanel != null)
            {
                try {
                    string citizenMessageID = string.Empty;

                    CitizenMessage cm = message as CitizenMessage;
                    if (cm != null)
                    {
                        //DebugOutputPanel.AddMessage(ColossalFramework.Plugins.PluginManager.MessageType.Message, string.Format("found citmess MessageID: {0} GetText: {1}", cm.m_messageID, cm.GetText()));
                        citizenMessageID = cm.m_messageID;
                    }

                    if (!string.IsNullOrEmpty(citizenMessageID))
                    {
                        // TODO: Do stuff if the Chirper message is actually important.
                        // Hope is to mimic SimCity's ticker.
                        // List of LocaleIDs available here: https://github.com/cities-skylines/Assembly-CSharp/wiki/LocaleID
                        important = FilterMessage(cm.m_messageID);
                    }
                } catch (Exception ex) {
                    DebugOutputPanel.AddMessage(ColossalFramework.Plugins.PluginManager.MessageType.Message, string.Format("ChirpBanner.OnNewMessage threw Exception: {0}", ex.Message));
                }

                // use rich styled text
                // Colossal markup uses sliiiiiightly different tags than unity.
                // munge our config strings to fit
                string nameColorTag = MyConfig.ConfigHolder.Config.NameColor;
                string textColorTag = MyConfig.ConfigHolder.Config.MessageColor;

                if (nameColorTag.Length == 9)                    // ie: #001122FF
                {
                    nameColorTag = nameColorTag.Substring(0, 7); // drop alpha bits
                }

                if (textColorTag.Length == 9)                    // ie: #001122FF
                {
                    textColorTag = textColorTag.Substring(0, 7); // drop alpha bits
                }

                // Check for CurrentConfig.ColorChirps
                if (MyConfig.ConfigHolder.Config.ColorChirps)
                {
                    // If chirp is important, and ColorChirps is enabled, make the chirp name and message red.
                    if (important)
                    {
                        //DebugOutputPanel.AddMessage (ColossalFramework.Plugins.PluginManager.MessageType.Message, string.Format ("Chirp is important: {0}", message.text));
                        //DebugOutputPanel.AddMessage (ColossalFramework.Plugins.PluginManager.MessageType.Message, string.Format ("CurrentConfig.NameColor: {0}", CurrentConfig.NameColor));
                        //DebugOutputPanel.AddMessage (ColossalFramework.Plugins.PluginManager.MessageType.Message, string.Format ("CurrentConfig.MessageColor: {0}", CurrentConfig.MessageColor));
                        textColorTag = "#FF0000";
                        nameColorTag = "#FF0000";
                    }
                }

                string str = String.Format("<color{0}>{1}</color> : <color{2}>{3}</color>", nameColorTag, message.senderName, textColorTag, message.text);

                // Check for CurrentConfig.FilterChirps
                if (MyConfig.ConfigHolder.Config.FilterChirps)
                {
                    // If Chirp is deemed not important as a result of above LocaleIDs, just return, do nothing
                    if (!important)
                    {
                        //DebugOutputPanel.AddMessage (ColossalFramework.Plugins.PluginManager.MessageType.Message, string.Format ("Chirp is not important: {0}", message.text));
                        return;
                    }
                    // Otherwise, do something
                    if (important)
                    {
                        //DebugOutputPanel.AddMessage (ColossalFramework.Plugins.PluginManager.MessageType.Message, string.Format ("Chirp is important: {0}", message.text));

                        //theBannerPanel.CreateBannerLabel (str, message.senderID);
                        ChirpMoverThread.addTask2Main(() => { theBannerPanel.CreateBannerLabel(str, message.senderID); });
                    }
                }
                else
                {
                    //theBannerPanel.CreateBannerLabel (str, message.senderID);
                    ChirpMoverThread.addTask2Main(() => { theBannerPanel.CreateBannerLabel(str, message.senderID); });
                }

                //DebugOutputPanel.AddMessage (ColossalFramework.Plugins.PluginManager.MessageType.Message, string.Format ("textColorTag: {0}", textColorTag));
                //DebugOutputPanel.AddMessage (ColossalFramework.Plugins.PluginManager.MessageType.Message, string.Format ("nameColorTag: {0}", nameColorTag));
                //DebugOutputPanel.AddMessage(ColossalFramework.Plugins.PluginManager.MessageType.Message, string.Format("chirp! {0}", message.text));


                //MyIThreadingExtension.addTask2Main(() => { theBannerPanel.CreateBannerLabel(str, message.senderID); });
                //MyIThreadingExtension.addTask2Main(() => { DebugOutputPanel.AddMessage(ColossalFramework.Plugins.PluginManager.MessageType.Message, string.Format("chirp! {0}", message.text)); });
            }
        }
 // Write an error to the panel
 public static void panelError(string text)
 {
     DebugOutputPanel.AddMessage(PluginManager.MessageType.Error, "WG_HighRise: " + text);
 }
 void HandleDestroy()
 {
     vanillaPanel.transform.parent = oldVanillaPanelParent;
     vanillaPanel = null;
 }
 void HandleDestroy()
 {
     vanillaPanel.transform.parent = oldVanillaPanelParent;
     vanillaPanel = null;
 }
Exemple #23
0
 public static void message(string msg)
 {
     DebugOutputPanel.AddMessage(PluginManager.MessageType.Message, msg);
 }
 public static void Message(string s)
 {
     DebugOutputPanel.AddMessage(ColossalFramework.Plugins.PluginManager.MessageType.Message, s);
 }
Exemple #25
0
 public static void Error(string format, params object [] args)
 {
     DebugOutputPanel.AddMessage(ColossalFramework.Plugins.PluginManager.MessageType.Error, "DeveloperUI Mod: " + string.Format(format, args));
 }
Exemple #26
0
 public static void Log(PluginManager.MessageType type, string message)
 {
     DebugOutputPanel.AddMessage(type, $"[Tango] {message}");
 }
Exemple #27
0
 // Write an error to the panel
 public static void panelError(string text)
 {
     DebugOutputPanel.AddMessage(PluginManager.MessageType.Error, "WG_RealisticCity: " + text);
 }
 public static void LogWarning(string msg)
 {
     DebugOutputPanel.AddMessage(PluginManager.MessageType.Warning, msg);
     _logFile.WriteLine("Warning: " + msg);
 }
 public static void Message(String message)
 {
     DebugOutputPanel.AddMessage(PluginManager.MessageType.Message, message);
 }
 public static void LogError(string msg)
 {
     DebugOutputPanel.AddMessage(PluginManager.MessageType.Error, msg);
     _logFile.WriteLine("Error: " + msg);
 }
Exemple #31
0
 public static void PrintWarning(string message)
 {
     DebugOutputPanel.AddMessage(PluginManager.MessageType.Warning, prefix + message);
 }
Exemple #32
0
        //these overrides are not necessary, but obviously helpful
        //this seems to be called initially
        public override void Start()
        {
            //this makes the panel "visible", I don't know what sprites are available, but found this value to work
            this.backgroundSprite = "GenericPanel";
            this.color            = new Color32(0, 0, 255, 100);
            this.width            = 100;
            this.height           = 200;

            uint totalOre, totalOil, totalForest, totalFertility, totalWater;
            uint unlockableOre, unlockableOil, unlockableForest, unlockableFertility, unlockableWater;
            uint unlockedOre, unlockedOil, unlockedForest, unlockedFertility, unlockedWater;
            uint usedOre, usedOil, usedForest, usedFertility;

            DebugOutputPanel.AddMessage(PluginManager.MessageType.Message, "hatters");
            NaturalResourceManager.instance.CalculateTotalResources(out totalOre, out totalOil, out totalForest, out totalFertility, out totalWater);
            NaturalResourceManager.instance.CalculateUnlockableResources(out unlockableOre, out unlockableOil, out unlockableForest, out unlockableFertility, out unlockableWater);
            NaturalResourceManager.instance.CalculateUnlockedResources(out unlockedOre, out unlockedOil, out unlockedForest, out unlockedFertility, out unlockedWater);
            NaturalResourceManager.instance.CalculateUsedResources(out usedOre, out usedOil, out usedForest, out usedFertility);

            DebugOutputPanel.AddMessage(PluginManager.MessageType.Message, "mad hatters");
            DebugOutputPanel.AddMessage(PluginManager.MessageType.Message, "total:" + " " + totalOre + " " + totalOil + " " + totalForest + " " + totalFertility + " " + totalWater);
            DebugOutputPanel.AddMessage(PluginManager.MessageType.Message, "unlockable:" + " " + unlockableOre + " " + unlockableOil + " " + unlockableForest + " " + unlockableFertility + " " + unlockableWater);
            DebugOutputPanel.AddMessage(PluginManager.MessageType.Message, "unlocked:" + " " + unlockedOre + " " + unlockedOil + " " + unlockedForest + " " + unlockedFertility + " " + unlockedWater);
            DebugOutputPanel.AddMessage(PluginManager.MessageType.Message, "used:" + " " + usedOre + " " + usedOil + " " + usedForest + " " + usedFertility);
            DebugOutputPanel.AddMessage(PluginManager.MessageType.Message, "areaResource: " + NaturalResourceManager.instance.m_areaResources.Length + " naturalResource" + NaturalResourceManager.instance.m_naturalResources.Length);

            for (int i = 0; i < NaturalResourceManager.instance.m_areaResources.Length; i++)
            {
                DebugOutputPanel.AddMessage(PluginManager.MessageType.Message, "" + i + ": " +
                                            NaturalResourceManager.instance.m_areaResources[i].m_finalOre + ": " +
                                            NaturalResourceManager.instance.m_areaResources[i].m_finalOil + ": " +
                                            NaturalResourceManager.instance.m_areaResources[i].m_finalForest + ": " +
                                            NaturalResourceManager.instance.m_areaResources[i].m_finalFertility + ": " +
                                            NaturalResourceManager.instance.m_areaResources[i].m_tempOre + ": " +
                                            NaturalResourceManager.instance.m_areaResources[i].m_tempOre + ": " +
                                            NaturalResourceManager.instance.m_areaResources[i].m_tempForest + ": " +
                                            NaturalResourceManager.instance.m_areaResources[i].m_tempFertility);
            }



            using (StreamWriter w = File.AppendText(("D:\\Workspace\\Cities\\test.txt")))
            {
                /*for (int i = 0; i < NaturalResourceManager.instance.m_naturalResources.Length; i++)
                 * {
                 *  var item = NaturalResourceManager.instance.m_naturalResources[i];
                 *
                 *  //m_fertility
                 *  //m_forest;
                 *  //m_modified;
                 *  //m_oil;
                 *  //m_ore;
                 *  //m_pollution;
                 *  //m_sand;
                 *  //m_tree;
                 *  //m_water;
                 *  w.WriteLine("natural resource:" + item.m_fertility + ">");
                 * }*/

                for (int i = 0; i < DistrictManager.instance.m_districtGrid.Length; i++)
                {
                    DistrictManager.Cell cell = DistrictManager.instance.m_districtGrid[i];
                    w.WriteLine("district:"
                                + ">" + cell.m_alpha1
                                + ">" + cell.m_alpha2
                                + ">" + cell.m_alpha3
                                + ">" + cell.m_alpha4
                                + ">" + cell.m_district1
                                + ">" + cell.m_district2
                                + ">" + cell.m_district3
                                + ">" + cell.m_district4
                                );
                }
            }

            UILabel x = this.AddUIComponent <UILabel>();
            UILabel y = this.AddUIComponent <UILabel>();
            UILabel z = this.AddUIComponent <UILabel>();

/*
 *          x.text = "X";
 *          y.text = "Y";
 *          z.text = "Z";
 *          x.position = new Vector3(10, 100);
 *          y.position = new Vector3(10, 80);
 *          z.position = new Vector3(10, 60);
 */



            /*for (int i = 0; i < districtCount; i++)
             * {
             *  labelList[i] = this.AddUIComponent<UILabel>();
             *  labelList[i].text = DistrictManager.instance.GetDistrictName(i);
             * }
             *
             * UIListBox districtList = this.AddUIComponent<UIListBox>();
             * districtList.Enable();
             * districtList.size = new Vector2(80, 80);
             * districtList.color = new Color32(255, 0, 0, 100);
             * districtList.animateHover = true;
             * districtList.itemHeight = 10;
             * districtList.itemHighlight = "penis";
             * districtList.itemHover = "poonani";
             * districtList.itemPadding = new RectOffset(1, 2, 3, 4);
             * districtList.itemTextColor = new Color32(255, 255, 255, 100);
             * districtList.listPadding = new RectOffset(1, 2, 3, 4);
             * districtList.scrollbar = new UIScrollbar();
             * districtList.scrollPosition = 0;
             * districtList.selectedIndex = 1;
             *
             *
             *
             *
             * districtList.items[0] = "Hello";
             * districtList.items[1] = "Caca";
             */

            //x.text = DistrictManager.instance.GetDistrictName(1);
        }
Exemple #33
0
		private void CreatePanels()
		{
			quickSearchPanel = new QuickSearchPanel();
			informationPanel = new InformationPanel();
			outputPanel = new DebugOutputPanel();
			callStackPanel = new CallStackPanel();
			logMessagePanel = new InformationPanel();
			localVariablesPanel = new ObjectsPanel();
			argumentsPanel = new ObjectsPanel();
			watchPanel = new ObjectsPanel();
			autoObjectsPanel = new ObjectsPanel();
			breakpointsPanel = new BreakpointsPanel();
			threadsPanel = new ThreadsPanel();
			modulesPanel = new ModulesPanel();
		}
 public override void OnReleased()
 {
     base.OnReleased();
     // instance = null;
     DebugOutputPanel.AddMessage(PluginManager.MessageType.Message, "on released");
 }