Exemplo n.º 1
0
        public StatsRollout()
            : base()
        {
            // Add stat labels
            font = DaggerfallUI.DefaultFont;
            Vector2 pos = new Vector2(19, 33);

            for (int i = 0; i < DaggerfallStats.Count; i++)
            {
                statLabels[i]             = DaggerfallUI.AddTextLabel(font, pos, string.Empty, this);
                statLabels[i].ShadowColor = DaggerfallUI.DaggerfallAlternateShadowColor1;
                pos.y += 22f;
            }

            // Add stat select buttons
            pos = new Vector2(7, 20);
            Vector2 size = new Vector2(36, 20);

            for (int i = 0; i < DaggerfallStats.Count; i++)
            {
                Button button = DaggerfallUI.AddButton(pos, size, this);
                button.Tag           = i;
                button.OnMouseClick += StatButton_OnMouseClick;
                pos.y += 22;
            }

            // Add up/down spinner
            spinner = new UpDownSpinner();
            this.Components.Add(spinner);
            spinner.OnUpButtonClicked   += Spinner_OnUpButtonClicked;
            spinner.OnDownButtonClicked += Spinner_OnDownButtonClicked;
            SelectStat(0);

            UpdateStatLabels();
        }
Exemplo n.º 2
0
        public StatsRollout(bool onCharacterSheet = false)
            : base()
        {
            if (onCharacterSheet)
            {
                characterSheetPositioning = true;
            }

            // Add stat labels
            font = DaggerfallUI.DefaultFont;

            Vector2 pos;

            if (!onCharacterSheet)
            {
                pos = new Vector2(19, 33);
            }
            else
            {
                pos = new Vector2(150, 17);
            }

            for (int i = 0; i < DaggerfallStats.Count; i++)
            {
                statLabels[i]             = DaggerfallUI.AddTextLabel(font, pos, string.Empty, this);
                statLabels[i].ShadowColor = DaggerfallUI.DaggerfallAlternateShadowColor1;
                if (!onCharacterSheet)
                {
                    pos.y += 22f;
                }
                else
                {
                    pos.y += 24f;
                }
            }

            // Add stat select buttons
            if (!onCharacterSheet)
            {
                pos = new Vector2(7, 20);
            }
            else
            {
                pos = new Vector2(141, 6);
            }

            Vector2 size;

            if (!onCharacterSheet)
            {
                size = new Vector2(36, 20);
            }
            else
            {
                size = new Vector2(28, 20);
            }

            for (int i = 0; i < DaggerfallStats.Count; i++)
            {
                Button button = DaggerfallUI.AddButton(pos, size, this);
                button.Tag           = i;
                button.OnMouseClick += StatButton_OnMouseClick;
                if (!onCharacterSheet)
                {
                    pos.y += 22f;
                }
                else
                {
                    pos.y += 24f;
                }
            }

            // Add up/down spinner
            spinner = new UpDownSpinner();
            this.Components.Add(spinner);
            spinner.OnUpButtonClicked   += Spinner_OnUpButtonClicked;
            spinner.OnDownButtonClicked += Spinner_OnDownButtonClicked;
            SelectStat(0);

            UpdateStatLabels();
        }
Exemplo n.º 3
0
        public StatsRollout()
            : base()
        {
            // Add stat labels
            font = DaggerfallUI.DefaultFont;
            Vector2 pos = new Vector2(19, 33);
            for (int i = 0; i < DaggerfallStats.Count; i++)
            {
                statLabels[i] = DaggerfallUI.AddTextLabel(font, pos, string.Empty, this);
                statLabels[i].ShadowColor = DaggerfallUI.DaggerfallAlternateShadowColor1;
                pos.y += 22f;
            }

            // Add stat select buttons
            pos = new Vector2(7, 20);
            Vector2 size = new Vector2(36, 20);
            for (int i = 0; i < DaggerfallStats.Count; i++)
            {
                Button button = DaggerfallUI.AddButton(pos, size, this);
                button.Tag = i;
                button.OnMouseClick += StatButton_OnMouseClick;
                pos.y += 22;
            }

            // Add up/down spinner
            spinner = new UpDownSpinner();
            this.Components.Add(spinner);
            spinner.OnUpButtonClicked += Spinner_OnUpButtonClicked;
            spinner.OnDownButtonClicked += Spinner_OnDownButtonClicked;
            SelectStat(0);

            UpdateStatLabels();
        }
Exemplo n.º 4
0
        public StatsRollout(bool onCharacterSheet = false, bool freeEdit = false)
            : base()
        {
            if (onCharacterSheet)
            {
                characterSheetPositioning = true;
            }
            if (freeEdit)
            {
                this.freeEdit         = true;
                modifiedStatTextColor = DaggerfallUI.DaggerfallDefaultTextColor;
            }

            // Add stat panels and labels
            font = DaggerfallUI.DefaultFont;

            Vector2 panelPos, panelSize;

            if (!onCharacterSheet)
            {
                panelPos  = new Vector2(8, 33);
                panelSize = new Vector2(34, 6);
            }
            else
            {
                panelPos  = new Vector2(141, 17);
                panelSize = new Vector2(28, 6);
            }

            for (int i = 0; i < DaggerfallStats.Count; i++)
            {
                statPanels[i] = DaggerfallUI.AddPanel(new Rect(panelPos.x, panelPos.y, panelSize.x, panelSize.y), this);
                statLabels[i] = DaggerfallUI.AddTextLabel(font, Vector2.zero, string.Empty, statPanels[i]);
                statLabels[i].HorizontalAlignment = HorizontalAlignment.Center;
                statLabels[i].ShadowColor         = DaggerfallUI.DaggerfallAlternateShadowColor1;
                if (!onCharacterSheet)
                {
                    panelPos.y += 22f;
                }
                else
                {
                    panelPos.y += 24f;
                }
            }

            // Add stat select buttons
            Vector2 pos;

            if (!onCharacterSheet)
            {
                pos = new Vector2(7, 20);
            }
            else
            {
                pos = new Vector2(141, 6);
            }

            Vector2 size;

            if (!onCharacterSheet)
            {
                size = new Vector2(36, 20);
            }
            else
            {
                size = new Vector2(28, 20);
            }

            for (int i = 0; i < DaggerfallStats.Count; i++)
            {
                Button button = DaggerfallUI.AddButton(pos, size, this);
                button.Tag           = i;
                button.OnMouseClick += StatButton_OnMouseClick;
                if (!onCharacterSheet)
                {
                    pos.y += 22f;
                }
                else
                {
                    pos.y += 24f;
                }
            }

            // Add up/down spinner
            spinner = new UpDownSpinner();
            this.Components.Add(spinner);
            spinner.OnUpButtonClicked   += Spinner_OnUpButtonClicked;
            spinner.OnDownButtonClicked += Spinner_OnDownButtonClicked;
            SelectStat(0);

            UpdateStatLabels();
        }