aboutsummaryrefslogtreecommitdiff
path: root/src/guiTextInputMenu.h
blob: c679aa9ca35bc2430317d5ab07a000d90dad0103 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
Minetest-c55
Copyright (C) 2010 celeron55, Perttu Ahola <celeron55@gmail.com>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#ifndef GUITEXTINPUTMENU_HEADER
#define GUITEXTINPUTMENU_HEADER

#include "common_irrlicht.h"
#include "modalMenu.h"
#include "utility.h"
#include <string>

struct TextDest
{
	virtual void gotText(std::wstring text) = 0;
};

class GUITextInputMenu : public GUIModalMenu
{
public:
	GUITextInputMenu(gui::IGUIEnvironment* env,
			gui::IGUIElement* parent, s32 id,
			IMenuManager *menumgr,
			TextDest *dest,
			std::wstring initial_text);
	~GUITextInputMenu();
	
	void removeChildren();
	/*
		Remove and re-add (or reposition) stuff
	*/
	void regenerateGui(v2u32 screensize);

	void drawMenu();

	void acceptInput();

	bool OnEvent(const SEvent& event);
	
private:
	TextDest *m_dest;
	std::wstring m_initial_text;
};

#endif

an class="hl opt">, "moreblocks:stone_tile") minetest.register_alias("moreblocks:circlestonebrick", "moreblocks:circle_stone_bricks") minetest.register_alias("moreblocks:ironstonebrick", "moreblocks:iron_stone_bricks") minetest.register_alias("moreblocks:fence_junglewood", "moreblocks:fence_jungle_wood") minetest.register_alias("moreblocks:coalstone", "moreblocks:coal_stone") minetest.register_alias("moreblocks:ironstone", "moreblocks:iron_stone") minetest.register_alias("moreblocks:woodtile", "moreblocks:wood_tile") minetest.register_alias("moreblocks:woodtile_full", "moreblocks:wood_tile_full") minetest.register_alias("moreblocks:woodtile_centered", "moreblocks:wood_tile_centered") minetest.register_alias("moreblocks:woodtile_up", "moreblocks:wood_tile_up") minetest.register_alias("moreblocks:woodtile_down", "moreblocks:wood_tile_down") minetest.register_alias("moreblocks:woodtile_left", "moreblocks:wood_tile_left") minetest.register_alias("moreblocks:woodtile_right", "moreblocks:wood_tile_right") minetest.register_alias("moreblocks:coalglass", "moreblocks:coal_glass") minetest.register_alias("moreblocks:ironglass", "moreblocks:iron_glass") minetest.register_alias("moreblocks:glowglass", "moreblocks:glow_glass") minetest.register_alias("moreblocks:superglowglass", "moreblocks:super_glow_glass") minetest.register_alias("moreblocks:trapglass", "moreblocks:trap_glass") minetest.register_alias("moreblocks:trapstone", "moreblocks:trap_stone") minetest.register_alias("moreblocks:cactuschecker", "moreblocks:cactus_checker") minetest.register_alias("moreblocks:coalchecker", "moreblocks:coal_checker") minetest.register_alias("moreblocks:ironchecker", "moreblocks:iron_checker") minetest.register_alias("moreblocks:cactusbrick", "moreblocks:cactus_brick") minetest.register_alias("moreblocks:cleanglass", "moreblocks:clean_glass") minetest.register_alias("moreblocks:emptybookshelf", "moreblocks:empty_bookshelf") minetest.register_alias("moreblocks:junglestick", "moreblocks:jungle_stick") minetest.register_alias("moreblocks:splitstonesquare","moreblocks:split_stone_tile") minetest.register_alias("moreblocks:allfacestree","moreblocks:all_faces_tree") -- ABM for horizontal trees (fix facedir). local horizontal_tree_convert_facedir = {7, 12, 9, 18} minetest.register_abm({ nodenames = {"moreblocks:horizontal_tree","moreblocks:horizontal_jungle_tree"}, interval = 1, chance = 1, action = function(pos, node) if node.name == "moreblocks:horizontal_tree" then node.name = "default:tree" else node.name = "default:jungletree" end node.param2 = node.param2 < 3 and node.param2 or 0 minetest.set_node(pos, { name = node.name, param2 = horizontal_tree_convert_facedir[node.param2 + 1] }) end, })