コード例 #1
0
ファイル: AffixesBlock.cs プロジェクト: antfitch/HeroKit
        /// <summary>
        /// Draw first group of fields (name, desc, icon, price)
        /// </summary>
        private static void DrawColorField()
        {
            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);

            // color field
            SimpleLayout.Label("Color" + ":");
            stringFields[2].value = SimpleLayout.ColorField(stringFields[2].value, HeroKit.Editor.HeroKitCommon.GetWidthForField(60, 450));

            SimpleLayout.EndVertical();
        }
コード例 #2
0
        /// <summary>
        /// Draw the body of the block.
        /// </summary>
        private static void DrawBody()
        {
            SimpleLayout.BeginVertical(Box.StyleCanvasBox);

            SimpleLayout.BeginVertical(Box.StyleB);

            SimpleLayout.Label("Action (this is used during gameplay):");
            heroAction.action = SimpleLayout.ObjectField(heroAction.action, 400);

            SimpleLayout.Label("Action (this is used to create editor fields for action):");
            heroAction.actionFields = SimpleLayout.ObjectField(heroAction.actionFields, 400);

            SimpleLayout.EndVertical();

            // -------------

            SimpleLayout.BeginVertical(Box.StyleB);

            SimpleLayout.Label("Prefix (adds text in front of the action in the menu):");
            heroAction.title = SimpleLayout.TextField(heroAction.title);

            SimpleLayout.Label("Description (this appears below editor fields for action):");
            heroAction.description = SimpleLayout.TextArea(heroAction.description);

            SimpleLayout.EndVertical();

            // --------------

            SimpleLayout.BeginVertical(Box.StyleB);

            SimpleLayout.Label("Indent This Action (indents this action in menu. 0=no indent):");
            heroAction.indentThis = SimpleLayout.IntField(heroAction.indentThis);

            SimpleLayout.Label("Indent Next Action (indents the next action in menu. 0=no indent):");
            heroAction.indentNext = SimpleLayout.IntField(heroAction.indentNext);

            SimpleLayout.Label("Color (The color of this action in the menu):");
            heroAction.titleColor = SimpleLayout.ColorField(heroAction.titleColor, 400);

            SimpleLayout.EndVertical();

            // --------------

            SimpleLayout.Label("Version (version of this action + developer notes):");
            heroAction.version = SimpleLayout.TextArea(heroAction.version);

            SimpleLayout.EndVertical();
        }
コード例 #3
0
        // --------------------------------------------------------------
        // Action Fields
        // --------------------------------------------------------------

        /// <summary>
        /// Get a color.
        /// </summary>
        /// <param name="title">Title for action field.</param>
        /// <param name="actionParams">Action field parameters.</param>
        /// <param name="actionField">Action field.</param>
        /// <param name="titleToLeft">Show the title on the left?</param>
        /// <returns>A color.</returns>
        public static Color BuildField(string title, HeroActionParams actionParams, HeroActionField actionField, bool titleToLeft = false)
        {
            // create the fields
            ColorValueData data = CreateFieldData(title, actionField);

            //-----------------------------------------
            // Display this title above the field
            //-----------------------------------------
            if (data.title != "" && !titleToLeft)
            {
                SimpleLayout.Label(data.title);
            }
            SimpleLayout.BeginHorizontal();
            if (data.title != "" && titleToLeft)
            {
                SimpleLayout.Label(data.title);
            }

            //-----------------------------------------
            // Get the bool list you want to work with.
            // The bool list is in hero object editor > Variables
            //-----------------------------------------
            data.fieldValue = SimpleLayout.ColorField(data.fieldValue);

            //-----------------------------------------
            // assign values back to hero object fields
            //-----------------------------------------
            actionField.colors[0] = data.fieldValue;

            //-----------------------------------------
            // Visual stuff
            //-----------------------------------------
            SimpleLayout.Space();
            SimpleLayout.EndHorizontal();

            return(data.fieldValue);
        }