From fa736e138c2eb04f50bcc0431fc5a0435bf34bc6 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Mon, 4 Apr 2011 05:12:33 +0300 Subject: fully implemented the sign with the new framework --- src/main.cpp | 47 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 4b968865f..c9099f69b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -578,6 +578,25 @@ struct TextDestChat : public TextDest Client *m_client; }; +struct TextDestSignNode : public TextDest +{ + TextDestSignNode(v3s16 p, Client *client) + { + m_p = p; + m_client = client; + } + void gotText(std::wstring text) + { + std::string ntext = wide_to_narrow(text); + dstream<<"Changing text of a sign node: " + <sendSignNodeText(m_p, ntext); + } + + v3s16 m_p; + Client *m_client; +}; + class MyEventReceiver : public IEventReceiver { public: @@ -2829,6 +2848,8 @@ int main(int argc, char *argv[]) { infotext = narrow_to_wide(meta->infoText()); } + + //MapNode node = client.getNode(nodepos); /* Handle digging @@ -2956,7 +2977,31 @@ int main(int argc, char *argv[]) if(g_input->getRightClicked()) { std::cout<typeId() == CONTENT_SIGN_WALL) + { + dstream<<"Sign node right-clicked"<getText()); + + (new GUITextInputMenu(guienv, guiroot, -1, + &g_menumgr, dest, + wtext))->drop(); + } + } + else + { + client.groundAction(1, nodepos, neighbourpos, g_selected_item); + } } nodepos_old = nodepos; -- cgit v1.2.3