예제 #1
0
    // Update is called once per frame
    void Update()
    {
        //Tell all items that are being built to update themselves
        GUIEvents.TellItemsToUpdate(Time.deltaTime);

        if (Input.GetKeyDown("r"))
        {
            Resize();
        }
    }
예제 #2
0
    public void Execute()
    {
        //Draw Button
        if (GUI.Button(m_ButtonRect, (ID + 1).ToString(), m_ButtonStyle))
        {
            GUIEvents.QueueButtonPressed(this, ID);
        }

        if (Selected)
        {
            //Draw Queue Content
            m_QueueContent.Execute();
        }
    }
예제 #3
0
파일: TypeButton.cs 프로젝트: StalkerxD/RTS
    public void Execute()
    {
        //Draw type button
        if (GUI.Button(m_ButtonRect, m_Content, m_ButtonStyle))
        {
            GUIEvents.TypeButtonPressed(this, m_ButtonType);
        }

        if (Selected)
        {
            //Draw Queue Buttons
            foreach (QueueButton queueButton in m_QueueButtons)
            {
                queueButton.Execute();
            }
        }
    }
예제 #4
0
        protected Texture(String tex, Vec2i pos, Vec2i size, Texture parent, bool isSingleUser, int singleUserID, GUIEvents evts, bool useCreate)
            : base(pos, isSingleUser, singleUserID, parent)
        {
            if (tex == null)
            {
                tex = "";
            }
            this.tex = tex;
            this.size.set(size);

            this.enabledEvents = evts;

            if (useCreate)
            {
                create(-1);
            }
        }
예제 #5
0
        public Texture(int id, String tex, Vec2i position, Vec2i size, Texture parent, GUIEvents evts)
            : base(id, position)
        {
            this.enabledEvents = evts;
            this.parent        = parent;
            this.size.set(size);


            Process process = Process.ThisProcess();

            view = zCView.Create(process, position.X, position.Y, position.X + this.size.X, position.Y + this.size.Y);

            if (tex != null && tex != "")
            {
                zString text = zString.Create(process, tex);
                view.InsertBack(text);
                text.Dispose();
            }

            updateTimer         = new Timer(200);
            updateTimer.OnTick += timerTick;
        }
예제 #6
0
 public Button(String text, String tex, String font, int x, int y, int width, int height, Texture parent, GUIEvents evts)
     : this(text, tex, font, x, y, width, height, parent, false, 0, evts)
 {
 }
예제 #7
0
 public Button(String text, String tex, GUIEvents evts)
     : this(text, tex, 0, 0, 1700, 600, evts)
 {
 }
예제 #8
0
        public void Read(RakNet.BitStream stream, RakNet.Packet packet, Server server)
        {
            int  playerID = 0;
            byte type     = 0;

            stream.Read(out type);
            stream.Read(out playerID);

            Player pl = (Player)sWorld.VobDict[playerID];

            GuiMessageType gmT    = (GuiMessageType)type;
            int            viewID = 0;

            if (gmT == GuiMessageType.TextBoxCallSend)
            {
                String message;
                stream.Read(out viewID);
                stream.Read(out message);

                View v = getViewFromList(viewID);
                if (!(v is TextBox))
                {
                    throw new Exception("TextBoxCallSend needs a TextBox " + v);
                }
                TextBox tex = (TextBox)v;
                TextBox.OnTextSends(tex, (Scripting.Objects.Character.Player)pl.ScriptingNPC, message);
            }
            else if (gmT == GuiMessageType.ButtonPressed)
            {
                stream.Read(out viewID);

                View v = getViewFromList(viewID);
                if (!(v is Button))
                {
                    throw new Exception("ButtonPressed needs a Button " + v);
                }
                Button button = (Button)v;
                Button.OnButtonPress(button, (Scripting.Objects.Character.Player)pl.ScriptingNPC);
            }
            else if (gmT == GuiMessageType.GuiEvent)
            {
                int guiEvent = 0;
                stream.Read(out viewID);
                stream.Read(out guiEvent);

                GUIEvents evt = (GUIEvents)guiEvent;

                View v = getViewFromList(viewID);


                if (evt.HasFlag(GUIEvents.LeftClicked))
                {
                    if ((v is Button))
                    {
                        Button button = (Button)v;
                        Button.OnButtonPress(button, (Scripting.Objects.Character.Player)pl.ScriptingNPC);
                    }
                    Texture tex = (Texture)v;
                    Texture.isOnLeftClick(tex, (Scripting.Objects.Character.Player)pl.ScriptingNPC);
                }
                else if (evt.HasFlag(GUIEvents.RightClicked))
                {
                    Texture.isOnRightClick((Texture)v, (Scripting.Objects.Character.Player)pl.ScriptingNPC);
                }
                else if (evt.HasFlag(GUIEvents.Hover))
                {
                    bool hover = false;
                    stream.Read(out hover);
                    Texture.isOnHover((Texture)v, (Scripting.Objects.Character.Player)pl.ScriptingNPC, hover);
                }
                else if (evt.HasFlag(GUIEvents.ListButtonClicked))
                {
                    Scripting.GUI.GuiList.ListButton.isOnClick((Scripting.GUI.GuiList.ListButton)v, (Scripting.Objects.Character.Player)pl.ScriptingNPC);
                    //Texture.isOnHover((Texture)v, (Scripting.Objects.Character.Player)pl.ScriptingNPC, hover);
                }
                else if (evt.HasFlag(GUIEvents.ListTextBoxSend))
                {
                    String text = "";
                    stream.Read(out text);
                    Scripting.GUI.GuiList.ListTextBox.isOnTextSend((Scripting.GUI.GuiList.ListTextBox)v, (Scripting.Objects.Character.Player)pl.ScriptingNPC, text);
                    //Texture.isOnHover((Texture)v, (Scripting.Objects.Character.Player)pl.ScriptingNPC, hover);
                }
            }
        }
예제 #9
0
 public Button(String text, Vec2i pos, GUIEvents evts)
     : this(text, pos.X, pos.Y, evts)
 {
 }
예제 #10
0
 public Button(String text, int x, int y, GUIEvents evts)
     : this(text, "buttons_03.tga", x, y, 1700, 600, evts)
 {
 }
예제 #11
0
        public Button(String text, String tex, String font, ColorRGBA color, Vec2i pos, Vec2i size, Texture parent, GUIEvents evts, bool isSingleUser, int singleUserID)
            : base(tex, pos, size, parent, isSingleUser, singleUserID, evts, false)
        {
            this.text  = text;
            this.font  = font;
            this.color = color;

            create(-1);
        }
예제 #12
0
 public Button(String text, GUIEvents evts)
     : this(text, "buttons_03.tga", evts)
 {
 }
예제 #13
0
 public Texture(String tex, GUIEvents evts)
     : this(tex, 0, 0, 0x2000, 0x2000, evts)
 {
 }
예제 #14
0
 public Button(String text, String tex, String font, ColorRGBA color, Vec2i pos, Vec2i size, Texture parent, bool isSingleUser, int singleUserID, GUIEvents evts)
     : this(text, tex, "FONT_DEFAULT.TGA", ColorRGBA.White, pos, size, parent, evts, isSingleUser, singleUserID)
 {
 }
예제 #15
0
 public Texture(String tex, int x, int y, int width, int height, Texture parent, GUIEvents evts)
     : this(tex, x, y, width, height, parent, false, 0, evts)
 {
 }
예제 #16
0
 public Button(String text, String tex, int x, int y, int width, int height, GUIEvents evts)
     : this(text, tex, x, y, width, height, null, false, 0, evts)
 {
 }
예제 #17
0
 public Texture(String tex, int x, int y, int width, int height, Texture parent, bool isSingleUser, int singleUserID, GUIEvents evts)
     : this(tex, new Vec2i(x, y), new Vec2i(width, height), parent, isSingleUser, singleUserID, evts)
 {
 }
예제 #18
0
        public List(int id, int lines, String font, Vec2i pos, Vec2i size, String texture, Texture parent, GUIEvents evts)
            : base(id, texture, pos, size, parent, evts)
        {
            //Creation:
            Process process = Process.ThisProcess();

            setFont(font);


            emptyString = zString.Create(process, "");

            createTextViews(lines);
        }
예제 #19
0
 public Texture(String tex, Vec2i pos, Vec2i size, Texture parent, bool isSingleUser, int singleUserID, GUIEvents evts)
     : this(tex, pos, size, parent, isSingleUser, singleUserID, evts, true)
 {
 }
예제 #20
0
 public Button(String text, String tex, int x, int y, int width, int height, Texture parent, bool isSingleUser, int singleUserID, GUIEvents evts)
     : this(text, tex, "FONT_DEFAULT.TGA", ColorRGBA.White, new Vec2i(x, y), new Vec2i(width, height), parent, isSingleUser, singleUserID, evts)
 {
 }
예제 #21
0
 public Button(int id, String text, String tex, String font, ColorRGBA color, Vec2i position, Vec2i size, Texture parent, GUIEvents evts)
     : base(id, tex, position, size, parent, evts)
 {
     setFont(font);
     setText(text);
     setColor(color);
 }