1 /************************************************************************
3 * voxelands - 3d voxel world sandbox game
4 * Copyright (C) Lisa 'darkrose' Milne 2013-2014 <lisa@ltmnet.com>
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 * See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>
19 * License updated from GPLv2 or later to GPLv3 or later by Lisa Milne
21 ************************************************************************/
23 #include "common_irrlicht.h"
24 #include "modalMenu.h"
31 #include "guiPauseMenu.h"
37 GUI_ID_CD_QUIT_BUTTON
= 101,
38 GUI_ID_CD_SAVE_BUTTON
,
39 GUI_ID_CD_MALE_BUTTON
,
40 GUI_ID_CD_FEMALE_BUTTON
,
41 GUI_ID_CD_TALLER_BUTTON
,
42 GUI_ID_CD_SHORTER_BUTTON
,
43 GUI_ID_CD_WIDER_BUTTON
,
44 GUI_ID_CD_THINNER_BUTTON
,
45 GUI_ID_CD_SKINTONE_PREV_BUTTON
,
46 GUI_ID_CD_SKINTONE_NEXT_BUTTON
,
47 GUI_ID_CD_FACE_PREV_BUTTON
,
48 GUI_ID_CD_FACE_NEXT_BUTTON
,
49 GUI_ID_CD_HAIRTONE_PREV_BUTTON
,
50 GUI_ID_CD_HAIRTONE_NEXT_BUTTON
,
51 GUI_ID_CD_HAIR_PREV_BUTTON
,
52 GUI_ID_CD_HAIR_NEXT_BUTTON
,
53 GUI_ID_CD_EYES_PREV_BUTTON
,
54 GUI_ID_CD_EYES_NEXT_BUTTON
,
55 GUI_ID_CD_SHIRT_PREV_BUTTON
,
56 GUI_ID_CD_SHIRT_NEXT_BUTTON
,
57 GUI_ID_CD_PANTS_PREV_BUTTON
,
58 GUI_ID_CD_PANTS_NEXT_BUTTON
,
59 GUI_ID_CD_SHOES_PREV_BUTTON
,
60 GUI_ID_CD_SHOES_NEXT_BUTTON
,
63 class GUICharDefMenu
: public GUIModalMenu
67 IrrlichtDevice
* device
,
68 gui::IGUIEnvironment
* env
,
69 gui::IGUIElement
* parent
, s32 id
,
74 void removeChildren();
76 Remove and re-add (or reposition) stuff
78 void regenerateGui(v2u32 screensize
);
89 bool OnEvent(const SEvent
& event
);
91 std::string
getPlayerSkin();
92 video::ITexture
* getPlayerTexture()
94 std::string tex
= getPlayerSkin();
95 return g_texturesource
->getTextureRaw(tex
);
97 void fetchPlayerSkin();
98 void savePlayerSkin();
102 std::string chardef
= m_parts
["gender"];
103 chardef
+= std::string(":")+m_parts
["Yscale"];
104 chardef
+= std::string(":")+m_parts
["XZscale"];
105 chardef
+= std::string(":")+m_parts
["skintone"];
106 chardef
+= std::string(":")+m_parts
["eyes"];
107 chardef
+= std::string(":")+m_parts
["hairtone"];
108 chardef
+= std::string(":")+m_parts
["hair"];
109 chardef
+= std::string(":")+m_parts
["face"];
115 gui::IGUIEnvironment
* env
;
116 gui::IGUIElement
* parent
;
118 IMenuManager
*menumgr
;
121 scene::IAnimatedMeshSceneNode
*m_model
;
122 scene::ICameraSceneNode
* m_cameranode
;
123 f32 m_model_rotation
;
125 std::map
<std::string
,std::string
> m_parts
;
129 std::map
<std::string
,std::wstring
> m_skintone_types
;
130 std::map
<std::string
,std::wstring
> m_face_types
;
131 std::map
<std::string
,std::wstring
> m_hairtone_types
;
132 std::map
<std::string
,std::wstring
> m_hair_types
;
133 std::map
<std::string
,std::wstring
> m_eyes_types
;
135 std::map
<std::string
,std::wstring
> m_shirt_types
;
136 std::map
<std::string
,std::wstring
> m_pants_types
;
137 std::map
<std::string
,std::wstring
> m_shoes_types
;