Exemplo n.º 1
0
 public NavWindow(GameObject.MapEntities.Actors.Player Player, Microsoft.Xna.Framework.Graphics.Texture2D tex)
 {
     this.WM          = Gameplay.WindowManager;
     this.Player      = Player;
     this.Width       = 276;
     this.Height      = 300;
     this.AnchorRight = true;
     Placename        = new GUI.Controls.RichTextDisplay("World", 256, 20, WM)
     {
         Y = 0,
         X = 4
     };
     GUI.Controls.TextureContainer texcont = new GUI.Controls.TextureContainer(tex, WM)
     {
         Y = 20,
         X = 4
     };
     Coords = new GUI.Controls.RichTextDisplay("loading...", 256, 20, WM)
     {
         Y = 280,
         X = 4
     };
     this.AddControl(texcont);
     this.AddControl(Placename);
     this.AddControl(Coords);
 }
Exemplo n.º 2
0
        public NPCWindow(GUI.WindowManager WM, GameObject.MapEntities.Actors.NPC NPC, GameObject.MapEntities.Actors.Player Player)
        {
            this.Player = Player;
            this.Width  = 320;
            this.Height = 512;
            GUI.Controls.RichTextDisplay greeting = new GUI.Controls.RichTextDisplay(NPC.Greeting, 180, 200, WM);
            this.Controls.Add(greeting);
            this.Title = NPC.DisplayName;
            int yoffset = greeting.Height + 2;

            if (NPC.Commands != null && NPC.Commands.Count > 0)
            {
                for (int i = 0; i < NPC.Commands.Count; i++)
                {
                    NPCMenuItem mi = new NPCMenuItem(Player, NPC.Commands[i])
                    {
                        Y = yoffset
                    };
                    yoffset += mi.Height;
                    AddControl(mi);
                }
            }
            NPCMenuItem end = NPCMenuItem.Close();

            end.Y = yoffset;
            AddControl(end);
        }
Exemplo n.º 3
0
 public NPCMenuItem(GameObject.MapEntities.Actors.Player Player, string Label)
 {
     this.Title  = Label;
     this.Height = 20;
     this.Width  = 300;
     player      = Player;
 }
Exemplo n.º 4
0
 public InventoryWindow(GUI.WindowManager WM, GameObject.MapEntities.Actors.Player Player)
 {
     _ic         = new InventoryControl(WM, Player.Inventory);
     this.Width  = _ic.Width + 10;
     this.Height = _ic.Height + this.Margin.Y + this.Margin.Height;
     this.Title  = "Inventory";
     this.AddControl(_ic);
     this.X = 600;
     this.Y = 500;
 }
Exemplo n.º 5
0
        public StatusWindow(WindowManager WM, GameObject.MapEntities.Actors.Player Player)
        {
            this.Player            = Player;
            this.WM                = WM;
            this.Width             = 360;
            this.Height            = 500;
            this.Title             = "Status";
            this.OKButton          = new GUI.Controls.Button("Make something!");
            this.OKButton.Clicked += OKButton_Clicked;
            this.OKButton.Width    = 128;
            this.OKButton.Height   = 48;
            this.OKButton.X        = 64;
            this.OKButton.Y        = 49;
            this.AddControl(this.OKButton);

            this.slot   = new ItemSlot(null);
            this.slot.X = 0;
            this.slot.Y = 49;
            this.Controls.Add(this.slot);

            this.HPBar = new GUI.Controls.ProgressBar
            {
                DisplayLabel = true,
                Style        = 0,
                Height       = 16,
                Width        = 192,
                Colour       = new Color(255, 0, 80),
                X            = 3,
                Y            = 3
            };
            this.AddControl(HPBar);
            this.MPBar = new GUI.Controls.ProgressBar
            {
                DisplayLabel = true,
                Style        = 0,
                Height       = 16,
                Width        = 192,
                Colour       = new Color(25, 150, 255),
                X            = 3,
                Y            = 21
            };
            this.AddControl(MPBar);
            this.EXPBar = new GUI.Controls.ProgressBar
            {
                DisplayLabel = true,
                Style        = 0,
                Height       = 24,
                Width        = 192,
                Colour       = new Color(200, 100, 255),
                X            = 3,
                Y            = 39
            };
            this.AddControl(EXPBar);
            // this.AddControl(Texst);
        }
Exemplo n.º 6
0
 public NPCMenuItem(GameObject.MapEntities.Actors.Player Player, NPCCommand command)
 {
     this.Title  = command.Label;
     this.Height = 20;
     this.Width  = 300;
     player      = Player;
     if (command is OpenShop shop)
     {
         this.OnClick += new ClickEventHandler((sender, m) => OpenShop(shop.Shop));
     }
 }
Exemplo n.º 7
0
        ItemSlot makeslot(int id, GameObject.MapEntities.Actors.Player Player)
        {
            ItemSlot s = new ItemSlot(Player.Equipment[id]);

            s.X                  = 0;
            s.Y                  = 0;
            s.CanGrab            = true;
            s.CanPut             = true;
            s.BeforeItemChanged += new ItemSlot.ItemEventHandler((sender, e) =>
            {
                GameObject.Item item = (GameObject.Item)(e as ItemSlot.ItemEventArgs).Item;
                if ((item as GameObject.Items.ItemEquip) == null)
                {
                    e.Cancel = true;
                    if (item == null)
                    {
                        Console.Write("^FF0000 No item.");
                    }
                    else
                    {
                        List <string> ToolTip = item.GetTooltip();
                        Console.WriteEx("^BEGINLINK " + GUI.Renderer.ColourToCode(item.NameColour) + "[" + item.GetName() + "] ^ENDLINK ^FF0000 is not a suitable item.", new List <Action> {
                            new Action(() => { GUI.ToolTipWindow tip = new GUI.ToolTipWindow(this.WM, ToolTip, WM.MouseX, WM.MouseY, false);
                                               WM.Add(tip); })
                        });
                    }
                }
            });
            s.ItemOut += new ItemSlot.ItemEventHandler((sender, e) =>
            {
                int thisslot = id;
                GameObject.Items.ItemEquip item = (GameObject.Items.ItemEquip)(e as ItemSlot.ItemEventArgs).Item;
                List <string> ToolTip           = item.GetTooltip();
                Console.WriteEx("^BEGINLINK " + GUI.Renderer.ColourToCode(item.NameColour) + "[" + item.GetName() + "] ^ENDLINK ^FFFFFF is removed.", new List <Action> {
                    new Action(() => { GUI.ToolTipWindow tip = new GUI.ToolTipWindow(this.WM, ToolTip, WM.MouseX, WM.MouseY, false);
                                       WM.Add(tip); })
                });
                Player.UnequipItem(item, thisslot);
            });
            s.ItemIn += new ItemSlot.ItemEventHandler((sender, e) =>
            {
                int thisslot = id;
                GameObject.Items.ItemEquip item = (GameObject.Items.ItemEquip)(e as ItemSlot.ItemEventArgs).Item;
                List <string> ToolTip           = item.GetTooltip();
                Console.WriteEx("^BEGINLINK " + GUI.Renderer.ColourToCode(item.NameColour) + "[" + item.GetName() + "] ^ENDLINK ^FFFFFF is equipped.", new List <Action> {
                    new Action(() => { GUI.ToolTipWindow tip = new GUI.ToolTipWindow(this.WM, ToolTip, WM.MouseX, WM.MouseY, false);
                                       WM.Add(tip); })
                });
                Player.EquipItem(item, thisslot);
            });

            return(s);
        }
Exemplo n.º 8
0
 public TargetWindow(WindowManager WM, GameObject.MapEntities.Actors.Player Player)
 {
     this.Player             = Player;
     this.Width              = 200;
     this.Height             = 50;
     this.X                  = 500;
     this.HPBar              = new GUI.Controls.ProgressBar();
     this.HPBar.DisplayLabel = true;
     this.HPBar.Style        = 0;
     this.HPBar.Height       = 16;
     this.HPBar.Width        = 192;
     this.HPBar.Colour       = new Color(255, 0, 80);
     this.AddControl(HPBar);
 }
Exemplo n.º 9
0
        public EquipWindow(GUI.WindowManager WM, GameObject.MapEntities.Actors.Player Player)
        {
            this.Width  = 400 + 6 + 6;
            this.Height = 400 + 6 + 16;
            this.Title  = "Equipment";
            this.X      = 400;
            this.Y      = 400;

            GUI.Controls.TextureContainer tx = new GUI.Controls.TextureContainer(Gameplay.Textures["equipdoll"], WM);
            this.AddControl(tx);

            int y = 0;
            int x = 0;

            Point[] slots = new Point[]
            {
                new Point(314, 83),
                new Point(50, 83),
                new Point(175, 129),
                new Point(175, 244),
                new Point(104, 105),
                new Point(180, 346),
                new Point(89, 35),
                new Point(180, 10),
                new Point(270, 35),
                new Point(180, 74),
                new Point(314, 126),
                new Point(135, 74),
                new Point(230, 74),
                new Point(72, 190),
                new Point(288, 190),
            };
            ItemSlot s;

            for (int i = 0; i < GameObject.Items.ItemEquip.EquipSlot.Max; i++)
            {
                s   = makeslot(i, Player);
                s.X = slots[i].X;
                s.Y = slots[i].Y;
                tx.AddControl(s);
            }
        }
Exemplo n.º 10
0
        public StatusWindow(WindowManager WM, GameObject.MapEntities.Actors.Player Player)
        {
            this.Player = Player;
            this.WM     = WM;
            this.Width  = 360;
            this.Height = 500;
            this.Title  = "Status";
            this.HPBar  = new GUI.Controls.ProgressBar
            {
                DisplayLabel = true,
                Style        = 0,
                Height       = 16,
                Width        = 192,
                Colour       = new Color(255, 0, 80),
                X            = 3,
                Y            = 3
            };
            this.AddControl(HPBar);
            this.MPBar = new GUI.Controls.ProgressBar
            {
                DisplayLabel = true,
                Style        = 0,
                Height       = 16,
                Width        = 192,
                Colour       = new Color(25, 150, 255),
                X            = 3,
                Y            = 21
            };
            this.AddControl(MPBar);
            this.EXPBar = new GUI.Controls.ProgressBar
            {
                DisplayLabel = true,
                Style        = 0,
                Height       = 24,
                Width        = 192,
                Colour       = new Color(200, 100, 255),
                X            = 3,
                Y            = 39
            };
            this.AddControl(EXPBar);
            //all these will be moved to a separate GUI testing window someday ;_;


            this.OKButton          = new GUI.Controls.Button("Make something!");
            this.OKButton.Clicked += OKButton_Clicked;
            this.OKButton.Width    = 128;
            this.OKButton.Height   = 48;
            this.OKButton.X        = 0;
            this.OKButton.Y        = 300;
            this.AddControl(this.OKButton);

            this.slot   = new ItemSlot(null);
            this.slot.X = 0;
            this.slot.Y = 49;
            this.slot.Y = 0;
            //  this.Controls.Add(this.slot);

            GUI.Controls.TextBox box = new GUI.Controls.TextBox();
            box.Height = 20;
            box.Width  = 200;
            box.Y      = 100;
            box.Y      = 0;
            // AddControl(box);
            GUI.Controls.NumberBox nbox = new GUI.Controls.NumberBox();
            nbox.Height = 20;
            nbox.Width  = 200;
            nbox.Y      = 130;
            nbox.Y      = 0;
            nbox.Value  = 1204;
            // AddControl(nbox);

            ////
            recipe = new GameObject.ItemLogic.CraftingRecipe();
            GameObject.Item result       = MakeRandomEquip();
            GameObject.Item betterresult = (GameObject.Item)result.Clone();
            betterresult.NameColour = Color.Red;
            GameObject.Item comp  = MakeRandomMat();
            GameObject.Item comp2 = MakeRandomMat();
            comp.SubType  = 1;
            comp2.SubType = 2;
            recipe.Components.Add(new Tuple <GameObject.Item, int>(comp, 1));
            // recipe.Components.Add(new Tuple<GameObject.Item, int>(comp2, 1));
            recipe.Outputs[0] = new List <GameObject.Item>()
            {
                result
            };
            recipe.Outputs[1] = new List <GameObject.Item>()
            {
                betterresult
            };
            recipe.Outputs[2] = new List <GameObject.Item>()
            {
                betterresult
            };

            rs          = new ItemSlot(result);
            rs.X        = 40;
            rs.CanGrab  = false;
            rs.CanPut   = false;
            cs          = new ItemSlot(comp);
            cs.X        = 10;
            cs.Y        = 50;
            cs.CanGrab  = false;
            cs.CanPut   = false;
            cs2         = new ItemSlot(comp2);
            cs2.X       = 60;
            cs2.Y       = 50;
            cs2.CanGrab = false;
            cs2.CanPut  = false;
            GUI.Controls.Button craftb = new GUI.Controls.Button("Craft");
            craftb.Y        = 100;
            craftb.Width    = 150;
            craftb.Height   = 32;
            craftb.OnClick += CraftTest;



            GUI.Controls.TabbedView tabs = new GUI.Controls.TabbedView();
            AddControl(tabs);
            tabs.Width = 200;
            tabs.AddTab("first", new List <Control>()
            {
                slot
            });
            tabs.AddTab("second", new List <Control>()
            {
                cs, cs2, rs, craftb
            });
            tabs.AddTab("thirddd", new List <Control>()
            {
                box
            });
            tabs.Y      = 100;
            tabs.Height = 152;
            tabs.SetActiveTab(0);
            // this.AddControl(Texst);
        }