예제 #1
0
파일: DialogGui.cs 프로젝트: wt616/JxqyHD
        public DialogGui()
        {
            LoadPortrait();
            BaseTexture = new Texture(Utils.GetAsf(@"asf\ui\dialog\", "panel.asf"));
            Width       = BaseTexture.Width;
            Height      = BaseTexture.Height;
            Position    = new Vector2((Globals.WindowWidth - BaseTexture.Width) / 2f,
                                      Globals.WindowHeight - 208f);
            _text = new TextGui(this,
                                new Vector2(65, 30),
                                310,
                                70,
                                Globals.FontSize12,
                                -2,
                                0,
                                "",
                                _defaultTextColor);
            _selectA = new TextGui(this,
                                   new Vector2(65, 52),
                                   310,
                                   20,
                                   Globals.FontSize12,
                                   1,
                                   0,
                                   "",
                                   Color.Blue * 0.8f);
            _selectB = new TextGui(this,
                                   new Vector2(65, 74),
                                   310,
                                   20,
                                   Globals.FontSize12,
                                   1,
                                   0,
                                   "",
                                   Color.Blue * 0.8f);
            _portrait = new GuiItem(this,
                                    new Vector2(5, -143),
                                    200,
                                    160,
                                    null);
            _selectA.MouseEnter    += (arg1, arg2) => _selectA.SetDrawColor(Color.Red * 0.8f);
            _selectA.MouseLeave    += (arg1, arg2) => _selectA.SetDrawColor(Color.Blue * 0.8f);
            _selectA.MouseLeftDown += (arg1, arg2) =>
            {
                if (IsInSelecting)
                {
                    IsInSelecting = false;
                    Selection     = 0;
                }
            };
            _selectB.MouseEnter    += (arg1, arg2) => _selectB.SetDrawColor(Color.Red * 0.8f);
            _selectB.MouseLeave    += (arg1, arg2) => _selectB.SetDrawColor(Color.Blue * 0.8f);
            _selectB.MouseLeftDown += (arg1, arg2) =>
            {
                if (IsInSelecting)
                {
                    IsInSelecting = false;
                    Selection     = 1;
                }
            };

            IsShow = false;
        }
예제 #2
0
파일: DialogGui.cs 프로젝트: zy1911/JxqyHD
        public DialogGui()
        {
            LoadPortrait();

            var cfg = GuiManager.Setttings.Sections["Dialog"];

            BaseTexture = new Texture(Utils.GetAsf(null, cfg["Image"]));
            Width       = BaseTexture.Width;
            Height      = BaseTexture.Height;
            Position    = new Vector2((Globals.WindowWidth - BaseTexture.Width) / 2f + int.Parse(cfg["LeftAdjust"]),
                                      Globals.WindowHeight + int.Parse(cfg["TopAdjust"]));

            cfg   = GuiManager.Setttings.Sections["Dialog_Txt"];
            _text = new TextGui(this,
                                new Vector2(int.Parse(cfg["Left"]), int.Parse(cfg["Top"])),
                                int.Parse(cfg["Width"]),
                                int.Parse(cfg["Height"]),
                                Globals.FontSize12,
                                int.Parse(cfg["CharSpace"]),
                                int.Parse(cfg["LineSpace"]),
                                "",
                                Utils.GetColor(cfg["Color"]));

            cfg      = GuiManager.Setttings.Sections["Dialog_SelA"];
            _selectA = new TextGui(this,
                                   new Vector2(int.Parse(cfg["Left"]), int.Parse(cfg["Top"])),
                                   int.Parse(cfg["Width"]),
                                   int.Parse(cfg["Height"]),
                                   Globals.FontSize12,
                                   int.Parse(cfg["CharSpace"]),
                                   int.Parse(cfg["LineSpace"]),
                                   "",
                                   Utils.GetColor(cfg["Color"]));

            cfg      = GuiManager.Setttings.Sections["Dialog_SelB"];
            _selectB = new TextGui(this,
                                   new Vector2(int.Parse(cfg["Left"]), int.Parse(cfg["Top"])),
                                   int.Parse(cfg["Width"]),
                                   int.Parse(cfg["Height"]),
                                   Globals.FontSize12,
                                   int.Parse(cfg["CharSpace"]),
                                   int.Parse(cfg["LineSpace"]),
                                   "",
                                   Utils.GetColor(cfg["Color"]));

            cfg       = GuiManager.Setttings.Sections["Dialog_Portrait"];
            _portrait = new GuiItem(this,
                                    new Vector2(int.Parse(cfg["Left"]), int.Parse(cfg["Top"])),
                                    int.Parse(cfg["Width"]),
                                    int.Parse(cfg["Height"]),
                                    null);
            _selectA.MouseEnter    += (arg1, arg2) => _selectA.SetDrawColor(Color.Red * 0.8f);
            _selectA.MouseLeave    += (arg1, arg2) => _selectA.SetDrawColor(Color.Blue * 0.8f);
            _selectA.MouseLeftDown += (arg1, arg2) =>
            {
                if (IsInSelecting)
                {
                    IsInSelecting = false;
                    Selection     = 0;
                }
            };
            _selectB.MouseEnter    += (arg1, arg2) => _selectB.SetDrawColor(Color.Red * 0.8f);
            _selectB.MouseLeave    += (arg1, arg2) => _selectB.SetDrawColor(Color.Blue * 0.8f);
            _selectB.MouseLeftDown += (arg1, arg2) =>
            {
                if (IsInSelecting)
                {
                    IsInSelecting = false;
                    Selection     = 1;
                }
            };

            IsShow = false;
        }