Пример #1
0
 protected override void OnPanelEnable()
 {
     rect         = Helper.GetSmartRects(WindowPosition, 1)[0];
     head         = locale["title"];
     pagePosition = new Rect(WindowPosition.x, WindowPosition.y + ((rect.height + Style.VerticalMargin) * 2f), WindowPosition.width, WindowPosition.height - (rect.y + rect.height + Style.VerticalMargin) - Style.WindowBottomOffset - Style.WindowTopOffset);
     SmartRect[] rects = Helper.GetSmartRects(pagePosition, 2);
     left           = rects[0];
     right          = rects[1];
     pagesSelection = locale.GetArray("buttons");
     RebindPage     = 0;
     RebindLabels   = locale.GetArray("buttonsRebinds");
     ModPage        = 0;
     ModLabels      = locale.GetArray("modMenu");
     burstTypes     = locale.GetArray("burstTypes");
     AbilityPage    = 0;
     AbilityLabels  = locale.GetArray("abilityNames");
     if (Application.loadedLevelName == "menu")
     {
         AnarchyManager.MainMenu.DisableImmediate();
     }
     if (wasClosedByUpdate)
     {
         pageSelection     = Anarchy;
         ModPage           = AnarchyStyle;
         wasClosedByUpdate = false;
     }
 }
Пример #2
0
        private void EnableList()
        {
            head       = locale["title"];
            rect       = Helper.GetSmartRects(WindowPosition, 1)[0];
            scroll     = Optimization.Caching.Vectors.v2zero;
            scrollRect = new SmartRect(0f, 0f, rect.width, rect.height, 0f, Style.VerticalMargin);
            float rawWidth = scrollRect.width - (Style.HorizontalMargin * 5);

            float[] multipliers = new float[6] {
                0.06f, 0.44f, 0.23f, 0.1f, 0.08f, 0.09f
            };
            float prev = 0f;// rawWidth * multipliers[0];

            listRects = new SmartRect[6];
            for (int i = 0; i < 6; i++)
            {
                listRects[i] = new SmartRect(new Rect(prev, 0f, rawWidth * multipliers[i], Style.Height), 0f, Style.VerticalMargin);
                prev        += Style.HorizontalMargin + listRects[i].width;
            }
            scrollArea      = new Rect(rect.x, rect.y, rect.width, WindowPosition.height - (4 * (Style.Height + Style.VerticalMargin)) - (Style.WindowTopOffset + Style.WindowBottomOffset) - 10f);
            scrollAreaView  = new Rect(0f, 0f, rect.width, 1000f);
            roomList        = new List <RoomInfo>();
            nameFilter      = string.Empty;
            connected       = PhotonNetwork.connected;
            region          = NetworkSettings.PreferedRegion.Value;
            oldRegion       = region;
            oldCustomServer = customServer;
            regions         = locale.GetArray("regions");
            playersCount    = 0;
            customServers   = locale.GetArray("servers");
            UpdateRoomList();
            timeToUpdate = UpdateTime;
        }
Пример #3
0
 private void DisableSettings()
 {
     rect         = null;
     regions      = null;
     protocols    = null;
     serProtocols = null;
 }
Пример #4
0
        private void PasswordPageEnable()
        {
            pwdInput = string.Empty;
            Rect rect = Helper.GetScreenMiddle(Style.WindowWidth / 2f, Style.Height * 3f + Style.VerticalMargin * 2f);

            pwdRect = new SmartRect(rect.x, rect.y, rect.width, Style.Height, Style.HorizontalMargin, Style.VerticalMargin);
        }
Пример #5
0
        private bool PauseButton(SmartRect rect, string key)
        {
            bool res = UnityEngine.GUI.Button(rect.ToRect(), locale[key], pauseStyle);

            rect.MoveY();
            return(res);
        }
Пример #6
0
 protected override void OnPanelDisable()
 {
     rect  = null;
     left  = null;
     right = null;
     GameModes.Save();
 }
Пример #7
0
        public static float BombStatSlider(SmartRect position, float value, string label, float offset, float step, float min, float max, bool move = true)
        {
            if (offset > 0f)
            {
                UnityEngine.GUI.Label(position.ToRect(), label, Style.Label);
                position.MoveOffsetX(offset);
            }

            value = UnityEngine.GUI.HorizontalSlider(position.ToRect(), value, min, max, Style.Slider, Style.SliderBody);
            position.ResetX();
            if (move)
            {
                position.MoveY();
            }

            if (step == 0.5f)
            {
                int   low  = Mathf.FloorToInt(value);
                float diff = value - low;
                if (diff >= 0.25f && diff < 0.75f)
                {
                    return(low + 0.5f);
                }
                else
                {
                    return(Mathf.RoundToInt(value));
                }
            }
            else
            {
                return((int)value);
            }
        }
Пример #8
0
 public static void Box(SmartRect position, string text, bool move = true)
 {
     UGUI.Box(position.ToRect(), text, Style.Box);
     if (move)
     {
         position.MoveY();
     }
 }
Пример #9
0
 public static void LabelCenter(SmartRect position, string content, bool move = false)
 {
     UGUI.Label(position.ToRect(), content, Style.LabelCenter);
     if (move)
     {
         position.MoveY();
     }
 }
Пример #10
0
 public static void DrawTexture(SmartRect position, Texture tex, bool move = false)
 {
     UGUI.DrawTexture(position.ToRect(), tex);
     if (move)
     {
         position.MoveY();
     }
 }
Пример #11
0
 protected override void OnDisable()
 {
     Screen.lockCursor = true;
     Screen.showCursor = true;
     IN_GAME_MAIN_CAMERA.SpecMov.disable = false;
     IN_GAME_MAIN_CAMERA.Look.disable    = false;
     rect = null;
 }
Пример #12
0
 private void EnableSettings()
 {
     head         = locale["roomSettings"];
     rect         = Helper.GetSmartRects(BoxPosition, 1)[0];
     regions      = locale.GetArray("regions");
     serProtocols = new string[] { "GPBinaryV16", "GPBinaryV18" };
     protocols    = new string[] { "UDP", "TCP", "WebSocket", "WebSocketSecure" };
 }
Пример #13
0
 protected override void OnPanelDisable()
 {
     skinTypeSelection = null;
     left       = null;
     right      = null;
     rect       = null;
     currentSet = null;
 }
Пример #14
0
 protected override void OnPanelDisable()
 {
     gameTypes  = null;
     selections = null;
     rect       = null;
     areaStyle  = null;
     allNames   = null;
     filter     = null;
 }
Пример #15
0
 public static Vector2 BeginScrollView(SmartRect position, Vector2 scrollView, Rect viewRect, bool alwaysHorizontal, bool alwaysVertical, bool move = false)
 {
     scrollView = UGUI.BeginScrollView(position.ToRect(), scrollView, viewRect, alwaysHorizontal, alwaysVertical, Style.ScrollView, Style.ScrollView);
     if (move)
     {
         position.MoveY();
     }
     return(scrollView);
 }
Пример #16
0
        protected override void OnPanelEnable()
        {
            if (IN_GAME_MAIN_CAMERA.GameType == GameType.Single)
            {
                Time.timeScale = 0f;
            }
            if (!AnarchyManager.Pause.IsActive)
            {
                IN_GAME_MAIN_CAMERA.isPausing = true;
                InputManager.MenuOn           = true;
                if (Screen.lockCursor)
                {
                    Screen.lockCursor = false;
                }
                if (!Screen.showCursor)
                {
                    Screen.showCursor = true;
                }
            }
            rect = Helper.GetSmartRects(WindowPosition, 1)[0];

            scroll         = Optimization.Caching.Vectors.v2zero;
            scrollRect     = new SmartRect(0f, 0f, rect.width, rect.height, 0f, Style.VerticalMargin);
            scrollArea     = new Rect(rect.x, rect.y, rect.width, WindowPosition.height - (4 * (Style.Height + Style.VerticalMargin)) - (Style.WindowTopOffset + Style.WindowBottomOffset) - 10f);
            scrollAreaView = new Rect(0f, 0f, rect.width, int.MaxValue);

            head           = locale["title"];
            pagesSelection = locale.GetArray("buttons");
            pagePosition   = new Rect(WindowPosition.x, WindowPosition.y + ((rect.height + Style.VerticalMargin) * 2f), WindowPosition.width, WindowPosition.height - (rect.y + rect.height + Style.VerticalMargin) - Style.WindowBottomOffset - Style.WindowTopOffset);
            SmartRect[] rects = Helper.GetSmartRects(pagePosition, 2);
            left  = rects[0];
            right = rects[1];

            scrollName         = Optimization.Caching.Vectors.v2zero;
            scrollRectName     = new SmartRect(left.x, left.y, left.width, left.height, 0f, Style.VerticalMargin);
            scrollAreaName     = new Rect(left.x, left.y, left.width, WindowPosition.height - (4 * (Style.Height + Style.VerticalMargin)) - (Style.WindowTopOffset + Style.WindowBottomOffset) - 10f);
            scrollAreaViewName = new Rect(left.x, left.y, left.width, int.MaxValue);

            scrollProperties         = Optimization.Caching.Vectors.v2zero;
            scrollRectProperties     = new SmartRect(right.x, right.y, right.width, right.height, 0f, Style.VerticalMargin);
            scrollAreaProperties     = new Rect(right.x, right.y, right.width, WindowPosition.height - (4 * (Style.Height + Style.VerticalMargin)) - (Style.WindowTopOffset + Style.WindowBottomOffset) - 10f);
            scrollAreaViewProperties = new Rect(0, 0, right.width, int.MaxValue);


            scrollStyle = new GUIStyle();
            scrollStyle.normal.background  = Textures.TextureCache[ElementType.Button][0];
            scrollStyle.hover.background   = Textures.TextureCache[ElementType.SelectionGrid][0];
            scrollStyle.active.background  = Textures.TextureCache[ElementType.SelectionGrid][1];
            scrollStyle.focused.background = Textures.TextureCache[ElementType.SelectionGrid][2];
            //scrollStyle.fixedHeight = 200f;
            scrollStyle.fixedWidth = 25f;

            scrollStyle.onNormal.background  = Textures.TextureCache[ElementType.Button][0];
            scrollStyle.onHover.background   = Textures.TextureCache[ElementType.SelectionGrid][3];
            scrollStyle.onActive.background  = Textures.TextureCache[ElementType.SelectionGrid][4];
            scrollStyle.onFocused.background = Textures.TextureCache[ElementType.SelectionGrid][5];
        }
Пример #17
0
 protected override void OnEnable()
 {
     profileRect             = new Rect(Style.ScreenWidth - new AutoScaleFloat(300f), 0f, new AutoScaleFloat(300f), new AutoScaleFloat(20f));
     rect                    = new SmartRect(new Rect(Style.ScreenWidth - new AutoScaleFloat(400f), Style.ScreenHeight - new AutoScaleFloat(360f), new AutoScaleFloat(396f), new AutoScaleFloat(54f)), 0f, new AutoScaleFloat(18f));
     style                   = Helper.CreateStyle(TextAnchor.MiddleRight, FontStyle.Normal, Mathf.RoundToInt(new AutoScaleFloat(35)), true, new Color[] { white, orange, yellow, white, white, white });
     style.normal.background = style.hover.background = style.active.background = EmptyTexture;
     style.font              = AnarchyAssets.Load <Font>(Style.FontName);
     allUsedPanels           = new GUIBase[] { AnarchyManager.ProfilePanel, AnarchyManager.SinglePanel, AnarchyManager.ServerList, AnarchyManager.SettingsPanel };
 }
Пример #18
0
 protected override void OnPanelEnable()
 {
     rect = Helper.GetSmartRects(BoxPosition, 1)[0];
     skinTypeSelection = locale.GetArray("skinSelection");
     pageRect          = new Rect(BoxPosition.x, BoxPosition.y + ((Style.Height + Style.VerticalMargin) * 2f), BoxPosition.width, BoxPosition.height - ((Style.VerticalMargin + Style.Height) * 2f));
     SmartRect[] rects = Helper.GetSmartRects(pageRect, 2);
     left  = rects[0];
     right = rects[1];
 }
Пример #19
0
 private void DisableList()
 {
     regions       = null;
     nameFilter    = null;
     roomList      = null;
     rect          = null;
     scrollRect    = null;
     customServers = null;
 }
Пример #20
0
 protected override void OnPanelEnable()
 {
     SmartRect[] rects = Helper.GetSmartRects(WindowPosition, 2);
     left           = rects[0];
     right          = rects[1];
     newProfile     = "Profile" + (User.AllProfiles.Length + 1);
     currentProfile = FindCurrentProfile();
     checkProfile   = currentProfile;
     previewPage    = 0;
 }
Пример #21
0
 protected override void OnDisable()
 {
     rect          = null;
     style         = null;
     allUsedPanels = null;
     AnarchyManager.ProfilePanel.DisableImmediate();
     AnarchyManager.SinglePanel.DisableImmediate();
     AnarchyManager.SettingsPanel.DisableImmediate();
     AnarchyManager.ServerList.DisableImmediate();
 }
Пример #22
0
 protected override void OnEnable()
 {
     activePanel          = null;
     boxPosition          = Helper.GetScreenMiddle(Width, Height);
     pauseRect            = new SmartRect(boxPosition.x + 10f, boxPosition.y + 25f, boxPosition.width - 20f, 50f - Style.VerticalMargin, Style.HorizontalMargin, Style.VerticalMargin);
     pauseStyle           = new GUIStyle(Style.Button);
     pauseStyle.fontSize  = Style.FontSize * 2;
     pauseStyle.fontStyle = FontStyle.Bold;
     leaving = false;
 }
Пример #23
0
        private void LogicPageEnable()
        {
            Rect pos = BoxPosition;

            pos.y += (Style.Height + Style.VerticalMargin);
            SmartRect[] rects = Helper.GetSmartRects(pos, 2);
            left     = rects[0];
            right    = rects[1];
            allNames = LoadFiles(LogicsPath);
        }
Пример #24
0
 protected override void OnPanelEnable()
 {
     gameTypes           = locale.GetArray("gameTypes");
     rect                = Helper.GetSmartRects(BoxPosition, 1)[0];
     selections          = locale.GetArray("selection");
     areaStyle           = new GUIStyle(Style.TextField);
     areaStyle.alignment = TextAnchor.UpperLeft;
     scroll              = Optimization.Caching.Vectors.v2zero;
     filter              = "";
 }
Пример #25
0
 protected override void OnPanelDisable()
 {
     character      = "";
     right          = null;
     cameraList     = null;
     characterList  = null;
     charactersList = null;
     costumeList    = null;
     avatar         = null;
 }
Пример #26
0
 protected override void OnPanelEnable()
 {
     SmartRect[] init = Helper.GetSmartRects(BoxPosition, 2);
     left           = init[0];
     right          = init[1];
     cameraList     = new string[] { "ORIGINAL", "WOW", "TPS" };
     characterList  = locale.GetArray("characters");
     costumeList    = new string[] { "Cos1", "Cos2", "Cos3" };
     charactersList = new string[] { "Mikasa", "Levi", "Armin", "Marco", "Jean", "Eren", "Petra", "Sasha", "Set 1", "Set 2", "Set 3" };
 }
Пример #27
0
        public static bool Button(SmartRect position, string text, bool move = true)
        {
            bool value = UGUI.Button(position.ToRect(), text, Style.Button);

            if (move)
            {
                position.MoveY();
            }
            return(value);
        }
Пример #28
0
        protected override void OnEnable()
        {
            screenRect = new Rect(0f, 0f, Style.ScreenWidth, Style.ScreenHeight);
            Rect center = Helper.GetScreenMiddle(new AutoScaleFloat(300f), new AutoScaleFloat(100f));

            rect = new SmartRect(center.x, center.y, center.width, new AutoScaleFloat(30f));
            Screen.lockCursor = false;
            Screen.showCursor = true;
            IN_GAME_MAIN_CAMERA.SpecMov.disable = true;
            IN_GAME_MAIN_CAMERA.Look.disable    = true;
        }
Пример #29
0
 protected override void OnDisable()
 {
     if (FengGameManagerMKII.FGM.NeedChooseSide)
     {
         Screen.lockCursor = true;
         Screen.showCursor = true;
         IN_GAME_MAIN_CAMERA.SpecMov.disable = false;
         IN_GAME_MAIN_CAMERA.Look.disable    = false;
         rect = null;
     }
 }
Пример #30
0
 public static void Toggle(SmartRect position, Setting <bool> val, string label, float offset, bool move = false)
 {
     UGUI.Label(position.ToRect(), label, Style.Label);
     position.MoveOffsetX(position.width - Style.Height);
     val.Value = UGUI.Toggle(position.ToRect(), val.Value, string.Empty, Style.Toggle);
     position.ResetX();
     if (move)
     {
         position.MoveY();
     }
 }