summaryrefslogtreecommitdiff
path: root/plugins/manipulator.cpp
diff options
context:
space:
mode:
authorAlexander Gavrilov2012-08-22 12:23:56 +0400
committerAlexander Gavrilov2012-08-22 12:23:56 +0400
commit8969fc9435859399441cc5bc4f4308411183ef46 (patch)
tree2c9bd08ef26c848318c95d375d176e9e5a97e586 /plugins/manipulator.cpp
parentb6e5786b4f888566e03573f4c0e911a820be7ab9 (diff)
downloaddfhack-8969fc9435859399441cc5bc4f4308411183ef46.tar.gz
dfhack-8969fc9435859399441cc5bc4f4308411183ef46.tar.bz2
dfhack-8969fc9435859399441cc5bc4f4308411183ef46.tar.xz
manipulator: Inherit from dfhack_viewscreen, and don't use itoa.
Diffstat (limited to 'plugins/manipulator.cpp')
-rw-r--r--plugins/manipulator.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/plugins/manipulator.cpp b/plugins/manipulator.cpp
index 5179b013..deb45b9d 100644
--- a/plugins/manipulator.cpp
+++ b/plugins/manipulator.cpp
@@ -36,7 +36,7 @@ using df::global::enabler;
typedef struct
{
- char *name;
+ const char *name;
int points;
char abbrev;
} SkillLevel;
@@ -241,7 +241,7 @@ DFHACK_PLUGIN("manipulator");
#define FILTER_LIVING 0x0010
#define FILTER_DEAD 0x0020
-class viewscreen_unitlaborsst : public df::viewscreen {
+class viewscreen_unitlaborsst : public dfhack_viewscreen {
public:
static viewscreen_unitlaborsst *create (char pushtype, df::viewscreen *scr = NULL);
@@ -251,12 +251,11 @@ public:
void resize(int w, int h) { calcSize(); }
void help() { }
- int8_t movies_okay() { return 1; }
- int8_t is_option_screen() { return 0; }
- int8_t is_save_screen() { return 0; }
+
+ std::string getFocusString() { return "unitlabors"; }
+
viewscreen_unitlaborsst();
~viewscreen_unitlaborsst() { };
- bool key_conflict(df::interface_key test_key) { return test_key == interface_key::OPTIONS; }
protected:
vector<df::unit *> units;
@@ -577,11 +576,7 @@ void viewscreen_unitlaborsst::render()
str += ENUM_ATTR_STR(job_skill, caption_noun, columns[sel_column].skill);
if (level != NUM_SKILL_LEVELS - 1)
{
- str += " (";
- str += itoa(skill->experience, buf, 10);
- str += "/";
- str += itoa(skill_levels[level].points, buf, 10);
- str += ")";
+ str += stl_sprintf(" (%d/%d)", skill->experience, skill_levels[level].points);
}
}
else