Exemplo n.º 1
0
        private void MiscModes()
        {
            left.Reset();
            GameModes.MaxWave.Draw(left, locale);
            left.MoveY();
            GameModes.EndlessRespawn.Draw(left, locale);
            left.MoveY();
            LabelCenter(left, locale["motd"], true);
            TextField(left, GameModes.Motd, string.Empty, 0f, true);

            right.Reset();
            GameModes.KickEren.Draw(right, locale);
            right.MoveY();
            GameModes.MinimapDisable.Draw(right, locale);
            right.MoveY();
            GameModes.NoGuest.Draw(right, locale);
            right.MoveY();
            GameModes.AntiRevive.Draw(right, locale);
            right.MoveY();
            GameModes.AllowHorses.Draw(right, locale);
            right.MoveY();
            GameModes.AfkKill.Draw(right, locale);
            right.MoveY();
            GameModes.InfiniteGasPvp.Draw(right, locale);
        }
Exemplo n.º 2
0
        private void DrawGeneralPage()
        {
            //Left
            left.Reset();
            LabelCenter(left, locale["game"], true);
            ToggleButton(left, Settings.InvertY, locale["inverty"], true);
            HorizontalSlider(left, Settings.MouseSensivity, locale.Format("sensivity", (Settings.MouseSensivity.Value * 100f).ToString("F0") + "%"), 0.01f, 1f, Style.LabelOffsetSlider, true);
            HorizontalSlider(left, Settings.CameraDistance, locale.Format("distance", Settings.CameraDistance.Value.ToString("F2")), Style.LabelOffsetSlider, true);

            ToggleButton(left, Settings.Minimap, locale["minimap"], true);
            ToggleButton(left, Settings.GameFeed, locale["gameFeed"], true);
            left.MoveY();
            LabelCenter(left, locale["audio"], true);
            HorizontalSlider(left, Settings.SoundLevel, locale.Format("overallAudio", (Settings.SoundLevel.Value * 100f).ToString("F0") + "%"), 0f, 1f, Style.LabelOffsetSlider, true);
            left.MoveY();
            LabelCenter(left, locale["snapshots"], true);
            ToggleButton(left, Settings.Snapshots, locale["snapshotsEnabled"], true);
            if (Settings.Snapshots.Value)
            {
                ToggleButton(left, Settings.SnapshotsInGame, Style.LabelSpace + locale["snapshotsShow"], true);
                TextField(left, Settings.SnapshotsDamage, Style.LabelSpace + locale["snapshotsDmg"], Style.BigLabelOffset, true);
            }

            //Right
            right.Reset();
            LabelCenter(right, locale["others"], true);
            ToggleButton(right, Settings.Speedometer, locale["speedometer"], true);
            if (Settings.Speedometer.Value)
            {
                SelectionGrid(right, Settings.SpeedometerType, locale.GetArray("speedometerTypes"), 2, true);
            }
        }
Exemplo n.º 3
0
 private void DrawEffectsPage()
 {
     left.Reset();
     LabelCenter(left, locale["effects"], true);
     ToggleButton(left, VideoSettings.WindEffect, locale["windEffect"], true);
     ToggleButton(left, VideoSettings.BladeTrails, locale["bladeTrails"], true);
     ToggleButton(left, VideoSettings.CameraTilt, locale["tilt"], true);
     ToggleButton(left, VideoSettings.Blur, locale["blur"], true);
 }
Exemplo n.º 4
0
 protected internal override void Draw()
 {
     Box(screenRect, string.Empty);
     rect.Reset();
     LabelCenter(rect, locale["loadingLbl"], true);
     LabelCenter(rect, locale.Format("loadingProgress", PhotonNetwork.player.CurrentLevel.Length.ToString(), PhotonNetwork.masterClient.CurrentLevel.Length.ToString()), true);
     if (Button(rect, locale["disconnect"], false))
     {
         if (IN_GAME_MAIN_CAMERA.GameType == GameType.MultiPlayer)
         {
             PhotonNetwork.Disconnect();
         }
         IN_GAME_MAIN_CAMERA.GameType      = GameType.Stop;
         FengGameManagerMKII.FGM.GameStart = false;
         UnityEngine.Object.Destroy(FengGameManagerMKII.FGM);
         Application.LoadLevel("menu");
         DisableImmediate();
     }
     if (PhotonNetwork.player.CurrentLevel.Length >= PhotonNetwork.masterClient.CurrentLevel.Length)
     {
         DisableImmediate();
         RC.CustomLevel.customLevelLoaded = true;
         RC.CustomLevel.SpawnPlayerCustomMap();
         GameLogic.RacingLogic log = FengGameManagerMKII.FGM.Logic as GameLogic.RacingLogic;
         if (log != null)
         {
             if (log.RaceStart)
             {
                 log.TryDestroyDoors();
             }
         }
     }
 }
Exemplo n.º 5
0
 protected internal override void Draw()
 {
     enabledPanel = CheckActivePanel();
     if (GUI.Button(profileRect, locale["profile"] + " <b>" + User.ProfileName + "</b>"))
     {
         CheckEnabled(AnarchyManager.ProfilePanel, new GUIBase[] { AnarchyManager.SinglePanel, AnarchyManager.ServerList, AnarchyManager.SettingsPanel });
     }
     rect.Reset();
     if (Button("single"))
     {
         CheckEnabled(AnarchyManager.SinglePanel, new GUIBase[] { AnarchyManager.ProfilePanel, AnarchyManager.ServerList, AnarchyManager.SettingsPanel });
     }
     if (Button("multi"))
     {
         CheckEnabled(AnarchyManager.ServerList, new GUIBase[] { AnarchyManager.ProfilePanel, AnarchyManager.SinglePanel, AnarchyManager.SettingsPanel });
     }
     if (Button("settings"))
     {
         CheckEnabled(AnarchyManager.SettingsPanel, new GUIBase[] { AnarchyManager.ProfilePanel, AnarchyManager.ServerList, AnarchyManager.SinglePanel });
     }
     if (Button("custom_characters"))
     {
         if (enabledPanel < 0)
         {
             Application.LoadLevel("characterCreation");
             return;
         }
     }
     if (Button("exit"))
     {
         Application.Quit();
     }
 }
Exemplo n.º 6
0
        protected override void DrawMainPart()
        {
            left.Reset();
            LabelCenter(left, locale["profileSel"], true);

            newProfile = TextField(left, newProfile, string.Empty, 0f, true);
            left.BeginHorizontal(2);
            if (Button(left, locale["btnAdd"], false))
            {
                if (User.AllProfiles.Length < MaxProfiles)
                {
                    User.LoadProfile(newProfile);
                    newProfile     = "Profile" + (User.AllProfiles.Length + 1);
                    currentProfile = FindCurrentProfile();
                }
                else
                {
                    //Put log
                }
            }
            left.MoveX();
            if (Button(left, locale["btnCopy"], true))
            {
                if (User.AllProfiles.Length < MaxProfiles)
                {
                    User.CopyProfile(newProfile, User.ProfileName);
                    User.LoadProfile(newProfile);
                    newProfile     = "Profile" + (User.AllProfiles.Length + 1);
                    currentProfile = FindCurrentProfile();
                }
                else
                {
                    //Put log
                }
            }
            left.ResetX();
            if (Button(left, locale["btnRemove"], true))
            {
                if (User.AllProfiles.Length > 1)
                {
                    User.DeleteProfile(User.ProfileName);
                    newProfile     = User.ProfileName;
                    currentProfile = FindCurrentProfile();
                }
                else
                {
                    //Put log
                }
            }

            Label(left, locale["note"], true);
            LabelCenter(left, locale["allProfiles"], true);
            currentProfile = SelectionGrid(left, currentProfile, User.AllProfiles, 1, true);
            CheckChange();
        }
Exemplo n.º 7
0
        private void AdvancedSettings()
        {
            right.Reset();
            LabelCenter(right, locale["advancedHead"], true);
            TextField(right, User.DieName, locale["diename"], Style.LabelOffset, true);
            TextField(right, User.RaceFinish, locale["raceFinish"], Style.LabelOffset, true);
            TextField(right, User.DieNameFormat, locale["dieStyle"], Style.LabelOffset, true);
            TextField(right, User.WaveFormat, locale["wave"], Style.LabelOffset, true);
            right.MoveY();
            LabelCenter(right, locale["chatSettings"], true);
            TextField(right, User.ChatFormat, locale["chatFormat"], Style.LabelOffset, true);
            TextField(right, User.ChatPmFormat, locale["chatPMFormat"], Style.LabelOffset, true);
            LabelCenter(right, locale["chatFormatSend"], true);
            TextField(right, User.ChatFormatSend, string.Empty, 0f, true);
            LabelCenter(right, locale["chatPMFormatSend"], true);
            TextField(right, User.ChatPmFormatSend, string.Empty, 0f, true);
            right.MoveY();
            LabelCenter(right, locale["others"], true);
            LabelCenter(right, locale["restart"], true);
            TextField(right, User.RestartMessage, string.Empty, 0f, true);
            LabelCenter(right, locale["mcswitch"], true);
            TextField(right, User.McSwitch, string.Empty, 0f, true);

            right.MoveToEndY(WindowPosition, Style.Height * 2f + Style.VerticalMargin);
            if (Button(right, locale["preview"], true))
            {
                pageSelection = PreviewPage;
                return;
            }
            right.BeginHorizontal(2);
            if (Button(right, locale["btnToMain"], false))
            {
                pageSelection = MainPage;
                return;
            }
            right.MoveX();
            if (Button(right, locale["btnBack"], false))
            {
                Disable();
                return;
            }
        }
Exemplo n.º 8
0
 private void CityPage()
 {
     left.Reset();
     SelectionGrid(left, SkinSettings.CitySkins, locale.GetArray("skinStateSelection"), 3, true);
     left.MoveY();
     DrawControlElements();
 }
Exemplo n.º 9
0
        protected internal override void Draw()
        {
            GUI.DrawTexture(urlRect, patreonIcon);
            Vector2 position = Event.current.mousePosition;

            if (urlRect.Contains(position))
            {
                GUI.Label(new Rect(position.x, position.y, 500f, 200f), locale["aottg2Message1"] + "\n" + locale["aottg2Message2"]);
            }
            if (UnityEngine.GUI.Button(urlRect, string.Empty, GUIStyle.none))
            {
                Application.OpenURL("https://www.patreon.com/aottg2");
            }
            enabledPanel = CheckActivePanel();
            if (GUI.Button(profileRect, locale["profile"] + " <b>" + User.ProfileName + "</b>"))
            {
                CheckEnabled(AnarchyManager.ProfilePanel, new GUIBase[] { AnarchyManager.SinglePanel, AnarchyManager.ServerList, AnarchyManager.SettingsPanel });
            }
            rect.Reset();
            if (Button("single"))
            {
                CheckEnabled(AnarchyManager.SinglePanel, new GUIBase[] { AnarchyManager.ProfilePanel, AnarchyManager.ServerList, AnarchyManager.SettingsPanel });
            }
            if (Button("multi"))
            {
                CheckEnabled(AnarchyManager.ServerList, new GUIBase[] { AnarchyManager.ProfilePanel, AnarchyManager.SinglePanel, AnarchyManager.SettingsPanel });
            }
            if (Button("settings"))
            {
                CheckEnabled(AnarchyManager.SettingsPanel, new GUIBase[] { AnarchyManager.ProfilePanel, AnarchyManager.ServerList, AnarchyManager.SinglePanel });
            }
            if (Button("custom_characters"))
            {
                if (enabledPanel < 0)
                {
                    Application.LoadLevel("characterCreation");
                    return;
                }
            }
            if (Button("snapshots"))
            {
                if (enabledPanel < 0)
                {
                    Application.LoadLevel("SnapShot");
                    return;
                }
            }
            if (Button("exit"))
            {
                Application.Quit();
            }
        }
Exemplo n.º 10
0
        private void DrawEffectsPage()
        {
            left.Reset();
            LabelCenter(left, locale["effects"], true);
            ToggleButton(left, VideoSettings.WindEffect, locale["windEffect"], true);
            ToggleButton(left, VideoSettings.BladeTrails, locale["bladeTrails"], true);
            if (VideoSettings.BladeTrails)
            {
                Label(left, Style.LabelSpace + locale["trailAppearance"], false);
                left.MoveOffsetX(Style.LabelOffsetSlider);
                SelectionGrid(left, VideoSettings.TrailType, locale.GetArray("trailType"), 3, true);
                left.ResetX();
                ToggleButton(left, VideoSettings.InfiniteTrail, Style.LabelSpace + locale["infiniteTrails"], true);
                HorizontalSlider(left, VideoSettings.TrailFPS, Style.LabelSpace + locale.Format("trailFps", VideoSettings.TrailFPS.Value.ToString("F0")), 60f, 240f, Style.LabelOffsetSlider, true);
            }
            ToggleButton(left, VideoSettings.CameraTilt, locale["tilt"], true);
            ToggleButton(left, VideoSettings.Blur, locale["blur"], true);
            ToggleButton(left, VideoSettings.ShadowsUI, locale["shadowsUI"], true);

            right.Reset();
            ToggleButton(right, VideoSettings.DisableFog, locale["disableFog"]);
        }
Exemplo n.º 11
0
        private void DrawAbilityPage()
        {
            rect.Reset();
            rect.MoveY();
            AbilityPage = SelectionGrid(rect, AbilityPage, AbilityLabels, AbilityLabels.Length, true);
            SmartRect[] rects = Helper.GetSmartRects(pagePosition, 2);
            switch (AbilityPage)
            {
            case 0:
                LabelCenter(rects[0], locale["bombStats"], true);
                bombStats.Radius = BombStatSlider(rects[0], bombStats.Radius, locale.Format("bombRad", bombStats.Radius.ToString()),
                                                  Style.LabelOffsetSlider, calculator.RadiusSetting.Step, calculator.RadiusSetting.MinimumLimit, calculator.RadiusSetting.MaximumLimit, true);


                bombStats.Range = BombStatSlider(rects[0], bombStats.Range, locale.Format("bombRange", bombStats.Range.ToString()),
                                                 Style.LabelOffsetSlider, calculator.RangeSetting.Step, calculator.RangeSetting.MinimumLimit, calculator.RangeSetting.MaximumLimit, true);


                bombStats.Speed = BombStatSlider(rects[0], bombStats.Speed, locale.Format("bombSpeed", bombStats.Speed.ToString()),
                                                 Style.LabelOffsetSlider, calculator.SpeedSetting.Step, calculator.SpeedSetting.MinimumLimit, calculator.SpeedSetting.MaximumLimit, true);


                bombStats.Cooldown = BombStatSlider(rects[0], bombStats.Cooldown, locale.Format("bombCd", bombStats.Cooldown.ToString()),
                                                    Style.LabelOffsetSlider, calculator.CooldownSetting.Step, calculator.CooldownSetting.MinimumLimit, calculator.CooldownSetting.MaximumLimit, true);

                //localBombStats[0] = (int)HorizontalSlider(rects[0], localBombStats[0], locale.Format("bombRad", Mathf.RoundToInt(localBombStats[0]).ToString()), 0f, 10f, Style.LabelOffsetSlider, true);
                //localBombStats[1] = (int)HorizontalSlider(rects[0], localBombStats[1], locale.Format("bombRange", Mathf.RoundToInt(localBombStats[1]).ToString()), 0f, 10f, Style.LabelOffsetSlider, true);
                //localBombStats[2] = (int)HorizontalSlider(rects[0], localBombStats[2], locale.Format("bombSpeed", Mathf.RoundToInt(localBombStats[2]).ToString()), 0f, 10f, Style.LabelOffsetSlider, true);
                //localBombStats[3] = (int)HorizontalSlider(rects[0], localBombStats[3], locale.Format("bombCd", Mathf.RoundToInt(localBombStats[3]).ToString()), 0f, 10f, Style.LabelOffsetSlider, true);
                TextField(rects[0], Bomb.BombNameSetting, locale["bombName"], Style.LabelOffset, true);

                LabelCenter(rects[1], locale["bombColor"], true);
                HorizontalSlider(rects[1], Bomb.MyBombColorR, locale["bombColorR"], 0f, 1f, Style.LabelOffsetSlider, true);
                HorizontalSlider(rects[1], Bomb.MyBombColorG, locale["bombColorG"], 0f, 1f, Style.LabelOffsetSlider, true);
                HorizontalSlider(rects[1], Bomb.MyBombColorB, locale["bombColorB"], 0f, 1f, Style.LabelOffsetSlider, true);
                HorizontalSlider(rects[1], Bomb.MyBombColorA, locale["bombColorA"], 0.5f, 1f, Style.LabelOffsetSlider, true);
                break;
            }
        }
Exemplo n.º 12
0
 private void DrawRightColumn()
 {
     right.Reset();
     LabelCenter(right, locale["character"], true);
     SelectionGrid(right, costumeSelection, costumeList, 3, true);
     DropdownMenu(this, right, characterSelection, characterList, true);
     right.MoveToEndY(WindowPosition, new AutoScaleFloat(30f));
     right.MoveOffsetX(new AutoScaleFloat(150f));
     right.height = new AutoScaleFloat(30f);
     if (Button(right, locale["back"], false))
     {
         Disable();
         return;
     }
 }
Exemplo n.º 13
0
        protected override void DrawMainPart()
        {
            rect.Reset();
            Box(BoxPosition, locale["title"]);
            float offset = new AutoScaleFloat(120f);

            rect.MoveOffsetX(offset);
            rect.width   -= offset;
            pageSelection = SelectionGrid(rect, pageSelection, modeSelection, modeSelection.Length);
            rect.ResetX();
            rect.MoveToEndY(BoxPosition, Style.Height);
            rect.MoveToEndX(BoxPosition, Style.LabelOffset);
            rect.width = Style.LabelOffset;
            if (Button(rect, locale["btnClose"]))
            {
                Disable();
            }
        }
Exemplo n.º 14
0
        protected override void DrawMainPart()
        {
            rect.Reset();
            rect.MoveY();
            scrollRect.Reset();
            scrollArea.y = rect.y;

            if (messages.Count > 0)
            {
                scroll = BeginScrollView(scrollArea, scroll, scrollAreaView);
                UnityEngine.GUILayout.TextArea(showString, Style.Label, new GUILayoutOption[] { UnityEngine.GUILayout.Width(scrollArea.width) });
                //var options = new GUILayoutOption[0];
                //foreach (var msg in messages)
                //{
                //    GUILayout.Label(msg.ToString(), options);
                //}
                EndScrollView();
            }
        }
Exemplo n.º 15
0
 private void DrawLeftColumn()
 {
     left.Reset();
     LabelCenter(left, locale["map"], true);
     SelectionGrid(left, mapSelection, mapList, 1, true);
     LabelCenter(left, locale["difficulity"], true);
     SelectionGrid(left, difficulitySelection, difficulityList, 3, true);
     LabelCenter(left, locale["daylight"], true);
     SelectionGrid(left, dayLightSelection, dayLightList, 3, true);
     LabelCenter(left, locale["camera"], true);
     SelectionGrid(left, Settings.CameraMode, cameraList, cameraList.Length, true);
     left.MoveToEndY(BoxPosition, new AutoScaleFloat(30f));
     left.height = new AutoScaleFloat(30f);
     if (Button(left, locale["start"], true))
     {
         OnButtonStartClick();
         DisableImmediate();
         return;
     }
 }
Exemplo n.º 16
0
        protected override void DrawMainPart()
        {
            rect.Reset();
            Box(WindowPosition, locale["title"]);
            float offset = new AutoScaleFloat(120f);

            rect.MoveOffsetX(offset);
            rect.width   -= offset;
            pageSelection = SelectionGrid(rect, pageSelection, modeSelection, modeSelection.Length);
            rect.ResetX();
            rect.MoveToEndY(WindowPosition, Style.Height);
            rect.MoveToEndX(WindowPosition, Style.LabelOffset * 2f + Style.HorizontalMargin);
            rect.width = Style.LabelOffset;
            if (Button(rect, locale["btnReset"], false))
            {
                GameModes.DisableAll();
            }
            rect.MoveX(Style.HorizontalMargin, true);
            if (Button(rect, locale["btnClose"]))
            {
                Disable();
            }
        }
Exemplo n.º 17
0
 private void PasswordPage()
 {
     pwdRect.Reset();
     LabelCenter(pwdRect, locale["pwdRequest"], true);
     pwdInput = TextField(pwdRect, pwdInput, string.Empty, 0f, true);
     if (Button(pwdRect, locale["joinRoom"], true))
     {
         if (roomToJoin == null || !roomToJoin.IsCorrectPassword(pwdInput))
         {
             pageSelection = ServerListPage;
         }
         else
         {
             PhotonNetwork.JoinRoom(roomToJoin.Name);
             disconnectByJoin = true;
             DisableImmediate();
         }
     }
     else if (Button(pwdRect, locale["btnBack"], false))
     {
         pageSelection = ServerListPage;
     }
 }
Exemplo n.º 18
0
        protected override void DrawMainPart()
        {
            rect.Reset();
            Box(BoxPosition, locale["title"]);
            rect.MoveOffsetX(new AutoScaleFloat(120f));
            rect.width   -= new AutoScaleFloat(120f);
            pageSelection = SelectionGrid(rect, pageSelection, skinTypeSelection, skinTypeSelection.Length);

            right.Reset();
            if (presets != null && presets.Count > 0 && skinSelection >= 0)
            {
                var set = presets[skinSelection];
                set.Draw(right, locale);
            }

            rect.ResetX();
            rect.MoveToEndY(BoxPosition, Style.Height);
            rect.MoveToEndX(BoxPosition, Style.LabelOffset);
            rect.width = Style.LabelOffset;
            if (Button(rect, locale["btnClose"]))
            {
                Disable();
            }
        }
Exemplo n.º 19
0
        private void RoomCreation()
        {
            left.Reset();
            right.Reset();
            LabelCenter(left, locale["roomSettings"], true);
            serverName = TextField(left, serverName, locale["roomName"], Style.LabelOffset, true);
            password   = TextField(left, password, locale["pwd"], Style.LabelOffset, true);
            serverTime = TextField(left, serverTime, locale["time"], Style.LabelOffset * 2f, true);
            maxPlayers = TextField(left, maxPlayers, locale["players"], Style.LabelOffset * 2f, true);

            LabelCenter(left, locale["difficulity"], true);
            difficulity = SelectionGrid(left, difficulity, difficulities, difficulities.Length, true);

            LabelCenter(left, locale["dayLight"], true);
            daylight = SelectionGrid(left, daylight, daylights, daylights.Length, true);
            left.MoveY();

            LabelCenter(left, locale["presets"], true);
            Label(left, locale["presetNote"], true);
            newPresetName = TextField(left, newPresetName, locale["presetName"], Style.LabelOffset, true);
            left.width    = (left.DefaultWidth - Style.HorizontalMargin) / 2f;
            if (Button(left, locale["presetAdd"], false))
            {
                ServerPreset set = new ServerPreset(newPresetName);
                ExportPreset(set);
                presets.Add(set);
                presetView.height = (presets.Count * Style.Height) + ((presets.Count - 1) * Style.VerticalMargin);
                set.Save();
            }
            left.MoveX();
            if (Button(left, locale["presetRemove"], true))
            {
                if (presets.Count > 0)
                {
                    ServerPreset selected = null;
                    for (int i = 0; i < presets.Count; i++)
                    {
                        if (presets[i].Name == newPresetName)
                        {
                            selected = presets[i];
                        }
                    }
                    if (selected != null)
                    {
                        presets.Remove(selected);
                        selected.Delete();
                        newPresetName = "Set " + (presets.Count + 1);
                        if (presets.Count > 0)
                        {
                            newPresetName = presets[presets.Count - 1].Name;
                        }

                        presetView.height = (presets.Count * Style.Height) + ((presets.Count - 1) * Style.VerticalMargin);
                    }
                }
            }
            left.ResetX();
            if (presets.Count > 0)
            {
                presetArea.y = left.y;
                presetRect.Reset();
                presetScroll = BeginScrollView(presetArea, presetScroll, presetView);
                {
                    for (int i = 0; i < presets.Count; i++)
                    {
                        if (Button(presetRect, presets[i].Name, true))
                        {
                            ServerPreset selected = presets[i];
                            ImportPreset(selected);
                        }
                    }
                }
                EndScrollView();
            }

            left.MoveToEndY(BoxPosition, Style.Height);
            left.width = left.DefaultWidth / 2f - Style.HorizontalMargin;
            if (Button(left, locale["btnCreation"], false))
            {
                disconnectByJoin = true;
                string[] args = new string[]
                {
                    serverName,
                    maps[mapSelection],
                    new string[] { "normal", "hard", "abnormal" }[difficulity],
                    serverTime,
                    new string[] { "day", "dawn", "night" }[daylight],
                    password.Length > 0 ? new SimpleAES().Encrypt(password) : string.Empty,
                    UnityEngine.Random.Range(1000000, 10000000).ToString()
                };
                if (!int.TryParse(maxPlayers, out int max))
                {
                    max = 5;
                }
                PhotonNetwork.CreateRoom(string.Join("`", args), new RoomOptions()
                {
                    isVisible = true, isOpen = true, maxPlayers = max
                }, null);
                DisableImmediate();
                AnarchyManager.Background.Disable();
                return;
            }
            left.MoveX(Style.HorizontalMargin, true);
            if (Button(left, locale["btnOffline"], false))
            {
                disconnectByJoin = true;
                PhotonNetwork.Disconnect();
                PhotonNetwork.offlineMode = true;
                string[] args = new string[]
                {
                    serverName,
                    maps[mapSelection],
                    new string[] { "normal", "hard", "abnormal" }[difficulity],
                    serverTime,
                    new string[] { "day", "dawn", "night" }[daylight],
                    password.Length > 0 ? new SimpleAES().Encrypt(password) : string.Empty,
                    UnityEngine.Random.Range(1000000, 10000000).ToString()
                };
                if (!int.TryParse(maxPlayers, out int max))
                {
                    max = 5;
                }
                PhotonNetwork.CreateRoom(string.Join("`", args), new RoomOptions()
                {
                    isVisible = true, isOpen = true, maxPlayers = max
                }, null);
                DisableImmediate();
                AnarchyManager.Background.Disable();
                return;
            }

            LabelCenter(right, locale["mapSelection"], true);
            mapSelection = SelectionGrid(right, mapSelection, maps, 1);
            right.MoveToEndY(BoxPosition, Style.Height);
            right.MoveToEndX(BoxPosition, new AutoScaleFloat(240f) + Style.HorizontalMargin);
            right.width = new AutoScaleFloat(120f);
            if (Button(right, locale["btnSettings"], false))
            {
                connected     = false;
                pageSelection = SettingsPage;
                return;
            }
            right.MoveX();
            if (Button(right, locale["btnList"], false))
            {
                connected = PhotonNetwork.connected;
                if (connected)
                {
                    timeToUpdate = 0.1f;
                }
                pageSelection = ServerListPage;
                return;
            }
        }
Exemplo n.º 20
0
        protected override void DrawMainPart()
        {
            left.Reset();
            LabelCenter(left, locale["character"], true);
            SelectionGrid(left, costumeSelection, costumeList, 3, true);
            bool updateChar = avatar == null;
            int  oldChar    = characterSelection.Value;

            SelectionGrid(left, characterSelection, characterList, 1, true);
            if (oldChar != characterSelection.Value)
            {
                updateChar = true;
            }
            character = charactersList[characterSelection].ToUpper();
            var set = CostumeConeveter.LocalDataToHeroCostume(character);

            stats = character.Contains("SET") ? (set == null ? new HeroStat() : set.stat) : HeroStat.getInfo(character);

            LabelCenter(left, locale["camera"], true);
            SelectionGrid(left, Settings.CameraMode, cameraList, cameraList.Length, true);
            float height = Style.Height * (FengGameManagerMKII.Level.PVPEnabled ? 3f : 2f) + (Style.VerticalMargin * (FengGameManagerMKII.Level.PVPEnabled ? 2f : 1f)) + (Style.Height + Style.VerticalMargin);

            left.MoveToEndY(BoxPosition, height);
            if (Button(left, locale["humanStart"], true))
            {
                SpawnHero();
                DisableImmediate();
                return;
            }
            if (FengGameManagerMKII.Level.PVPEnabled)
            {
                if (FengGameManagerMKII.Level.TeamTitan && IN_GAME_MAIN_CAMERA.GameMode != GameMode.PVP_AHSS)
                {
                    if (Button(left, locale["titanStart"], true))
                    {
                        SpawnTitan();
                        DisableImmediate();
                        return;
                    }
                }
                else
                {
                    if (Button(left, locale["ahssStart"], true))
                    {
                        SpawnAHSS();
                        DisableImmediate();
                        return;
                    }
                }
            }
            if (Button(left, locale["back"], true))
            {
                Screen.lockCursor = true;
                Screen.showCursor = true;
                IN_GAME_MAIN_CAMERA.SpecMov.disable = false;
                IN_GAME_MAIN_CAMERA.Look.disable    = false;
                Disable();
                return;
            }
            right.Reset();
            LabelCenter(right, locale["avatar"], true);
            right.height = right.width;
            if (updateChar)
            {
                avatar = LoadTexture(character.Contains("SET") ? "CUSTOM" : character, "png");
            }
            DrawTexture(right, avatar, true);
            right.height = Style.Height;
            LabelCenter(right, locale["stats"], true);
            Label(right, locale.Format("speed", stats.Spd.ToString()), true);
            Label(right, locale.Format("acceleration", stats.Acl.ToString()), true);
            Label(right, locale.Format("gas", stats.Gas.ToString()), true);
            Label(right, locale.Format("blade", stats.Bla.ToString()), true);
        }
Exemplo n.º 21
0
        private void DrawControlElements()
        {
            LabelCenter(left, locale["sets"], true);
            Label(left, locale["name"], false);
            left.MoveOffsetX(Style.LabelOffset);
            newSetName = TextField(left, newSetName, string.Empty, 0f, true);
            left.ResetX();
            left.BeginHorizontal(2);
            if (Button(left, locale["btnAdd"], false))
            {
                SkinPreset add = null;
                if (pageSelection == Humans)
                {
                    add = new HumanSkinPreset(newSetName);
                }
                else if (pageSelection == Titans)
                {
                    add = new TitanSkinPreset(newSetName);
                }
                else if (pageSelection == City)
                {
                    add = new CityPreset(newSetName);
                }
                else if (pageSelection == Forest)
                {
                    add = new ForestPreset(newSetName);
                }
                else if (pageSelection == Skyboxes)
                {
                    add = new SkyboxPreset(newSetName);
                }
                else if (pageSelection == Custom)
                {
                    add = new CustomMapPreset(newSetName);
                }
                if (add != null)
                {
                    presets.Add(add);
                    skinSelection = presets.Count - 1;
                    newSetName    = locale["set"] + " " + (presets.Count + 1).ToString();
                    presetLabels  = new string[presets.Count];
                    for (int i = 0; i < presetLabels.Length; i++)
                    {
                        presetLabels[i] = presets[i].Name;
                    }
                }
            }
            left.MoveX();
            if (Button(left, locale["btnDelete"], true))
            {
                if (skinSelection >= 0)
                {
                    presets[skinSelection].Delete();
                    presets.RemoveAt(skinSelection);
                }
                skinSelection = presets.Count > 0 ? presets.Count - 1 : -1;
                presetLabels  = new string[presets.Count];
                for (int i = 0; i < presetLabels.Length; i++)
                {
                    presetLabels[i] = presets[i].Name;
                }
            }
            left.ResetX();

            scrollArea.y = left.y;
            left.MoveToEndY(BoxPosition, Style.Height + Style.VerticalMargin);
            scrollArea.height = left.y - scrollArea.y;
            scrollRect.Reset();
            scrollAreaView.height = (Style.Height * presetLabels.Length) + (Style.VerticalMargin * (presetLabels.Length + 1));


            scroll        = BeginScrollView(scrollArea, scroll, scrollAreaView);
            skinSelection = SelectionGrid(scrollRect, skinSelection, presetLabels, 1, true);
            EndScrollView();
        }
Exemplo n.º 22
0
        protected override void DrawMainPart()
        {
            left.Reset();
            right.Reset();
            rect.Reset();
            float offset = new AutoScaleFloat(120f);

            rect.MoveOffsetX(offset);
            rect.width   -= offset;
            pageSelection = SelectionGrid(rect, pageSelection, selections, selections.Length, true);
            rect.ResetX();

            LabelCenter(right, locale["picker" + pageSelection.ToString()], true);
            right.BeginHorizontal(2);
            if (Button(right, locale["update"], false))
            {
                if (pageSelection == CustomLogicPage)
                {
                    allNames = LoadFiles(LogicsPath);
                }
                else
                {
                    allNames = LoadFiles(MapsPath);
                }
            }
            right.MoveX();
            if (Button(right, locale["random"], true))
            {
                int pickId = Random.Range(0, allNames.Length);
                if (filter.Length > 0)
                {
                    PickByName(allNames[pickId], true);
                }
                else
                {
                    Pick(pickId, allNames[pickId], true);
                }
            }
            right.ResetX();
            filter = TextField(right, filter, locale["filter"], Style.LabelOffset, true);

            scrollArea.y = right.y;
            right.MoveToEndY(BoxPosition, Style.Height + Style.VerticalMargin);
            scrollArea.height = right.y - scrollArea.y;
            scrollRect.Reset();
            scrollAreaView.height = (Style.Height * allNames.Length) + ((Style.VerticalMargin * 2) * allNames.Length);

            scroll = BeginScrollView(scrollArea, scroll, scrollAreaView);
            for (int i = 0; i < allNames.Length; i++)
            {
                if (Button(scrollRect, allNames[i], (i != allNames.Length - 1)))
                {
                    if (filter.Length == 0)
                    {
                        Pick(i, allNames[i], false);
                    }
                    else
                    {
                        PickByName(allNames[i], false);
                    }
                }
            }
            EndScrollView();
        }
Exemplo n.º 23
0
 protected internal override void Draw()
 {
     if (activePanel != null && activePanel.Active)
     {
         return;
     }
     GUI.Box(boxPosition, locale["title"]);
     pauseRect.Reset();
     if (PauseButton(pauseRect, "btnContinue"))
     {
         Continue();
         return;
     }
     if (PauseButton(pauseRect, "profile"))
     {
         if (activePanel != null)
         {
             activePanel.DisableImmediate();
         }
         activePanel = AnarchyManager.ProfilePanel;
         activePanel.Enable();
     }
     if (PauseButton(pauseRect, "skins"))
     {
         if (activePanel != null)
         {
             activePanel.DisableImmediate();
         }
         activePanel = new SkinsPanel();
         activePanel.Enable();
     }
     if (PauseButton(pauseRect, "custom"))
     {
         if (IN_GAME_MAIN_CAMERA.GameType == GameType.Single || (IN_GAME_MAIN_CAMERA.GameType == GameType.MultiPlayer && PhotonNetwork.IsMasterClient))
         {
             if (activePanel != null)
             {
                 activePanel.DisableImmediate();
             }
             activePanel = new CustomPanel();
             activePanel.Enable();
         }
     }
     if (PauseButton(pauseRect, "gameSettings"))
     {
         if (IN_GAME_MAIN_CAMERA.GameType == GameType.Single || (IN_GAME_MAIN_CAMERA.GameType == GameType.MultiPlayer && PhotonNetwork.IsMasterClient))
         {
             if (activePanel != null)
             {
                 activePanel.DisableImmediate();
             }
             activePanel = new GameModesPanel();
             activePanel.Enable();
         }
     }
     if (PauseButton(pauseRect, "settings"))
     {
         if (activePanel != null)
         {
             activePanel.DisableImmediate();
         }
         activePanel = AnarchyManager.SettingsPanel;
         activePanel.Enable();
     }
     if (PauseButton(pauseRect, "btnQuit"))
     {
         Quit();
         return;
     }
 }
Exemplo n.º 24
0
        private void ServerList()
        {
            if (Event.current != null && Event.current.type == EventType.KeyDown && UnityEngine.GUI.GetNameOfFocusedControl() == "ServerListFilter")
            {
                UpdateRoomList();
            }

            rect.Reset();
            region = SelectionGrid(rect, region, regions, regions.Length, true);

            Label(rect, locale["customServer"], false);
            float offset = ((scrollArea.width - (Style.HorizontalMargin * 3)) / 4f) + Style.HorizontalMargin;

            rect.MoveOffsetX(offset);
            rect.width -= (new AutoScaleFloat(100f) - Style.HorizontalMargin);
            float txt = offset + rect.width;

            customServer = SelectionGrid(rect, customServer, customServers, customServers.Length, false);

            rect.ResetX();
            rect.MoveOffsetX(txt + Style.HorizontalMargin);
            customServerField = TextField(rect, customServerField, string.Empty, 0f, true);

            rect.ResetX();
            CheckReconnect();
            UnityEngine.GUI.SetNextControlName("ServerListFilter");
            nameFilter = TextField(rect, nameFilter, locale["filter"], offset, true);

            rect.ResetX();
            rect.MoveY(Style.VerticalMargin);
            scrollRect.Reset();
            scrollArea.y = rect.y;
            scroll       = BeginScrollView(scrollArea, scroll, scrollAreaView);
            if (connected)
            {
                foreach (var room in roomList)
                {
                    if (Button(scrollRect, room.UIName.ToHTMLFormat(), true) && room.PlayerCount != room.MaxPlayers)
                    {
                        if (room.HasPassword)
                        {
                            roomToJoin    = room;
                            pageSelection = PasswordRequestPage;
                        }
                        else
                        {
                            PhotonNetwork.JoinRoom(room.Name);
                            disconnectByJoin = true;
                            DisableImmediate();
                        }
                        return;
                    }
                }
            }
            EndScrollView();

            rect.MoveToEndY(BoxPosition, Style.Height);
            rect.width = new AutoScaleFloat(170f);
            if (Button(rect, locale["btnCreation"], false))
            {
                pageSelection = CreationPage;
                connected     = false;
                return;
            }
            rect.MoveX(new AutoScaleFloat(5f), true);
            if (Button(rect, locale["btnSettings"], false))
            {
                pageSelection = SettingsPage;
                connected     = false;
                return;
            }
            rect.width = new AutoScaleFloat(120f);
            rect.MoveToEndX(BoxPosition, new AutoScaleFloat(120f));
            if (Button(rect, locale["btnBack"]))
            {
                Disable();
                return;
            }
        }