make Spawn Entities tab in admin commands

This commit is contained in:
RunRobDog 2023-04-16 01:29:14 +02:00
parent f14d312ac3
commit 17cd291613
2 changed files with 16 additions and 1 deletions

View File

@ -203,7 +203,7 @@ lazy_static! {
};
/// List of all entity configs. Useful for tab completing
static ref ENTITY_CONFIGS: Vec<String> = {
pub static ref ENTITY_CONFIGS: Vec<String> = {
try_all_entity_configs()
.unwrap_or_else(|e| {
warn!(?e, "Failed to load entity configs");

View File

@ -13,6 +13,16 @@ lazy_static! {
item_specs
};
}
lazy_static! {
static ref ITEM_CONFIGS: Vec<String> = {
let mut item_configs = common::cmd::ITEM_CONFIGS
.iter()
.map(|entity_desc| entity_desc.replace("common.entity.", ""))
.collect::<Vec<String>>();
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);
})
});
});
}