Ejemplo n.º 1
0
        private void EnableCreation()
        {
            head = locale["roomCreationTitle"];
            SmartRect[] rects = Helper.GetSmartRects(WindowPosition, 2);
            left  = rects[0];
            right = rects[1];

            serverName = "Food for titoons";
            serverTime = "83";
            password   = string.Empty;
            //mapSelection = 0;
            maps = new string[] {
                "The City", "The Forest", "The Forest II", "The Forest III", "The Forest IV  - LAVA", "Annie", "Annie II", "Colossal Titan", "Colossal Titan II",
                "Trost", "Trost II", "Racing - Akina", "Outside The Walls", "The City III", "Cave Fight", "House Fight", "Custom", "Custom (No PT)", //End RC maps
                //Custom maps, added in Anarchy or other mods
                "The City II", "The City IV", "The City V",
                //Anarchy maps
                "Custom-Anarchy (No PT)"
            };
            daylight      = 0;
            daylights     = locale.GetArray("dayLights");
            difficulity   = 0;
            difficulities = locale.GetArray("difficulities");
            maxPlayers    = "5";
            ServerPreset[] sets = ServerPreset.LoadPresets();
            presets = new List <ServerPreset>();
            if (sets != null)
            {
                foreach (ServerPreset set in sets)
                {
                    presets.Add(set);
                }
            }
            newPresetName = "Set " + (presets.Count + 1);
            if (sets.Length > 0)
            {
                newPresetName = sets[sets.Length - 1].Name;
            }
            presetArea                = new Rect(left.x, 0f, left.width, Style.Height * PresetsVisibleCount + Style.VerticalMargin * (PresetsVisibleCount - 1));
            presetView                = new Rect(0f, 0f, left.width, Style.Height * presets.Count + (Style.VerticalMargin * (presets.Count - 1)));
            presetRect                = new SmartRect(0f, 0f, left.width, Style.Height, 0f, Style.VerticalMargin);
            presetScroll              = Optimization.Caching.Vectors.v2zero;
            mapSelectionSetting       = new Configuration.IntSetting("tempMapSelectionSetting", 0);
            mapSelectionSetting.Value = 0;
        }
Ejemplo n.º 2
0
 private void DisableCreation()
 {
     left          = null;
     right         = null;
     maps          = null;
     difficulities = null;
     daylights     = null;
     serverName    = null;
     serverTime    = null;
     password      = null;
     maxPlayers    = null;
     if (presets != null && presets.Count > 0)
     {
         foreach (ServerPreset set in presets)
         {
             set.Save();
         }
     }
     presets             = null;
     newPresetName       = null;
     presetRect          = null;
     mapSelectionSetting = null;
 }