diff options
-rw-r--r-- | src/game/base/template.cc | 35 | ||||
-rw-r--r-- | src/game/base/template.h | 2 |
2 files changed, 36 insertions, 1 deletions
diff --git a/src/game/base/template.cc b/src/game/base/template.cc index 7ef4106..fd04402 100644 --- a/src/game/base/template.cc +++ b/src/game/base/template.cc @@ -17,7 +17,21 @@ core::InfoType *Template::template_infotype = 0; void func_list_template(const std::string &args) { - Template::list(); + std::stringstream argstr(args); + std::string label; + if (argstr >> label) { + aux::to_label(label); + Template *entitytemplate = Template::find(label); + if (entitytemplate) { + entitytemplate->print(); + + } else { + con_warn << "Unknown template '" << label << "'" << std::endl; + return; + } + } else { + Template::list(); + } } Template *Template::find(const std::string & label) @@ -29,6 +43,25 @@ Template *Template::find(const std::string & label) } } +void Template::print() const { + con_print << "Template '" << label() << "' info id " << id() << std::endl; + // show radius if set + if (radius()) + con_print << " radius " << radius() << std::endl; + + // set modelname + if (modelname().size()) + con_print << " model " << modelname() << std::endl; + + // set primary color + if (has_color()) + con_print << " primary color " << color() << std::endl; + + // set secondary color + if (has_color_second()) + con_print << " primary color " << color_second() << std::endl; +} + void Template::list() { core::Info::list(template_infotype); diff --git a/src/game/base/template.h b/src/game/base/template.h index 7934a7f..a89a092 100644 --- a/src/game/base/template.h +++ b/src/game/base/template.h @@ -44,6 +44,8 @@ public: return template_color_second; } + virtual void print() const; + /* --- actors ----------------------------------------------------- */ /** |