From 17cd2916131b2e6bc240a33ef10b78d27084442e Mon Sep 17 00:00:00 2001 From: RunRobDog Date: Sun, 16 Apr 2023 01:29:14 +0200 Subject: [PATCH] make Spawn Entities tab in admin commands --- common/src/cmd.rs | 2 +- voxygen/egui/src/admin.rs | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/common/src/cmd.rs b/common/src/cmd.rs index 2ff84a99ce..cce463ea6a 100644 --- a/common/src/cmd.rs +++ b/common/src/cmd.rs @@ -203,7 +203,7 @@ lazy_static! { }; /// List of all entity configs. Useful for tab completing - static ref ENTITY_CONFIGS: Vec = { + pub static ref ENTITY_CONFIGS: Vec = { try_all_entity_configs() .unwrap_or_else(|e| { warn!(?e, "Failed to load entity configs"); diff --git a/voxygen/egui/src/admin.rs b/voxygen/egui/src/admin.rs index 284b024d1a..28fbe611b0 100644 --- a/voxygen/egui/src/admin.rs +++ b/voxygen/egui/src/admin.rs @@ -13,6 +13,16 @@ lazy_static! { item_specs }; } +lazy_static! { + static ref ITEM_CONFIGS: Vec = { + let mut item_configs = common::cmd::ITEM_CONFIGS + .iter() + .map(|entity_desc| entity_desc.replace("common.entity.", "")) + .collect::>(); + entity_configs.sort(); + entity_confifs + }; +} pub fn draw_admin_commands_window( ctx: &CtxRef, @@ -37,6 +47,11 @@ pub fn draw_admin_commands_window( .show(ui, |ui| { draw_kits(ui, state, egui_actions); }); + CollapsingHeader::new("Spawn Entities") + .default_open(false) + .show(ui, |ui| { + draw_spawn_entities(ui, state, egui_actions); + }) }); }); }