Beispiel #1
0
    protected override void Load()
    {
        base.Load();

        Skin = Resources.Load("GUI/UI Skin") as GUISkin;

        UpArrow      = Resources.Load("GUI/FullUpArrow") as Texture;
        DisableArrow = Resources.Load("GUI/EmptyUpArrow") as Texture;

        TheCharacter    = GameState.Instance.PlayerObject;
        this.Background = Resources.Load("GUI/PlainBackground") as Texture;

        NewImageButton(Alignments.Max, Margin, Alignments.Absolute, Margin, Resources.Load("GUI/CloseBox") as Texture, Close);
        NewLabel(Alignments.Absolute, Margin, Alignments.Absolute, Margin, 256, 32, TheCharacter.Name + ":Stats");
        XPLabel = NewLabel(Alignments.Absolute, Margin, Alignments.Absolute, 54, 256, 32, "XP:" + TheCharacter.XP.ToString());
        NewLabel(Alignments.Max, Margin * 5, Alignments.Absolute, Margin * 2.5f, 64, 32, "Skills").SetFont(Color.white, 24);

        ToolTipElement     = NewImage(Alignments.Absolute, 0, Alignments.Max, 0, Resources.Load("GUI/WideToolTip") as Texture);
        ToolTipTextElement = ToolTipElement.NewLabel(Alignments.Absolute, 35, Alignments.Absolute, 15, 450, 32, "Blerg");

        ToolTipTextElement.TextStyle                  = new GUIStyle();
        ToolTipTextElement.TextStyle.font             = Resources.Load("GUI/ALEAWBB_") as Font;
        ToolTipTextElement.TextStyle.normal.textColor = Color.white;
        ToolTipTextElement.TextStyle.fontSize         = 12;

        ToolTipElement.Enabled = false;

        SetPlayerData();
    }
Beispiel #2
0
        /// <summary>
        /// Add new Button for a new Pattern
        /// </summary>
        private void AddPatternButton(string nameOfButton, Bitmap icon)
        {
            //Generate new Button
            Button patternButton = new Button();

            patternButtons.Add(patternButton);
            this.Controls.Add(patternButton);


            //Get Some Variables for New Button Parameters
            int xPosNew = 4;

            if ((patternButtons.Count + 1) % 2 != 0)
            {
                xPosNew = 42;
            }

            //Set new Button Parameters
            patternButton.BackgroundImage            = icon;
            patternButton.BackgroundImageLayout      = ImageLayout.Center;
            patternButton.FlatAppearance.BorderColor = Color.DarkGray;
            patternButton.FlatStyle = FlatStyle.Flat;
            patternButton.Location  = new Point(xPosNew, 277 + (38 * (int)((patternButtons.Count + 1) / 2)));;
            patternButton.Name      = nameOfButton + "_" + patternButtons.Count;
            patternButton.Size      = paintmode_add.Size;
            patternButton.TabIndex  = paintmode_add.TabIndex;
            ToolTipElement.SetToolTip(patternButton, "Add " + nameOfButton + " to Grid");
            patternButton.UseVisualStyleBackColor = true;
            patternButton.Click     += new System.EventHandler(paintmode_custom_Click);
            patternButton.MouseDown += new System.Windows.Forms.MouseEventHandler(paintmode_custom_MouseRightClick);

            UpdateAddPatternButton();
        }
Beispiel #3
0
 protected override void OnVisibleChanged(EventArgs e)
 {
     base.OnVisibleChanged(e);
     if (ToolTipElement.Visible)
     {
         ToolTipElement.Hide();
     }
 }
Beispiel #4
0
        public void SetToolTip(ToolTipElement toolTip)
        {
            if (toolTip != this.CurrentToolTip)
            {
                this.HideToolTip();
            }

            this.CurrentToolTip = toolTip;
        }
Beispiel #5
0
        /// <summary>
        /// Disposes the control.
        /// </summary>
        /// <param name="disposing">Whether Dispose has been called.</param>
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

            if (this.toolTipElement != null)
            {
                this.toolTipElement.Dispose();
            }

            if (disposing)
            {
                this.textElement    = null;
                this.toolTipElement = null;
            }
        }
Beispiel #6
0
    public InventoryScreen()
    {
        Enabled = false;

        Bounds      = new Rect(50, 10, 512, 512 + 15);
        HAlignement = Alignments.Absolute;
        VAlignement = Alignments.Max;

        ToolTipStyle.font             = Resources.Load("GUI/MIGHZV2") as Font;
        ToolTipStyle.fontSize         = 12;
        ToolTipStyle.normal.textColor = Color.white;

        ToolTipElement     = NewImage(Alignments.Absolute, 0, Alignments.Max, 0, Resources.Load("GUI/WideToolTip") as Texture);
        ToolTipTextElement = ToolTipElement.NewLabel(Alignments.Absolute, 35, Alignments.Absolute, 15, 450, 32, "Blerg");

        ToolTipElement.Enabled = false;

//         ToolTipBackgorund = Resources.Load("GUI/tooltip") as Texture;
//         ToolTipOffset = new Vector2(-ToolTipBackgorund.width / 4, -180);
//  //       ToolTipOffset = new Vector2(-20, -60);
//         ToolTipRect = new Rect(38, -50, 150, 60);
//         KeepToolTipInBounds = false;
    }
Beispiel #7
0
        public static IElement ParseElement(string localizedType, string designedId, string designedName, IElement parent)
        {
            IElement element = null;

            switch (localizedType.ToLower())
            {
            case ElementBase.WINDOW:
                element = new WindowElement();
                element.Attributes.ElementType = ElementBase.WINDOW_TYPE;
                break;

            case ElementBase.DIALOG:
                element = new WindowElement();
                element.Attributes.ElementType = ElementBase.DIALOG_TYPE;
                break;

            case ElementBase.BUTTON:
                element = new ButtonElement();
                element.Attributes.ElementType = ElementBase.BUTTON_TYPE;
                break;

            case ElementBase.COMBO_BOX:
                element = new ComboBoxElement();
                element.Attributes.ElementType = ElementBase.COMBOBOX_TYPE;
                break;

            case ElementBase.TEXT:
                element = new TextElement();
                element.Attributes.ElementType = ElementBase.TEXT_TYPE;
                break;

            case ElementBase.PANE:
                element = new ContainerElement();
                element.Attributes.ElementType = ElementBase.CONTAINER_TYPE;
                break;

            case ElementBase.TITLE_BAR:
                element = new TitleBarElement();
                element.Attributes.ElementType = ElementBase.TITLEBAR_TYPE;
                break;

            case ElementBase.MENU_BAR:
                element = new MenuBarElement();
                element.Attributes.ElementType = ElementBase.MENUBAR_TYPE;
                break;

            case ElementBase.DOCUMENT:
                element = new EditableTextElement();
                element.Attributes.ElementType = ElementBase.EDITABLETEXT_TYPE;
                break;

            case ElementBase.TAB:
                element = new TabPageElement();
                element.Attributes.ElementType = ElementBase.TABPAGE_TYPE;
                break;

            case ElementBase.TAB_ITEM:
                element = new TabItemElement();
                element.Attributes.ElementType = ElementBase.TABITEM_TYPE;
                break;

            case ElementBase.SCROLL_BAR:
                element = new ScrollBarElement();
                element.Attributes.ElementType = ElementBase.SCROLLBAR_TYPE;
                break;

            //case THUMB:
            case ElementBase.TREE:
                element = new TreeViewElement();
                element.Attributes.ElementType = ElementBase.TREEVIEW_TYPE;
                break;

            case ElementBase.TREE_VIEW:
                element = new TreeViewElement();
                element.Attributes.ElementType = ElementBase.TREEVIEW_TYPE;
                break;

            case ElementBase.TREE_ITEM:
                element = new TreeItemElement();
                element.Attributes.ElementType = ElementBase.TREEITEM_TYPE;
                break;

            case ElementBase.TABLE:
                element = new TableElement();
                element.Attributes.ElementType = ElementBase.TABLE_TYPE;
                break;

            //?
            case ElementBase.HEADER:
                element = new HeaderElement();
                element.Attributes.ElementType = ElementBase.HEADER_TYPE;
                break;

            case ElementBase.ITEM:
                if (parent != null && (parent is TableElement || parent is DatagridElement))
                {
                    element = new RowElement();
                    element.Attributes.ElementType = ElementBase.ROW_TYPE;
                }
                break;

            case ElementBase.LIST:     //(listview or checkedlistbox)
                element = new ListElement();
                element.Attributes.ElementType = ElementBase.LIST_TYPE;
                break;

            case ElementBase.LIST_VIEW:     //(listview or checkedlistbox)
                element = new ListElement();
                element.Attributes.ElementType = ElementBase.LIST_TYPE;
                break;

            case ElementBase.LIST_ITEM:     //(table)
                element = new ListItemElement();
                element.Attributes.ElementType = ElementBase.LISTITEM_TYPE;
                break;

            case ElementBase.EDIT:     //textbox
                element = new EditableTextElement();
                element.Attributes.ElementType = ElementBase.EDITABLETEXT_TYPE;
                break;

            case ElementBase.CHECK_BOX:
                element = new CheckBoxElement();
                element.Attributes.ElementType = ElementBase.CHECKBOX_TYPE;
                break;

            case ElementBase.RADIO_BUTTON:
                element = new RadioButtonElement();
                element.Attributes.ElementType = ElementBase.RADIO_BUTTON_TYPE;
                break;

            case ElementBase.CALENDAR:
                element = new CalendarElement();
                element.Attributes.ElementType = "Calendar";
                break;

            case ElementBase.CUSTOM:
                element = new CustomElement();
                element.Attributes.ElementType = "Custom";
                break;

            case ElementBase.DATAGRID:
                element = new DatagridElement();
                element.Attributes.ElementType = "DataGrid";
                break;

            case ElementBase.DATAGRID2:
                element = new DatagridElement();
                element.Attributes.ElementType = "DataGrid";
                break;

            case ElementBase.DATAITEM:
                element = new DataitemElement();
                element.Attributes.ElementType = "dataitem";
                break;

            case ElementBase.GROUP:
                element = new GroupELement();
                element.Attributes.ElementType = ElementBase.GROUP_TYPE;
                break;

            case ElementBase.HEADER_ITEM:
                element = new HeaderItemElement();
                element.Attributes.ElementType = "HeaderItem";
                break;

            case ElementBase.HYPERLINK:
                element = new LinkElement();
                element.Attributes.ElementType = "Hyperlink";
                break;

            case ElementBase.IMAGE:
                element = new ImageElement();
                element.Attributes.ElementType = "Image";
                break;

            case ElementBase.MENU:
                element = new MenuElement();
                element.Attributes.ElementType = "Menu";
                break;

            case ElementBase.PROGRESS_BAR:
                element = new ProgressBarElement();
                element.Attributes.ElementType = "ProgressBar";
                break;

            case ElementBase.SEPARATOR:
                element = new SeparatorElement();
                element.Attributes.ElementType = "Separator";
                break;

            case ElementBase.SLIDER:
                element = new SliderElement();
                element.Attributes.ElementType = "Slider";
                break;

            case ElementBase.SPINNER:
                element = new SpinnerElement();
                element.Attributes.ElementType = "Spinner";
                break;

            case ElementBase.SPLIT_BUTTON:
                element = new SplitButtonElement();
                element.Attributes.ElementType = "SplitButton";
                break;

            case ElementBase.STATUS_BAR:
                element = new StatusBarElement();
                element.Attributes.ElementType = "StatusBar";
                break;

            case ElementBase.TOOL_BAR:
                element = new ToolBarElement();
                element.Attributes.ElementType = "ToolBar";
                break;

            case ElementBase.TOOL_TIP:
                element = new ToolTipElement();
                element.Attributes.ElementType = "ToolTip";
                break;

            //?
            case ElementBase.MENU_ITEM:
                element = new MenuItemElement();
                element.Attributes.ElementType = "MenuItem";
                break;

            case ElementBase.LINK:
                element = new LinkElement();
                element.Attributes.ElementType = ElementBase.LINK_TYPE;
                break;
            }
            if (element == null)
            {
                if (parent is TableElement || parent is DatagridElement)
                {
                    element = new RowElement();
                    element.Attributes.ElementType = ElementBase.ROW_TYPE;
                }
                else if (parent is RowElement)
                {
                    element = new CellElement();
                    element.Attributes.ElementType = ElementBase.CELL_TYPE;
                }
                else
                {
                    element = new UnknownELement();
                    element.Attributes.ElementType = ElementBase.UNKNOWN_TYPE;
                }
            }
            element.Attributes.DesignedId = designedId;
            return(element);
        }