Ejemplo n.º 1
0
        public void Update()
        {
            if (!Visible)
            {
                return;
            }

            ShowInstructionalButtons();
            Function.Call(Hash.HIDE_HUD_AND_RADAR_THIS_FRAME);

            ProcessControls();
            ProcessMouse();

            var res  = UIMenu.GetScreenResolutionMantainRatio();
            var safe = new Point(300, 180);

            new UIResText(Title, new Point(safe.X, safe.Y - 80), 1f, Color.White, Font.ChaletComprimeCologne, UIResText.Alignment.Left)
            {
                DropShadow = true,
            }.Draw();

            if (Photo == null)
            {
                new Sprite("char_multiplayer", "char_multiplayer", new Point((int)res.Width - safe.X - 64, safe.Y - 80), new Size(64, 64)).Draw();
            }
            else
            {
                Photo.Position = new Point((int)res.Width - safe.X - 100, safe.Y - 80);
                Photo.Size     = new Size(64, 64);
                Photo.Draw();
            }

            new UIResText(Name, new Point((int)res.Width - safe.X - 70, safe.Y - 95), 0.7f, Color.White,
                          Font.ChaletComprimeCologne, UIResText.Alignment.Right)
            {
                DropShadow = true,
            }.Draw();

            string t = Money;

            if (string.IsNullOrEmpty(Money))
            {
                t = DateTime.Now.ToString();
            }


            new UIResText(t, new Point((int)res.Width - safe.X - 70, safe.Y - 60), 0.4f, Color.White,
                          Font.ChaletComprimeCologne, UIResText.Alignment.Right)
            {
                DropShadow = true,
            }.Draw();

            string subt = MoneySubtitle;

            if (string.IsNullOrEmpty(MoneySubtitle))
            {
                subt = "";
            }

            new UIResText(subt, new Point((int)res.Width - safe.X - 70, safe.Y - 40), 0.4f, Color.White,
                          Font.ChaletComprimeCologne, UIResText.Alignment.Right)
            {
                DropShadow = true,
            }.Draw();

            for (int i = 0; i < Tabs.Count; i++)
            {
                var activeSize = res.Width - 2 * safe.X;
                activeSize -= 4 * 5;
                int tabWidth = (int)activeSize / 5;

                var tabColor = Tabs[i].Active ? Color.White : Color.Black;
                new UIResRectangle(safe.AddPoints(new Point((tabWidth + 5) * i, 0)), new Size(tabWidth, 40), Color.FromArgb(Tabs[i].Active ? 255 : 200, tabColor)).Draw();

                new UIResText(Tabs[i].Title.ToUpper(), safe.AddPoints(new Point((tabWidth / 2) + (tabWidth + 5) * i, 5)), 0.35f,
                              Tabs[i].Active ? Color.Black : Color.White, Font.ChaletLondon, UIResText.Alignment.Centered).Draw();

                if (Tabs[i].Active)
                {
                    new UIResRectangle(safe.SubtractPoints(new Point(-((tabWidth + 5) * i), 10)), new Size(tabWidth, 10), Color.DodgerBlue).Draw();
                }
            }

            Tabs[Index].Draw();

            _sc.CallFunction("DRAW_INSTRUCTIONAL_BUTTONS", -1);

            _sc.Render2D();
        }
Ejemplo n.º 2
0
        public void Update()
        {
            if (!Visible || TemporarilyHidden)
            {
                return;
            }
            ShowInstructionalButtons();
            Function.Call(Hash.HIDE_HUD_AND_RADAR_THIS_FRAME);
            Function.Call(Hash._SHOW_CURSOR_THIS_FRAME);


            var res  = UIMenu.GetScreenResolutionMaintainRatio();
            var safe = new Point(300, 180);

            if (!HideTabs)
            {
                new UIResText(Title, new Point(safe.X, safe.Y - 80), 1f, Color.White, Font.ChaletComprimeCologne,
                              UIResText.Alignment.Left)
                {
                    DropShadow = true,
                }.Draw();

                if (Photo == null)
                {
                    new Sprite("char_multiplayer", "char_multiplayer",
                               new Point((int)res.Width - safe.X - 64, safe.Y - 80), new Size(64, 64)).Draw();
                }
                else
                {
                    Photo.Position = new Point((int)res.Width - safe.X - 100, safe.Y - 80);
                    Photo.Size     = new Size(64, 64);
                    Photo.Draw();
                }

                new UIResText(Name, new Point((int)res.Width - safe.X - 70, safe.Y - 95), 0.7f, Color.White,
                              Font.ChaletComprimeCologne, UIResText.Alignment.Right)
                {
                    DropShadow = true,
                }.Draw();

                string t = Money;
                if (string.IsNullOrEmpty(Money))
                {
                    t = DateTime.Now.ToString();
                }


                new UIResText(t, new Point((int)res.Width - safe.X - 70, safe.Y - 60), 0.4f, Color.White,
                              Font.ChaletComprimeCologne, UIResText.Alignment.Right)
                {
                    DropShadow = true,
                }.Draw();

                string subt = MoneySubtitle;
                if (string.IsNullOrEmpty(MoneySubtitle))
                {
                    subt = "";
                }

                new UIResText(subt, new Point((int)res.Width - safe.X - 70, safe.Y - 40), 0.4f, Color.White,
                              Font.ChaletComprimeCologne, UIResText.Alignment.Right)
                {
                    DropShadow = true,
                }.Draw();

                for (int i = 0; i < Tabs.Count; i++)
                {
                    var activeSize = res.Width - 2 * safe.X;
                    activeSize -= 4 * 5;
                    int tabWidth = (int)activeSize / Tabs.Count;

                    Game.EnableControlThisFrame(0, Control.CursorX);
                    Game.EnableControlThisFrame(0, Control.CursorY);

                    var hovering = UIMenu.IsMouseInBounds(safe.AddPoints(new Point((tabWidth + 5) * i, 0)),
                                                          new Size(tabWidth, 40));

                    var tabColor = Tabs[i].Active
                        ? Color.White
                        : hovering?Color.FromArgb(100, 50, 50, 50) : Color.Black;

                    new UIResRectangle(safe.AddPoints(new Point((tabWidth + 5) * i, 0)), new Size(tabWidth, 40),
                                       Color.FromArgb(Tabs[i].Active ? 255 : 200, tabColor)).Draw();

                    new UIResText(Tabs[i].Title.ToUpper(), safe.AddPoints(new Point((tabWidth / 2) + (tabWidth + 5) * i, 5)),
                                  0.35f,
                                  Tabs[i].Active ? Color.Black : Color.White, Font.ChaletLondon, UIResText.Alignment.Centered)
                    .Draw();

                    if (Tabs[i].Active)
                    {
                        new UIResRectangle(safe.SubtractPoints(new Point(-((tabWidth + 5) * i), 10)),
                                           new Size(tabWidth, 10), Color.DodgerBlue).Draw();
                    }

                    if (hovering && Game.IsControlJustPressed(0, Control.CursorAccept) && !Tabs[i].Active)
                    {
                        Tabs[Index].Active  = false;
                        Tabs[Index].Focused = false;
                        Tabs[Index].Visible = false;
                        Index = (1000 - (1000 % Tabs.Count) + i) % Tabs.Count;
                        Tabs[Index].Active     = true;
                        Tabs[Index].Focused    = true;
                        Tabs[Index].Visible    = true;
                        Tabs[Index].JustOpened = true;

                        if (Tabs[Index].CanBeFocused)
                        {
                            FocusLevel = 1;
                        }
                        else
                        {
                            FocusLevel = 0;
                        }

                        Function.Call(Hash.PLAY_SOUND_FRONTEND, -1, "NAV_UP_DOWN", "HUD_FRONTEND_DEFAULT_SOUNDSET", 1);
                    }
                }
            }
            Tabs[Index].Draw();

            _sc.CallFunction("DRAW_INSTRUCTIONAL_BUTTONS", -1);

            _sc.Render2D();
        }
Ejemplo n.º 3
0
        public void Update()
        {
            if (!Visible || TemporarilyHidden)
            {
                return;
            }

            ShowInstructionalButtons();
            NativeFunction.Natives.HideHudAndRadarThisFrame();
            //NativeFunction.CallByHash<uint>(0xaae7ce1d63167423); // _SHOW_CURSOR_THIS_FRAME

            ProcessControls();

            var res  = UIMenu.GetScreenResolutionMantainRatio();
            var safe = new Point(300, 180);

            if (!HideTabs)
            {
                ResText.Draw(Title, new Point(safe.X, safe.Y - 80), 1f, Color.White, Common.EFont.ChaletComprimeCologne, ResText.Alignment.Left, true, false, Size.Empty);

                if (Photo == null)
                {
                    Sprite.Draw("char_multiplayer", "char_multiplayer", new Point((int)res.Width - safe.X - 64, safe.Y - 80), new Size(64, 64), 0f, Color.White);
                }
                else
                {
                    Photo.Position = new Point((int)res.Width - safe.X - 100, safe.Y - 80);
                    Photo.Size     = new Size(64, 64);
                    Photo.Draw();
                }

                ResText.Draw(Name, new Point((int)res.Width - safe.X - 70, safe.Y - 95), 0.7f, Color.White, Common.EFont.ChaletComprimeCologne, ResText.Alignment.Right, true, false, Size.Empty);

                string subt = Money;
                if (string.IsNullOrEmpty(Money))
                {
                    subt = DateTime.Now.ToString();
                }


                ResText.Draw(subt, new Point((int)res.Width - safe.X - 70, safe.Y - 60), 0.4f, Color.White, Common.EFont.ChaletComprimeCologne, ResText.Alignment.Right, true, false, Size.Empty);

                ResText.Draw(MoneySubtitle, new Point((int)res.Width - safe.X - 70, safe.Y - 40), 0.4f, Color.White, Common.EFont.ChaletComprimeCologne, ResText.Alignment.Right, true, false, Size.Empty);

                for (int i = 0; i < Tabs.Count; i++)
                {
                    var activeSize = res.Width - 2 * safe.X;
                    activeSize -= 4 * 5;
                    int tabWidth = (int)activeSize / Tabs.Count;

                    //Game.DisableControlAction(0, GameControl.CursorX, false);
                    //Game.DisableControlAction(0, GameControl.CursorY, false);

                    //bool hovering = UIMenu.IsMouseInBounds(safe.AddPoints(new Point((tabWidth + 5) * i, 0)), new Size(tabWidth, 40));

                    var tabColor = Tabs[i].Active ? Color.White : /*hovering ? Color.FromArgb(100, 50, 50, 50) :*/ Color.Black;
                    ResRectangle.Draw(safe.AddPoints(new Point((tabWidth + 5) * i, 0)), new Size(tabWidth, 40), Color.FromArgb(Tabs[i].Active ? 255 : 200, tabColor));

                    ResText.Draw(Tabs[i].Title.ToUpper(), safe.AddPoints(new Point((tabWidth / 2) + (tabWidth + 5) * i, 5)), 0.35f, Tabs[i].Active ? Color.Black : Color.White, Common.EFont.ChaletLondon, ResText.Alignment.Centered, false, false, Size.Empty);

                    if (Tabs[i].Active)
                    {
                        ResRectangle.Draw(safe.SubtractPoints(new Point(-((tabWidth + 5) * i), 10)), new Size(tabWidth, 10), Color.DodgerBlue);
                    }

                    //if (hovering && Common.IsDisabledControlJustPressed(0, GameControl.CursorAccept) && !Tabs[i].Active)
                    //{
                    //    Tabs[Index].Active = false;
                    //    Tabs[Index].Focused = false;
                    //    Tabs[Index].Visible = false;
                    //    Index = (1000 - (1000 % Tabs.Count) + i) % Tabs.Count;
                    //    Tabs[Index].Active = true;
                    //    Tabs[Index].Focused = true;
                    //    Tabs[Index].Visible = true;
                    //    Tabs[Index].JustOpened = true;

                    //    FocusLevel = Tabs[Index].CanBeFocused ? 1 : 0;

                    //    Common.PlaySound("NAV_UP_DOWN", "HUD_FRONTEND_DEFAULT_SOUNDSET");
                    //}
                }
            }

            Tabs[Index].Draw();

            _sc.CallFunction("DRAW_INSTRUCTIONAL_BUTTONS", -1);

            _sc.Render2D();
        }