summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authordarkrose <lisa@ltmnet.com>2012-06-01 23:10:53 +1000
committerPerttu Ahola <celeron55@gmail.com>2012-06-03 22:31:00 +0300
commitc4315a7afafcc9adff945b5e63800340f6c2c008 (patch)
tree8ad98a55fa774c6c1123c1e1d463d508d6a8173d /src/game.cpp
parent704782c95b8a4194a9383da55d93f37fd0f7278f (diff)
downloadminetest-c4315a7afafcc9adff945b5e63800340f6c2c008.tar.gz
minetest-c4315a7afafcc9adff945b5e63800340f6c2c008.tar.bz2
minetest-c4315a7afafcc9adff945b5e63800340f6c2c008.zip
Strip unneeded variables from NodeMetadata
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp41
1 files changed, 18 insertions, 23 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 8440801b7..69fc601c3 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -2195,7 +2195,7 @@ void the_game(
ClientMap &map = client.getEnv().getClientMap();
NodeMetadata *meta = map.getNodeMetadata(nodepos);
if(meta){
- infotext = narrow_to_wide(meta->getInfoText());
+ infotext = narrow_to_wide(meta->getString("infotext"));
} else {
MapNode n = map.getNode(nodepos);
if(nodedef->get(n).tname_tiles[0] == "unknown_block.png"){
@@ -2320,10 +2320,23 @@ void the_game(
{
infostream<<"Ground right-clicked"<<std::endl;
+ // sign special case, at least until formspec is properly implemented
+ if(meta && meta->getString("formspec") == "hack:sign_text_input" && !random_input)
+ {
+ infostream<<"Launching metadata text input"<<std::endl;
+
+ // Get a new text for it
+
+ TextDest *dest = new TextDestNodeMetadata(nodepos, &client);
+
+ std::wstring wtext = narrow_to_wide(meta->getString("text"));
+
+ (new GUITextInputMenu(guienv, guiroot, -1,
+ &g_menumgr, dest,
+ wtext))->drop();
+ }
// If metadata provides an inventory view, activate it
- errorstream<<"Need to implement metadata formspecs"<<std::endl;
- #if 0
- if(meta && meta->getInventoryDrawSpecString() != "" && !random_input)
+ else if(meta && meta->getString("formspec") != "" && !random_input)
{
infostream<<"Launching custom inventory view"<<std::endl;
@@ -2339,7 +2352,7 @@ void the_game(
v2s16 invsize =
GUIInventoryMenu::makeDrawSpecArrayFromString(
draw_spec,
- meta->getInventoryDrawSpecString(),
+ meta->getString("formspec"),
inventoryloc);
GUIInventoryMenu *menu =
@@ -2349,24 +2362,6 @@ void the_game(
menu->setDrawSpec(draw_spec);
menu->drop();
}
- // If metadata provides text input, activate text input
- else if(meta && meta->allowsTextInput() && !random_input)
- {
- infostream<<"Launching metadata text input"<<std::endl;
-
- // Get a new text for it
-
- TextDest *dest = new TextDestNodeMetadata(nodepos, &client);
-
- std::wstring wtext = narrow_to_wide(meta->getText());
-
- (new GUITextInputMenu(guienv, guiroot, -1,
- &g_menumgr, dest,
- wtext))->drop();
- }
- #else
- if(0) /* do nothing */;
- #endif
// Otherwise report right click to server
else
{