public static void RenderDebug(JsonValue root) { root.Checkbox("Back", "back", false); root.Checkbox("Up", "up", false); root.Checkbox("Down", "down", false); root.InputFloat("Chance", "chance", 10); }
public static void RenderDebug(JsonValue root) { root.InputInt("Modifier", "amount"); root.Checkbox("Coins", "coins", true); root.Checkbox("Keys", "keys", false); root.Checkbox("Bombs", "bombs", false); }
public static void RenderDebug(JsonValue root) { root.Checkbox("From Any Source", "any", false); root.InputFloat("Chance", "chance"); root.InputFloat("Damage Modifier", "damage"); root.InputFloat("Scale", "scale"); root.Checkbox("Make it mine", "mine", false); ImGui.Separator(); if (root.Checkbox("Random Effect", "rne", false)) { root.InputFloat("Effect Change Speed", "ecs", 3f); } else { if (ImGui.TreeNode("Buff")) { if (!BuffRegistry.All.ContainsKey(root.InputText("Buff", "buff", "bk:frozen"))) { ImGui.BulletText("Unknown buff!"); } if (!root.Checkbox("Infinite", "infinite_buff", false)) { root.InputFloat("Buff Duration", "buff_time"); } ImGui.TreePop(); } } }
public static void RenderDebug(JsonValue root) { GiveBuffUse.RenderDebug(root); ImGui.Separator(); root.Checkbox("Give ice immunity", "ice", false); root.Checkbox("Pit immunity", "pit", false); }
public static void RenderDebug(JsonValue root) { if (root.Checkbox("On Kills", "kills", true)) { root.InputInt("Speed", "speed", 10); } root.Checkbox("On Chests", "chests", false); root.Checkbox("On Purchase", "purchase", false); }
public static void RenderDebug(JsonValue root) { root.Checkbox("XL Level", "xl", false); root.Checkbox("Generate Market", "gm", false); root.Checkbox("Only Shops", "sp", false); root.Checkbox("Only Treasure", "tr", false); root.Checkbox("Only Generate Melee", "ml", false); root.InputFloat("Chest Reward Chance Modifier", "crc", 0); root.InputFloat("Mob Not Shoot Chance Modifier", "md", 0); root.InputFloat("Mimic Chance Modifier", "mimic", 0); }
public static void RenderDebug(JsonValue root) { var v = root["fp"].Bool(false); if (ImGui.Checkbox("For projectiles", ref v)) { root["fp"] = v; } v = root["fpl"].Bool(false); if (ImGui.Checkbox("For player", ref v)) { root["fpl"] = v; } ImGui.Separator(); root.Checkbox("Projectiles", "p", false); v = root["ic"].Bool(false); if (ImGui.Checkbox("Ignore chasms", ref v)) { root["ic"] = v; } v = root["ip"].Bool(false); if (ImGui.Checkbox("Ignore props", ref v)) { root["ip"] = v; } v = root["iw"].Bool(false); if (ImGui.Checkbox("Ignore walls", ref v)) { root["iw"] = v; } v = root["im"].Bool(false); if (ImGui.Checkbox("Ignore mobs", ref v)) { root["im"] = v; } root.Checkbox("Ignore stones", "st", false); root.Checkbox("Break Projectiles", "bp", false); }
public static void RenderDebug(JsonValue root) { root.Checkbox("Only if has none", "oin", false); if (root.Checkbox("Random", "random", false)) { return; } if (!OrbitalRegistry.Has(root.InputText("Orbital", "orbital", "", 128))) { ImGui.BulletText("Unknown orbital!"); } }
public static void RenderDebug(JsonValue root) { root.Checkbox("Open Both if one is present", "bt", false); ImGui.Separator(); root.InputFloat("Granny", "gr", 0); root.Checkbox("Add Granny", "agr", true); ImGui.Separator(); root.InputFloat("Dm", "dm", 0); root.Checkbox("Add Dm", "adm", true); }
public static void RenderDebug(JsonValue root) { var v = root["lv"].Bool(false); if (ImGui.Checkbox("From lava", ref v)) { root["lv"] = v; } v = root["sp"].Bool(false); if (ImGui.Checkbox("From spikes", ref v)) { root["sp"] = v; } v = root["cs"].Bool(false); if (ImGui.Checkbox("From chasm", ref v)) { root["cs"] = v; } v = root["bms"].Bool(false); if (ImGui.Checkbox("From explosions", ref v)) { root["bms"] = v; } root.Checkbox("From Contact", "cnt", false); }
public static void RenderDebug(JsonValue root) { var stand = root["on_stand"].Bool(false); var random = root["random"].Bool(false); if (ImGui.Checkbox("Spawn on stand?", ref stand)) { root["on_stand"] = stand; } if (ImGui.Checkbox("Random item?", ref random)) { root["random"] = random; } if (stand) { return; } var val = root["amount"].Int(1); if (!random) { var item = root["item"].AsString ?? ""; if (ImGui.InputText("Item", ref item, 128)) { root["item"] = item; } if (!Items.Datas.ContainsKey(item)) { ImGui.BulletText("Unknown item!"); } } if (ImGui.InputInt("Amount", ref val)) { root["amount"] = val; } root.Checkbox("Animate?", "animate", true); root.Checkbox("Hide?", "hide", false); }
public static void RenderDebug(JsonValue root) { var val = root["amount"].Int(1); if (ImGui.InputInt("Amount", ref val)) { root["amount"] = val; } var giveHp = root["give_hp"].Bool(true); if (ImGui.Checkbox("Give health", ref giveHp)) { root["give_hp"] = giveHp; } root.Checkbox("Set", "set", false); root.Checkbox("Bomb", "bomb", false); }
public static void RenderDebug(JsonValue root) { var v = root["prc"].Number(50f); if (ImGui.InputFloat("% sale", ref v)) { root["prc"] = v; } root.Checkbox("Only when used", "wu", false); }
public static void RenderDebug(JsonValue root) { var val = root["amount"].Int(1); if (ImGui.InputInt("Amount", ref val)) { root["amount"] = val; } root.Checkbox("Broken", "broken", false); }
public static void RenderDebug(JsonValue root) { var speed = root["speed"].Number(1); if (ImGui.InputFloat("Speed", ref speed)) { root["speed"] = speed; } root.Checkbox("Better?", "better", false); }
public static void RenderDebug(JsonValue root) { var all = root["all"].Bool(false); if (ImGui.Checkbox("All?", ref all)) { root["all"] = all; } if (all || root.Checkbox("Half", "half", false)) { return; } var count = root["count"].Int(1); if (ImGui.InputInt("Count", ref count)) { root["count"] = count; } }
public static void RenderDebug(JsonValue root) { root.InputFloat("Speed", "speed", 0); root.Checkbox("Add Speed", "add_speed"); root.InputFloat("Damage", "damage", 0); root.Checkbox("Add Damage", "add_damage"); root.InputFloat("Fire Rate", "fire_rate", 0); root.Checkbox("Add Fire Rate", "add_fire_rate"); root.InputFloat("Ranged Rate", "ranged_rate", 0); root.Checkbox("Add Ranged Rate", "add_ranged_rate"); root.InputFloat("Accuracy", "accuracy", 0); root.Checkbox("Add Accuracy", "add_accuracy"); root.InputFloat("Range", "range", 0); root.Checkbox("Add Range", "add_range"); root.InputFloat("Knockback", "knockback", 0); root.Checkbox("Add Knockback", "add_knockback"); }
public static void RenderDebug(JsonValue root) { root.Checkbox("Water Bucket", "wt", false); root.Checkbox("Snow Bucket", "snw", false); }
public static void RenderDebug(JsonValue root) { var rerollStands = root["r_stands"].Bool(true); var spawnNew = root["s_new"].Bool(true); var ignore = root["ignore"].Bool(true); root.InputFloat("Consume Chance", "cc", 0); root.Checkbox("D2", "d2", false); if (ImGui.Checkbox("Reroll stands", ref rerollStands)) { root["r_stands"] = rerollStands; } if (ImGui.Checkbox("Spawn new", ref spawnNew)) { root["s_new"] = spawnNew; } var tps = root["types"]; if (!tps.IsJsonArray) { tps = root["types"] = new JsonArray(); } if (ImGui.TreeNode("Item types")) { if (ImGui.Checkbox("Ignore those types", ref ignore)) { root["ignore"] = ignore; } ImGui.Separator(); var tp = tps.AsJsonArray; var toRemove = -1; var toAdd = -1; for (var i = 0; i < ItemEditor.Types.Length; i++) { var v = tp.Contains(i); if (ImGui.Checkbox(ItemEditor.Types[i], ref v)) { if (v) { toAdd = i; } else { toRemove = tp.IndexOf(i); } } } if (toRemove != -1) { tp.Remove(toRemove); } else if (toAdd != -1) { tp.Add(toAdd); } ImGui.TreePop(); } }
public static void DisplayUse(JsonValue parent, JsonValue root, string useId = null) { if (root == JsonValue.Null) { return; } ImGui.PushID(ud); ud++; if (!root.IsJsonArray && parent != JsonValue.Null) { if (ImGui.Button("-")) { if (parent.IsJsonArray) { toRemove = parent.AsJsonArray.IndexOf(root); } else if (root.IsJsonObject) { root.AsJsonObject.Clear(); } return; } ImGui.SameLine(); } if (root.IsString) { if (ImGui.TreeNode(root.AsString)) { ImGui.TreePop(); } } else if (root.IsJsonObject && root["id"] != JsonValue.Null) { var id = root["id"].AsString; if (ImGui.TreeNode(id)) { root.Checkbox("Single Use", "single", false); ImGui.Separator(); if (UseRegistry.Renderers.TryGetValue(id, out var renderer)) { renderer(root); } else { ImGui.Text($"No renderer found for use '{id}'"); } ImGui.TreePop(); } } else if (root.IsJsonArray) { foreach (var u in root.AsJsonArray) { DisplayUse(root, u); } if (toRemove > -1) { root.AsJsonArray.Remove(toRemove); toRemove = -1; } if (useId != null) { if (ImGui.Button("Add")) { root.AsJsonArray.Add(new JsonObject { ["id"] = useId }); } } else { if (ImGui.Button("Add use")) { toAdd = root; ImGui.OpenPopup("Add item use"); } } if (ImGui.BeginPopupModal("Add item use")) { id = 0; ImGui.SetWindowSize(popupSize); popupFilter.Draw(""); ImGui.BeginChild("ScrollingRegionUses", new System.Numerics.Vector2(0, -ImGui.GetStyle().ItemSpacing.Y - ImGui.GetFrameHeightWithSpacing() - 4), false, ImGuiWindowFlags.HorizontalScrollbar); foreach (var i in UseRegistry.Uses) { ImGui.PushID(id); if (popupFilter.PassFilter(i.Key) && ImGui.Selectable(i.Key, selectedUse == i.Key)) { selectedUse = i.Key; } ImGui.PopID(); id++; } ImGui.EndChild(); ImGui.Separator(); if (ImGui.Button("Add") || Input.Keyboard.WasPressed(Keys.Enter, true)) { toAdd.AsJsonArray.Add(new JsonObject { ["id"] = selectedUse }); ImGui.CloseCurrentPopup(); } ImGui.SameLine(); if (ImGui.Button("Cancel") || Input.Keyboard.WasPressed(Keys.Escape, true)) { ImGui.CloseCurrentPopup(); } ImGui.EndPopup(); } } else { if (ImGui.TreeNode(root.ToString())) { ImGui.TreePop(); } } ImGui.PopID(); }
public static void RenderDebug(JsonValue root) { if (root.InputInt("Mana Usage", "mana", 0) > 0) { var b = root["mdr"].Int(0); if (ImGui.Combo("Place Mana", ref b, manaDropNames, manaDropNames.Length)) { root["mdr"] = b; } } if (ImGui.TreeNode("Stats")) { root.Checkbox("To Cursor", "cursor", false); root.Checkbox("To Cloest Target", "tomb", false); root.InputFloat("Damage", "damage"); root.InputInt("Projectile Count", "amount"); root.InputText("Sound", "sfx", "item_gun_fire"); root.InputInt("Sound Prefix Number", "sfxn", 0); root.Checkbox("Reload Sound", "rsfx", false); root.Checkbox("Drop Shells", "shells", true); root.Checkbox("Uses Emeralds", "emeralds", false); var c = root.InputText("Color", "color"); if (!string.IsNullOrEmpty(c) && !ProjectileColor.Colors.ContainsKey(c)) { ImGui.BulletText("Unknown color"); } ImGui.Separator(); root.InputFloat("Min Speed", "speed", 10); root.InputFloat("Max Speed", "speedm", 10); root.Checkbox("Disable Boost", "dsb", false); ImGui.Separator(); root.InputFloat("Min Scale", "scale"); root.InputFloat("Max Scale", "scalem"); ImGui.Separator(); var range = (float)root["range"].Number(0); if (ImGui.InputFloat("Range", ref range)) { root["range"] = range; } var knockback = (float)root["knockback"].Number(1); if (ImGui.InputFloat("Knockback", ref knockback)) { root["knockback"] = knockback; } root.InputFloat("Additional Angle", "ang", 0); var accuracy = (float)root["accuracy"].Number(0); if (ImGui.InputFloat("Accuracy", ref accuracy)) { root["accuracy"] = accuracy; } var light = root["light"].Bool(true); if (ImGui.Checkbox("Light", ref light)) { root["light"] = light; } var rect = root["rect"].Bool(false); if (ImGui.Checkbox("Rect body", ref rect)) { root["rect"] = rect; } var wait = root["wait"].Bool(false); if (ImGui.Checkbox("Wait for projectile death", ref wait)) { root["wait"] = wait; } var prefab = root["prefab"].String(""); if (ImGui.InputText("Prefab", ref prefab, 128)) { root["prefab"] = prefab; } if (prefab.Length > 0 && ProjectileRegistry.Get(prefab) == null) { ImGui.BulletText("Unknown prefab"); } var slice = root["texture"].String("rect"); if (slice == "default") { slice = "rect"; } var region = CommonAse.Projectiles.GetSlice(slice, false); if (region != null) { ImGui.Image(ImGuiHelper.ProjectilesTexture, new Num.Vector2(region.Width * 3, region.Height * 3), new Num.Vector2(region.X / region.Texture.Width, region.Y / region.Texture.Height), new Num.Vector2((region.X + region.Width) / region.Texture.Width, (region.Y + region.Height) / region.Texture.Height)); } if (ImGui.InputText("Texture", ref slice, 128)) { root["texture"] = slice; } ImGui.TreePop(); } if (ImGui.TreeNode("Modifiers")) { if (!root["modifiers"].IsJsonArray) { root["modifiers"] = new JsonArray(); } ItemEditor.DisplayUse(root, root["modifiers"], "bk:ModifyProjectiles"); ImGui.TreePop(); } }
public static void RenderDebug(JsonValue root) { root.Checkbox("Pets", "pets", true); root.Checkbox("Orbitals", "orbitals", false); root.Checkbox("Any", "any", false); }
public static void RenderDebug(JsonValue root) { root.InputInt("Amount", "amount"); root.Checkbox("Set To Min", "to_min", false); root.Checkbox("Fully Heal", "to_max", false); }