private static void DrawTimerEndCond() { SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); SimpleLayout.BeginHorizontal(); boolFields[0].value = SimpleLayout.BoolField(boolFields[0].value); SimpleLayout.Label("Turn off condition with timer"); SimpleLayout.EndHorizontal(); if (boolFields[0].value) { SimpleLayout.Line(); // list of stat change types DropDownValues changeTypeValues = new DropDownValues(); string[] changeType = { "Seconds", "Minutes", "Hours" }; changeTypeValues.setValues("", changeType); SimpleLayout.BeginHorizontal(); intFields[0].value = SimpleLayout.DropDownList(intFields[0].value, changeTypeValues, 0, 150); intFields[1].value = SimpleLayout.IntField(intFields[1].value, 150); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); } SimpleLayout.EndVertical(); }
/// <summary> /// Draw the body of the block. /// </summary> private static void DrawItems() { // exit early if there are no items if (items == null || items.Count == 0) { HeroKitCommon.DrawNoItemsInList(blockName); return; } SimpleLayout.BeginVertical(Box.StyleCanvasBox); // display items (move up, move down, int field, for (int i = 0; i < items.Count; i++) { SimpleLayout.BeginHorizontal(); HeroKitCommon.DrawListArrows(moveItemUp, moveItemDown, i); items[i].value = SimpleLayout.BoolListField(items[i], i); items[i].name = SimpleLayout.StringListField(items[i].name, HeroKitCommon.GetWidthForField(289)); HeroKitCommon.DrawListButtons(addItem, copyItem, pasteItem, deleteItem, i); SimpleLayout.EndHorizontal(); if (i != items.Count - 1) { SimpleLayout.Line(); } } SimpleLayout.EndVertical(); SimpleLayout.Space(20); }
/// <summary> /// Draw a note about how to use the fields in this block. /// </summary> private static void DrawDescription() { SimpleLayout.Line(); SimpleLayout.Label("Using unity objects requires unboxing" + "\n" + "Unboxing is not performant, so use these objects sparingly." + "\n" ); }
/// <summary> /// Draw item type /// </summary> private static void DrawTarget2() { SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); SimpleLayout.BeginHorizontal(); SimpleLayout.Label("Uses Ammunition" + ":"); boolFields[3].value = SimpleLayout.BoolField(boolFields[3].value); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); if (boolFields[3].value) { SimpleLayout.Space(5); SimpleLayout.Line(); // item type field string[] items = { "Another Character", "Caster" }; DropDownValues itemList = new DropDownValues(); itemList.setValues("", items); SimpleLayout.BeginHorizontal(); intFields[1].value = SimpleLayout.DropDownList(intFields[1].value, itemList, 0, HeroKit.Editor.HeroKitCommon.GetWidthForField(60, 200)); SimpleLayout.Label("Target"); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); SimpleLayout.BeginHorizontal(); intFields[17].value = SimpleLayout.IntField(intFields[17].value); SimpleLayout.Label("Range (in meters)"); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); } SimpleLayout.EndVertical(); }
/// <summary> /// Draw item type /// </summary> private static void DrawUsesAmmo() { SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); SimpleLayout.BeginHorizontal(); SimpleLayout.Label("Uses Ammunition" + ":"); boolFields[3].value = SimpleLayout.BoolField(boolFields[3].value); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); if (boolFields[3].value) { SimpleLayout.Space(5); SimpleLayout.Line(); // item type field DropDownValues itemList = HeroKitCommon.databaseList(HeroKitCommon.ammunitionTypeDatabase); SimpleLayout.BeginHorizontal(); intFields[2].value = SimpleLayout.DropDownList(intFields[2].value, itemList, 0, HeroKit.Editor.HeroKitCommon.GetWidthForField(60, 200)); SimpleLayout.Label("Ammunition type"); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); SimpleLayout.BeginHorizontal(); intFields[3].value = SimpleLayout.IntField(intFields[3].value); SimpleLayout.Label("Range (in meters)"); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); } SimpleLayout.EndVertical(); }
/// <summary> /// Draw a note about how to use the fields in this block. /// </summary> private static void DrawDescription() { SimpleLayout.Line(); SimpleLayout.Label("NOTE: You cannot directly assign a hero object in a scene to a slot. \nYou must use actions to do this.\n" + "\n" + "NOTE: A slot can contain one hero object or a \ngroup of hero objects from a scene.\n" ); }
/// <summary> /// Draw fields for an item /// </summary> private static void DrawItemFields() { HeroKitCommon.DrawItemDropdown(intFields, "Ammunition Type", 0, HeroKitCommon.ammunitionTypeDatabase); HeroKitCommon.BasicFieldsA(stringFields, uoFields, 0, 1, 0); HeroKitCommon.DrawMoneyValue(stringFields_att, intFields_att); HeroKitCommon.DrawItemWeight(intFields_att); SimpleLayout.Line(); HeroKitCommon.DrawStatsValue(stringFields_att, intFields_att); HeroKitCommon.DrawConditionsValue(stringFields_att, intFields_att); HeroKitCommon.DrawElementValue(stringFields_att, intFields_att, "Attach elements to this item"); SimpleLayout.Line(); HeroKitCommon.DrawActions(heroObject, heroActions, addItem, showBlockContent, showContextMenu); }
public static void BuildField(HeroActionParams actionParams) { HeroAction heroAction = actionParams.heroAction; //----------------------------------------- // create the action fields if they don't exist //----------------------------------------- ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 18); //----------------------------------------- // create the fields for this action //----------------------------------------- SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); bool useDifferent = GetBoolValue.BuildField("Play particle effect on a different object?", actionParams, heroAction.actionFields[0], true); if (useDifferent) { SimpleLayout.Line(); GetSceneObjectValue.BuildField("particle effect", actionParams, heroAction.actionFields[1], heroAction.actionFields[2]); } SimpleLayout.EndVertical(); SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); bool changePos = GetBoolValue.BuildField("Change position?", actionParams, heroAction.actionFields[3], true); if (changePos) { GetCoordinatesField.BuildField("", actionParams, heroAction.actionFields[4], heroAction.actionFields[5], heroAction.actionFields[6], heroAction.actionFields[7], heroAction.actionFields[8], heroAction.actionFields[9]); } SimpleLayout.EndVertical(); SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); bool changeRotation = GetBoolValue.BuildField("Change rotation?", actionParams, heroAction.actionFields[10], true); if (changeRotation) { GetCoordinatesField.BuildField("", actionParams, heroAction.actionFields[11], heroAction.actionFields[12], heroAction.actionFields[13], heroAction.actionFields[14], heroAction.actionFields[15], heroAction.actionFields[16]); } SimpleLayout.EndVertical(); SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); GetBoolValue.BuildField("Don't play next action until this action completes?", actionParams, heroAction.actionFields[17], true); SimpleLayout.EndVertical(); }
public static void BuildField(HeroActionParams actionParams) { HeroAction heroAction = actionParams.heroAction; //----------------------------------------- // create the action fields if they don't exist //----------------------------------------- ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 23); //----------------------------------------- // create the fields for this action //----------------------------------------- SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); GetHeroObjectField.BuildFieldE("Change move settings for a different object?", actionParams, heroAction.actionFields[0], heroAction.actionFields[1]); SimpleLayout.EndVertical(); SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); bool changeSpeed = GetBoolValue.BuildField("Change move speed?", actionParams, heroAction.actionFields[5], true); if (changeSpeed) { SimpleLayout.Line(); GetIntegerField.BuildFieldA("Movement Speed:", actionParams, heroAction.actionFields[2]); } SimpleLayout.EndVertical(); SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); bool changeMoveDirection = GetBoolValue.BuildField("Change move directions?", actionParams, heroAction.actionFields[6], true); if (changeMoveDirection) { SimpleLayout.Line(); string[] items = { "4-ways (up, down, left, right)", "8-ways (up, down, left, right, up left, up right, etc)" }; GetDropDownField.BuildField("Which directions can player move?:", actionParams, heroAction.actionFields[3], new GenericListField(items)); } SimpleLayout.EndVertical(); SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); bool changeMoveFace = GetBoolValue.BuildField("Change animation type?", actionParams, heroAction.actionFields[7], true); if (changeMoveFace) { SimpleLayout.Line(); string[] items2 = { "4-ways (up, down, left, right)", "8-ways (up, down, left, right, up left, up right, etc)" }; GetDropDownField.BuildField("Which animations can player use?:", actionParams, heroAction.actionFields[4], new GenericListField(items2)); } SimpleLayout.EndVertical(); }
/// <summary> /// Draw fields for an item /// </summary> private static void DrawItemFields() { HeroKitCommon.DrawItemDropdown(intFields, "Character Type", 0, HeroKitCommon.characterTypeDatabase); HeroKitCommon.BasicFieldsB(stringFields, 0, 1); SimpleLayout.Line(); HeroKitCommon.DrawItemDropdownB(intFields, "Starting Class", 4, 3, HeroKitCommon.classDatabase, HeroKitCommon.subclassDatabase); HeroKitCommon.DrawItemDropdownB(intFields, "Starting Race", 7, 6, HeroKitCommon.raceDatabase, HeroKitCommon.subraceDatabase); HeroKitCommon.DrawItemDropdown(intFields, "Starting Alignment", 5, HeroKitCommon.alignmentDatabase, 200); SimpleLayout.Line(); HeroKitCommon.DrawItemDropdownB(intFields, "Starting Weapon", 2, 1, HeroKitCommon.weaponTypeDatabase, HeroKitCommon.weaponDatabase); HeroKitCommon.DrawFirstEquip(stringFields, intFields); HeroKitCommon.DrawAbilityList(stringFields_att, intFields_att, "Starting Abilities"); SimpleLayout.Line(); HeroKitCommon.DrawStartStats(stringFields_att, intFields_att, "Stats this character can use"); HeroKitCommon.DrawStartMeters(stringFields_att, intFields_att, "Meters this character can use"); }
/// <summary> /// Draw fields for an item /// </summary> private static void DrawItemFields() { HeroKitCommon.DrawItemDropdown(intFields, "Condition Type", 3, HeroKitCommon.conditionTypeDatabase); HeroKitCommon.BasicFieldsB(stringFields, 0, 1); SimpleLayout.Line(); DrawCantAttack(); DrawCantBeAttacked(); DrawCantEvade(); SimpleLayout.Line(); HeroKitCommon.DrawMeterValue_Conditions(stringFields_att, intFields_att); HeroKitCommon.DrawStatValue_Conditions(stringFields_att, intFields_att); HeroKitCommon.DrawElementValue(stringFields_att, intFields_att, "Change effect of elements on the character"); HeroKitCommon.DrawConditionsValue(stringFields_att, intFields_att, "Change other conditions"); SimpleLayout.Line(); DrawTimerEndCond(); DrawAttackEndCond(); }
/// <summary> /// Draw the body of the block. /// </summary> private static void DrawBody() { SimpleLayout.BeginVertical(Box.StyleCanvasBox); // draw name of the block eventBlock.name = HeroKitCommon.DrawBlockName(eventBlock.name); SimpleLayout.Line(); SimpleLayout.Space(5); DrawEventTypeField(); DrawIntConditionFields(); DrawBoolConditionFields(); SimpleLayout.EndVertical(); }
/// <summary> /// Draw fields for an item /// </summary> private static void DrawItemFields() { HeroKitCommon.DrawItemDropdown(intFields, "Ability Type", 0, HeroKitCommon.abilityTypeDatabase); HeroKitCommon.BasicFieldsA(stringFields, uoFields, 0, 1, 0); DrawAttackSpeed(); DrawTarget(); DrawSuccess(); DrawRange(); DrawChainAttack(); DrawExpMeter(); SimpleLayout.Line(); HeroKitCommon.DrawMeterValue(stringFields_att, intFields_att, "Change meters (on caster)"); HeroKitCommon.DrawMeterValue_Abilities(stringFields_att, intFields_att); SimpleLayout.Line(); HeroKitCommon.DrawConditionsValue(stringFields_att, intFields_att); HeroKitCommon.DrawElementValue(stringFields_att, intFields_att, "Attach elements to this item"); SimpleLayout.Line(); HeroKitCommon.DrawActions(heroObject, heroActions, addItem, showBlockContent, showContextMenu); }
/// <summary> /// Draw a note about how to use the fields in this block. /// </summary> private static void DrawDescription() { SimpleLayout.Line(); SimpleLayout.Label("You can insert integers, bools, and strings" + "\n" + "into this string with codes." + "\n" + "\n" + "Codes:" + "\n" + "[V-I-0] = Variables, Integers (slot 0)" + "\n" + "[V-B-0] = Variables, Bools (slot 0)" + "\n" + "[V-S-0] = Variables, Strings (slot 0)" + "\n" + "\n" + "[P-0-I-0] = Properties (slot 0), Integers (slot 0)" + "\n" + "[P-0-B-0] = Properties (slot 0), Bools (slot 0)" + "\n" + "[P-0-S-0] = Properties (slot 0), Strings (slot 0)" + "\n" + "\n" + "[G-I-0] = Globals, Integers (slot 0)" + "\n" + "[G-B-0] = Globals, Bools (slot 0)" + "\n" + "[G-S-0] = Globals, Strings (slot 0)" ); }
/// <summary> /// Draw fields for an item /// </summary> private static void DrawItemFields() { HeroKitCommon.DrawItemDropdown(intFields, "Item Type", 0, HeroKitCommon.itemTypeDatabase); HeroKitCommon.BasicFieldsA(stringFields, uoFields, 0, 1, 0); HeroKitCommon.DrawMoneyValue(stringFields_att, intFields_att); HeroKitCommon.DrawItemWeight(intFields_att); HeroKitCommon.DrawStackItems(boolFields_att); SimpleLayout.Line(); HeroKitCommon.DrawAffixValue(stringFields_att, intFields_att); HeroKitCommon.DrawSocketsValue(stringFields_att, intFields_att); SimpleLayout.Line(); HeroKitCommon.DrawMeterValue(stringFields_att, intFields_att); HeroKitCommon.DrawStatsValue(stringFields_att, intFields_att); HeroKitCommon.DrawExtras(intFields_att); SimpleLayout.Line(); HeroKitCommon.DrawConditionsValue(stringFields_att, intFields_att); HeroKitCommon.DrawElementValue(stringFields_att, intFields_att); SimpleLayout.Line(); HeroKitCommon.DrawActions(heroObject, heroActions, addItem, showBlockContent, showContextMenu); }
/// <summary> /// Draw the body of the block. /// </summary> private static void DrawBody() { SimpleLayout.BeginVertical(Box.StyleCanvasBox); // draw name of the block action.name = HeroKitCommon.DrawBlockName(action.name); SimpleLayout.Line(); // get current action template on hero object HeroKitAction oldTemplate = action.actionTemplate; // draw action field for block SimpleLayout.Space(5); SimpleLayout.BeginHorizontal(); SimpleLayout.Label("Action:"); action.actionTemplate = SimpleLayout.ObjectField(action.actionTemplate, HeroKitCommon.GetWidthForField(85)); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); // SHOW FIELDS FOR SPECIFIC ACTION if (action.actionTemplate != null) { SimpleLayout.Space(5); SimpleLayout.Line(); SimpleLayout.Space(5); // build fields ActionBlockBuilder.BuildFields(heroObject, action, action.actionTemplate, oldTemplate); // build description for action SimpleLayout.Space(5); SimpleLayout.Line(); SimpleLayout.Label("Description:"); SimpleLayout.Label(action.actionTemplate.description, true); } SimpleLayout.EndVertical(); }
// -------------------------------------------------------------- // Methods (Fields) // -------------------------------------------------------------- /// <summary> /// A field for a hero property file. /// </summary> private static void DrawItemType() { SimpleLayout.BeginHorizontal(); SimpleLayout.Label("Item Type:"); SimpleLayout.Space(13); propertyBlock.propertyTemplate = SimpleLayout.ObjectField(propertyBlock.propertyTemplate, HeroKitCommon.GetWidthForField(120)); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); // SHOW FIELDS FOR SPECIFIC HERO PROPERTY // if hero property has been removed, sanitize properties list if (propertyBlock.propertyTemplate != null) { SimpleLayout.Space(5); SimpleLayout.Line(); } else { propertyBlock.itemProperties = new HeroList(); } }
/// <summary> /// Get a return value from a method and assign the value to a hero object variable. /// </summary> /// <param name="title">Title for action field.</param> /// <param name="actionParams">Action field parameters.</param> /// <param name="actionField">Action field.</param> /// <param name="actionFieldB">Action field.</param> /// <param name="method">The method that contains the parameters.</param> public static void BuildFieldB(string title, HeroActionParams actionParams, HeroActionField actionField, HeroActionField actionFieldB, MethodInfo method) { // create the fields ParameterFieldData data = CreateFieldData(title, actionField, actionParams.heroObject); //----------------------------------------- // Get the list you want to work with. //----------------------------------------- ParameterInfo returnValue = method.ReturnParameter; if (returnValue != null) { if (data.title != "") { SimpleLayout.Label(data.title); } SimpleLayout.Line(); GetParameter(returnValue, actionParams, actionFieldB, true); } }
/// <summary> /// Draw fields for an item /// </summary> private static void DrawItemFields() { HeroKitCommon.DrawItemDropdown(intFields, "Affix Type", 0, HeroKitCommon.affixTypeDatabase); HeroKitCommon.BasicFieldsA(stringFields, uoFields, 0, 1, 0); DrawColorField(); HeroKitCommon.DrawMoneyValue(stringFields_att, intFields_att); SimpleLayout.Line(); HeroKitCommon.DrawMeterValue(stringFields_att, intFields_att); //HeroKitCommon.DrawMeters(intFields_att, boolFields_att); HeroKitCommon.DrawStatsValue(stringFields_att, intFields_att); //HeroKitCommon.DrawStats(intFields_att, boolFields_att); HeroKitCommon.DrawExtras(intFields_att); SimpleLayout.Line(); //HeroKitCommon.DrawConditions(intFields_att, boolFields_att); HeroKitCommon.DrawConditionsValue(stringFields_att, intFields_att); HeroKitCommon.DrawElementValue(stringFields_att, intFields_att, "Attach elements to this affix"); //HeroKitCommon.DrawElements(intFields_att, boolFields_att, "Attach elements to this affix", false); }
public static void BuildField(HeroActionParams actionParams) { HeroAction heroAction = actionParams.heroAction; //----------------------------------------- // create the action fields if they don't exist //----------------------------------------- ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 3); //----------------------------------------- // create the fields for this action //----------------------------------------- SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); bool useDifferent = GetBoolValue.BuildField("Stop particle effect on a different object?", actionParams, heroAction.actionFields[0], true); if (useDifferent) { SimpleLayout.Line(); GetSceneObjectValue.BuildField("particle effect", actionParams, heroAction.actionFields[1], heroAction.actionFields[2]); } SimpleLayout.EndVertical(); }
// -------------------------------------------------------------- // Methods (Visual Fields) // -------------------------------------------------------------- /// <summary> /// Choose the type of visuals to use for this state. /// </summary> private static void DrawVisualsTypeForState() { // Visual Type SimpleLayout.Label("Visuals type:"); stateBlock.heroVisuals.visualType = new VisualTypeField().SetValues(stateBlock.heroVisuals.visualType, 0); SimpleLayout.Space(5); SimpleLayout.Line(); SimpleLayout.Space(5); switch (stateBlock.heroVisuals.visualType) { case 0: // not set case 1: // 3D Draw3DForState(); break; case 2: // 2D Draw2DForState(); break; } }
/// <summary> /// Draw fields for an item /// </summary> private static void DrawItemFields() { HeroKitCommon.DrawItemDropdown(intFields, "Weapon Type", 0, HeroKitCommon.weaponTypeDatabase); HeroKitCommon.BasicFieldsA(stringFields, uoFields, 0, 1, 0); HeroKitCommon.DrawMoneyValue(stringFields_att, intFields_att); HeroKitCommon.DrawItemWeight(intFields_att); DrawAttackSpeed(); HeroKitCommon.DrawStackItems(boolFields_att); DrawIsTwoHanded(); DrawUsesAmmo(); SimpleLayout.Line(); HeroKitCommon.DrawAffixValue(stringFields_att, intFields_att); HeroKitCommon.DrawSocketsValue(stringFields_att, intFields_att); SimpleLayout.Line(); HeroKitCommon.DrawMeterValue(stringFields_att, intFields_att, "Change meters (on attack target)"); HeroKitCommon.DrawStatsValue(stringFields_att, intFields_att, "Change stats (on character who has this weapon)"); SimpleLayout.Line(); HeroKitCommon.DrawConditionsValue(stringFields_att, intFields_att); HeroKitCommon.DrawElementValue(stringFields_att, intFields_att, "Attach elements to this item"); SimpleLayout.Line(); HeroKitCommon.DrawActions(heroObject, heroActions, addItem, showBlockContent, showContextMenu); }
/// <summary> /// Draw the body of the block. /// </summary> private static void DrawBody() { SimpleLayout.BeginVertical(Box.StyleCanvasBox); SimpleLayout.Button("Refresh Hero Objects", RefreshHeroObjects, Button.StyleA); SimpleLayout.Label("Use this to make sure that your hero objects structure is up-to-date. \n" + "For example, if you change a Hero Property that is assigned to several \n" + "Hero Objects, press this button to make sure all of the hero objects have \n" + "the new, updated properties."); SimpleLayout.Line(); SimpleLayout.EndVertical(); SimpleLayout.BeginVertical(Box.StyleCanvasBox); SimpleLayout.Button("Delete Save Files", DeleteSaveFiles, Button.StyleA); SimpleLayout.Label("Quickly delete save files."); SimpleLayout.Line(); SimpleLayout.EndVertical(); SimpleLayout.BeginVertical(Box.StyleCanvasBox); SimpleLayout.Button("Migrate HeroKit data to Beta 1.02", UpdateHeroKit1_2, Button.StyleA); SimpleLayout.Label("This move your properties on hero objects into the new Property \n" + "structure on hero objects. Once you've done this, you need to update your \n" + "actions to point to the updated properties."); SimpleLayout.Line(); SimpleLayout.EndVertical(); SimpleLayout.BeginVertical(Box.StyleCanvasBox); SimpleLayout.Button("Show/Hide Menu Templates", ShowMenuSkins, Button.StyleA); SimpleLayout.Label("You can use the default templates we provide for your menus \n" + "or you can use your own. The default templates are stored here: \n" + "HeroKit/Hero Engine/Assets/Resources/Hero Templates/Menus"); MenuSkins(); SimpleLayout.Line(); SimpleLayout.EndVertical(); }
private static void DrawAttackEndCond() { SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); SimpleLayout.BeginHorizontal(); boolFields[1].value = SimpleLayout.BoolField(boolFields[1].value); SimpleLayout.Label("Turn off condition when character is attacked"); SimpleLayout.EndHorizontal(); if (boolFields[1].value) { SimpleLayout.Line(); SimpleLayout.BeginHorizontal(); SimpleLayout.Label("Chance:"); intFields[1].value = SimpleLayout.IntField(intFields[1].value, 150); SimpleLayout.Label("%"); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); } SimpleLayout.EndVertical(); }
/// <summary> /// Draw the body of the block. /// </summary> private static void DrawBody() { SimpleLayout.BeginVertical(Box.StyleCanvasBox); // draw name of the block stateBlock.name = HeroKitCommon.DrawBlockName(stateBlock.name); SimpleLayout.Line(); SimpleLayout.Space(5); // draw the conditions for the block DrawIntConditionFields(); DrawBoolConditionFields(); SimpleLayout.Space(5); SimpleLayout.Line(); SimpleLayout.Space(5); // draw the image for the block DrawVisualsTypeForState(); SimpleLayout.EndVertical(); }
// -------------------------------------------------------------- // Action Fields // -------------------------------------------------------------- /// <summary> /// Set the parameters to be passed into a method in a script. /// </summary> /// <param name="title">Title for action field.</param> /// <param name="actionParams">Action field parameters.</param> /// <param name="actionField">Action field.</param> /// <param name="paramFieldStart">Action field ID (start of range).</param> /// <param name="paramFieldEnd">Action field ID (end of range).</param> /// <param name="method">The method that contains the parameters.</param> /// <param name="heroAction"></param> public static void BuildFieldA(string title, HeroActionParams actionParams, HeroActionField actionField, int paramFieldStart, int paramFieldEnd, MethodInfo method, HeroAction heroAction) { // create the fields ParameterFieldData data = CreateFieldData(title, actionField, actionParams.heroObject); //----------------------------------------- // Get the list you want to work with. //----------------------------------------- ParameterInfo[] parameters = GetParameters(method); int availablePropertySlots = paramFieldEnd - paramFieldStart; if (parameters != null && parameters.Length != 0) { if (data.title != "") { SimpleLayout.Label(data.title); } SimpleLayout.Line(); for (int i = 0; i < parameters.Length && i < availablePropertySlots; i++) { ParameterInfo parameter = parameters[i]; GetParameter(parameter, actionParams, heroAction.actionFields[paramFieldStart + i], false); } } else { SimpleLayout.Label("There are not parameters for this method."); } //----------------------------------------- // assign values back to hero object fields //----------------------------------------- actionField.ints[1] = paramFieldStart; actionField.ints[2] = paramFieldEnd; }
public static void BuildField(HeroActionParams actionParams) { HeroAction heroAction = actionParams.heroAction; //----------------------------------------- // create the action fields if they don't exist //----------------------------------------- ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 9); //----------------------------------------- // create the fields for this action //----------------------------------------- SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); SimpleLayout.Label("Get the hero objects to filter here:"); GetHeroObjectField.BuildFieldB("", actionParams, heroAction.actionFields[4]); SimpleLayout.Line(); GetHeroObjectField.BuildFieldA("The hero object which has the field of view:", actionParams, heroAction.actionFields[3]); GetChildObjectField.BuildField("Is field of view coming from a child object?", actionParams, heroAction.actionFields[5], heroAction.actionFields[6], false, -20); SimpleLayout.Line(); GetDropDownField.BuildField("Side of the hero object which has the field of view:", actionParams, heroAction.actionFields[7], new RayDirectionTypeField()); GetIntegerField.BuildFieldA("Size of the field of view (in degrees):", actionParams, heroAction.actionFields[8]); SimpleLayout.EndVertical(); SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); SimpleLayout.Label("Operation:"); GetDropDownField.BuildField("", actionParams, heroAction.actionFields[0], new HeroObjectOperatorField()); SimpleLayout.EndVertical(); SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); SimpleLayout.Label("Save the hero objects here:"); GetHeroObjectField.BuildFieldB("", actionParams, heroAction.actionFields[1]); SimpleLayout.Label("Maximum number of hero objects to save:"); GetIntegerField.BuildFieldA("", actionParams, heroAction.actionFields[2]); SimpleLayout.EndVertical(); }
public static void BuildField(HeroActionParams actionParams) { HeroAction heroAction = actionParams.heroAction; //----------------------------------------- // create the action fields if they don't exist //----------------------------------------- ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 23); //----------------------------------------- // create the fields for this action //----------------------------------------- SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); GetHeroObjectField.BuildFieldE("Change move settings for a different object?", actionParams, heroAction.actionFields[0], heroAction.actionFields[1]); SimpleLayout.EndVertical(); SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); bool changeAnims = GetBoolValue.BuildField("Change Movement Animation?", actionParams, heroAction.actionFields[1], true); if (changeAnims) { SimpleLayout.Line(); SimpleLayout.Label("Enter the name of the bool for each animation you want to change. The bools are stored in the " + "animator controller that is assigned to the hero object. " + "If you leave a field blank, the animation won't be changed for that field.", true); SimpleLayout.Line(); GetStringField.BuildFieldA("Move Default", actionParams, heroAction.actionFields[5]); GetStringField.BuildFieldA("Move Left", actionParams, heroAction.actionFields[6]); GetStringField.BuildFieldA("Move Right", actionParams, heroAction.actionFields[7]); GetStringField.BuildFieldA("Move Up", actionParams, heroAction.actionFields[8]); GetStringField.BuildFieldA("Move Down", actionParams, heroAction.actionFields[9]); GetStringField.BuildFieldA("Move Up Left", actionParams, heroAction.actionFields[10]); GetStringField.BuildFieldA("Move Up Right", actionParams, heroAction.actionFields[11]); GetStringField.BuildFieldA("Move Down Left", actionParams, heroAction.actionFields[12]); GetStringField.BuildFieldA("Move Down Right", actionParams, heroAction.actionFields[13]); } SimpleLayout.EndVertical(); SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); bool changeFace = GetBoolValue.BuildField("Change Face Direction Animation?", actionParams, heroAction.actionFields[2], true); if (changeFace) { SimpleLayout.Line(); SimpleLayout.Label("Enter the name of the bool for each animation you want to change. The bools are stored in the " + "animator controller that is assigned to the hero object. " + "If you leave a field blank, the animation won't be changed for that field.", true); SimpleLayout.Line(); GetStringField.BuildFieldA("Face Default", actionParams, heroAction.actionFields[14]); GetStringField.BuildFieldA("Face Left", actionParams, heroAction.actionFields[15]); GetStringField.BuildFieldA("Face Right", actionParams, heroAction.actionFields[16]); GetStringField.BuildFieldA("Face Up", actionParams, heroAction.actionFields[17]); GetStringField.BuildFieldA("Face Down", actionParams, heroAction.actionFields[18]); GetStringField.BuildFieldA("Face Up Left", actionParams, heroAction.actionFields[19]); GetStringField.BuildFieldA("Face Up Right", actionParams, heroAction.actionFields[20]); GetStringField.BuildFieldA("Face Down Left", actionParams, heroAction.actionFields[21]); GetStringField.BuildFieldA("Face Down Right", actionParams, heroAction.actionFields[22]); } SimpleLayout.EndVertical(); }
/// <summary> /// Draw a note about how to use the fields in this block. /// </summary> private static void DrawDescription() { SimpleLayout.Line(); SimpleLayout.Label("NOTE: You cannot directly assign a game object in a scene to a slot. \nYou must use actions to do this.\n"); }
/// <summary> /// Bool conditions that must be satisfied for the event to run. /// </summary> private static void DrawBoolConditionFields() { SimpleLayout.BeginVertical(Box.StyleB); // ROW: START ----------------------------------------- SimpleLayout.BeginHorizontal(); // COLUMN 1: START ------------------------------------ SimpleLayout.BeginVertical(); SimpleLayout.Label("BOOLS (these conditions must be met before this event can run):"); SimpleLayout.EndVertical(); // COLUMN 1: END -------------------------------------- SimpleLayout.Space(); // COLUMN 2: START ------------------------------------ SimpleLayout.BeginVertical(); SimpleLayout.Button(Content.AddIcon, addBoolCondition, Button.StyleA, 25); SimpleLayout.EndVertical(); // COLUMN 2: END -------------------------------------- SimpleLayout.EndHorizontal(); // ROW: END ------------------------------------------- if (eventBlock.boolConditions.Count > 0) { SimpleLayout.Line(); } // List of entries for (int i = 0; i < eventBlock.boolConditions.Count; i++) { // ROW 1: START --------------------------------------- SimpleLayout.BeginHorizontal(); // COLUMN 1: START ------------------------------------ SimpleLayout.BeginVertical(); // VALUE 1 SimpleLayout.BeginHorizontal(); GetBoolField.BuildEventField("Value 1:", eventBlock.boolConditions[i].itemA, heroObject); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); // OPERATOR SimpleLayout.BeginHorizontal(); SimpleLayout.Space(60); eventBlock.boolConditions[i].operatorID = new TrueFalseField().SetValues(eventBlock.boolConditions[i].operatorID, 0); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); //SimpleLayout.Space(4); // VALUE 2 SimpleLayout.BeginHorizontal(); GetBoolField.BuildEventField("Value 2:", eventBlock.boolConditions[i].itemB, heroObject); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); SimpleLayout.EndVertical(); // COLUMN 1: END -------------------------------------- // COLUMN 2: START ------------------------------------ SimpleLayout.BeginVertical(); SimpleLayout.Button(Content.DeleteIcon, deleteBoolCondition, i, Button.StyleA, 25); SimpleLayout.EndVertical(); // COLUMN 2: END -------------------------------------- SimpleLayout.EndHorizontal(); // ROW 1: END ----------------------------------------- // ROW 2: START --------------------------------------- if (i < eventBlock.boolConditions.Count - 1) { SimpleLayout.Line(); } // ROW 2: END ----------------------------------------- } SimpleLayout.EndVertical(); }