*/
#include "guiFileSelectMenu.h"
-#include "util/string.h"
-#include <locale.h>
GUIFileSelectMenu::GUIFileSelectMenu(gui::IGUIEnvironment* env,
- gui::IGUIElement* parent, s32 id, IMenuManager *menumgr,
- std::string title, std::string formname) :
-GUIModalMenu(env, parent, id, menumgr)
+ gui::IGUIElement* parent, s32 id, IMenuManager *menumgr,
+ const std::string &title, const std::string &formname) :
+ GUIModalMenu(env, parent, id, menumgr),
+ m_title(utf8_to_wide(title)),
+ m_accepted(false),
+ m_parent(parent),
+ m_text_dst(NULL),
+ m_formname(formname)
{
- m_title = utf8_to_wide(title);
- m_parent = parent;
- m_formname = formname;
- m_text_dst = 0;
- m_accepted = false;
}
GUIFileSelectMenu::~GUIFileSelectMenu()
acceptInput();
quitMenu();
return true;
- break;
-
case gui::EGET_DIRECTORY_SELECTED:
case gui::EGET_FILE_SELECTED:
m_accepted=true;
acceptInput();
quitMenu();
return true;
- break;
-
default:
//ignore this event
break;
public:
GUIFileSelectMenu(gui::IGUIEnvironment* env, gui::IGUIElement* parent,
s32 id, IMenuManager *menumgr,
- std::string title,
- std::string formid);
+ const std::string &title, const std::string &formid);
~GUIFileSelectMenu();
void removeChildren();
bool OnEvent(const SEvent& event);
- bool isRunning() {
- return m_running;
- }
+ bool isRunning() const { return m_running; }
void setTextDest(TextDest * dest) {
m_text_dst = dest;
return;
}
- errorstream << "Invalid anchor element (" << parts.size() << "): '" << element << "'" << std::endl;
+ errorstream << "Invalid anchor element (" << parts.size() << "): '" << element
+ << "'" << std::endl;
}
-void GUIFormSpecMenu::parseElement(parserData* data, std::string element)
+void GUIFormSpecMenu::parseElement(parserData* data, const std::string &element)
{
//some prechecks
if (element == "")
struct TextDest
{
- virtual ~TextDest() {};
+ virtual ~TextDest() {}
// This is deprecated I guess? -celeron55
virtual void gotText(std::wstring text){}
virtual void gotText(const StringMap &fields) = 0;
- virtual void setFormName(std::string formname)
- { m_formname = formname;};
std::string m_formname;
};
{
ItemSpec() :
i(-1)
- {}
+ {
+ }
ItemSpec(const InventoryLocation &a_inventoryloc,
const std::string &a_listname,
inventoryloc(a_inventoryloc),
listname(a_listname),
i(a_i)
- {}
+ {
+ }
bool isValid() const { return i != -1; }
ImageDrawSpec():
parent_button(NULL),
clip(false)
- {}
+ {
+ }
ImageDrawSpec(const std::string &a_name,
const std::string &a_item_name,
geom(a_geom),
scale(true),
clip(false)
- {}
+ {
+ }
ImageDrawSpec(const std::string &a_name,
const std::string &a_item_name,
geom(a_geom),
scale(true),
clip(false)
- {}
+ {
+ }
ImageDrawSpec(const std::string &a_name,
const v2s32 &a_pos, const v2s32 &a_geom, bool clip=false):
geom(a_geom),
scale(true),
clip(clip)
- {}
+ {
+ }
ImageDrawSpec(const std::string &a_name,
const v2s32 &a_pos):
pos(a_pos),
scale(false),
clip(false)
- {}
+ {
+ }
std::string name;
std::string item_name;
send(false),
ftype(f_Unknown),
is_exit(false)
- {}
+ {
+ }
std::string fname;
std::wstring flabel;
core::rect<s32> rect;
};
- struct BoxDrawSpec {
+ struct BoxDrawSpec
+ {
BoxDrawSpec(v2s32 a_pos, v2s32 a_geom,irr::video::SColor a_color):
pos(a_pos),
geom(a_geom),
irr::video::SColor color;
};
- struct TooltipSpec {
+ struct TooltipSpec
+ {
TooltipSpec() {}
- TooltipSpec(std::string a_tooltip, irr::video::SColor a_bgcolor,
+ TooltipSpec(const std::string &a_tooltip, irr::video::SColor a_bgcolor,
irr::video::SColor a_color):
tooltip(utf8_to_wide(a_tooltip)),
bgcolor(a_bgcolor),
color(a_color)
- {}
+ {
+ }
std::wstring tooltip;
irr::video::SColor bgcolor;
irr::video::SColor color;
};
- struct StaticTextSpec {
+ struct StaticTextSpec
+ {
StaticTextSpec():
parent_button(NULL)
{
}
+
StaticTextSpec(const std::wstring &a_text,
const core::rect<s32> &a_rect):
+ text(a_text),
rect(a_rect),
parent_button(NULL)
{
- //text = unescape_enriched(a_text);
- text = a_text;
}
+
StaticTextSpec(const std::wstring &a_text,
const core::rect<s32> &a_rect,
gui::IGUIButton *a_parent_button):
text(a_text),
rect(a_rect),
parent_button(a_parent_button)
- {}
+ {
+ }
std::wstring text;
core::rect<s32> rect;
~GUIFormSpecMenu();
void setFormSpec(const std::string &formspec_string,
- InventoryLocation current_inventory_location)
+ const InventoryLocation ¤t_inventory_location)
{
m_formspec_string = formspec_string;
m_current_inventory_location = current_inventory_location;
fs_key_pendig current_keys_pending;
std::string current_field_enter_pending;
- void parseElement(parserData* data, std::string element);
+ void parseElement(parserData* data, const std::string &element);
void parseSize(parserData* data, const std::string &element);
void parseContainer(parserData* data, const std::string &element);
public:
FormspecFormSource(const std::string &formspec):
m_formspec(formspec)
- {}
+ {
+ }
~FormspecFormSource()
- {}
+ {
+ }
void setForm(const std::string &formspec)
{
switch (mesh_buffer->getVertexType()) {
case video::EVT_STANDARD: {
video::S3DVertex *v = (video::S3DVertex *) mesh_buffer->getVertices();
- u16 *indices = (u16*) mesh_buffer->getIndices();
+ u16 *indices = mesh_buffer->getIndices();
scene::SMeshBuffer *temp_buf = new scene::SMeshBuffer();
temp_buf->append(v, mesh_buffer->getVertexCount(), indices,
mesh_buffer->getIndexCount());
case video::EVT_2TCOORDS: {
video::S3DVertex2TCoords *v =
(video::S3DVertex2TCoords *) mesh_buffer->getVertices();
- u16 *indices = (u16*) mesh_buffer->getIndices();
+ u16 *indices = mesh_buffer->getIndices();
scene::SMeshBufferTangents *temp_buf = new scene::SMeshBufferTangents();
temp_buf->append(v, mesh_buffer->getVertexCount(), indices,
mesh_buffer->getIndexCount());
case video::EVT_TANGENTS: {
video::S3DVertexTangents *v =
(video::S3DVertexTangents *) mesh_buffer->getVertices();
- u16 *indices = (u16*) mesh_buffer->getIndices();
+ u16 *indices = mesh_buffer->getIndices();
scene::SMeshBufferTangents *temp_buf = new scene::SMeshBufferTangents();
temp_buf->append(v, mesh_buffer->getVertexCount(), indices,
mesh_buffer->getIndexCount());
buf->drop();
}
- video::SColor c(255,255,255,255);
+ video::SColor c(255,255,255,255);
for (std::vector<aabb3f>::const_iterator
i = boxes.begin();
buf->append(vertices + j, 4, indices, 6);
}
}
- return dst_mesh;
+ return dst_mesh;
}
struct vcache
struct SimpleSoundSpec
{
- SimpleSoundSpec(const std::string &name = "", float gain = 1.0) :
- name(name),
- gain(gain)
- {}
+ SimpleSoundSpec(const std::string &name = "", float gain = 1.0)
+ : name(name), gain(gain)
+ {
+ }
bool exists() const { return name != ""; }
/*!
* Holds color information of an item mesh's buffer.
*/
-struct ItemPartColor {
+struct ItemPartColor
+{
/*!
* If this is false, the global base color of the item
* will be used instead of the specific color of the
*/
video::SColor color;
- ItemPartColor():
- override_base(false),
- color(0)
- {}
+ ItemPartColor() : override_base(false), color(0) {}
- ItemPartColor(bool override, video::SColor color):
- override_base(override),
- color(color)
- {}
+ ItemPartColor(bool override, video::SColor color)
+ : override_base(override), color(color)
+ {
+ }
};
struct ItemMesh
s32 id = -1, bool lighting = false);
virtual ~WieldMeshSceneNode();
- void setCube(const ContentFeatures &f, v3f wield_scale,
- ITextureSource *tsrc);
+ void setCube(const ContentFeatures &f, v3f wield_scale, ITextureSource *tsrc);
void setExtruded(const std::string &imagename, v3f wield_scale,
ITextureSource *tsrc, u8 num_frames);
void setItem(const ItemStack &item, Client *client);
* be NULL to leave the original material.
* \param colors returns the colors of the mesh buffers in the mesh.
*/
-void postProcessNodeMesh(scene::SMesh *mesh, const ContentFeatures &f,
- bool use_shaders, bool set_material, video::E_MATERIAL_TYPE *mattype,
- std::vector<ItemPartColor> *colors);
+void postProcessNodeMesh(scene::SMesh *mesh, const ContentFeatures &f, bool use_shaders,
+ bool set_material, video::E_MATERIAL_TYPE *mattype,
+ std::vector<ItemPartColor> *colors);
#endif