From c4315a7afafcc9adff945b5e63800340f6c2c008 Mon Sep 17 00:00:00 2001 From: darkrose Date: Fri, 1 Jun 2012 23:10:53 +1000 Subject: Strip unneeded variables from NodeMetadata --- src/game.cpp | 41 ++++++++++++++++++----------------------- 1 file changed, 18 insertions(+), 23 deletions(-) (limited to 'src/game.cpp') 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"<getString("formspec") == "hack:sign_text_input" && !random_input) + { + infostream<<"Launching metadata text input"<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"<getInventoryDrawSpecString() != "" && !random_input) + else if(meta && meta->getString("formspec") != "" && !random_input) { infostream<<"Launching custom inventory view"<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"<getText()); - - (new GUITextInputMenu(guienv, guiroot, -1, - &g_menumgr, dest, - wtext))->drop(); - } - #else - if(0) /* do nothing */; - #endif // Otherwise report right click to server else { -- cgit v1.2.3