예제 #1
0
파일: ScrollBar.cs 프로젝트: wt616/JxqyHD
        public ScrollBar(GuiItem parent,
                         int width,
                         int height,
                         Texture baseTexture,
                         ScrollBarType type,
                         GuiItem slider,
                         Vector2 positon,
                         int minValue,
                         int maxValue,
                         int value)
            : base(parent, positon, width, height, baseTexture)
        {
            Type   = type;
            Slider = slider;
            switch (type)
            {
            case ScrollBarType.Vertical:
                Length = height;
                break;

            case ScrollBarType.Horizontal:
                Length = width;
                break;

            default:
                throw new ArgumentOutOfRangeException("type");
            }
            MinValue = minValue;
            MaxValue = maxValue;
            Value    = value;
            RegisterEvent();
        }
예제 #2
0
파일: TopGui.cs 프로젝트: zy1911/JxqyHD
 private void InitializeItems()
 {
     string[] sectionNames =
     {
         "Top_State_Btn",
         "Top_Equip_Btn",
         "Top_XiuLian_Btn",
         "Top_Goods_Btn",
         "Top_Magic_Btn",
         "Top_Memo_Btn",
         "Top_System_Btn",
     };
     for (var i = 0; i < 7; i++)
     {
         var cfg            = GuiManager.Setttings.Sections[sectionNames[i]];
         var asf            = Utils.GetAsf(null, cfg["Image"]);
         var baseTexture    = new Texture(asf, 0, 1);
         var clickedTexture = new Texture(asf, 1, 1);
         _buttons[i] = new GuiItem(this,
                                   new Vector2(int.Parse(cfg["Left"]), int.Parse(cfg["Top"])),
                                   int.Parse(cfg["Width"]),
                                   int.Parse(cfg["Height"]),
                                   baseTexture,
                                   null,
                                   clickedTexture,
                                   null,
                                   Utils.GetSoundEffect(cfg["Sound"]));
     }
     RegisterClickHandler();
 }
예제 #3
0
        public MagicGui()
        {
            var baseTexture = new Texture(Utils.GetAsf(@"asf\ui\common\", "panel2.asf"));
            var position    = new Vector2(
                Globals.WindowWidth / 2f,
                0f);

            _listView = new ListView(null,
                                     position,
                                     new Vector2(294, 108),
                                     baseTexture.Width,
                                     baseTexture.Height,
                                     baseTexture,
                                     12);
            _listView.Scrolled += delegate
            {
                UpdateItems();
            };
            _listView.RegisterItemDragHandler((arg1, arg2) =>
            {
            });
            _listView.RegisterItemDropHandler(DropHandler);
            _listView.RegisterItemMouseStayOverHandler(MouseStayOverHandler);
            _listView.RegisterItemMouseLeaveHandler(MouseLeaveHandler);
            _listView.RegisterItemMouseRightClickeHandler(MouseRightClickdHandler);

            IsShow = false;
        }
예제 #4
0
        public DragDropItem(GuiItem parent,
                            Vector2 position,
                            int width,
                            int height,
                            Texture baseTexture,
                            object data = null)
            : base(parent, position, width, height, baseTexture)
        {
            Data           = data;
            MouseLeftDown += delegate(object arg1, MouseLeftDownEvent arg2)
            {
                GuiManager.DragDropSourceItem    = this;
                GuiManager.DragDropSourceTexture = this.BaseTexture;
                GuiManager.IsDropped             = false;
                IsShow = false;
                if (Drag != null)
                {
                    Drag(this, new DragEvent(arg2.MouseScreenPosition));
                }
            };

            MouseLeftUp += delegate(object arg1, MouseLeftUpEvent arg2)
            {
                if (GuiManager.DragDropSourceItem != null)
                {
                    if (Drop != null &&
                        InRange)
                    {
                        Drop(this, new DropEvent(arg2.MouseScreenPosition, GuiManager.DragDropSourceItem));
                    }
                    GuiManager.IsDropped = true;
                }
            };
        }
예제 #5
0
        public override void ShowMagic(Magic magic)
        {
            Clear();
            IsShow = true;
            Texture texture = null;
            var     name    = "无名称";
            var     level   = "等级: 0";
            var     intro   = "无简介";

            if (magic != null)
            {
                texture = new Texture(magic.Image);
                if (!string.IsNullOrEmpty(magic.Name))
                {
                    name = magic.Name;
                }
                level = "等级: " + magic.CurrentLevel;
                if (!string.IsNullOrEmpty(magic.Intro))
                {
                    intro = magic.Intro;
                }
            }
            _image.BaseTexture = texture;
            _name.Text         = name;
            _costOrLevel.Text  = level;
            _magicIntro.Text   = intro;
        }
예제 #6
0
파일: MouseGui.cs 프로젝트: wt616/JxqyHD
 public MouseGui()
 {
     BaseTexture = new Texture(Utils.GetAsf(@"asf\ui\common\", "mouse.asf"));
     Width       = 0;
     Height      = 0;
     _drapImage  = new GuiItem(this, Vector2.Zero, 0, 0, null);
 }
예제 #7
0
        public MagicGui()
        {
            var cfg         = GuiManager.Setttings.Sections["Magics"];
            var baseTexture = new Texture(Utils.GetAsf(null, cfg["Image"]));
            var position    = new Vector2(
                Globals.WindowWidth / 2f + int.Parse(cfg["LeftAdjust"]),
                0f + int.Parse(cfg["TopAdjust"]));

            _listView = new ListView(null,
                                     position,
                                     new Vector2(294, 108),
                                     baseTexture.Width,
                                     baseTexture.Height,
                                     baseTexture,
                                     (MagicListManager.StoreIndexEnd - MagicListManager.StoreIndexBegin + 1 + 2) / 3,
                                     GuiManager.Setttings.Sections["Magics_List_Items"],
                                     int.Parse(cfg["ScrollBarWidth"]),
                                     int.Parse(cfg["ScrollBarHeight"]),
                                     cfg["ScrollBarButton"]);
            _listView.Scrolled += delegate
            {
                UpdateItems();
            };
            _listView.RegisterItemDragHandler((arg1, arg2) =>
            {
            });
            _listView.RegisterItemDropHandler(DropHandler);
            _listView.RegisterItemMouseStayOverHandler(MouseStayOverHandler);
            _listView.RegisterItemMouseLeaveHandler(MouseLeaveHandler);
            _listView.RegisterItemMouseRightClickeHandler(MouseRightClickdHandler);

            IsShow = false;
        }
예제 #8
0
 private void LoadTexture()
 {
     _player  = new Texture(Utils.GetAsf(@"asf\ui\littlemap\", "主角坐标.asf"));
     _enemy   = new Texture(Utils.GetAsf(@"asf\ui\littlemap\", "敌人坐标.asf"));
     _partner = new Texture(Utils.GetAsf(@"asf\ui\littlemap\", "同伴坐标.asf"));
     _neutral = new Texture(Utils.GetAsf(@"asf\ui\littlemap\", "路人坐标.asf"));
 }
예제 #9
0
파일: BottomGui.cs 프로젝트: wt616/JxqyHD
 public void SetItem(int index, Texture texture, string topLeftText = "")
 {
     if (index >= 0 && index < 8)
     {
         _items[index].BaseTexture = texture;
         _items[index].TopLeftText = topLeftText;
     }
 }
예제 #10
0
 public TopGui()
 {
     BaseTexture = new Texture(Utils.GetAsf(@"asf\ui\top\", "window.asf"));
     Width       = BaseTexture.Width;
     Height      = BaseTexture.Height;
     Position    = new Vector2((Globals.WindowWidth - BaseTexture.Width) / 2f, 0f);
     InitializeItems();
 }
예제 #11
0
파일: SystemGui.cs 프로젝트: wt616/JxqyHD
        public SystemGui()
        {
            BaseTexture = new Texture(Utils.GetAsf(
                                          @"asf\ui\common", "panel.asf"));
            Width    = BaseTexture.Width;
            Height   = BaseTexture.Height;
            Position = new Vector2(
                (Globals.WindowWidth - Width) / 2f,
                26);

            //Button
            var asf          = Utils.GetAsf(@"asf\ui\system", "saveload.asf");
            var clickedSound = Utils.GetSoundEffect("界-大按钮.wav");

            _saveloadButton = new GuiItem(this,
                                          new Vector2(58, 86),
                                          69,
                                          64,
                                          new Texture(asf, 0, 1),
                                          null,
                                          new Texture(asf, 1, 1),
                                          null,
                                          clickedSound);
            asf            = Utils.GetAsf(@"asf\ui\system", "option.asf");
            _opetionButton = new GuiItem(this,
                                         new Vector2(58, 150),
                                         69,
                                         54,
                                         new Texture(asf, 0, 1),
                                         null,
                                         new Texture(asf, 1, 1),
                                         null,
                                         clickedSound);
            asf         = Utils.GetAsf(@"asf\ui\system", "quit.asf");
            _exitButton = new GuiItem(this,
                                      new Vector2(58, 213),
                                      69,
                                      54,
                                      new Texture(asf, 0, 1),
                                      null,
                                      new Texture(asf, 1, 1),
                                      null,
                                      clickedSound);
            asf           = Utils.GetAsf(@"asf\ui\system", "return.asf");
            _returnButton = new GuiItem(this,
                                        new Vector2(58, 276),
                                        69,
                                        54,
                                        new Texture(asf, 0, 1),
                                        null,
                                        new Texture(asf, 1, 1),
                                        null,
                                        clickedSound);

            RegisterEvent();

            IsShow = false;
        }
예제 #12
0
        public MouseGui()
        {
            var cfg = GuiManager.Setttings.Sections["Mouse"];

            BaseTexture = new Texture(Utils.GetAsf(null, cfg["Image"]));
            Width       = 0;
            Height      = 0;
            _drapImage  = new GuiItem(this, Vector2.Zero, 0, 0, null);
        }
예제 #13
0
파일: ColumnGui.cs 프로젝트: wt616/JxqyHD
 public ColumnGui()
 {
     BaseTexture = new Texture(Utils.GetAsf(@"asf\ui\column\", "panel9.asf"));
     Width       = BaseTexture.Width;
     Height      = BaseTexture.Height;
     Position    = new Vector2(Globals.WindowWidth / 2f - 320,
                               Globals.WindowHeight - BaseTexture.Height);
     InitializeItems();
 }
예제 #14
0
        public EquipGui()
        {
            BaseTexture = new Texture(Utils.GetAsf(@"asf\ui\common\", "panel7.asf"));
            Width       = BaseTexture.Width;
            Height      = BaseTexture.Height;
            Position    = new Vector2(
                Globals.WindowWidth / 2f - Width,
                0f);

            _items[0] = _head = new DragDropItem(this,//Head
                                                 new Vector2(47, 66),
                                                 60,
                                                 75,
                                                 null,
                                                 new GoodsGui.GoodItemData(201));

            _items[1] = _neck = new DragDropItem(this, //Neck
                                                 new Vector2(193, 66),
                                                 60,
                                                 75,
                                                 null,
                                                 new GoodsGui.GoodItemData(202));
            _items[2] = _body = new DragDropItem(this, //Body
                                                 new Vector2(121, 168),
                                                 60,
                                                 75,
                                                 null,
                                                 new GoodsGui.GoodItemData(203));
            _items[3] = _back = new DragDropItem(this, //Back
                                                 new Vector2(193, 267),
                                                 60,
                                                 75,
                                                 null,
                                                 new GoodsGui.GoodItemData(204));
            _items[4] = _hand = new DragDropItem(this, //Hand
                                                 new Vector2(193, 168),
                                                 60,
                                                 75,
                                                 null,
                                                 new GoodsGui.GoodItemData(205));
            _items[5] = _wrist = new DragDropItem(this, //Wrist
                                                  new Vector2(47, 168),
                                                  60,
                                                  75,
                                                  null,
                                                  new GoodsGui.GoodItemData(206));
            _items[6] = _foot = new DragDropItem(this, //Foot
                                                 new Vector2(47, 267),
                                                 60,
                                                 75,
                                                 null,
                                                 new GoodsGui.GoodItemData(207));
            RegisterEventHandler();

            IsShow = false;
        }
예제 #15
0
 public XiuLianGui()
 {
     BaseTexture = new Texture(Utils.GetAsf(@"asf\ui\common\", "panel6.asf"));
     Width       = BaseTexture.Width;
     Height      = BaseTexture.Height;
     Position    = new Vector2(
         Globals.WindowWidth / 2f - Width,
         0f);
     _infoItem = new DragDropItem(this,
                                  new Vector2(115, 75),
                                  60,
                                  75,
                                  null,
                                  new MagicGui.MagicItemData(ItemIndex));
     _infoItem.Drop          += MagicGui.DropHandler;
     _infoItem.Drop          += (arg1, arg2) => _isItemChange = true;
     _infoItem.MouseStayOver += MagicGui.MouseStayOverHandler;
     _infoItem.MouseLeave    += MagicGui.MouseLeaveHandler;
     _levelText = new TextGui(this,
                              new Vector2(126, 224),
                              80,
                              12,
                              Globals.FontSize7,
                              0,
                              0,
                              "",
                              Color.Black * 0.8f);
     _expText = new TextGui(this,
                            new Vector2(126, 243),
                            80,
                            12,
                            Globals.FontSize7,
                            0,
                            0,
                            "",
                            Color.Black * 0.8f);
     _nameText = new TextGui(this,
                             new Vector2(105, 256),
                             200,
                             20,
                             Globals.FontSize12,
                             0,
                             0,
                             "",
                             new Color(88, 32, 32) * 0.9f);
     _introText = new TextGui(this,
                              new Vector2(75, 275),
                              145,
                              120,
                              Globals.FontSize10,
                              2,
                              0,
                              "",
                              new Color(47, 32, 88) * 0.9f);
 }
예제 #16
0
파일: BottomGui.cs 프로젝트: wt616/JxqyHD
        public BottomGui()
        {
            BaseTexture = new Texture(Utils.GetAsf(@"asf\ui\bottom\", "window.asf"));
            Width       = BaseTexture.Width;
            Height      = BaseTexture.Height;
            Position    = new Vector2(
                (Globals.WindowWidth - BaseTexture.Width) / 2f + 102,
                Globals.WindowHeight - BaseTexture.Height);

            InitializeItems();
        }
예제 #17
0
파일: TopGui.cs 프로젝트: zy1911/JxqyHD
        public TopGui()
        {
            var cfg = GuiManager.Setttings.Sections["Top"];

            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"]),
                                      0f + int.Parse(cfg["TopAdjust"]));
            InitializeItems();
        }
예제 #18
0
파일: MemoGui.cs 프로젝트: zy1911/JxqyHD
        public MemoGui()
        {
            var cfg = GuiManager.Setttings.Sections["Memo"];

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

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

            cfg = GuiManager.Setttings.Sections["Memo_Slider"];
            var slideTexture       = Utils.GetAsf(null, cfg["Image_Btn"]);
            var slideBaseTexture   = new Texture(slideTexture);
            var slideClikedTexture = new Texture(slideTexture, 0, 1);
            var slideButton        = new GuiItem(this,
                                                 Vector2.Zero,
                                                 slideBaseTexture.Width,
                                                 slideBaseTexture.Height,
                                                 slideBaseTexture,
                                                 null,
                                                 slideClikedTexture,
                                                 null,
                                                 Utils.GetSoundEffect(cfg["Sound_Btn"]));

            _scrollBar = new ScrollBar(this,
                                       int.Parse(cfg["Width"]),
                                       int.Parse(cfg["Height"]),
                                       null,
                                       ScrollBar.ScrollBarType.Vertical,
                                       slideButton,
                                       new Vector2(int.Parse(cfg["Left"]), int.Parse(cfg["Top"])),
                                       0,
                                       1,
                                       0);
            _scrollBar.Scrolled += (arg1, arg2) => SetTextShow(arg2.Value);

            MouseScrollUp   += (arg1, arg2) => _scrollBar.Value -= 1;
            MouseScrollDown += (arg1, arg2) => _scrollBar.Value += 1;

            IsShow = false;
        }
예제 #19
0
파일: BuyGui.cs 프로젝트: wt616/JxqyHD
        public BuyGui()
        {
            var baseTexture = new Texture(Utils.GetAsf(@"asf\ui\common\", "panel8.asf"));
            var position    = new Vector2(
                Globals.WindowWidth / 2f - baseTexture.Width,
                0f);

            _listView = new ListView(null,
                                     position,
                                     new Vector2(271, 108),
                                     baseTexture.Width,
                                     baseTexture.Height,
                                     baseTexture,
                                     27,
                                     new Vector2(-17, 0));
            var asf = Utils.GetAsf(@"asf\ui\buysell\", "CloseBtn.asf");

            baseTexture  = new Texture(asf, 0, 1);
            _closeButton = new GuiItem(_listView,
                                       new Vector2(117, 354),
                                       baseTexture.Width,
                                       baseTexture.Height,
                                       baseTexture,
                                       null,
                                       new Texture(asf, 1, 1),
                                       null,
                                       Utils.GetSoundEffect("界-大按钮.wav"));
            _listView.Scrolled += (arg1, arg2) => UpdateItems();
            _listView.RegisterItemMouseStayOverHandler((arg1, arg2) =>
            {
                var item  = (DragDropItem)arg1;
                var index = (int)item.Data;
                if (_goods.ContainsKey(index))
                {
                    GuiManager.ToolTipInterface.ShowGood(_goods[index]);
                }
            });
            _listView.RegisterItemMouseLeaveHandler(
                (arg1, arg2) => GuiManager.ToolTipInterface.IsShow = false);
            _listView.RegisterItemMouseRightClickeHandler((arg1, arg2) =>
            {
                var item  = (DragDropItem)arg1;
                var index = (int)item.Data;
                if (_goods.ContainsKey(index))
                {
                    Globals.ThePlayer.BuyGood(_goods[index]);
                }
            });
            _closeButton.Click += (arg1, arg2) => GuiManager.EndBuyGoods();

            IsShow = false;
        }
예제 #20
0
파일: BuyGui.cs 프로젝트: wt616/JxqyHD
 private void UpdateItems()
 {
     for (var i = 0; i < 9; i++)
     {
         Texture texture = null;
         var     index   = _listView.ToListIndex(i);
         if (_goods.ContainsKey(index) &&
             _goods[index] != null)
         {
             texture = new Texture(_goods[index].Image);
         }
         _listView.SetListItem(i, texture, index);
     }
 }
예제 #21
0
파일: MemoGui.cs 프로젝트: wt616/JxqyHD
        public MemoGui()
        {
            BaseTexture = new Texture(Utils.GetAsf(@"asf\ui\common\", "panel4.asf"));
            Width       = BaseTexture.Width;
            Height      = BaseTexture.Height;
            Position    = new Vector2(
                Globals.WindowWidth / 2f,
                0f);

            _text = new TextGui(this,
                                new Vector2(90, 155),
                                150,
                                180,
                                Globals.FontSize10,
                                1,
                                1,
                                "",
                                new Color(40, 25, 15) * 0.8f);

            var slideTexture       = Utils.GetAsf(@"asf\ui\option\", "slidebtn.asf");
            var slideBaseTexture   = new Texture(slideTexture);
            var slideClikedTexture = new Texture(slideTexture, 0, 1);
            var slideButton        = new GuiItem(this,
                                                 Vector2.Zero,
                                                 slideBaseTexture.Width,
                                                 slideBaseTexture.Height,
                                                 slideBaseTexture,
                                                 null,
                                                 slideClikedTexture,
                                                 null,
                                                 Utils.GetSoundEffect("界-大按钮.wav"));

            _scrollBar = new ScrollBar(this,
                                       28,
                                       190,
                                       null,
                                       ScrollBar.ScrollBarType.Vertical,
                                       slideButton,
                                       new Vector2(295, 108),
                                       0,
                                       1,
                                       0);
            _scrollBar.Scrolled += (arg1, arg2) => SetTextShow(arg2.Value);

            MouseScrollUp   += (arg1, arg2) => _scrollBar.Value -= 1;
            MouseScrollDown += (arg1, arg2) => _scrollBar.Value += 1;

            IsShow = false;
        }
예제 #22
0
        public LittleMapGui()
        {
            BaseTexture = new Texture(Utils.GetAsf(@"asf\ui\littlemap\", "panel.asf"));
            Width       = BaseTexture.Width;
            Height      = BaseTexture.Height;
            Position    = new Vector2(
                (Globals.WindowWidth - Width) / 2f,
                0f);
            LoadItems();
            RegisterHadler();
            LoadNameList();
            LoadTexture();

            IsShow = false;
        }
예제 #23
0
        public LittleMapGui()
        {
            var cfg = GuiManager.Setttings.Sections["LittleMap"];

            BaseTexture = new Texture(Utils.GetAsf(@"asf\ui\littlemap\", "panel.asf"));
            Width       = BaseTexture.Width;
            Height      = BaseTexture.Height;
            Position    = new Vector2(
                (Globals.WindowWidth - Width) / 2f + int.Parse(cfg["LeftAdjust"]),
                0f + int.Parse(cfg["TopAdjust"]));
            LoadItems();
            RegisterHadler();
            LoadNameList();
            LoadTexture();

            IsShow = false;
        }
예제 #24
0
파일: GoodsGui.cs 프로젝트: Pircs/JxqyHD
        public GoodsGui()
        {
            var cfg         = GuiManager.Setttings.Sections["Goods"];
            var baseTexture = new Texture(Utils.GetAsf(null, cfg["Image"]));
            var position    = new Vector2(
                Globals.WindowWidth / 2f + int.Parse(cfg["LeftAdjust"]),
                0f + int.Parse(cfg["TopAdjust"]));

            _listView = new ListView(null,
                                     position,
                                     new Vector2(int.Parse(cfg["ScrollBarLeft"]), int.Parse(cfg["ScrollBarRight"])),
                                     baseTexture.Width,
                                     baseTexture.Height,
                                     baseTexture,
                                     (GoodsListManager.StoreIndexEnd - GoodsListManager.StoreIndexBegin + 1 + 2) / 3,
                                     GuiManager.Setttings.Sections["Goods_List_Items"],
                                     int.Parse(cfg["ScrollBarWidth"]),
                                     int.Parse(cfg["ScrollBarHeight"]),
                                     cfg["ScrollBarButton"],
                                     GoodsListManager.Type != GoodsListManager.ListType.TypeByGoodItem);
            _listView.Scrolled += delegate
            {
                UpdateItems();
            };
            _listView.RegisterItemDragHandler((arg1, arg2) =>
            {
            });
            _listView.RegisterItemDropHandler(DropHandler);
            _listView.RegisterItemMouseRightClickeHandler(RightClickHandler);
            _listView.RegisterItemMouseStayOverHandler(MouseStayOverHandler);
            _listView.RegisterItemMouseLeaveHandler(MouseLeaveHandler);

            cfg    = GuiManager.Setttings.Sections["Goods_Money"];
            _money = new TextGui(_listView,
                                 new Vector2(int.Parse(cfg["Left"]), int.Parse(cfg["Top"])),
                                 int.Parse(cfg["Width"]),
                                 int.Parse(cfg["Height"]),
                                 Globals.FontSize7,
                                 0,
                                 0,
                                 "",
                                 Utils.GetColor(cfg["Color"]));

            IsShow = false;
        }
예제 #25
0
파일: BuyGui.cs 프로젝트: mapic91/JxqyHD
 private void UpdateItems()
 {
     for (var i = 0; i < 9; i++)
     {
         Texture texture  = null;
         var     countStr = "";
         var     index    = _listView.ToListIndex(i);
         if (_goods.ContainsKey(index) &&
             _goods[index] != null &&
             _goods[index].TheGood != null)
         {
             texture  = new Texture(_goods[index].TheGood.Image);
             countStr = _goods[index].Count.ToString();
         }
         _listView.SetListItem(i, texture, index);
         _listView.SetItemTopLeftText(i, _numberValid ? countStr : "");
     }
 }
예제 #26
0
        public TimerGui()
        {
            BaseTexture = new Texture(Utils.GetAsf(@"asf\ui\timer\", "window.asf"));
            Width       = BaseTexture.Width;
            Height      = BaseTexture.Height;
            Position    = new Vector2(Globals.WindowWidth / 2f + 103, 0);
            _text       = new TextGui(this,
                                      new Vector2(74, 44),
                                      120,
                                      22,
                                      Globals.FontSize12,
                                      1,
                                      0,
                                      "",
                                      Color.Red * 0.8f);

            IsShow = false;
        }
예제 #27
0
        public MessageGui()
        {
            BaseTexture = new Texture(Utils.GetAsf(@"asf\ui\message\", "msgbox.asf"));
            Width       = BaseTexture.Width;
            Height      = BaseTexture.Height;
            Position    = new Vector2((Globals.WindowWidth - Width) / 2 - 10,
                                      Globals.WindowHeight - 47 - Height);
            _message = new TextGui(this,
                                   new Vector2(46, 32),
                                   148,
                                   50,
                                   Globals.FontSize12,
                                   0,
                                   1,
                                   "",
                                   new Color(155, 34, 22) * 0.8f);

            IsShow = false;
        }
예제 #28
0
        private void InitializeItems()
        {
            string[] fileNames =
            {
                "BtnState.asf",   //0
                "BtnEquip.asf",   //1
                "BtnXiuLian.asf", //2
                "BtnGoods.asf",   //3
                "BtnMagic.asf",   //4
                "BtnNotes.asf",   //5
                "BtnOption.asf"   //6
            };
            Vector2[] position =
            {
                new Vector2(52,  0),
                new Vector2(80,  0),
                new Vector2(107, 0),
                new Vector2(135, 0),
                new Vector2(162, 0),
                new Vector2(189, 0),
                new Vector2(216, 0)
            };
            var clickedSound = Utils.GetSoundEffect("界-大按钮.wav");

            for (var i = 0; i < 7; i++)
            {
                var asf            = Utils.GetAsf(@"asf\ui\top\", fileNames[i]);
                var baseTexture    = new Texture(asf, 0, 1);
                var clickedTexture = new Texture(asf, 1, 1);
                _buttons[i] = new GuiItem(this,
                                          position[i],
                                          baseTexture.Width,
                                          baseTexture.Height,
                                          baseTexture,
                                          null,
                                          clickedTexture,
                                          null,
                                          clickedSound);
            }
            RegisterClickHandler();
        }
예제 #29
0
파일: TimerGui.cs 프로젝트: zy1911/JxqyHD
        public TimerGui()
        {
            var cfg = GuiManager.Setttings.Sections["Timer"];

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

            cfg   = GuiManager.Setttings.Sections["Timer_Text"];
            _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"]));

            IsShow = false;
        }
예제 #30
0
        public GoodsGui()
        {
            var baseTexture = new Texture(Utils.GetAsf(@"asf\ui\common\", "panel3.asf"));
            var position    = new Vector2(
                Globals.WindowWidth / 2f,
                0f);

            _listView = new ListView(null,
                                     position,
                                     new Vector2(294, 108),
                                     baseTexture.Width,
                                     baseTexture.Height,
                                     baseTexture,
                                     66);
            _listView.Scrolled += delegate
            {
                UpdateItems();
            };
            _listView.RegisterItemDragHandler((arg1, arg2) =>
            {
            });
            _listView.RegisterItemDropHandler(DropHandler);
            _listView.RegisterItemMouseRightClickeHandler(RightClickHandler);
            _listView.RegisterItemMouseStayOverHandler(MouseStayOverHandler);
            _listView.RegisterItemMouseLeaveHandler(MouseLeaveHandler);
            _money = new TextGui(_listView,
                                 new Vector2(137, 363),
                                 100,
                                 12,
                                 Globals.FontSize7,
                                 0,
                                 0,
                                 "",
                                 Color.White * 0.8f);

            IsShow = false;
        }