summaryrefslogtreecommitdiff
path: root/library
diff options
context:
space:
mode:
authorAlexander Gavrilov2012-08-22 12:23:56 +0400
committerAlexander Gavrilov2012-08-22 12:23:56 +0400
commit8969fc9435859399441cc5bc4f4308411183ef46 (patch)
tree2c9bd08ef26c848318c95d375d176e9e5a97e586 /library
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 'library')
-rw-r--r--library/include/modules/Screen.h4
-rw-r--r--library/modules/Screen.cpp10
2 files changed, 8 insertions, 6 deletions
diff --git a/library/include/modules/Screen.h b/library/include/modules/Screen.h
index e2923317..10b6afb2 100644
--- a/library/include/modules/Screen.h
+++ b/library/include/modules/Screen.h
@@ -123,6 +123,9 @@ namespace DFHack
static bool is_instance(df::viewscreen *screen);
+ virtual int8_t movies_okay() { return 1; }
+ virtual bool key_conflict(df::interface_key key);
+
virtual bool is_lua_screen() { return false; }
virtual std::string getFocusString() = 0;
};
@@ -154,6 +157,5 @@ namespace DFHack
virtual void help();
virtual void resize(int w, int h);
virtual void feed(std::set<df::interface_key> *keys);
- virtual bool key_conflict(df::interface_key key);
};
}
diff --git a/library/modules/Screen.cpp b/library/modules/Screen.cpp
index 561ae2c5..7dcbba32 100644
--- a/library/modules/Screen.cpp
+++ b/library/modules/Screen.cpp
@@ -269,6 +269,11 @@ bool dfhack_viewscreen::is_instance(df::viewscreen *screen)
return dfhack_screens.count(screen) != 0;
}
+bool dfhack_viewscreen::key_conflict(df::interface_key key)
+{
+ return key == interface_key::OPTIONS;
+}
+
/*
* Lua-backed viewscreen.
*/
@@ -516,8 +521,3 @@ void dfhack_lua_viewscreen::feed(std::set<df::interface_key> *keys)
lua_pushlightuserdata(Lua::Core::State, keys);
safe_call_lua(do_input, 1, 0);
}
-
-bool dfhack_lua_viewscreen::key_conflict(df::interface_key key)
-{
- return key == interface_key::MOVIES || key == interface_key::OPTIONS;
-}