예제 #1
0
 public GUI_event(int windowID, int groupID, GUI_item guiItem, float value)
 {
     WindowID     = windowID;
     this.guiItem = guiItem;
     GroupID      = groupID;
     ItemID       = guiItem.ID;
     MouseButton  = 0;
     Value        = value;
 }
예제 #2
0
 public GUI_event(int windowID, int groupID, GUI_item guiItem, int mouseButton)
 {
     WindowID     = windowID;
     this.guiItem = guiItem;
     GroupID      = groupID;
     ItemID       = guiItem.ID;
     MouseButton  = mouseButton;
     Value        = 0;
 }
예제 #3
0
        public static GUIStyle GetGuiStyle(GUI_item item)
        {
            if (!isInitStyles)
            {
                isInitStyles = SetGUIStyles();
            }

            switch (item.ContentType)
            {
            case GUI_Item_Type.NORMALBUTTON:
                SimpleSkin.button.normal.textColor = GetGuiColor(item.TextColor.Normal);
                SimpleSkin.button.hover.textColor  = GetGuiColor(item.TextColor.Hover);
                SimpleSkin.button.active.textColor = GetGuiColor(item.TextColor.Active);
                SimpleSkin.button.fontStyle        = item.FontStyle;
                SimpleSkin.button.alignment        = item.Align;
                SimpleSkin.button.wordWrap         = item.WordWrap;
                SimpleSkin.button.clipping         = item.Clipping;
                return(SimpleSkin.button);

            case GUI_Item_Type.TOGGLEBUTTON:
            case GUI_Item_Type.TAB:
                if (item.State == GUI_Item_State.PRESSED)
                {
                    Tab.normal.background = normalTexture;
                    Tab.hover.background  = hoverTexture;
                    Tab.active.background = activeTexture;
                    Tab.normal.textColor  = GetGuiColor(item.TextColor.Active);
                    Tab.hover.textColor   = GetGuiColor(item.TextColor.Hover);
                    Tab.active.textColor  = GetGuiColor(item.TextColor.Active);
                }
                else
                {
                    Tab.normal.background = normalTexture;
                    Tab.hover.background  = hoverTexture;
                    Tab.active.background = activeTexture;
                    Tab.normal.textColor  = GetGuiColor(item.TextColor.Normal);
                    Tab.hover.textColor   = GetGuiColor(item.TextColor.Hover);
                    Tab.active.textColor  = GetGuiColor(item.TextColor.Active);
                }

                Tab.fontStyle = item.FontStyle;
                Tab.alignment = item.Align;
                Tab.wordWrap  = item.WordWrap;
                Tab.clipping  = item.Clipping;
                return(Tab);

            case GUI_Item_Type.LABEL:
                Label.normal.textColor = GetGuiColor(item.TextColor.Normal);
                Label.fontStyle        = item.FontStyle;
                Label.alignment        = item.Align;
                Label.wordWrap         = item.WordWrap;
                Label.clipping         = item.Clipping;
                return(Label);

            case GUI_Item_Type.GROUPLABEL:
                Label.normal.textColor = GetGuiColor(item.TextColor.Normal);
                Label.fontStyle        = item.FontStyle;
                Label.alignment        = item.Align;
                Label.wordWrap         = item.WordWrap;
                Label.clipping         = item.Clipping;
                return(Label);

            case GUI_Item_Type.TEXTFIELD:
                TextField.normal.textColor = GetGuiColor(item.TextColor.Normal);
                TextField.fontStyle        = item.FontStyle;
                TextField.alignment        = item.Align;
                TextField.wordWrap         = item.WordWrap;
                TextField.clipping         = item.Clipping;
                return(TextField);

            case GUI_Item_Type.TEXTAREA:
                TextArea.normal.textColor = GetGuiColor(item.TextColor.Normal);
                TextArea.fontStyle        = item.FontStyle;
                TextArea.alignment        = item.Align;
                TextArea.wordWrap         = item.WordWrap;
                TextArea.clipping         = item.Clipping;
                return(TextArea);

            case GUI_Item_Type.DROPDOWN:
                return(DropDown);
            }

            return(Label);
        }