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 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 exp meter /// </summary> private static void DrawExpMeter() { SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); SimpleLayout.BeginHorizontal(); boolFields[6].value = SimpleLayout.BoolField(boolFields[6].value); SimpleLayout.Label("Ability has Experience Meter"); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); if (boolFields[6].value) { SimpleLayout.BeginHorizontal(); intFields[11].value = SimpleLayout.IntField(intFields[11].value); SimpleLayout.Label("Experience gained per use of this ability"); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); SimpleLayout.BeginHorizontal(); intFields[10].value = SimpleLayout.IntField(intFields[10].value); SimpleLayout.Label("Experience needed to morph ability"); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); DropDownValues itemList = HeroKitCommon.databaseList(HeroKitCommon.abilityDatabase); SimpleLayout.BeginHorizontal(); intFields[12].value = SimpleLayout.DropDownList(intFields[12].value, itemList, 0, HeroKit.Editor.HeroKitCommon.GetWidthForField(60, 250)); SimpleLayout.Label("Morph into..."); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); } SimpleLayout.EndVertical(); }
/// <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 DrawRange() { // item type field string[] items = { "Projectile launched at target", "Everything within radius around Caster", "Directly on Target" }; DropDownValues itemList = new DropDownValues(); itemList.setValues("", items); SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); SimpleLayout.BeginHorizontal(); intFields[2].value = SimpleLayout.DropDownList(intFields[2].value, itemList, 0, HeroKit.Editor.HeroKitCommon.GetWidthForField(60, 200)); SimpleLayout.Label("How ability is used"); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); // projectile or radius if (intFields[2].value == 1 || intFields[2].value == 2) { SimpleLayout.BeginHorizontal(); intFields[3].value = SimpleLayout.IntField(intFields[3].value); SimpleLayout.Label("Range (in meters)"); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); } // projectile if (intFields[2].value == 1) { SimpleLayout.BeginHorizontal(); intFields[4].value = SimpleLayout.IntField(intFields[4].value); SimpleLayout.Label("Speed of projectile"); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); // particle effect on target SimpleLayout.BeginHorizontal(); uoFields[3].value = SimpleLayout.ObjectField(uoFields[3].value as ParticleSystem, HeroKit.Editor.HeroKitCommon.GetWidthForField(60, 200)); SimpleLayout.Label("Particle effect for projectile"); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); } // particle effect on target SimpleLayout.BeginHorizontal(); uoFields[2].value = SimpleLayout.ObjectField(uoFields[2].value as ParticleSystem, HeroKit.Editor.HeroKitCommon.GetWidthForField(60, 200)); SimpleLayout.Label("Particle effect on target"); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); // particle effect on caster SimpleLayout.BeginHorizontal(); uoFields[1].value = SimpleLayout.ObjectField(uoFields[1].value as ParticleSystem, HeroKit.Editor.HeroKitCommon.GetWidthForField(60, 200)); SimpleLayout.Label("Particle effect on caster"); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); SimpleLayout.EndVertical(); }
/// <summary> /// Draw item type /// </summary> private static void DrawAttackSpeed() { SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); SimpleLayout.BeginHorizontal(); intFields[1].value = SimpleLayout.IntField(intFields[1].value); SimpleLayout.Label("Pause time between attacks"); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); SimpleLayout.EndVertical(); }
/// <summary> /// Draw first group of fields (name, desc, icon, price) /// </summary> private static void DrawMaxValue() { SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); // max value field SimpleLayout.Label("Max Value" + ":"); intFields[0].value = SimpleLayout.IntField(intFields[0].value, HeroKit.Editor.HeroKitCommon.GetWidthForField(60, 450)); SimpleLayout.EndVertical(); }
/// <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(); }
/// <summary> /// Draw item type /// </summary> private static void DrawTarget() { // item type field string[] items = { "Enemies", "Friends", "Caster", "Enemies and Friends", "All" }; DropDownValues itemList = new DropDownValues(); itemList.setValues("", items); // item type field string[] scope = { "All", "Some", "One" }; DropDownValues scopeList = new DropDownValues(); scopeList.setValues("", scope); SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); SimpleLayout.BeginHorizontal(); intFields[1].value = SimpleLayout.DropDownList(intFields[1].value, itemList, 0, HeroKit.Editor.HeroKitCommon.GetWidthForField(60, 250)); SimpleLayout.Label("Target"); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); SimpleLayout.BeginHorizontal(); intFields[7].value = SimpleLayout.DropDownList(intFields[7].value, scopeList, 0, HeroKit.Editor.HeroKitCommon.GetWidthForField(60, 250)); SimpleLayout.Label("Scope"); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); if (intFields[7].value == 2) { SimpleLayout.BeginHorizontal(); intFields[8].value = SimpleLayout.IntField(intFields[8].value); SimpleLayout.Label("Max number of targets"); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); SimpleLayout.BeginHorizontal(); boolFields[4].value = SimpleLayout.BoolField(boolFields[4].value); SimpleLayout.Label("Random"); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); } SimpleLayout.EndVertical(); }
/// <summary> /// Draw item type /// </summary> private static void DrawAttackSpeed() { SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); SimpleLayout.BeginHorizontal(); intFields[6].value = SimpleLayout.IntField(intFields[6].value); SimpleLayout.Label("Wait time before cast"); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); SimpleLayout.BeginHorizontal(); intFields[13].value = SimpleLayout.IntField(intFields[13].value); SimpleLayout.Label("Wait time after cast"); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); SimpleLayout.EndVertical(); }
/// <summary> /// Fields for the hero property (ints). /// </summary> private static void DrawInts() { List <IntField> items = propertyBlock.itemProperties.ints.items; // exit early if there are no values if (items == null || items.Count == 0) { return; } SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); for (int i = 0; i < items.Count; i++) { SimpleLayout.Label(items[i].name + ":"); items[i].value = SimpleLayout.IntField(items[i].value, HeroKitCommon.GetWidthForField(60, 150)); } SimpleLayout.EndVertical(); }
/// <summary> /// Draw chain attack /// </summary> private static void DrawChainAttack() { SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); SimpleLayout.BeginHorizontal(); boolFields[5].value = SimpleLayout.BoolField(boolFields[5].value); SimpleLayout.Label("Chain attack (pass attack to others in range of target that is hit)"); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); if (boolFields[5].value) { SimpleLayout.BeginHorizontal(); intFields[9].value = SimpleLayout.IntField(intFields[9].value); SimpleLayout.Label("Radius around target"); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); } 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> /// Get a value from an integer field on an event. /// This is for a field that contains Value, Variable, Property, Global. /// </summary> /// <param name="title">Title for action field.</param> /// <param name="boolData">Current data for this action field.</param> /// <param name="heroObject">Hero object that is the target of this action.</param> public static void BuildEventField(string title, ConditionIntField eventData, HeroObject heroObject) // string title, ref int fieldType, ref int objectType, ref int objectID, ref int fieldID, ref int heroGUID) { IntegerFieldData data = new IntegerFieldData(); data.heroObject = heroObject; data.targetHeroObject = eventData.targetHeroObject; data.objectType = eventData.objectType; data.objectID = eventData.objectID; data.fieldID = eventData.fieldID; data.fieldType = eventData.fieldType; data.heroGUID = eventData.heroGUID; data.propertyID = eventData.propertyID; data.objectName = eventData.objectName; data.fieldValue = eventData.fieldValue; SimpleLayout.Label(title); //----------------------------------------- // Get the type of field you want to work with. //----------------------------------------- data.fieldType = new HeroField.ValueTypeField().SetValues(data.fieldType, 0); //----------------------------------------- // Get the type of game object we are working with // Option 1: This game object (game object that this hero object is attached to) // Option 2: Another game object (another game object in the scene that has a hero object attached to it) // 2 = Local Variable, 3 = Property //----------------------------------------- if (data.fieldType == 2 || data.fieldType == 3) { data = ActionCommon.GetTargetHeroObject(data); } //----------------------------------------- // Get the integer list you want to work with. // The integer list is in hero object editor > Variables //----------------------------------------- // if this is a field, draw field (1=number) if (data.fieldType == 1) { data.fieldValue = SimpleLayout.IntField(data.fieldValue, 149); } // if this is a list, draw ints (2=integers, 3=properties) if (data.fieldType != 1) { data = SetPropertyID(data, -1); List <IntField> items = GetItemsFromList(data, -1); data = BuildItemFieldList(data, items); } //----------------------------------------- // assign values back to hero object fields //----------------------------------------- eventData.objectType = data.objectType; eventData.objectID = data.objectID; eventData.fieldID = data.fieldID; eventData.fieldType = data.fieldType; eventData.heroGUID = data.heroGUID; eventData.propertyID = data.propertyID; eventData.targetHeroObject = data.targetHeroObject; eventData.objectName = data.objectName; eventData.fieldValue = data.fieldValue; }
/// <summary> /// Get a value from an integer field. /// This is for a field that contains Value, Variable, Property, Global. /// </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> public static void BuildFieldA(string title, HeroActionParams actionParams, HeroActionField actionField, bool titleToLeft = false, SliderData sliderData = new SliderData()) { // create the fields IntegerFieldData data = CreateFieldData(title, actionField, actionParams.heroObject); //----------------------------------------- // 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 type of field you want to work with. //----------------------------------------- data.fieldType = new HeroField.ValueTypeField().SetValues(data.fieldType, 0); //----------------------------------------- // Get the type of game object we are working with // Option 1: This game object (game object that this hero object is attached to) // Option 2: Another game object (another game object in the scene that has a hero object attached to it) // 2 = Local Variable, 3 = Property //----------------------------------------- if (data.fieldType == 2 || data.fieldType == 3) { data = ActionCommon.GetTargetHeroObject(data); } //----------------------------------------- // Get the integer list you want to work with. // The integer list is in hero object editor > Variables //----------------------------------------- // if this is a field, draw field (1=number) if (data.fieldType == 1) { if (!sliderData.useSlider) { data.fieldValue = SimpleLayout.IntField(data.fieldValue, 149); } else { data.fieldValue = (int)SimpleLayout.SliderField(data.fieldValue, 250, sliderData.min, sliderData.max); if (data.fieldValue > sliderData.max) { data.fieldValue = (int)sliderData.max; } else if (data.fieldValue < sliderData.min) { data.fieldValue = (int)sliderData.min; } } } // if this is a list, draw ints (2=integers, 3=properties) if (data.fieldType != 1) { data = SetPropertyID(data, -1); List <IntField> items = GetItemsFromList(data, -1); data = BuildItemFieldList(data, items); } //----------------------------------------- // assign values back to hero object fields //----------------------------------------- actionField.ints[0] = data.objectType; actionField.ints[1] = data.objectID; actionField.ints[2] = data.fieldID; actionField.ints[3] = data.fieldType; actionField.ints[4] = data.heroGUID; actionField.heroObjects[0] = data.targetHeroObject; actionField.strings[0] = data.objectName; actionField.ints[5] = data.fieldValue; actionField.ints[6] = data.propertyID; //----------------------------------------- // Visual stuff //----------------------------------------- SimpleLayout.Space(); SimpleLayout.EndHorizontal(); }