Beispiel #1
0
        public static void RenderDebug(JsonValue root)
        {
            if (!root["uses"].IsJsonArray)
            {
                root["uses"] = new JsonArray();
            }

            ItemEditor.DisplayUse(root, root["uses"]);
        }
        public static void RenderDebug(JsonValue root)
        {
            var type = root["tp"].String("");
            var use  = root["use"].String("");

            if (ImGui.InputText("Use", ref use, 128))
            {
                root["use"] = use;
            }

            var c = !UseRegistry.Uses.ContainsKey(use);

            if (c)
            {
                ImGui.BulletText("Unknown use");
            }

            if (ImGui.InputText("Event type", ref type, 256))
            {
                root["tp"] = type;
            }

            try {
                Type.GetType(type, true, false);
            } catch (Exception e) {
                ImGui.BulletText("Unknown type");
            }

            if (c)
            {
                return;
            }

            var us = root["us"];

            if (us == JsonValue.Null)
            {
                us = root["us"] = new JsonObject();
            }

            us["id"] = use;

            ItemEditor.DisplayUse(root, us);
        }
Beispiel #3
0
        public static void RenderDebug(JsonValue root)
        {
            root.InputFloat("Chance", "chance", 100f);

            if (ImGui.TreeNode("With who"))
            {
                DoWithTagUse.RenderDebug(root);
                ImGui.TreePop();
            }

            ImGui.Separator();

            if (!root["uses"].IsJsonArray)
            {
                root["uses"] = new JsonArray();
            }

            ItemEditor.DisplayUse(root, root["uses"]);
        }
Beispiel #4
0
        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();
            }
        }