From f0e36c04042d6e2dfa4b3f17f6f9901119291c59 Mon Sep 17 00:00:00 2001 From: darkrose Date: Wed, 10 May 2017 15:37:26 +1000 Subject: [PATCH] this is what happens when darkrose rages at code --- src/CMakeLists.txt | 12 +- src/auth.c | 424 ++++++++++++++++++ src/auth.cpp | 274 ------------ src/auth.h | 155 +++---- src/character_creator.cpp | 193 +++++---- src/content_cao.cpp | 8 +- src/content_clothesitem.cpp | 400 ++++++++--------- src/content_clothesitem.h | 16 +- src/content_craftitem.cpp | 268 ++++++------ src/content_craftitem.h | 28 +- src/content_mapnode.cpp | 238 +++++----- src/content_mapnode_circuit.cpp | 62 +-- src/content_mapnode_door.cpp | 104 ++--- src/content_mapnode_farm.cpp | 48 +- src/content_mapnode_furniture.cpp | 164 +++---- src/content_mapnode_plants.cpp | 96 ++-- src/content_mapnode_slab.cpp | 52 +-- src/content_mapnode_special.cpp | 166 +++---- src/content_mapnode_stair.cpp | 18 +- src/content_mapnode_util.cpp | 4 +- src/content_mapnode_util.h | 2 +- src/content_mob.cpp | 42 +- src/content_mob.h | 4 +- src/content_nodemeta.cpp | 222 +++++----- src/content_nodemeta.h | 8 +- src/content_sao.cpp | 2 +- src/content_toolitem.cpp | 98 ++--- src/content_toolitem.h | 4 +- src/enchantment.cpp | 12 +- src/enchantment.h | 2 +- src/file.c | 446 +++++++++++++++++++ src/file.h | 50 +++ src/game.cpp | 112 ++--- src/guiDeathScreen.cpp | 4 +- src/guiFormSpecMenu.cpp | 28 +- src/guiMainMenu.cpp | 139 +++--- src/guiMessageMenu.cpp | 2 +- src/guiMultiplayerMenu.cpp | 88 ++-- src/guiPasswordChange.cpp | 10 +- src/guiPauseMenu.cpp | 10 +- src/guiSettingsMenu.cpp | 158 +++---- src/guiSettingsMenu.h | 2 +- src/http.cpp | 75 ++-- src/http.h | 8 +- src/hud.cpp | 40 +- src/{intl.cpp => intl.c} | 91 +--- src/intl.h | 26 +- src/inventory.cpp | 193 +++++---- src/inventory.h | 4 +- src/main.cpp | 41 +- src/map.cpp | 35 +- src/mapnode.cpp | 18 +- src/mapnode.h | 4 +- src/mesh.cpp | 8 +- src/mineral.cpp | 28 +- src/mineral.h | 7 +- src/path.c | 699 ++++++++++++++++++++++++++++++ src/path.cpp | 200 --------- src/path.h | 74 ++-- src/player.cpp | 35 +- src/server.cpp | 74 ++-- src/server.h | 29 +- src/servercommand.cpp | 44 +- src/sky.cpp | 7 +- src/sound_openal.cpp | 6 +- src/thread.c | 290 +++++++++++++ src/thread.h | 82 ++++ src/tile.cpp | 253 ++++++----- 68 files changed, 4003 insertions(+), 2543 deletions(-) create mode 100644 src/auth.c delete mode 100644 src/auth.cpp create mode 100644 src/file.c create mode 100644 src/file.h rename src/{intl.cpp => intl.c} (88%) create mode 100644 src/path.c delete mode 100644 src/path.cpp create mode 100644 src/thread.c create mode 100644 src/thread.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4e64695..c497ea5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -164,11 +164,15 @@ configure_file( ) set(common_SRCS + auth.c array.c list.c nvp.c crypto.c crypto_base64.c + file.c + thread.c + path.c log.cpp content_sao.cpp mapgen.cpp @@ -190,8 +194,7 @@ set(common_SRCS content_mapnode_util.cpp content_list.c content_nodebox.cpp - intl.cpp - auth.cpp + intl.c collision.cpp nodemetadata.cpp serverobject.cpp @@ -223,7 +226,6 @@ set(common_SRCS base64.cpp ban.cpp http.cpp - path.cpp ) # This gives us the icon @@ -408,9 +410,9 @@ else() - set(CMAKE_CXX_FLAGS_RELEASE "${OPT_FLAGS} ${SAFETY_FLAGS} -Wall -DNDEBUG -pipe") + set(CMAKE_CXX_FLAGS_RELEASE "${OPT_FLAGS} ${SAFETY_FLAGS} -Wall -DNDEBUG -pipe -fpermissive") set(CMAKE_C_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE}) - set(CMAKE_CXX_FLAGS_DEBUG "${SAFETY_FLAGS} -Wall -O0 -g3 -ggdb") + set(CMAKE_CXX_FLAGS_DEBUG "${SAFETY_FLAGS} -Wall -O0 -g3 -ggdb -fpermissive") set(CMAKE_C_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG}) set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${OPT_LDFLAGS} ${SAFETY_LDFLAGS}") diff --git a/src/auth.c b/src/auth.c new file mode 100644 index 0000000..c9493e8 --- /dev/null +++ b/src/auth.c @@ -0,0 +1,424 @@ +/************************************************************************ +* auth.c +* voxelands - 3d voxel world sandbox game +* Copyright (C) Lisa 'darkrose' Milne 2016 +* +* 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 3 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, see +************************************************************************/ + +#include "auth.h" + +#include "thread.h" +#include "nvp.h" +#include "file.h" +#include "path.h" + +#include +#include + +static struct { + char* file; + mutex_t *mutex; + nvp_t *data; + char modified; + char* privstr[PRIV_COUNT]; +} auth = { + NULL, + NULL, + NULL, + 0, + { + "build", + "teleport", + "settime", + "privs", + "server", + "shout", + "ban" + } +}; + +/* convert privs into a human readable csv string */ +int auth_privs2str(uint64_t privs, char* buff, int size) +{ + int i; + int r = 0; + int l; + int o = 0; + uint64_t p = 1; + + if (!buff || !size) + return -1; + + buff[0] = 0; + + for (i=0; ipwd,p); + d->privs = privs; + nvp_set(&auth.data,n,"",d); + } + + mutex_unlock(auth.mutex); + + file_free(f); + + auth.modified = 0; +} + +/* save auth data to file */ +void auth_save() +{ + file_t *f; + nvp_t *n; + char s[512]; + + if (!auth.modified) + return; + + mutex_lock(auth.mutex); + + f = file_create(NULL,auth.file); + if (!f) { + mutex_unlock(auth.mutex); + return; + } + + for (n=auth.data; n; n = n->next) { + if (!n->name || !n->name[0]) + continue; + if (auth_privs2str(((authdata_t*)n->data)->privs,s,512) < 0) + s[0] = 0; + file_writef(f,"%s:%s:%s\n",n->name,((authdata_t*)n->data)->pwd,s); + } + + file_flush(f); + + mutex_unlock(auth.mutex); + + file_free(f); + + auth.modified = 0; +} + +int auth_exists(char* name) +{ + nvp_t *n; + if (!name) + return 0; + + mutex_lock(auth.mutex); + + n = nvp_get(&auth.data,name); + + mutex_unlock(auth.mutex); + + if (!n) + return 0; + return 1; +} + +void auth_set(char* name, authdata_t data) +{ + nvp_t *n; + if (!name) + return; + + mutex_lock(auth.mutex); + + n = nvp_get(&auth.data,name); + + if (n) { + strcpy(((authdata_t*)n->data)->pwd,data.pwd); + ((authdata_t*)n->data)->privs = data.privs; + }else{ + authdata_t *d = malloc(sizeof(authdata_t)); + if (!d) { + mutex_unlock(auth.mutex); + return; + } + + strcpy(d->pwd,data.pwd); + d->privs = data.privs; + nvp_set(&auth.data,name,"",d); + } + + mutex_unlock(auth.mutex); + + auth.modified = 1; +} + +void auth_add(char* name) +{ + authdata_t d; + d.pwd[0] = 0; + d.privs = PRIV_DEFAULT; + + auth_set(name,d); +} + +int auth_getpwd(char* name, char buff[64]) +{ + nvp_t *n; + + buff[0] = 0; + + if (!name) + return -1; + + mutex_lock(auth.mutex); + + n = nvp_get(&auth.data,name); + + if (!n) { + mutex_unlock(auth.mutex); + return -1; + } + + strcpy(buff,((authdata_t*)n->data)->pwd); + + mutex_unlock(auth.mutex); + + return 0; +} + +void auth_setpwd(char* name, char* pwd) +{ + nvp_t *n; + if (!name) + return; + + mutex_lock(auth.mutex); + + n = nvp_get(&auth.data,name); + + if (n) { + strcpy(((authdata_t*)n->data)->pwd,pwd); + }else{ + authdata_t *d = malloc(sizeof(authdata_t)); + if (!d) { + mutex_unlock(auth.mutex); + return; + } + + strcpy(d->pwd,pwd); + d->privs = PRIV_DEFAULT; + nvp_set(&auth.data,name,"",d); + } + + mutex_unlock(auth.mutex); + + auth.modified = 1; +} + +uint64_t auth_getprivs(char* name) +{ + nvp_t *n; + uint64_t privs = PRIV_INVALID; + + if (!name) + return PRIV_INVALID; + + mutex_lock(auth.mutex); + + n = nvp_get(&auth.data,name); + + if (!n) { + mutex_unlock(auth.mutex); + return PRIV_INVALID; + } + + privs = ((authdata_t*)n->data)->privs; + + mutex_unlock(auth.mutex); + + return privs; +} + +void auth_setprivs(char* name, uint64_t privs) +{ + nvp_t *n; + if (!name) + return; + + mutex_lock(auth.mutex); + + n = nvp_get(&auth.data,name); + + if (n) { + ((authdata_t*)n->data)->privs = privs; + }else{ + authdata_t *d = malloc(sizeof(authdata_t)); + if (!d) { + mutex_unlock(auth.mutex); + return; + } + + d->pwd[0] = 0; + d->privs = privs; + nvp_set(&auth.data,name,"",d); + } + + mutex_unlock(auth.mutex); + + auth.modified = 1; +} diff --git a/src/auth.cpp b/src/auth.cpp deleted file mode 100644 index 90f1094..0000000 --- a/src/auth.cpp +++ /dev/null @@ -1,274 +0,0 @@ -/************************************************************************ -* Minetest-c55 -* Copyright (C) 2011 celeron55, Perttu Ahola -* -* auth.cpp -* voxelands - 3d voxel world sandbox game -* Copyright (C) Lisa 'darkrose' Milne 2014 -* -* 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 3 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, see -* -* License updated from GPLv2 or later to GPLv3 or later by Lisa Milne -* for Voxelands. -************************************************************************/ - -#include "auth.h" -#include -#include -//#include "main.h" // for g_settings -#include -#include "strfnd.h" -#include "debug.h" - -// Convert a privileges value into a human-readable string, -// with each component separated by a comma. -std::string privsToString(uint64_t privs) -{ - std::ostringstream os(std::ios_base::binary); - if(privs & PRIV_BUILD) - os<<"build,"; - if(privs & PRIV_TELEPORT) - os<<"teleport,"; - if(privs & PRIV_SETTIME) - os<<"settime,"; - if(privs & PRIV_PRIVS) - os<<"privs,"; - if(privs & PRIV_SHOUT) - os<<"shout,"; - if(privs & PRIV_BAN) - os<<"ban,"; - if(os.tellp()) - { - // Drop the trailing comma. (Why on earth can't - // you truncate a C++ stream anyway???) - std::string tmp = os.str(); - return tmp.substr(0, tmp.length() -1); - } - return os.str(); -} - -// Converts a comma-seperated list of privilege values into a -// privileges value. The reverse of privsToString(). Returns -// PRIV_INVALID if there is anything wrong with the input. -uint64_t stringToPrivs(std::string str) -{ - uint64_t privs=0; - Strfnd f(str); - while(f.atend() == false) - { - std::string s = trim(f.next(",")); - if(s == "build") - privs |= PRIV_BUILD; - else if(s == "teleport") - privs |= PRIV_TELEPORT; - else if(s == "settime") - privs |= PRIV_SETTIME; - else if(s == "privs") - privs |= PRIV_PRIVS; - else if(s == "shout") - privs |= PRIV_SHOUT; - else if(s == "ban") - privs |= PRIV_BAN; - else - return PRIV_INVALID; - } - return privs; -} - -AuthManager::AuthManager(const std::string &authfilepath): - m_authfilepath(authfilepath), - m_modified(false) -{ - m_mutex.Init(); - - try{ - load(); - } - catch(SerializationError &e) - { - dstream<<"WARNING: AuthManager: creating " - <::Iterator - i = m_authdata.getIterator(); - i.atEnd()==false; i++) - { - std::string name = i.getNode()->getKey(); - if(name == "") - continue; - AuthData ad = i.getNode()->getValue(); - os<::Node *n; - n = m_authdata.find(username); - if(n == NULL) - return false; - return true; -} - -void AuthManager::set(const std::string &username, AuthData ad) -{ - JMutexAutoLock lock(m_mutex); - - m_authdata[username] = ad; - - m_modified = true; -} - -void AuthManager::add(const std::string &username) -{ - JMutexAutoLock lock(m_mutex); - - m_authdata[username] = AuthData(); - - m_modified = true; -} - -std::string AuthManager::getPassword(const std::string &username) -{ - JMutexAutoLock lock(m_mutex); - - core::map::Node *n; - n = m_authdata.find(username); - if(n == NULL) - throw AuthNotFoundException(""); - - return n->getValue().pwd; -} - -void AuthManager::setPassword(const std::string &username, - const std::string &password) -{ - JMutexAutoLock lock(m_mutex); - - core::map::Node *n; - n = m_authdata.find(username); - if(n == NULL) - throw AuthNotFoundException(""); - - AuthData ad = n->getValue(); - ad.pwd = password; - n->setValue(ad); - - m_modified = true; -} - -uint64_t AuthManager::getPrivs(const std::string &username) -{ - JMutexAutoLock lock(m_mutex); - - core::map::Node *n; - n = m_authdata.find(username); - if(n == NULL) - throw AuthNotFoundException(""); - - return n->getValue().privs; -} - -void AuthManager::setPrivs(const std::string &username, uint64_t privs) -{ - JMutexAutoLock lock(m_mutex); - - core::map::Node *n; - n = m_authdata.find(username); - if(n == NULL) - throw AuthNotFoundException(""); - - AuthData ad = n->getValue(); - ad.privs = privs; - n->setValue(ad); - - m_modified = true; -} - -bool AuthManager::isModified() -{ - JMutexAutoLock lock(m_mutex); - return m_modified; -} - - diff --git a/src/auth.h b/src/auth.h index 712418d..0c13dc7 100644 --- a/src/auth.h +++ b/src/auth.h @@ -1,108 +1,53 @@ -/************************************************************************ -* Minetest-c55 -* Copyright (C) 2011 celeron55, Perttu Ahola -* -* auth.h -* voxelands - 3d voxel world sandbox game -* Copyright (C) Lisa 'darkrose' Milne 2014 -* -* 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 3 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, see -* -* License updated from GPLv2 or later to GPLv3 or later by Lisa Milne -* for Voxelands. -************************************************************************/ - -#ifndef AUTH_HEADER -#define AUTH_HEADER - -#include -#include -#include -#include "common_irrlicht.h" -#include "exceptions.h" - -using namespace jthread; - -// Player privileges. These form a bitmask stored in the privs field -// of the player, and define things they're allowed to do. See also -// the static methods Player::privsToString and stringToPrivs that -// convert these to human-readable form. -const uint64_t PRIV_BUILD = 1; // Can build - i.e. modify the world -const uint64_t PRIV_TELEPORT = 2; // Can teleport -const uint64_t PRIV_SETTIME = 4; // Can set the time -const uint64_t PRIV_PRIVS = 8; // Can grant and revoke privileges -const uint64_t PRIV_SERVER = 16; // Can manage the server (e.g. shutodwn, settings) -const uint64_t PRIV_SHOUT = 32; // Can broadcast chat messages to all players -const uint64_t PRIV_BAN = 64; // Can ban players - -// Default privileges - these can be overriden for new players using the -// config option "default_privs" - however, this value still applies for -// players that existed before the privileges system was added. -const uint64_t PRIV_DEFAULT = PRIV_BUILD|PRIV_SHOUT; -const uint64_t PRIV_ALL = 0x7FFFFFFFFFFFFFFFULL; -const uint64_t PRIV_INVALID = 0x8000000000000000ULL; - -// Convert a privileges value into a human-readable string, -// with each component separated by a comma. -std::string privsToString(uint64_t privs); - -// Converts a comma-seperated list of privilege values into a -// privileges value. The reverse of privsToString(). Returns -// PRIV_INVALID if there is anything wrong with the input. -uint64_t stringToPrivs(std::string str); - -struct AuthData -{ - std::string pwd; - uint64_t privs; - - AuthData(): - privs(PRIV_DEFAULT) - { - } -}; - -class AuthNotFoundException : public BaseException -{ -public: - AuthNotFoundException(const char *s): - BaseException(s) - {} -}; - -class AuthManager -{ -public: - AuthManager(const std::string &authfilepath); - ~AuthManager(); - void load(); - void save(); - bool exists(const std::string &username); - void set(const std::string &username, AuthData ad); - void add(const std::string &username); - std::string getPassword(const std::string &username); - void setPassword(const std::string &username, - const std::string &password); - uint64_t getPrivs(const std::string &username); - void setPrivs(const std::string &username, uint64_t privs); - bool isModified(); -private: - JMutex m_mutex; - std::string m_authfilepath; - core::map m_authdata; - bool m_modified; -}; +#ifndef _AUTH_H_ +#define _AUTH_H_ +#ifdef __cplusplus +extern "C" { #endif +#include + +#define PRIV_NONE 0x0000 +#define PRIV_BUILD 0x0001 /* build/interact */ +#define PRIV_TELEPORT 0x0002 /* teleport */ +#define PRIV_SETTIME 0x0004 /* set the time */ +#define PRIV_PRIVS 0x0008 /* grant/revoke privs */ +#define PRIV_SERVER 0x0010 /* server management (shutdown/settings/etc) */ +#define PRIV_SHOUT 0x0020 /* chat */ +#define PRIV_BAN 0x0040 /* ban/unban */ + +/* increment this if a priv is added */ +#define PRIV_COUNT 7 + +#define PRIV_DEFAULT (PRIV_BUILD|PRIV_SHOUT) +#define PRIV_ALL 0x7FFFFFFFFFFFFFFF +#define PRIV_INVALID 0x8000000000000000 + +#ifndef _HAVE_AUTHDATA_TYPE +#define _HAVE_AUTHDATA_TYPE +typedef struct authdata_s { + char pwd[64]; + uint64_t privs; +} authdata_t; +#endif + +/* defined in auth.c */ +int auth_privs2str(uint64_t privs, char* buff, int size); +uint64_t auth_str2privs(char* str); +int auth_init(char* file); +void auth_exit(void); +void auth_load(void); +void auth_save(void); +int auth_exists(char* name); +void auth_set(char* name, authdata_t data); +void auth_add(char* name); +int auth_getpwd(char* name, char buff[64]); +void auth_setpwd(char* name, char* pwd); +uint64_t auth_getprivs(char* name); +void auth_setprivs(char* name, uint64_t privs); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/character_creator.cpp b/src/character_creator.cpp index 5a8e233..210a3f7 100644 --- a/src/character_creator.cpp +++ b/src/character_creator.cpp @@ -52,65 +52,65 @@ GUICharDefMenu::GUICharDefMenu( fetchPlayerSkin(); - m_skintone_types["white"] = wgettext("White Skin"); - m_skintone_types["red"] = wgettext("Red Skin"); - m_skintone_types["green"] = wgettext("Green Skin"); - m_skintone_types["fair"] = wgettext("Fair Skin"); - m_skintone_types["tanned"] = wgettext("Tanned Skin"); - m_skintone_types["dark"] = wgettext("Dark Skin"); - m_skintone_types["black"] = wgettext("Black Skin"); + m_skintone_types["white"] = narrow_to_wide(gettext("White Skin")); + m_skintone_types["red"] = narrow_to_wide(gettext("Red Skin")); + m_skintone_types["green"] = narrow_to_wide(gettext("Green Skin")); + m_skintone_types["fair"] = narrow_to_wide(gettext("Fair Skin")); + m_skintone_types["tanned"] = narrow_to_wide(gettext("Tanned Skin")); + m_skintone_types["dark"] = narrow_to_wide(gettext("Dark Skin")); + m_skintone_types["black"] = narrow_to_wide(gettext("Black Skin")); - m_face_types["human"] = wgettext("Human Face"); - m_face_types["elven"] = wgettext("Elven Face"); - m_face_types["dwarven"] = wgettext("Dwarven Face"); - m_face_types["alien"] = wgettext("Alien Face"); + m_face_types["human"] = narrow_to_wide(gettext("Human Face")); + m_face_types["elven"] = narrow_to_wide(gettext("Elven Face")); + m_face_types["dwarven"] = narrow_to_wide(gettext("Dwarven Face")); + m_face_types["alien"] = narrow_to_wide(gettext("Alien Face")); - m_hairtone_types["white"] = wgettext("White Hair"); - m_hairtone_types["blue"] = wgettext("Blue Hair"); - m_hairtone_types["green"] = wgettext("Green Hair"); - m_hairtone_types["orange"] = wgettext("Orange Hair"); - m_hairtone_types["brown"] = wgettext("Brown Hair"); - m_hairtone_types["purple"] = wgettext("Purple Hair"); - m_hairtone_types["red"] = wgettext("Red Hair"); - m_hairtone_types["blonde"] = wgettext("Blonde Hair"); - m_hairtone_types["black"] = wgettext("Black Hair"); + m_hairtone_types["white"] = narrow_to_wide(gettext("White Hair")); + m_hairtone_types["blue"] = narrow_to_wide(gettext("Blue Hair")); + m_hairtone_types["green"] = narrow_to_wide(gettext("Green Hair")); + m_hairtone_types["orange"] = narrow_to_wide(gettext("Orange Hair")); + m_hairtone_types["brown"] = narrow_to_wide(gettext("Brown Hair")); + m_hairtone_types["purple"] = narrow_to_wide(gettext("Purple Hair")); + m_hairtone_types["red"] = narrow_to_wide(gettext("Red Hair")); + m_hairtone_types["blonde"] = narrow_to_wide(gettext("Blonde Hair")); + m_hairtone_types["black"] = narrow_to_wide(gettext("Black Hair")); - m_hair_types["short"] = wgettext("Short Hair"); - m_hair_types["medium"] = wgettext("Medium Hair"); - m_hair_types["long"] = wgettext("Long Hair"); - m_hair_types["special"] = wgettext("Styled Hair"); + m_hair_types["short"] = narrow_to_wide(gettext("Short Hair")); + m_hair_types["medium"] = narrow_to_wide(gettext("Medium Hair")); + m_hair_types["long"] = narrow_to_wide(gettext("Long Hair")); + m_hair_types["special"] = narrow_to_wide(gettext("Styled Hair")); - m_eyes_types["white"] = wgettext("White Eyes"); - m_eyes_types["blue"] = wgettext("Blue Eyes"); - m_eyes_types["green"] = wgettext("Green Eyes"); - m_eyes_types["orange"] = wgettext("Orange Eyes"); - m_eyes_types["brown"] = wgettext("Brown Eyes"); - m_eyes_types["purple"] = wgettext("Purple Eyes"); - m_eyes_types["red"] = wgettext("Red Eyes"); - m_eyes_types["yellow"] = wgettext("Yellow Eyes"); - m_eyes_types["black"] = wgettext("Black Eyes"); + m_eyes_types["white"] = narrow_to_wide(gettext("White Eyes")); + m_eyes_types["blue"] = narrow_to_wide(gettext("Blue Eyes")); + m_eyes_types["green"] = narrow_to_wide(gettext("Green Eyes")); + m_eyes_types["orange"] = narrow_to_wide(gettext("Orange Eyes")); + m_eyes_types["brown"] = narrow_to_wide(gettext("Brown Eyes")); + m_eyes_types["purple"] = narrow_to_wide(gettext("Purple Eyes")); + m_eyes_types["red"] = narrow_to_wide(gettext("Red Eyes")); + m_eyes_types["yellow"] = narrow_to_wide(gettext("Yellow Eyes")); + m_eyes_types["black"] = narrow_to_wide(gettext("Black Eyes")); - m_shirt_types["white"] = wgettext("White T-Shirt"); - m_shirt_types["blue"] = wgettext("Blue T-Shirt"); - m_shirt_types["green"] = wgettext("Green T-Shirt"); - m_shirt_types["orange"] = wgettext("Orange T-Shirt"); - m_shirt_types["purple"] = wgettext("Purple T-Shirt"); - m_shirt_types["red"] = wgettext("Red T-Shirt"); - m_shirt_types["yellow"] = wgettext("Yellow T-Shirt"); - m_shirt_types["black"] = wgettext("Black T-Shirt"); + m_shirt_types["white"] = narrow_to_wide(gettext("White T-Shirt")); + m_shirt_types["blue"] = narrow_to_wide(gettext("Blue T-Shirt")); + m_shirt_types["green"] = narrow_to_wide(gettext("Green T-Shirt")); + m_shirt_types["orange"] = narrow_to_wide(gettext("Orange T-Shirt")); + m_shirt_types["purple"] = narrow_to_wide(gettext("Purple T-Shirt")); + m_shirt_types["red"] = narrow_to_wide(gettext("Red T-Shirt")); + m_shirt_types["yellow"] = narrow_to_wide(gettext("Yellow T-Shirt")); + m_shirt_types["black"] = narrow_to_wide(gettext("Black T-Shirt")); - m_pants_types["white"] = wgettext("White Pants"); - m_pants_types["blue"] = wgettext("Blue Pants"); - m_pants_types["green"] = wgettext("Green Pants"); - m_pants_types["orange"] = wgettext("Orange Pants"); - m_pants_types["purple"] = wgettext("Purple Pants"); - m_pants_types["red"] = wgettext("Red Pants"); - m_pants_types["yellow"] = wgettext("Yellow Pants"); - m_pants_types["black"] = wgettext("Black Pants"); + m_pants_types["white"] = narrow_to_wide(gettext("White Pants")); + m_pants_types["blue"] = narrow_to_wide(gettext("Blue Pants")); + m_pants_types["green"] = narrow_to_wide(gettext("Green Pants")); + m_pants_types["orange"] = narrow_to_wide(gettext("Orange Pants")); + m_pants_types["purple"] = narrow_to_wide(gettext("Purple Pants")); + m_pants_types["red"] = narrow_to_wide(gettext("Red Pants")); + m_pants_types["yellow"] = narrow_to_wide(gettext("Yellow Pants")); + m_pants_types["black"] = narrow_to_wide(gettext("Black Pants")); - m_shoes_types["leather"] = wgettext("Leather Shoes"); - m_shoes_types["fur"] = wgettext("Fur Shoes"); - m_shoes_types["canvas"] = wgettext("Canvas Shoes"); + m_shoes_types["leather"] = narrow_to_wide(gettext("Leather Shoes")); + m_shoes_types["fur"] = narrow_to_wide(gettext("Fur Shoes")); + m_shoes_types["canvas"] = narrow_to_wide(gettext("Canvas Shoes")); scene::ISceneManager* smgr = device->getSceneManager(); @@ -199,7 +199,7 @@ void GUICharDefMenu::regenerateGui(v2u32 screensize) core::rect rect(0, 0, 230, 300); rect += leftside + v2s32(10, 220); gui::IGUIStaticText *t = Environment->addStaticText( - wgettext( + narrow_to_wide(gettext( "Here you can create your default character," " this is how other players will see you in-game." " When you join a new server you will start with" @@ -208,7 +208,7 @@ void GUICharDefMenu::regenerateGui(v2u32 screensize) " can be crafted in-game.\n" "You can return here from the main menu anytime to" " change your character." - ), + )).c_str(), rect, false, true, @@ -221,43 +221,43 @@ void GUICharDefMenu::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 250, 20); rect += rightside + v2s32(0, 20); - gui::IGUIStaticText *t = Environment->addStaticText(wgettext("Create Your Character"), rect, false, true, this, -1); + gui::IGUIStaticText *t = Environment->addStaticText(narrow_to_wide(gettext("Create Your Character")).c_str(), rect, false, true, this, -1); t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); } // gender { core::rect rect(0, 0, 105, 30); rect += rightside + v2s32(15, 50); - Environment->addButton(rect, this, GUI_ID_CD_MALE_BUTTON, wgettext("Male")); + Environment->addButton(rect, this, GUI_ID_CD_MALE_BUTTON, narrow_to_wide(gettext("Male")).c_str()); } { core::rect rect(0, 0, 105, 30); rect += rightside + v2s32(130, 50); - Environment->addButton(rect, this, GUI_ID_CD_FEMALE_BUTTON, wgettext("Female")); + Environment->addButton(rect, this, GUI_ID_CD_FEMALE_BUTTON, narrow_to_wide(gettext("Female")).c_str()); } // Yscale { core::rect rect(0, 0, 105, 30); rect += rightside + v2s32(15, 95); - Environment->addButton(rect, this, GUI_ID_CD_TALLER_BUTTON, wgettext("Taller")); + Environment->addButton(rect, this, GUI_ID_CD_TALLER_BUTTON, narrow_to_wide(gettext("Taller")).c_str()); } { core::rect rect(0, 0, 105, 30); rect += rightside + v2s32(15, 130); - Environment->addButton(rect, this, GUI_ID_CD_SHORTER_BUTTON, wgettext("Shorter")); + Environment->addButton(rect, this, GUI_ID_CD_SHORTER_BUTTON, narrow_to_wide(gettext("Shorter")).c_str()); } // XZscale { core::rect rect(0, 0, 105, 30); rect += rightside + v2s32(130, 95); - Environment->addButton(rect, this, GUI_ID_CD_WIDER_BUTTON, wgettext("Wider")); + Environment->addButton(rect, this, GUI_ID_CD_WIDER_BUTTON, narrow_to_wide(gettext("Wider")).c_str()); } { core::rect rect(0, 0, 105, 30); rect += rightside + v2s32(130, 130); - Environment->addButton(rect, this, GUI_ID_CD_THINNER_BUTTON, wgettext("Thinner")); + Environment->addButton(rect, this, GUI_ID_CD_THINNER_BUTTON, narrow_to_wide(gettext("Thinner")).c_str()); } // skintone @@ -416,17 +416,18 @@ void GUICharDefMenu::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 105, 30); rect += rightside + v2s32(15, 460); - Environment->addButton(rect, this, GUI_ID_CD_SAVE_BUTTON, wgettext("Done")); + Environment->addButton(rect, this, GUI_ID_CD_SAVE_BUTTON, narrow_to_wide(gettext("Done")).c_str()); } { core::rect rect(0, 0, 105, 30); rect += rightside + v2s32(130, 460); - Environment->addButton(rect, this, GUI_ID_CD_QUIT_BUTTON, wgettext("Cancel")); + Environment->addButton(rect, this, GUI_ID_CD_QUIT_BUTTON, narrow_to_wide(gettext("Cancel")).c_str()); } } void GUICharDefMenu::drawMenu() { + char buff[1024]; gui::IGUISkin* skin = Environment->getSkin(); if (!skin) return; @@ -452,18 +453,20 @@ void GUICharDefMenu::drawMenu() driver->draw2DRectangle(right, GUI_BG_TOP, GUI_BG_TOP, GUI_BG_BTM, GUI_BG_BTM, &AbsoluteClippingRect); driver->draw2DRectangleOutline(right, GUI_BORDER); - video::ITexture *texture = driver->getTexture(getTexturePath("menulogo.png").c_str()); - if (texture != 0) { - const core::dimension2d& img_origsize = texture->getOriginalSize(); - core::rect logo( - AbsoluteRect.UpperLeftCorner.X+25, - AbsoluteRect.UpperLeftCorner.Y, - AbsoluteRect.UpperLeftCorner.X+225, - AbsoluteRect.UpperLeftCorner.Y+200 - ); - const video::SColor color(255,255,255,255); - const video::SColor colors[] = {color,color,color,color}; - driver->draw2DImage(texture, logo, core::rect(core::position2d(0,0),img_origsize), NULL, colors, true); + if (path_get((char*)"texture",(char*)"menulogo.png",1,buff,1024)) { + video::ITexture *texture = driver->getTexture(buff); + if (texture != 0) { + const core::dimension2d& img_origsize = texture->getOriginalSize(); + core::rect logo( + AbsoluteRect.UpperLeftCorner.X+25, + AbsoluteRect.UpperLeftCorner.Y, + AbsoluteRect.UpperLeftCorner.X+225, + AbsoluteRect.UpperLeftCorner.Y+200 + ); + const video::SColor color(255,255,255,255); + const video::SColor colors[] = {color,color,color,color}; + driver->draw2DImage(texture, logo, core::rect(core::position2d(0,0),img_origsize), NULL, colors, true); + } } gui::IGUIElement::draw(); @@ -789,13 +792,13 @@ std::string GUICharDefMenu::getPlayerSkin() { std::string tex = ""; - tex += std::string("skins")+DIR_DELIM+"skintone_"+m_parts["skintone"]+".png"; - tex += std::string("^skins")+DIR_DELIM+"gender_"+m_parts["gender"]+".png"; - tex += std::string("^skins")+DIR_DELIM+"face_"+m_parts["face"]+"_"+m_parts["skintone"]+"_"+m_parts["gender"]+".png"; - tex += std::string("^skins")+DIR_DELIM+"eyes_"+m_parts["eyes"]+".png"; + tex += std::string("skins/")+"skintone_"+m_parts["skintone"]+".png"; + tex += std::string("^skins/")+"gender_"+m_parts["gender"]+".png"; + tex += std::string("^skins/")+"face_"+m_parts["face"]+"_"+m_parts["skintone"]+"_"+m_parts["gender"]+".png"; + tex += std::string("^skins/")+"eyes_"+m_parts["eyes"]+".png"; tex += std::string("^clothes_player_pants_canvas_")+m_parts["pants"]+".png"; tex += std::string("^clothes_player_tshirt_cotton_")+m_parts["shirt"]+".png"; - tex += std::string("^skins")+DIR_DELIM+"hair_"+m_parts["hair"]+"_"+m_parts["hairtone"]+"_"+m_parts["gender"]+".png"; + tex += std::string("^skins/")+"hair_"+m_parts["hair"]+"_"+m_parts["hairtone"]+"_"+m_parts["gender"]+".png"; std::string c = "brown"; if (m_parts["shoes"] == "canvas") c = "black"; @@ -808,6 +811,8 @@ std::string GUICharDefMenu::getPlayerSkin() //M:10:10:fair:blue:brown:medium:normal:green:blue:leather void GUICharDefMenu::fetchPlayerSkin() { + char buff[1024]; + char buf[256]; std::string chardef = std::string(PLAYER_DEFAULT_CHARDEF); if (g_settings->exists("character_definition")) chardef = g_settings->get("character_definition"); @@ -842,29 +847,43 @@ void GUICharDefMenu::fetchPlayerSkin() m_xz_scale = 1.1; m_parts["XZscale"] = ftos(m_xz_scale*10.); - if (getPath("skin",std::string("skintone_")+m_parts["skintone"]+"_"+m_parts["gender"]+".png",true) == "") + snprintf(buf,256,"skintone_%s_%s.png",m_parts["skintone"].c_str(),m_parts["gender"].c_str()); + if (!path_get((char*)"skin",buf,1,buff,1024)) m_parts["skintone"] = "fair"; - if (getPath("skin",std::string("eyes_")+m_parts["eyes"]+".png",true) == "") + + + snprintf(buf,256,"eyes_%s.png",m_parts["eyes"].c_str()); + if (!path_get((char*)"skin",buf,1,buff,1024)) m_parts["eyes"] = "blue"; + + snprintf(buf,256,"hair_%s_%s_%s.png",m_parts["hair"].c_str(),m_parts["hairtone"].c_str(),m_parts["gender"].c_str()); if ( m_parts["hairtone"] == "" || m_parts["hair"] == "" - || getPath("skin",std::string("hair_")+m_parts["hair"]+"_"+m_parts["hairtone"]+"_"+m_parts["gender"]+".png",true) == "" + || !path_get((char*)"skin",buf,1,buff,1024) ) { m_parts["hairtone"] = "brown"; m_parts["hair"] = "medium"; } - if (getPath("skin",std::string("face_")+m_parts["face"]+"_"+m_parts["gender"]+".png",true) == "") + + snprintf(buf,256,"face_%s_%s.png",m_parts["face"].c_str(),m_parts["gender"].c_str()); + if (!path_get((char*)"skin",buf,1,buff,1024)) m_parts["face"] = "human"; - if (getPath("texture",std::string("clothes_player_tshirt_cotton_")+m_parts["shirt"]+".png",true) == "") + snprintf(buf,256,"clothes_player_tshirt_cotton_%s.png",m_parts["shirt"].c_str()); + if (!path_get((char*)"texture",buf,1,buff,1024)) m_parts["shirt"] = "green"; - if (getPath("texture",std::string("clothes_player_pants_canvas_")+m_parts["pants"]+".png",true) == "") + + snprintf(buf,256,"clothes_player_pants_canvas_%s.png",m_parts["pants"].c_str()); + if (!path_get((char*)"texture",buf,1,buff,1024)) m_parts["pants"] = "blue"; + std::string c = "brown"; if (m_parts["shoes"] == "canvas") c = "black"; - if (getPath("texture",std::string("clothes_player_shoes_")+m_parts["shoes"]+"_"+c+".png",true) == "") + + snprintf(buf,256,"clothes_player_shoes_%s_%s.png",m_parts["shoes"].c_str(),c.c_str()); + if (!path_get((char*)"texture",buf,1,buff,1024)) m_parts["shoes"] = "leather"; } diff --git a/src/content_cao.cpp b/src/content_cao.cpp index 17c4882..d7ed587 100644 --- a/src/content_cao.cpp +++ b/src/content_cao.cpp @@ -93,6 +93,7 @@ void MobCAO::addToScene(scene::ISceneManager *smgr) if (node) { int s; int e; + char buff[1024]; m.getAnimationFrames(MA_STAND,&s,&e); node->setFrameLoop(s,e); node->setScale(m.model_scale); @@ -102,7 +103,8 @@ void MobCAO::addToScene(scene::ISceneManager *smgr) bool use_anisotropic_filter = g_settings->getBool("anisotropic_filter"); // Set material flags and texture - node->setMaterialTexture( 0, driver->getTexture(getTexturePath(m.texture).c_str())); + if (path_get((char*)"texture",const_cast(m.texture.c_str()),1,buff,1024)) + node->setMaterialTexture( 0, driver->getTexture(buff)); video::SMaterial& material = node->getMaterial(0); material.setFlag(video::EMF_LIGHTING, false); material.setFlag(video::EMF_TRILINEAR_FILTER, use_trilinear_filter); @@ -119,11 +121,13 @@ void MobCAO::addToScene(scene::ISceneManager *smgr) #endif updateNodePos(); }else if (m.texture != "") { + char buff[1024]; bool use_trilinear_filter = g_settings->getBool("trilinear_filter"); bool use_bilinear_filter = g_settings->getBool("bilinear_filter"); bool use_anisotropic_filter = g_settings->getBool("anisotropic_filter"); scene::IBillboardSceneNode *bill = smgr->addBillboardSceneNode(NULL, v2f(1, 1), v3f(0,0,0), -1); - bill->setMaterialTexture(0, driver->getTexture(getTexturePath(m.texture).c_str())); + if (path_get((char*)"texture",const_cast(m.texture.c_str()),1,buff,1024)) + bill->setMaterialTexture( 0, driver->getTexture(buff)); bill->setMaterialFlag(video::EMF_LIGHTING, false); bill->setMaterialFlag(video::EMF_TRILINEAR_FILTER, use_trilinear_filter); bill->setMaterialFlag(video::EMF_BILINEAR_FILTER, use_bilinear_filter); diff --git a/src/content_clothesitem.cpp b/src/content_clothesitem.cpp index 280fdd2..bc7d1c2 100644 --- a/src/content_clothesitem.cpp +++ b/src/content_clothesitem.cpp @@ -49,7 +49,7 @@ void content_clothesitem_init() g_content_clothesitem_features[k].content = CONTENT_IGNORE; g_content_clothesitem_features[k].texture = std::string("unknown_item.png"); g_content_clothesitem_features[k].overlay_texture = std::string(""); - g_content_clothesitem_features[k].description = std::wstring(L""); + g_content_clothesitem_features[k].description = (char*)""; g_content_clothesitem_features[k].type = CT_NONE; g_content_clothesitem_features[k].armour = 0.; g_content_clothesitem_features[k].warmth = 0.; @@ -64,7 +64,7 @@ void content_clothesitem_init() f->content = i; f->texture = "clothes_pants_space.png"; f->overlay_texture = "clothes_player_pants_space.png"; - f->description = wgettext("Space Suit Pants"); + f->description = gettext("Space Suit Pants"); f->type = CT_PANTS; f->armour = 0.10; f->warmth = 0.20; @@ -86,7 +86,7 @@ void content_clothesitem_init() f->content = i; f->texture = "clothes_shirt_space.png"; f->overlay_texture = "clothes_player_shirt_space.png"; - f->description = wgettext("Space Suit Shirt"); + f->description = gettext("Space Suit Shirt"); f->type = CT_JACKET; f->armour = 0.10; f->warmth = 0.20; @@ -108,7 +108,7 @@ void content_clothesitem_init() f->content = i; f->texture = "clothes_helmet_space.png"; f->overlay_texture = "clothes_player_helmet_space.png"; - f->description = wgettext("Space Suit Helmet"); + f->description = gettext("Space Suit Helmet"); f->type = CT_HAT; f->armour = 0.05; f->warmth = 0.15; @@ -124,7 +124,7 @@ void content_clothesitem_init() f->content = i; f->texture = "clothes_boots_space.png"; f->overlay_texture = "clothes_player_boots_space.png"; - f->description = wgettext("Space Suit Boots"); + f->description = gettext("Space Suit Boots"); f->type = CT_BOOTS; f->armour = 0.05; f->warmth = 0.20; @@ -141,7 +141,7 @@ void content_clothesitem_init() f->type = CT_SHIRT; f->texture = "clothes_tshirt_cotton_white.png"; f->overlay_texture = "clothes_player_tshirt_cotton_white.png"; - f->description = wgettext("Cotton T-Shirt"); + f->description = gettext("Cotton T-Shirt"); f->armour = 0.0; f->warmth = 0.0; f->vacuum = 0.0; @@ -155,7 +155,7 @@ void content_clothesitem_init() f->type = CT_SHIRT; f->texture = "clothes_tshirt_cotton_blue.png"; f->overlay_texture = "clothes_player_tshirt_cotton_blue.png"; - f->description = wgettext("Blue Cotton T-Shirt"); + f->description = gettext("Blue Cotton T-Shirt"); f->armour = 0.0; f->warmth = 0.0; f->vacuum = 0.0; @@ -169,7 +169,7 @@ void content_clothesitem_init() f->type = CT_SHIRT; f->texture = "clothes_tshirt_cotton_green.png"; f->overlay_texture = "clothes_player_tshirt_cotton_green.png"; - f->description = wgettext("Green Cotton T-Shirt"); + f->description = gettext("Green Cotton T-Shirt"); f->armour = 0.0; f->warmth = 0.0; f->vacuum = 0.0; @@ -183,7 +183,7 @@ void content_clothesitem_init() f->type = CT_SHIRT; f->texture = "clothes_tshirt_cotton_orange.png"; f->overlay_texture = "clothes_player_tshirt_cotton_orange.png"; - f->description = wgettext("Orange Cotton Tshirt"); + f->description = gettext("Orange Cotton Tshirt"); f->armour = 0.0; f->warmth = 0.0; f->vacuum = 0.0; @@ -197,7 +197,7 @@ void content_clothesitem_init() f->type = CT_SHIRT; f->texture = "clothes_tshirt_cotton_purple.png"; f->overlay_texture = "clothes_player_tshirt_cotton_purple.png"; - f->description = wgettext("Purple Cotton T-Shirt"); + f->description = gettext("Purple Cotton T-Shirt"); f->armour = 0.0; f->warmth = 0.0; f->vacuum = 0.0; @@ -211,7 +211,7 @@ void content_clothesitem_init() f->type = CT_SHIRT; f->texture = "clothes_tshirt_cotton_red.png"; f->overlay_texture = "clothes_player_tshirt_cotton_red.png"; - f->description = wgettext("Red Cotton T-Shirt"); + f->description = gettext("Red Cotton T-Shirt"); f->armour = 0.0; f->warmth = 0.0; f->vacuum = 0.0; @@ -225,7 +225,7 @@ void content_clothesitem_init() f->type = CT_SHIRT; f->texture = "clothes_tshirt_cotton_yellow.png"; f->overlay_texture = "clothes_player_tshirt_cotton_yellow.png"; - f->description = wgettext("Yellow Cotton T-Shirt"); + f->description = gettext("Yellow Cotton T-Shirt"); f->armour = 0.0; f->warmth = 0.0; f->vacuum = 0.0; @@ -239,7 +239,7 @@ void content_clothesitem_init() f->type = CT_SHIRT; f->texture = "clothes_tshirt_cotton_black.png"; f->overlay_texture = "clothes_player_tshirt_cotton_black.png"; - f->description = wgettext("Black Cotton T-Shirt"); + f->description = gettext("Black Cotton T-Shirt"); f->armour = 0.0; f->warmth = 0.0; f->vacuum = 0.0; @@ -254,7 +254,7 @@ void content_clothesitem_init() f->type = CT_SHIRT; f->texture = "clothes_shirt_cotton_white.png"; f->overlay_texture = "clothes_player_shirt_cotton_white.png"; - f->description = wgettext("Cotton Shirt"); + f->description = gettext("Cotton Shirt"); f->armour = 0.0; f->warmth = 0.05; f->vacuum = 0.0; @@ -268,7 +268,7 @@ void content_clothesitem_init() f->type = CT_SHIRT; f->texture = "clothes_shirt_cotton_blue.png"; f->overlay_texture = "clothes_player_shirt_cotton_blue.png"; - f->description = wgettext("Blue Cotton Shirt"); + f->description = gettext("Blue Cotton Shirt"); f->armour = 0.0; f->warmth = 0.05; f->vacuum = 0.0; @@ -282,7 +282,7 @@ void content_clothesitem_init() f->type = CT_SHIRT; f->texture = "clothes_shirt_cotton_green.png"; f->overlay_texture = "clothes_player_shirt_cotton_green.png"; - f->description = wgettext("Green Cotton Shirt"); + f->description = gettext("Green Cotton Shirt"); f->armour = 0.0; f->warmth = 0.05; f->vacuum = 0.0; @@ -296,7 +296,7 @@ void content_clothesitem_init() f->type = CT_SHIRT; f->texture = "clothes_shirt_cotton_orange.png"; f->overlay_texture = "clothes_player_shirt_cotton_orange.png"; - f->description = wgettext("Orange Cotton Shirt"); + f->description = gettext("Orange Cotton Shirt"); f->armour = 0.0; f->warmth = 0.05; f->vacuum = 0.0; @@ -310,7 +310,7 @@ void content_clothesitem_init() f->type = CT_SHIRT; f->texture = "clothes_shirt_cotton_purple.png"; f->overlay_texture = "clothes_player_shirt_cotton_purple.png"; - f->description = wgettext("Purple Cotton Shirt"); + f->description = gettext("Purple Cotton Shirt"); f->armour = 0.0; f->warmth = 0.05; f->vacuum = 0.0; @@ -324,7 +324,7 @@ void content_clothesitem_init() f->type = CT_SHIRT; f->texture = "clothes_shirt_cotton_red.png"; f->overlay_texture = "clothes_player_shirt_cotton_red.png"; - f->description = wgettext("Red Cotton Shirt"); + f->description = gettext("Red Cotton Shirt"); f->armour = 0.0; f->warmth = 0.05; f->vacuum = 0.0; @@ -338,7 +338,7 @@ void content_clothesitem_init() f->type = CT_SHIRT; f->texture = "clothes_shirt_cotton_yellow.png"; f->overlay_texture = "clothes_player_shirt_cotton_yellow.png"; - f->description = wgettext("Yellow Cotton Shirt"); + f->description = gettext("Yellow Cotton Shirt"); f->armour = 0.0; f->warmth = 0.05; f->vacuum = 0.0; @@ -352,7 +352,7 @@ void content_clothesitem_init() f->type = CT_SHIRT; f->texture = "clothes_shirt_cotton_black.png"; f->overlay_texture = "clothes_player_shirt_cotton_black.png"; - f->description = wgettext("Black Cotton Shirt"); + f->description = gettext("Black Cotton Shirt"); f->armour = 0.0; f->warmth = 0.05; f->vacuum = 0.0; @@ -367,7 +367,7 @@ void content_clothesitem_init() f->type = CT_PANTS; f->texture = "clothes_shorts_cotton_white.png"; f->overlay_texture = "clothes_player_shorts_cotton_white.png"; - f->description = wgettext("Cotton Shorts"); + f->description = gettext("Cotton Shorts"); f->armour = 0.0; f->warmth = 0.0; f->vacuum = 0.0; @@ -382,7 +382,7 @@ void content_clothesitem_init() f->type = CT_PANTS; f->texture = "clothes_shorts_cotton_blue.png"; f->overlay_texture = "clothes_player_shorts_cotton_blue.png"; - f->description = wgettext("Blue Cotton Shorts"); + f->description = gettext("Blue Cotton Shorts"); f->armour = 0.0; f->warmth = 0.0; f->vacuum = 0.0; @@ -397,7 +397,7 @@ void content_clothesitem_init() f->type = CT_PANTS; f->texture = "clothes_shorts_cotton_green.png"; f->overlay_texture = "clothes_player_shorts_cotton_green.png"; - f->description = wgettext("Green Cotton Shorts"); + f->description = gettext("Green Cotton Shorts"); f->armour = 0.0; f->warmth = 0.0; f->vacuum = 0.0; @@ -412,7 +412,7 @@ void content_clothesitem_init() f->type = CT_PANTS; f->texture = "clothes_shorts_cotton_orange.png"; f->overlay_texture = "clothes_player_shorts_cotton_orange.png"; - f->description = wgettext("Orange Cotton Shorts"); + f->description = gettext("Orange Cotton Shorts"); f->armour = 0.0; f->warmth = 0.0; f->vacuum = 0.0; @@ -427,7 +427,7 @@ void content_clothesitem_init() f->type = CT_PANTS; f->texture = "clothes_shorts_cotton_purple.png"; f->overlay_texture = "clothes_player_shorts_cotton_purple.png"; - f->description = wgettext("Purple Cotton Shorts"); + f->description = gettext("Purple Cotton Shorts"); f->armour = 0.0; f->warmth = 0.0; f->vacuum = 0.0; @@ -442,7 +442,7 @@ void content_clothesitem_init() f->type = CT_PANTS; f->texture = "clothes_shorts_cotton_red.png"; f->overlay_texture = "clothes_player_shorts_cotton_red.png"; - f->description = wgettext("Red Cotton Shorts"); + f->description = gettext("Red Cotton Shorts"); f->armour = 0.0; f->warmth = 0.0; f->vacuum = 0.0; @@ -457,7 +457,7 @@ void content_clothesitem_init() f->type = CT_PANTS; f->texture = "clothes_shorts_cotton_yellow.png"; f->overlay_texture = "clothes_player_shorts_cotton_yellow.png"; - f->description = wgettext("Yellow Cotton Shorts"); + f->description = gettext("Yellow Cotton Shorts"); f->armour = 0.0; f->warmth = 0.0; f->vacuum = 0.0; @@ -472,7 +472,7 @@ void content_clothesitem_init() f->type = CT_PANTS; f->texture = "clothes_shorts_cotton_black.png"; f->overlay_texture = "clothes_player_shorts_cotton_black.png"; - f->description = wgettext("Black Cotton Shorts"); + f->description = gettext("Black Cotton Shorts"); f->armour = 0.0; f->warmth = 0.0; f->vacuum = 0.0; @@ -488,7 +488,7 @@ void content_clothesitem_init() f->type = CT_HAT; f->texture = "clothes_hat_cotton_white.png"; f->overlay_texture = "clothes_player_hat_cotton_white.png"; - f->description = wgettext("Cotton Hat"); + f->description = gettext("Cotton Hat"); f->armour = 0.0; f->warmth = 0.05; f->vacuum = 0.0; @@ -502,7 +502,7 @@ void content_clothesitem_init() f->type = CT_HAT; f->texture = "clothes_hat_cotton_blue.png"; f->overlay_texture = "clothes_player_hat_cotton_blue.png"; - f->description = wgettext("Blue Cotton Hat"); + f->description = gettext("Blue Cotton Hat"); f->armour = 0.0; f->warmth = 0.05; f->vacuum = 0.0; @@ -516,7 +516,7 @@ void content_clothesitem_init() f->type = CT_HAT; f->texture = "clothes_hat_cotton_green.png"; f->overlay_texture = "clothes_player_hat_cotton_green.png"; - f->description = wgettext("Green Cotton Hat"); + f->description = gettext("Green Cotton Hat"); f->armour = 0.0; f->warmth = 0.05; f->vacuum = 0.0; @@ -530,7 +530,7 @@ void content_clothesitem_init() f->type = CT_HAT; f->texture = "clothes_hat_cotton_orange.png"; f->overlay_texture = "clothes_player_hat_cotton_orange.png"; - f->description = wgettext("Orange Cotton Hat"); + f->description = gettext("Orange Cotton Hat"); f->armour = 0.0; f->warmth = 0.05; f->vacuum = 0.0; @@ -544,7 +544,7 @@ void content_clothesitem_init() f->type = CT_HAT; f->texture = "clothes_hat_cotton_purple.png"; f->overlay_texture = "clothes_player_hat_cotton_purple.png"; - f->description = wgettext("Purple Cotton Hat"); + f->description = gettext("Purple Cotton Hat"); f->armour = 0.0; f->warmth = 0.05; f->vacuum = 0.0; @@ -558,7 +558,7 @@ void content_clothesitem_init() f->type = CT_HAT; f->texture = "clothes_hat_cotton_red.png"; f->overlay_texture = "clothes_player_hat_cotton_red.png"; - f->description = wgettext("Red Cotton Hat"); + f->description = gettext("Red Cotton Hat"); f->armour = 0.0; f->warmth = 0.05; f->vacuum = 0.0; @@ -572,7 +572,7 @@ void content_clothesitem_init() f->type = CT_HAT; f->texture = "clothes_hat_cotton_yellow.png"; f->overlay_texture = "clothes_player_hat_cotton_yellow.png"; - f->description = wgettext("Yellow Cotton Hat"); + f->description = gettext("Yellow Cotton Hat"); f->armour = 0.0; f->warmth = 0.05; f->vacuum = 0.0; @@ -586,7 +586,7 @@ void content_clothesitem_init() f->type = CT_HAT; f->texture = "clothes_hat_cotton_black.png"; f->overlay_texture = "clothes_player_hat_cotton_black.png"; - f->description = wgettext("Black Cotton Hat"); + f->description = gettext("Black Cotton Hat"); f->armour = 0.0; f->warmth = 0.05; f->vacuum = 0.0; @@ -601,7 +601,7 @@ void content_clothesitem_init() f->type = CT_DECORATIVE; f->texture = "clothes_tie_cotton_white.png"; f->overlay_texture = "clothes_player_tie_cotton_white.png"; - f->description = wgettext("Cotton Tie"); + f->description = gettext("Cotton Tie"); f->armour = 0.0; f->warmth = 0.0; f->vacuum = 0.0; @@ -615,7 +615,7 @@ void content_clothesitem_init() f->type = CT_DECORATIVE; f->texture = "clothes_tie_cotton_blue.png"; f->overlay_texture = "clothes_player_tie_cotton_blue.png"; - f->description = wgettext("Blue Cotton Tie"); + f->description = gettext("Blue Cotton Tie"); f->armour = 0.0; f->warmth = 0.0; f->vacuum = 0.0; @@ -629,7 +629,7 @@ void content_clothesitem_init() f->type = CT_DECORATIVE; f->texture = "clothes_tie_cotton_green.png"; f->overlay_texture = "clothes_player_tie_cotton_green.png"; - f->description = wgettext("Green Cotton Tie"); + f->description = gettext("Green Cotton Tie"); f->armour = 0.0; f->warmth = 0.0; f->vacuum = 0.0; @@ -643,7 +643,7 @@ void content_clothesitem_init() f->type = CT_DECORATIVE; f->texture = "clothes_tie_cotton_orange.png"; f->overlay_texture = "clothes_player_tie_cotton_orange.png"; - f->description = wgettext("Orange Cotton Tie"); + f->description = gettext("Orange Cotton Tie"); f->armour = 0.0; f->warmth = 0.0; f->vacuum = 0.0; @@ -657,7 +657,7 @@ void content_clothesitem_init() f->type = CT_DECORATIVE; f->texture = "clothes_tie_cotton_purple.png"; f->overlay_texture = "clothes_player_tie_cotton_purple.png"; - f->description = wgettext("Purple Cotton Tie"); + f->description = gettext("Purple Cotton Tie"); f->armour = 0.0; f->warmth = 0.0; f->vacuum = 0.0; @@ -671,7 +671,7 @@ void content_clothesitem_init() f->type = CT_DECORATIVE; f->texture = "clothes_tie_cotton_red.png"; f->overlay_texture = "clothes_player_tie_cotton_red.png"; - f->description = wgettext("Red Cotton Tie"); + f->description = gettext("Red Cotton Tie"); f->armour = 0.0; f->warmth = 0.0; f->vacuum = 0.0; @@ -685,7 +685,7 @@ void content_clothesitem_init() f->type = CT_DECORATIVE; f->texture = "clothes_tie_cotton_yellow.png"; f->overlay_texture = "clothes_player_tie_cotton_yellow.png"; - f->description = wgettext("Yellow Cotton Tie"); + f->description = gettext("Yellow Cotton Tie"); f->armour = 0.0; f->warmth = 0.0; f->vacuum = 0.0; @@ -699,7 +699,7 @@ void content_clothesitem_init() f->type = CT_DECORATIVE; f->texture = "clothes_tie_cotton_black.png"; f->overlay_texture = "clothes_player_tie_cotton_black.png"; - f->description = wgettext("Black Cotton Tie"); + f->description = gettext("Black Cotton Tie"); f->armour = 0.0; f->warmth = 0.0; f->vacuum = 0.0; @@ -714,7 +714,7 @@ void content_clothesitem_init() f->type = CT_SHIRT; f->texture = "clothes_shirt_canvas_white.png"; f->overlay_texture = "clothes_player_shirt_canvas_white.png"; - f->description = wgettext("Canvas Shirt"); + f->description = gettext("Canvas Shirt"); f->armour = 0.0; f->warmth = 0.45; f->vacuum = 0.0; @@ -729,7 +729,7 @@ void content_clothesitem_init() f->type = CT_SHIRT; f->texture = "clothes_shirt_canvas_blue.png"; f->overlay_texture = "clothes_player_shirt_canvas_blue.png"; - f->description = wgettext("Blue Canvas Shirt"); + f->description = gettext("Blue Canvas Shirt"); f->armour = 0.0; f->warmth = 0.45; f->vacuum = 0.0; @@ -744,7 +744,7 @@ void content_clothesitem_init() f->type = CT_SHIRT; f->texture = "clothes_shirt_canvas_green.png"; f->overlay_texture = "clothes_player_shirt_canvas_green.png"; - f->description = wgettext("Green Canvas Shirt"); + f->description = gettext("Green Canvas Shirt"); f->armour = 0.0; f->warmth = 0.45; f->vacuum = 0.0; @@ -759,7 +759,7 @@ void content_clothesitem_init() f->type = CT_SHIRT; f->texture = "clothes_shirt_canvas_orange.png"; f->overlay_texture = "clothes_player_shirt_canvas_orange.png"; - f->description = wgettext("Orange Canvas Shirt"); + f->description = gettext("Orange Canvas Shirt"); f->armour = 0.0; f->warmth = 0.45; f->vacuum = 0.0; @@ -774,7 +774,7 @@ void content_clothesitem_init() f->type = CT_SHIRT; f->texture = "clothes_shirt_canvas_purple.png"; f->overlay_texture = "clothes_player_shirt_canvas_purple.png"; - f->description = wgettext("Purple Canvas Shirt"); + f->description = gettext("Purple Canvas Shirt"); f->armour = 0.0; f->warmth = 0.45; f->vacuum = 0.0; @@ -789,7 +789,7 @@ void content_clothesitem_init() f->type = CT_SHIRT; f->texture = "clothes_shirt_canvas_red.png"; f->overlay_texture = "clothes_player_shirt_canvas_red.png"; - f->description = wgettext("Red Canvas Shirt"); + f->description = gettext("Red Canvas Shirt"); f->armour = 0.0; f->warmth = 0.45; f->vacuum = 0.0; @@ -804,7 +804,7 @@ void content_clothesitem_init() f->type = CT_SHIRT; f->texture = "clothes_shirt_canvas_yellow.png"; f->overlay_texture = "clothes_player_shirt_canvas_yellow.png"; - f->description = wgettext("Yellow Canvas Shirt"); + f->description = gettext("Yellow Canvas Shirt"); f->armour = 0.0; f->warmth = 0.45; f->vacuum = 0.0; @@ -819,7 +819,7 @@ void content_clothesitem_init() f->type = CT_SHIRT; f->texture = "clothes_shirt_canvas_black.png"; f->overlay_texture = "clothes_player_shirt_canvas_black.png"; - f->description = wgettext("Black Canvas Shirt"); + f->description = gettext("Black Canvas Shirt"); f->armour = 0.0; f->warmth = 0.45; f->vacuum = 0.0; @@ -835,7 +835,7 @@ void content_clothesitem_init() f->type = CT_PANTS; f->texture = "clothes_pants_canvas_white.png"; f->overlay_texture = "clothes_player_pants_canvas_white.png"; - f->description = wgettext("Canvas Pants"); + f->description = gettext("Canvas Pants"); f->armour = 0.0; f->warmth = 0.45; f->vacuum = 0.0; @@ -850,7 +850,7 @@ void content_clothesitem_init() f->type = CT_PANTS; f->texture = "clothes_pants_canvas_blue.png"; f->overlay_texture = "clothes_player_pants_canvas_blue.png"; - f->description = wgettext("Blue Canvas Pants"); + f->description = gettext("Blue Canvas Pants"); f->armour = 0.0; f->warmth = 0.45; f->vacuum = 0.0; @@ -865,7 +865,7 @@ void content_clothesitem_init() f->type = CT_PANTS; f->texture = "clothes_pants_canvas_green.png"; f->overlay_texture = "clothes_player_pants_canvas_green.png"; - f->description = wgettext("Green Canvas Pants"); + f->description = gettext("Green Canvas Pants"); f->armour = 0.0; f->warmth = 0.45; f->vacuum = 0.0; @@ -880,7 +880,7 @@ void content_clothesitem_init() f->type = CT_PANTS; f->texture = "clothes_pants_canvas_orange.png"; f->overlay_texture = "clothes_player_pants_canvas_orange.png"; - f->description = wgettext("Orange Canvas Pants"); + f->description = gettext("Orange Canvas Pants"); f->armour = 0.0; f->warmth = 0.45; f->vacuum = 0.0; @@ -895,7 +895,7 @@ void content_clothesitem_init() f->type = CT_PANTS; f->texture = "clothes_pants_canvas_purple.png"; f->overlay_texture = "clothes_player_pants_canvas_purple.png"; - f->description = wgettext("Purple Canvas Pants"); + f->description = gettext("Purple Canvas Pants"); f->armour = 0.0; f->warmth = 0.45; f->vacuum = 0.0; @@ -910,7 +910,7 @@ void content_clothesitem_init() f->type = CT_PANTS; f->texture = "clothes_pants_canvas_red.png"; f->overlay_texture = "clothes_player_pants_canvas_red.png"; - f->description = wgettext("Red Canvas Pants"); + f->description = gettext("Red Canvas Pants"); f->armour = 0.0; f->warmth = 0.45; f->vacuum = 0.0; @@ -925,7 +925,7 @@ void content_clothesitem_init() f->type = CT_PANTS; f->texture = "clothes_pants_canvas_yellow.png"; f->overlay_texture = "clothes_player_pants_canvas_yellow.png"; - f->description = wgettext("Yellow Canvas Pants"); + f->description = gettext("Yellow Canvas Pants"); f->armour = 0.0; f->warmth = 0.45; f->vacuum = 0.0; @@ -940,7 +940,7 @@ void content_clothesitem_init() f->type = CT_PANTS; f->texture = "clothes_pants_canvas_black.png"; f->overlay_texture = "clothes_player_pants_canvas_black.png"; - f->description = wgettext("Black Canvas Pants"); + f->description = gettext("Black Canvas Pants"); f->armour = 0.0; f->warmth = 0.45; f->vacuum = 0.0; @@ -956,7 +956,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_shoes_canvas_white.png"; f->overlay_texture = "clothes_player_shoes_canvas_white.png"; - f->description = wgettext("Canvas Shoes"); + f->description = gettext("Canvas Shoes"); f->armour = 0.05; f->warmth = 0.45; f->vacuum = 0.0; @@ -970,7 +970,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_shoes_canvas_blue.png"; f->overlay_texture = "clothes_player_shoes_canvas_blue.png"; - f->description = wgettext("Blue Canvas Shoes"); + f->description = gettext("Blue Canvas Shoes"); f->armour = 0.05; f->warmth = 0.45; f->vacuum = 0.0; @@ -984,7 +984,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_shoes_canvas_green.png"; f->overlay_texture = "clothes_player_shoes_canvas_green.png"; - f->description = wgettext("Green Canvas Shoes"); + f->description = gettext("Green Canvas Shoes"); f->armour = 0.05; f->warmth = 0.45; f->vacuum = 0.0; @@ -998,7 +998,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_shoes_canvas_orange.png"; f->overlay_texture = "clothes_player_shoes_canvas_orange.png"; - f->description = wgettext("Orange Canvas Shoes"); + f->description = gettext("Orange Canvas Shoes"); f->armour = 0.05; f->warmth = 0.45; f->vacuum = 0.0; @@ -1012,7 +1012,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_shoes_canvas_purple.png"; f->overlay_texture = "clothes_player_shoes_canvas_purple.png"; - f->description = wgettext("Purple Canvas Shoes"); + f->description = gettext("Purple Canvas Shoes"); f->armour = 0.05; f->warmth = 0.45; f->vacuum = 0.0; @@ -1026,7 +1026,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_shoes_canvas_red.png"; f->overlay_texture = "clothes_player_shoes_canvas_red.png"; - f->description = wgettext("Red Canvas Shoes"); + f->description = gettext("Red Canvas Shoes"); f->armour = 0.05; f->warmth = 0.45; f->vacuum = 0.0; @@ -1040,7 +1040,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_shoes_canvas_yellow.png"; f->overlay_texture = "clothes_player_shoes_canvas_yellow.png"; - f->description = wgettext("Yellow Canvas Shoes"); + f->description = gettext("Yellow Canvas Shoes"); f->armour = 0.05; f->warmth = 0.45; f->vacuum = 0.0; @@ -1054,7 +1054,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_shoes_canvas_black.png"; f->overlay_texture = "clothes_player_shoes_canvas_black.png"; - f->description = wgettext("Black Canvas Shoes"); + f->description = gettext("Black Canvas Shoes"); f->armour = 0.05; f->warmth = 0.45; f->vacuum = 0.0; @@ -1069,7 +1069,7 @@ void content_clothesitem_init() f->type = CT_BELT; f->texture = "clothes_belt_canvas_white.png"; f->overlay_texture = "clothes_player_belt_canvas_white.png"; - f->description = wgettext("Canvas Belt"); + f->description = gettext("Canvas Belt"); f->armour = 0.0; f->warmth = 0.0; f->vacuum = 0.0; @@ -1083,7 +1083,7 @@ void content_clothesitem_init() f->type = CT_BELT; f->texture = "clothes_belt_canvas_blue.png"; f->overlay_texture = "clothes_player_belt_canvas_blue.png"; - f->description = wgettext("Blue Canvas Belt"); + f->description = gettext("Blue Canvas Belt"); f->armour = 0.0; f->warmth = 0.0; f->vacuum = 0.0; @@ -1097,7 +1097,7 @@ void content_clothesitem_init() f->type = CT_BELT; f->texture = "clothes_belt_canvas_green.png"; f->overlay_texture = "clothes_player_belt_canvas_green.png"; - f->description = wgettext("Green Canvas Belt"); + f->description = gettext("Green Canvas Belt"); f->armour = 0.0; f->warmth = 0.0; f->vacuum = 0.0; @@ -1111,7 +1111,7 @@ void content_clothesitem_init() f->type = CT_BELT; f->texture = "clothes_belt_canvas_orange.png"; f->overlay_texture = "clothes_player_belt_canvas_orange.png"; - f->description = wgettext("Orange Canvas Belt"); + f->description = gettext("Orange Canvas Belt"); f->armour = 0.0; f->warmth = 0.0; f->vacuum = 0.0; @@ -1125,7 +1125,7 @@ void content_clothesitem_init() f->type = CT_BELT; f->texture = "clothes_belt_canvas_purple.png"; f->overlay_texture = "clothes_player_belt_canvas_purple.png"; - f->description = wgettext("Purple Canvas Belt"); + f->description = gettext("Purple Canvas Belt"); f->armour = 0.0; f->warmth = 0.0; f->vacuum = 0.0; @@ -1139,7 +1139,7 @@ void content_clothesitem_init() f->type = CT_BELT; f->texture = "clothes_belt_canvas_red.png"; f->overlay_texture = "clothes_player_belt_canvas_red.png"; - f->description = wgettext("Red Canvas Belt"); + f->description = gettext("Red Canvas Belt"); f->armour = 0.0; f->warmth = 0.0; f->vacuum = 0.0; @@ -1153,7 +1153,7 @@ void content_clothesitem_init() f->type = CT_BELT; f->texture = "clothes_belt_canvas_yellow.png"; f->overlay_texture = "clothes_player_belt_canvas_yellow.png"; - f->description = wgettext("Yellow Canvas Belt"); + f->description = gettext("Yellow Canvas Belt"); f->armour = 0.0; f->warmth = 0.0; f->vacuum = 0.0; @@ -1167,7 +1167,7 @@ void content_clothesitem_init() f->type = CT_BELT; f->texture = "clothes_belt_canvas_black.png"; f->overlay_texture = "clothes_player_belt_canvas_black.png"; - f->description = wgettext("Black Canvas Belt"); + f->description = gettext("Black Canvas Belt"); f->armour = 0.0; f->warmth = 0.0; f->vacuum = 0.0; @@ -1182,7 +1182,7 @@ void content_clothesitem_init() f->type = CT_JACKET; f->texture = "clothes_jacket_leather_brown.png"; f->overlay_texture = "clothes_player_jacket_leather_brown.png"; - f->description = wgettext("Leather Jacket"); + f->description = gettext("Leather Jacket"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1197,7 +1197,7 @@ void content_clothesitem_init() f->type = CT_JACKET; f->texture = "clothes_jacket_leather_white.png"; f->overlay_texture = "clothes_player_jacket_leather_white.png"; - f->description = wgettext("White Leather Jacket"); + f->description = gettext("White Leather Jacket"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1212,7 +1212,7 @@ void content_clothesitem_init() f->type = CT_JACKET; f->texture = "clothes_jacket_leather_blue.png"; f->overlay_texture = "clothes_player_jacket_leather_blue.png"; - f->description = wgettext("Blue Leather Jacket"); + f->description = gettext("Blue Leather Jacket"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1227,7 +1227,7 @@ void content_clothesitem_init() f->type = CT_JACKET; f->texture = "clothes_jacket_leather_green.png"; f->overlay_texture = "clothes_player_jacket_leather_green.png"; - f->description = wgettext("Green Leather Jacket"); + f->description = gettext("Green Leather Jacket"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1242,7 +1242,7 @@ void content_clothesitem_init() f->type = CT_JACKET; f->texture = "clothes_jacket_leather_orange.png"; f->overlay_texture = "clothes_player_jacket_leather_orange.png"; - f->description = wgettext("Orange Leather Jacket"); + f->description = gettext("Orange Leather Jacket"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1257,7 +1257,7 @@ void content_clothesitem_init() f->type = CT_JACKET; f->texture = "clothes_jacket_leather_purple.png"; f->overlay_texture = "clothes_player_jacket_leather_purple.png"; - f->description = wgettext("Purple Leather Jacket"); + f->description = gettext("Purple Leather Jacket"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1272,7 +1272,7 @@ void content_clothesitem_init() f->type = CT_JACKET; f->texture = "clothes_jacket_leather_red.png"; f->overlay_texture = "clothes_player_jacket_leather_red.png"; - f->description = wgettext("Red Leather Jacket"); + f->description = gettext("Red Leather Jacket"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1287,7 +1287,7 @@ void content_clothesitem_init() f->type = CT_JACKET; f->texture = "clothes_jacket_leather_yellow.png"; f->overlay_texture = "clothes_player_jacket_leather_yellow.png"; - f->description = wgettext("Yellow Leather Jacket"); + f->description = gettext("Yellow Leather Jacket"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1302,7 +1302,7 @@ void content_clothesitem_init() f->type = CT_JACKET; f->texture = "clothes_jacket_leather_black.png"; f->overlay_texture = "clothes_player_jacket_leather_black.png"; - f->description = wgettext("Black Leather Jacket"); + f->description = gettext("Black Leather Jacket"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1318,7 +1318,7 @@ void content_clothesitem_init() f->type = CT_PANTS; f->texture = "clothes_pants_leather_brown.png"; f->overlay_texture = "clothes_player_pants_leather_brown.png"; - f->description = wgettext("Leather Pants"); + f->description = gettext("Leather Pants"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1333,7 +1333,7 @@ void content_clothesitem_init() f->type = CT_PANTS; f->texture = "clothes_pants_leather_white.png"; f->overlay_texture = "clothes_player_pants_leather_white.png"; - f->description = wgettext("White Leather Pants"); + f->description = gettext("White Leather Pants"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1348,7 +1348,7 @@ void content_clothesitem_init() f->type = CT_PANTS; f->texture = "clothes_pants_leather_blue.png"; f->overlay_texture = "clothes_player_pants_leather_blue.png"; - f->description = wgettext("Blue Leather Pants"); + f->description = gettext("Blue Leather Pants"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1363,7 +1363,7 @@ void content_clothesitem_init() f->type = CT_PANTS; f->texture = "clothes_pants_leather_green.png"; f->overlay_texture = "clothes_player_pants_leather_green.png"; - f->description = wgettext("Green Leather Pants"); + f->description = gettext("Green Leather Pants"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1378,7 +1378,7 @@ void content_clothesitem_init() f->type = CT_PANTS; f->texture = "clothes_pants_leather_orange.png"; f->overlay_texture = "clothes_player_pants_leather_orange.png"; - f->description = wgettext("Orange Leather Pants"); + f->description = gettext("Orange Leather Pants"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1393,7 +1393,7 @@ void content_clothesitem_init() f->type = CT_PANTS; f->texture = "clothes_pants_leather_purple.png"; f->overlay_texture = "clothes_player_pants_leather_purple.png"; - f->description = wgettext("Purple Leather Pants"); + f->description = gettext("Purple Leather Pants"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1408,7 +1408,7 @@ void content_clothesitem_init() f->type = CT_PANTS; f->texture = "clothes_pants_leather_red.png"; f->overlay_texture = "clothes_player_pants_leather_red.png"; - f->description = wgettext("Red Leather Pants"); + f->description = gettext("Red Leather Pants"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1423,7 +1423,7 @@ void content_clothesitem_init() f->type = CT_PANTS; f->texture = "clothes_pants_leather_yellow.png"; f->overlay_texture = "clothes_player_pants_leather_yellow.png"; - f->description = wgettext("Yellow Leather Pants"); + f->description = gettext("Yellow Leather Pants"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1438,7 +1438,7 @@ void content_clothesitem_init() f->type = CT_PANTS; f->texture = "clothes_pants_leather_black.png"; f->overlay_texture = "clothes_player_pants_leather_black.png"; - f->description = wgettext("Black Leather Pants"); + f->description = gettext("Black Leather Pants"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1454,7 +1454,7 @@ void content_clothesitem_init() f->type = CT_HAT; f->texture = "clothes_hat_leather_brown.png"; f->overlay_texture = "clothes_player_hat_leather_brown.png"; - f->description = wgettext("Leather Hat"); + f->description = gettext("Leather Hat"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1468,7 +1468,7 @@ void content_clothesitem_init() f->type = CT_HAT; f->texture = "clothes_hat_leather_white.png"; f->overlay_texture = "clothes_player_hat_leather_white.png"; - f->description = wgettext("White Leather Hat"); + f->description = gettext("White Leather Hat"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1482,7 +1482,7 @@ void content_clothesitem_init() f->type = CT_HAT; f->texture = "clothes_hat_leather_blue.png"; f->overlay_texture = "clothes_player_hat_leather_blue.png"; - f->description = wgettext("Blue Leather Hat"); + f->description = gettext("Blue Leather Hat"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1496,7 +1496,7 @@ void content_clothesitem_init() f->type = CT_HAT; f->texture = "clothes_hat_leather_green.png"; f->overlay_texture = "clothes_player_hat_leather_green.png"; - f->description = wgettext("Green Leather Hat"); + f->description = gettext("Green Leather Hat"); f->armour = 1.0; f->warmth = 1.0; f->vacuum = 0.1; @@ -1510,7 +1510,7 @@ void content_clothesitem_init() f->type = CT_HAT; f->texture = "clothes_hat_leather_orange.png"; f->overlay_texture = "clothes_player_hat_leather_orange.png"; - f->description = wgettext("Orange Leather Hat"); + f->description = gettext("Orange Leather Hat"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1524,7 +1524,7 @@ void content_clothesitem_init() f->type = CT_HAT; f->texture = "clothes_hat_leather_purple.png"; f->overlay_texture = "clothes_player_hat_leather_purple.png"; - f->description = wgettext("Purple Leather Hat"); + f->description = gettext("Purple Leather Hat"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1538,7 +1538,7 @@ void content_clothesitem_init() f->type = CT_HAT; f->texture = "clothes_hat_leather_red.png"; f->overlay_texture = "clothes_player_hat_leather_red.png"; - f->description = wgettext("Red Leather Hat"); + f->description = gettext("Red Leather Hat"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1552,7 +1552,7 @@ void content_clothesitem_init() f->type = CT_HAT; f->texture = "clothes_hat_leather_yellow.png"; f->overlay_texture = "clothes_player_hat_leather_yellow.png"; - f->description = wgettext("Yellow Leather Hat"); + f->description = gettext("Yellow Leather Hat"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1566,7 +1566,7 @@ void content_clothesitem_init() f->type = CT_HAT; f->texture = "clothes_hat_leather_black.png"; f->overlay_texture = "clothes_player_hat_leather_black.png"; - f->description = wgettext("Black Leather Hat"); + f->description = gettext("Black Leather Hat"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1581,7 +1581,7 @@ void content_clothesitem_init() f->type = CT_HAT; f->texture = "clothes_helmet_leather_brown.png"; f->overlay_texture = "clothes_player_helmet_leather_brown.png"; - f->description = wgettext("Leather Helmet"); + f->description = gettext("Leather Helmet"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1596,7 +1596,7 @@ void content_clothesitem_init() f->type = CT_HAT; f->texture = "clothes_helmet_leather_white.png"; f->overlay_texture = "clothes_player_helmet_leather_white.png"; - f->description = wgettext("White Leather Helmet"); + f->description = gettext("White Leather Helmet"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1611,7 +1611,7 @@ void content_clothesitem_init() f->type = CT_HAT; f->texture = "clothes_helmet_leather_blue.png"; f->overlay_texture = "clothes_player_helmet_leather_blue.png"; - f->description = wgettext("Blue Leather Helmet"); + f->description = gettext("Blue Leather Helmet"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1626,7 +1626,7 @@ void content_clothesitem_init() f->type = CT_HAT; f->texture = "clothes_helmet_leather_green.png"; f->overlay_texture = "clothes_player_helmet_leather_green.png"; - f->description = wgettext("Green Leather Helmet"); + f->description = gettext("Green Leather Helmet"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1641,7 +1641,7 @@ void content_clothesitem_init() f->type = CT_HAT; f->texture = "clothes_helmet_leather_orange.png"; f->overlay_texture = "clothes_player_helmet_leather_orange.png"; - f->description = wgettext("Orange Leather Helmet"); + f->description = gettext("Orange Leather Helmet"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1656,7 +1656,7 @@ void content_clothesitem_init() f->type = CT_HAT; f->texture = "clothes_helmet_leather_purple.png"; f->overlay_texture = "clothes_player_helmet_leather_purple.png"; - f->description = wgettext("Purple Leather Helmet"); + f->description = gettext("Purple Leather Helmet"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1671,7 +1671,7 @@ void content_clothesitem_init() f->type = CT_HAT; f->texture = "clothes_helmet_leather_red.png"; f->overlay_texture = "clothes_player_helmet_leather_red.png"; - f->description = wgettext("Red Leather Helmet"); + f->description = gettext("Red Leather Helmet"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1686,7 +1686,7 @@ void content_clothesitem_init() f->type = CT_HAT; f->texture = "clothes_helmet_leather_yellow.png"; f->overlay_texture = "clothes_player_helmet_leather_yellow.png"; - f->description = wgettext("Yellow Leather Helmet"); + f->description = gettext("Yellow Leather Helmet"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1701,7 +1701,7 @@ void content_clothesitem_init() f->type = CT_HAT; f->texture = "clothes_helmet_leather_black.png"; f->overlay_texture = "clothes_player_helmet_leather_black.png"; - f->description = wgettext("Black Leather Helmet"); + f->description = gettext("Black Leather Helmet"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1717,7 +1717,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_shoes_leather_brown.png"; f->overlay_texture = "clothes_player_shoes_leather_brown.png"; - f->description = wgettext("Leather Shoes"); + f->description = gettext("Leather Shoes"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1732,7 +1732,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_shoes_leather_white.png"; f->overlay_texture = "clothes_player_shoes_leather_white.png"; - f->description = wgettext("White Leather Shoes"); + f->description = gettext("White Leather Shoes"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1747,7 +1747,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_shoes_leather_blue.png"; f->overlay_texture = "clothes_player_shoes_leather_blue.png"; - f->description = wgettext("Blue Leather Shoes"); + f->description = gettext("Blue Leather Shoes"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1762,7 +1762,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_shoes_leather_green.png"; f->overlay_texture = "clothes_player_shoes_leather_green.png"; - f->description = wgettext("Green Leather Shoes"); + f->description = gettext("Green Leather Shoes"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1777,7 +1777,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_shoes_leather_orange.png"; f->overlay_texture = "clothes_player_shoes_leather_orange.png"; - f->description = wgettext("Orange Leather Shoes"); + f->description = gettext("Orange Leather Shoes"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1792,7 +1792,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_shoes_leather_purple.png"; f->overlay_texture = "clothes_player_shoes_leather_purple.png"; - f->description = wgettext("Purple Leather Shoes"); + f->description = gettext("Purple Leather Shoes"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1807,7 +1807,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_shoes_leather_red.png"; f->overlay_texture = "clothes_player_shoes_leather_red.png"; - f->description = wgettext("Red Leather Shoes"); + f->description = gettext("Red Leather Shoes"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1822,7 +1822,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_shoes_leather_yellow.png"; f->overlay_texture = "clothes_player_shoes_leather_yellow.png"; - f->description = wgettext("Yellow Leather Shoes"); + f->description = gettext("Yellow Leather Shoes"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1837,7 +1837,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_shoes_leather_black.png"; f->overlay_texture = "clothes_player_shoes_leather_black.png"; - f->description = wgettext("Black Leather Shoes"); + f->description = gettext("Black Leather Shoes"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1853,7 +1853,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_boots_leather_brown.png"; f->overlay_texture = "clothes_player_boots_leather_brown.png"; - f->description = wgettext("Leather Boots"); + f->description = gettext("Leather Boots"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1868,7 +1868,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_boots_leather_white.png"; f->overlay_texture = "clothes_player_boots_leather_white.png"; - f->description = wgettext("White Leather Boots"); + f->description = gettext("White Leather Boots"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1883,7 +1883,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_boots_leather_blue.png"; f->overlay_texture = "clothes_player_boots_leather_blue.png"; - f->description = wgettext("Blue Leather Boots"); + f->description = gettext("Blue Leather Boots"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1898,7 +1898,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_boots_leather_green.png"; f->overlay_texture = "clothes_player_boots_leather_green.png"; - f->description = wgettext("Green Leather Boots"); + f->description = gettext("Green Leather Boots"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1913,7 +1913,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_boots_leather_orange.png"; f->overlay_texture = "clothes_player_boots_leather_orange.png"; - f->description = wgettext("Orange Leather Boots"); + f->description = gettext("Orange Leather Boots"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1928,7 +1928,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_boots_leather_purple.png"; f->overlay_texture = "clothes_player_boots_leather_purple.png"; - f->description = wgettext("Purple Leather Boots"); + f->description = gettext("Purple Leather Boots"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1943,7 +1943,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_boots_leather_red.png"; f->overlay_texture = "clothes_player_boots_leather_red.png"; - f->description = wgettext("Red Leather Boots"); + f->description = gettext("Red Leather Boots"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1958,7 +1958,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_boots_leather_yellow.png"; f->overlay_texture = "clothes_player_boots_leather_yellow.png"; - f->description = wgettext("Yellow Leather Boots"); + f->description = gettext("Yellow Leather Boots"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1973,7 +1973,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_boots_leather_black.png"; f->overlay_texture = "clothes_player_boots_leather_black.png"; - f->description = wgettext("Black Leather Boots"); + f->description = gettext("Black Leather Boots"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -1989,7 +1989,7 @@ void content_clothesitem_init() f->type = CT_BELT; f->texture = "clothes_belt_leather_brown.png"; f->overlay_texture = "clothes_player_belt_leather_brown.png"; - f->description = wgettext("Leather Belt"); + f->description = gettext("Leather Belt"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -2004,7 +2004,7 @@ void content_clothesitem_init() f->type = CT_BELT; f->texture = "clothes_belt_leather_white.png"; f->overlay_texture = "clothes_player_belt_leather_white.png"; - f->description = wgettext("White Leather Belt"); + f->description = gettext("White Leather Belt"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -2019,7 +2019,7 @@ void content_clothesitem_init() f->type = CT_BELT; f->texture = "clothes_belt_leather_blue.png"; f->overlay_texture = "clothes_player_belt_leather_blue.png"; - f->description = wgettext("Blue Leather Belt"); + f->description = gettext("Blue Leather Belt"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -2034,7 +2034,7 @@ void content_clothesitem_init() f->type = CT_BELT; f->texture = "clothes_belt_leather_green.png"; f->overlay_texture = "clothes_player_belt_leather_green.png"; - f->description = wgettext("Green Leather Belt"); + f->description = gettext("Green Leather Belt"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -2049,7 +2049,7 @@ void content_clothesitem_init() f->type = CT_BELT; f->texture = "clothes_belt_leather_orange.png"; f->overlay_texture = "clothes_player_belt_leather_orange.png"; - f->description = wgettext("Orange Leather Belt"); + f->description = gettext("Orange Leather Belt"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -2064,7 +2064,7 @@ void content_clothesitem_init() f->type = CT_BELT; f->texture = "clothes_belt_leather_purple.png"; f->overlay_texture = "clothes_player_belt_leather_purple.png"; - f->description = wgettext("Purple Leather Belt"); + f->description = gettext("Purple Leather Belt"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -2079,7 +2079,7 @@ void content_clothesitem_init() f->type = CT_BELT; f->texture = "clothes_belt_leather_red.png"; f->overlay_texture = "clothes_player_belt_leather_red.png"; - f->description = wgettext("Red Leather Belt"); + f->description = gettext("Red Leather Belt"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -2094,7 +2094,7 @@ void content_clothesitem_init() f->type = CT_BELT; f->texture = "clothes_belt_leather_yellow.png"; f->overlay_texture = "clothes_player_belt_leather_yellow.png"; - f->description = wgettext("Yellow Leather Belt"); + f->description = gettext("Yellow Leather Belt"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -2109,7 +2109,7 @@ void content_clothesitem_init() f->type = CT_BELT; f->texture = "clothes_belt_leather_black.png"; f->overlay_texture = "clothes_player_belt_leather_black.png"; - f->description = wgettext("Black Leather Belt"); + f->description = gettext("Black Leather Belt"); f->armour = 1.0; f->warmth = 0.6; f->vacuum = 0.1; @@ -2125,7 +2125,7 @@ void content_clothesitem_init() f->type = CT_JACKET; f->texture = "clothes_jacket_fur_brown.png"; f->overlay_texture = "clothes_player_jacket_fur_brown.png"; - f->description = wgettext("Fur Coat"); + f->description = gettext("Fur Coat"); f->armour = 0.4; f->warmth = 1.0; f->vacuum = 0.05; @@ -2140,7 +2140,7 @@ void content_clothesitem_init() f->type = CT_JACKET; f->texture = "clothes_jacket_fur_white.png"; f->overlay_texture = "clothes_player_jacket_fur_white.png"; - f->description = wgettext("White Fur Coat"); + f->description = gettext("White Fur Coat"); f->armour = 0.4; f->warmth = 1.0; f->vacuum = 0.05; @@ -2155,7 +2155,7 @@ void content_clothesitem_init() f->type = CT_JACKET; f->texture = "clothes_jacket_fur_blue.png"; f->overlay_texture = "clothes_player_jacket_fur_blue.png"; - f->description = wgettext("Blue Fur Coat"); + f->description = gettext("Blue Fur Coat"); f->armour = 0.4; f->warmth = 1.0; f->vacuum = 0.05; @@ -2170,7 +2170,7 @@ void content_clothesitem_init() f->type = CT_JACKET; f->texture = "clothes_jacket_fur_green.png"; f->overlay_texture = "clothes_player_jacket_fur_green.png"; - f->description = wgettext("Green Fur Coat"); + f->description = gettext("Green Fur Coat"); f->armour = 0.4; f->warmth = 1.0; f->vacuum = 0.05; @@ -2185,7 +2185,7 @@ void content_clothesitem_init() f->type = CT_JACKET; f->texture = "clothes_jacket_fur_orange.png"; f->overlay_texture = "clothes_player_jacket_fur_orange.png"; - f->description = wgettext("Orange Fur Coat"); + f->description = gettext("Orange Fur Coat"); f->armour = 0.4; f->warmth = 1.0; f->vacuum = 0.05; @@ -2200,7 +2200,7 @@ void content_clothesitem_init() f->type = CT_JACKET; f->texture = "clothes_jacket_fur_purple.png"; f->overlay_texture = "clothes_player_jacket_fur_purple.png"; - f->description = wgettext("Purple Fur Coat"); + f->description = gettext("Purple Fur Coat"); f->armour = 0.4; f->warmth = 1.0; f->vacuum = 0.05; @@ -2215,7 +2215,7 @@ void content_clothesitem_init() f->type = CT_JACKET; f->texture = "clothes_jacket_fur_red.png"; f->overlay_texture = "clothes_player_jacket_fur_red.png"; - f->description = wgettext("Red Fur Coat"); + f->description = gettext("Red Fur Coat"); f->armour = 0.4; f->warmth = 1.0; f->vacuum = 0.05; @@ -2230,7 +2230,7 @@ void content_clothesitem_init() f->type = CT_JACKET; f->texture = "clothes_jacket_fur_yellow.png"; f->overlay_texture = "clothes_player_jacket_fur_yellow.png"; - f->description = wgettext("Yellow Fur Coat"); + f->description = gettext("Yellow Fur Coat"); f->armour = 0.4; f->warmth = 1.0; f->vacuum = 0.05; @@ -2245,7 +2245,7 @@ void content_clothesitem_init() f->type = CT_JACKET; f->texture = "clothes_jacket_fur_black.png"; f->overlay_texture = "clothes_player_jacket_fur_black.png"; - f->description = wgettext("Black Fur Coat"); + f->description = gettext("Black Fur Coat"); f->armour = 0.4; f->warmth = 1.0; f->vacuum = 0.05; @@ -2261,7 +2261,7 @@ void content_clothesitem_init() f->type = CT_PANTS; f->texture = "clothes_pants_fur_brown.png"; f->overlay_texture = "clothes_player_pants_fur_brown.png"; - f->description = wgettext("Fur Pants"); + f->description = gettext("Fur Pants"); f->armour = 0.4; f->warmth = 1.0; f->vacuum = 0.05; @@ -2276,7 +2276,7 @@ void content_clothesitem_init() f->type = CT_PANTS; f->texture = "clothes_pants_fur_white.png"; f->overlay_texture = "clothes_player_pants_fur_white.png"; - f->description = wgettext("White Fur Pants"); + f->description = gettext("White Fur Pants"); f->armour = 0.4; f->warmth = 1.0; f->vacuum = 0.05; @@ -2291,7 +2291,7 @@ void content_clothesitem_init() f->type = CT_PANTS; f->texture = "clothes_pants_fur_blue.png"; f->overlay_texture = "clothes_player_pants_fur_blue.png"; - f->description = wgettext("Blue Fur Pants"); + f->description = gettext("Blue Fur Pants"); f->armour = 0.4; f->warmth = 1.0; f->vacuum = 0.05; @@ -2306,7 +2306,7 @@ void content_clothesitem_init() f->type = CT_PANTS; f->texture = "clothes_pants_fur_green.png"; f->overlay_texture = "clothes_player_pants_fur_green.png"; - f->description = wgettext("Green Fur Pants"); + f->description = gettext("Green Fur Pants"); f->armour = 0.4; f->warmth = 1.0; f->vacuum = 0.05; @@ -2321,7 +2321,7 @@ void content_clothesitem_init() f->type = CT_PANTS; f->texture = "clothes_pants_fur_orange.png"; f->overlay_texture = "clothes_player_pants_fur_orange.png"; - f->description = wgettext("Orange Fur Pants"); + f->description = gettext("Orange Fur Pants"); f->armour = 0.4; f->warmth = 1.0; f->vacuum = 0.05; @@ -2336,7 +2336,7 @@ void content_clothesitem_init() f->type = CT_PANTS; f->texture = "clothes_pants_fur_purple.png"; f->overlay_texture = "clothes_player_pants_fur_purple.png"; - f->description = wgettext("Purple Fur Pants"); + f->description = gettext("Purple Fur Pants"); f->armour = 0.4; f->warmth = 1.0; f->vacuum = 0.05; @@ -2351,7 +2351,7 @@ void content_clothesitem_init() f->type = CT_PANTS; f->texture = "clothes_pants_fur_red.png"; f->overlay_texture = "clothes_player_pants_fur_red.png"; - f->description = wgettext("Red Fur Pants"); + f->description = gettext("Red Fur Pants"); f->armour = 0.4; f->warmth = 1.0; f->vacuum = 0.05; @@ -2366,7 +2366,7 @@ void content_clothesitem_init() f->type = CT_PANTS; f->texture = "clothes_pants_fur_yellow.png"; f->overlay_texture = "clothes_player_pants_fur_yellow.png"; - f->description = wgettext("Yellow Fur Pants"); + f->description = gettext("Yellow Fur Pants"); f->armour = 0.4; f->warmth = 1.0; f->vacuum = 0.05; @@ -2381,7 +2381,7 @@ void content_clothesitem_init() f->type = CT_PANTS; f->texture = "clothes_pants_fur_black.png"; f->overlay_texture = "clothes_player_pants_fur_black.png"; - f->description = wgettext("Black Fur Pants"); + f->description = gettext("Black Fur Pants"); f->armour = 0.4; f->warmth = 1.0; f->vacuum = 0.05; @@ -2397,7 +2397,7 @@ void content_clothesitem_init() f->type = CT_HAT; f->texture = "clothes_hat_fur_brown.png"; f->overlay_texture = "clothes_player_hat_fur_brown.png"; - f->description = wgettext("Fur Hat"); + f->description = gettext("Fur Hat"); f->armour = 0.4; f->warmth = 1.0; f->vacuum = 0.05; @@ -2412,7 +2412,7 @@ void content_clothesitem_init() f->type = CT_HAT; f->texture = "clothes_hat_fur_white.png"; f->overlay_texture = "clothes_player_hat_fur_white.png"; - f->description = wgettext("White Fur Hat"); + f->description = gettext("White Fur Hat"); f->armour = 0.4; f->warmth = 1.0; f->vacuum = 0.05; @@ -2427,7 +2427,7 @@ void content_clothesitem_init() f->type = CT_HAT; f->texture = "clothes_hat_fur_blue.png"; f->overlay_texture = "clothes_player_hat_fur_blue.png"; - f->description = wgettext("Blue Fur Hat"); + f->description = gettext("Blue Fur Hat"); f->armour = 0.4; f->warmth = 1.0; f->vacuum = 0.05; @@ -2442,7 +2442,7 @@ void content_clothesitem_init() f->type = CT_HAT; f->texture = "clothes_hat_fur_green.png"; f->overlay_texture = "clothes_player_hat_fur_green.png"; - f->description = wgettext("Green Fur Hat"); + f->description = gettext("Green Fur Hat"); f->armour = 0.4; f->warmth = 1.0; f->vacuum = 0.05; @@ -2457,7 +2457,7 @@ void content_clothesitem_init() f->type = CT_HAT; f->texture = "clothes_hat_fur_orange.png"; f->overlay_texture = "clothes_player_hat_fur_orange.png"; - f->description = wgettext("Orange Fur Hat"); + f->description = gettext("Orange Fur Hat"); f->armour = 0.4; f->warmth = 1.0; f->vacuum = 0.05; @@ -2472,7 +2472,7 @@ void content_clothesitem_init() f->type = CT_HAT; f->texture = "clothes_hat_fur_purple.png"; f->overlay_texture = "clothes_player_hat_fur_purple.png"; - f->description = wgettext("Purple Fur Hat"); + f->description = gettext("Purple Fur Hat"); f->armour = 0.4; f->warmth = 1.0; f->vacuum = 0.05; @@ -2487,7 +2487,7 @@ void content_clothesitem_init() f->type = CT_HAT; f->texture = "clothes_hat_fur_red.png"; f->overlay_texture = "clothes_player_hat_fur_red.png"; - f->description = wgettext("Red Fur Hat"); + f->description = gettext("Red Fur Hat"); f->armour = 0.4; f->warmth = 1.0; f->vacuum = 0.05; @@ -2502,7 +2502,7 @@ void content_clothesitem_init() f->type = CT_HAT; f->texture = "clothes_hat_fur_yellow.png"; f->overlay_texture = "clothes_player_hat_fur_yellow.png"; - f->description = wgettext("Yellow Fur Hat"); + f->description = gettext("Yellow Fur Hat"); f->armour = 0.4; f->warmth = 1.0; f->vacuum = 0.05; @@ -2517,7 +2517,7 @@ void content_clothesitem_init() f->type = CT_HAT; f->texture = "clothes_hat_fur_black.png"; f->overlay_texture = "clothes_player_hat_fur_black.png"; - f->description = wgettext("Black Fur Hat"); + f->description = gettext("Black Fur Hat"); f->armour = 0.4; f->warmth = 1.0; f->vacuum = 0.05; @@ -2533,7 +2533,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_shoes_fur_brown.png"; f->overlay_texture = "clothes_player_shoes_fur_brown.png"; - f->description = wgettext("Fur Shoes"); + f->description = gettext("Fur Shoes"); f->armour = 0.4; f->warmth = 1.0; f->vacuum = 0.05; @@ -2547,7 +2547,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_shoes_fur_white.png"; f->overlay_texture = "clothes_player_shoes_fur_white.png"; - f->description = wgettext("White Fur Shoes"); + f->description = gettext("White Fur Shoes"); f->armour = 0.4; f->warmth = 1.0; f->vacuum = 0.05; @@ -2561,7 +2561,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_shoes_fur_blue.png"; f->overlay_texture = "clothes_player_shoes_fur_blue.png"; - f->description = wgettext("Blue Fur Shoes"); + f->description = gettext("Blue Fur Shoes"); f->armour = 0.4; f->warmth = 1.0; f->vacuum = 0.05; @@ -2575,7 +2575,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_shoes_fur_green.png"; f->overlay_texture = "clothes_player_shoes_fur_green.png"; - f->description = wgettext("Green Fur Shoes"); + f->description = gettext("Green Fur Shoes"); f->armour = 0.4; f->warmth = 1.0; f->vacuum = 0.05; @@ -2589,7 +2589,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_shoes_fur_orange.png"; f->overlay_texture = "clothes_player_shoes_fur_orange.png"; - f->description = wgettext("Orange Fur Shoes"); + f->description = gettext("Orange Fur Shoes"); f->armour = 0.4; f->warmth = 1.0; f->vacuum = 0.05; @@ -2603,7 +2603,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_shoes_fur_purple.png"; f->overlay_texture = "clothes_player_shoes_fur_purple.png"; - f->description = wgettext("Purple Fur Shoes"); + f->description = gettext("Purple Fur Shoes"); f->armour = 0.4; f->warmth = 1.0; f->vacuum = 0.05; @@ -2617,7 +2617,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_shoes_fur_red.png"; f->overlay_texture = "clothes_player_shoes_fur_red.png"; - f->description = wgettext("Red Fur Shoes"); + f->description = gettext("Red Fur Shoes"); f->armour = 0.4; f->warmth = 1.0; f->vacuum = 0.05; @@ -2631,7 +2631,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_shoes_fur_yellow.png"; f->overlay_texture = "clothes_player_shoes_fur_yellow.png"; - f->description = wgettext("Yellow Fur Shoes"); + f->description = gettext("Yellow Fur Shoes"); f->armour = 0.4; f->warmth = 1.0; f->vacuum = 0.05; @@ -2645,7 +2645,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_shoes_fur_black.png"; f->overlay_texture = "clothes_player_shoes_fur_black.png"; - f->description = wgettext("Black Fur Shoes"); + f->description = gettext("Black Fur Shoes"); f->armour = 0.4; f->warmth = 1.0; f->vacuum = 0.05; @@ -2660,7 +2660,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_boots_fur_brown.png"; f->overlay_texture = "clothes_player_boots_fur_brown.png"; - f->description = wgettext("Fur Boots"); + f->description = gettext("Fur Boots"); f->armour = 0.4; f->warmth = 1.0; f->vacuum = 0.05; @@ -2675,7 +2675,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_boots_fur_white.png"; f->overlay_texture = "clothes_player_boots_fur_white.png"; - f->description = wgettext("White Fur Boots"); + f->description = gettext("White Fur Boots"); f->armour = 0.4; f->warmth = 1.0; f->vacuum = 0.05; @@ -2690,7 +2690,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_boots_fur_blue.png"; f->overlay_texture = "clothes_player_boots_fur_blue.png"; - f->description = wgettext("Blue Fur Boots"); + f->description = gettext("Blue Fur Boots"); f->armour = 0.4; f->warmth = 1.0; f->vacuum = 0.05; @@ -2705,7 +2705,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_boots_fur_green.png"; f->overlay_texture = "clothes_player_boots_fur_green.png"; - f->description = wgettext("Green Fur Boots"); + f->description = gettext("Green Fur Boots"); f->armour = 0.4; f->warmth = 1.0; f->vacuum = 0.05; @@ -2720,7 +2720,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_boots_fur_orange.png"; f->overlay_texture = "clothes_player_boots_fur_orange.png"; - f->description = wgettext("Orange Fur Boots"); + f->description = gettext("Orange Fur Boots"); f->armour = 0.4; f->warmth = 1.0; f->vacuum = 0.05; @@ -2735,7 +2735,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_boots_fur_purple.png"; f->overlay_texture = "clothes_player_boots_fur_purple.png"; - f->description = wgettext("Purple Fur Boots"); + f->description = gettext("Purple Fur Boots"); f->armour = 0.4; f->warmth = 1.0; f->vacuum = 0.05; @@ -2750,7 +2750,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_boots_fur_red.png"; f->overlay_texture = "clothes_player_boots_fur_red.png"; - f->description = wgettext("Red Fur Boots"); + f->description = gettext("Red Fur Boots"); f->armour = 0.4; f->warmth = 1.0; f->vacuum = 0.05; @@ -2765,7 +2765,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_boots_fur_yellow.png"; f->overlay_texture = "clothes_player_boots_fur_yellow.png"; - f->description = wgettext("Yellow Fur Boots"); + f->description = gettext("Yellow Fur Boots"); f->armour = 0.4; f->warmth = 1.0; f->vacuum = 0.05; @@ -2780,7 +2780,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_boots_fur_black.png"; f->overlay_texture = "clothes_player_boots_fur_black.png"; - f->description = wgettext("Black Fur Boots"); + f->description = gettext("Black Fur Boots"); f->armour = 0.4; f->warmth = 1.0; f->vacuum = 0.05; @@ -2796,7 +2796,7 @@ void content_clothesitem_init() f->type = CT_DECORATIVE; f->texture = "clothes_necklace_leather.png"; f->overlay_texture = "clothes_player_necklace_leather.png"; - f->description = wgettext("Leather Necklace"); + f->description = gettext("Leather Necklace"); f->armour = 0.0; f->warmth = 0.0; f->vacuum = 0.0; @@ -2819,7 +2819,7 @@ void content_clothesitem_init() f->type = CT_MEDALLION; f->texture = "clothes_medallion_gold.png"; f->overlay_texture = "clothes_player_medallion_gold.png"; - f->description = wgettext("Gold Medallion"); + f->description = gettext("Gold Medallion"); f->armour = 0.0; f->warmth = 0.0; f->vacuum = 0.0; @@ -2835,7 +2835,7 @@ void content_clothesitem_init() f->type = CT_MEDALLION; f->texture = "clothes_medallion_copper.png"; f->overlay_texture = "clothes_player_medallion_copper.png"; - f->description = wgettext("Copper Medallion"); + f->description = gettext("Copper Medallion"); f->armour = 0.0; f->warmth = 0.0; f->vacuum = 0.0; @@ -2851,7 +2851,7 @@ void content_clothesitem_init() f->type = CT_MEDALLION; f->texture = "clothes_medallion_silver.png"; f->overlay_texture = "clothes_player_medallion_silver.png"; - f->description = wgettext("Silver Medallion"); + f->description = gettext("Silver Medallion"); f->armour = 0.0; f->warmth = 0.0; f->vacuum = 0.0; @@ -2867,7 +2867,7 @@ void content_clothesitem_init() f->type = CT_MEDALLION; f->texture = "clothes_medallion_tin.png"; f->overlay_texture = "clothes_player_medallion_tin.png"; - f->description = wgettext("Tin Medallion"); + f->description = gettext("Tin Medallion"); f->armour = 0.0; f->warmth = 0.0; f->vacuum = 0.0; @@ -2883,7 +2883,7 @@ void content_clothesitem_init() f->type = CT_MEDALLION; f->texture = "clothes_medallion_iron.png"; f->overlay_texture = "clothes_player_medallion_iron.png"; - f->description = wgettext("Iron Medallion"); + f->description = gettext("Iron Medallion"); f->armour = 0.0; f->warmth = 0.0; f->vacuum = 0.0; @@ -2899,7 +2899,7 @@ void content_clothesitem_init() f->type = CT_MEDALLION; f->texture = "clothes_medallion_quartz.png"; f->overlay_texture = "clothes_player_medallion_quartz.png"; - f->description = wgettext("Quartz Medallion"); + f->description = gettext("Quartz Medallion"); f->armour = 0.0; f->warmth = 0.0; f->vacuum = 0.0; @@ -2916,7 +2916,7 @@ void content_clothesitem_init() f->type = CT_HAT; f->texture = "clothes_helmet_steel.png"; f->overlay_texture = "clothes_player_helmet_steel.png"; - f->description = wgettext("Steel Helmet"); + f->description = gettext("Steel Helmet"); f->armour = 1.0; f->warmth = 0.0; f->vacuum = 0.1; @@ -2931,7 +2931,7 @@ void content_clothesitem_init() f->type = CT_JACKET; f->texture = "clothes_shirt_steel.png"; f->overlay_texture = "clothes_player_shirt_steel.png"; - f->description = wgettext("Steel Chest Armour"); + f->description = gettext("Steel Chest Armour"); f->armour = 1.0; f->warmth = 0.0; f->vacuum = 0.1; @@ -2946,7 +2946,7 @@ void content_clothesitem_init() f->type = CT_PANTS; f->texture = "clothes_pants_steel.png"; f->overlay_texture = "clothes_player_pants_steel.png"; - f->description = wgettext("Steel Pants"); + f->description = gettext("Steel Pants"); f->armour = 1.0; f->warmth = 0.0; f->vacuum = 0.1; @@ -2961,7 +2961,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_boots_steel.png"; f->overlay_texture = "clothes_player_boots_steel.png"; - f->description = wgettext("Steel Boots"); + f->description = gettext("Steel Boots"); f->armour = 1.0; f->warmth = 0.0; f->vacuum = 0.1; @@ -2976,7 +2976,7 @@ void content_clothesitem_init() f->type = CT_HAT; f->texture = "clothes_helmet_copper.png"; f->overlay_texture = "clothes_player_helmet_copper.png"; - f->description = wgettext("Copper Helmet"); + f->description = gettext("Copper Helmet"); f->armour = 1.0; f->warmth = 0.0; f->vacuum = 0.0; @@ -2990,7 +2990,7 @@ void content_clothesitem_init() f->type = CT_JACKET; f->texture = "clothes_shirt_copper.png"; f->overlay_texture = "clothes_player_shirt_copper.png"; - f->description = wgettext("Copper Chest Armour"); + f->description = gettext("Copper Chest Armour"); f->armour = 1.0; f->warmth = 0.0; f->vacuum = 0.0; @@ -3004,7 +3004,7 @@ void content_clothesitem_init() f->type = CT_PANTS; f->texture = "clothes_pants_copper.png"; f->overlay_texture = "clothes_player_pants_copper.png"; - f->description = wgettext("Copper Pants"); + f->description = gettext("Copper Pants"); f->armour = 1.0; f->warmth = 0.0; f->vacuum = 0.0; @@ -3018,7 +3018,7 @@ void content_clothesitem_init() f->type = CT_BOOTS; f->texture = "clothes_boots_copper.png"; f->overlay_texture = "clothes_player_boots_copper.png"; - f->description = wgettext("Copper Boots"); + f->description = gettext("Copper Boots"); f->armour = 1.0; f->warmth = 0.0; f->vacuum = 0.0; diff --git a/src/content_clothesitem.h b/src/content_clothesitem.h index e2dd103..a3d2b4d 100644 --- a/src/content_clothesitem.h +++ b/src/content_clothesitem.h @@ -46,7 +46,7 @@ struct ClothesItemFeatures { // overlaid on the player texture so it can be seen as worn std::string overlay_texture; // tooltip used in inventory - std::wstring description; + char* description; // the type of this clothing ClothesType type; // the strength as armour @@ -61,20 +61,6 @@ struct ClothesItemFeatures { u8 durability; // for medallions, how much the affect durability of other items f32 effect; - - ClothesItemFeatures(): - content(CONTENT_IGNORE), - texture("unknown_item.png"), - overlay_texture(""), - description(L""), - type(CT_NONE), - armour(0.), - warmth(0.), - vacuum(0.), - suffocate(0.), - durability(5), - effect(1.) - {} }; extern struct ClothesItemFeatures g_content_clothesitem_features[4096]; diff --git a/src/content_craftitem.cpp b/src/content_craftitem.cpp index 276c739..a5ee47f 100644 --- a/src/content_craftitem.cpp +++ b/src/content_craftitem.cpp @@ -57,7 +57,7 @@ void content_craftitem_init() g_content_craftitem_features[k].texture = "unknown_item.png"; g_content_craftitem_features[k].overlay_base = ""; g_content_craftitem_features[k].name = ""; - g_content_craftitem_features[k].description = L""; + g_content_craftitem_features[k].description = (char*)""; g_content_craftitem_features[k].cook_result = CONTENT_IGNORE; g_content_craftitem_features[k].cook_type = COOK_ANY; g_content_craftitem_features[k].fuel_time = 0.0; @@ -83,7 +83,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_PAPER; f->texture = "paper.png"; f->name = "paper"; - f->description = wgettext("Paper"); + f->description = gettext("Paper"); crafting::setRow3Recipe(CONTENT_PAPYRUS,CONTENT_CRAFTITEM_PAPER); content_list_add("craftguide",i,1,0); content_list_add("creative",i,1,0); @@ -93,7 +93,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_CHARCOAL; f->texture = "lump_of_charcoal.png"; f->name = "lump_of_charcoal"; - f->description = wgettext("Charcoal Lump"); + f->description = gettext("Charcoal Lump"); f->fuel_time = 40; content_list_add("creative",i,1,0); @@ -102,7 +102,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_COAL; f->texture = "lump_of_coal.png"; f->name = "lump_of_coal"; - f->description = wgettext("Coal Lump"); + f->description = gettext("Coal Lump"); f->fuel_time = 40; content_list_add("creative",i,1,0); @@ -111,7 +111,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_IRON; f->texture = "lump_of_iron.png"; f->name = "lump_of_iron"; - f->description = wgettext("Iron Lump"); + f->description = gettext("Iron Lump"); f->cook_result = CONTENT_CRAFTITEM_STEEL_INGOT; f->cook_type = COOK_FURNACE; content_list_add("creative",i,1,0); @@ -122,7 +122,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_CLAY; f->texture = "lump_of_clay.png"; f->name = "lump_of_clay"; - f->description = wgettext("Clay Lump"); + f->description = gettext("Clay Lump"); f->cook_result = CONTENT_CRAFTITEM_CLAY_BRICK; content_list_add("creative",i,1,0); content_list_add("cooking",i,1,0); @@ -132,7 +132,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_TIN; f->texture = "lump_of_tin.png"; f->name = "lump_of_tin"; - f->description = wgettext("Tin Lump"); + f->description = gettext("Tin Lump"); f->cook_result = CONTENT_CRAFTITEM_TIN_INGOT; content_list_add("creative",i,1,0); content_list_add("cooking",i,1,0); @@ -142,7 +142,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_COPPER; f->texture = "lump_of_copper.png"; f->name = "lump_of_copper"; - f->description = wgettext("Copper Lump"); + f->description = gettext("Copper Lump"); f->cook_result = CONTENT_CRAFTITEM_COPPER_INGOT; content_list_add("creative",i,1,0); content_list_add("cooking",i,1,0); @@ -152,7 +152,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_SILVER; f->texture = "lump_of_silver.png"; f->name = "lump_of_silver"; - f->description = wgettext("Silver Lump"); + f->description = gettext("Silver Lump"); f->cook_result = CONTENT_CRAFTITEM_SILVER_INGOT; f->cook_type = COOK_FURNACE; content_list_add("creative",i,1,0); @@ -163,7 +163,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_GOLD; f->texture = "lump_of_gold.png"; f->name = "lump_of_gold"; - f->description = wgettext("Gold Lump"); + f->description = gettext("Gold Lump"); f->cook_result = CONTENT_CRAFTITEM_GOLD_INGOT; f->cook_type = COOK_FURNACE; content_list_add("creative",i,1,0); @@ -174,7 +174,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_QUARTZ; f->texture = "lump_of_quartz.png"; f->name = "lump_of_quartz"; - f->description = wgettext("Quartz Crystal"); + f->description = gettext("Quartz Crystal"); content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_TIN_INGOT; @@ -182,7 +182,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_TIN_INGOT; f->texture = "tin_ingot.png"; f->name = "tin_ingot"; - f->description = wgettext("Tin Ingot"); + f->description = gettext("Tin Ingot"); content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_COPPER_INGOT; @@ -190,7 +190,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_COPPER_INGOT; f->texture = "copper_ingot.png"; f->name = "copper_ingot"; - f->description = wgettext("Copper Ingot"); + f->description = gettext("Copper Ingot"); content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_SILVER_INGOT; @@ -198,7 +198,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_SILVER_INGOT; f->texture = "silver_ingot.png"; f->name = "silver_ingot"; - f->description = wgettext("Silver Ingot"); + f->description = gettext("Silver Ingot"); content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_GOLD_INGOT; @@ -206,7 +206,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_GOLD_INGOT; f->texture = "gold_ingot.png"; f->name = "gold_ingot"; - f->description = wgettext("Gold Ingot"); + f->description = gettext("Gold Ingot"); content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_FLINT; @@ -214,7 +214,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_FLINT; f->texture = "lump_of_flint.png"; f->name = "lump_of_flint"; - f->description = wgettext("Flint"); + f->description = gettext("Flint"); content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_STEEL_INGOT; @@ -222,7 +222,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_STEEL_INGOT; f->texture = "steel_ingot.png"; f->name = "steel_ingot"; - f->description = wgettext("Steel Ingot"); + f->description = gettext("Steel Ingot"); content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_CLAY_BRICK; @@ -230,7 +230,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_CLAY_BRICK; f->texture = "clay_brick.png"; f->name = "clay_brick"; - f->description = wgettext("Brick"); + f->description = gettext("Brick"); content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_RAT; @@ -238,7 +238,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_RAT; f->texture = "rat.png"; f->name = "rat"; - f->description = wgettext("Rat"); + f->description = gettext("Rat"); f->cook_result = CONTENT_CRAFTITEM_COOKED_RAT; f->drop_count = 1; f->drop_item = CONTENT_MOB_RAT; @@ -250,7 +250,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_COOKED_RAT; f->texture = "cooked_rat.png"; f->name = "cooked_rat"; - f->description = wgettext("Cooked Rat"); + f->description = gettext("Cooked Rat"); f->cook_result = CONTENT_CRAFTITEM_ASH; f->consumable = true; f->sound_use = "use-eat"; @@ -264,7 +264,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_FIREFLY; f->texture = "firefly.png"; f->name = "firefly"; - f->description = wgettext("Firefly"); + f->description = gettext("Firefly"); f->drop_count = 1; f->drop_item = CONTENT_MOB_FIREFLY; content_list_add("creative",i,1,0); @@ -274,7 +274,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_APPLE; f->texture = "apple.png^[forcesingle"; f->name = "apple"; - f->description = wgettext("Apple"); + f->description = gettext("Apple"); f->consumable = true; f->sound_use = "use-eat"; f->hunger_effect = 30; @@ -286,7 +286,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_APPLE_IRON; f->texture = "apple_iron.png"; f->name = "apple_iron"; - f->description = wgettext("Iron Apple"); + f->description = gettext("Iron Apple"); f->consumable = true; f->sound_use = "use-eat"; f->hunger_effect = 80; @@ -307,7 +307,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_DYE_BLUE; f->texture = "dye_blue.png"; f->name = "dye_blue"; - f->description = wgettext("Blue Dye"); + f->description = gettext("Blue Dye"); crafting::set1To2Recipe(CONTENT_FLOWER_TULIP,CONTENT_CRAFTITEM_DYE_BLUE); content_list_add("craftguide",i,1,0); content_list_add("creative",i,1,0); @@ -317,7 +317,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_DYE_GREEN; f->texture = "dye_green.png"; f->name = "dye_green"; - f->description = wgettext("Green Dye"); + f->description = gettext("Green Dye"); crafting::set2Any2Recipe(CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_CRAFTITEM_DYE_GREEN); content_list_add("craftguide",i,1,0); content_list_add("creative",i,1,0); @@ -327,7 +327,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_DYE_ORANGE; f->texture = "dye_orange.png"; f->name = "dye_orange"; - f->description = wgettext("Orange Dye"); + f->description = gettext("Orange Dye"); crafting::set2Any2Recipe(CONTENT_CRAFTITEM_DYE_RED,CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_CRAFTITEM_DYE_ORANGE); content_list_add("craftguide",i,1,0); content_list_add("creative",i,1,0); @@ -337,7 +337,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_DYE_PURPLE; f->texture = "dye_purple.png"; f->name = "dye_purple"; - f->description = wgettext("Purple Dye"); + f->description = gettext("Purple Dye"); crafting::set2Any2Recipe(CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_CRAFTITEM_DYE_RED,CONTENT_CRAFTITEM_DYE_PURPLE); content_list_add("craftguide",i,1,0); content_list_add("creative",i,1,0); @@ -347,7 +347,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_DYE_RED; f->texture = "dye_red.png"; f->name = "dye_red"; - f->description = wgettext("Red Dye"); + f->description = gettext("Red Dye"); crafting::set1To2Recipe(CONTENT_FLOWER_ROSE,CONTENT_CRAFTITEM_DYE_RED); content_list_add("craftguide",i,1,0); content_list_add("creative",i,1,0); @@ -357,7 +357,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_DYE_YELLOW; f->texture = "dye_yellow.png"; f->name = "dye_yellow"; - f->description = wgettext("Yellow Dye"); + f->description = gettext("Yellow Dye"); crafting::set1To2Recipe(CONTENT_CACTUS_BLOSSOM,CONTENT_CRAFTITEM_DYE_YELLOW); crafting::set1To2Recipe(CONTENT_FLOWER_DAFFODIL,CONTENT_CRAFTITEM_DYE_YELLOW); content_list_add("craftguide",i,1,0); @@ -368,7 +368,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_DYE_WHITE; f->texture = "dye_white.png"; f->name = "dye_white"; - f->description = wgettext("White Dye"); + f->description = gettext("White Dye"); crafting::set1To1Recipe(CONTENT_CRAFTITEM_APPLE_BLOSSOM,CONTENT_CRAFTITEM_DYE_WHITE); crafting::set2Any3Recipe(CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_CRAFTITEM_DYE_RED,CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_CRAFTITEM_DYE_WHITE); content_list_add("craftguide",i,1,0); @@ -379,7 +379,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_DYE_BLACK; f->texture = "dye_black.png"; f->name = "dye_black"; - f->description = wgettext("Black Dye"); + f->description = gettext("Black Dye"); crafting::set2Any2Recipe(CONTENT_CRAFTITEM_DYE_WHITE,CONTENT_CRAFTITEM_COAL,CONTENT_CRAFTITEM_DYE_BLACK); content_list_add("craftguide",i,1,0); content_list_add("creative",i,1,0); @@ -389,7 +389,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_QUARTZ_DUST; f->texture = "quartz_dust.png"; f->name = "quartz_dust"; - f->description = wgettext("Quartz Dust"); + f->description = gettext("Quartz Dust"); crafting::set1To2Recipe(CONTENT_CRAFTITEM_QUARTZ,CONTENT_CRAFTITEM_QUARTZ_DUST); content_list_add("craftguide",i,1,0); content_list_add("creative",i,1,0); @@ -399,7 +399,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_SALTPETER; f->texture = "saltpeter.png"; f->name = "saltpeter"; - f->description = wgettext("Saltpeter"); + f->description = gettext("Saltpeter"); content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_GUNPOWDER; @@ -407,7 +407,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_GUNPOWDER; f->texture = "gunpowder.png"; f->name = "gunpowder"; - f->description = wgettext("Gun Powder"); + f->description = gettext("Gun Powder"); crafting::set1Any3Recipe(CONTENT_CRAFTITEM_CHARCOAL,CONTENT_CRAFTITEM_FLINT,CONTENT_CRAFTITEM_SALTPETER,CONTENT_CRAFTITEM_GUNPOWDER); content_list_add("craftguide",i,1,0); content_list_add("creative",i,1,0); @@ -417,7 +417,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_SNOW_BALL; f->texture = "snow_ball.png"; f->name = "snow_ball"; - f->description = wgettext("Snow Ball"); + f->description = gettext("Snow Ball"); f->thrown_item = CONTENT_MOB_SNOWBALL; i = CONTENT_CRAFTITEM_STICK; @@ -425,7 +425,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_STICK; f->texture = "stick.png"; f->name = "Stick"; - f->description = wgettext("Stick"); + f->description = gettext("Stick"); f->fuel_time = 30/16; crafting::set1To2Recipe(CONTENT_CRAFTITEM_PINE_PLANK,CONTENT_CRAFTITEM_STICK); crafting::set1To2Recipe(CONTENT_CRAFTITEM_WOOD_PLANK,CONTENT_CRAFTITEM_STICK); @@ -442,7 +442,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_PINE_PLANK; f->texture = "pine_plank.png"; f->name = "pine_plank"; - f->description = wgettext("Pine Plank"); + f->description = gettext("Pine Plank"); f->fuel_time = 30/16; crafting::set1To4Recipe(CONTENT_WOOD_PINE,CONTENT_CRAFTITEM_PINE_PLANK); crafting::set1To2Recipe(CONTENT_YOUNG_CONIFER_TREE,CONTENT_CRAFTITEM_PINE_PLANK); @@ -454,7 +454,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_WOOD_PLANK; f->texture = "wood_plank.png"; f->name = "wood_plank"; - f->description = wgettext("Wood Plank"); + f->description = gettext("Wood Plank"); f->fuel_time = 30/16; crafting::set1To4Recipe(CONTENT_WOOD,CONTENT_CRAFTITEM_WOOD_PLANK); crafting::set1To2Recipe(CONTENT_YOUNG_TREE,CONTENT_CRAFTITEM_WOOD_PLANK); @@ -467,7 +467,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_JUNGLE_PLANK; f->texture = "jungle_plank.png"; f->name = "jungle_plank"; - f->description = wgettext("Jungle Wood Plank"); + f->description = gettext("Jungle Wood Plank"); f->fuel_time = 30/16; crafting::set1To4Recipe(CONTENT_JUNGLEWOOD,CONTENT_CRAFTITEM_JUNGLE_PLANK); crafting::set1To2Recipe(CONTENT_YOUNG_JUNGLETREE,CONTENT_CRAFTITEM_JUNGLE_PLANK); @@ -479,7 +479,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_TNT; f->texture = "tnt_stick.png"; f->name = "tnt_stick"; - f->description = wgettext("TNT Stick"); + f->description = gettext("TNT Stick"); { u16 recipe[9] = { CONTENT_CRAFTITEM_PAPER, CONTENT_CRAFTITEM_GUNPOWDER, CONTENT_CRAFTITEM_PAPER, @@ -496,7 +496,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_ASH; f->texture = "lump_of_ash.png"; f->name = "lump_of_ash"; - f->description = wgettext("Ash"); + f->description = gettext("Ash"); content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_APPLE_BLOSSOM; @@ -504,7 +504,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_APPLE_BLOSSOM; f->texture = "apple_blossom.png"; f->name = "apple_blossom"; - f->description = wgettext("Apple Blossoms"); + f->description = gettext("Apple Blossoms"); f->consumable = true; f->sound_use = "use-eat"; f->hunger_effect = 10; @@ -517,7 +517,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_CACTUS_FRUIT; f->texture = "cactus_fruit.png^[forcesingle"; f->name = "cactus_fruit"; - f->description = wgettext("Cactus Berry"); + f->description = gettext("Cactus Berry"); f->consumable = true; f->sound_use = "use-eat"; f->hunger_effect = 30; @@ -530,7 +530,7 @@ void content_craftitem_init() f->texture = "mush.png"; f->name = "mush"; f->cook_result = CONTENT_CRAFTITEM_ASH; - f->description = wgettext("Mush"); + f->description = gettext("Mush"); f->consumable = true; f->sound_use = "use-eat"; f->health_effect = -5; @@ -541,7 +541,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_PUMPKINSLICE; f->texture = "pumpkin_slice.png"; f->name = "pumpkin_slice"; - f->description = wgettext("Sliced Pumpkin"); + f->description = gettext("Sliced Pumpkin"); f->consumable = true; f->sound_use = "use-eat"; f->hunger_effect = 30; @@ -555,7 +555,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_PUMPKIN_PIE_SLICE; f->texture = "pumpkin_pie_slice.png"; f->name = "pumpkin_pie_slice"; - f->description = wgettext("Pumpkin Pie Slice"); + f->description = gettext("Pumpkin Pie Slice"); f->consumable = true; f->sound_use = "use-eat"; f->hunger_effect = 60; @@ -567,7 +567,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_APPLE_PIE_SLICE; f->texture = "apple_pie_slice.png"; f->name = "apple_pie_slice"; - f->description = wgettext("Apple Pie Slice"); + f->description = gettext("Apple Pie Slice"); f->consumable = true; f->sound_use = "use-eat"; f->hunger_effect = 60; @@ -579,7 +579,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_MELONSLICE; f->texture = "melon_slice.png"; f->name = "melon_slice"; - f->description = wgettext("Sliced Melon"); + f->description = gettext("Sliced Melon"); f->consumable = true; f->sound_use = "use-eat"; f->hunger_effect = 40; @@ -593,7 +593,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_WHEAT; f->texture = "harvested_wheat.png"; f->name = "harvested_wheat"; - f->description = wgettext("Wheat"); + f->description = gettext("Wheat"); f->consumable = true; f->sound_use = "use-eat"; f->hunger_effect = 10; @@ -605,7 +605,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_FLOUR; f->texture = "flour.png"; f->name = "flour"; - f->description = wgettext("Flour"); + f->description = gettext("Flour"); f->consumable = true; f->sound_use = "use-eat"; f->hunger_effect = 10; @@ -619,7 +619,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_DOUGH; f->texture = "dough.png"; f->name = "dough"; - f->description = wgettext("Dough"); + f->description = gettext("Dough"); f->cook_result = CONTENT_CRAFTITEM_BREAD; f->consumable = true; f->sound_use = "use-eat"; @@ -635,7 +635,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_BREAD; f->texture = "bread.png"; f->name = "bread"; - f->description = wgettext("Bread"); + f->description = gettext("Bread"); f->consumable = true; f->sound_use = "use-eat"; f->hunger_effect = 50; @@ -647,7 +647,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_POTATO; f->texture = "harvested_potato.png"; f->name = "harvested_potato"; - f->description = wgettext("Potato"); + f->description = gettext("Potato"); f->cook_result = CONTENT_CRAFTITEM_ROASTPOTATO; f->consumable = true; f->sound_use = "use-eat"; @@ -661,7 +661,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_STARCH; f->texture = "potato_starch.png"; f->name = "potato_starch"; - f->description = wgettext("Potato Starch"); + f->description = gettext("Potato Starch"); crafting::set2Any2Recipe(CONTENT_CRAFTITEM_POTATO,CONTENT_CRAFTITEM_POTATO,CONTENT_CRAFTITEM_STARCH); content_list_add("craftguide",i,1,0); content_list_add("creative",i,1,0); @@ -671,7 +671,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_ROASTPOTATO; f->texture = "roast_potato.png"; f->name = "roast_potato"; - f->description = wgettext("Roast Potato"); + f->description = gettext("Roast Potato"); f->consumable = true; f->sound_use = "use-eat"; f->hunger_effect = 60; @@ -683,7 +683,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_CARROT; f->texture = "harvested_carrot.png"; f->name = "harvested_carrot"; - f->description = wgettext("Carrot"); + f->description = gettext("Carrot"); f->consumable = true; f->sound_use = "use-eat"; f->hunger_effect = 30; @@ -695,7 +695,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_CARROT_CAKE_RAW; f->texture = "carrot_cake_raw.png"; f->name = "carrot_cake_raw"; - f->description = wgettext("Raw Carrot Cake"); + f->description = gettext("Raw Carrot Cake"); f->cook_result = CONTENT_CRAFTITEM_CARROT_CAKE; f->consumable = true; f->sound_use = "use-eat"; @@ -710,7 +710,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_CARROT_CAKE; f->texture = "carrot_cake.png"; f->name = "carrot_cake"; - f->description = wgettext("Carrot Cake"); + f->description = gettext("Carrot Cake"); f->consumable = true; f->sound_use = "use-eat"; f->hunger_effect = 60; @@ -722,7 +722,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_BEETROOT; f->texture = "harvested_beetroot.png"; f->name = "harvested_beetroot"; - f->description = wgettext("Beetroot"); + f->description = gettext("Beetroot"); f->consumable = true; f->sound_use = "use-eat"; f->hunger_effect = 30; @@ -734,7 +734,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_GRAPE; f->texture = "harvested_grape.png"; f->name = "harvested_grape"; - f->description = wgettext("Bunch of Grapes"); + f->description = gettext("Bunch of Grapes"); f->consumable = true; f->sound_use = "use-eat"; f->hunger_effect = 30; @@ -746,7 +746,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_STRING; f->texture = "string.png"; f->name = "string"; - f->description = wgettext("String"); + f->description = gettext("String"); crafting::set1To4Recipe(CONTENT_COTTON,CONTENT_CRAFTITEM_STRING); content_list_add("craftguide",i,1,0); content_list_add("creative",i,1,0); @@ -756,7 +756,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_MITHRILDUST; f->texture = "mithril_dust.png"; f->name = "mese_dust"; - f->description = wgettext("Mithril Dust"); + f->description = gettext("Mithril Dust"); f->drop_count = 1; f->drop_item = CONTENT_CIRCUIT_MITHRILWIRE; crafting::set1To2Recipe(CONTENT_CRAFTITEM_MITHRIL_RAW,CONTENT_CRAFTITEM_MITHRILDUST); @@ -768,7 +768,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_RESIN; f->texture = "resin.png"; f->name = "lump_of_resin"; - f->description = wgettext("Resin"); + f->description = gettext("Resin"); f->drop_count = 1; content_list_add("cooking",i,1,0); content_list_add("creative",i,1,0); @@ -778,7 +778,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_OERKKI_DUST; f->texture = "oerkki_dust.png"; f->name = "oerkki_dust"; - f->description = wgettext("Oerkki Dust"); + f->description = gettext("Oerkki Dust"); f->drop_count = 1; f->teleports = PLAYERFLAG_HOME; // teleports player to default home location { @@ -797,7 +797,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_FISH; f->texture = "fish.png"; f->name = "fish"; - f->description = wgettext("Fish"); + f->description = gettext("Fish"); f->cook_result = CONTENT_CRAFTITEM_COOKED_FISH; f->drop_count = 1; f->drop_item = CONTENT_MOB_FISH; @@ -813,7 +813,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_COOKED_FISH; f->texture = "cooked_fish.png"; f->name = "cooked_fish"; - f->description = wgettext("Cooked Fish"); + f->description = gettext("Cooked Fish"); f->cook_result = CONTENT_CRAFTITEM_ASH; f->consumable = true; f->sound_use = "use-eat"; @@ -827,7 +827,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_MEAT; f->texture = "meat.png"; f->name = "meat"; - f->description = wgettext("Meat"); + f->description = gettext("Meat"); f->cook_result = CONTENT_CRAFTITEM_COOKED_MEAT; f->consumable = true; f->sound_use = "use-eat"; @@ -841,7 +841,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_COOKED_MEAT; f->texture = "cooked_meat.png"; f->name = "cooked_meat"; - f->description = wgettext("Cooked Meat"); + f->description = gettext("Cooked Meat"); f->cook_result = CONTENT_CRAFTITEM_ASH; f->consumable = true; f->sound_use = "use-eat"; @@ -855,7 +855,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_COTTON_SHEET; f->texture = "cotton_sheet.png"; f->name = "cotton_sheet"; - f->description = wgettext("Cotton Sheet"); + f->description = gettext("Cotton Sheet"); crafting::setRow2Recipe(CONTENT_CRAFTITEM_STRING,CONTENT_CRAFTITEM_COTTON_SHEET); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_STARCH,CONTENT_CRAFTITEM_COTTON_SHEET_BLUE,CONTENT_CRAFTITEM_COTTON_SHEET); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_STARCH,CONTENT_CRAFTITEM_COTTON_SHEET_GREEN,CONTENT_CRAFTITEM_COTTON_SHEET); @@ -872,7 +872,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_COTTON_SHEET_BLUE; f->texture = "cotton_sheet_blue.png"; f->name = "cotton_sheet_blue"; - f->description = wgettext("Blue Cotton Sheet"); + f->description = gettext("Blue Cotton Sheet"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_COTTON_SHEET,CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_CRAFTITEM_COTTON_SHEET_BLUE); content_list_add("craftguide",i,1,0); content_list_add("creative",i,1,0); @@ -882,7 +882,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_COTTON_SHEET_GREEN; f->texture = "cotton_sheet_green.png"; f->name = "cotton_sheet_green"; - f->description = wgettext("Green Cotton Sheet"); + f->description = gettext("Green Cotton Sheet"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_COTTON_SHEET,CONTENT_CRAFTITEM_DYE_GREEN,CONTENT_CRAFTITEM_COTTON_SHEET_GREEN); content_list_add("craftguide",i,1,0); content_list_add("creative",i,1,0); @@ -892,7 +892,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_COTTON_SHEET_ORANGE; f->texture = "cotton_sheet_orange.png"; f->name = "cotton_sheet_orange"; - f->description = wgettext("Orange Cotton Sheet"); + f->description = gettext("Orange Cotton Sheet"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_COTTON_SHEET,CONTENT_CRAFTITEM_DYE_ORANGE,CONTENT_CRAFTITEM_COTTON_SHEET_ORANGE); content_list_add("craftguide",i,1,0); content_list_add("creative",i,1,0); @@ -902,7 +902,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_COTTON_SHEET_PURPLE; f->texture = "cotton_sheet_purple.png"; f->name = "cotton_sheet_purple"; - f->description = wgettext("Purple Cotton Sheet"); + f->description = gettext("Purple Cotton Sheet"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_COTTON_SHEET,CONTENT_CRAFTITEM_DYE_PURPLE,CONTENT_CRAFTITEM_COTTON_SHEET_PURPLE); content_list_add("craftguide",i,1,0); content_list_add("creative",i,1,0); @@ -912,7 +912,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_COTTON_SHEET_RED; f->texture = "cotton_sheet_red.png"; f->name = "cotton_sheet_red"; - f->description = wgettext("Red Cotton Sheet"); + f->description = gettext("Red Cotton Sheet"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_COTTON_SHEET,CONTENT_CRAFTITEM_DYE_RED,CONTENT_CRAFTITEM_COTTON_SHEET_RED); content_list_add("craftguide",i,1,0); content_list_add("creative",i,1,0); @@ -922,7 +922,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_COTTON_SHEET_YELLOW; f->texture = "cotton_sheet_yellow.png"; f->name = "cotton_sheet_yellow"; - f->description = wgettext("Yellow Cotton Sheet"); + f->description = gettext("Yellow Cotton Sheet"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_COTTON_SHEET,CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_CRAFTITEM_COTTON_SHEET_YELLOW); content_list_add("craftguide",i,1,0); content_list_add("creative",i,1,0); @@ -932,7 +932,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_COTTON_SHEET_BLACK; f->texture = "cotton_sheet_black.png"; f->name = "cotton_sheet_black"; - f->description = wgettext("Black Cotton Sheet"); + f->description = gettext("Black Cotton Sheet"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_COTTON_SHEET,CONTENT_CRAFTITEM_DYE_BLACK,CONTENT_CRAFTITEM_COTTON_SHEET_BLACK); content_list_add("craftguide",i,1,0); content_list_add("creative",i,1,0); @@ -942,7 +942,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_CANVAS_SHEET; f->texture = "canvas_sheet.png"; f->name = "canvas_sheet"; - f->description = wgettext("Canvas Sheet"); + f->description = gettext("Canvas Sheet"); crafting::setCol2Recipe(CONTENT_CRAFTITEM_COTTON_SHEET,CONTENT_CRAFTITEM_CANVAS_SHEET); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_STARCH,CONTENT_CRAFTITEM_CANVAS_SHEET_BLUE,CONTENT_CRAFTITEM_CANVAS_SHEET); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_STARCH,CONTENT_CRAFTITEM_CANVAS_SHEET_GREEN,CONTENT_CRAFTITEM_CANVAS_SHEET); @@ -959,7 +959,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_CANVAS_SHEET_BLUE; f->texture = "canvas_sheet_blue.png"; f->name = "canvas_sheet_blue"; - f->description = wgettext("Blue Canvas Sheet"); + f->description = gettext("Blue Canvas Sheet"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_CANVAS_SHEET,CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_CRAFTITEM_CANVAS_SHEET_BLUE); content_list_add("craftguide",i,1,0); content_list_add("creative",i,1,0); @@ -969,7 +969,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_CANVAS_SHEET_GREEN; f->texture = "canvas_sheet_green.png"; f->name = "canvas_sheet_green"; - f->description = wgettext("Green Canvas Sheet"); + f->description = gettext("Green Canvas Sheet"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_CANVAS_SHEET,CONTENT_CRAFTITEM_DYE_GREEN,CONTENT_CRAFTITEM_CANVAS_SHEET_GREEN); content_list_add("craftguide",i,1,0); content_list_add("creative",i,1,0); @@ -979,7 +979,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_CANVAS_SHEET_ORANGE; f->texture = "canvas_sheet_orange.png"; f->name = "canvas_sheet_orange"; - f->description = wgettext("Orange Canvas Sheet"); + f->description = gettext("Orange Canvas Sheet"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_CANVAS_SHEET,CONTENT_CRAFTITEM_DYE_ORANGE,CONTENT_CRAFTITEM_CANVAS_SHEET_ORANGE); content_list_add("craftguide",i,1,0); content_list_add("creative",i,1,0); @@ -989,7 +989,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_CANVAS_SHEET_PURPLE; f->texture = "canvas_sheet_purple.png"; f->name = "canvas_sheet_purple"; - f->description = wgettext("Purple Canvas Sheet"); + f->description = gettext("Purple Canvas Sheet"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_CANVAS_SHEET,CONTENT_CRAFTITEM_DYE_PURPLE,CONTENT_CRAFTITEM_CANVAS_SHEET_PURPLE); content_list_add("craftguide",i,1,0); content_list_add("creative",i,1,0); @@ -999,7 +999,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_CANVAS_SHEET_RED; f->texture = "canvas_sheet_red.png"; f->name = "canvas_sheet_red"; - f->description = wgettext("Red Canvas Sheet"); + f->description = gettext("Red Canvas Sheet"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_CANVAS_SHEET,CONTENT_CRAFTITEM_DYE_RED,CONTENT_CRAFTITEM_CANVAS_SHEET_RED); content_list_add("craftguide",i,1,0); content_list_add("creative",i,1,0); @@ -1009,7 +1009,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_CANVAS_SHEET_YELLOW; f->texture = "canvas_sheet_yellow.png"; f->name = "canvas_sheet_yellow"; - f->description = wgettext("Yellow Canvas Sheet"); + f->description = gettext("Yellow Canvas Sheet"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_CANVAS_SHEET,CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_CRAFTITEM_CANVAS_SHEET_YELLOW); content_list_add("craftguide",i,1,0); content_list_add("creative",i,1,0); @@ -1019,7 +1019,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_CANVAS_SHEET_BLACK; f->texture = "canvas_sheet_black.png"; f->name = "canvas_sheet_black"; - f->description = wgettext("Black Canvas Sheet"); + f->description = gettext("Black Canvas Sheet"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_CANVAS_SHEET,CONTENT_CRAFTITEM_DYE_BLACK,CONTENT_CRAFTITEM_CANVAS_SHEET_BLACK); content_list_add("craftguide",i,1,0); content_list_add("creative",i,1,0); @@ -1029,7 +1029,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_FUR; f->texture = "fur.png"; f->name = "fur"; - f->description = wgettext("Fur"); + f->description = gettext("Fur"); content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_FUR_WHITE; @@ -1037,7 +1037,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_FUR_WHITE; f->texture = "fur_white.png"; f->name = "fur_white"; - f->description = wgettext("White Fur"); + f->description = gettext("White Fur"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FUR,CONTENT_CRAFTITEM_DYE_WHITE,CONTENT_CRAFTITEM_FUR_WHITE); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FUR,CONTENT_CRAFTITEM_STARCH,CONTENT_CRAFTITEM_FUR_WHITE); content_list_add("craftguide",i,1,0); @@ -1048,7 +1048,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_FUR_BLUE; f->texture = "fur_blue.png"; f->name = "fur_blue"; - f->description = wgettext("Blue Fur"); + f->description = gettext("Blue Fur"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FUR_WHITE,CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_CRAFTITEM_FUR_BLUE); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FUR,CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_CRAFTITEM_FUR_BLUE); content_list_add("craftguide",i,1,0); @@ -1059,7 +1059,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_FUR_GREEN; f->texture = "fur_green.png"; f->name = "fur_green"; - f->description = wgettext("Green Fur"); + f->description = gettext("Green Fur"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FUR_WHITE,CONTENT_CRAFTITEM_DYE_GREEN,CONTENT_CRAFTITEM_FUR_GREEN); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FUR,CONTENT_CRAFTITEM_DYE_GREEN,CONTENT_CRAFTITEM_FUR_GREEN); content_list_add("craftguide",i,1,0); @@ -1070,7 +1070,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_FUR_ORANGE; f->texture = "fur_orange.png"; f->name = "fur_orange"; - f->description = wgettext("Orange Fur"); + f->description = gettext("Orange Fur"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FUR_WHITE,CONTENT_CRAFTITEM_DYE_ORANGE,CONTENT_CRAFTITEM_FUR_ORANGE); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FUR,CONTENT_CRAFTITEM_DYE_ORANGE,CONTENT_CRAFTITEM_FUR_ORANGE); content_list_add("craftguide",i,1,0); @@ -1081,7 +1081,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_FUR_PURPLE; f->texture = "fur_purple.png"; f->name = "fur_purple"; - f->description = wgettext("Purple Fur"); + f->description = gettext("Purple Fur"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FUR_WHITE,CONTENT_CRAFTITEM_DYE_PURPLE,CONTENT_CRAFTITEM_FUR_PURPLE); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FUR,CONTENT_CRAFTITEM_DYE_PURPLE,CONTENT_CRAFTITEM_FUR_PURPLE); content_list_add("craftguide",i,1,0); @@ -1092,7 +1092,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_FUR_RED; f->texture = "fur_red.png"; f->name = "fur_red"; - f->description = wgettext("Red Fur"); + f->description = gettext("Red Fur"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FUR_WHITE,CONTENT_CRAFTITEM_DYE_RED,CONTENT_CRAFTITEM_FUR_RED); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FUR,CONTENT_CRAFTITEM_DYE_RED,CONTENT_CRAFTITEM_FUR_RED); content_list_add("craftguide",i,1,0); @@ -1103,7 +1103,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_FUR_YELLOW; f->texture = "fur_yellow.png"; f->name = "fur_yellow"; - f->description = wgettext("Yellow Fur"); + f->description = gettext("Yellow Fur"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FUR_WHITE,CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_CRAFTITEM_FUR_YELLOW); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FUR,CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_CRAFTITEM_FUR_YELLOW); content_list_add("craftguide",i,1,0); @@ -1114,7 +1114,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_FUR_BLACK; f->texture = "fur_black.png"; f->name = "fur_black"; - f->description = wgettext("Black Fur"); + f->description = gettext("Black Fur"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FUR_WHITE,CONTENT_CRAFTITEM_DYE_BLACK,CONTENT_CRAFTITEM_FUR_BLACK); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FUR,CONTENT_CRAFTITEM_DYE_BLACK,CONTENT_CRAFTITEM_FUR_BLACK); content_list_add("craftguide",i,1,0); @@ -1125,7 +1125,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_LEATHER; f->texture = "leather.png"; f->name = "leather"; - f->description = wgettext("Leather"); + f->description = gettext("Leather"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FUR,CONTENT_CRAFTITEM_ASH,CONTENT_CRAFTITEM_LEATHER); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FUR,CONTENT_CRAFTITEM_MUSH,CONTENT_CRAFTITEM_LEATHER); content_list_add("creative",i,1,0); @@ -1135,7 +1135,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_LEATHER_WHITE; f->texture = "leather_white.png"; f->name = "leather_white"; - f->description = wgettext("White Leather"); + f->description = gettext("White Leather"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_LEATHER,CONTENT_CRAFTITEM_DYE_WHITE,CONTENT_CRAFTITEM_LEATHER_WHITE); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_LEATHER,CONTENT_CRAFTITEM_STARCH,CONTENT_CRAFTITEM_LEATHER_WHITE); content_list_add("craftguide",i,1,0); @@ -1146,7 +1146,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_LEATHER_BLUE; f->texture = "leather_blue.png"; f->name = "leather_blue"; - f->description = wgettext("Blue Leather"); + f->description = gettext("Blue Leather"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_LEATHER_WHITE,CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_CRAFTITEM_LEATHER_BLUE); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_LEATHER,CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_CRAFTITEM_LEATHER_BLUE); content_list_add("craftguide",i,1,0); @@ -1157,7 +1157,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_LEATHER_GREEN; f->texture = "leather_green.png"; f->name = "leather_green"; - f->description = wgettext("Green Leather"); + f->description = gettext("Green Leather"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_LEATHER_WHITE,CONTENT_CRAFTITEM_DYE_GREEN,CONTENT_CRAFTITEM_LEATHER_GREEN); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_LEATHER,CONTENT_CRAFTITEM_DYE_GREEN,CONTENT_CRAFTITEM_LEATHER_GREEN); content_list_add("craftguide",i,1,0); @@ -1168,7 +1168,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_LEATHER_ORANGE; f->texture = "leather_orange.png"; f->name = "leather_orange"; - f->description = wgettext("Orange Leather"); + f->description = gettext("Orange Leather"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_LEATHER_WHITE,CONTENT_CRAFTITEM_DYE_ORANGE,CONTENT_CRAFTITEM_LEATHER_ORANGE); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_LEATHER,CONTENT_CRAFTITEM_DYE_ORANGE,CONTENT_CRAFTITEM_LEATHER_ORANGE); content_list_add("craftguide",i,1,0); @@ -1179,7 +1179,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_LEATHER_PURPLE; f->texture = "leather_purple.png"; f->name = "leather_purple"; - f->description = wgettext("Purple Leather"); + f->description = gettext("Purple Leather"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_LEATHER_WHITE,CONTENT_CRAFTITEM_DYE_PURPLE,CONTENT_CRAFTITEM_LEATHER_PURPLE); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_LEATHER,CONTENT_CRAFTITEM_DYE_PURPLE,CONTENT_CRAFTITEM_LEATHER_PURPLE); content_list_add("craftguide",i,1,0); @@ -1190,7 +1190,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_LEATHER_RED; f->texture = "leather_red.png"; f->name = "leather_red"; - f->description = wgettext("Red Leather"); + f->description = gettext("Red Leather"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_LEATHER_WHITE,CONTENT_CRAFTITEM_DYE_RED,CONTENT_CRAFTITEM_LEATHER_RED); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_LEATHER,CONTENT_CRAFTITEM_DYE_RED,CONTENT_CRAFTITEM_LEATHER_RED); content_list_add("craftguide",i,1,0); @@ -1201,7 +1201,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_LEATHER_YELLOW; f->texture = "leather_yellow.png"; f->name = "leather_yellow"; - f->description = wgettext("Yellow Leather"); + f->description = gettext("Yellow Leather"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_LEATHER_WHITE,CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_CRAFTITEM_LEATHER_YELLOW); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_LEATHER,CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_CRAFTITEM_LEATHER_YELLOW); content_list_add("craftguide",i,1,0); @@ -1212,7 +1212,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_LEATHER_BLACK; f->texture = "leather_black.png"; f->name = "leather_black"; - f->description = wgettext("Black Leather"); + f->description = gettext("Black Leather"); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_LEATHER_WHITE,CONTENT_CRAFTITEM_DYE_BLACK,CONTENT_CRAFTITEM_LEATHER_BLACK); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_LEATHER,CONTENT_CRAFTITEM_DYE_BLACK,CONTENT_CRAFTITEM_LEATHER_BLACK); content_list_add("craftguide",i,1,0); @@ -1223,7 +1223,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_ARROW; f->texture = "arrow.png"; f->name = "arrow"; - f->description = wgettext("Arrow"); + f->description = gettext("Arrow"); f->shot_item = CONTENT_MOB_ARROW; crafting::set1over4Recipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_CRAFTITEM_STICK,CONTENT_CRAFTITEM_ARROW); content_list_add("craftguide",i,1,0); @@ -1234,7 +1234,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_FERTILIZER; f->texture = "fertilizer_item.png"; f->name = "fertilizer"; - f->description = wgettext("Fertilizer"); + f->description = gettext("Fertilizer"); f->drop_count = 1; f->drop_item = CONTENT_FERTILIZER; crafting::set2Any2Recipe(CONTENT_CRAFTITEM_MUSH,CONTENT_CRAFTITEM_ASH,CONTENT_CRAFTITEM_FERTILIZER); @@ -1246,7 +1246,7 @@ void content_craftitem_init() f->content = i; f->texture = "oerkki_dust_white.png"; f->name = "oerkki_dust_white"; - f->description = wgettext("White Oerkki Dust"); + f->description = gettext("White Oerkki Dust"); f->drop_count = 1; f->teleports = PLAYERFLAG_WHITE; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_OERKKI_DUST,CONTENT_CRAFTITEM_DYE_WHITE,CONTENT_CRAFTITEM_OERKKI_DUST_WHITE); @@ -1258,7 +1258,7 @@ void content_craftitem_init() f->content = i; f->texture = "oerkki_dust_blue.png"; f->name = "oerkki_dust_blue"; - f->description = wgettext("Blue Oerkki Dust"); + f->description = gettext("Blue Oerkki Dust"); f->drop_count = 1; f->teleports = PLAYERFLAG_BLUE; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_OERKKI_DUST,CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_CRAFTITEM_OERKKI_DUST_BLUE); @@ -1270,7 +1270,7 @@ void content_craftitem_init() f->content = i; f->texture = "oerkki_dust_green.png"; f->name = "oerkki_dust_green"; - f->description = wgettext("Green Oerkki Dust"); + f->description = gettext("Green Oerkki Dust"); f->drop_count = 1; f->teleports = PLAYERFLAG_GREEN; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_OERKKI_DUST,CONTENT_CRAFTITEM_DYE_GREEN,CONTENT_CRAFTITEM_OERKKI_DUST_GREEN); @@ -1282,7 +1282,7 @@ void content_craftitem_init() f->content = i; f->texture = "oerkki_dust_orange.png"; f->name = "oerkki_dust_orange"; - f->description = wgettext("Orange Oerkki Dust"); + f->description = gettext("Orange Oerkki Dust"); f->drop_count = 1; f->teleports = PLAYERFLAG_ORANGE; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_OERKKI_DUST,CONTENT_CRAFTITEM_DYE_ORANGE,CONTENT_CRAFTITEM_OERKKI_DUST_ORANGE); @@ -1294,7 +1294,7 @@ void content_craftitem_init() f->content = i; f->texture = "oerkki_dust_purple.png"; f->name = "oerkki_dust_purple"; - f->description = wgettext("Purple Oerkki Dust"); + f->description = gettext("Purple Oerkki Dust"); f->drop_count = 1; f->teleports = PLAYERFLAG_PURPLE; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_OERKKI_DUST,CONTENT_CRAFTITEM_DYE_PURPLE,CONTENT_CRAFTITEM_OERKKI_DUST_PURPLE); @@ -1306,7 +1306,7 @@ void content_craftitem_init() f->content = i; f->texture = "oerkki_dust_red.png"; f->name = "oerkki_dust_red"; - f->description = wgettext("Red Oerkki Dust"); + f->description = gettext("Red Oerkki Dust"); f->drop_count = 1; f->teleports = PLAYERFLAG_RED; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_OERKKI_DUST,CONTENT_CRAFTITEM_DYE_RED,CONTENT_CRAFTITEM_OERKKI_DUST_RED); @@ -1318,7 +1318,7 @@ void content_craftitem_init() f->content = i; f->texture = "oerkki_dust_yellow.png"; f->name = "oerkki_dust_yellow"; - f->description = wgettext("Yellow Oerkki Dust"); + f->description = gettext("Yellow Oerkki Dust"); f->drop_count = 1; f->teleports = PLAYERFLAG_YELLOW; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_OERKKI_DUST,CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_CRAFTITEM_OERKKI_DUST_YELLOW); @@ -1330,7 +1330,7 @@ void content_craftitem_init() f->content = i; f->texture = "oerkki_dust_black.png"; f->name = "oerkki_dust_black"; - f->description = wgettext("Black Oerkki Dust"); + f->description = gettext("Black Oerkki Dust"); f->drop_count = 1; f->teleports = PLAYERFLAG_BLACK; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_OERKKI_DUST,CONTENT_CRAFTITEM_DYE_BLACK,CONTENT_CRAFTITEM_OERKKI_DUST_BLACK); @@ -1342,7 +1342,7 @@ void content_craftitem_init() f->content = i; f->texture = "glass_bottle.png"; f->name = "glass_bottle"; - f->description = wgettext("Glass Bottle"); + f->description = gettext("Glass Bottle"); f->drop_count = 1; { u16 r[9] = { @@ -1360,7 +1360,7 @@ void content_craftitem_init() f->content = i; f->texture = "drink_grape.png^glass_bottle.png"; f->name = "grape_juice"; - f->description = wgettext("Grape Juice"); + f->description = gettext("Grape Juice"); f->stackable = false; f->drop_count = 1; f->consumable = true; @@ -1378,7 +1378,7 @@ void content_craftitem_init() f->content = i; f->texture = "drink_apple.png^glass_bottle.png"; f->name = "apple_juice"; - f->description = wgettext("Apple Juice"); + f->description = gettext("Apple Juice"); f->stackable = false; f->drop_count = 1; f->consumable = true; @@ -1396,7 +1396,7 @@ void content_craftitem_init() f->content = i; f->texture = "tea_leaves.png"; f->name = "tea_leaves"; - f->description = wgettext("Tea Leaves"); + f->description = gettext("Tea Leaves"); f->drop_count = 1; f->consumable = true; f->sound_use = "use-eat"; @@ -1409,7 +1409,7 @@ void content_craftitem_init() f->content = i; f->texture = "steel_bottle.png^tea_bag.png"; f->name = "tea_drink"; - f->description = wgettext("Tea"); + f->description = gettext("Tea"); f->stackable = false; f->drop_count = 1; f->consumable = true; @@ -1428,7 +1428,7 @@ void content_craftitem_init() f->content = i; f->texture = "coffee_beans.png"; f->name = "coffee_beans"; - f->description = wgettext("Roasted Coffee Beans"); + f->description = gettext("Roasted Coffee Beans"); f->drop_count = 1; f->consumable = true; f->sound_use = "use-eat"; @@ -1442,7 +1442,7 @@ void content_craftitem_init() f->content = i; f->texture = "steel_bottle.png^coffee_bean.png"; f->name = "coffee_drink"; - f->description = wgettext("Coffee"); + f->description = gettext("Coffee"); f->stackable = false; f->drop_count = 1; f->consumable = true; @@ -1461,7 +1461,7 @@ void content_craftitem_init() f->content = i; f->texture = "steel_bottle.png"; f->name = "steel_bottle"; - f->description = wgettext("Steel Bottle"); + f->description = gettext("Steel Bottle"); f->drop_count = 1; { u16 r[9] = { @@ -1479,7 +1479,7 @@ void content_craftitem_init() f->content = i; f->texture = "drink_water.png^glass_bottle.png"; f->name = "water_drink"; - f->description = wgettext("Bottle of Water"); + f->description = gettext("Bottle of Water"); f->stackable = false; f->drop_count = 1; f->consumable = true; @@ -1494,7 +1494,7 @@ void content_craftitem_init() f->content = i; f->texture = "steel_bottle.png^water_droplet.png"; f->name = "hotwater_drink"; - f->description = wgettext("Bottle of Hot Water"); + f->description = gettext("Bottle of Hot Water"); f->stackable = false; f->drop_count = 1; f->consumable = true; @@ -1510,7 +1510,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_MITHRIL_RAW; f->texture = "mithril_raw.png"; f->name = "mithril_raw"; - f->description = wgettext("Raw Mithril"); + f->description = gettext("Raw Mithril"); f->cook_result = CONTENT_CRAFTITEM_MITHRIL_UNBOUND; f->cook_type = COOK_FURNACE; content_list_add("creative",i,1,0); @@ -1522,7 +1522,7 @@ void content_craftitem_init() f->texture = "mithril_unbound.png"; f->name = "mithril_unbound"; f->enchanted_item = CONTENT_CRAFTITEM_MITHRIL; - f->description = wgettext("Unbound Mithril"); + f->description = gettext("Unbound Mithril"); content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_MITHRIL; @@ -1531,7 +1531,7 @@ void content_craftitem_init() f->texture = "mithril_unbound.png"; f->name = "mithril_bound"; f->param_type = CPT_ENCHANTMENT; - f->description = wgettext("Mithril"); + f->description = gettext("Mithril"); f->overlay_base = "ingot_overlay"; content_list_add("creative",i,1,0); @@ -1540,7 +1540,7 @@ void content_craftitem_init() f->content = i; f->texture = "lump_of_ruby.png"; f->name = "lump_of_ruby"; - f->description = wgettext("Ruby"); + f->description = gettext("Ruby"); content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_TURQUOISE; @@ -1548,7 +1548,7 @@ void content_craftitem_init() f->content = i; f->texture = "lump_of_turquoise.png"; f->name = "lump_of_turquiose"; - f->description = wgettext("Turquiose"); + f->description = gettext("Turquiose"); content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_AMETHYST; @@ -1556,7 +1556,7 @@ void content_craftitem_init() f->content = i; f->texture = "lump_of_amethyst.png"; f->name = "lump_of_amethyst"; - f->description = wgettext("Amethyst"); + f->description = gettext("Amethyst"); content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_SAPPHIRE; @@ -1564,7 +1564,7 @@ void content_craftitem_init() f->content = i; f->texture = "lump_of_sapphire.png"; f->name = "lump_of_sapphire"; - f->description = wgettext("Sapphire"); + f->description = gettext("Sapphire"); content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_SUNSTONE; @@ -1572,7 +1572,7 @@ void content_craftitem_init() f->content = i; f->texture = "lump_of_sunstone.png"; f->name = "lump_of_sunstone"; - f->description = wgettext("Sunstone"); + f->description = gettext("Sunstone"); content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_SALT; @@ -1580,7 +1580,7 @@ void content_craftitem_init() f->content = i; f->texture = "salt.png"; f->name = "salt_dust"; - f->description = wgettext("Salt"); + f->description = gettext("Salt"); content_list_add("creative",i,1,0); i = CONTENT_CRAFTITEM_OERKKI_DUST_SPACE; @@ -1588,7 +1588,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_OERKKI_DUST_SPACE; f->texture = "oerkki_dust_space.png"; f->name = "oerkki_dust_space"; - f->description = wgettext("Space Dust"); + f->description = gettext("Space Dust"); f->drop_count = 1; f->teleports = PLAYERFLAG_JUMP; // teleports player up 1500 { @@ -1607,7 +1607,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_BLUEBERRY; f->texture = "harvested_blueberry.png"; f->name = "blueberry"; - f->description = wgettext("Blueberries"); + f->description = gettext("Blueberries"); f->consumable = true; f->sound_use = "use-eat"; f->hunger_effect = 10; @@ -1619,7 +1619,7 @@ void content_craftitem_init() f->content = CONTENT_CRAFTITEM_RASPBERRY; f->texture = "harvested_raspberry.png"; f->name = "raspberry"; - f->description = wgettext("Raspberries"); + f->description = gettext("Raspberries"); f->consumable = true; f->sound_use = "use-eat"; f->hunger_effect = 10; diff --git a/src/content_craftitem.h b/src/content_craftitem.h index 9a6a565..2562551 100644 --- a/src/content_craftitem.h +++ b/src/content_craftitem.h @@ -36,7 +36,7 @@ struct CraftItemFeatures { // the old 'subname' std::string name; // tooltip used in inventory - std::wstring description; + char* description; // the result of cooking this item content_t cook_result; // what type of cooking device this item needs @@ -76,32 +76,6 @@ struct CraftItemFeatures { content_t enchanted_item; // sound played when item is used std::string sound_use; - - CraftItemFeatures(): - content(CONTENT_IGNORE), - texture("unknown_item.png"), - overlay_base(""), - name(""), - description(L""), - cook_result(CONTENT_IGNORE), - cook_type(COOK_ANY), - fuel_time(0.0), - stackable(true), - consumable(false), - hunger_effect(0), - health_effect(0), - cold_effect(0), - energy_effect(0), - drop_count(-1), - teleports(-2), - param_type(CPT_NONE), - drop_item(CONTENT_IGNORE), - thrown_item(CONTENT_IGNORE), - shot_item(CONTENT_IGNORE), - onuse_replace_item(CONTENT_IGNORE), - enchanted_item(CONTENT_IGNORE), - sound_use("") - {} }; void content_craftitem_init(); diff --git a/src/content_mapnode.cpp b/src/content_mapnode.cpp index c7a9328..7feaac5 100644 --- a/src/content_mapnode.cpp +++ b/src/content_mapnode.cpp @@ -216,7 +216,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_STONE; f = &content_features(i); - f->description = wgettext("Stone"); + f->description = gettext("Stone"); f->setAllTextures("stone.png"); f->setInventoryTextureCube("stone.png", "stone.png", "stone.png"); f->param_type = CPT_MINERAL; @@ -231,7 +231,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_LIMESTONE; f = &content_features(i); - f->description = wgettext("Limestone"); + f->description = gettext("Limestone"); f->setAllTextures("limestone.png"); f->setInventoryTextureCube("limestone.png", "limestone.png", "limestone.png"); f->param_type = CPT_MINERAL; @@ -249,7 +249,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_SPACEROCK; f = &content_features(i); - f->description = wgettext("Space Rock"); + f->description = gettext("Space Rock"); f->setAllTextures("spacerock.png"); f->setInventoryTextureCube("spacerock.png", "spacerock.png", "spacerock.png"); f->param_type = CPT_MINERAL; @@ -262,7 +262,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_MARBLE; f = &content_features(i); - f->description = wgettext("Marble"); + f->description = gettext("Marble"); f->setAllTextures("marble.png"); f->setInventoryTextureCube("marble.png", "marble.png", "marble.png"); f->draw_type = CDT_CUBELIKE; @@ -273,7 +273,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_ROCK; f = &content_features(i); - f->description = wgettext("Rock"); + f->description = gettext("Rock"); f->setAllTextures("stone.png"); f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; f->type = CMT_DIRT; @@ -294,7 +294,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_ICE; f = &content_features(i); - f->description = wgettext("Ice"); + f->description = gettext("Ice"); f->setAllTextures("ice.png"); f->setInventoryTextureCube("ice.png", "ice.png", "ice.png"); f->draw_type = CDT_CUBELIKE; @@ -310,7 +310,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_COAL; f = &content_features(i); - f->description = wgettext("Coal Block"); + f->description = gettext("Coal Block"); f->setAllTextures("coal.png"); f->setInventoryTextureCube("coal.png", "coal.png", "coal.png"); f->draw_type = CDT_CUBELIKE; @@ -327,7 +327,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_CHARCOAL; f = &content_features(i); - f->description = wgettext("Charcoal Block"); + f->description = gettext("Charcoal Block"); f->setAllTextures("charcoal.png"); f->setInventoryTextureCube("charcoal.png", "charcoal.png", "charcoal.png"); f->draw_type = CDT_CUBELIKE; @@ -344,7 +344,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_STONEBRICK; f = &content_features(i); - f->description = wgettext("Stone Brick"); + f->description = gettext("Stone Brick"); f->setAllTextures("stonebrick.png"); f->setInventoryTextureCube("stonebrick.png", "stonebrick.png", "stonebrick.png"); f->draw_type = CDT_CUBELIKE; @@ -358,7 +358,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_STONEBLOCK; f = &content_features(i); - f->description = wgettext("Stone Block"); + f->description = gettext("Stone Block"); f->setAllTextures("stoneblock.png"); f->setInventoryTextureCube("stoneblock.png", "stoneblock.png", "stoneblock.png"); f->draw_type = CDT_CUBELIKE; @@ -372,7 +372,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_ROUGHSTONEBRICK; f = &content_features(i); - f->description = wgettext("Rough Stone Brick"); + f->description = gettext("Rough Stone Brick"); f->setAllTextures("roughstone_brick.png"); f->setInventoryTextureCube("roughstone_brick.png", "roughstone_brick.png", "roughstone_brick.png"); f->draw_type = CDT_CUBELIKE; @@ -390,7 +390,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_ROUGHSTONEBLOCK; f = &content_features(i); - f->description = wgettext("Rough Stone Block"); + f->description = gettext("Rough Stone Block"); f->setAllTextures("roughstone_block.png"); f->setInventoryTextureCube("roughstone_block.png", "roughstone_block.png", "roughstone_block.png"); f->draw_type = CDT_CUBELIKE; @@ -407,7 +407,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_GRASS; f = &content_features(i); - f->description = wgettext("Grass"); + f->description = gettext("Grass"); f->setAllTextures("mud.png^grass_side.png"); f->setTexture(0, "grass.png"); f->setTexture(1, "mud.png"); @@ -425,7 +425,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_GROWING_GRASS; f = &content_features(i); - f->description = wgettext("Growing Grass"); + f->description = gettext("Growing Grass"); f->setAllTextures("mud.png"); f->setTexture(0, "grass_growing.png"); f->setInventoryTextureCube("grass.png","mud.png","mud.png"); @@ -440,7 +440,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_GRASS_FOOTSTEPS; f = &content_features(i); - f->description = wgettext("Grass"); + f->description = gettext("Grass"); f->setAllTextures("mud.png^grass_side.png"); f->setTexture(0, "grass_footsteps.png"); f->setTexture(1, "mud.png"); @@ -454,7 +454,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_GRASS_AUTUMN; f = &content_features(i); - f->description = wgettext("Grass"); + f->description = gettext("Grass"); f->setAllTextures("mud.png^grass_side_autumn.png"); f->setTexture(0, "grass_autumn.png"); f->setTexture(1, "mud.png"); @@ -472,7 +472,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_GROWING_GRASS_AUTUMN; f = &content_features(i); - f->description = wgettext("Growing Grass"); + f->description = gettext("Growing Grass"); f->setAllTextures("mud.png"); f->setTexture(0, "grass_growing_autumn.png"); f->setInventoryTextureCube("grass_autumn.png","mud.png","mud.png"); @@ -487,7 +487,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_GRASS_FOOTSTEPS_AUTUMN; f = &content_features(i); - f->description = wgettext("Grass"); + f->description = gettext("Grass"); f->setAllTextures("mud.png^grass_side_autumn.png"); f->setTexture(0, "grass_footsteps_autumn.png"); f->setTexture(1, "mud.png"); @@ -501,7 +501,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_MUDSNOW; f = &content_features(i); - f->description = wgettext("Muddy Snow"); + f->description = gettext("Muddy Snow"); f->setAllTextures("mud.png^snow_side.png"); f->setTexture(0, "snow.png"); f->setTexture(1, "mud.png"); @@ -517,7 +517,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_MUD; f = &content_features(i); - f->description = wgettext("Mud"); + f->description = gettext("Mud"); f->setAllTextures("mud.png"); f->setTexture(0, "grass.png"); f->setInventoryTextureCube("mud.png", "mud.png", "mud.png"); @@ -536,7 +536,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_ASH; f = &content_features(i); - f->description = wgettext("Ash Block"); + f->description = gettext("Ash Block"); f->setAllTextures("ash.png"); f->setInventoryTextureCube("ash.png", "ash.png", "ash.png"); f->draw_type = CDT_CUBELIKE; @@ -551,7 +551,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_SAND; f = &content_features(i); - f->description = wgettext("Sand"); + f->description = gettext("Sand"); f->setAllTextures("sand.png"); f->setInventoryTextureCube("sand.png", "sand.png", "sand.png"); f->draw_type = CDT_CUBELIKE; @@ -571,7 +571,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_DESERT_SAND; f = &content_features(i); - f->description = wgettext("Desert Sand"); + f->description = gettext("Desert Sand"); f->setAllTextures("sand_desert.png"); f->setInventoryTextureCube("sand_desert.png", "sand_desert.png", "sand_desert.png"); f->draw_type = CDT_CUBELIKE; @@ -591,7 +591,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_GRAVEL; f = &content_features(i); - f->description = wgettext("Gravel"); + f->description = gettext("Gravel"); f->setAllTextures("gravel.png"); f->setInventoryTextureCube("gravel.png", "gravel.png", "gravel.png"); f->draw_type = CDT_CUBELIKE; @@ -608,7 +608,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_SANDSTONE; f = &content_features(i); - f->description = wgettext("Sand Stone"); + f->description = gettext("Sand Stone"); f->setAllTextures("sandstone.png"); f->setInventoryTextureCube("sandstone.png", "sandstone.png", "sandstone.png"); f->draw_type = CDT_CUBELIKE; @@ -623,7 +623,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_SANDSTONE_BRICK; f = &content_features(i); - f->description = wgettext("Sand Stone Bricks"); + f->description = gettext("Sand Stone Bricks"); f->setAllTextures("sandstone_brick.png"); f->setInventoryTextureCube("sandstone_brick.png", "sandstone_brick.png", "sandstone_brick.png"); f->draw_type = CDT_CUBELIKE; @@ -638,7 +638,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_SANDSTONE_BLOCK; f = &content_features(i); - f->description = wgettext("Sand Stone Blocks"); + f->description = gettext("Sand Stone Blocks"); f->setAllTextures("sandstone_block.png"); f->setInventoryTextureCube("sandstone_block.png", "sandstone_block.png", "sandstone_block.png"); f->draw_type = CDT_CUBELIKE; @@ -653,7 +653,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_CLAY; f = &content_features(i); - f->description = wgettext("Clay"); + f->description = gettext("Clay"); f->setAllTextures("clay.png"); f->setTexture(0,"grass.png"); f->setInventoryTextureCube("clay.png", "clay.png", "clay.png"); @@ -673,7 +673,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_CLAY_BLUE; f = &content_features(i); - f->description = wgettext("Blue Clay"); + f->description = gettext("Blue Clay"); f->setAllTextures("clay_blue.png"); f->setInventoryTextureCube("clay_blue.png", "clay_blue.png", "clay_blue.png"); f->draw_type = CDT_CUBELIKE; @@ -690,7 +690,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_CLAY_GREEN; f = &content_features(i); - f->description = wgettext("Green Clay"); + f->description = gettext("Green Clay"); f->setAllTextures("clay_green.png"); f->setInventoryTextureCube("clay_green.png", "clay_green.png", "clay_green.png"); f->draw_type = CDT_CUBELIKE; @@ -707,7 +707,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_CLAY_ORANGE; f = &content_features(i); - f->description = wgettext("Orange Clay"); + f->description = gettext("Orange Clay"); f->setAllTextures("clay_orange.png"); f->setInventoryTextureCube("clay_orange.png", "clay_orange.png", "clay_orange.png"); f->draw_type = CDT_CUBELIKE; @@ -724,7 +724,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_CLAY_PURPLE; f = &content_features(i); - f->description = wgettext("Purple Clay"); + f->description = gettext("Purple Clay"); f->setAllTextures("clay_purple.png"); f->setInventoryTextureCube("clay_purple.png", "clay_purple.png", "clay_purple.png"); f->draw_type = CDT_CUBELIKE; @@ -741,7 +741,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_CLAY_RED; f = &content_features(i); - f->description = wgettext("Red Clay"); + f->description = gettext("Red Clay"); f->setAllTextures("clay_red.png"); f->setInventoryTextureCube("clay_red.png", "clay_red.png", "clay_red.png"); f->draw_type = CDT_CUBELIKE; @@ -758,7 +758,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_CLAY_YELLOW; f = &content_features(i); - f->description = wgettext("Yellow Clay"); + f->description = gettext("Yellow Clay"); f->setAllTextures("clay_yellow.png"); f->setInventoryTextureCube("clay_yellow.png", "clay_yellow.png", "clay_yellow.png"); f->draw_type = CDT_CUBELIKE; @@ -775,7 +775,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_CLAY_BLACK; f = &content_features(i); - f->description = wgettext("Black Clay"); + f->description = gettext("Black Clay"); f->setAllTextures("clay_black.png"); f->setInventoryTextureCube("clay_black.png", "clay_black.png", "clay_black.png"); f->draw_type = CDT_CUBELIKE; @@ -792,7 +792,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_BRICK; f = &content_features(i); - f->description = wgettext("Brick"); + f->description = gettext("Brick"); f->setAllTextures("brick.png"); f->setTexture(0,"brick_top.png"); f->setTexture(1,"brick_bottom.png"); @@ -811,7 +811,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_TERRACOTTA; f = &content_features(i); - f->description = wgettext("Terracotta"); + f->description = gettext("Terracotta"); f->setAllTextures("terracotta.png"); f->setInventoryTextureCube("terracotta.png", "terracotta.png", "terracotta.png"); f->draw_type = CDT_CUBELIKE; @@ -823,7 +823,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_TERRACOTTA_BRICK; f = &content_features(i); - f->description = wgettext("Terracotta Brick"); + f->description = gettext("Terracotta Brick"); f->setAllTextures("terracotta_brick.png"); f->setInventoryTextureCube("terracotta_brick.png", "terracotta_brick.png", "terracotta_brick.png"); f->draw_type = CDT_CUBELIKE; @@ -837,7 +837,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_TERRACOTTA_BLOCK; f = &content_features(i); - f->description = wgettext("Terracotta Block"); + f->description = gettext("Terracotta Block"); f->setAllTextures("terracotta_block.png"); f->setInventoryTextureCube("terracotta_block.png", "terracotta_block.png", "terracotta_block.png"); f->draw_type = CDT_CUBELIKE; @@ -851,7 +851,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_TERRACOTTA_TILE; f = &content_features(i); - f->description = wgettext("Terracotta Tile"); + f->description = gettext("Terracotta Tile"); f->setAllTextures("terracotta_tile.png"); f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; f->type = CMT_STONE; @@ -870,7 +870,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_GLASS; f = &content_features(i); - f->description = wgettext("Glass"); + f->description = gettext("Glass"); f->light_propagates = true; f->sunlight_propagates = true; f->param_type = CPT_LIGHT; @@ -888,7 +888,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_GLASS_BLUE; f = &content_features(i); - f->description = wgettext("Blue Glass"); + f->description = gettext("Blue Glass"); f->light_propagates = true; f->sunlight_propagates = true; f->param_type = CPT_LIGHT; @@ -908,7 +908,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_GLASS_GREEN; f = &content_features(i); - f->description = wgettext("Green Glass"); + f->description = gettext("Green Glass"); f->light_propagates = true; f->sunlight_propagates = true; f->param_type = CPT_LIGHT; @@ -928,7 +928,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_GLASS_ORANGE; f = &content_features(i); - f->description = wgettext("Orange Glass"); + f->description = gettext("Orange Glass"); f->light_propagates = true; f->sunlight_propagates = true; f->param_type = CPT_LIGHT; @@ -948,7 +948,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_GLASS_PURPLE; f = &content_features(i); - f->description = wgettext("Purple Glass"); + f->description = gettext("Purple Glass"); f->light_propagates = true; f->sunlight_propagates = true; f->param_type = CPT_LIGHT; @@ -968,7 +968,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_GLASS_RED; f = &content_features(i); - f->description = wgettext("Red Glass"); + f->description = gettext("Red Glass"); f->light_propagates = true; f->sunlight_propagates = true; f->param_type = CPT_LIGHT; @@ -988,7 +988,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_GLASS_YELLOW; f = &content_features(i); - f->description = wgettext("Yellow Glass"); + f->description = gettext("Yellow Glass"); f->light_propagates = true; f->sunlight_propagates = true; f->param_type = CPT_LIGHT; @@ -1008,7 +1008,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_GLASS_BLACK; f = &content_features(i); - f->description = wgettext("Black Glass"); + f->description = gettext("Black Glass"); f->light_propagates = true; f->sunlight_propagates = true; f->param_type = CPT_LIGHT; @@ -1028,7 +1028,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_GLASS_PANE; f = &content_features(i); - f->description = wgettext("Glass Pane"); + f->description = gettext("Glass Pane"); f->param2_type = CPT_FACEDIR_SIMPLE; f->param_type = CPT_LIGHT; f->light_propagates = true; @@ -1061,7 +1061,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_GLASS_PANE_BLUE; f = &content_features(i); - f->description = wgettext("Blue Glass Pane"); + f->description = gettext("Blue Glass Pane"); f->param2_type = CPT_FACEDIR_SIMPLE; f->param_type = CPT_LIGHT; f->light_propagates = true; @@ -1095,7 +1095,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_GLASS_PANE_GREEN; f = &content_features(i); - f->description = wgettext("Green Glass Pane"); + f->description = gettext("Green Glass Pane"); f->param2_type = CPT_FACEDIR_SIMPLE; f->param_type = CPT_LIGHT; f->light_propagates = true; @@ -1129,7 +1129,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_GLASS_PANE_ORANGE; f = &content_features(i); - f->description = wgettext("Orange Glass Pane"); + f->description = gettext("Orange Glass Pane"); f->param2_type = CPT_FACEDIR_SIMPLE; f->param_type = CPT_LIGHT; f->light_propagates = true; @@ -1163,7 +1163,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_GLASS_PANE_PURPLE; f = &content_features(i); - f->description = wgettext("Purple Glass Pane"); + f->description = gettext("Purple Glass Pane"); f->param2_type = CPT_FACEDIR_SIMPLE; f->param_type = CPT_LIGHT; f->light_propagates = true; @@ -1197,7 +1197,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_GLASS_PANE_RED; f = &content_features(i); - f->description = wgettext("Red Glass Pane"); + f->description = gettext("Red Glass Pane"); f->param2_type = CPT_FACEDIR_SIMPLE; f->param_type = CPT_LIGHT; f->light_propagates = true; @@ -1231,7 +1231,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_GLASS_PANE_YELLOW; f = &content_features(i); - f->description = wgettext("Yellow Glass Pane"); + f->description = gettext("Yellow Glass Pane"); f->param2_type = CPT_FACEDIR_SIMPLE; f->param_type = CPT_LIGHT; f->light_propagates = true; @@ -1265,7 +1265,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_GLASS_PANE_BLACK; f = &content_features(i); - f->description = wgettext("Black Glass Pane"); + f->description = gettext("Black Glass Pane"); f->param2_type = CPT_FACEDIR_SIMPLE; f->param_type = CPT_LIGHT; f->light_propagates = true; @@ -1299,7 +1299,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_GLASSLIGHT; f = &content_features(i); - f->description = wgettext("Glass Light"); + f->description = gettext("Glass Light"); f->light_propagates = true; f->sunlight_propagates = true; f->param_type = CPT_LIGHT; @@ -1320,7 +1320,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_WOOD; f = &content_features(i); - f->description = wgettext("Wood"); + f->description = gettext("Wood"); f->setAllTextures("wood.png"); f->setInventoryTextureCube("wood.png", "wood.png", "wood.png"); f->draw_type = CDT_CUBELIKE; @@ -1346,7 +1346,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_JUNGLEWOOD; f = &content_features(i); - f->description = wgettext("Jungle Wood"); + f->description = gettext("Jungle Wood"); f->setAllTextures("junglewood.png"); f->setInventoryTextureCube("junglewood.png", "junglewood.png", "junglewood.png"); f->draw_type = CDT_CUBELIKE; @@ -1371,7 +1371,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_WOOD_PINE; f = &content_features(i); - f->description = wgettext("Pine"); + f->description = gettext("Pine"); f->setAllTextures("pine.png"); f->setInventoryTextureCube("pine.png", "pine.png", "pine.png"); f->draw_type = CDT_CUBELIKE; @@ -1396,7 +1396,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_SPONGE; f = &content_features(i); - f->description = wgettext("Sponge"); + f->description = gettext("Sponge"); f->setAllTextures("sponge.png"); f->setInventoryTextureCube("sponge.png", "sponge.png", "sponge.png"); f->draw_type = CDT_CUBELIKE; @@ -1411,7 +1411,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_SPONGE_FULL; f = &content_features(i); - f->description = wgettext("Waterlogged Sponge"); + f->description = gettext("Waterlogged Sponge"); f->setAllTextures("sponge_full.png"); f->setInventoryTextureCube("sponge_full.png", "sponge_full.png", "sponge_full.png"); f->draw_type = CDT_CUBELIKE; @@ -1426,7 +1426,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_HAY; f = &content_features(i); - f->description = wgettext("Hay Bale"); + f->description = gettext("Hay Bale"); f->setAllTextures("hay_bale.png"); f->setInventoryTextureCube("hay_bale.png", "hay_bale.png", "hay_bale.png"); f->draw_type = CDT_CUBELIKE; @@ -1443,7 +1443,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_APPLE_PIE_RAW; f = &content_features(i); - f->description = wgettext("Raw Apple Pie"); + f->description = gettext("Raw Apple Pie"); f->setTexture(0, "apple_pie_raw.png"); f->setTexture(1, "apple_pie_raw.png"); f->setTexture(2, "apple_pie_raw.png"); @@ -1471,7 +1471,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_APPLE_PIE; f = &content_features(i); - f->description = wgettext("Apple Pie"); + f->description = gettext("Apple Pie"); f->setTexture(0, "apple_pie.png"); f->setTexture(1, "apple_pie.png"); f->setTexture(2, "apple_pie.png"); @@ -1562,7 +1562,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_PUMPKIN_PIE_RAW; f = &content_features(i); - f->description = wgettext("Raw Pumpkin Pie"); + f->description = gettext("Raw Pumpkin Pie"); f->setTexture(0, "pumpkin_pie_raw.png"); f->setTexture(1, "pumpkin_pie_raw.png"); f->setTexture(2, "pumpkin_pie_raw.png"); @@ -1590,7 +1590,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_PUMPKIN_PIE; f = &content_features(i); - f->description = wgettext("Pumpkin Pie"); + f->description = gettext("Pumpkin Pie"); f->setTexture(0, "pumpkin_pie.png"); f->setTexture(1, "pumpkin_pie.png"); f->setTexture(2, "pumpkin_pie.png"); @@ -1681,7 +1681,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_SNOW_BLOCK; f = &content_features(i); - f->description = wgettext("Snow"); + f->description = gettext("Snow"); f->setAllTextures("snow.png"); f->setInventoryTextureCube("snow.png", "snow.png", "snow.png"); f->draw_type = CDT_CUBELIKE; @@ -1697,7 +1697,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_SNOWMAN; f = &content_features(i); - f->description = wgettext("Snowman"); + f->description = gettext("Snowman"); f->param2_type = CPT_FACEDIR_SIMPLE; f->setAllTextures("snowman.png"); f->setTexture(0,"snowman_top.png"); @@ -1759,7 +1759,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_SNOW; f = &content_features(i); - f->description = wgettext("Snow"); + f->description = gettext("Snow"); f->setAllTextures("snow.png"); f->param_type = CPT_LIGHT; f->draw_type = CDT_NODEBOX; @@ -1782,7 +1782,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_COTTON; f = &content_features(i); - f->description = wgettext("Cotton"); + f->description = gettext("Cotton"); f->setAllTextures("cotton.png"); f->setInventoryTextureCube("cotton.png", "cotton.png", "cotton.png"); f->draw_type = CDT_CUBELIKE; @@ -1813,7 +1813,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_COTTON_BLUE; f = &content_features(i); - f->description = wgettext("Blue Cotton"); + f->description = gettext("Blue Cotton"); f->setAllTextures("cotton_blue.png"); f->setInventoryTextureCube("cotton_blue.png", "cotton_blue.png", "cotton_blue.png"); f->draw_type = CDT_CUBELIKE; @@ -1830,7 +1830,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_COTTON_GREEN; f = &content_features(i); - f->description = wgettext("Green Cotton"); + f->description = gettext("Green Cotton"); f->setAllTextures("cotton_green.png"); f->setInventoryTextureCube("cotton_green.png", "cotton_green.png", "cotton_green.png"); f->draw_type = CDT_CUBELIKE; @@ -1847,7 +1847,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_COTTON_ORANGE; f = &content_features(i); - f->description = wgettext("Orange Cotton"); + f->description = gettext("Orange Cotton"); f->setAllTextures("cotton_orange.png"); f->setInventoryTextureCube("cotton_orange.png", "cotton_orange.png", "cotton_orange.png"); f->draw_type = CDT_CUBELIKE; @@ -1864,7 +1864,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_COTTON_PURPLE; f = &content_features(i); - f->description = wgettext("Purple Cotton"); + f->description = gettext("Purple Cotton"); f->setAllTextures("cotton_purple.png"); f->setInventoryTextureCube("cotton_purple.png", "cotton_purple.png", "cotton_purple.png"); f->draw_type = CDT_CUBELIKE; @@ -1881,7 +1881,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_COTTON_RED; f = &content_features(i); - f->description = wgettext("Red Cotton"); + f->description = gettext("Red Cotton"); f->setAllTextures("cotton_red.png"); f->setInventoryTextureCube("cotton_red.png", "cotton_red.png", "cotton_red.png"); f->draw_type = CDT_CUBELIKE; @@ -1898,7 +1898,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_COTTON_YELLOW; f = &content_features(i); - f->description = wgettext("Yellow Cotton"); + f->description = gettext("Yellow Cotton"); f->setAllTextures("cotton_yellow.png"); f->setInventoryTextureCube("cotton_yellow.png", "cotton_yellow.png", "cotton_yellow.png"); f->draw_type = CDT_CUBELIKE; @@ -1915,7 +1915,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_COTTON_BLACK; f = &content_features(i); - f->description = wgettext("Black Cotton"); + f->description = gettext("Black Cotton"); f->setAllTextures("cotton_black.png"); f->setInventoryTextureCube("cotton_black.png", "cotton_black.png", "cotton_black.png"); f->draw_type = CDT_CUBELIKE; @@ -1932,7 +1932,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_CARPET; f = &content_features(i); - f->description = wgettext("Carpet"); + f->description = gettext("Carpet"); f->setAllTextures("cotton.png"); f->param_type = CPT_LIGHT; f->draw_type = CDT_NODEBOX; @@ -1954,7 +1954,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_CARPET_BLUE; f = &content_features(i); - f->description = wgettext("Blue Carpet"); + f->description = gettext("Blue Carpet"); f->setAllTextures("cotton_blue.png"); f->param_type = CPT_LIGHT; f->draw_type = CDT_NODEBOX; @@ -1977,7 +1977,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_CARPET_GREEN; f = &content_features(i); - f->description = wgettext("Green Carpet"); + f->description = gettext("Green Carpet"); f->setAllTextures("cotton_green.png"); f->param_type = CPT_LIGHT; f->draw_type = CDT_NODEBOX; @@ -2000,7 +2000,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_CARPET_ORANGE; f = &content_features(i); - f->description = wgettext("Orange Carpet"); + f->description = gettext("Orange Carpet"); f->setAllTextures("cotton_orange.png"); f->param_type = CPT_LIGHT; f->draw_type = CDT_NODEBOX; @@ -2023,7 +2023,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_CARPET_PURPLE; f = &content_features(i); - f->description = wgettext("Purple Carpet"); + f->description = gettext("Purple Carpet"); f->setAllTextures("cotton_purple.png"); f->param_type = CPT_LIGHT; f->draw_type = CDT_NODEBOX; @@ -2046,7 +2046,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_CARPET_RED; f = &content_features(i); - f->description = wgettext("Red Carpet"); + f->description = gettext("Red Carpet"); f->setAllTextures("cotton_red.png"); f->param_type = CPT_LIGHT; f->draw_type = CDT_NODEBOX; @@ -2069,7 +2069,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_CARPET_YELLOW; f = &content_features(i); - f->description = wgettext("Yellow Carpet"); + f->description = gettext("Yellow Carpet"); f->setAllTextures("cotton_yellow.png"); f->param_type = CPT_LIGHT; f->draw_type = CDT_NODEBOX; @@ -2092,7 +2092,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_CARPET_BLACK; f = &content_features(i); - f->description = wgettext("Black Carpet"); + f->description = gettext("Black Carpet"); f->setAllTextures("cotton_black.png"); f->param_type = CPT_LIGHT; f->draw_type = CDT_NODEBOX; @@ -2115,7 +2115,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_AIR; f = &content_features(i); - f->description = wgettext("Air"); + f->description = gettext("Air"); f->param_type = CPT_LIGHT; f->draw_type = CDT_AIRLIKE; f->light_propagates = true; @@ -2130,7 +2130,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_VACUUM; f = &content_features(i); - f->description = wgettext("Vacuum"); + f->description = gettext("Vacuum"); f->param_type = CPT_LIGHT; f->draw_type = CDT_AIRLIKE; f->light_propagates = true; @@ -2146,7 +2146,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_WATER; f = &content_features(i); - f->description = wgettext("Water"); + f->description = gettext("Water"); f->setAllTextures("water.png"); f->setInventoryTextureCube("water.png", "water.png", "water.png"); f->param_type = CPT_LIGHT; @@ -2176,7 +2176,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_WATERSOURCE; f = &content_features(i); - f->description = wgettext("Water"); + f->description = gettext("Water"); f->setAllTextures("water.png"); f->setInventoryTextureCube("water.png", "water.png", "water.png"); f->param_type = CPT_LIGHT; @@ -2207,7 +2207,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_LAVA; f = &content_features(i); - f->description = wgettext("Lava"); + f->description = gettext("Lava"); f->setAllTextures("lava.png"); f->setInventoryTextureCube("lava.png", "lava.png", "lava.png"); f->param_type = CPT_LIGHT; @@ -2236,7 +2236,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_LAVASOURCE; f = &content_features(i); - f->description = wgettext("Lava"); + f->description = gettext("Lava"); f->setAllTextures("lava.png"); f->setInventoryTextureCube("lava.png", "lava.png", "lava.png"); f->param_type = CPT_LIGHT; @@ -2269,7 +2269,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_ROUGHSTONE; f = &content_features(i); - f->description = wgettext("Rough Stone"); + f->description = gettext("Rough Stone"); f->setAllTextures("roughstone.png"); f->setInventoryTextureCube("roughstone.png", "roughstone.png", "roughstone.png"); f->param_type = CPT_NONE; @@ -2287,7 +2287,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_COBBLE; f = &content_features(i); - f->description = wgettext("Cobble Stone"); + f->description = gettext("Cobble Stone"); f->setAllTextures("cobble.png"); f->setInventoryTextureCube("cobble.png", "cobble.png", "cobble.png"); f->param_type = CPT_NONE; @@ -2303,7 +2303,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_MOSSYCOBBLE; f = &content_features(i); - f->description = wgettext("Mossy Cobble Stone"); + f->description = gettext("Mossy Cobble Stone"); f->setAllTextures("mossycobble.png"); f->setInventoryTextureCube("mossycobble.png", "mossycobble.png", "mossycobble.png"); f->param_type = CPT_NONE; @@ -2316,7 +2316,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_STEEL; f = &content_features(i); - f->description = wgettext("Steel Block"); + f->description = gettext("Steel Block"); f->setAllTextures("steel_block.png"); f->setInventoryTextureCube("steel_block.png", "steel_block.png", "steel_block.png"); f->param_type = CPT_NONE; @@ -2333,7 +2333,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_MITHRIL_BLOCK; f = &content_features(i); - f->description = wgettext("Mithril Block"); + f->description = gettext("Mithril Block"); f->setAllTextures("mithril_block.png"); f->setInventoryTextureCube("mithril_block.png", "mithril_block.png", "mithril_block.png"); f->param_type = CPT_NONE; @@ -2349,16 +2349,16 @@ void content_mapnode_init(bool repeat) content_list_add("craftguide",i,1,0); content_list_add("creative",i,1,0); - content_nodedef_knob(CONTENT_STONE_KNOB, CONTENT_STONE, CMT_STONE, "stone.png", wgettext("Stone Knob")); - content_nodedef_knob(CONTENT_ROUGHSTONE_KNOB, CONTENT_ROUGHSTONE, CMT_STONE, "roughstone.png", wgettext("Rough Stone Knob")); - content_nodedef_knob(CONTENT_SANDSTONE_KNOB, CONTENT_SANDSTONE, CMT_STONE, "sandstone.png", wgettext("Sandstone Knob")); - content_nodedef_knob(CONTENT_WOOD_KNOB, CONTENT_CRAFTITEM_WOOD_PLANK, CMT_WOOD, "wood.png", wgettext("Wooden Knob")); - content_nodedef_knob(CONTENT_JUNGLEWOOD_KNOB, CONTENT_CRAFTITEM_JUNGLE_PLANK, CMT_WOOD, "junglewood.png", wgettext("Junglewood Knob")); - content_nodedef_knob(CONTENT_PINE_KNOB, CONTENT_CRAFTITEM_PINE_PLANK, CMT_WOOD, "pine.png", wgettext("Pine Knob")); + content_nodedef_knob(CONTENT_STONE_KNOB, CONTENT_STONE, CMT_STONE, "stone.png", gettext("Stone Knob")); + content_nodedef_knob(CONTENT_ROUGHSTONE_KNOB, CONTENT_ROUGHSTONE, CMT_STONE, "roughstone.png", gettext("Rough Stone Knob")); + content_nodedef_knob(CONTENT_SANDSTONE_KNOB, CONTENT_SANDSTONE, CMT_STONE, "sandstone.png", gettext("Sandstone Knob")); + content_nodedef_knob(CONTENT_WOOD_KNOB, CONTENT_CRAFTITEM_WOOD_PLANK, CMT_WOOD, "wood.png", gettext("Wooden Knob")); + content_nodedef_knob(CONTENT_JUNGLEWOOD_KNOB, CONTENT_CRAFTITEM_JUNGLE_PLANK, CMT_WOOD, "junglewood.png", gettext("Junglewood Knob")); + content_nodedef_knob(CONTENT_PINE_KNOB, CONTENT_CRAFTITEM_PINE_PLANK, CMT_WOOD, "pine.png", gettext("Pine Knob")); i = CONTENT_COPPER; f = &content_features(i); - f->description = wgettext("Copper Block"); + f->description = gettext("Copper Block"); f->setAllTextures("copper_block.png"); f->setInventoryTextureCube("copper_block.png", "copper_block.png", "copper_block.png"); f->param_type = CPT_NONE; @@ -2375,7 +2375,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_GOLD; f = &content_features(i); - f->description = wgettext("Gold Block"); + f->description = gettext("Gold Block"); f->setAllTextures("gold_block.png"); f->setInventoryTextureCube("gold_block.png", "gold_block.png", "gold_block.png"); f->param_type = CPT_NONE; @@ -2392,7 +2392,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_SILVER; f = &content_features(i); - f->description = wgettext("Silver Block"); + f->description = gettext("Silver Block"); f->setAllTextures("silver_block.png"); f->setInventoryTextureCube("silver_block.png", "silver_block.png", "silver_block.png"); f->param_type = CPT_NONE; @@ -2409,7 +2409,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_TIN; f = &content_features(i); - f->description = wgettext("Tin Block"); + f->description = gettext("Tin Block"); f->setAllTextures("tin_block.png"); f->setInventoryTextureCube("tin_block.png", "tin_block.png", "tin_block.png"); f->param_type = CPT_NONE; @@ -2426,7 +2426,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_QUARTZ; f = &content_features(i); - f->description = wgettext("Quartz Block"); + f->description = gettext("Quartz Block"); f->setAllTextures("quartz_block.png"); f->setInventoryTextureCube("quartz_block.png", "quartz_block.png", "quartz_block.png"); f->param_type = CPT_NONE; @@ -2443,7 +2443,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_STONE_TILE; f = &content_features(i); - f->description = wgettext("Stone Tiles"); + f->description = gettext("Stone Tiles"); f->setAllTextures("stone_tile.png"); f->param_type = CPT_LIGHT; f->draw_type = CDT_NODEBOX; @@ -2463,7 +2463,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_WOOD_TILE; f = &content_features(i); - f->description = wgettext("Wood Tiles"); + f->description = gettext("Wood Tiles"); f->setAllTextures("wood_tile.png"); f->param_type = CPT_LIGHT; f->draw_type = CDT_NODEBOX; @@ -2485,7 +2485,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_STONE_COLUMN_SQUARE; f = &content_features(i); - f->description = wgettext("Stone Column"); + f->description = gettext("Stone Column"); f->setAllTextures("stone.png"); f->param_type = CPT_LIGHT; f->draw_type = CDT_NODEBOX; @@ -2542,7 +2542,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_LIMESTONE_COLUMN_SQUARE; f = &content_features(i); - f->description = wgettext("Limestone Column"); + f->description = gettext("Limestone Column"); f->setAllTextures("limestone.png"); f->param_type = CPT_LIGHT; f->draw_type = CDT_NODEBOX; @@ -2599,7 +2599,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_MARBLE_COLUMN_SQUARE; f = &content_features(i); - f->description = wgettext("Marble Column"); + f->description = gettext("Marble Column"); f->setAllTextures("marble.png"); f->param_type = CPT_LIGHT; f->draw_type = CDT_NODEBOX; @@ -2656,7 +2656,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_SANDSTONE_COLUMN_SQUARE; f = &content_features(i); - f->description = wgettext("Sandstone Column"); + f->description = gettext("Sandstone Column"); f->setAllTextures("sandstone.png"); f->param_type = CPT_LIGHT; f->draw_type = CDT_NODEBOX; @@ -2714,7 +2714,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_BRICK_COLUMN_SQUARE; f = &content_features(i); - f->description = wgettext("Brick Column"); + f->description = gettext("Brick Column"); f->setAllTextures("brick.png"); f->param_type = CPT_LIGHT; f->draw_type = CDT_NODEBOX; @@ -2769,7 +2769,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_WOOD_COLUMN_SQUARE; f = &content_features(i); - f->description = wgettext("Wood Column"); + f->description = gettext("Wood Column"); f->setAllTextures("wood.png"); f->param_type = CPT_LIGHT; f->draw_type = CDT_NODEBOX; @@ -2830,7 +2830,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_JUNGLEWOOD_COLUMN_SQUARE; f = &content_features(i); - f->description = wgettext("Jungle Wood Column"); + f->description = gettext("Jungle Wood Column"); f->setAllTextures("junglewood.png"); f->param_type = CPT_LIGHT; f->draw_type = CDT_NODEBOX; @@ -2891,7 +2891,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_WOOD_PINE_COLUMN_SQUARE; f = &content_features(i); - f->description = wgettext("Pine Wood Column"); + f->description = gettext("Pine Wood Column"); f->setAllTextures("pine.jpg"); f->param_type = CPT_LIGHT; f->draw_type = CDT_NODEBOX; @@ -2952,7 +2952,7 @@ void content_mapnode_init(bool repeat) i = CONTENT_ROUGHSTONE_COLUMN_SQUARE; f = &content_features(i); - f->description = wgettext("Rough Stone Column"); + f->description = gettext("Rough Stone Column"); f->setAllTextures("roughstone.png"); f->param_type = CPT_LIGHT; f->draw_type = CDT_NODEBOX; diff --git a/src/content_mapnode_circuit.cpp b/src/content_mapnode_circuit.cpp index 434fcf0..80c0015 100644 --- a/src/content_mapnode_circuit.cpp +++ b/src/content_mapnode_circuit.cpp @@ -33,7 +33,7 @@ void content_mapnode_circuit(bool repeat) i = CONTENT_CIRCUIT_MITHRILWIRE; f = &content_features(i); - f->description = wgettext("Mithril Wire"); + f->description = gettext("Mithril Wire"); f->setAllTextures("mithril_wire.png"); f->setAllTextureFlags(0); f->param_type = CPT_LIGHT; @@ -56,7 +56,7 @@ void content_mapnode_circuit(bool repeat) i = CONTENT_CIRCUIT_COPPERWIRE; f = &content_features(i); - f->description = wgettext("Copper Wire"); + f->description = gettext("Copper Wire"); f->setAllTextures("copper_wire.png"); f->setInventoryTexture("copper_wire_inv.png"); f->param_type = CPT_LIGHT; @@ -87,7 +87,7 @@ void content_mapnode_circuit(bool repeat) i = CONTENT_CIRCUIT_REACTOR; f = &content_features(i); - f->description = wgettext("Reactor"); + f->description = gettext("Reactor"); f->setAllTextures("circuit_reactor.png"); f->setTexture(0,"circuit_reactor_top.png"); f->setTexture(1,"circuit_reactor_bottom.png"); @@ -109,7 +109,7 @@ void content_mapnode_circuit(bool repeat) i = CONTENT_CIRCUIT_SOLARPANEL; f = &content_features(i); - f->description = wgettext("Solar Panel"); + f->description = gettext("Solar Panel"); f->setAllTextures("wood.png"); f->setTexture(0,"circuit_solarpanel_top.png"); f->param_type = CPT_LIGHT; @@ -139,7 +139,7 @@ void content_mapnode_circuit(bool repeat) i = CONTENT_CIRCUIT_WATERWHEEL; f = &content_features(i); - f->description = wgettext("Water Wheel"); + f->description = gettext("Water Wheel"); f->setAllTextures("circuit_waterwheel.png"); f->setTexture(2,"circuit_waterwheel_side.png"); f->setTexture(3,"circuit_waterwheel_side.png^[transformFX"); @@ -171,7 +171,7 @@ void content_mapnode_circuit(bool repeat) i = CONTENT_CIRCUIT_SWITCH; f = &content_features(i); - f->description = wgettext("Switch"); + f->description = gettext("Switch"); f->setAllTextures("stone.png"); f->setTexture(5,"circuit_switch_front.png"); f->setAllMetaTextures("stone.png"); @@ -206,7 +206,7 @@ void content_mapnode_circuit(bool repeat) i = CONTENT_CIRCUIT_BUTTON; f = &content_features(i); - f->description = wgettext("Button"); + f->description = gettext("Button"); f->setAllTextures("stone.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_WALLMOUNT; @@ -237,7 +237,7 @@ void content_mapnode_circuit(bool repeat) i = CONTENT_CIRCUIT_PRESSUREPLATE_STONE; f = &content_features(i); - f->description = wgettext("Stone Pressure Plate"); + f->description = gettext("Stone Pressure Plate"); f->setAllTextures("stone.png"); f->setTexture(0,"pressureplate_stone_top.png"); f->draw_type = CDT_NODEBOX; @@ -265,7 +265,7 @@ void content_mapnode_circuit(bool repeat) i = CONTENT_CIRCUIT_PRESSUREPLATE_WOOD; f = &content_features(i); - f->description = wgettext("Wood Pressure Plate"); + f->description = gettext("Wood Pressure Plate"); f->setAllTextures("stone.png"); f->setTexture(0,"pressureplate_wood_top.png"); f->draw_type = CDT_NODEBOX; @@ -293,7 +293,7 @@ void content_mapnode_circuit(bool repeat) i = CONTENT_CIRCUIT_NOTGATE; f = &content_features(i); - f->description = wgettext("Not Gate"); + f->description = gettext("Not Gate"); f->setAllTextures("circuit_gate.png"); f->setTexture(0,"circuit_gate_top.png"); f->rotate_tile_with_nodebox = true; @@ -324,7 +324,7 @@ void content_mapnode_circuit(bool repeat) i = CONTENT_CIRCUIT_REPEATER; f = &content_features(i); - f->description = wgettext("Repeater"); + f->description = gettext("Repeater"); f->setAllTextures("circuit_repeater.png"); f->setTexture(0,"circuit_repeater_top.png"); f->rotate_tile_with_nodebox = true; @@ -355,7 +355,7 @@ void content_mapnode_circuit(bool repeat) i = CONTENT_CIRCUIT_LAMP; f = &content_features(i); - f->description = wgettext("Electric Lamp"); + f->description = gettext("Electric Lamp"); f->is_ground_content = true; f->param_type = CPT_LIGHT; f->draw_type = CDT_CUBELIKE; @@ -374,7 +374,7 @@ void content_mapnode_circuit(bool repeat) i = CONTENT_CIRCUIT_LAMP_OFF; f = &content_features(i); - f->description = wgettext("Electric Lamp"); + f->description = gettext("Electric Lamp"); f->is_ground_content = true; f->param_type = CPT_LIGHT; f->draw_type = CDT_GLASSLIKE; @@ -406,7 +406,7 @@ void content_mapnode_circuit(bool repeat) // regular piston i = CONTENT_CIRCUIT_PISTON_OFF; f = &content_features(i); - f->description = wgettext("Piston"); + f->description = gettext("Piston"); f->is_ground_content = true; f->param_type = CPT_FACEDIR_SIMPLE; f->draw_type = CDT_CUBELIKE; @@ -440,7 +440,7 @@ void content_mapnode_circuit(bool repeat) i = CONTENT_CIRCUIT_PISTON; f = &content_features(i); - f->description = wgettext("Piston"); + f->description = gettext("Piston"); f->is_ground_content = true; f->param_type = CPT_FACEDIR_SIMPLE; f->draw_type = CDT_NODEBOX; @@ -465,7 +465,7 @@ void content_mapnode_circuit(bool repeat) i = CONTENT_CIRCUIT_PISTON_ARM; f = &content_features(i); - f->description = wgettext("Piston Arm"); + f->description = gettext("Piston Arm"); f->is_ground_content = true; f->param_type = CPT_FACEDIR_SIMPLE; f->draw_type = CDT_NODEBOX; @@ -490,7 +490,7 @@ void content_mapnode_circuit(bool repeat) // push up i = CONTENT_CIRCUIT_PISTON_UP_OFF; f = &content_features(i); - f->description = wgettext("Piston"); + f->description = gettext("Piston"); f->is_ground_content = true; f->draw_type = CDT_CUBELIKE; f->energy_type = CET_DEVICE; @@ -510,7 +510,7 @@ void content_mapnode_circuit(bool repeat) i = CONTENT_CIRCUIT_PISTON_UP; f = &content_features(i); - f->description = wgettext("Piston"); + f->description = gettext("Piston"); f->is_ground_content = true; f->draw_type = CDT_NODEBOX; f->energy_type = CET_DEVICE; @@ -531,7 +531,7 @@ void content_mapnode_circuit(bool repeat) i = CONTENT_CIRCUIT_PISTON_UP_ARM; f = &content_features(i); - f->description = wgettext("Piston Arm"); + f->description = gettext("Piston Arm"); f->is_ground_content = true; f->air_equivalent = true; f->draw_type = CDT_NODEBOX; @@ -551,7 +551,7 @@ void content_mapnode_circuit(bool repeat) // push down i = CONTENT_CIRCUIT_PISTON_DOWN_OFF; f = &content_features(i); - f->description = wgettext("Piston"); + f->description = gettext("Piston"); f->is_ground_content = true; f->draw_type = CDT_CUBELIKE; f->energy_type = CET_DEVICE; @@ -571,7 +571,7 @@ void content_mapnode_circuit(bool repeat) i = CONTENT_CIRCUIT_PISTON_DOWN; f = &content_features(i); - f->description = wgettext("Piston"); + f->description = gettext("Piston"); f->is_ground_content = true; f->draw_type = CDT_NODEBOX; f->energy_type = CET_DEVICE; @@ -592,7 +592,7 @@ void content_mapnode_circuit(bool repeat) i = CONTENT_CIRCUIT_PISTON_DOWN_ARM; f = &content_features(i); - f->description = wgettext("Piston Arm"); + f->description = gettext("Piston Arm"); f->is_ground_content = true; f->air_equivalent = true; f->draw_type = CDT_NODEBOX; @@ -612,7 +612,7 @@ void content_mapnode_circuit(bool repeat) // sticky piston i = CONTENT_CIRCUIT_STICKYPISTON_OFF; f = &content_features(i); - f->description = wgettext("Sticky Piston"); + f->description = gettext("Sticky Piston"); f->is_ground_content = true; f->param_type = CPT_FACEDIR_SIMPLE; f->draw_type = CDT_CUBELIKE; @@ -639,7 +639,7 @@ void content_mapnode_circuit(bool repeat) i = CONTENT_CIRCUIT_STICKYPISTON; f = &content_features(i); - f->description = wgettext("Sticky Piston"); + f->description = gettext("Sticky Piston"); f->is_ground_content = true; f->param_type = CPT_FACEDIR_SIMPLE; f->draw_type = CDT_NODEBOX; @@ -664,7 +664,7 @@ void content_mapnode_circuit(bool repeat) i = CONTENT_CIRCUIT_STICKYPISTON_ARM; f = &content_features(i); - f->description = wgettext("Sticky Piston Arm"); + f->description = gettext("Sticky Piston Arm"); f->is_ground_content = true; f->air_equivalent = true; f->param_type = CPT_FACEDIR_SIMPLE; @@ -689,7 +689,7 @@ void content_mapnode_circuit(bool repeat) // push up i = CONTENT_CIRCUIT_STICKYPISTON_UP_OFF; f = &content_features(i); - f->description = wgettext("Sticky Piston"); + f->description = gettext("Sticky Piston"); f->is_ground_content = true; f->draw_type = CDT_CUBELIKE; f->energy_type = CET_DEVICE; @@ -709,7 +709,7 @@ void content_mapnode_circuit(bool repeat) i = CONTENT_CIRCUIT_STICKYPISTON_UP; f = &content_features(i); - f->description = wgettext("Sticky Piston"); + f->description = gettext("Sticky Piston"); f->is_ground_content = true; f->draw_type = CDT_NODEBOX; f->energy_type = CET_DEVICE; @@ -730,7 +730,7 @@ void content_mapnode_circuit(bool repeat) i = CONTENT_CIRCUIT_STICKYPISTON_UP_ARM; f = &content_features(i); - f->description = wgettext("Sticky Piston Arm"); + f->description = gettext("Sticky Piston Arm"); f->is_ground_content = true; f->air_equivalent = true; f->draw_type = CDT_NODEBOX; @@ -750,7 +750,7 @@ void content_mapnode_circuit(bool repeat) // push down i = CONTENT_CIRCUIT_STICKYPISTON_DOWN_OFF; f = &content_features(i); - f->description = wgettext("Sticky Piston"); + f->description = gettext("Sticky Piston"); f->is_ground_content = true; f->draw_type = CDT_CUBELIKE; f->energy_type = CET_DEVICE; @@ -770,7 +770,7 @@ void content_mapnode_circuit(bool repeat) i = CONTENT_CIRCUIT_STICKYPISTON_DOWN; f = &content_features(i); - f->description = wgettext("Sticky Piston"); + f->description = gettext("Sticky Piston"); f->is_ground_content = true; f->draw_type = CDT_NODEBOX; f->energy_type = CET_DEVICE; @@ -791,7 +791,7 @@ void content_mapnode_circuit(bool repeat) i = CONTENT_CIRCUIT_STICKYPISTON_DOWN_ARM; f = &content_features(i); - f->description = wgettext("Sticky Piston Arm"); + f->description = gettext("Sticky Piston Arm"); f->is_ground_content = true; f->air_equivalent = true; f->draw_type = CDT_NODEBOX; diff --git a/src/content_mapnode_door.cpp b/src/content_mapnode_door.cpp index 4248ab9..6a911f1 100644 --- a/src/content_mapnode_door.cpp +++ b/src/content_mapnode_door.cpp @@ -35,7 +35,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_WOOD_DOOR_LB; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Wood Door"); + f->description = gettext("Wood Door"); f->setAllTextures("door_wood_b.png"); f->setTexture(2,"door_wood_b.png^[transformFX"); f->setTexture(3,"door_wood_b.png^[transformFX"); @@ -61,7 +61,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_WOOD_DOOR_LT; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Wood Door"); + f->description = gettext("Wood Door"); f->setAllTextures("door_wood_t.png"); f->setTexture(2,"door_wood_t.png^[transformFX"); f->setTexture(3,"door_wood_t.png^[transformFX"); @@ -92,7 +92,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_STEEL_DOOR_LB; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Steel Door"); + f->description = gettext("Steel Door"); f->setAllTextures("door_steel_b.png"); f->setTexture(2,"door_steel_b.png^[transformFX"); f->setTexture(3,"door_steel_b.png^[transformFX"); @@ -119,7 +119,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_STEEL_DOOR_LT; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Steel Door"); + f->description = gettext("Steel Door"); f->setAllTextures("door_steel_t.png"); f->setTexture(2,"door_steel_t.png^[transformFX"); f->setTexture(3,"door_steel_t.png^[transformFX"); @@ -151,7 +151,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_GLASS_DOOR_LB; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Glass Door"); + f->description = gettext("Glass Door"); f->setAllTextures("door_glass_b.png"); f->setTexture(2,"door_glass_b.png^[transformFX"); f->setTexture(3,"door_glass_b.png^[transformFX"); @@ -179,7 +179,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_GLASS_DOOR_LT; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Glass Door"); + f->description = gettext("Glass Door"); f->setAllTextures("door_glass_t.png"); f->setTexture(2,"door_glass_t.png^[transformFX"); f->setTexture(3,"door_glass_t.png^[transformFX"); @@ -212,7 +212,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_WOOD_W_DOOR_LB; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Wood Windowed Door"); + f->description = gettext("Wood Windowed Door"); f->setAllTextures("door_wood_wb.png"); f->setTexture(2,"door_wood_wb.png^[transformFX"); f->setTexture(3,"door_wood_wb.png^[transformFX"); @@ -239,7 +239,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_WOOD_W_DOOR_LT; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Wood Windowed Door"); + f->description = gettext("Wood Windowed Door"); f->setAllTextures("door_wood_wt.png"); f->setTexture(2,"door_wood_wt.png^[transformFX"); f->setTexture(3,"door_wood_wt.png^[transformFX"); @@ -272,7 +272,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_STEEL_W_DOOR_LB; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Steel Windowed Door"); + f->description = gettext("Steel Windowed Door"); f->setAllTextures("door_steel_wb.png"); f->setTexture(2,"door_steel_wb.png^[transformFX"); f->setTexture(3,"door_steel_wb.png^[transformFX"); @@ -300,7 +300,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_STEEL_W_DOOR_LT; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Steel Windowed Door"); + f->description = gettext("Steel Windowed Door"); f->setAllTextures("door_steel_wt.png"); f->setTexture(2,"door_steel_wt.png^[transformFX"); f->setTexture(3,"door_steel_wt.png^[transformFX"); @@ -335,7 +335,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_WOOD_DOOR_RB; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Right Hanging Wood Door"); + f->description = gettext("Right Hanging Wood Door"); f->setAllTextures("door_wood_b.png^[transformFX"); f->setTexture(2,"door_wood_b.png"); f->setTexture(3,"door_wood_b.png"); @@ -361,7 +361,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_WOOD_DOOR_RT; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Right Hanging Wood Door"); + f->description = gettext("Right Hanging Wood Door"); f->setAllTextures("door_wood_t.png^[transformFX"); f->setTexture(2,"door_wood_t.png"); f->setTexture(3,"door_wood_t.png"); @@ -390,7 +390,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_GLASS_DOOR_RB; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Right Hanging Glass Door"); + f->description = gettext("Right Hanging Glass Door"); f->setAllTextures("door_glass_b.png^[transformFX"); f->setTexture(2,"door_glass_b.png"); f->setTexture(3,"door_glass_b.png"); @@ -419,7 +419,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_GLASS_DOOR_RT; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Right Hanging Glass Door"); + f->description = gettext("Right Hanging Glass Door"); f->setAllTextures("door_glass_t.png^[transformFX"); f->setTexture(2,"door_glass_t.png"); f->setTexture(3,"door_glass_t.png"); @@ -451,7 +451,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_STEEL_DOOR_RB; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Right Hanging Steel Door"); + f->description = gettext("Right Hanging Steel Door"); f->setAllTextures("door_steel_b.png^[transformFX"); f->setTexture(2,"door_steel_b.png"); f->setTexture(3,"door_steel_b.png"); @@ -478,7 +478,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_STEEL_DOOR_RT; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Right Hanging Steel Door"); + f->description = gettext("Right Hanging Steel Door"); f->setAllTextures("door_steel_t.png^[transformFX"); f->setTexture(2,"door_steel_t.png"); f->setTexture(3,"door_steel_t.png"); @@ -508,7 +508,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_WOOD_W_DOOR_RB; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Right Hanging Wood Windowed Door"); + f->description = gettext("Right Hanging Wood Windowed Door"); f->setAllTextures("door_wood_wb.png^[transformFX"); f->setTexture(2,"door_wood_wb.png"); f->setTexture(3,"door_wood_wb.png"); @@ -535,7 +535,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_WOOD_W_DOOR_RT; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Right Hanging Wood Windowed Door"); + f->description = gettext("Right Hanging Wood Windowed Door"); f->setAllTextures("door_wood_wt.png^[transformFX"); f->setTexture(2,"door_wood_wt.png"); f->setTexture(3,"door_wood_wt.png"); @@ -565,7 +565,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_STEEL_W_DOOR_RB; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Right Hanging Steel Windowed Door"); + f->description = gettext("Right Hanging Steel Windowed Door"); f->setAllTextures("door_steel_wb.png^[transformFX"); f->setTexture(2,"door_steel_wb.png"); f->setTexture(3,"door_steel_wb.png"); @@ -593,7 +593,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_STEEL_W_DOOR_RT; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Right Hanging Steel Windowed Door"); + f->description = gettext("Right Hanging Steel Windowed Door"); f->setAllTextures("door_steel_wt.png^[transformFX"); f->setTexture(2,"door_steel_wt.png"); f->setTexture(3,"door_steel_wt.png"); @@ -628,7 +628,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_WOOD_DOOR_LB_OPEN; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Wood Door"); + f->description = gettext("Wood Door"); f->setAllTextures("door_wood_b.png"); f->setTexture(3,"door_wood_b.png^[transformFX"); f->setInventoryTexture("door_wood_inv.png"); @@ -653,7 +653,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_WOOD_DOOR_LT_OPEN; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Wood Door"); + f->description = gettext("Wood Door"); f->setAllTextures("door_wood_t.png"); f->setTexture(3,"door_wood_t.png^[transformFX"); f->setInventoryTexture("door_wood_inv.png"); @@ -679,7 +679,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_GLASS_DOOR_LB_OPEN; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Glass Door"); + f->description = gettext("Glass Door"); f->setAllTextures("door_glass_b.png"); f->setTexture(3,"door_glass_b.png^[transformFX"); #ifndef SERVER @@ -706,7 +706,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_GLASS_DOOR_LT_OPEN; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Glass Door"); + f->description = gettext("Glass Door"); f->setAllTextures("door_glass_t.png"); f->setTexture(3,"door_glass_t.png^[transformFX"); #ifndef SERVER @@ -734,7 +734,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_STEEL_DOOR_LB_OPEN; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Steel Door"); + f->description = gettext("Steel Door"); f->setAllTextures("door_steel_b.png"); f->setTexture(3,"door_steel_b.png^[transformFX"); f->setInventoryTexture("door_steel_inv.png"); @@ -760,7 +760,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_STEEL_DOOR_LT_OPEN; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Steel Door"); + f->description = gettext("Steel Door"); f->setAllTextures("door_steel_t.png"); f->setTexture(3,"door_steel_t.png^[transformFX"); f->setInventoryTexture("door_steel_inv.png"); @@ -787,7 +787,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_WOOD_W_DOOR_LB_OPEN; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Wood Windowed Door"); + f->description = gettext("Wood Windowed Door"); f->setAllTextures("door_wood_wb.png"); f->setTexture(3,"door_wood_wb.png^[transformFX"); f->setInventoryTexture("door_wood_w_inv.png"); @@ -812,7 +812,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_WOOD_W_DOOR_LT_OPEN; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Wood Windowed Door"); + f->description = gettext("Wood Windowed Door"); f->setAllTextures("door_wood_wt.png"); f->setTexture(3,"door_wood_wt.png^[transformFX"); f->setInventoryTexture("door_wood_w_inv.png"); @@ -838,7 +838,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_STEEL_W_DOOR_LB_OPEN; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Steel Windowed Door"); + f->description = gettext("Steel Windowed Door"); f->setAllTextures("door_steel_wb.png"); f->setTexture(3,"door_steel_wb.png^[transformFX"); f->setInventoryTexture("door_steel_w_inv.png"); @@ -864,7 +864,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_STEEL_W_DOOR_LT_OPEN; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Steel Windowed Door"); + f->description = gettext("Steel Windowed Door"); f->setAllTextures("door_steel_wt.png"); f->setTexture(3,"door_steel_wt.png^[transformFX"); f->setInventoryTexture("door_steel_w_inv.png"); @@ -892,7 +892,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_WOOD_DOOR_RB_OPEN; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Right Hanging Wood Door"); + f->description = gettext("Right Hanging Wood Door"); f->setAllTextures("door_wood_b.png"); f->setTexture(3,"door_wood_b.png^[transformFX"); f->setTexture(4,"door_wood_b.png^[transformFX"); @@ -919,7 +919,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_WOOD_DOOR_RT_OPEN; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Right Hanging Wood Door"); + f->description = gettext("Right Hanging Wood Door"); f->setAllTextures("door_wood_t.png"); f->setTexture(3,"door_wood_t.png^[transformFX"); f->setTexture(4,"door_wood_t.png^[transformFX"); @@ -947,7 +947,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_GLASS_DOOR_RB_OPEN; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Right Hanging Glass Door"); + f->description = gettext("Right Hanging Glass Door"); f->setAllTextures("door_glass_b.png"); f->setTexture(2,"door_glass_b.png^[transformFX"); f->setTexture(3,"door_glass_b.png^[transformFX"); @@ -976,7 +976,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_GLASS_DOOR_RT_OPEN; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Right Hanging Glass Door"); + f->description = gettext("Right Hanging Glass Door"); f->setAllTextures("door_glass_t.png"); f->setTexture(2,"door_glass_t.png^[transformFX"); f->setTexture(3,"door_glass_t.png^[transformFX"); @@ -1005,7 +1005,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_STEEL_DOOR_RB_OPEN; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Right Hanging Steel Door"); + f->description = gettext("Right Hanging Steel Door"); f->setAllTextures("door_steel_b.png"); f->setTexture(3,"door_steel_b.png^[transformFX"); f->setTexture(4,"door_steel_b.png^[transformFX"); @@ -1033,7 +1033,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_STEEL_DOOR_RT_OPEN; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Right Hanging Steel Door"); + f->description = gettext("Right Hanging Steel Door"); f->setAllTextures("door_steel_b.png"); f->setTexture(3,"door_steel_t.png^[transformFX"); f->setTexture(4,"door_steel_t.png^[transformFX"); @@ -1062,7 +1062,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_WOOD_W_DOOR_RB_OPEN; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Right Hanging Wood Windowed Door"); + f->description = gettext("Right Hanging Wood Windowed Door"); f->setAllTextures("door_wood_wb.png"); f->setTexture(3,"door_wood_wb.png^[transformFX"); f->setTexture(4,"door_wood_wb.png^[transformFX"); @@ -1089,7 +1089,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_WOOD_W_DOOR_RT_OPEN; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Right Hanging Wood Windowed Door"); + f->description = gettext("Right Hanging Wood Windowed Door"); f->setAllTextures("door_wood_wt.png"); f->setTexture(3,"door_wood_wt.png^[transformFX"); f->setTexture(4,"door_wood_wt.png^[transformFX"); @@ -1117,7 +1117,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_STEEL_W_DOOR_RB_OPEN; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Right Hanging Steel Windowed Door"); + f->description = gettext("Right Hanging Steel Windowed Door"); f->setAllTextures("door_steel_wb.png"); f->setTexture(3,"door_steel_wb.png^[transformFX"); f->setTexture(4,"door_steel_wb.png^[transformFX"); @@ -1145,7 +1145,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_STEEL_W_DOOR_RT_OPEN; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Right Hanging Steel Windowed Door"); + f->description = gettext("Right Hanging Steel Windowed Door"); f->setAllTextures("door_steel_wt.png"); f->setTexture(3,"door_steel_wt.png^[transformFX"); f->setTexture(4,"door_steel_wt.png^[transformFX"); @@ -1175,7 +1175,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_WOOD_HATCH; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Wood Hatch"); + f->description = gettext("Wood Hatch"); f->setAllTextures("hatch_wood.png"); f->rotate_tile_with_nodebox = true; f->setInventoryTexture("hatch_wood_inv.png"); @@ -1201,7 +1201,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_STEEL_HATCH; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Steel Hatch"); + f->description = gettext("Steel Hatch"); f->setAllTextures("hatch_steel.png"); f->rotate_tile_with_nodebox = true; f->setInventoryTexture("hatch_steel_inv.png"); @@ -1227,7 +1227,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_WOOD_W_HATCH; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Wood Windowed Hatch"); + f->description = gettext("Wood Windowed Hatch"); f->setAllTextures("hatch_wood_w.png"); f->rotate_tile_with_nodebox = true; f->setInventoryTexture("hatch_wood_w_inv.png"); @@ -1255,7 +1255,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_STEEL_W_HATCH; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Steel Windowed Hatch"); + f->description = gettext("Steel Windowed Hatch"); f->setAllTextures("hatch_steel_w.png"); f->rotate_tile_with_nodebox = true; f->setInventoryTexture("hatch_steel_w_inv.png"); @@ -1285,7 +1285,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_WOOD_GATE; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Wood Gate"); + f->description = gettext("Wood Gate"); f->setAllTextures("gate_wood.png"); f->rotate_tile_with_nodebox = true; f->setInventoryTexture("gate_wood_inv.png"); @@ -1317,7 +1317,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_STEEL_GATE; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Steel Gate"); + f->description = gettext("Steel Gate"); f->setAllTextures("gate_steel.png"); f->rotate_tile_with_nodebox = true; f->setInventoryTexture("gate_steel_inv.png"); @@ -1348,7 +1348,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_WOOD_HATCH_OPEN; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Wood Hatch"); + f->description = gettext("Wood Hatch"); f->setAllTextures("hatch_wood.png"); f->setTexture(2,"hatch_wood.png^[transformR90"); f->setTexture(3,"hatch_wood.png^[transformR90"); @@ -1375,7 +1375,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_STEEL_HATCH_OPEN; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Steel Hatch"); + f->description = gettext("Steel Hatch"); f->setAllTextures("hatch_steel.png"); f->setTexture(2,"hatch_steel.png^[transformR90"); f->setTexture(3,"hatch_steel.png^[transformR90"); @@ -1403,7 +1403,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_WOOD_W_HATCH_OPEN; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Wood Hatch"); + f->description = gettext("Wood Hatch"); f->setAllTextures("hatch_wood_w.png"); f->setTexture(2,"hatch_wood.png^[transformR90"); f->setTexture(3,"hatch_wood.png^[transformR90"); @@ -1430,7 +1430,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_STEEL_W_HATCH_OPEN; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Steel Hatch"); + f->description = gettext("Steel Hatch"); f->setAllTextures("hatch_steel_w.png"); f->setTexture(2,"hatch_steel.png^[transformR90"); f->setTexture(3,"hatch_steel.png^[transformR90"); @@ -1459,7 +1459,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_WOOD_GATE_OPEN; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Wood Gate"); + f->description = gettext("Wood Gate"); f->setAllTextures("wood.png"); f->rotate_tile_with_nodebox = true; f->setInventoryTexture("gate_wood_inv.png"); @@ -1484,7 +1484,7 @@ void content_mapnode_door(bool repeat) i = CONTENT_STEEL_GATE_OPEN; f = &content_features(i); f->param2_type = CPT_FACEDIR_SIMPLE; - f->description = wgettext("Steel Gate"); + f->description = gettext("Steel Gate"); f->setAllTextures("steel.png"); f->rotate_tile_with_nodebox = true; f->setInventoryTexture("gate_steel_inv.png"); diff --git a/src/content_mapnode_farm.cpp b/src/content_mapnode_farm.cpp index 952eadd..3835af1 100644 --- a/src/content_mapnode_farm.cpp +++ b/src/content_mapnode_farm.cpp @@ -35,7 +35,7 @@ void content_mapnode_farm(bool repeat) i = CONTENT_FARM_DIRT; f = &content_features(i); - f->description = wgettext("Farm Dirt"); + f->description = gettext("Farm Dirt"); f->setAllTextures("dirt.png"); f->setInventoryTextureCube("dirt.png","dirt.png","dirt.png"); f->draw_type = CDT_CUBELIKE; @@ -47,7 +47,7 @@ void content_mapnode_farm(bool repeat) i = CONTENT_FERTILIZER; f = &content_features(i); - f->description = wgettext("Fertilizer"); + f->description = gettext("Fertilizer"); f->setAllTextures("fertilizer.png"); f->param_type = CPT_LIGHT; f->draw_type = CDT_NODEBOX; @@ -64,7 +64,7 @@ void content_mapnode_farm(bool repeat) i = CONTENT_TRELLIS; f = &content_features(i); - f->description = wgettext("Trellis"); + f->description = gettext("Trellis"); f->setAllTextures("trellis.png"); f->setAllTextureFlags(0); f->draw_type = CDT_PLANTLIKE; @@ -86,7 +86,7 @@ void content_mapnode_farm(bool repeat) i = CONTENT_SEEDS_WHEAT; f = &content_features(i); - f->description = wgettext("Wheat Seeds"); + f->description = gettext("Wheat Seeds"); f->setAllTextures("farm_seeds_wheat.png"); f->draw_type = CDT_PLANTLIKE; f->param_type = CPT_LIGHT; @@ -106,7 +106,7 @@ void content_mapnode_farm(bool repeat) i = CONTENT_SEEDS_MELON; f = &content_features(i); - f->description = wgettext("Melon Seeds"); + f->description = gettext("Melon Seeds"); f->setAllTextures("farm_seeds_melon.png"); f->draw_type = CDT_PLANTLIKE; f->param_type = CPT_LIGHT; @@ -128,7 +128,7 @@ void content_mapnode_farm(bool repeat) i = CONTENT_SEEDS_PUMPKIN; f = &content_features(i); - f->description = wgettext("Pumpkin Seeds"); + f->description = gettext("Pumpkin Seeds"); f->setAllTextures("farm_seeds_pumpkin.png"); f->draw_type = CDT_PLANTLIKE; f->param_type = CPT_LIGHT; @@ -150,7 +150,7 @@ void content_mapnode_farm(bool repeat) i = CONTENT_SEEDS_POTATO; f = &content_features(i); - f->description = wgettext("Potato Seeds"); + f->description = gettext("Potato Seeds"); f->setAllTextures("farm_seeds_potato.png"); f->draw_type = CDT_PLANTLIKE; f->param_type = CPT_LIGHT; @@ -172,7 +172,7 @@ void content_mapnode_farm(bool repeat) i = CONTENT_SEEDS_CARROT; f = &content_features(i); - f->description = wgettext("Carrot Seeds"); + f->description = gettext("Carrot Seeds"); f->setAllTextures("farm_seeds_carrot.png"); f->draw_type = CDT_PLANTLIKE; f->param_type = CPT_LIGHT; @@ -194,7 +194,7 @@ void content_mapnode_farm(bool repeat) i = CONTENT_SEEDS_BEETROOT; f = &content_features(i); - f->description = wgettext("Beetroot Seeds"); + f->description = gettext("Beetroot Seeds"); f->setAllTextures("farm_seeds_beetroot.png"); f->draw_type = CDT_PLANTLIKE; f->param_type = CPT_LIGHT; @@ -216,7 +216,7 @@ void content_mapnode_farm(bool repeat) i = CONTENT_SEEDS_GRAPE; f = &content_features(i); - f->description = wgettext("Grape Seeds"); + f->description = gettext("Grape Seeds"); f->setAllTextures("farm_seeds_grape.png"); f->draw_type = CDT_PLANTLIKE; f->param_type = CPT_LIGHT; @@ -238,7 +238,7 @@ void content_mapnode_farm(bool repeat) i = CONTENT_SEEDS_COTTON; f = &content_features(i); - f->description = wgettext("Cotton Seeds"); + f->description = gettext("Cotton Seeds"); f->setAllTextures("farm_seeds_cotton.png"); f->draw_type = CDT_PLANTLIKE; f->param_type = CPT_LIGHT; @@ -258,7 +258,7 @@ void content_mapnode_farm(bool repeat) i = CONTENT_FARM_WHEAT; f = &content_features(i); - f->description = wgettext("Wheat"); + f->description = gettext("Wheat"); f->setAllTextures("farm_wheat.png"); f->draw_type = CDT_PLANTLIKE; f->param_type = CPT_LIGHT; @@ -280,7 +280,7 @@ void content_mapnode_farm(bool repeat) i = CONTENT_FARM_MELON; f = &content_features(i); - f->description = wgettext("Melon"); + f->description = gettext("Melon"); f->setAllTextures("farm_melon.png"); f->setTexture(0,"farm_melon_top.png"); f->setTexture(1,"farm_melon_top.png"); @@ -297,7 +297,7 @@ void content_mapnode_farm(bool repeat) i = CONTENT_FARM_PUMPKIN; f = &content_features(i); - f->description = wgettext("Pumpkin"); + f->description = gettext("Pumpkin"); f->setAllTextures("farm_pumpkin.png"); f->setTexture(0,"farm_pumpkin_top.png"); f->setTexture(1,"farm_pumpkin_top.png"); @@ -316,7 +316,7 @@ void content_mapnode_farm(bool repeat) i = CONTENT_FARM_PUMPKIN_JACK; f = &content_features(i); if (g_settings->getBool("enable_supernatural")) { - f->description = wgettext("Jack' O Lantern"); + f->description = gettext("Jack' O Lantern"); f->setAllTextures("farm_pumpkin.png"); f->setTexture(0,"farm_pumpkin_top.png"); f->setTexture(1,"farm_pumpkin_top.png"); @@ -326,7 +326,7 @@ void content_mapnode_farm(bool repeat) content_nodebox_jackolantern(f); f->setInventoryTextureNodeBox(i,"farm_pumpkin_top.png","farm_pumpkin_jack.png","farm_pumpkin.png"); }else{ - f->description = wgettext("Glass Light"); + f->description = gettext("Glass Light"); f->light_propagates = true; f->sunlight_propagates = true; f->param_type = CPT_LIGHT; @@ -352,7 +352,7 @@ void content_mapnode_farm(bool repeat) i = CONTENT_FARM_POTATO; f = &content_features(i); - f->description = wgettext("Potato"); + f->description = gettext("Potato"); f->setAllTextures("farm_potato.png"); f->draw_type = CDT_PLANTLIKE; f->param_type = CPT_LIGHT; @@ -372,7 +372,7 @@ void content_mapnode_farm(bool repeat) i = CONTENT_FARM_CARROT; f = &content_features(i); - f->description = wgettext("Carrot"); + f->description = gettext("Carrot"); f->setAllTextures("farm_carrot.png"); f->draw_type = CDT_PLANTLIKE; f->param_type = CPT_LIGHT; @@ -392,7 +392,7 @@ void content_mapnode_farm(bool repeat) i = CONTENT_FARM_BEETROOT; f = &content_features(i); - f->description = wgettext("Beetroot"); + f->description = gettext("Beetroot"); f->setAllTextures("farm_beetroot.png"); f->draw_type = CDT_PLANTLIKE; f->param_type = CPT_LIGHT; @@ -412,7 +412,7 @@ void content_mapnode_farm(bool repeat) i = CONTENT_FARM_GRAPEVINE; f = &content_features(i); - f->description = wgettext("Grape"); + f->description = gettext("Grape"); f->setAllTextures("farm_grapevine.png"); f->draw_type = CDT_PLANTLIKE; f->param_type = CPT_LIGHT; @@ -433,7 +433,7 @@ void content_mapnode_farm(bool repeat) i = CONTENT_FARM_COTTON; f = &content_features(i); - f->description = wgettext("Cotton"); + f->description = gettext("Cotton"); f->setAllTextures("farm_cotton.png"); f->draw_type = CDT_PLANTLIKE; f->param_type = CPT_LIGHT; @@ -456,7 +456,7 @@ void content_mapnode_farm(bool repeat) i = CONTENT_FARM_TRELLIS_GRAPE; f = &content_features(i); - f->description = wgettext("Trellis Grape"); + f->description = gettext("Trellis Grape"); f->setAllTextures("farm_grapevine.png"); f->setAllTextureFlags(0); f->draw_type = CDT_PLANTLIKE; @@ -480,7 +480,7 @@ void content_mapnode_farm(bool repeat) i = CONTENT_DEAD_VINE; f = &content_features(i); - f->description = wgettext("Dead Vine"); + f->description = gettext("Dead Vine"); f->setAllTextures("dead_vine.png"); f->setAllTextureFlags(0); f->draw_type = CDT_PLANTLIKE; @@ -498,7 +498,7 @@ void content_mapnode_farm(bool repeat) i = CONTENT_TRELLIS_DEAD_VINE; f = &content_features(i); - f->description = wgettext("Dead Vine"); + f->description = gettext("Dead Vine"); f->setAllTextures("dead_vine.png"); f->setAllTextureFlags(0); f->draw_type = CDT_PLANTLIKE; diff --git a/src/content_mapnode_furniture.cpp b/src/content_mapnode_furniture.cpp index e59f300..4299a47 100644 --- a/src/content_mapnode_furniture.cpp +++ b/src/content_mapnode_furniture.cpp @@ -33,7 +33,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_BOOKSHELF; f = &content_features(i); - f->description = wgettext("Book Shelf"); + f->description = gettext("Book Shelf"); f->setAllTextures("bookshelf_front.png"); f->setTexture(0, "bookshelf_top.png"); f->setTexture(1, "bookshelf_top.png"); @@ -70,7 +70,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_BOOKSHELF_JUNGLE; f = &content_features(i); - f->description = wgettext("Junglewood Book Shelf"); + f->description = gettext("Junglewood Book Shelf"); f->setAllTextures("bookshelf_jungle_front.png"); f->setTexture(0, "bookshelf_jungle_top.png"); f->setTexture(1, "bookshelf_jungle_top.png"); @@ -107,7 +107,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_BOOKSHELF_PINE; f = &content_features(i); - f->description = wgettext("Pine Book Shelf"); + f->description = gettext("Pine Book Shelf"); f->setAllTextures("bookshelf_pine_front.png"); f->setTexture(0, "bookshelf_pine_top.png"); f->setTexture(1, "bookshelf_pine_top.png"); @@ -144,7 +144,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_CENTRE; f = &content_features(i); - f->description = wgettext("Couch"); + f->description = gettext("Couch"); f->setAllTextures("cotton.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -163,7 +163,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_ENDL; f = &content_features(i); - f->description = wgettext("Couch"); + f->description = gettext("Couch"); f->setAllTextures("cotton.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -182,7 +182,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_ENDR; f = &content_features(i); - f->description = wgettext("Couch"); + f->description = gettext("Couch"); f->setAllTextures("cotton.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -201,7 +201,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_INNER; f = &content_features(i); - f->description = wgettext("Couch"); + f->description = gettext("Couch"); f->setAllTextures("cotton.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -220,7 +220,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_OUTER; f = &content_features(i); - f->description = wgettext("Couch"); + f->description = gettext("Couch"); f->setAllTextures("cotton.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -239,7 +239,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_CHAIR; f = &content_features(i); - f->description = wgettext("Couch"); + f->description = gettext("Couch"); f->setAllTextures("cotton.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -268,7 +268,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_CENTRE_BLUE; f = &content_features(i); - f->description = wgettext("Blue Couch"); + f->description = gettext("Blue Couch"); f->setAllTextures("cotton_blue.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -287,7 +287,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_ENDL_BLUE; f = &content_features(i); - f->description = wgettext("Blue Couch"); + f->description = gettext("Blue Couch"); f->setAllTextures("cotton_blue.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -306,7 +306,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_ENDR_BLUE; f = &content_features(i); - f->description = wgettext("Blue Couch"); + f->description = gettext("Blue Couch"); f->setAllTextures("cotton_blue.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -325,7 +325,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_INNER_BLUE; f = &content_features(i); - f->description = wgettext("Blue Couch"); + f->description = gettext("Blue Couch"); f->setAllTextures("cotton_blue.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -344,7 +344,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_OUTER_BLUE; f = &content_features(i); - f->description = wgettext("Blue Couch"); + f->description = gettext("Blue Couch"); f->setAllTextures("cotton_blue.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -363,7 +363,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_CHAIR_BLUE; f = &content_features(i); - f->description = wgettext("Blue Couch"); + f->description = gettext("Blue Couch"); f->setAllTextures("cotton_blue.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -386,7 +386,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_CENTRE_GREEN; f = &content_features(i); - f->description = wgettext("Green Couch"); + f->description = gettext("Green Couch"); f->setAllTextures("cotton_green.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -405,7 +405,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_ENDL_GREEN; f = &content_features(i); - f->description = wgettext("Green Couch"); + f->description = gettext("Green Couch"); f->setAllTextures("cotton_green.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -424,7 +424,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_ENDR_GREEN; f = &content_features(i); - f->description = wgettext("Green Couch"); + f->description = gettext("Green Couch"); f->setAllTextures("cotton_green.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -443,7 +443,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_INNER_GREEN; f = &content_features(i); - f->description = wgettext("Green Couch"); + f->description = gettext("Green Couch"); f->setAllTextures("cotton_green.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -462,7 +462,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_OUTER_GREEN; f = &content_features(i); - f->description = wgettext("Green Couch"); + f->description = gettext("Green Couch"); f->setAllTextures("cotton_green.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -481,7 +481,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_CHAIR_GREEN; f = &content_features(i); - f->description = wgettext("Green Couch"); + f->description = gettext("Green Couch"); f->setAllTextures("cotton_green.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -504,7 +504,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_CENTRE_ORANGE; f = &content_features(i); - f->description = wgettext("Orange Couch"); + f->description = gettext("Orange Couch"); f->setAllTextures("cotton_orange.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -523,7 +523,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_ENDL_ORANGE; f = &content_features(i); - f->description = wgettext("Orange Couch"); + f->description = gettext("Orange Couch"); f->setAllTextures("cotton_orange.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -542,7 +542,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_ENDR_ORANGE; f = &content_features(i); - f->description = wgettext("Orange Couch"); + f->description = gettext("Orange Couch"); f->setAllTextures("cotton_orange.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -561,7 +561,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_INNER_ORANGE; f = &content_features(i); - f->description = wgettext("Orange Couch"); + f->description = gettext("Orange Couch"); f->setAllTextures("cotton_orange.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -580,7 +580,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_OUTER_ORANGE; f = &content_features(i); - f->description = wgettext("Orange Couch"); + f->description = gettext("Orange Couch"); f->setAllTextures("cotton_orange.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -599,7 +599,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_CHAIR_ORANGE; f = &content_features(i); - f->description = wgettext("Orange Couch"); + f->description = gettext("Orange Couch"); f->setAllTextures("cotton_orange.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -622,7 +622,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_CENTRE_PURPLE; f = &content_features(i); - f->description = wgettext("Purple Couch"); + f->description = gettext("Purple Couch"); f->setAllTextures("cotton_purple.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -641,7 +641,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_ENDL_PURPLE; f = &content_features(i); - f->description = wgettext("Purple Couch"); + f->description = gettext("Purple Couch"); f->setAllTextures("cotton_purple.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -660,7 +660,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_ENDR_PURPLE; f = &content_features(i); - f->description = wgettext("Purple Couch"); + f->description = gettext("Purple Couch"); f->setAllTextures("cotton_purple.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -679,7 +679,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_INNER_PURPLE; f = &content_features(i); - f->description = wgettext("Purple Couch"); + f->description = gettext("Purple Couch"); f->setAllTextures("cotton_purple.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -698,7 +698,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_OUTER_PURPLE; f = &content_features(i); - f->description = wgettext("Purple Couch"); + f->description = gettext("Purple Couch"); f->setAllTextures("cotton_purple.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -717,7 +717,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_CHAIR_PURPLE; f = &content_features(i); - f->description = wgettext("Purple Couch"); + f->description = gettext("Purple Couch"); f->setAllTextures("cotton_purple.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -740,7 +740,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_CENTRE_RED; f = &content_features(i); - f->description = wgettext("Red Couch"); + f->description = gettext("Red Couch"); f->setAllTextures("cotton_red.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -759,7 +759,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_ENDL_RED; f = &content_features(i); - f->description = wgettext("Red Couch"); + f->description = gettext("Red Couch"); f->setAllTextures("cotton_red.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -778,7 +778,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_ENDR_RED; f = &content_features(i); - f->description = wgettext("Red Couch"); + f->description = gettext("Red Couch"); f->setAllTextures("cotton_red.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -797,7 +797,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_INNER_RED; f = &content_features(i); - f->description = wgettext("Red Couch"); + f->description = gettext("Red Couch"); f->setAllTextures("cotton_red.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -816,7 +816,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_OUTER_RED; f = &content_features(i); - f->description = wgettext("Red Couch"); + f->description = gettext("Red Couch"); f->setAllTextures("cotton_red.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -835,7 +835,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_CHAIR_RED; f = &content_features(i); - f->description = wgettext("Red Couch"); + f->description = gettext("Red Couch"); f->setAllTextures("cotton_red.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -858,7 +858,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_CENTRE_YELLOW; f = &content_features(i); - f->description = wgettext("Yellow Couch"); + f->description = gettext("Yellow Couch"); f->setAllTextures("cotton_yellow.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -877,7 +877,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_ENDL_YELLOW; f = &content_features(i); - f->description = wgettext("Yellow Couch"); + f->description = gettext("Yellow Couch"); f->setAllTextures("cotton_yellow.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -896,7 +896,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_ENDR_YELLOW; f = &content_features(i); - f->description = wgettext("Yellow Couch"); + f->description = gettext("Yellow Couch"); f->setAllTextures("cotton_yellow.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -915,7 +915,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_INNER_YELLOW; f = &content_features(i); - f->description = wgettext("Yellow Couch"); + f->description = gettext("Yellow Couch"); f->setAllTextures("cotton_yellow.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -934,7 +934,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_OUTER_YELLOW; f = &content_features(i); - f->description = wgettext("Yellow Couch"); + f->description = gettext("Yellow Couch"); f->setAllTextures("cotton_yellow.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -953,7 +953,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_CHAIR_YELLOW; f = &content_features(i); - f->description = wgettext("Yellow Couch"); + f->description = gettext("Yellow Couch"); f->setAllTextures("cotton_yellow.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -976,7 +976,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_CENTRE_BLACK; f = &content_features(i); - f->description = wgettext("Black Couch"); + f->description = gettext("Black Couch"); f->setAllTextures("cotton_black.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -995,7 +995,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_ENDL_BLACK; f = &content_features(i); - f->description = wgettext("Black Couch"); + f->description = gettext("Black Couch"); f->setAllTextures("cotton_black.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -1014,7 +1014,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_ENDR_BLACK; f = &content_features(i); - f->description = wgettext("Black Couch"); + f->description = gettext("Black Couch"); f->setAllTextures("cotton_black.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -1033,7 +1033,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_INNER_BLACK; f = &content_features(i); - f->description = wgettext("Black Couch"); + f->description = gettext("Black Couch"); f->setAllTextures("cotton_black.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -1052,7 +1052,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_OUTER_BLACK; f = &content_features(i); - f->description = wgettext("Black Couch"); + f->description = gettext("Black Couch"); f->setAllTextures("cotton_black.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -1071,7 +1071,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_COUCH_CHAIR_BLACK; f = &content_features(i); - f->description = wgettext("Black Couch"); + f->description = gettext("Black Couch"); f->setAllTextures("cotton_black.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -1094,7 +1094,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_CHAIR; f = &content_features(i); - f->description = wgettext("Chair"); + f->description = gettext("Chair"); f->setAllTextures("pine.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -1127,7 +1127,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_CHAIR_CENTRE; f = &content_features(i); - f->description = wgettext("Chair"); + f->description = gettext("Chair"); f->setAllTextures("pine.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -1150,7 +1150,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_CHAIR_ENDL; f = &content_features(i); - f->description = wgettext("Chair"); + f->description = gettext("Chair"); f->setAllTextures("pine.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -1173,7 +1173,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_CHAIR_ENDR; f = &content_features(i); - f->description = wgettext("Chair"); + f->description = gettext("Chair"); f->setAllTextures("pine.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -1196,7 +1196,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_CHAIR_INNER; f = &content_features(i); - f->description = wgettext("Chair"); + f->description = gettext("Chair"); f->setAllTextures("pine.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -1219,7 +1219,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_CHAIR_OUTER; f = &content_features(i); - f->description = wgettext("Chair"); + f->description = gettext("Chair"); f->setAllTextures("pine.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -1242,7 +1242,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_TABLE; f = &content_features(i); - f->description = wgettext("Table"); + f->description = gettext("Table"); f->setAllTextures("pine.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; @@ -1272,7 +1272,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_BED_HEAD; f = &content_features(i); - f->description = wgettext("Bed"); + f->description = gettext("Bed"); f->setTexture(0,"cotton.png^bed_head.png"); f->setTexture(1,"bed_bottom.png"); f->setTexture(2,"cotton.png^bed_side_head.png"); @@ -1304,7 +1304,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_BED_FOOT; f = &content_features(i); - f->description = wgettext("Bed"); + f->description = gettext("Bed"); f->setTexture(0,"cotton.png^bed_top.png"); f->setTexture(1,"bed_bottom.png"); f->setTexture(2,"cotton.png^bed_side.png^[transformFX"); @@ -1331,7 +1331,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_BED_BLUE_HEAD; f = &content_features(i); - f->description = wgettext("Blue Bed"); + f->description = gettext("Blue Bed"); f->setTexture(0,"cotton_blue.png^bed_head.png"); f->setTexture(1,"bed_bottom.png"); f->setTexture(2,"cotton_blue.png^bed_side_head.png"); @@ -1363,7 +1363,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_BED_BLUE_FOOT; f = &content_features(i); - f->description = wgettext("Blue Bed"); + f->description = gettext("Blue Bed"); f->setTexture(0,"cotton_blue.png^bed_top.png"); f->setTexture(1,"bed_bottom.png"); f->setTexture(2,"cotton_blue.png^bed_side.png^[transformFX"); @@ -1390,7 +1390,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_BED_GREEN_HEAD; f = &content_features(i); - f->description = wgettext("Green Bed"); + f->description = gettext("Green Bed"); f->setTexture(0,"cotton_green.png^bed_head.png"); f->setTexture(1,"bed_bottom.png"); f->setTexture(2,"cotton_green.png^bed_side_head.png"); @@ -1422,7 +1422,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_BED_GREEN_FOOT; f = &content_features(i); - f->description = wgettext("Green Bed"); + f->description = gettext("Green Bed"); f->setTexture(0,"cotton_green.png^bed_top.png"); f->setTexture(1,"bed_bottom.png"); f->setTexture(2,"cotton_green.png^bed_side.png^[transformFX"); @@ -1449,7 +1449,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_BED_ORANGE_HEAD; f = &content_features(i); - f->description = wgettext("Orange Bed"); + f->description = gettext("Orange Bed"); f->setTexture(0,"cotton_orange.png^bed_head.png"); f->setTexture(1,"bed_bottom.png"); f->setTexture(2,"cotton_orange.png^bed_side_head.png"); @@ -1481,7 +1481,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_BED_ORANGE_FOOT; f = &content_features(i); - f->description = wgettext("Orange Bed"); + f->description = gettext("Orange Bed"); f->setTexture(0,"cotton_orange.png^bed_top.png"); f->setTexture(1,"cotton_orange.png^bed_bottom.png"); f->setTexture(2,"cotton_orange.png^bed_side.png^[transformFX"); @@ -1508,7 +1508,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_BED_PURPLE_HEAD; f = &content_features(i); - f->description = wgettext("Purple Bed"); + f->description = gettext("Purple Bed"); f->setTexture(0,"cotton_purple.png^bed_head.png"); f->setTexture(1,"bed_bottom.png"); f->setTexture(2,"cotton_purple.png^bed_side_head.png"); @@ -1540,7 +1540,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_BED_PURPLE_FOOT; f = &content_features(i); - f->description = wgettext("Purple Bed"); + f->description = gettext("Purple Bed"); f->setTexture(0,"cotton_purple.png^bed_top.png"); f->setTexture(1,"bed_bottom.png"); f->setTexture(2,"cotton_purple.png^bed_side.png^[transformFX"); @@ -1567,7 +1567,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_BED_RED_HEAD; f = &content_features(i); - f->description = wgettext("Red Bed"); + f->description = gettext("Red Bed"); f->setTexture(0,"cotton_red.png^bed_head.png"); f->setTexture(1,"bed_bottom.png"); f->setTexture(2,"cotton_red.png^bed_side_head.png"); @@ -1599,7 +1599,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_BED_RED_FOOT; f = &content_features(i); - f->description = wgettext("Red Bed"); + f->description = gettext("Red Bed"); f->setTexture(0,"cotton_red.png^bed_top.png"); f->setTexture(1,"bed_bottom.png"); f->setTexture(2,"cotton_red.png^bed_side.png^[transformFX"); @@ -1626,7 +1626,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_BED_YELLOW_HEAD; f = &content_features(i); - f->description = wgettext("Yellow Bed"); + f->description = gettext("Yellow Bed"); f->setTexture(0,"cotton_yellow.png^bed_head.png"); f->setTexture(1,"bed_bottom.png"); f->setTexture(2,"cotton_yellow.png^bed_side_head.png"); @@ -1658,7 +1658,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_BED_YELLOW_FOOT; f = &content_features(i); - f->description = wgettext("Yellow Bed"); + f->description = gettext("Yellow Bed"); f->setTexture(0,"cotton_yellow.png^bed_top.png"); f->setTexture(1,"bed_bottom.png"); f->setTexture(2,"cotton_yellow.png^bed_side.png^[transformFX"); @@ -1685,7 +1685,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_BED_BLACK_HEAD; f = &content_features(i); - f->description = wgettext("Black Bed"); + f->description = gettext("Black Bed"); f->setTexture(0,"cotton_black.png^bed_head.png"); f->setTexture(1,"bed_bottom.png"); f->setTexture(2,"cotton_black.png^bed_side_head.png"); @@ -1717,7 +1717,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_BED_BLACK_FOOT; f = &content_features(i); - f->description = wgettext("Black Bed"); + f->description = gettext("Black Bed"); f->setTexture(0,"cotton_black.png^bed_top.png"); f->setTexture(1,"bed_bottom.png"); f->setTexture(2,"cotton_black.png^bed_side.png^[transformFX"); @@ -1744,7 +1744,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_BED_CAMP_HEAD; f = &content_features(i); - f->description = wgettext("Camp Bed"); + f->description = gettext("Camp Bed"); f->setAllTextures("hay_bale.png"); f->setTexture(0,"bed_camp_top.png"); f->setInventoryTexture("bed_camp_inv.png"); @@ -1778,7 +1778,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_BED_CAMP_FOOT; f = &content_features(i); - f->description = wgettext("Camp Bed"); + f->description = gettext("Camp Bed"); f->setAllTextures("hay_bale.png"); f->setTexture(0,"bed_camp_top.png"); f->setInventoryTexture("bed_camp_inv.png"); @@ -1801,7 +1801,7 @@ void content_mapnode_furniture(bool repeat) // Paintings i = CONTENT_PAINTING_WHITE; f = &content_features(i); - f->description = wgettext("Colorful Painting"); + f->description = gettext("Colorful Painting"); f->setAllTextures("painting.png"); f->setTexture(4, "painting.png"); f->setTexture(5, "painting_white.png"); @@ -1835,7 +1835,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_PAINTING_RED; f = &content_features(i); - f->description = wgettext("Red Rose Painting"); + f->description = gettext("Red Rose Painting"); f->setAllTextures("painting.png"); f->setTexture(4, "painting.png"); f->setTexture(5, "painting_red.png"); @@ -1869,7 +1869,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_PAINTING_GREEN; f = &content_features(i); - f->description = wgettext("Field Painting"); + f->description = gettext("Field Painting"); f->setAllTextures("painting.png"); f->setTexture(4, "painting.png"); f->setTexture(5, "painting_green.png"); @@ -1903,7 +1903,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_PAINTING_BLUE; f = &content_features(i); - f->description = wgettext("Blue Flower Painting"); + f->description = gettext("Blue Flower Painting"); f->setAllTextures("painting.png"); f->setTexture(4, "painting.png"); f->setTexture(5, "painting_blue.png"); @@ -1937,7 +1937,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_PAINTING_CANVAS; f = &content_features(i); - f->description = wgettext("Painting Canvas"); + f->description = gettext("Painting Canvas"); f->setAllTextures("painting.png"); f->setTexture(4, "painting.png"); f->setTexture(5, "painting_canvas.png"); @@ -1974,7 +1974,7 @@ void content_mapnode_furniture(bool repeat) i = CONTENT_CLOCK; f = &content_features(i); - f->description = wgettext("Clock"); + f->description = gettext("Clock"); f->setAllTextures("clock.png"); f->setTexture(5, "clock_front.png"); f->setAllMetaTextures("clock_numbers.png"); diff --git a/src/content_mapnode_plants.cpp b/src/content_mapnode_plants.cpp index 2cd92cf..2c1fa04 100644 --- a/src/content_mapnode_plants.cpp +++ b/src/content_mapnode_plants.cpp @@ -38,7 +38,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_TREE; f = &content_features(i); - f->description = wgettext("Tree"); + f->description = gettext("Tree"); f->setAllTextures("tree.png"); f->setTexture(0, "tree_top.png"); f->setTexture(1, "tree_top.png"); @@ -59,7 +59,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_APPLE_TREE; f = &content_features(i); - f->description = wgettext("Apple Tree"); + f->description = gettext("Apple Tree"); f->setAllTextures("apple_tree.png"); f->setTexture(0, "apple_tree_top.png"); f->setTexture(1, "apple_tree_top.png"); @@ -80,7 +80,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_JUNGLETREE; f = &content_features(i); - f->description = wgettext("Jungle Tree"); + f->description = gettext("Jungle Tree"); f->setAllTextures("jungletree.png"); f->setTexture(0, "jungletree_top.png"); f->setTexture(1, "jungletree_top.png"); @@ -100,7 +100,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_CONIFER_TREE; f = &content_features(i); - f->description = wgettext("Conifer Tree"); + f->description = gettext("Conifer Tree"); f->setAllTextures("conifer_tree.png"); f->setTexture(0, "conifer_tree_top.png"); f->setTexture(1, "conifer_tree_top.png"); @@ -121,7 +121,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_YOUNG_TREE; f = &content_features(i); - f->description = wgettext("Young Tree"); + f->description = gettext("Young Tree"); f->setAllTextures("tree.png"); f->setTexture(0, "tree_top.png"); f->setTexture(1, "tree_top.png"); @@ -141,7 +141,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_YOUNG_JUNGLETREE; f = &content_features(i); - f->description = wgettext("Young Jungle Tree"); + f->description = gettext("Young Jungle Tree"); f->setAllTextures("jungletree.png"); f->setTexture(0, "jungletree_top.png"); f->setTexture(1, "jungletree_top.png"); @@ -161,7 +161,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_YOUNG_APPLE_TREE; f = &content_features(i); - f->description = wgettext("Young Apple Tree"); + f->description = gettext("Young Apple Tree"); f->setAllTextures("apple_tree.png"); f->setTexture(0, "apple_tree_top.png"); f->setTexture(1, "apple_tree_top.png"); @@ -181,7 +181,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_YOUNG_CONIFER_TREE; f = &content_features(i); - f->description = wgettext("Young Conifer Tree"); + f->description = gettext("Young Conifer Tree"); f->setAllTextures("conifer_tree.png"); f->setTexture(0, "conifer_tree_top.png"); f->setTexture(1, "conifer_tree_top.png"); @@ -201,7 +201,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_JUNGLEGRASS; f = &content_features(i); - f->description = wgettext("Jungle Grass"); + f->description = gettext("Jungle Grass"); f->setInventoryTexture("junglegrass.png"); f->setAllTextures("junglegrass.png"); f->setTexture(1,"junglegrass_leaf.png"); @@ -222,7 +222,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_JUNGLEFERN; f = &content_features(i); - f->description = wgettext("Jungle Fern"); + f->description = gettext("Jungle Fern"); f->setInventoryTexture("junglegrass.png"); f->setAllTextures("junglegrass.png"); f->setTexture(1,"leaf_big.png"); @@ -243,7 +243,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_LEAVES; f = &content_features(i); - f->description = wgettext("Leaves"); + f->description = gettext("Leaves"); f->light_propagates = true; f->air_equivalent = true; f->walkable = false; @@ -275,7 +275,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_LEAVES_AUTUMN; f = &content_features(i); - f->description = wgettext("Leaves"); + f->description = gettext("Leaves"); f->light_propagates = true; f->air_equivalent = true; f->walkable = false; @@ -307,7 +307,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_LEAVES_WINTER; f = &content_features(i); - f->description = wgettext("Leaves"); + f->description = gettext("Leaves"); f->light_propagates = true; f->air_equivalent = true; f->walkable = false; @@ -339,7 +339,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_LEAVES_SNOWY; f = &content_features(i); - f->description = wgettext("Leaves"); + f->description = gettext("Leaves"); f->light_propagates = true; f->air_equivalent = true; f->walkable = false; @@ -371,7 +371,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_APPLE_LEAVES; f = &content_features(i); - f->description = wgettext("Apple Tree Leaves"); + f->description = gettext("Apple Tree Leaves"); f->light_propagates = true; f->air_equivalent = true; f->walkable = false; @@ -404,7 +404,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_JUNGLELEAVES; f = &content_features(i); - f->description = wgettext("Jungle Leaves"); + f->description = gettext("Jungle Leaves"); f->light_propagates = true; f->air_equivalent = true; f->walkable = false; @@ -436,7 +436,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_CONIFER_LEAVES; f = &content_features(i); - f->description = wgettext("Conifer Leaves"); + f->description = gettext("Conifer Leaves"); f->light_propagates = true; f->air_equivalent = true; f->walkable = false; @@ -468,7 +468,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_TRIMMED_LEAVES; f = &content_features(i); - f->description = wgettext("Trimmed Leaves"); + f->description = gettext("Trimmed Leaves"); f->light_propagates = true; f->air_equivalent = true; f->walkable = false; @@ -493,7 +493,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_TRIMMED_LEAVES_AUTUMN; f = &content_features(i); - f->description = wgettext("Trimmed Leaves"); + f->description = gettext("Trimmed Leaves"); f->light_propagates = true; f->air_equivalent = true; f->walkable = false; @@ -518,7 +518,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_TRIMMED_LEAVES_WINTER; f = &content_features(i); - f->description = wgettext("Trimmed Leaves"); + f->description = gettext("Trimmed Leaves"); f->light_propagates = true; f->air_equivalent = true; f->walkable = false; @@ -543,7 +543,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_TRIMMED_APPLE_LEAVES; f = &content_features(i); - f->description = wgettext("Trimmed Apple Tree Leaves"); + f->description = gettext("Trimmed Apple Tree Leaves"); f->light_propagates = true; f->air_equivalent = true; f->walkable = false; @@ -568,7 +568,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_TRIMMED_JUNGLE_LEAVES; f = &content_features(i); - f->description = wgettext("Trimmed Jungle Leaves"); + f->description = gettext("Trimmed Jungle Leaves"); f->light_propagates = true; f->air_equivalent = true; f->walkable = false; @@ -593,7 +593,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_TRIMMED_CONIFER_LEAVES; f = &content_features(i); - f->description = wgettext("Trimmed Conifer Leaves"); + f->description = gettext("Trimmed Conifer Leaves"); f->light_propagates = true; f->air_equivalent = true; f->walkable = false; @@ -618,7 +618,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_APPLE_BLOSSOM; f = &content_features(i); - f->description = wgettext("Apple Tree Blossom"); + f->description = gettext("Apple Tree Blossom"); f->light_propagates = true; f->air_equivalent = true; f->walkable = false; @@ -643,7 +643,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_TRIMMED_APPLE_BLOSSOM; f = &content_features(i); - f->description = wgettext("Trimmed Apple Tree Blossom"); + f->description = gettext("Trimmed Apple Tree Blossom"); f->light_propagates = true; f->air_equivalent = true; f->walkable = false; @@ -665,7 +665,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_CACTUS_BLOSSOM; f = &content_features(i); - f->description = wgettext("Cactus Blossom"); + f->description = gettext("Cactus Blossom"); f->setInventoryTexture("cactus_blossom.png"); f->setAllTextures("cactus_blossom.png"); f->setAllTextureFlags(0); @@ -685,7 +685,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_CACTUS_FLOWER; f = &content_features(i); - f->description = wgettext("Cactus Flower"); + f->description = gettext("Cactus Flower"); f->setInventoryTexture("cactus_flower.png"); f->setAllTextures("cactus_flower.png"); f->setAllTextureFlags(0); @@ -706,7 +706,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_CACTUS_FRUIT; f = &content_features(i); - f->description = wgettext("Cactus Berry"); + f->description = gettext("Cactus Berry"); f->setInventoryTexture("cactus_fruit.png"); f->setAllTextures("cactus_fruit.png"); f->setAllTextureFlags(0); @@ -726,7 +726,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_CACTUS; f = &content_features(i); - f->description = wgettext("Cactus"); + f->description = gettext("Cactus"); f->setAllTextures("cactus_side.png"); f->setTexture(0, "cactus_top.png"); f->setTexture(1, "cactus_top.png"); @@ -788,7 +788,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_PAPYRUS; f = &content_features(i); - f->description = wgettext("Papyrus"); + f->description = gettext("Papyrus"); f->setInventoryTexture("papyrus.png"); f->setAllTextures("papyrus.png"); f->setAllTextureFlags(0); @@ -811,7 +811,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_SAPLING; f = &content_features(i); - f->description = wgettext("Sapling"); + f->description = gettext("Sapling"); f->param_type = CPT_LIGHT; f->draw_type = CDT_PLANTLIKE; f->setAllTextures("sapling.png"); @@ -832,7 +832,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_APPLE_SAPLING; f = &content_features(i); - f->description = wgettext("Apple Tree Sapling"); + f->description = gettext("Apple Tree Sapling"); f->param_type = CPT_LIGHT; f->draw_type = CDT_PLANTLIKE; f->setAllTextures("apple_sapling.png"); @@ -853,7 +853,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_JUNGLESAPLING; f = &content_features(i); - f->description = wgettext("Jungle Sapling"); + f->description = gettext("Jungle Sapling"); f->param_type = CPT_LIGHT; f->draw_type = CDT_PLANTLIKE; f->setAllTextures("junglesapling.png"); @@ -874,7 +874,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_CONIFER_SAPLING; f = &content_features(i); - f->description = wgettext("Conifer Sapling"); + f->description = gettext("Conifer Sapling"); f->param_type = CPT_LIGHT; f->draw_type = CDT_PLANTLIKE; f->setAllTextures("conifer_sapling.png"); @@ -895,7 +895,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_APPLE; f = &content_features(i); - f->description = wgettext("Apple"); + f->description = gettext("Apple"); f->setInventoryTexture("apple.png"); f->setAllTextures("apple.png"); f->setAllTextureFlags(0); @@ -919,7 +919,7 @@ void content_mapnode_plants(bool repeat) // plants i = CONTENT_WILDGRASS_SHORT; f = &content_features(i); - f->description = wgettext("Wild Grass"); + f->description = gettext("Wild Grass"); f->setInventoryTexture("wildgrass_short.png"); f->setAllTextures("wildgrass_short.png"); f->setAllTextureFlags(0); @@ -942,7 +942,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_WILDGRASS_LONG; f = &content_features(i); - f->description = wgettext("Wild Grass"); + f->description = gettext("Wild Grass"); f->setInventoryTexture("wildgrass_long.png"); f->setAllTextures("wildgrass_long.png"); f->setAllTextureFlags(0); @@ -964,7 +964,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_DEADGRASS; f = &content_features(i); - f->description = wgettext("Dead Grass"); + f->description = gettext("Dead Grass"); f->setInventoryTexture("deadgrass.png"); f->setAllTextures("deadgrass.png"); f->setAllTextureFlags(0); @@ -986,7 +986,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_FLOWER_STEM; f = &content_features(i); - f->description = wgettext("Flower Stem"); + f->description = gettext("Flower Stem"); f->setInventoryTexture("flower_stem.png"); f->setAllTextures("flower_stem.png"); f->setAllTextureFlags(0); @@ -1008,7 +1008,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_FLOWER_ROSE; f = &content_features(i); - f->description = wgettext("Rose"); + f->description = gettext("Rose"); f->setInventoryTexture("flower_rose.png"); f->setAllTextures("flower_rose.png"); f->setAllTextureFlags(0); @@ -1031,7 +1031,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_FLOWER_DAFFODIL; f = &content_features(i); - f->description = wgettext("Daffodil"); + f->description = gettext("Daffodil"); f->setInventoryTexture("flower_daffodil.png"); f->setAllTextures("flower_daffodil.png"); f->setAllTextureFlags(0); @@ -1054,7 +1054,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_FLOWER_TULIP; f = &content_features(i); - f->description = wgettext("Tulip"); + f->description = gettext("Tulip"); f->setInventoryTexture("flower_tulip.png"); f->setAllTextures("flower_tulip.png"); f->setAllTextureFlags(0); @@ -1077,7 +1077,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_SEEDS_TEA; f = &content_features(i); - f->description = wgettext("Tea Seeds"); + f->description = gettext("Tea Seeds"); f->setAllTextures("farm_seeds_tea.png"); f->draw_type = CDT_PLANTLIKE; f->param_type = CPT_LIGHT; @@ -1096,7 +1096,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_TEA; f = &content_features(i); - f->description = wgettext("Tea Plant"); + f->description = gettext("Tea Plant"); f->setInventoryTexture("plant_tea.png"); f->setAllTextures("plant_tea.png"); f->setAllTextureFlags(0); @@ -1119,7 +1119,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_BEANS_COFFEE; f = &content_features(i); - f->description = wgettext("Coffee Beans"); + f->description = gettext("Coffee Beans"); f->setAllTextures("farm_seeds_coffee.png"); f->draw_type = CDT_PLANTLIKE; f->param_type = CPT_LIGHT; @@ -1139,7 +1139,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_COFFEE; f = &content_features(i); - f->description = wgettext("Coffee Plant"); + f->description = gettext("Coffee Plant"); f->setInventoryTexture("plant_coffe.png"); f->setAllTextures("plant_coffee.png"); f->setAllTextureFlags(0); @@ -1161,7 +1161,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_BUSH_BLUEBERRY; f = &content_features(i); - f->description = wgettext("Blueberry Bush"); + f->description = gettext("Blueberry Bush"); f->light_propagates = true; f->air_equivalent = true; f->param_type = CPT_LIGHT; @@ -1191,7 +1191,7 @@ void content_mapnode_plants(bool repeat) i = CONTENT_BUSH_RASPBERRY; f = &content_features(i); - f->description = wgettext("Raspberry Bush"); + f->description = gettext("Raspberry Bush"); f->light_propagates = true; f->air_equivalent = true; f->param_type = CPT_LIGHT; diff --git a/src/content_mapnode_slab.cpp b/src/content_mapnode_slab.cpp index 5d9606d..26f3d8f 100644 --- a/src/content_mapnode_slab.cpp +++ b/src/content_mapnode_slab.cpp @@ -34,7 +34,7 @@ void content_mapnode_slab(bool repeat) // slabs i = CONTENT_ROUGHSTONE_SLAB; f = &content_features(i); - f->description = wgettext("Rough Stone Slab"); + f->description = gettext("Rough Stone Slab"); f->setAllTextures("roughstone.png"); f->param_type = CPT_NONE; f->draw_type = CDT_SLABLIKE; @@ -52,7 +52,7 @@ void content_mapnode_slab(bool repeat) i = CONTENT_COBBLE_SLAB; f = &content_features(i); - f->description = wgettext("Cobble Stone Slab"); + f->description = gettext("Cobble Stone Slab"); f->setAllTextures("cobble.png"); f->param_type = CPT_NONE; f->draw_type = CDT_SLABLIKE; @@ -70,7 +70,7 @@ void content_mapnode_slab(bool repeat) i = CONTENT_MOSSYCOBBLE_SLAB; f = &content_features(i); - f->description = wgettext("Mossy Cobble Stone Slab"); + f->description = gettext("Mossy Cobble Stone Slab"); f->setAllTextures("mossycobble.png"); f->param_type = CPT_NONE; f->draw_type = CDT_SLABLIKE; @@ -88,7 +88,7 @@ void content_mapnode_slab(bool repeat) i = CONTENT_STONE_SLAB; f = &content_features(i); - f->description = wgettext("Stone Slab"); + f->description = gettext("Stone Slab"); f->setAllTextures("stone.png"); f->draw_type = CDT_SLABLIKE; f->is_ground_content = true; @@ -105,7 +105,7 @@ void content_mapnode_slab(bool repeat) i = CONTENT_WOOD_SLAB; f = &content_features(i); - f->description = wgettext("Wood Slab"); + f->description = gettext("Wood Slab"); f->setAllTextures("wood.png"); f->draw_type = CDT_NODEBOX; f->is_ground_content = true; @@ -124,7 +124,7 @@ void content_mapnode_slab(bool repeat) i = CONTENT_JUNGLE_SLAB; f = &content_features(i); - f->description = wgettext("Jungle Wood Slab"); + f->description = gettext("Jungle Wood Slab"); f->setAllTextures("junglewood.png"); f->draw_type = CDT_NODEBOX; //f->is_ground_content = true; @@ -143,7 +143,7 @@ void content_mapnode_slab(bool repeat) i = CONTENT_BRICK_SLAB; f = &content_features(i); - f->description = wgettext("Brick Slab"); + f->description = gettext("Brick Slab"); f->setAllTextures("brick.png"); f->setTexture(0,"brick_slab_top.png"); f->setTexture(1,"brick_bottom.png"); @@ -164,7 +164,7 @@ void content_mapnode_slab(bool repeat) i = CONTENT_SANDSTONE_SLAB; f = &content_features(i); - f->description = wgettext("Sand Stone Slab"); + f->description = gettext("Sand Stone Slab"); f->setAllTextures("sandstone.png"); f->draw_type = CDT_SLABLIKE; f->is_ground_content = true; @@ -181,7 +181,7 @@ void content_mapnode_slab(bool repeat) i = CONTENT_GLASS_SLAB; f = &content_features(i); - f->description = wgettext("Glass Slab"); + f->description = gettext("Glass Slab"); f->light_propagates = true; f->sunlight_propagates = true; f->param_type = CPT_LIGHT; @@ -206,7 +206,7 @@ void content_mapnode_slab(bool repeat) i = CONTENT_GLASS_BLUE_SLAB; f = &content_features(i); - f->description = wgettext("Blue Glass Slab"); + f->description = gettext("Blue Glass Slab"); f->light_propagates = true; f->sunlight_propagates = true; f->param_type = CPT_LIGHT; @@ -232,7 +232,7 @@ void content_mapnode_slab(bool repeat) i = CONTENT_GLASS_GREEN_SLAB; f = &content_features(i); - f->description = wgettext("Green Glass Slab"); + f->description = gettext("Green Glass Slab"); f->light_propagates = true; f->sunlight_propagates = true; f->param_type = CPT_LIGHT; @@ -258,7 +258,7 @@ void content_mapnode_slab(bool repeat) i = CONTENT_GLASS_ORANGE_SLAB; f = &content_features(i); - f->description = wgettext("Orange Glass Slab"); + f->description = gettext("Orange Glass Slab"); f->light_propagates = true; f->sunlight_propagates = true; f->param_type = CPT_LIGHT; @@ -284,7 +284,7 @@ void content_mapnode_slab(bool repeat) i = CONTENT_GLASS_PURPLE_SLAB; f = &content_features(i); - f->description = wgettext("Purple Glass Slab"); + f->description = gettext("Purple Glass Slab"); f->light_propagates = true; f->sunlight_propagates = true; f->param_type = CPT_LIGHT; @@ -310,7 +310,7 @@ void content_mapnode_slab(bool repeat) i = CONTENT_GLASS_RED_SLAB; f = &content_features(i); - f->description = wgettext("Red Glass Slab"); + f->description = gettext("Red Glass Slab"); f->light_propagates = true; f->sunlight_propagates = true; f->param_type = CPT_LIGHT; @@ -336,7 +336,7 @@ void content_mapnode_slab(bool repeat) i = CONTENT_GLASS_YELLOW_SLAB; f = &content_features(i); - f->description = wgettext("Yellow Glass Slab"); + f->description = gettext("Yellow Glass Slab"); f->light_propagates = true; f->sunlight_propagates = true; f->param_type = CPT_LIGHT; @@ -362,7 +362,7 @@ void content_mapnode_slab(bool repeat) i = CONTENT_GLASS_BLACK_SLAB; f = &content_features(i); - f->description = wgettext("Black Glass Slab"); + f->description = gettext("Black Glass Slab"); f->light_propagates = true; f->sunlight_propagates = true; f->param_type = CPT_LIGHT; @@ -388,7 +388,7 @@ void content_mapnode_slab(bool repeat) i = CONTENT_LIMESTONE_SLAB; f = &content_features(i); - f->description = wgettext("Limestone Slab"); + f->description = gettext("Limestone Slab"); f->setAllTextures("limestone.png"); f->param_type = CPT_NONE; f->draw_type = CDT_SLABLIKE; @@ -421,7 +421,7 @@ void content_mapnode_slab(bool repeat) i = CONTENT_COBBLE_SLAB_UD; f = &content_features(i); - f->description = wgettext("Cobble Stone Slab"); + f->description = gettext("Cobble Stone Slab"); f->setAllTextures("cobble.png"); f->param_type = CPT_NONE; f->draw_type = CDT_SLABLIKE; @@ -523,7 +523,7 @@ void content_mapnode_slab(bool repeat) i = CONTENT_GLASS_SLAB_UD; f = &content_features(i); - f->description = wgettext("Glass Slab"); + f->description = gettext("Glass Slab"); f->light_propagates = true; f->sunlight_propagates = true; f->param_type = CPT_LIGHT; @@ -545,7 +545,7 @@ void content_mapnode_slab(bool repeat) i = CONTENT_GLASS_BLUE_SLAB_UD; f = &content_features(i); - f->description = wgettext("Blue Glass Slab"); + f->description = gettext("Blue Glass Slab"); f->light_propagates = true; f->sunlight_propagates = true; f->param_type = CPT_LIGHT; @@ -567,7 +567,7 @@ void content_mapnode_slab(bool repeat) i = CONTENT_GLASS_GREEN_SLAB_UD; f = &content_features(i); - f->description = wgettext("Green Glass Slab"); + f->description = gettext("Green Glass Slab"); f->light_propagates = true; f->sunlight_propagates = true; f->param_type = CPT_LIGHT; @@ -589,7 +589,7 @@ void content_mapnode_slab(bool repeat) i = CONTENT_GLASS_ORANGE_SLAB_UD; f = &content_features(i); - f->description = wgettext("Orange Glass Slab"); + f->description = gettext("Orange Glass Slab"); f->light_propagates = true; f->sunlight_propagates = true; f->param_type = CPT_LIGHT; @@ -611,7 +611,7 @@ void content_mapnode_slab(bool repeat) i = CONTENT_GLASS_PURPLE_SLAB_UD; f = &content_features(i); - f->description = wgettext("Purple Glass Slab"); + f->description = gettext("Purple Glass Slab"); f->light_propagates = true; f->sunlight_propagates = true; f->param_type = CPT_LIGHT; @@ -633,7 +633,7 @@ void content_mapnode_slab(bool repeat) i = CONTENT_GLASS_RED_SLAB_UD; f = &content_features(i); - f->description = wgettext("Red Glass Slab"); + f->description = gettext("Red Glass Slab"); f->light_propagates = true; f->sunlight_propagates = true; f->param_type = CPT_LIGHT; @@ -655,7 +655,7 @@ void content_mapnode_slab(bool repeat) i = CONTENT_GLASS_YELLOW_SLAB_UD; f = &content_features(i); - f->description = wgettext("Yellow Glass Slab"); + f->description = gettext("Yellow Glass Slab"); f->light_propagates = true; f->sunlight_propagates = true; f->param_type = CPT_LIGHT; @@ -677,7 +677,7 @@ void content_mapnode_slab(bool repeat) i = CONTENT_GLASS_BLACK_SLAB_UD; f = &content_features(i); - f->description = wgettext("Black Glass Slab"); + f->description = gettext("Black Glass Slab"); f->light_propagates = true; f->sunlight_propagates = true; f->param_type = CPT_LIGHT; diff --git a/src/content_mapnode_special.cpp b/src/content_mapnode_special.cpp index c4d132b..966895e 100644 --- a/src/content_mapnode_special.cpp +++ b/src/content_mapnode_special.cpp @@ -34,7 +34,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_FENCE; f = &content_features(i); - f->description = wgettext("Fence"); + f->description = gettext("Fence"); f->setAllTextures("fence.png"); f->setTexture(0,"fence_top.png"); f->setTexture(1,"fence_top.png"); @@ -62,7 +62,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_STEEL_FENCE; f = &content_features(i); - f->description = wgettext("Steel Fence"); + f->description = gettext("Steel Fence"); f->setAllTextures("fence_steel.png"); f->setTexture(0,"fence_steel_top.png"); f->setTexture(1,"fence_steel_top.png"); @@ -89,7 +89,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_JUNGLE_FENCE; f = &content_features(i); - f->description = wgettext("Jungle Wood Fence"); + f->description = gettext("Jungle Wood Fence"); f->setAllTextures("fence_jungle.png"); f->setTexture(0,"fence_jungle_top.png"); f->setTexture(1,"fence_jungle_top.png"); @@ -117,7 +117,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_PINE_FENCE; f = &content_features(i); - f->description = wgettext("Pine Fence"); + f->description = gettext("Pine Fence"); f->setAllTextures("fence_pine.png"); f->setTexture(0,"fence_pine_top.png"); f->setTexture(1,"fence_pine_top.png"); @@ -145,7 +145,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_STEEL_BARS; f = &content_features(i); - f->description = wgettext("Steel Bars"); + f->description = gettext("Steel Bars"); f->setAllTextures("steel_block.png"); f->light_propagates = true; f->param_type = CPT_LIGHT; @@ -173,7 +173,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_RAIL; f = &content_features(i); - f->description = wgettext("Rail"); + f->description = gettext("Rail"); f->setAllTextures("rail.png"); f->setTexture(0,"track_tie.png"); f->setTexture(1,"track_rail.png"); @@ -205,7 +205,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_ROOFTILE_TERRACOTTA; f = &content_features(i); - f->description = wgettext("Terracotta Roof Tile"); + f->description = gettext("Terracotta Roof Tile"); f->setAllTextures("rooftile_terracotta.png"); f->setAllTextureFlags(0); f->draw_type = CDT_ROOFLIKE; @@ -221,7 +221,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_ROOFTILE_WOOD; f = &content_features(i); - f->description = wgettext("Wood Roof Tile"); + f->description = gettext("Wood Roof Tile"); f->setAllTextures("rooftile_wood.png"); f->setAllTextureFlags(0); f->draw_type = CDT_ROOFLIKE; @@ -238,7 +238,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_ROOFTILE_ASPHALT; f = &content_features(i); - f->description = wgettext("Asphalt Roof Tile"); + f->description = gettext("Asphalt Roof Tile"); f->setAllTextures("rooftile_asphalt.png"); f->setAllTextureFlags(0); f->draw_type = CDT_ROOFLIKE; @@ -261,7 +261,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_ROOFTILE_STONE; f = &content_features(i); - f->description = wgettext("Stone Roof Tile"); + f->description = gettext("Stone Roof Tile"); f->setAllTextures("rooftile_stone.png"); f->setAllTextureFlags(0); f->draw_type = CDT_ROOFLIKE; @@ -277,7 +277,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_ROOFTILE_GLASS; f = &content_features(i); - f->description = wgettext("Glass Roof Tile"); + f->description = gettext("Glass Roof Tile"); f->setAllTextures("glass.png"); f->setTexture(1,"glass_slab.png"); // special texture for top sections f->setAllTextureFlags(0); @@ -299,7 +299,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_ROOFTILE_GLASS_BLUE; f = &content_features(i); - f->description = wgettext("Blue Glass Roof Tile"); + f->description = gettext("Blue Glass Roof Tile"); f->setAllTextures("glass.png^glass_pane_blue_side.png"); f->setTexture(1,"glass_slab.png^glass_pane_blue_side.png"); // special texture for top sections f->setAllTextureFlags(0); @@ -322,7 +322,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_ROOFTILE_GLASS_GREEN; f = &content_features(i); - f->description = wgettext("Green Glass Roof Tile"); + f->description = gettext("Green Glass Roof Tile"); f->setAllTextures("glass.png^glass_pane_green_side.png"); f->setTexture(1,"glass_slab.png^glass_pane_green_side.png"); // special texture for top sections f->setAllTextureFlags(0); @@ -345,7 +345,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_ROOFTILE_GLASS_ORANGE; f = &content_features(i); - f->description = wgettext("Orange Glass Roof Tile"); + f->description = gettext("Orange Glass Roof Tile"); f->setAllTextures("glass.png^glass_pane_orange_side.png"); f->setTexture(1,"glass_slab.png^glass_pane_orange_side.png"); // special texture for top sections f->setAllTextureFlags(0); @@ -368,7 +368,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_ROOFTILE_GLASS_PURPLE; f = &content_features(i); - f->description = wgettext("Purple Glass Roof Tile"); + f->description = gettext("Purple Glass Roof Tile"); f->setAllTextures("glass.png^glass_pane_purple_side.png"); f->setTexture(1,"glass_slab.png^glass_pane_purple_side.png"); // special texture for top sections f->setAllTextureFlags(0); @@ -391,7 +391,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_ROOFTILE_GLASS_RED; f = &content_features(i); - f->description = wgettext("Red Glass Roof Tile"); + f->description = gettext("Red Glass Roof Tile"); f->setAllTextures("glass.png^glass_pane_red_side.png"); f->setTexture(1,"glass_slab.png^glass_pane_red_side.png"); // special texture for top sections f->setAllTextureFlags(0); @@ -414,7 +414,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_ROOFTILE_GLASS_YELLOW; f = &content_features(i); - f->description = wgettext("Yellow Glass Roof Tile"); + f->description = gettext("Yellow Glass Roof Tile"); f->setAllTextures("glass.png^glass_pane_yellow_side.png"); f->setTexture(1,"glass_slab.png^glass_pane_yellow_side.png"); // special texture for top sections f->setAllTextureFlags(0); @@ -437,7 +437,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_ROOFTILE_GLASS_BLACK; f = &content_features(i); - f->description = wgettext("Black Glass Roof Tile"); + f->description = gettext("Black Glass Roof Tile"); f->setAllTextures("glass.png^glass_pane_black_side.png"); f->setTexture(1,"glass_slab.png^glass_pane_black_side.png"); // special texture for top sections f->setAllTextureFlags(0); @@ -460,7 +460,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_ROOFTILE_THATCH; f = &content_features(i); - f->description = wgettext("Thatch Roof Tile"); + f->description = gettext("Thatch Roof Tile"); f->setAllTextures("rooftile_thatch.png"); f->setAllTextureFlags(0); f->draw_type = CDT_ROOFLIKE; @@ -478,7 +478,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_LADDER_WALL; f = &content_features(i); - f->description = wgettext("Ladder"); + f->description = gettext("Ladder"); f->setAllTextures("ladder.png"); f->light_propagates = true; f->param_type = CPT_LIGHT; @@ -537,7 +537,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_LADDER_FLOOR; f = &content_features(i); - f->description = wgettext("Ladder"); + f->description = gettext("Ladder"); f->setAllTextures("ladder.png"); f->light_propagates = true; f->param_type = CPT_LIGHT; @@ -571,7 +571,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_LADDER_ROOF; f = &content_features(i); - f->description = wgettext("Ladder"); + f->description = gettext("Ladder"); f->setAllTextures("ladder.png"); f->light_propagates = true; f->param_type = CPT_LIGHT; @@ -605,7 +605,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_BORDERSTONE; f = &content_features(i); - f->description = wgettext("Border Stone"); + f->description = gettext("Border Stone"); f->setAllTextures("borderstone.png"); f->setInventoryTextureCube("borderstone.png", "borderstone.png", "borderstone.png"); f->draw_type = CDT_CUBELIKE; @@ -632,7 +632,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_BOOK; f = &content_features(i); - f->description = wgettext("Book"); + f->description = gettext("Book"); f->setTexture(0, "book_cover.png"); f->setTexture(1, "book_cover.png^[transformFX"); f->setTexture(2, "book_side.png^[transformFY"); @@ -663,7 +663,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_COOK_BOOK; f = &content_features(i); - f->description = wgettext("Cook Book"); + f->description = gettext("Cook Book"); f->setTexture(0, "book_cook_cover.png"); f->setTexture(1, "book_cook_cover.png^[transformFX"); f->setTexture(2, "book_cook_side.png^[transformFY"); @@ -694,7 +694,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_DECRAFT_BOOK; f = &content_features(i); - f->description = wgettext("Decraft Book"); + f->description = gettext("Decraft Book"); f->setTexture(0, "book_decraft_cover.png"); f->setTexture(1, "book_decraft_cover.png^[transformFX"); f->setTexture(2, "book_decraft_side.png^[transformFY"); @@ -724,7 +724,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_DIARY_BOOK; f = &content_features(i); - f->description = wgettext("Diary"); + f->description = gettext("Diary"); f->setTexture(0, "book_diary_cover.png"); f->setTexture(1, "book_diary_cover.png^[transformFX"); f->setTexture(2, "book_diary_side.png^[transformFY"); @@ -755,7 +755,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_CRAFT_BOOK; f = &content_features(i); - f->description = wgettext("Craft Book"); + f->description = gettext("Craft Book"); f->setTexture(0, "book_craft_cover.png"); f->setTexture(1, "book_craft_cover.png^[transformFX"); f->setTexture(2, "book_craft_side.png^[transformFY"); @@ -794,7 +794,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_RCRAFT_BOOK; f = &content_features(i); - f->description = wgettext("Reverse Craft Book"); + f->description = gettext("Reverse Craft Book"); f->setTexture(0, "book_rcraft_cover.png"); f->setTexture(1, "book_rcraft_cover.png^[transformFX"); f->setTexture(2, "book_rcraft_side.png^[transformFY"); @@ -831,7 +831,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_BOOK_OPEN; f = &content_features(i); - f->description = wgettext("Guide"); + f->description = gettext("Guide"); f->setAllTextures("guide_side.png"); f->setTexture(0, "guide_top.png"); f->setTexture(1, "guide_bottom.png"); @@ -859,7 +859,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_COOK_BOOK_OPEN; f = &content_features(i); - f->description = wgettext("Cooking Guide"); + f->description = gettext("Cooking Guide"); f->setAllTextures("guide_cook_side.png"); f->setTexture(0, "guide_cook_top.png"); f->setTexture(1, "guide_cook_bottom.png"); @@ -886,7 +886,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_DECRAFT_BOOK_OPEN; f = &content_features(i); - f->description = wgettext("Decrafting Guide"); + f->description = gettext("Decrafting Guide"); f->setAllTextures("guide_decraft_side.png"); f->setTexture(0, "guide_decraft_top.png"); f->setTexture(1, "guide_decraft_bottom.png"); @@ -913,7 +913,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_DIARY_BOOK_OPEN; f = &content_features(i); - f->description = wgettext("Diary"); + f->description = gettext("Diary"); f->setAllTextures("guide_diary_side.png"); f->setTexture(0, "guide_diary_top.png"); f->setTexture(1, "guide_diary_bottom.png"); @@ -941,7 +941,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_CRAFT_BOOK_OPEN; f = &content_features(i); - f->description = wgettext("Craft Guide"); + f->description = gettext("Craft Guide"); f->setAllTextures("guide_craft_side.png"); f->setTexture(0, "guide_craft_top.png"); f->setTexture(1, "guide_craft_bottom.png"); @@ -968,7 +968,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_RCRAFT_BOOK_OPEN; f = &content_features(i); - f->description = wgettext("Reverse Craft Guide"); + f->description = gettext("Reverse Craft Guide"); f->setAllTextures("guide_rcraft_side.png"); f->setTexture(0, "guide_rcraft_top.png"); f->setTexture(1, "guide_rcraft_bottom.png"); @@ -995,7 +995,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_FIRE; f = &content_features(i); - f->description = wgettext("Fire"); + f->description = gettext("Fire"); f->setAllTextures("fire.png"); f->setAllTextureFlags(0); f->param_type = CPT_LIGHT; @@ -1015,7 +1015,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_FIRE_SHORTTERM; f = &content_features(i); - f->description = wgettext("Fire"); + f->description = gettext("Fire"); f->setAllTextures("fire.png"); f->setAllTextureFlags(0); f->param_type = CPT_LIGHT; @@ -1034,7 +1034,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_TORCH; f = &content_features(i); - f->description = wgettext("Torch"); + f->description = gettext("Torch"); f->setAllTextures("torch.png"); f->setInventoryTexture("torch_inventory.png"); f->setAllTextureFlags(0); @@ -1061,7 +1061,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_SIGN_WALL; f = &content_features(i); - f->description = wgettext("Sign"); + f->description = gettext("Sign"); f->setAllTextures("sign_wall.png"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_WALLMOUNT; @@ -1087,7 +1087,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_SIGN; f = &content_features(i); - f->description = wgettext("Sign"); + f->description = gettext("Sign"); f->setAllTextures("sign.png"); f->setTexture(4, "sign_back.png"); f->setTexture(5, "sign_front.png"); // Z- @@ -1120,7 +1120,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_SIGN_UD; f = &content_features(i); - f->description = wgettext("Sign"); + f->description = gettext("Sign"); f->setAllTextures("sign.png"); f->setTexture(4, "sign_back_ud.png"); f->setTexture(5, "sign_front_ud.png"); // Z- @@ -1148,7 +1148,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_LOCKABLE_SIGN_WALL; f = &content_features(i); - f->description = wgettext("Locking Sign"); + f->description = gettext("Locking Sign"); f->setAllTextures("sign.png"); f->setTexture(4, "sign_back.png"); f->setTexture(5, "sign_wall_lock.png"); // Z- @@ -1178,7 +1178,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_LOCKABLE_SIGN; f = &content_features(i); - f->description = wgettext("Locking Sign"); + f->description = gettext("Locking Sign"); f->setAllTextures("sign.png"); f->setTexture(4, "sign_back.png"); f->setTexture(5, "sign_lock.png"); // Z- @@ -1210,7 +1210,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_LOCKABLE_SIGN_UD; f = &content_features(i); - f->description = wgettext("Locking Sign"); + f->description = gettext("Locking Sign"); f->setAllTextures("sign.png"); f->setTexture(4, "sign_back_ud.png"); f->setTexture(5, "sign_lock_ud.png"); // Z- @@ -1239,7 +1239,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_CHEST; f = &content_features(i); - f->description = wgettext("Chest"); + f->description = gettext("Chest"); f->param_type = CPT_FACEDIR_SIMPLE; f->draw_type = CDT_CUBELIKE; f->setAllTextures("chest_side.png"); @@ -1263,7 +1263,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_CREATIVE_CHEST; f = &content_features(i); - f->description = wgettext("Creative Chest"); + f->description = gettext("Creative Chest"); f->param_type = CPT_FACEDIR_SIMPLE; f->draw_type = CDT_CUBELIKE; f->setAllTextures("chest_side.png"); @@ -1284,7 +1284,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_LOCKABLE_CHEST; f = &content_features(i); - f->description = wgettext("Locking Chest"); + f->description = gettext("Locking Chest"); f->param_type = CPT_FACEDIR_SIMPLE; f->draw_type = CDT_CUBELIKE; f->setAllTextures("chest_side.png"); @@ -1315,7 +1315,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_SAFE; f = &content_features(i); - f->description = wgettext("Safe"); + f->description = gettext("Safe"); f->param_type = CPT_FACEDIR_SIMPLE; f->draw_type = CDT_CUBELIKE; f->setAllTextures("safe_side.png"); @@ -1337,7 +1337,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_FURNACE; f = &content_features(i); - f->description = wgettext("Furnace"); + f->description = gettext("Furnace"); f->param_type = CPT_FACEDIR_SIMPLE; f->draw_type = CDT_NODEBOX_META; f->setAllTextures("furnace_side.png"); @@ -1363,7 +1363,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_FURNACE_ACTIVE; f = &content_features(i); - f->description = wgettext("Furnace"); + f->description = gettext("Furnace"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; f->draw_type = CDT_CUBELIKE; @@ -1381,7 +1381,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_LOCKABLE_FURNACE; f = &content_features(i); - f->description = wgettext("Locking Furnace"); + f->description = gettext("Locking Furnace"); f->param_type = CPT_FACEDIR_SIMPLE; f->draw_type = CDT_NODEBOX_META; f->setAllTextures("furnace_side.png"); @@ -1408,7 +1408,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_LOCKABLE_FURNACE_ACTIVE; f = &content_features(i); - f->description = wgettext("Locking Furnace"); + f->description = gettext("Locking Furnace"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; f->draw_type = CDT_CUBELIKE; @@ -1426,7 +1426,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_INCINERATOR; f = &content_features(i); - f->description = wgettext("Incinerator"); + f->description = gettext("Incinerator"); f->param_type = CPT_FACEDIR_SIMPLE; f->draw_type = CDT_NODEBOX_META; f->setAllTextures("incinerator_side.png"); @@ -1451,7 +1451,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_INCINERATOR_ACTIVE; f = &content_features(i); - f->description = wgettext("Incinerator"); + f->description = gettext("Incinerator"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; f->draw_type = CDT_CUBELIKE; @@ -1471,7 +1471,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_CAMPFIRE; f = &content_features(i); - f->description = wgettext("Camp Fire"); + f->description = gettext("Camp Fire"); f->draw_type = CDT_CAMPFIRELIKE; f->param_type = CPT_LIGHT; f->draw_type = CDT_CAMPFIRELIKE; @@ -1513,7 +1513,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_NC; f = &content_features(i); - f->description = wgettext("Nyan Cat"); + f->description = gettext("Nyan Cat"); f->param_type = CPT_FACEDIR_SIMPLE; f->draw_type = CDT_CUBELIKE; f->setAllTextures("nc_side.png"); @@ -1527,7 +1527,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_NC_RB; f = &content_features(i); - f->description = wgettext("Rainbow"); + f->description = gettext("Rainbow"); f->draw_type = CDT_CUBELIKE; f->setAllTextures("nc_rb.png"); f->setInventoryTextureCube("nc_rb.png", "nc_rb.png", "nc_rb.png"); @@ -1539,7 +1539,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_FLOWER_POT_RAW; f = &content_features(i); f->param_type = CPT_LIGHT; - f->description = wgettext("Unbaked Flower Pot"); + f->description = gettext("Unbaked Flower Pot"); f->setAllTextures("flower_pot_raw.png"); f->setTexture(0,"flower_pot_raw_top.png"); f->setTexture(1,"flower_pot_raw_bottom.png"); @@ -1560,7 +1560,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_FLOWER_POT; f = &content_features(i); f->param_type = CPT_LIGHT; - f->description = wgettext("Flower Pot"); + f->description = gettext("Flower Pot"); f->setAllTextures("flower_pot.png"); f->setTexture(0,"flower_pot_top.png"); f->setTexture(1,"flower_pot_bottom.png"); @@ -1577,7 +1577,7 @@ void content_mapnode_special(bool repeat) // walls i = CONTENT_COBBLE_WALL; f = &content_features(i); - f->description = wgettext("Cobblestone Wall"); + f->description = gettext("Cobblestone Wall"); f->setAllTextures("cobble.png"); f->light_propagates = true; f->jumpable = false; @@ -1600,7 +1600,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_ROUGHSTONE_WALL; f = &content_features(i); - f->description = wgettext("Rough Stone Wall"); + f->description = gettext("Rough Stone Wall"); f->setAllTextures("roughstone.png"); f->light_propagates = true; f->jumpable = false; @@ -1623,7 +1623,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_MOSSYCOBBLE_WALL; f = &content_features(i); - f->description = wgettext("Mossy Cobblestone Wall"); + f->description = gettext("Mossy Cobblestone Wall"); f->setAllTextures("mossycobble.png"); f->light_propagates = true; f->jumpable = false; @@ -1646,7 +1646,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_STONE_WALL; f = &content_features(i); - f->description = wgettext("Stone Wall"); + f->description = gettext("Stone Wall"); f->setAllTextures("stone.png"); f->light_propagates = true; f->jumpable = false; @@ -1669,7 +1669,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_SANDSTONE_WALL; f = &content_features(i); - f->description = wgettext("Sand Stone Wall"); + f->description = gettext("Sand Stone Wall"); f->setAllTextures("sandstone.png"); f->light_propagates = true; f->jumpable = false; @@ -1692,7 +1692,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_LIMESTONE_WALL; f = &content_features(i); - f->description = wgettext("Limestone Wall"); + f->description = gettext("Limestone Wall"); f->setAllTextures("limestone.png"); f->light_propagates = true; f->jumpable = false; @@ -1715,7 +1715,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_MARBLE_WALL; f = &content_features(i); - f->description = wgettext("Marble Wall"); + f->description = gettext("Marble Wall"); f->setAllTextures("marble.png"); f->light_propagates = true; f->jumpable = false; @@ -1738,7 +1738,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_TNT; f = &content_features(i); - f->description = wgettext("TNT"); + f->description = gettext("TNT"); f->setAllTextures("tnt.png"); f->setTexture(0, "tnt_top.png"); f->setTexture(1, "tnt_bottom.png"); @@ -1758,7 +1758,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_FLASH; f = &content_features(i); - f->description = wgettext("In-Progress explosion - how did you get this???"); + f->description = gettext("In-Progress explosion - how did you get this???"); f->setAllTextures("flash.png"); f->param_type = CPT_LIGHT; f->draw_type = CDT_GLASSLIKE; @@ -1777,7 +1777,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_STEAM; f = &content_features(i); - f->description = wgettext("Steam"); + f->description = gettext("Steam"); f->setAllTextures("steam.png"); f->param_type = CPT_LIGHT; f->draw_type = CDT_GLASSLIKE; @@ -1797,7 +1797,7 @@ void content_mapnode_special(bool repeat) // flags i = CONTENT_FLAG; f = &content_features(i); - f->description = wgettext("Home Flag"); + f->description = gettext("Home Flag"); f->setAllTextures("flag.png"); f->setAllTextureFlags(0); f->light_propagates = true; @@ -1842,7 +1842,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_FLAG_BLUE; f = &content_features(i); - f->description = wgettext("Blue Home Flag"); + f->description = gettext("Blue Home Flag"); f->setAllTextures("flag_blue.png"); f->setAllTextureFlags(0); f->light_propagates = true; @@ -1866,7 +1866,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_FLAG_GREEN; f = &content_features(i); - f->description = wgettext("Green Home Flag"); + f->description = gettext("Green Home Flag"); f->setAllTextures("flag_green.png"); f->setAllTextureFlags(0); f->light_propagates = true; @@ -1890,7 +1890,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_FLAG_ORANGE; f = &content_features(i); - f->description = wgettext("Orange Home Flag"); + f->description = gettext("Orange Home Flag"); f->setAllTextures("flag_orange.png"); f->setAllTextureFlags(0); f->light_propagates = true; @@ -1914,7 +1914,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_FLAG_PURPLE; f = &content_features(i); - f->description = wgettext("Purple Home Flag"); + f->description = gettext("Purple Home Flag"); f->setAllTextures("flag_purple.png"); f->setAllTextureFlags(0); f->light_propagates = true; @@ -1938,7 +1938,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_FLAG_RED; f = &content_features(i); - f->description = wgettext("Red Home Flag"); + f->description = gettext("Red Home Flag"); f->setAllTextures("flag_red.png"); f->setAllTextureFlags(0); f->light_propagates = true; @@ -1962,7 +1962,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_FLAG_YELLOW; f = &content_features(i); - f->description = wgettext("Yellow Home Flag"); + f->description = gettext("Yellow Home Flag"); f->setAllTextures("flag_yellow.png"); f->setAllTextureFlags(0); f->light_propagates = true; @@ -1986,7 +1986,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_FLAG_BLACK; f = &content_features(i); - f->description = wgettext("Black Home Flag"); + f->description = gettext("Black Home Flag"); f->setAllTextures("flag_black.png"); f->setAllTextureFlags(0); f->light_propagates = true; @@ -2010,7 +2010,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_LIFE_SUPPORT; f = &content_features(i); - f->description = wgettext("Life Support System"); + f->description = gettext("Life Support System"); f->setAllTextures("life_support.png"); f->setTexture(0, "life_support_top.png"); f->setTexture(1, "life_support_bottom.png"); @@ -2034,7 +2034,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_PARCEL; f = &content_features(i); - f->description = wgettext("Parcel"); + f->description = gettext("Parcel"); f->setAllTextures("parcel.png"); f->setTexture(0, "parcel_top.png"); f->setTexture(1, "parcel_bottom.png"); @@ -2059,7 +2059,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_CAULDRON; f = &content_features(i); - f->description = wgettext("Cauldron"); + f->description = gettext("Cauldron"); f->setAllTextures("cauldron_outer.png"); f->setAllMetaTextures("cauldron_inner.png"); f->setMetaTexture(0,"water.png"); @@ -2079,7 +2079,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_FORGE; f = &content_features(i); - f->description = wgettext("Forge"); + f->description = gettext("Forge"); f->setAllTextures("forge_side.png"); f->setTexture(0,"forge_top.png"); f->setTexture(1,"forge_bottom.png"); @@ -2106,7 +2106,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_FORGE_FIRE; f = &content_features(i); - f->description = wgettext("Forge Fire"); + f->description = gettext("Forge Fire"); f->setAllTextures("forge_fire.png"); f->setAllTextureFlags(0); f->param_type = CPT_LIGHT; @@ -2125,7 +2125,7 @@ void content_mapnode_special(bool repeat) i = CONTENT_SCAFFOLDING; f = &content_features(i); - f->description = wgettext("Scaffolding"); + f->description = gettext("Scaffolding"); f->setAllTextures("wood.png"); f->air_equivalent = true; f->climbable = true; diff --git a/src/content_mapnode_stair.cpp b/src/content_mapnode_stair.cpp index ff3df6f..a1aa861 100644 --- a/src/content_mapnode_stair.cpp +++ b/src/content_mapnode_stair.cpp @@ -34,7 +34,7 @@ void content_mapnode_stair(bool repeat) // stairs i = CONTENT_ROUGHSTONE_STAIR; f = &content_features(i); - f->description = wgettext("Rough Stone Stair"); + f->description = gettext("Rough Stone Stair"); f->param_type = CPT_FACEDIR_SIMPLE; f->setAllTextures("roughstone.png"); f->draw_type = CDT_STAIRLIKE; @@ -52,7 +52,7 @@ void content_mapnode_stair(bool repeat) i = CONTENT_COBBLE_STAIR; f = &content_features(i); - f->description = wgettext("Cobble Stone Stair"); + f->description = gettext("Cobble Stone Stair"); f->param_type = CPT_FACEDIR_SIMPLE; f->setAllTextures("cobble.png"); f->draw_type = CDT_STAIRLIKE; @@ -70,7 +70,7 @@ void content_mapnode_stair(bool repeat) i = CONTENT_MOSSYCOBBLE_STAIR; f = &content_features(i); - f->description = wgettext("Mossy Cobble Stone Stair"); + f->description = gettext("Mossy Cobble Stone Stair"); f->param_type = CPT_FACEDIR_SIMPLE; f->setAllTextures("mossycobble.png"); f->draw_type = CDT_STAIRLIKE; @@ -88,7 +88,7 @@ void content_mapnode_stair(bool repeat) i = CONTENT_STONE_STAIR; f = &content_features(i); - f->description = wgettext("Stone Stair"); + f->description = gettext("Stone Stair"); f->param_type = CPT_FACEDIR_SIMPLE; f->setAllTextures("stone.png"); f->draw_type = CDT_STAIRLIKE; @@ -107,7 +107,7 @@ void content_mapnode_stair(bool repeat) i = CONTENT_WOOD_STAIR; f = &content_features(i); - f->description = wgettext("Wood Stair"); + f->description = gettext("Wood Stair"); f->param_type = CPT_FACEDIR_SIMPLE; f->draw_type = CDT_STAIRLIKE; f->setAllTextures("wood.png"); @@ -127,7 +127,7 @@ void content_mapnode_stair(bool repeat) i = CONTENT_JUNGLE_STAIR; f = &content_features(i); - f->description = wgettext("Jungle Wood Stair"); + f->description = gettext("Jungle Wood Stair"); f->param_type = CPT_FACEDIR_SIMPLE; f->setAllTextures("junglewood.png"); f->draw_type = CDT_STAIRLIKE; @@ -147,7 +147,7 @@ void content_mapnode_stair(bool repeat) i = CONTENT_BRICK_STAIR; f = &content_features(i); - f->description = wgettext("Brick Stair"); + f->description = gettext("Brick Stair"); f->param_type = CPT_FACEDIR_SIMPLE; f->setAllTextures("brick.png"); f->setTexture(0,"brick_stair_top.png"); @@ -170,7 +170,7 @@ void content_mapnode_stair(bool repeat) i = CONTENT_SANDSTONE_STAIR; f = &content_features(i); - f->description = wgettext("Sand Stone Stair"); + f->description = gettext("Sand Stone Stair"); f->param_type = CPT_FACEDIR_SIMPLE; f->setAllTextures("sandstone.png"); f->draw_type = CDT_STAIRLIKE; @@ -188,7 +188,7 @@ void content_mapnode_stair(bool repeat) i = CONTENT_LIMESTONE_STAIR; f = &content_features(i); - f->description = wgettext("Limestone Stair"); + f->description = gettext("Limestone Stair"); f->param_type = CPT_FACEDIR_SIMPLE; f->setAllTextures("limestone.png"); f->draw_type = CDT_STAIRLIKE; diff --git a/src/content_mapnode_util.cpp b/src/content_mapnode_util.cpp index b6074ca..f56a1ab 100644 --- a/src/content_mapnode_util.cpp +++ b/src/content_mapnode_util.cpp @@ -19,10 +19,10 @@ #define WATER_VISC 1 #define LAVA_VISC 7 -void content_nodedef_knob(content_t nodeid, content_t source_node, ContentMaterialType material_type, const char* texture, const std::wstring desc) +void content_nodedef_knob(content_t nodeid, content_t source_node, ContentMaterialType material_type, const char* texture, char* desc) { ContentFeatures *features = &content_features(nodeid); - features->description = std::wstring(desc); + features->description = desc; features->setAllTextures(texture); features->param_type = CPT_LIGHT; features->param2_type = CPT_FACEDIR_WALLMOUNT; diff --git a/src/content_mapnode_util.h b/src/content_mapnode_util.h index bdf2684..64fa8e8 100644 --- a/src/content_mapnode_util.h +++ b/src/content_mapnode_util.h @@ -1,7 +1,7 @@ #ifndef CONTENT_MAPNODE_UTIL_HEADER #define CONTENT_MAPNODE_UTIL_HEADER -void content_nodedef_knob(content_t nodeid, content_t source_node, ContentMaterialType material_type, const char* texture, const std::wstring desc); +void content_nodedef_knob(content_t nodeid, content_t source_node, ContentMaterialType material_type, const char* texture, char* desc); #endif diff --git a/src/content_mob.cpp b/src/content_mob.cpp index bb62d3a..7d33871 100644 --- a/src/content_mob.cpp +++ b/src/content_mob.cpp @@ -183,7 +183,7 @@ void mob_spawn(v3s16 pos, content_t mob, ServerEnvironment *env) return; v3f p = intToFloat(pos+v3s16(0,1,0), BS); - actionstream<<"A "<addActiveObject(obj); if (!id) { @@ -360,7 +360,7 @@ void content_mob_init() i = CONTENT_MOB_RAT; f = &g_content_mob_features[i&~CONTENT_MOB_MASK]; f->content = i; - f->description = wgettext("Rat"); + f->description = gettext("Rat"); f->level = MOB_PASSIVE; f->model = "rat.x"; f->setTexture("mob_rat.png"); @@ -379,7 +379,7 @@ void content_mob_init() i = CONTENT_MOB_FIREFLY; f = &g_content_mob_features[i&~CONTENT_MOB_MASK]; f->content = i; - f->description = wgettext("Firefly"); + f->description = gettext("Firefly"); f->level = MOB_PASSIVE; f->model_scale = v3f(0.5,0.5,0.5); f->setTexture("mob_firefly.png"); @@ -398,7 +398,7 @@ void content_mob_init() i = CONTENT_MOB_OERKKI; f = &g_content_mob_features[i&~CONTENT_MOB_MASK]; f->content = i; - f->description = wgettext("Oerkki"); + f->description = gettext("Oerkki"); f->level = MOB_AGGRESSIVE; f->model = "oerkki.x"; f->model_scale = v3f(4,4,4); @@ -419,7 +419,7 @@ void content_mob_init() i = CONTENT_MOB_DUNGEON_MASTER; f = &g_content_mob_features[i&~CONTENT_MOB_MASK]; f->content = i; - f->description = wgettext("Dungeon Master"); + f->description = gettext("Dungeon Master"); f->level = MOB_DESTRUCTIVE; f->model = "dungeon_master.b3d"; f->model_rotation = v3f(0,-90,0); @@ -440,7 +440,7 @@ void content_mob_init() i = CONTENT_MOB_FIREBALL; f = &g_content_mob_features[i&~CONTENT_MOB_MASK]; f->content = i; - f->description = wgettext("Fireball"); + f->description = gettext("Fireball"); f->level = MOB_DESTRUCTIVE; f->setTexture("mob_fireball.png"); f->punch_action = MPA_IGNORE; @@ -457,7 +457,7 @@ void content_mob_init() i = CONTENT_MOB_DOE; f = &g_content_mob_features[i&~CONTENT_MOB_MASK]; f->content = i; - f->description = wgettext("Doe"); + f->description = gettext("Doe"); f->level = MOB_PASSIVE; f->hp = 30; f->model = "doe.x"; @@ -484,7 +484,7 @@ void content_mob_init() i = CONTENT_MOB_STAG; f = &g_content_mob_features[i&~CONTENT_MOB_MASK]; f->content = i; - f->description = wgettext("Stag"); + f->description = gettext("Stag"); f->level = MOB_AGGRESSIVE; f->hp = 40; f->model = "stag.x"; @@ -513,7 +513,7 @@ void content_mob_init() i = CONTENT_MOB_TAMESTAG; f = &g_content_mob_features[i&~CONTENT_MOB_MASK]; f->content = i; - f->description = wgettext("Stag"); + f->description = gettext("Stag"); f->level = MOB_PASSIVE; f->hp = 40; f->model = "stag.b3d"; @@ -536,7 +536,7 @@ void content_mob_init() i = CONTENT_MOB_FISH; f = &g_content_mob_features[i&~CONTENT_MOB_MASK]; f->content = i; - f->description = wgettext("Fish"); + f->description = gettext("Fish"); f->level = MOB_PASSIVE; f->model = "fish.b3d"; f->model_rotation = v3f(0,-90,0); @@ -562,7 +562,7 @@ void content_mob_init() i = CONTENT_MOB_SHARK; f = &g_content_mob_features[i&~CONTENT_MOB_MASK]; f->content = i; - f->description = wgettext("Shark"); + f->description = gettext("Shark"); f->level = MOB_AGGRESSIVE; f->hp = 40; f->model = "shark.b3d"; @@ -587,7 +587,7 @@ void content_mob_init() i = CONTENT_MOB_WOLF; f = &g_content_mob_features[i&~CONTENT_MOB_MASK]; f->content = i; - f->description = wgettext("Wolf"); + f->description = gettext("Wolf"); f->level = MOB_AGGRESSIVE; f->hp = 40; f->model = "wolf.b3d"; @@ -615,7 +615,7 @@ void content_mob_init() i = CONTENT_MOB_TAMEWOLF; f = &g_content_mob_features[i&~CONTENT_MOB_MASK]; f->content = i; - f->description = wgettext("Tame Wolf"); + f->description = gettext("Tame Wolf"); f->level = MOB_PASSIVE; f->hp = 40; f->model = "wolf.b3d"; @@ -641,7 +641,7 @@ void content_mob_init() i = CONTENT_MOB_SHEEP; f = &g_content_mob_features[i&~CONTENT_MOB_MASK]; f->content = i; - f->description = wgettext("Sheep"); + f->description = gettext("Sheep"); f->level = MOB_PASSIVE; f->hp = 30; f->model = "sheep.b3d"; @@ -673,7 +673,7 @@ void content_mob_init() i = CONTENT_MOB_SHEARED_SHEEP; f = &g_content_mob_features[i&~CONTENT_MOB_MASK]; f->content = i; - f->description = wgettext("Sheared Sheep"); + f->description = gettext("Sheared Sheep"); f->level = MOB_PASSIVE; f->hp = 30; f->model = "sheared_sheep.b3d"; @@ -698,7 +698,7 @@ void content_mob_init() i = CONTENT_MOB_SNOWBALL; f = &g_content_mob_features[i&~CONTENT_MOB_MASK]; f->content = i; - f->description = wgettext("Snowball"); + f->description = gettext("Snowball"); f->level = MOB_AGGRESSIVE; f->setTexture("snow_ball.png"); f->model_offset = v3f(0,0.2,0); @@ -716,7 +716,7 @@ void content_mob_init() i = CONTENT_MOB_ARROW; f = &g_content_mob_features[i&~CONTENT_MOB_MASK]; f->content = i; - f->description = wgettext("Arrow"); + f->description = gettext("Arrow"); f->level = MOB_AGGRESSIVE; f->setTexture("mob_arrow.png"); f->texture_display = MDT_EXTRUDED; @@ -734,7 +734,7 @@ void content_mob_init() i = CONTENT_MOB_GREY_KITTY; f = &g_content_mob_features[i&~CONTENT_MOB_MASK]; f->content = i; - f->description = wgettext("Grey Kitten"); + f->description = gettext("Grey Kitten"); f->level = MOB_AGGRESSIVE; f->hp = 30; f->model = "kitty.b3d"; @@ -761,7 +761,7 @@ void content_mob_init() i = CONTENT_MOB_WHITE_KITTY; f = &g_content_mob_features[i&~CONTENT_MOB_MASK]; f->content = i; - f->description = wgettext("White Kitten"); + f->description = gettext("White Kitten"); f->level = MOB_AGGRESSIVE; f->hp = 30; f->model = "kitty.b3d"; @@ -788,7 +788,7 @@ void content_mob_init() i = CONTENT_MOB_SIAMESE_KITTY; f = &g_content_mob_features[i&~CONTENT_MOB_MASK]; f->content = i; - f->description = wgettext("Siamese Kitten"); + f->description = gettext("Siamese Kitten"); f->level = MOB_AGGRESSIVE; f->hp = 30; f->model = "kitty.b3d"; @@ -815,7 +815,7 @@ void content_mob_init() i = CONTENT_MOB_GINGER_KITTY; f = &g_content_mob_features[i&~CONTENT_MOB_MASK]; f->content = i; - f->description = wgettext("Ginger Kitten"); + f->description = gettext("Ginger Kitten"); f->level = MOB_AGGRESSIVE; f->hp = 30; f->model = "kitty.b3d"; diff --git a/src/content_mob.h b/src/content_mob.h index a1daa57..3341ed6 100644 --- a/src/content_mob.h +++ b/src/content_mob.h @@ -90,7 +90,7 @@ enum MobDrawType struct MobFeatures { content_t content; - std::wstring description; + char* description; u8 level; #ifndef SERVER TileSpec tiles[6]; @@ -199,7 +199,7 @@ struct MobFeatures { void reset() { content = CONTENT_IGNORE; - description = L""; + description = (char*)""; texture = ""; texture_display = MDT_AUTO; model = ""; diff --git a/src/content_nodemeta.cpp b/src/content_nodemeta.cpp index 2c97e8f..18e752b 100644 --- a/src/content_nodemeta.cpp +++ b/src/content_nodemeta.cpp @@ -75,7 +75,7 @@ std::string SignNodeMetadata::getDrawSpecString(Player *player) spec += m_text; spec += "]"; spec += "button_exit[1.25,2;3,1;save;"; - spec += wide_to_narrow(wgettext("Save")); + spec += gettext("Save"); spec += "]"; return spec; } @@ -138,7 +138,7 @@ std::string LockingSignNodeMetadata::getDrawSpecString(Player *player) spec += m_text; spec += "]"; spec += "button_exit[1.25,2;3,1;save;"; - spec += wide_to_narrow(wgettext("Save")); + spec += gettext("Save"); spec += "]"; return spec; } @@ -184,9 +184,9 @@ void FlagNodeMetadata::serializeBody(std::ostream &os) } std::wstring FlagNodeMetadata::infoText() { - wchar_t buff[256]; - swprintf(buff, 256, wgettext("%s's Home Flag"), narrow_to_wide(m_owner).c_str()); - return std::wstring(buff); + char buff[256]; + snprintf(buff, 256, gettext("%s's Home Flag"), m_owner.c_str()); + return narrow_to_wide(buff); } /* @@ -269,24 +269,24 @@ std::string BedNodeMetadata::getDrawSpecString(Player *player) if (m_owner == "") { if (m_nope) { spec += "label[1.25,1;"; - spec += wide_to_narrow(wgettext("You can't sleep yet.")); + spec += gettext("You can't sleep yet.");; spec += "]"; }else{ spec += "button[1.25,1;3,1;sleep;"; - spec += wide_to_narrow(wgettext("Go to sleep")); + spec += gettext("Go to sleep");; spec += "]"; } }else if (m_owner != player->getName()) { spec += "label[1.25,1;"; - spec += wide_to_narrow(wgettext("Someone else is sleeping here.")); + spec += gettext("Someone else is sleeping here.");; spec += "]"; }else if (m_nope) { spec += "label[1.25,1;"; - spec += wide_to_narrow(wgettext("You can't sleep yet.")); + spec += gettext("You can't sleep yet.");; spec += "]"; }else{ spec += "button_exit[1.25,1;3,1;wake;"; - spec += wide_to_narrow(wgettext("Get out of bed")); + spec += gettext("Get out of bed");; spec += "]"; } return spec; @@ -416,28 +416,28 @@ std::string CampBedNodeMetadata::getDrawSpecString(Player *player) if (m_owner == "") { if (m_used) { spec += "label[1.25,1;"; - spec += wide_to_narrow(wgettext("This bed is too uncomfortable to sleep in.")); + spec += gettext("This bed is too uncomfortable to sleep in.");; spec += "]"; }else if (m_nope) { spec += "label[1.25,1;"; - spec += wide_to_narrow(wgettext("You can't sleep yet.")); + spec += gettext("You can't sleep yet.");; spec += "]"; }else{ spec += "button[1.25,1;3,1;sleep;"; - spec += wide_to_narrow(wgettext("Go to sleep")); + spec += gettext("Go to sleep");; spec += "]"; } }else if (m_owner != player->getName()) { spec += "label[1.25,1;"; - spec += wide_to_narrow(wgettext("Someone else is sleeping here.")); + spec += gettext("Someone else is sleeping here.");; spec += "]"; }else if (m_nope) { spec += "label[1.25,1;"; - spec += wide_to_narrow(wgettext("You can't sleep yet.")); + spec += gettext("You can't sleep yet.");; spec += "]"; }else{ spec += "button_exit[1.25,1;3,1;wake;"; - spec += wide_to_narrow(wgettext("Get out of bed")); + spec += gettext("Get out of bed");; spec += "]"; } return spec; @@ -484,7 +484,7 @@ void ChestNodeMetadata::serializeBody(std::ostream &os) } std::wstring ChestNodeMetadata::infoText() { - return wgettext("Chest"); + return narrow_to_wide(gettext("Chest")); } bool ChestNodeMetadata::nodeRemovalDisabled() { @@ -556,9 +556,9 @@ void LockingChestNodeMetadata::serializeBody(std::ostream &os) } std::wstring LockingChestNodeMetadata::infoText() { - wchar_t buff[256]; - swprintf(buff, 256, wgettext("Locking Chest owned by '%s'"), narrow_to_wide(m_owner).c_str()); - return buff; + char buff[256]; + snprintf(buff, 256, gettext("Locking Chest owned by '%s'"), m_owner.c_str()); + return narrow_to_wide(buff); } bool LockingChestNodeMetadata::nodeRemovalDisabled() { @@ -630,9 +630,9 @@ void SafeNodeMetadata::serializeBody(std::ostream &os) } std::wstring SafeNodeMetadata::infoText() { - wchar_t buff[256]; - swprintf(buff, 256, wgettext("Safe owned by '%s'"), narrow_to_wide(m_owner).c_str()); - return buff; + char buff[256]; + snprintf(buff, 256, gettext("Safe owned by '%s'"), m_owner.c_str()); + return narrow_to_wide(buff); } bool SafeNodeMetadata::nodeRemovalDisabled() { @@ -769,7 +769,7 @@ void CreativeChestNodeMetadata::serializeBody(std::ostream &os) } std::wstring CreativeChestNodeMetadata::infoText() { - return wgettext("Creative Chest"); + return narrow_to_wide(gettext("Creative Chest")); } bool CreativeChestNodeMetadata::nodeRemovalDisabled() { @@ -841,13 +841,13 @@ std::string CreativeChestNodeMetadata::getDrawSpecString(Player *player) std::string spec("size[8,10]"); spec += "list[current_name;0;0,0.5;8,4;]"; spec += "button[0.25,5;2.5,0.75;prev;"; - spec += wide_to_narrow(wgettext("<< Previous Page")); + spec += gettext("<< Previous Page");; spec += "]"; spec += "label[3.5,5;"; spec += buff; spec += "]"; spec += "button[6,5;2.5,0.75;next;"; - spec += wide_to_narrow(wgettext("Next Page >>")); + spec += gettext("Next Page >>");; spec += "]"; spec += "list[current_player;main;0,6;8,4;]"; @@ -889,9 +889,9 @@ void BorderStoneNodeMetadata::serializeBody(std::ostream &os) } std::wstring BorderStoneNodeMetadata::infoText() { - wchar_t buff[256]; - swprintf(buff, 256, wgettext("Border Stone owned by '%s'"), narrow_to_wide(m_text).c_str()); - return buff; + char buff[256]; + snprintf(buff, 256, gettext("Border Stone owned by '%s'"), m_text.c_str()); + return narrow_to_wide(buff); } /* @@ -965,13 +965,13 @@ std::wstring FurnaceNodeMetadata::infoText() if (src_item && src_item->isCookable(COOK_FURNACE)) { InventoryList *dst_list = m_inventory->getList("dst"); if(!dst_list->roomForCookedItem(src_item)) - return wgettext("Furnace is overloaded"); - return wgettext("Furnace is out of fuel"); + return narrow_to_wide(gettext("Furnace is overloaded")); + return narrow_to_wide(gettext("Furnace is out of fuel")); }else{ - return wgettext("Furnace is inactive"); + return narrow_to_wide(gettext("Furnace is inactive")); } }else{ - std::wstring s = wgettext("Furnace is active"); + std::wstring s = narrow_to_wide(gettext("Furnace is active")); // Do this so it doesn't always show (0%) for weak fuel if (m_fuel_totaltime > 3) { s += L" ("; @@ -1218,10 +1218,16 @@ void LockingFurnaceNodeMetadata::serializeBody(std::ostream &os) } std::wstring LockingFurnaceNodeMetadata::infoText() { - //return "Furnace"; + char buff[256]; + char* s; + char e[128]; std::string ostr = m_owner; + + e[0] = 0; + if (m_inv_owner != "") ostr += ","+m_inv_owner; + if (m_fuel_time >= m_fuel_totaltime) { const InventoryList *src_list = m_inventory->getList("src"); assert(src_list); @@ -1229,22 +1235,25 @@ std::wstring LockingFurnaceNodeMetadata::infoText() if(src_item && src_item->isCookable(COOK_FURNACE)) { InventoryList *dst_list = m_inventory->getList("dst"); - if (!dst_list->roomForCookedItem(src_item)) - return wgettext("Locking Furnace is overloaded")+std::wstring(L" (")+narrow_to_wide(ostr)+L")"; - return wgettext("Locking Furnace is out of fuel")+std::wstring(L" (")+narrow_to_wide(ostr)+L")"; + if (!dst_list->roomForCookedItem(src_item)) { + s = gettext("Locking Furnace is overloaded"); + }else{ + s = gettext("Locking Furnace is out of fuel"); + } }else{ - return wgettext("Locking Furnace is inactive")+std::wstring(L" (")+narrow_to_wide(ostr)+L")"; + s = gettext("Locking Furnace is inactive"); } }else{ - std::wstring s = wgettext("Locking Furnace is active")+std::wstring(L" (")+narrow_to_wide(ostr)+L")"; + s = gettext("Locking Furnace is active"); // Do this so it doesn't always show (0%) for weak fuel if (m_fuel_totaltime > 3) { - s += L" ("; - s += itows(m_fuel_time/m_fuel_totaltime*100); - s += L"%)"; + uint32_t tt = m_fuel_time/m_fuel_totaltime*100; + snprintf(e,128, " (%d%%)",tt); } - return s; } + + snprintf(buff,256,"%s (%s)%s",s,ostr.c_str(),e); + return narrow_to_wide(buff); } bool LockingFurnaceNodeMetadata::nodeRemovalDisabled() { @@ -1485,7 +1494,11 @@ void CampFireNodeMetadata::serializeBody(std::ostream &os) } std::wstring CampFireNodeMetadata::infoText() { - //return "CampFire"; + char buff[256]; + char* s; + char e[128]; + e[0] = 0; + if (m_fuel_time >= m_fuel_totaltime) { const InventoryList *src_list = m_inventory->getList("src"); assert(src_list); @@ -1493,22 +1506,25 @@ std::wstring CampFireNodeMetadata::infoText() if (src_item && src_item->isCookable(COOK_FIRE)) { InventoryList *dst_list = m_inventory->getList("dst"); - if(!dst_list->roomForCookedItem(src_item)) - return wgettext("CampFire is overloaded"); - return wgettext("CampFire is out of fuel"); + if(!dst_list->roomForCookedItem(src_item)) { + s = gettext("CampFire is overloaded"); + }else{ + s = gettext("CampFire is out of fuel"); + } }else{ - return wgettext("CampFire is inactive"); + s = gettext("CampFire is inactive"); } }else{ - std::wstring s = wgettext("CampFire is active"); + s = gettext("CampFire is active"); // Do this so it doesn't always show (0%) for weak fuel if (m_fuel_totaltime > 3) { - s += L" ("; - s += itows(m_fuel_time/m_fuel_totaltime*100); - s += L"%)"; + uint32_t tt = m_fuel_time/m_fuel_totaltime*100; + snprintf(e,128, " (%d%%)",tt); } - return s; } + + snprintf(buff,256,"%s%s",s,e); + return narrow_to_wide(buff); } bool CampFireNodeMetadata::nodeRemovalDisabled() { @@ -1734,16 +1750,16 @@ void TNTNodeMetadata::serializeBody(std::ostream &os) } std::wstring TNTNodeMetadata::infoText() { + char buff[256]; if (!m_armed) return L""; int s = (int)ceil(m_time); if (s < 1) - return wgettext("Armed Explosive: about to detonate"); + return narrow_to_wide(gettext("Armed Explosive: about to detonate")); - wchar_t buff[512]; - swprintf(buff, 512, wngettext("Armed Explosive: %d second till detonation","Armed Explosive: %d seconds till detonation",s),s); - return buff; + snprintf(buff, 256, ngettext("Armed Explosive: %d second till detonation","Armed Explosive: %d seconds till detonation",s),s); + return narrow_to_wide(buff); } /* @@ -1803,14 +1819,14 @@ void IncineratorNodeMetadata::serializeBody(std::ostream &os) std::wstring IncineratorNodeMetadata::infoText() { if (m_fuel_time < m_fuel_totaltime) - return wgettext("Incinerator is active"); + return narrow_to_wide(gettext("Incinerator is active")); InventoryList *fuel_list = m_inventory->getList("fuel"); if (fuel_list) { InventoryItem *fuel_item = fuel_list->getItem(0); if (fuel_item && fuel_item->isFuel()) - return wgettext("Incinerator is active"); + return narrow_to_wide(gettext("Incinerator is active")); } - return wgettext("Incinerator is inactive"); + return narrow_to_wide(gettext("Incinerator is inactive")); } bool IncineratorNodeMetadata::nodeRemovalDisabled() { @@ -1902,10 +1918,10 @@ std::string IncineratorNodeMetadata::getDrawSpecString(Player *player) { std::string spec("size[8,7]"); spec += "label[1,0.5;"; - spec += wide_to_narrow(wgettext("Add fuel, then punch to incinerate wielded item")); + spec += gettext("Add fuel, then punch to incinerate wielded item");; spec += "]"; spec += "label[3,1.5;"; - spec += wide_to_narrow(wgettext("Fuel")); + spec += gettext("Fuel");; spec += "]"; spec += "list[current_name;fuel;4,1;1,1;]"; spec += "ring[4,1;1;#FF0000;"; @@ -2224,21 +2240,21 @@ std::string CraftGuideNodeMetadata::getDrawSpecString(Player *player) std::string spec("size[8,10]"); spec += "label[0.5,0.75;"; - spec += wide_to_narrow(wgettext("Add item here to see recipe")); + spec += gettext("Add item here to see recipe");; spec += "]"; spec += "list[current_name;result;2,1;1,1;]"; if (rc > 1) { - wchar_t rbuff[256]; - swprintf(rbuff, 256, wgettext("Recipe %d of %d"), (int)(m_recipe+1),rc); + char rbuff[256]; + snprintf(rbuff, 256, gettext("Recipe %d of %d"), (int)(m_recipe+1),rc); spec += "button[2.5,3.5;1,0.75;rprev;<<]"; spec += "label[3.5,3.5;"; - spec += wide_to_narrow(rbuff); + spec += rbuff; spec += "]"; spec += "button[5.5,3.5;1,0.75;rnext;>>]"; } if (q && tr) { spec += "label[1,1.5;"; - spec += wide_to_narrow(wgettext("Gives")); + spec += gettext("Gives");; spec += " "; spec += itos(tr); // this overflows into the craft grid... but could be cool @@ -2248,13 +2264,13 @@ std::string CraftGuideNodeMetadata::getDrawSpecString(Player *player) } spec += "list[current_name;recipe;4,0;3,3;]"; spec += "button[0.25,4.5;2.5,0.75;prev;"; - spec += wide_to_narrow(wgettext("<< Previous Page")); + spec += gettext("<< Previous Page");; spec += "]"; spec += "label[3.5,4.5;"; spec += buff; spec += "]"; spec += "button[6,4.5;2.5,0.75;next;"; - spec += wide_to_narrow(wgettext("Next Page >>")); + spec += gettext("Next Page >>");; spec += "]"; spec += "list[current_name;list;0,5;8,5;]"; return spec; @@ -2506,33 +2522,33 @@ std::string ReverseCraftGuideNodeMetadata::getDrawSpecString(Player *player) if (ingredient_list.size()%40) ++page_count; //write the page count string - wchar_t buff[256]; - swprintf(buff, 256, wgettext("Page %d of %d"), (int)(m_page+1), page_count); + char buff[256]; + snprintf(buff, 256, gettext("Page %d of %d"), (int)(m_page+1), page_count); //build the formspec string spec("size[8,10]"); spec += "label[0.5,0.75;"; - spec += wide_to_narrow(wgettext("Add item here to see recipe")); + spec += gettext("Add item here to see recipe");; spec += "]"; spec += "list[current_name;item;2,1;1,1;]"; if (recipe_count > 1) { - wchar_t rbuff[256]; - swprintf(rbuff, 256, wgettext("Recipe %d of %d"), (int)(m_recipe+1), recipe_count); + char rbuff[256]; + snprintf(rbuff, 256, gettext("Recipe %d of %d"), (int)(m_recipe+1), recipe_count); spec += "button[2.5,3.5;1,0.75;rprev;<<]"; spec += "label[3.5,3.5;"; - spec += wide_to_narrow(rbuff); + spec += rbuff; spec += "]"; spec += "button[5.5,3.5;1,0.75;rnext;>>]"; } spec += "list[current_name;recipe;4,0;3,3;]"; spec += "button[0.25,4.5;2.5,0.75;prev;"; - spec += wide_to_narrow(wgettext("<< Previous Page")); + spec += gettext("<< Previous Page");; spec += "]"; spec += "label[3.5,4.5;"; - spec += wide_to_narrow(buff); + spec += buff; spec += "]"; spec += "button[6,4.5;2.5,0.75;next;"; - spec += wide_to_narrow(wgettext("Next Page >>")); + spec += gettext("Next Page >>");; spec += "]"; spec += "list[current_name;result;7,0;1,1;]"; spec += "list[current_name;list;0,5;8,5;]"; @@ -2781,18 +2797,18 @@ std::string CookBookNodeMetadata::getDrawSpecString(Player *player) std::string spec("size[8,9]"); spec += "label[0.5,0.75;"; - spec += wide_to_narrow(wgettext("Add item here to see cook result")); + spec += gettext("Add item here to see cook result");; spec += "]"; spec += "list[current_name;result;2,1;1,1;]"; spec += "list[current_name;recipe;4,1;1,1;]"; spec += "button[0.25,3.5;2.5,0.75;prev;"; - spec += wide_to_narrow(wgettext("<< Previous Page")); + spec += gettext("<< Previous Page");; spec += "]"; spec += "label[3.5,3.5;"; spec += buff; spec += "]"; spec += "button[6,3.5;2.5,0.75;next;"; - spec += wide_to_narrow(wgettext("Next Page >>")); + spec += gettext("Next Page >>");; spec += "]"; spec += "list[current_name;list;0,4;8,5;]"; return spec; @@ -3072,25 +3088,25 @@ std::string DeCraftNodeMetadata::getDrawSpecString(Player *player) std::string spec("size[8,9]"); spec += "label[0.5,0.75;"; - spec += wide_to_narrow(wgettext("Add item here to see dig result")); + spec += gettext("Add item here to see dig result");; spec += "]"; spec += "list[current_name;result;2,1;1,1;]"; spec += "label[5,1;"; - spec += wide_to_narrow(wgettext("Dig Result")); + spec += gettext("Dig Result");; spec += "]"; spec += "list[current_name;recipe;6.5,0.5;1,1;]"; spec += "label[5,2;"; - spec += wide_to_narrow(wgettext("Random Drop")); + spec += gettext("Random Drop");; spec += "]"; spec += "list[current_name;random;6.5,1.5;1,1;]"; spec += "button[0.25,3.5;2.5,0.75;prev;"; - spec += wide_to_narrow(wgettext("<< Previous Page")); + spec += gettext("<< Previous Page");; spec += "]"; spec += "label[3.5,3.5;"; spec += buff; spec += "]"; spec += "button[6,3.5;2.5,0.75;next;"; - spec += wide_to_narrow(wgettext("Next Page >>")); + spec += gettext("Next Page >>");; spec += "]"; spec += "list[current_name;list;0,4;8,5;]"; return spec; @@ -3172,17 +3188,17 @@ std::string BookNodeMetadata::getDrawSpecString(Player *player) { std::string spec("size[6,6]"); spec += "field[1,1;5,1;title;"; - spec += wide_to_narrow(wgettext("Title")); + spec += gettext("Title");; spec += ";"; spec += m_title; spec += "]"; spec += "field[1,2;5,2;content;"; - spec += wide_to_narrow(wgettext("Content")); + spec += gettext("Content");; spec += ";"; spec += m_content; spec += "]"; spec += "button_exit[2,5;3,1;submit;"; - spec += wide_to_narrow(wgettext("Save")); + spec += gettext("Save");; spec += "]"; return spec; } @@ -3271,17 +3287,17 @@ std::string DiaryNodeMetadata::getDrawSpecString(Player *player) { std::string spec("size[6,6]"); spec += "field[1,1;5,1;title;"; - spec += wide_to_narrow(wgettext("Title")); + spec += gettext("Title");; spec += ";"; spec += m_title; spec += "]"; spec += "field[1,2;5,2;content;"; - spec += wide_to_narrow(wgettext("Content")); + spec += gettext("Content");; spec += ";"; spec += m_content; spec += "]"; spec += "button_exit[2,5;3,1;submit;"; - spec += wide_to_narrow(wgettext("Save")); + spec += gettext("Save");; spec += "]"; return spec; } @@ -3640,19 +3656,19 @@ void CauldronNodeMetadata::serializeBody(std::ostream &os) std::wstring CauldronNodeMetadata::infoText() { if (m_fuel_time) - return wgettext("Cauldron is active"); + return narrow_to_wide(gettext("Cauldron is active")); if (m_water_level) { if (m_water_hot) - return wgettext("Cauldron is hot"); + return narrow_to_wide(gettext("Cauldron is hot")); if (m_water_heated) - return wgettext("Cauldron is cool"); + return narrow_to_wide(gettext("Cauldron is cool")); }else{ - return wgettext("Cauldron is empty"); + return narrow_to_wide(gettext("Cauldron is empty")); } InventoryList *list = m_inventory->getList("fuel"); if (list && list->getUsedSlots() > 0) - return wgettext("Cauldron is inactive"); - return wgettext("Cauldron is out of fuel"); + return narrow_to_wide(gettext("Cauldron is inactive")); + return narrow_to_wide(gettext("Cauldron is out of fuel")); } bool CauldronNodeMetadata::nodeRemovalDisabled() { @@ -3732,10 +3748,10 @@ std::string CauldronNodeMetadata::getDrawSpecString(Player *player) std::string spec("size[8,7]"); spec += "label[1,0.5;"; - spec += wide_to_narrow(wgettext("Add fuel, then punch to add or remove water")); + spec += gettext("Add fuel, then punch to add or remove water");; spec += "]"; spec += "label[3.5,1.5;"; - spec += wide_to_narrow(wgettext("Fuel")); + spec += gettext("Fuel");; spec += "]"; spec += "list[current_name;fuel;4,1;1,1;]"; spec += "list[current_player;main;0,3;8,4;]"; @@ -3831,7 +3847,7 @@ void ForgeNodeMetadata::serializeBody(std::ostream &os) } std::wstring ForgeNodeMetadata::infoText() { - return wgettext("Forge"); + return narrow_to_wide(gettext("Forge")); } void ForgeNodeMetadata::inventoryModified() { @@ -4005,14 +4021,14 @@ std::string ForgeNodeMetadata::getDrawSpecString(Player *player) spec += "list[current_name;craft;2,0;3,3;]"; spec += "list[current_name;craftresult;6,1;1,1;]"; spec += "button[3,3.2;3,1;enchant;"; - spec += wide_to_narrow(wgettext("Show Enchanting")); + spec += gettext("Show Enchanting");; spec += "]"; }else{ spec += "list[current_name;mithril;1,1;1,1;ingot_bg.png]"; spec += "list[current_name;gem;3,1;1,1;gem_bg.png]"; spec += "list[current_name;craftresult;6,1;1,1;]"; spec += "button[3,3.2;3,1;craft;"; - spec += wide_to_narrow(wgettext("Show Crafting")); + spec += gettext("Show Crafting");; spec += "]"; } diff --git a/src/content_nodemeta.h b/src/content_nodemeta.h index 35af26f..2d9d11a 100644 --- a/src/content_nodemeta.h +++ b/src/content_nodemeta.h @@ -439,7 +439,7 @@ public: NodeMetadata* clone(); static NodeMetadata* create(std::istream &is); virtual void serializeBody(std::ostream &os); - virtual std::wstring infoText() {return wgettext("Craft Guide");} + virtual std::wstring infoText() {return narrow_to_wide(gettext("Craft Guide"));} virtual Inventory* getInventory() {return m_inventory;} virtual bool nodeRemovalDisabled(); virtual void inventoryModified(); @@ -466,7 +466,7 @@ public: NodeMetadata* clone(); static NodeMetadata* create(std::istream &is); virtual void serializeBody(std::ostream &os); - virtual std::wstring infoText() {return wgettext("Reverse Craft Guide");} + virtual std::wstring infoText() {return narrow_to_wide(gettext("Reverse Craft Guide"));} virtual Inventory* getInventory() {return m_inventory;} virtual bool nodeRemovalDisabled(); virtual void inventoryModified(); @@ -497,7 +497,7 @@ public: NodeMetadata* clone(); static NodeMetadata* create(std::istream &is); virtual void serializeBody(std::ostream &os); - virtual std::wstring infoText() {return wgettext("Cooking Guide");} + virtual std::wstring infoText() {return narrow_to_wide(gettext("Cooking Guide"));} virtual Inventory* getInventory() {return m_inventory;} virtual bool nodeRemovalDisabled(); virtual void inventoryModified(); @@ -523,7 +523,7 @@ public: NodeMetadata* clone(); static NodeMetadata* create(std::istream &is); virtual void serializeBody(std::ostream &os); - virtual std::wstring infoText() {return wgettext("Decrafting Guide");} + virtual std::wstring infoText() {return narrow_to_wide(gettext("Decrafting Guide"));} virtual Inventory* getInventory() {return m_inventory;} virtual bool nodeRemovalDisabled(); virtual void inventoryModified(); diff --git a/src/content_sao.cpp b/src/content_sao.cpp index 2c216fa..956fe98 100644 --- a/src/content_sao.cpp +++ b/src/content_sao.cpp @@ -1381,7 +1381,7 @@ u16 MobSAO::punch(content_t punch_item, v3f dir, const std::string &playername) u16 wear = 655; actionstream<content = i; f->texture = "tool_smallpick.png"; f->name = "WPick"; - f->description = wgettext("Small Stone Pick"); + f->description = gettext("Small Stone Pick"); f->type = TT_PICK; f->diginfo.uses = 32; f->diginfo.time = 3.0; @@ -300,7 +300,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_stonepick.png"; f->name = "STPick"; - f->description = wgettext("Stone Pick"); + f->description = gettext("Stone Pick"); f->type = TT_PICK; f->diginfo.uses = 64; f->diginfo.time = 1.5; @@ -314,7 +314,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_flintpick.png"; f->name = "FPick"; - f->description = wgettext("Flint Pick"); + f->description = gettext("Flint Pick"); f->type = TT_PICK; f->diginfo.uses = 128; f->diginfo.time = 1.75; @@ -328,7 +328,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_steelpick.png"; f->name = "SteelPick"; - f->description = wgettext("Steel Pick"); + f->description = gettext("Steel Pick"); f->type = TT_PICK; f->diginfo.uses = 256; f->diginfo.time = 1.0; @@ -342,7 +342,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_mithril_raw_pick.png"; f->name = "mithril_raw_pick"; - f->description = wgettext("Raw Mithril Pick"); + f->description = gettext("Raw Mithril Pick"); f->type = TT_PICK; f->diginfo.uses = 512; f->diginfo.time = 0.75; @@ -356,7 +356,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_mithril_pick.png"; f->name = "mithril_unbound_pick"; - f->description = wgettext("Unbound Mithril Pick"); + f->description = gettext("Unbound Mithril Pick"); f->type = TT_PICK; f->diginfo.uses = 1024; f->diginfo.time = 0.6; @@ -370,7 +370,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_mithril_pick.png"; f->name = "mithril_pick"; - f->description = wgettext("Mithril Pick"); + f->description = gettext("Mithril Pick"); f->type = TT_PICK; f->param_type = CPT_ENCHANTMENT; f->diginfo.uses = 2048; @@ -385,7 +385,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_creativepick.png"; f->name = "MesePick"; - f->description = wgettext("Creative Pick"); + f->description = gettext("Creative Pick"); f->type = TT_PICK; f->diginfo.uses = 1000; f->diginfo.time = 0.1; @@ -401,7 +401,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_trowel.png"; f->name = "WShovel"; - f->description = wgettext("Stone Trowel"); + f->description = gettext("Stone Trowel"); f->type = TT_SHOVEL; f->diginfo.uses = 32; f->diginfo.time = 3.0; @@ -415,7 +415,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_stoneshovel.png"; f->name = "STShovel"; - f->description = wgettext("Stone Shovel"); + f->description = gettext("Stone Shovel"); f->type = TT_SHOVEL; f->diginfo.uses = 64; f->diginfo.time = 1.5; @@ -429,7 +429,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_flintshovel.png"; f->name = "FShovel"; - f->description = wgettext("Flint Shovel"); + f->description = gettext("Flint Shovel"); f->type = TT_SHOVEL; f->diginfo.uses = 128; f->diginfo.time = 1.75; @@ -443,7 +443,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_steelshovel.png"; f->name = "SteelShovel"; - f->description = wgettext("Steel Shovel"); + f->description = gettext("Steel Shovel"); f->type = TT_SHOVEL; f->diginfo.uses = 256; f->diginfo.time = 1.0; @@ -457,7 +457,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_mithril_raw_shovel.png"; f->name = "mithril_raw_shovel"; - f->description = wgettext("Raw Mithril Shovel"); + f->description = gettext("Raw Mithril Shovel"); f->type = TT_SHOVEL; f->diginfo.uses = 512; f->diginfo.time = 0.75; @@ -471,7 +471,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_mithril_shovel.png"; f->name = "mithril_unbound_shovel"; - f->description = wgettext("Unbound Mithril Shovel"); + f->description = gettext("Unbound Mithril Shovel"); f->type = TT_SHOVEL; f->diginfo.uses = 1024; f->diginfo.time = 0.6; @@ -485,7 +485,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_mithril_shovel.png"; f->name = "mithril_shovel"; - f->description = wgettext("Mithril Shovel"); + f->description = gettext("Mithril Shovel"); f->type = TT_SHOVEL; f->param_type = CPT_ENCHANTMENT; f->diginfo.uses = 2048; @@ -501,7 +501,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_smallaxe.png"; f->name = "WAxe"; - f->description = wgettext("Small Stone Axe"); + f->description = gettext("Small Stone Axe"); f->type = TT_AXE; f->diginfo.uses = 32; f->diginfo.time = 3.0; @@ -525,7 +525,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_stoneaxe.png"; f->name = "STAxe"; - f->description = wgettext("Stone Axe"); + f->description = gettext("Stone Axe"); f->type = TT_AXE; f->diginfo.uses = 64; f->diginfo.time = 1.5; @@ -539,7 +539,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_flintaxe.png"; f->name = "FAxe"; - f->description = wgettext("Flint Axe"); + f->description = gettext("Flint Axe"); f->type = TT_AXE; f->diginfo.uses = 128; f->diginfo.time = 1.75; @@ -553,7 +553,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_steelaxe.png"; f->name = "SteelAxe"; - f->description = wgettext("Steel Axe"); + f->description = gettext("Steel Axe"); f->type = TT_AXE; f->diginfo.uses = 256; f->diginfo.time = 1.0; @@ -567,7 +567,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_mithril_raw_axe.png"; f->name = "mithril_raw_axe"; - f->description = wgettext("Raw Mithril Axe"); + f->description = gettext("Raw Mithril Axe"); f->type = TT_AXE; f->diginfo.uses = 512; f->diginfo.time = 0.75; @@ -581,7 +581,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_mithril_axe.png"; f->name = "mithril_unbound_axe"; - f->description = wgettext("Unbound Mithril Axe"); + f->description = gettext("Unbound Mithril Axe"); f->type = TT_AXE; f->diginfo.uses = 1024; f->diginfo.time = 0.6; @@ -595,7 +595,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_mithril_axe.png"; f->name = "mithril_axe"; - f->description = wgettext("Mithril Axe"); + f->description = gettext("Mithril Axe"); f->type = TT_AXE; f->param_type = CPT_ENCHANTMENT; f->diginfo.uses = 2048; @@ -611,7 +611,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_woodclub.png"; f->name = "WSword"; - f->description = wgettext("Wooden Club"); + f->description = gettext("Wooden Club"); f->type = TT_CLUB; f->diginfo.uses = 32; f->diginfo.time = 3.0; @@ -626,7 +626,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_bow.png"; f->name = "bow"; - f->description = wgettext("Bow"); + f->description = gettext("Bow"); f->type = TT_SPECIAL; f->diginfo.uses = 256; f->diginfo.time = 1.0; @@ -650,7 +650,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_stonespear.png"; f->name = "stone_spear"; - f->description = wgettext("Stone Spear"); + f->description = gettext("Stone Spear"); f->type = TT_SPEAR; f->diginfo.uses = 64; f->diginfo.time = 1.5; @@ -664,7 +664,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_flintspear.png"; f->name = "flint_spear"; - f->description = wgettext("Flint Spear"); + f->description = gettext("Flint Spear"); f->type = TT_SPEAR; f->diginfo.uses = 128; f->diginfo.time = 1.75; @@ -678,7 +678,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_steelspear.png"; f->name = "steel_spear"; - f->description = wgettext("Steel Spear"); + f->description = gettext("Steel Spear"); f->type = TT_SPEAR; f->diginfo.uses = 256; f->diginfo.time = 1.0; @@ -692,7 +692,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_mithril_raw_spear.png"; f->name = "mithril_raw_spear"; - f->description = wgettext("Raw Mithril Spear"); + f->description = gettext("Raw Mithril Spear"); f->type = TT_SPEAR; f->diginfo.uses = 512; f->diginfo.time = 0.75; @@ -706,7 +706,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_mithril_spear.png"; f->name = "mithril_unbound_spear"; - f->description = wgettext("Unbound Mithril Spear"); + f->description = gettext("Unbound Mithril Spear"); f->type = TT_SPEAR; f->diginfo.uses = 1024; f->diginfo.time = 0.6; @@ -720,7 +720,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_mithril_spear.png"; f->name = "mithril_spear"; - f->description = wgettext("Mithril Spear"); + f->description = gettext("Mithril Spear"); f->type = TT_SPEAR; f->param_type = CPT_ENCHANTMENT; f->diginfo.uses = 2048; @@ -736,7 +736,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_stonesword.png"; f->name = "STSword"; - f->description = wgettext("Stone Sword"); + f->description = gettext("Stone Sword"); f->type = TT_SWORD; f->diginfo.uses = 64; f->diginfo.time = 1.5; @@ -750,7 +750,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_steelsword.png"; f->name = "SteelSword"; - f->description = wgettext("Steel Sword"); + f->description = gettext("Steel Sword"); f->type = TT_SWORD; f->diginfo.uses = 256; f->diginfo.time = 1.0; @@ -764,7 +764,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_mithril_raw_sword.png"; f->name = "mithril_raw_sword"; - f->description = wgettext("Raw Mithril Sword"); + f->description = gettext("Raw Mithril Sword"); f->type = TT_SWORD; f->diginfo.uses = 512; f->diginfo.time = 0.75; @@ -778,7 +778,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_mithril_sword.png"; f->name = "mithril_unbound_sword"; - f->description = wgettext("Unbound Mithril Sword"); + f->description = gettext("Unbound Mithril Sword"); f->type = TT_SWORD; f->diginfo.uses = 1024; f->diginfo.time = 0.6; @@ -792,7 +792,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_mithril_sword.png"; f->name = "mithril_sword"; - f->description = wgettext("Mithril Sword"); + f->description = gettext("Mithril Sword"); f->type = TT_SWORD; f->param_type = CPT_ENCHANTMENT; f->diginfo.uses = 2048; @@ -808,7 +808,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_flintshears.png"; f->name = "FShears"; - f->description = wgettext("Flint Shears"); + f->description = gettext("Flint Shears"); f->type = TT_SHEAR; f->diginfo.uses = 128; f->diginfo.time = 1.5; @@ -822,7 +822,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_steelshears.png"; f->name = "Shears"; - f->description = wgettext("Steel Shears"); + f->description = gettext("Steel Shears"); f->type = TT_SHEAR; f->diginfo.uses = 256; f->diginfo.time = 1.0; @@ -838,7 +838,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_woodbucket.png"; f->name = "WBucket"; - f->description = wgettext("Wooden Bucket"); + f->description = gettext("Wooden Bucket"); f->liquids_pointable = true; f->type = TT_BUCKET; f->diginfo.uses = 64; @@ -855,7 +855,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_tinbucket.png"; f->name = "TinBucket"; - f->description = wgettext("Tin Bucket"); + f->description = gettext("Tin Bucket"); f->liquids_pointable = true; f->type = TT_BUCKET; f->diginfo.uses = 128; @@ -871,7 +871,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_steelbucket.png"; f->name = "SteelBucket"; - f->description = wgettext("Steel Bucket"); + f->description = gettext("Steel Bucket"); f->liquids_pointable = true; f->type = TT_BUCKET; f->diginfo.uses = 256; @@ -886,7 +886,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_woodbucket.png^bucket_water.png"; f->name = "WBucket_water"; - f->description = wgettext("Wooden Bucket of Water"); + f->description = gettext("Wooden Bucket of Water"); f->type = TT_SPECIAL; f->onplace_node = CONTENT_WATERSOURCE; f->onplace_replace_item = CONTENT_TOOLITEM_WBUCKET; @@ -897,7 +897,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_tinbucket.png^bucket_water.png"; f->name = "TinBucket_water"; - f->description = wgettext("Tin Bucket of Water"); + f->description = gettext("Tin Bucket of Water"); f->type = TT_SPECIAL; f->onplace_node = CONTENT_WATERSOURCE; f->onplace_replace_item = CONTENT_TOOLITEM_TINBUCKET; @@ -908,7 +908,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_steelbucket.png^bucket_water.png"; f->name = "SteelBucket_water"; - f->description = wgettext("Steel Bucket of Water"); + f->description = gettext("Steel Bucket of Water"); f->type = TT_SPECIAL; f->onplace_node = CONTENT_WATERSOURCE; f->onplace_replace_item = CONTENT_TOOLITEM_STEELBUCKET; @@ -919,7 +919,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_steelbucket.png^bucket_lava.png"; f->name = "SteelBucket_lava"; - f->description = wgettext("Steel Bucket of Lava"); + f->description = gettext("Steel Bucket of Lava"); f->onplace_node = CONTENT_LAVASOURCE; f->onplace_replace_item = CONTENT_TOOLITEM_STEELBUCKET; f->fuel_time = 80; @@ -933,7 +933,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_fire_starter.png"; f->name = "FireStarter"; - f->description = wgettext("Fire Starter"); + f->description = gettext("Fire Starter"); f->liquids_pointable = true; f->type = TT_SPECIAL; f->diginfo.level = 3; @@ -947,7 +947,7 @@ void content_toolitem_init() f->content = i; f->texture = "crowbar.png"; f->name = "crowbar"; - f->description = wgettext("Crowbar"); + f->description = gettext("Crowbar"); f->type = TT_SPECIAL; f->diginfo.level = 3; f->has_rotate_effect = true; @@ -960,7 +960,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_key.png"; f->name = "key"; - f->description = wgettext("Key"); + f->description = gettext("Key"); f->type = TT_SPECIAL; f->diginfo.level = 4; f->has_unlock_effect = true; @@ -972,7 +972,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_mithril_key.png"; f->name = "mithrilkey"; - f->description = wgettext("Mithril Key"); + f->description = gettext("Mithril Key"); f->type = TT_SPECIAL; f->diginfo.level = 5; f->has_unlock_effect = true; @@ -992,7 +992,7 @@ void content_toolitem_init() f->content = i; f->texture = "tool_mob_spawner.png"; f->name = "mob_spawner"; - f->description = wgettext("Mob Spawner"); + f->description = gettext("Mob Spawner"); f->type = TT_SPECIAL; f->diginfo.level = 4; f->param_type = CPT_DROP; diff --git a/src/content_toolitem.h b/src/content_toolitem.h index 69c50d7..f64e664 100644 --- a/src/content_toolitem.h +++ b/src/content_toolitem.h @@ -30,7 +30,7 @@ struct ToolItemFeatures { // the old 'subname' std::string name; // tooltip used in inventory - std::wstring description; + char* description; // the result of cooking this item std::string cook_result; // what type of cooking device this item needs @@ -71,7 +71,6 @@ struct ToolItemFeatures { content(CONTENT_IGNORE), texture("unknown_item.png"), name(""), - description(L""), cook_result(""), cook_type(COOK_ANY), fuel_time(0.0), @@ -90,6 +89,7 @@ struct ToolItemFeatures { onplace_replace_item(CONTENT_IGNORE), onplace_node(CONTENT_IGNORE) { + description = (char*)""; diginfo.uses = 256; diginfo.time = 4.0; diginfo.level = 0; diff --git a/src/enchantment.cpp b/src/enchantment.cpp index 90523a0..afe5641 100644 --- a/src/enchantment.cpp +++ b/src/enchantment.cpp @@ -54,7 +54,7 @@ static void enchantment_init() f->level = 0; f->mask = 0; f->overlay = ""; - f->name = L""; + f->name = (char*)""; f->gem = CONTENT_IGNORE; } @@ -63,7 +63,7 @@ static void enchantment_init() f->type = i; f->mask = (1<<(i-1)); f->overlay = "flame"; - f->name = L"Ignis"; + f->name = (char*)"Ignis"; f->gem = CONTENT_CRAFTITEM_SUNSTONE; i = ENCHANTMENT_DONTBREAK; @@ -71,7 +71,7 @@ static void enchantment_init() f->type = i; f->mask = (1<<(i-1)); f->overlay = "dontbreak"; - f->name = L"Indomitus"; + f->name = (char*)"Indomitus"; f->gem = CONTENT_CRAFTITEM_SAPPHIRE; i = ENCHANTMENT_MORE; @@ -79,7 +79,7 @@ static void enchantment_init() f->type = i; f->mask = (1<<(i-1)); f->overlay = "more"; - f->name = L"Amplius"; + f->name = (char*)"Amplius"; f->gem = CONTENT_CRAFTITEM_TURQUOISE; i = ENCHANTMENT_FAST; @@ -87,7 +87,7 @@ static void enchantment_init() f->type = i; f->mask = (1<<(i-1)); f->overlay = "fast"; - f->name = L"Velox"; + f->name = (char*)"Velox"; f->gem = CONTENT_CRAFTITEM_AMETHYST; i = ENCHANTMENT_LONGLASTING; @@ -95,7 +95,7 @@ static void enchantment_init() f->type = i; f->mask = (1<<(i-1)); f->overlay = "longlast"; - f->name = L"Aeterna"; + f->name = (char*)"Aeterna"; f->gem = CONTENT_CRAFTITEM_RUBY; enchantment_isinit = 1; diff --git a/src/enchantment.h b/src/enchantment.h index 051d48e..b8a49f5 100644 --- a/src/enchantment.h +++ b/src/enchantment.h @@ -37,7 +37,7 @@ struct EnchantmentInfo { uint8_t level; uint16_t mask; std::string overlay; - std::wstring name; + char* name; content_t gem; }; diff --git a/src/file.c b/src/file.c new file mode 100644 index 0000000..b5cf7fe --- /dev/null +++ b/src/file.c @@ -0,0 +1,446 @@ +/************************************************************************ +* file.c +* voxelands - 3d voxel world sandbox game +* Copyright (C) Lisa 'darkrose' Milne 2016 +* +* 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 3 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, see +************************************************************************/ + +#include "file.h" +#include "path.h" + +#include +#include +#include +#include +#include + +#define FILE_BUFF_STEP 1024 + +static int file_extend(file_t *file, int min) +{ + unsigned char* b; + int inc = min; + int ttl; + if (min < FILE_BUFF_STEP) + inc = FILE_BUFF_STEP; + ttl = file->size+inc; + + b = realloc(file->data,ttl); + if (!b) + return 0; + + file->data = b; + file->size = ttl; + + return inc; +} + +/* load a file into memory */ +file_t *file_load(char* type, char* name) +{ + file_t *ft; + FILE *f; + char* fn; + char* path; + + if (type) { + fn = name; + path = path_get(type,name,1,NULL,0); + }else{ + path = name; + fn = strrchr(name,'/'); + if (!fn) + return NULL; + fn++; + } + + if (!path) + return NULL; + + f = fopen(path, "rb"); + if (!f) { + free(path); + return NULL; + } + + ft = malloc(sizeof(file_t)); + if (!ft) { + free(path); + fclose(f); + return NULL; + } + + ft->pos = 0; + ft->modified = 0; + + fseek(f, 0, SEEK_END); + ft->len = ftell(f); + fseek(f, 0, SEEK_SET); + + ft->size = ft->len+1; + + ft->data = malloc(ft->size); + if (!ft->data) { + free(path); + fclose(f); + free(ft); + return NULL; + } + + if (ft->len != fread(ft->data, 1, ft->len, f)) { + free(path); + fclose(f); + free(ft->data); + free(ft); + return NULL; + } + + /* this lets us do string operations on text files */ + ft->data[ft->len] = 0; + + fclose(f); + + ft->name = strdup(fn); + ft->path = path; + + return ft; +} + +/* load a file into memory */ +file_t *file_create(char* type, char *name) +{ + file_t *ft; + char* fn; + char* path; + + if (name) { + if (type) { + fn = name; + path = path_get(type,name,0,NULL,0); + }else{ + path = strdup(name); + fn = strrchr(name,'/'); + if (!fn) + return NULL; + fn++; + } + }else{ + fn = NULL; + path = NULL; + } + + ft = malloc(sizeof(file_t)); + if (!ft) { + free(path); + return NULL; + } + + ft->pos = 0; + ft->len = 0; + ft->size = 0; + ft->modified = 0; + + ft->data = NULL; + + if (fn) + ft->name = strdup(fn); + ft->path = path; + + return ft; +} + +/* free a loaded file */ +void file_free(file_t *file) +{ + if (!file) + return; + + if (file->data) + free(file->data); + + if (file->name) + free(file->name); + + free(file); +} + +/* flush file data to disk */ +void file_flush(file_t *file) +{ + FILE *f; + if (!file || !file->modified || !file->path) + return; + + if (!path_exists(file->path)) { + if (!path_create(NULL,file->path)) + return; + } + + f = fopen(file->path, "wb"); + if (!f) + return; + + if (file->len) { + if (fwrite(file->data,1,file->len,f) != file->len) { + fclose(f); + return; + } + } + + fclose(f); + file->modified = 0; +} + +/* find the next occurance of value from offset in file, return it's position + * relative to offset */ +int file_find(file_t *file, int offset, unsigned char value) +{ + int r; + if (!file) + return -1; + + for (r=offset; rlen; r++) { + if (file->data[r] == value) + return (r-offset); + } + return -1; +} + +/* find the next occurance of value from offset in file, return it's position + * relative to offset */ +int file_strfind(file_t *file, int offset, char* value) +{ + int r; + char* v; + if (!file || file->len <= offset) + return -1; + + v = strstr((char*)(file->data+offset),value); + if (!v) + return -1; + + r = (v-(char*)file->data); + if (r < 0) + return -1; + + return (r-offset); +} + +/* read from a file buffer to dst */ +int file_read(file_t *file, void* dst, int size) +{ + int len; + if (!file || !file->len) + return -1; + + len = file->len - file->pos; + if (size < len) { + len = size; + } + + if (len > 0) { + memcpy(dst, file->data+file->pos, len); + file->pos += len; + } + + return len; +} + +/* read a line from a file buffer to dst */ +int file_readline(file_t *file, char* dst, int size) +{ + int len; + char* b; + char* e; + if (!file || !file->len) + return -1; + if (file->pos >= file->len) + return -1; + + b = (char*)(file->data+file->pos); + + e = strchr(b,'\n'); + if (e) { + len = (e-b); + file->pos += len+1; + }else{ + len = strlen(b); + file->pos += len; + } + + if (len >= size) + len = size-1; + + memcpy(dst, b, len); + dst[len] = 0; + + if (file->pos > file->len) + file->pos = file->len; + + return len; +} + +/* read integer from a file buffer */ +int file_read_int(file_t *file) +{ + int32_t r; + file_read(file,&r,4); + return r; +} + +/* read short integer from a file buffer */ +int16_t file_read_short(file_t *file) +{ + int16_t r; + file_read(file,&r,2); + return r; +} + +/* read char from a file buffer */ +char file_read_char(file_t *file) +{ + char r = 0; + file_read(file,&r,1); + return r; +} + +/* read unsigned integer from a file buffer */ +uint32_t file_read_uint(file_t *file) +{ + uint32_t r; + file_read(file,&r,4); + return r; +} + +/* read float from a file buffer */ +float file_read_float(file_t *file) +{ + float r; + file_read(file,&r,4); + return r; +} + +/* seek to a position in a file buffer */ +int file_seek(file_t *file, int offset, int origin) +{ + if (!file) + return -1; + + switch (origin) { + case SEEK_SET: + if (file->len < offset) + offset = file->len; + + file->pos = offset; + break; + case SEEK_CUR: + offset += file->pos; + if (file->len < offset) + offset = file->len; + + file->pos = offset; + break; + case SEEK_END: + file->pos = file->len; + break; + default:; + }; + + if (file->pos < 0) + file->pos = 0; + + return 0; +} + +/* get the position in a file buffer */ +int file_tell(file_t *file) +{ + if (!file) + return -1; + + return file->pos; +} + +/* get the pointer to the current file position */ +void *file_get(file_t *file) +{ + return file->data+file->pos; +} + +/* write data to a file buffer */ +int file_write(file_t *file, void *buff, int size) +{ + if (!file || !buff || size) + return -1; + + if (file->size <= (file->pos+size+1)) { + int inc = file->pos+size+2; + if (file_extend(file,inc) < inc) + return 0; + } + + if (!memcpy(file->data+file->pos,buff,size)) { + file->data[file->pos] = 0; + return 0; + } + + file->pos += size; + if (file->pos >= file->len) { + file->len = file->pos; + file->data[file->pos] = 0; + } + file->modified = 1; + + return size; +} + +/* write a formatted string to a file buffer (printf style) */ +int file_writef(file_t *file, char* fmt, ...) +{ + va_list ap; + int l; + int s; + if (!file) + return -1; + + if (!file->size || !file->data) { + if (file_extend(file,FILE_BUFF_STEP) <= 0) + return 0; + } + + /* basically "keep trying till it all fits" */ + while (1) { + va_start(ap, fmt); + s = (file->size-1)-file->pos; + l = vsnprintf((char*)(file->data+file->pos), s, fmt, ap); + va_end(ap); + if (l < s) + break; + if (file_extend(file,s+FILE_BUFF_STEP) <= 0) { + if (file->data) + file->data[file->len] = 0; + return 0; + } + } + + file->pos += l; + if (file->pos >= file->len) { + file->len = file->pos; + file->data[file->pos] = 0; + } + file->modified = 1; + + return l; +} diff --git a/src/file.h b/src/file.h new file mode 100644 index 0000000..3fbc034 --- /dev/null +++ b/src/file.h @@ -0,0 +1,50 @@ +#ifndef _FILE_H_ +#define _FILE_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +#ifndef _HAVE_FILE_TYPE +#define _HAVE_FILE_TYPE +typedef struct file_s { + struct file_s *prev; + struct file_s *next; + char* path; + char* name; + unsigned char* data; + int size; + int len; + int pos; + int modified; +} file_t; +#endif + +/* defined in file.c */ +file_t *file_load(char* type, char *name); +file_t *file_create(char* type, char *name); +void file_free(file_t *file); +void file_flush(file_t *file); +int file_find(file_t *file, int offset, unsigned char value); +int file_strfind(file_t *file, int offset, char* value); +int file_read(file_t *file, void* dst, int size); +int file_readline(file_t *file, char* dst, int size); +int file_read_int(file_t *file); +int16_t file_read_short(file_t *file); +char file_read_char(file_t *file); +uint32_t file_read_uint(file_t *file); +float file_read_float(file_t *file); +int file_seek(file_t *file, int offset, int origin); +int file_tell(file_t *file); +void *file_get(file_t *file); +int file_write(file_t *file, void *buff, int size); +int file_writef(file_t *file, char* fmt, ...); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/game.cpp b/src/game.cpp index a0c118f..f0386b9 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -563,6 +563,7 @@ void getPointedNode(Client *client, v3f player_position, */ void drawLoadingScreen(irr::IrrlichtDevice* device, const std::wstring msg) { + char buff[1024]; if (device == NULL) return; device->run(); @@ -575,20 +576,23 @@ void drawLoadingScreen(irr::IrrlichtDevice* device, const std::wstring msg) driver->beginScene(true, true, video::SColor(255,0,0,0)); - video::ITexture *logotexture = driver->getTexture(getTexturePath("menulogo.png").c_str()); - if (logotexture) { - core::rect rect(x-100,y-150,x+100,y+50); - driver->draw2DImage(logotexture, rect, - core::rect(core::position2d(0,0), - core::dimension2di(logotexture->getSize())), - NULL, NULL, true); + + if (path_get((char*)"texture",(char*)"menulogo.png",1,buff,1024)) { + video::ITexture *logotexture = driver->getTexture(buff); + if (logotexture) { + core::rect rect(x-100,y-150,x+100,y+50); + driver->draw2DImage(logotexture, rect, + core::rect(core::position2d(0,0), + core::dimension2di(logotexture->getSize())), + NULL, NULL, true); + } } if (guienv) { std::wstring m; if (msg != L"") { m = msg; }else{ - m = wgettext("Loading"); + m = narrow_to_wide(gettext("Loading")); } core::dimension2d textsize = guienv->getSkin()->getFont()->getDimension(m.c_str()); core::rect rect(x-(textsize.Width/2), y+50, x+textsize.Width, y+50+textsize.Height); @@ -660,7 +664,7 @@ void the_game( Draw "Loading" screen */ //draw_load_screen(L"Loading...", driver, font); - drawLoadingScreen(device,wgettext("Loading...")); + drawLoadingScreen(device,narrow_to_wide(gettext("Loading..."))); /* Create server. @@ -669,7 +673,7 @@ void the_game( SharedPtr server; if(address == ""){ //draw_load_screen(L"Creating server...", driver, font); - drawLoadingScreen(device,wgettext("Creating server...")); + drawLoadingScreen(device,narrow_to_wide(gettext("Creating server..."))); infostream<<"Creating server"<start(port); @@ -680,12 +684,12 @@ void the_game( */ //draw_load_screen(L"Creating client...", driver, font); - drawLoadingScreen(device,wgettext("Creating client...")); + drawLoadingScreen(device,narrow_to_wide(gettext("Creating client..."))); infostream<<"Creating client"<wasKeyDown(getKeySetting(VLKC_FREEMOVE))) { if (free_move) { free_move = false; - statustext = wgettext("free_move disabled"); + statustext = narrow_to_wide(gettext("free_move disabled")); statustext_time = 0; }else{ free_move = true; - statustext = wgettext("free_move enabled"); + statustext = narrow_to_wide(gettext("free_move enabled")); statustext_time = 0; } }else if(input->wasKeyDown(getKeySetting(VLKC_SCREENSHOT))) { @@ -1167,10 +1171,10 @@ void the_game( g_settings->get("screenshot_path").c_str(), device->getTimer()->getRealTime()); if (driver->writeImageToFile(image, io::path(filename))) { - wchar_t buff[512]; - swprintf(buff, 512, wgettext("Saved screenshot to '%s'"), narrow_to_wide(filename).c_str()); + char buff[512]; + snprintf(buff, 512, gettext("Saved screenshot to '%s'"), filename); infostream << "Saved screenshot to '" << filename << "'" << std::endl; - statustext = (wchar_t *)buff; + statustext = narrow_to_wide(buff); statustext_time = 0; }else{ infostream << "Failed to save screenshot '" << filename << "'"<wasKeyDown(getKeySetting(VLKC_TOGGLE_HUD))) { show_hud = !show_hud; if (show_hud) { - statustext = wgettext("HUD shown"); + statustext = narrow_to_wide(gettext("HUD shown")); }else{ - statustext = wgettext("HUD hidden"); + statustext = narrow_to_wide(gettext("HUD hidden")); } statustext_time = 0; }else if (input->wasKeyDown(getKeySetting(VLKC_TOGGLE_CHAT))) { show_chat = !show_chat; if (show_chat) { - statustext = wgettext("Chat shown"); + statustext = narrow_to_wide(gettext("Chat shown")); }else{ - statustext = wgettext("Chat hidden"); + statustext = narrow_to_wide(gettext("Chat hidden")); } statustext_time = 0; }else if (input->wasKeyDown(getKeySetting(VLKC_TOGGLE_FOG))) { force_fog_off = !force_fog_off; if (force_fog_off) { - statustext = wgettext("Fog disabled"); + statustext = narrow_to_wide(gettext("Fog disabled")); }else{ - statustext = wgettext("Fog enabled"); + statustext = narrow_to_wide(gettext("Fog enabled")); } statustext_time = 0; }else if (input->wasKeyDown(getKeySetting(VLKC_TOGGLE_CAMERA))) { disable_camera_update = !disable_camera_update; if (disable_camera_update) { - statustext = wgettext("Camera update disabled"); + statustext = narrow_to_wide(gettext("Camera update disabled")); }else{ - statustext = wgettext("Camera update enabled"); + statustext = narrow_to_wide(gettext("Camera update enabled")); } statustext_time = 0; }else if (input->wasKeyDown(getKeySetting(VLKC_TOGGLE_DEBUG))) { @@ -1216,16 +1220,16 @@ void the_game( if (!show_debug) { show_debug = true; show_debug_frametime = false; - statustext = wgettext("Debug info shown"); + statustext = narrow_to_wide(gettext("Debug info shown")); statustext_time = 0; }else if (show_debug_frametime) { show_debug = false; show_debug_frametime = false; - statustext = wgettext("Debug info and frametime graph hidden"); + statustext = narrow_to_wide(gettext("Debug info and frametime graph hidden")); statustext_time = 0; }else{ show_debug_frametime = true; - statustext = wgettext("Frametime graph shown"); + statustext = narrow_to_wide(gettext("Frametime graph shown")); statustext_time = 0; } }else if (input->wasKeyDown(getKeySetting(VLKC_TOGGLE_PROFILER))) { @@ -1236,21 +1240,21 @@ void the_game( show_profiler, show_profiler_max); if (show_profiler != 0) { - wchar_t buff[512]; - swprintf(buff,512,wgettext("Profiler shown (page %d of %d)"),show_profiler,show_profiler_max); - statustext = std::wstring(buff); + char buff[512]; + snprintf(buff,512,gettext("Profiler shown (page %d of %d)"),show_profiler,show_profiler_max); + statustext = narrow_to_wide(buff); statustext_time = 0; }else{ - statustext = wgettext("Profiler hidden"); + statustext = narrow_to_wide(gettext("Profiler hidden")); statustext_time = 0; } }else if (input->wasKeyDown(getKeySetting(VLKC_RANGE_PLUS))) { s16 range = g_settings->getS16("viewing_range_nodes_min"); s16 range_new = range + 10; g_settings->set("viewing_range_nodes_min", itos(range_new)); - wchar_t buff[512]; - swprintf(buff,512,wgettext("Minimum viewing range changed to %d"),range_new); - statustext = std::wstring(buff); + char buff[512]; + snprintf(buff,512,gettext("Minimum viewing range changed to %d"),range_new); + statustext = narrow_to_wide(buff); statustext_time = 0; }else if (input->wasKeyDown(getKeySetting(VLKC_RANGE_MINUS))) { s16 range = g_settings->getS16("viewing_range_nodes_min"); @@ -1259,9 +1263,9 @@ void the_game( range_new = range; g_settings->set("viewing_range_nodes_min", itos(range_new)); - wchar_t buff[512]; - swprintf(buff,512,wgettext("Minimum viewing range changed to %d"),range_new); - statustext = std::wstring(buff); + char buff[512]; + snprintf(buff,512,gettext("Minimum viewing range changed to %d"),range_new); + statustext = narrow_to_wide(buff); statustext_time = 0; } @@ -1329,11 +1333,11 @@ void the_game( draw_control.range_all = !draw_control.range_all; if (draw_control.range_all) { infostream<<"Enabled full viewing range"< rect(0, 0, 400, 50); rect = rect + v2s32(size.X/2-400/2, size.Y/2-50/2-25); - Environment->addStaticText(wgettext("You died."), rect, false, true, this, 256); + Environment->addStaticText(narrow_to_wide(gettext("You died.")).c_str(), rect, false, true, this, 256); } { core::rect rect(0, 0, 140, 30); rect = rect + v2s32(size.X/2-140/2, size.Y/2-30/2+25); - gui::IGUIElement *e = Environment->addButton(rect, this, 257, wgettext("Respawn")); + gui::IGUIElement *e = Environment->addButton(rect, this, 257, narrow_to_wide(gettext("Respawn")).c_str()); Environment->setFocus(e); } } diff --git a/src/guiFormSpecMenu.cpp b/src/guiFormSpecMenu.cpp index ad213a7..085e682 100644 --- a/src/guiFormSpecMenu.cpp +++ b/src/guiFormSpecMenu.cpp @@ -388,6 +388,7 @@ void GUIFormSpecMenu::regenerateGui(v2u32 screensize) Environment->addButton(rect, this, spec.fid, spec.flabel.c_str()); m_fields.push_back(spec); }else if (type == "image_button" || type == "image_button_exit") { + char buff[1024]; v2s32 pos; pos.X = mystof(f.next(",")) * (float)spacing.X; pos.Y = mystof(f.next(";")) * (float)spacing.Y; @@ -413,11 +414,13 @@ void GUIFormSpecMenu::regenerateGui(v2u32 screensize) if (type == "image_button_exit") spec.is_exit = true; - video::ITexture *texture = Environment->getVideoDriver()->getTexture(getTexturePath(fimage).c_str()); gui::IGUIButton *e = Environment->addButton(rect, this, spec.fid, spec.flabel.c_str()); - e->setImage(texture); - e->setPressedImage(texture); - e->setScaleImage(true); + if (path_get((char*)"texture",const_cast(fimage.c_str()),1,buff,1024)) { + video::ITexture *texture = Environment->getVideoDriver()->getTexture(buff); + e->setImage(texture); + e->setPressedImage(texture); + e->setScaleImage(true); + } m_fields.push_back(spec); }else{ @@ -433,8 +436,7 @@ void GUIFormSpecMenu::regenerateGui(v2u32 screensize) core::rect rect(0, 0, size.X-padding.X*2, helptext_h); rect = rect + v2s32(size.X/2 - rect.getWidth()/2, size.Y-rect.getHeight()-5); - const wchar_t *text = wgettext("Left click: Move all items, Right click: Move single item"); - Environment->addStaticText(text, rect, false, true, this, 256); + Environment->addStaticText(narrow_to_wide(gettext("Left click: Move all items, Right click: Move single item")).c_str(), rect, false, true, this, 256); } // If there's fields, add a Proceed button if (m_fields.size() && bp_set != 2) { @@ -455,7 +457,7 @@ void GUIFormSpecMenu::regenerateGui(v2u32 screensize) v2s32 size = DesiredRect.getSize(); rect = core::rect(size.X/2-70, pos.Y, (size.X/2-70)+140, pos.Y+25); - Environment->addButton(rect, this, 257, wgettext("Write It")); + Environment->addButton(rect, this, 257, narrow_to_wide(gettext("Write It")).c_str()); } } // Add tooltip @@ -514,8 +516,11 @@ void GUIFormSpecMenu::drawList(const ListDrawSpec &s, int phase) InventoryList *ilist = inv->getList(s.listname); video::ITexture *bg_texture = NULL; - if (s.background != "") - bg_texture = driver->getTexture(getTexturePath(s.background).c_str()); + if (s.background != "") { + char buff[1024]; + if (path_get((char*)"texture",const_cast(s.background.c_str()),1,buff,1024)) + bg_texture = driver->getTexture(buff); + } core::rect imgrect(0,0,imgsize.X,imgsize.Y); @@ -621,7 +626,10 @@ void GUIFormSpecMenu::drawMenu() for (u32 i=0; igetTexture(getTexturePath(spec.name).c_str()); + char buff[1024]; + video::ITexture *texture = NULL; + if (path_get((char*)"texture",const_cast(spec.name.c_str()),1,buff,1024)) + texture = driver->getTexture(buff); // Image size on screen core::rect imgrect(0, 0, spec.geom.X, spec.geom.Y); // Image rectangle on screen diff --git a/src/guiMainMenu.cpp b/src/guiMainMenu.cpp index b49e4b3..9c50247 100644 --- a/src/guiMainMenu.cpp +++ b/src/guiMainMenu.cpp @@ -318,37 +318,37 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 200, 40); rect += v2s32(25, 200); - Environment->addButton(rect, this, GUI_ID_CHARACTER_CREATOR, wgettext("Character Creator")); + Environment->addButton(rect, this, GUI_ID_CHARACTER_CREATOR, narrow_to_wide(gettext("Character Creator")).c_str()); } // Single Player button { core::rect rect(0, 0, 200, 40); rect += v2s32(25, 260); - Environment->addButton(rect, this, GUI_ID_TAB_SINGLEPLAYER, wgettext("Single Player")); + Environment->addButton(rect, this, GUI_ID_TAB_SINGLEPLAYER, narrow_to_wide(gettext("Single Player")).c_str()); } // Multi Player button { core::rect rect(0, 0, 200, 40); rect += v2s32(25, 305); - Environment->addButton(rect, this, GUI_ID_TAB_MULTIPLAYER, wgettext("Multi Player")); + Environment->addButton(rect, this, GUI_ID_TAB_MULTIPLAYER, narrow_to_wide(gettext("Multi Player")).c_str()); } // Settings button { core::rect rect(0, 0, 180, 40); rect += v2s32(35, 350); - Environment->addButton(rect, this, GUI_ID_TAB_SETTINGS, wgettext("Settings")); + Environment->addButton(rect, this, GUI_ID_TAB_SETTINGS, narrow_to_wide(gettext("Settings")).c_str()); } // Credits button { core::rect rect(0, 0, 180, 40); rect += v2s32(35, 395); - Environment->addButton(rect, this, GUI_ID_TAB_CREDITS, wgettext("Credits")); + Environment->addButton(rect, this, GUI_ID_TAB_CREDITS, narrow_to_wide(gettext("Credits")).c_str()); } // Quit button { core::rect rect(0, 0, 180, 40); rect += v2s32(35, 440); - Environment->addButton(rect, this, GUI_ID_TAB_QUIT, wgettext("Quit")); + Environment->addButton(rect, this, GUI_ID_TAB_QUIT, narrow_to_wide(gettext("Quit")).c_str()); } v2s32 topleft_content(250, 0); @@ -385,7 +385,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 550, 20); rect += topleft_content + v2s32(0, 20); - gui::IGUIStaticText *t = Environment->addStaticText(wgettext("Single Player"), rect, false, true, this, -1); + gui::IGUIStaticText *t = Environment->addStaticText(narrow_to_wide(gettext("Single Player")).c_str(), rect, false, true, this, -1); t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); } @@ -394,9 +394,9 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) core::rect rect(0, 0, 200, 30); rect += topleft_content + v2s32(175, 60); gui::IGUIComboBox *c = Environment->addComboBox(rect, this, GUI_ID_GAME_MODE_COMBO); - u32 cm = c->addItem(wgettext("Creative Mode"),GUI_ID_GAME_MODE_CREATIVE); - u32 am = c->addItem(wgettext("Adventure Mode"),GUI_ID_GAME_MODE_ADVENTURE); - u32 sm = c->addItem(wgettext("Survival Mode"),GUI_ID_GAME_MODE_SURVIVAL); + u32 cm = c->addItem(narrow_to_wide(gettext("Creative Mode")).c_str(),GUI_ID_GAME_MODE_CREATIVE); + u32 am = c->addItem(narrow_to_wide(gettext("Adventure Mode")).c_str(),GUI_ID_GAME_MODE_ADVENTURE); + u32 sm = c->addItem(narrow_to_wide(gettext("Survival Mode")).c_str(),GUI_ID_GAME_MODE_SURVIVAL); if (game_mode == L"creative") { c->setSelected(cm); }else if (game_mode == L"adventure") { @@ -409,25 +409,25 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 220, 30); rect += topleft_content + v2s32(50, 100); - Environment->addButton(rect, this, GUI_ID_GAME_SETTINGS_ADV, wgettext("Advanced Settings")); + Environment->addButton(rect, this, GUI_ID_GAME_SETTINGS_ADV, narrow_to_wide(gettext("Advanced Settings")).c_str()); } // Map options button { core::rect rect(0, 0, 220, 30); rect += topleft_content + v2s32(280, 100); - Environment->addButton(rect, this, GUI_ID_MAP_OPTIONS_BUTTON, wgettext("Map Options")); + Environment->addButton(rect, this, GUI_ID_MAP_OPTIONS_BUTTON, narrow_to_wide(gettext("Map Options")).c_str()); } // Start game button { core::rect rect(0, 0, 180, 30); rect += topleft_content + v2s32(185, 170); - Environment->addButton(rect, this, GUI_ID_JOIN_GAME_BUTTON, wgettext("Start Game")); + Environment->addButton(rect, this, GUI_ID_JOIN_GAME_BUTTON, narrow_to_wide(gettext("Start Game")).c_str()); } }else if (m_data->selected_tab == TAB_SINGLEPLAYER_ADVANCED) { { core::rect rect(0, 0, 550, 20); rect += topleft_content + v2s32(0, 20); - gui::IGUIStaticText *t = Environment->addStaticText(wgettext("Single Player"), rect, false, true, this, -1); + gui::IGUIStaticText *t = Environment->addStaticText(narrow_to_wide(gettext("Single Player")).c_str(), rect, false, true, this, -1); t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); } @@ -436,9 +436,9 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) core::rect rect(0, 0, 200, 30); rect += topleft_content + v2s32(175, 60); gui::IGUIComboBox *c = Environment->addComboBox(rect, this, GUI_ID_GAME_MODE_COMBO); - u32 cm = c->addItem(wgettext("Creative Mode"),GUI_ID_GAME_MODE_CREATIVE); - u32 am = c->addItem(wgettext("Adventure Mode"),GUI_ID_GAME_MODE_ADVENTURE); - u32 sm = c->addItem(wgettext("Survival Mode"),GUI_ID_GAME_MODE_SURVIVAL); + u32 cm = c->addItem(narrow_to_wide(gettext("Creative Mode")).c_str(),GUI_ID_GAME_MODE_CREATIVE); + u32 am = c->addItem(narrow_to_wide(gettext("Adventure Mode")).c_str(),GUI_ID_GAME_MODE_ADVENTURE); + u32 sm = c->addItem(narrow_to_wide(gettext("Survival Mode")).c_str(),GUI_ID_GAME_MODE_SURVIVAL); if (game_mode == L"creative") { c->setSelected(cm); }else if (game_mode == L"adventure") { @@ -451,28 +451,28 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 220, 30); rect += topleft_content + v2s32(50, 100); - Environment->addButton(rect, this, GUI_ID_GAME_SETTINGS_BASIC, wgettext("Hide Advanced Settings")); + Environment->addButton(rect, this, GUI_ID_GAME_SETTINGS_BASIC, narrow_to_wide(gettext("Hide Advanced Settings")).c_str()); } // Map options button { core::rect rect(0, 0, 220, 30); rect += topleft_content + v2s32(280, 100); - Environment->addButton(rect, this, GUI_ID_MAP_OPTIONS_BUTTON, wgettext("Map Options")); + Environment->addButton(rect, this, GUI_ID_MAP_OPTIONS_BUTTON, narrow_to_wide(gettext("Map Options")).c_str()); } { core::rect rect(0, 0, 125, 20); rect += topleft_content + v2s32(40, 160); - gui::IGUIStaticText *t = Environment->addStaticText(wgettext("Creatures"), rect, false, true, this, -1); + gui::IGUIStaticText *t = Environment->addStaticText(narrow_to_wide(gettext("Creatures")).c_str(), rect, false, true, this, -1); t->setTextAlignment(gui::EGUIA_LOWERRIGHT, gui::EGUIA_UPPERLEFT); } { core::rect rect(0, 0, 240, 30); rect += topleft_content + v2s32(170, 155); gui::IGUIComboBox *c = Environment->addComboBox(rect, this, GUI_ID_MOBS_COMBO); - u32 nm = c->addItem(wgettext("None"),GUI_ID_MOBS_NONE); - u32 pm = c->addItem(wgettext("Passive"),GUI_ID_MOBS_PASSIVE); - u32 am = c->addItem(wgettext("Passive & Aggressive"),GUI_ID_MOBS_AGGRESSIVE); - u32 dm = c->addItem(wgettext("Passive, Aggressive, & Destructive"),GUI_ID_MOBS_DESTRUCTIVE); + u32 nm = c->addItem(narrow_to_wide(gettext("None")).c_str(),GUI_ID_MOBS_NONE); + u32 pm = c->addItem(narrow_to_wide(gettext("Passive")).c_str(),GUI_ID_MOBS_PASSIVE); + u32 am = c->addItem(narrow_to_wide(gettext("Passive & Aggressive")).c_str(),GUI_ID_MOBS_AGGRESSIVE); + u32 dm = c->addItem(narrow_to_wide(gettext("Passive, Aggressive, & Destructive")).c_str(),GUI_ID_MOBS_DESTRUCTIVE); if (max_mob_level == L"passive") { c->setSelected(pm); }else if (max_mob_level == L"destructive") { @@ -486,59 +486,59 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 200, 30); rect += topleft_content + v2s32(70, 200); - Environment->addCheckBox(enable_damage, rect, this, GUI_ID_DAMAGE_CB, wgettext("Player Damage")); + Environment->addCheckBox(enable_damage, rect, this, GUI_ID_DAMAGE_CB, narrow_to_wide(gettext("Player Damage")).c_str()); } { core::rect rect(0, 0, 200, 30); rect += topleft_content + v2s32(80, 230); - Environment->addCheckBox(suffocation, rect, this, GUI_ID_SUFFOCATE_CB, wgettext("Suffocation/Drowning")); + Environment->addCheckBox(suffocation, rect, this, GUI_ID_SUFFOCATE_CB, narrow_to_wide(gettext("Suffocation/Drowning")).c_str()); } { core::rect rect(0, 0, 200, 30); rect += topleft_content + v2s32(80, 260); - Environment->addCheckBox(hunger, rect, this, GUI_ID_HUNGER_CB, wgettext("Hunger")); + Environment->addCheckBox(hunger, rect, this, GUI_ID_HUNGER_CB, narrow_to_wide(gettext("Hunger")).c_str()); } { core::rect rect(0, 0, 200, 30); rect += topleft_content + v2s32(70, 290); - Environment->addCheckBox(tool_wear, rect, this, GUI_ID_TOOL_WEAR_CB, wgettext("Tool Wear")); + Environment->addCheckBox(tool_wear, rect, this, GUI_ID_TOOL_WEAR_CB, narrow_to_wide(gettext("Tool Wear")).c_str()); } { core::rect rect(0, 0, 200, 30); rect += topleft_content + v2s32(70, 320); - Environment->addCheckBox(unsafe_fire, rect, this, GUI_ID_FIRE_CB, wgettext("Dangerous Fire")); + Environment->addCheckBox(unsafe_fire, rect, this, GUI_ID_FIRE_CB, narrow_to_wide(gettext("Dangerous Fire")).c_str()); } { core::rect rect(0, 0, 200, 30); rect += topleft_content + v2s32(300, 200); - Environment->addCheckBox(infinite_inventory, rect, this, GUI_ID_INFINITE_INV_CB, wgettext("Infinite Inventory")); + Environment->addCheckBox(infinite_inventory, rect, this, GUI_ID_INFINITE_INV_CB, narrow_to_wide(gettext("Infinite Inventory")).c_str()); } { core::rect rect(0, 0, 200, 30); rect += topleft_content + v2s32(310, 230); - Environment->addCheckBox(initial_inventory, rect, this, GUI_ID_INITIAL_INV_CB, wgettext("Initial Inventory")); + Environment->addCheckBox(initial_inventory, rect, this, GUI_ID_INITIAL_INV_CB, narrow_to_wide(gettext("Initial Inventory")).c_str()); } { core::rect rect(0, 0, 200, 30); rect += topleft_content + v2s32(300, 260); - Environment->addCheckBox(droppable_inventory, rect, this, GUI_ID_DROPPABLE_INV_CB, wgettext("Droppable Inventory")); + Environment->addCheckBox(droppable_inventory, rect, this, GUI_ID_DROPPABLE_INV_CB, narrow_to_wide(gettext("Droppable Inventory")).c_str()); } { core::rect rect(0, 0, 200, 30); rect += topleft_content + v2s32(300, 290); - Environment->addCheckBox(death_drops_inventory, rect, this, GUI_ID_LOSE_INV_CB, wgettext("Death drops Inventory")); + Environment->addCheckBox(death_drops_inventory, rect, this, GUI_ID_LOSE_INV_CB, narrow_to_wide(gettext("Death drops Inventory")).c_str()); } // Start game button { core::rect rect(0, 0, 180, 30); rect += topleft_content + v2s32(185, 370); - Environment->addButton(rect, this, GUI_ID_JOIN_GAME_BUTTON, wgettext("Start Game")); + Environment->addButton(rect, this, GUI_ID_JOIN_GAME_BUTTON, narrow_to_wide(gettext("Start Game")).c_str()); } }else if (m_data->selected_tab == TAB_SINGLEPLAYER_MAP) { { core::rect rect(0, 0, 550, 20); rect += topleft_content + v2s32(0, 20); - gui::IGUIStaticText *t = Environment->addStaticText(wgettext("Single Player"), rect, false, true, this, -1); + gui::IGUIStaticText *t = Environment->addStaticText(narrow_to_wide(gettext("Single Player")).c_str(), rect, false, true, this, -1); t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); } @@ -547,9 +547,9 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) core::rect rect(0, 0, 200, 30); rect += topleft_content + v2s32(175, 60); gui::IGUIComboBox *c = Environment->addComboBox(rect, this, GUI_ID_GAME_MODE_COMBO); - u32 cm = c->addItem(wgettext("Creative Mode"),GUI_ID_GAME_MODE_CREATIVE); - u32 am = c->addItem(wgettext("Adventure Mode"),GUI_ID_GAME_MODE_ADVENTURE); - u32 sm = c->addItem(wgettext("Survival Mode"),GUI_ID_GAME_MODE_SURVIVAL); + u32 cm = c->addItem(narrow_to_wide(gettext("Creative Mode")).c_str(),GUI_ID_GAME_MODE_CREATIVE); + u32 am = c->addItem(narrow_to_wide(gettext("Adventure Mode")).c_str(),GUI_ID_GAME_MODE_ADVENTURE); + u32 sm = c->addItem(narrow_to_wide(gettext("Survival Mode")).c_str(),GUI_ID_GAME_MODE_SURVIVAL); if (game_mode == L"creative") { c->setSelected(cm); }else if (game_mode == L"adventure") { @@ -562,44 +562,44 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 220, 30); rect += topleft_content + v2s32(50, 100); - Environment->addButton(rect, this, GUI_ID_GAME_SETTINGS_ADV, wgettext("Advanced Settings")); + Environment->addButton(rect, this, GUI_ID_GAME_SETTINGS_ADV, narrow_to_wide(gettext("Advanced Settings")).c_str()); } // Basic settings button { core::rect rect(0, 0, 220, 30); rect += topleft_content + v2s32(280, 100); - Environment->addButton(rect, this, GUI_ID_GAME_SETTINGS_BASIC, wgettext("Hide Map Options")); + Environment->addButton(rect, this, GUI_ID_GAME_SETTINGS_BASIC, narrow_to_wide(gettext("Hide Map Options")).c_str()); } { core::rect rect(0, 0, 200, 30); rect += topleft_content + v2s32(150, 130); - Environment->addCheckBox(delete_map, rect, this, GUI_ID_MAP_DELETE_CB, wgettext("Create New Map")); + Environment->addCheckBox(delete_map, rect, this, GUI_ID_MAP_DELETE_CB, narrow_to_wide(gettext("Create New Map")).c_str()); } if (delete_map) { { core::rect rect(0, 0, 300, 20); rect += topleft_content + v2s32(120, 160); - Environment->addStaticText(wgettext("Warning! Your old map will be deleted!"), + Environment->addStaticText(narrow_to_wide(gettext("Warning! Your old map will be deleted!")).c_str(), rect, false, true, this, -1); } { core::rect rect(0, 0, 120, 20); rect += topleft_content + v2s32(45, 195); - gui::IGUIStaticText *t = Environment->addStaticText(wgettext("Map Type"), rect, false, true, this, -1); + gui::IGUIStaticText *t = Environment->addStaticText(narrow_to_wide(gettext("Map Type")).c_str(), rect, false, true, this, -1); t->setTextAlignment(gui::EGUIA_LOWERRIGHT, gui::EGUIA_UPPERLEFT); } { core::rect rect(0, 0, 240, 30); rect += topleft_content + v2s32(170, 190); gui::IGUIComboBox *c = Environment->addComboBox(rect, this, GUI_ID_MAP_TYPE_COMBO); - u32 m1 = c->addItem(wgettext("Flat"),GUI_ID_MAP_TYPE_FLAT); - u32 m2 = c->addItem(wgettext("Flatter"),GUI_ID_MAP_TYPE_FLATTER); - u32 m3 = c->addItem(wgettext("Smoother"),GUI_ID_MAP_TYPE_SMOOTHER); - u32 m4 = c->addItem(wgettext("Default"),GUI_ID_MAP_TYPE_DEFAULT); - u32 m5 = c->addItem(wgettext("Hilly"),GUI_ID_MAP_TYPE_HILLY); - u32 m6 = c->addItem(wgettext("Mountains"),GUI_ID_MAP_TYPE_MOUNTAINS); - u32 m7 = c->addItem(wgettext("Crazy"),GUI_ID_MAP_TYPE_CRAZY); - u32 m8 = c->addItem(wgettext("Crazy Hills"),GUI_ID_MAP_TYPE_CRAZYHILLS); + u32 m1 = c->addItem(narrow_to_wide(gettext("Flat")).c_str(),GUI_ID_MAP_TYPE_FLAT); + u32 m2 = c->addItem(narrow_to_wide(gettext("Flatter")).c_str(),GUI_ID_MAP_TYPE_FLATTER); + u32 m3 = c->addItem(narrow_to_wide(gettext("Smoother")).c_str(),GUI_ID_MAP_TYPE_SMOOTHER); + u32 m4 = c->addItem(narrow_to_wide(gettext("Default")).c_str(),GUI_ID_MAP_TYPE_DEFAULT); + u32 m5 = c->addItem(narrow_to_wide(gettext("Hilly")).c_str(),GUI_ID_MAP_TYPE_HILLY); + u32 m6 = c->addItem(narrow_to_wide(gettext("Mountains")).c_str(),GUI_ID_MAP_TYPE_MOUNTAINS); + u32 m7 = c->addItem(narrow_to_wide(gettext("Crazy")).c_str(),GUI_ID_MAP_TYPE_CRAZY); + u32 m8 = c->addItem(narrow_to_wide(gettext("Crazy Hills")).c_str(),GUI_ID_MAP_TYPE_CRAZYHILLS); if (map_type == "flat") { c->setSelected(m1); }else if (map_type == "flatter") { @@ -621,13 +621,13 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 200, 30); rect += topleft_content + v2s32(150, 230); - Environment->addCheckBox(use_fixed_seed, rect, this, GUI_ID_MAP_SEED_CB, wgettext("Use Fixed Seed")); + Environment->addCheckBox(use_fixed_seed, rect, this, GUI_ID_MAP_SEED_CB, narrow_to_wide(gettext("Use Fixed Seed")).c_str()); } if (use_fixed_seed) { { core::rect rect(0, 0, 120, 20); rect += topleft_content + v2s32(65, 265); - gui::IGUIStaticText *t = Environment->addStaticText(wgettext("Map Seed"), rect, false, true, this, -1); + gui::IGUIStaticText *t = Environment->addStaticText(narrow_to_wide(gettext("Map Seed")).c_str(), rect, false, true, this, -1); t->setTextAlignment(gui::EGUIA_LOWERRIGHT, gui::EGUIA_UPPERLEFT); } { @@ -644,12 +644,12 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 200, 30); rect += topleft_content + v2s32(150, 160); - Environment->addCheckBox(clear_map, rect, this, GUI_ID_MAP_CLEAR_CB, wgettext("Clear Map")); + Environment->addCheckBox(clear_map, rect, this, GUI_ID_MAP_CLEAR_CB, narrow_to_wide(gettext("Clear Map")).c_str()); } if (clear_map) { core::rect rect(0, 0, 300, 40); rect += topleft_content + v2s32(120, 190); - Environment->addStaticText(wgettext("Warning! This will delete all construction from your map!"), + Environment->addStaticText(narrow_to_wide(gettext("Warning! This will delete all construction from your map!")).c_str(), rect, false, true, this, -1); } } @@ -657,7 +657,7 @@ void GUIMainMenu::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 180, 30); rect += topleft_content + v2s32(185, 310); - Environment->addButton(rect, this, GUI_ID_JOIN_GAME_BUTTON, wgettext("Start Game")); + Environment->addButton(rect, this, GUI_ID_JOIN_GAME_BUTTON, narrow_to_wide(gettext("Start Game")).c_str()); } }else if(m_data->selected_tab == TAB_CREDITS) { // CREDITS @@ -715,6 +715,7 @@ void GUIMainMenu::drawMenu() video::IVideoDriver* driver = Environment->getVideoDriver(); { + char buff[1024]; core::rect left( AbsoluteRect.UpperLeftCorner.X, AbsoluteRect.UpperLeftCorner.Y, @@ -729,18 +730,20 @@ void GUIMainMenu::drawMenu() ); driver->draw2DRectangle(left, GUI_BG_BTM, GUI_BG_BTM, GUI_BG_BTM, GUI_BG_BTM, &AbsoluteClippingRect); driver->draw2DRectangle(right, GUI_BG_TOP, GUI_BG_BTM, GUI_BG_TOP, GUI_BG_BTM, &AbsoluteClippingRect); - video::ITexture *texture = driver->getTexture(getTexturePath("menulogo.png").c_str()); - if (texture != 0) { - const core::dimension2d& img_origsize = texture->getOriginalSize(); - core::rect logo( - AbsoluteRect.UpperLeftCorner.X+25, - AbsoluteRect.UpperLeftCorner.Y, - AbsoluteRect.UpperLeftCorner.X+225, - AbsoluteRect.UpperLeftCorner.Y+200 - ); - const video::SColor color(255,255,255,255); - const video::SColor colors[] = {color,color,color,color}; - driver->draw2DImage(texture, logo, core::rect(core::position2d(0,0),img_origsize), NULL, colors, true); + if (path_get((char*)"texture",(char*)"menulogo.png",1,buff,1024)) { + video::ITexture *texture = driver->getTexture(buff); + if (texture != 0) { + const core::dimension2d& img_origsize = texture->getOriginalSize(); + core::rect logo( + AbsoluteRect.UpperLeftCorner.X+25, + AbsoluteRect.UpperLeftCorner.Y, + AbsoluteRect.UpperLeftCorner.X+225, + AbsoluteRect.UpperLeftCorner.Y+200 + ); + const video::SColor color(255,255,255,255); + const video::SColor colors[] = {color,color,color,color}; + driver->draw2DImage(texture, logo, core::rect(core::position2d(0,0),img_origsize), NULL, colors, true); + } } } diff --git a/src/guiMessageMenu.cpp b/src/guiMessageMenu.cpp index 9f73be2..9fa3c5e 100644 --- a/src/guiMessageMenu.cpp +++ b/src/guiMessageMenu.cpp @@ -109,7 +109,7 @@ void GUIMessageMenu::regenerateGui(v2u32 screensize) rect = rect + v2s32(size.X/2-140/2, size.Y/2-30/2+25); gui::IGUIElement *e = Environment->addButton(rect, this, 257, - wgettext("Continue")); + narrow_to_wide(gettext("Continue")).c_str()); Environment->setFocus(e); } } diff --git a/src/guiMultiplayerMenu.cpp b/src/guiMultiplayerMenu.cpp index f4d8d18..7322c20 100644 --- a/src/guiMultiplayerMenu.cpp +++ b/src/guiMultiplayerMenu.cpp @@ -132,33 +132,33 @@ void GUIMultiplayerMenu::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 200, 40); rect += v2s32(25, 200); - Environment->addButton(rect, this, GUI_ID_TAB_MP_MAINMENU, wgettext("Main Menu")); + Environment->addButton(rect, this, GUI_ID_TAB_MP_MAINMENU, narrow_to_wide(gettext("Main Menu")).c_str()); } // Dynamic List button { core::rect rect(0, 0, 180, 40); rect += v2s32(35, 260); - Environment->addButton(rect, this, GUI_ID_TAB_MP_LIST, wgettext("All Servers")); + Environment->addButton(rect, this, GUI_ID_TAB_MP_LIST, narrow_to_wide(gettext("All Servers")).c_str()); } // Favourites List button { core::rect rect(0, 0, 180, 40); rect += v2s32(35, 305); - Environment->addButton(rect, this, GUI_ID_TAB_MP_FAVOURITES, wgettext("Favourite Servers")); + Environment->addButton(rect, this, GUI_ID_TAB_MP_FAVOURITES, narrow_to_wide(gettext("Favourite Servers")).c_str()); } // Custom Connect button (the old multiplayer menu) { core::rect rect(0, 0, 180, 40); rect += v2s32(35, 350); - Environment->addButton(rect, this, GUI_ID_TAB_MP_CUSTOM, wgettext("Custom Connect")); + Environment->addButton(rect, this, GUI_ID_TAB_MP_CUSTOM, narrow_to_wide(gettext("Custom Connect")).c_str()); } v2s32 topleft_content(250, 0); { core::rect rect(0, 0, 550, 20); rect += topleft_content + v2s32(0, 10); - gui::IGUIStaticText *t = Environment->addStaticText(wgettext("Multi Player"), rect, false, true, this, -1); + gui::IGUIStaticText *t = Environment->addStaticText(narrow_to_wide(gettext("Multi Player")).c_str(), rect, false, true, this, -1); t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); } @@ -166,14 +166,14 @@ void GUIMultiplayerMenu::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 550, 20); rect += topleft_content + v2s32(0, 30); - gui::IGUIStaticText *t = Environment->addStaticText(wgettext("Custom Connection"), rect, false, true, this, -1); + gui::IGUIStaticText *t = Environment->addStaticText(narrow_to_wide(gettext("Custom Connection")).c_str(), rect, false, true, this, -1); t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); } // Address + port { core::rect rect(0, 0, 110, 20); rect += topleft_content + v2s32(120, 60); - Environment->addStaticText(wgettext("Address/Port"), rect, false, true, this, -1); + Environment->addStaticText(narrow_to_wide(gettext("Address/Port")).c_str(), rect, false, true, this, -1); } { if (text_address == L"") @@ -198,19 +198,19 @@ void GUIMultiplayerMenu::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 180, 30); rect += topleft_content + v2s32(80, 160); - Environment->addButton(rect, this, GUI_ID_ADDFAV_BUTTON, wgettext("Add to Favourites")); + Environment->addButton(rect, this, GUI_ID_ADDFAV_BUTTON, narrow_to_wide(gettext("Add to Favourites")).c_str()); } { core::rect rect(0, 0, 180, 30); rect += topleft_content + v2s32(270, 160); - Environment->addButton(rect, this, GUI_ID_CONNECT_BUTTON, wgettext("Connect")); + Environment->addButton(rect, this, GUI_ID_CONNECT_BUTTON, narrow_to_wide(gettext("Connect")).c_str()); } }else if (m_data.selected_tab == TAB_MP_CONNECT) { // Nickname + password { core::rect rect(0, 0, 110, 20); rect += topleft_content + v2s32(120, 60); - Environment->addStaticText(wgettext("Name/Password"), rect, false, true, this, -1); + Environment->addStaticText(narrow_to_wide(gettext("Name/Password")).c_str(), rect, false, true, this, -1); } { core::rect rect(0, 0, 230, 30); @@ -237,7 +237,7 @@ void GUIMultiplayerMenu::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 180, 30); rect += topleft_content + v2s32(160, 160); - Environment->addButton(rect, this, GUI_ID_START_BUTTON, wgettext("Join Server")); + Environment->addButton(rect, this, GUI_ID_START_BUTTON, narrow_to_wide(gettext("Join Server")).c_str()); } } }else{ @@ -259,15 +259,15 @@ void GUIMultiplayerMenu::regenerateGui(v2u32 screensize) } if (m_data.selected_tab == TAB_MP_FAVOURITES) { - header->setText(wgettext("My Favourites")); + header->setText(narrow_to_wide(gettext("My Favourites")).c_str()); list = &m_data.favourites; }else{ - header->setText(wgettext("Server List")); + header->setText(narrow_to_wide(gettext("Server List")).c_str()); list = &m_data.servers; { core::rect rect(0, 0, 180, 25); rect += topleft_content + v2s32(270, 260); - Environment->addButton(rect, this, GUI_ID_REFRESH_BUTTON, wgettext("Get New List")); + Environment->addButton(rect, this, GUI_ID_REFRESH_BUTTON, narrow_to_wide(gettext("Get New List")).c_str()); } } @@ -304,20 +304,20 @@ void GUIMultiplayerMenu::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 180, 30); rect += topleft_content + v2s32(80, 390); - Environment->addButton(rect, this, GUI_ID_REMFAV_BUTTON, wgettext("Remove from Favourites")); + Environment->addButton(rect, this, GUI_ID_REMFAV_BUTTON, narrow_to_wide(gettext("Remove from Favourites")).c_str()); } }else{ { core::rect rect(0, 0, 180, 30); rect += topleft_content + v2s32(80, 390); - Environment->addButton(rect, this, GUI_ID_ADDFAV_BUTTON, wgettext("Add to Favourites")); + Environment->addButton(rect, this, GUI_ID_ADDFAV_BUTTON, narrow_to_wide(gettext("Add to Favourites")).c_str()); } } { core::rect rect(0, 0, 180, 30); rect += topleft_content + v2s32(270, 390); - Environment->addButton(rect, this, GUI_ID_CONNECT_BUTTON, wgettext("Connect")); + Environment->addButton(rect, this, GUI_ID_CONNECT_BUTTON, narrow_to_wide(gettext("Connect")).c_str()); } } } @@ -329,6 +329,7 @@ void GUIMultiplayerMenu::drawMenu() video::IVideoDriver* driver = Environment->getVideoDriver(); { + char buff[1024]; core::rect left( AbsoluteRect.UpperLeftCorner.X, AbsoluteRect.UpperLeftCorner.Y, @@ -343,18 +344,21 @@ void GUIMultiplayerMenu::drawMenu() ); driver->draw2DRectangle(left, GUI_BG_BTM, GUI_BG_BTM, GUI_BG_BTM, GUI_BG_BTM, &AbsoluteClippingRect); driver->draw2DRectangle(right, GUI_BG_TOP, GUI_BG_BTM, GUI_BG_TOP, GUI_BG_BTM, &AbsoluteClippingRect); - video::ITexture *texture = driver->getTexture(getTexturePath("menulogo.png").c_str()); - if (texture != 0) { - const core::dimension2d& img_origsize = texture->getOriginalSize(); - core::rect logo( - AbsoluteRect.UpperLeftCorner.X+25, - AbsoluteRect.UpperLeftCorner.Y, - AbsoluteRect.UpperLeftCorner.X+225, - AbsoluteRect.UpperLeftCorner.Y+200 - ); - const video::SColor color(255,255,255,255); - const video::SColor colors[] = {color,color,color,color}; - driver->draw2DImage(texture, logo, core::rect(core::position2d(0,0),img_origsize), NULL, colors, true); + + if (path_get((char*)"texture",(char*)"menulogo.png",1,buff,1024)) { + video::ITexture *texture = driver->getTexture(buff); + if (texture != 0) { + const core::dimension2d& img_origsize = texture->getOriginalSize(); + core::rect logo( + AbsoluteRect.UpperLeftCorner.X+25, + AbsoluteRect.UpperLeftCorner.Y, + AbsoluteRect.UpperLeftCorner.X+225, + AbsoluteRect.UpperLeftCorner.Y+200 + ); + const video::SColor color(255,255,255,255); + const video::SColor colors[] = {color,color,color,color}; + driver->draw2DImage(texture, logo, core::rect(core::position2d(0,0),img_origsize), NULL, colors, true); + } } } @@ -597,12 +601,15 @@ bool GUIMultiplayerMenu::OnEvent(const SEvent& event) bool GUIMultiplayerMenu::fetchServers() { + char buff[1024]; char* u = const_cast("/list"); std::string data = http_request(NULL,u); - std::string path = getPath("","servers.txt",false); + + if (!path_get((char*)"config",(char*)"servers.txt",0,buff,1024)) + return false; std::ofstream f; - f.open(path.c_str()); + f.open(buff); if (!f.is_open()) return false; @@ -613,13 +620,13 @@ bool GUIMultiplayerMenu::fetchServers() } bool GUIMultiplayerMenu::loadServers() { - std::string path = getPath("","servers.txt",true); - if (path != "") - parseFile(path,m_data.servers); + char buff[1024]; - path = getPath("","favourites.txt",true); - if (path != "") - parseFile(path,m_data.favourites); + if (path_get((char*)"config",(char*)"servers.txt",0,buff,1024)) + parseFile(buff,m_data.servers); + + if (path_get((char*)"config",(char*)"favourites.txt",0,buff,1024)) + parseFile(buff,m_data.favourites); if (m_data.favourites.size()) { for ( @@ -653,9 +660,12 @@ bool GUIMultiplayerMenu::loadServers() } bool GUIMultiplayerMenu::saveFavourites() { - std::string path = getPath("","favourites.txt",false); + char buff[1024]; + if (!path_get((char*)"config",(char*)"favourites.txt",0,buff,1024)) + return false; + std::ofstream f; - f.open(path.c_str()); + f.open(buff); if (!f.is_open()) return false; diff --git a/src/guiPasswordChange.cpp b/src/guiPasswordChange.cpp index a5df805..a0bc5ab 100644 --- a/src/guiPasswordChange.cpp +++ b/src/guiPasswordChange.cpp @@ -102,7 +102,7 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 110, 20); rect += topleft_client + v2s32(35, ypos+6); - Environment->addStaticText(wgettext("Old Password"), rect, false, true, this, -1); + Environment->addStaticText(narrow_to_wide(gettext("Old Password")).c_str(), rect, false, true, this, -1); } { core::rect rect(0, 0, 230, 30); @@ -120,7 +120,7 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 110, 20); rect += topleft_client + v2s32(35, ypos+6); - Environment->addStaticText(wgettext("New Password"), rect, false, true, this, -1); + Environment->addStaticText(narrow_to_wide(gettext("New Password")).c_str(), rect, false, true, this, -1); } { core::rect rect(0, 0, 230, 30); @@ -137,7 +137,7 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 110, 20); rect += topleft_client + v2s32(35, ypos+6); - Environment->addStaticText(wgettext("Confirm Password"), rect, false, true, this, -1); + Environment->addStaticText(narrow_to_wide(gettext("Confirm Password")).c_str(), rect, false, true, this, -1); } { core::rect rect(0, 0, 230, 30); @@ -155,7 +155,7 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 140, 30); rect = rect + v2s32(size.X/2-140/2, ypos); - Environment->addButton(rect, this, ID_change, wgettext("Change")); + Environment->addButton(rect, this, ID_change, narrow_to_wide(gettext("Change")).c_str()); } ypos += 50; @@ -163,7 +163,7 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize) core::rect rect(0, 0, 300, 20); rect += topleft_client + v2s32(35, ypos); IGUIElement *e = - Environment->addStaticText(wgettext("Passwords do not match!"), rect, false, true, this, ID_message); + Environment->addStaticText(narrow_to_wide(gettext("Passwords do not match!")).c_str(), rect, false, true, this, ID_message); e->setVisible(false); } diff --git a/src/guiPauseMenu.cpp b/src/guiPauseMenu.cpp index 27f4324..c75241c 100644 --- a/src/guiPauseMenu.cpp +++ b/src/guiPauseMenu.cpp @@ -100,7 +100,7 @@ void GUIPauseMenu::regenerateGui(v2u32 screensize) max_texture_size = driver->getMaxTextureSize(); } - gui::IGUIStaticText *t = Environment->addStaticText(wgettext("Voxelands by darkrose and contributors"), rect, false, true, this, 259); + gui::IGUIStaticText *t = Environment->addStaticText(narrow_to_wide(gettext("Voxelands by darkrose and contributors")).c_str(), rect, false, true, this, 259); t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); } { @@ -140,25 +140,25 @@ void GUIPauseMenu::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 180, btn_height); rect = rect + v2s32(size.X/2-180/2, btn_y); - Environment->addButton(rect, this, 256, wgettext("Continue")); + Environment->addButton(rect, this, 256, narrow_to_wide(gettext("Continue")).c_str()); } btn_y += btn_height + btn_gap; { core::rect rect(0, 0, 180, btn_height); rect = rect + v2s32(size.X/2-180/2, btn_y); - Environment->addButton(rect, this, 261, wgettext("Change Password")); + Environment->addButton(rect, this, 261, narrow_to_wide(gettext("Change Password")).c_str()); } btn_y += btn_height + btn_gap; { core::rect rect(0, 0, 180, btn_height); rect = rect + v2s32(size.X/2-180/2, btn_y); - Environment->addButton(rect, this, 265, wgettext("Settings")); + Environment->addButton(rect, this, 265, narrow_to_wide(gettext("Settings")).c_str()); } btn_y += btn_height + btn_gap; { core::rect rect(0, 0, 180, btn_height); rect = rect + v2s32(size.X/2-180/2, btn_y); - Environment->addButton(rect, this, 260, wgettext("Disconnect")); + Environment->addButton(rect, this, 260, narrow_to_wide(gettext("Disconnect")).c_str()); } } diff --git a/src/guiSettingsMenu.cpp b/src/guiSettingsMenu.cpp index b0668fc..cd55903 100644 --- a/src/guiSettingsMenu.cpp +++ b/src/guiSettingsMenu.cpp @@ -68,34 +68,34 @@ GUISettingsMenu::GUISettingsMenu( m_data.volume = g_settings->getFloat("sound_volume"); m_data.texture_animation = g_settings->getBool("enable_animated_textures"); - keynames[VLKC_FORWARD] = wgettext("Forward"); - keynames[VLKC_BACKWARD] = wgettext("Backward"); - keynames[VLKC_LEFT] = wgettext("Left"); - keynames[VLKC_RIGHT] = wgettext("Right"); - keynames[VLKC_JUMP] = wgettext("Jump"); - keynames[VLKC_SNEAK] = wgettext("Sneak"); - keynames[VLKC_INVENTORY] = wgettext("Inventory"); - keynames[VLKC_USE] = wgettext("Use Item"); - keynames[VLKC_CHAT] = wgettext("Chat"); - keynames[VLKC_COMMAND] = wgettext("Command"); - keynames[VLKC_RANGE] = wgettext("Range Select"); - keynames[VLKC_FREEMOVE] = wgettext("Toggle Fly"); - keynames[VLKC_UP] = wgettext("Up"); - keynames[VLKC_DOWN] = wgettext("Down"); - keynames[VLKC_RUN] = wgettext("Run"); - keynames[VLKC_EXAMINE] = wgettext("Examine/Open"); - keynames[VLKC_SCREENSHOT] = wgettext("Take Screenshot"); - keynames[VLKC_TOGGLE_HUD] = wgettext("Show/Hide HUD"); - keynames[VLKC_TOGGLE_CHAT] = wgettext("Show/Hide Chat"); - keynames[VLKC_TOGGLE_FOG] = wgettext("Toggle Fog"); - keynames[VLKC_TOGGLE_CAMERA] = NULL; - keynames[VLKC_TOGGLE_DEBUG] = NULL; - keynames[VLKC_TOGGLE_PROFILER] = NULL; - keynames[VLKC_RANGE_PLUS] = wgettext("Increase Viewing Range"); - keynames[VLKC_RANGE_MINUS] = wgettext("Decrease Viewing Range"); - keynames[VLKC_PRINT_DEBUG] = NULL; - keynames[VLKC_SELECT_PREV] = wgettext("Previous Item"); - keynames[VLKC_SELECT_NEXT] = wgettext("Next Item"); + keynames[VLKC_FORWARD] = narrow_to_wide(gettext("Forward")); + keynames[VLKC_BACKWARD] = narrow_to_wide(gettext("Backward")); + keynames[VLKC_LEFT] = narrow_to_wide(gettext("Left")); + keynames[VLKC_RIGHT] = narrow_to_wide(gettext("Right")); + keynames[VLKC_JUMP] = narrow_to_wide(gettext("Jump")); + keynames[VLKC_SNEAK] = narrow_to_wide(gettext("Sneak")); + keynames[VLKC_INVENTORY] = narrow_to_wide(gettext("Inventory")); + keynames[VLKC_USE] = narrow_to_wide(gettext("Use Item")); + keynames[VLKC_CHAT] = narrow_to_wide(gettext("Chat")); + keynames[VLKC_COMMAND] = narrow_to_wide(gettext("Command")); + keynames[VLKC_RANGE] = narrow_to_wide(gettext("Range Select")); + keynames[VLKC_FREEMOVE] = narrow_to_wide(gettext("Toggle Fly")); + keynames[VLKC_UP] = narrow_to_wide(gettext("Up")); + keynames[VLKC_DOWN] = narrow_to_wide(gettext("Down")); + keynames[VLKC_RUN] = narrow_to_wide(gettext("Run")); + keynames[VLKC_EXAMINE] = narrow_to_wide(gettext("Examine/Open")); + keynames[VLKC_SCREENSHOT] = narrow_to_wide(gettext("Take Screenshot")); + keynames[VLKC_TOGGLE_HUD] = narrow_to_wide(gettext("Show/Hide HUD")); + keynames[VLKC_TOGGLE_CHAT] = narrow_to_wide(gettext("Show/Hide Chat")); + keynames[VLKC_TOGGLE_FOG] = narrow_to_wide(gettext("Toggle Fog")); + keynames[VLKC_TOGGLE_CAMERA] = L""; + keynames[VLKC_TOGGLE_DEBUG] = L""; + keynames[VLKC_TOGGLE_PROFILER] = L""; + keynames[VLKC_RANGE_PLUS] = narrow_to_wide(gettext("Increase Viewing Range")); + keynames[VLKC_RANGE_MINUS] = narrow_to_wide(gettext("Decrease Viewing Range")); + keynames[VLKC_PRINT_DEBUG] = L""; + keynames[VLKC_SELECT_PREV] = narrow_to_wide(gettext("Previous Item")); + keynames[VLKC_SELECT_NEXT] = narrow_to_wide(gettext("Next Item")); } GUISettingsMenu::~GUISettingsMenu() @@ -317,32 +317,32 @@ void GUISettingsMenu::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 200, 40); rect += v2s32(25, 200); - Environment->addButton(rect, this, GUI_ID_TAB_MAINMENU, wgettext("Main Menu")); + Environment->addButton(rect, this, GUI_ID_TAB_MAINMENU, narrow_to_wide(gettext("Main Menu")).c_str()); } // Controls Settings button { core::rect rect(0, 0, 180, 40); rect += v2s32(35, 260); - Environment->addButton(rect, this, GUI_ID_TAB_SETTINGS_CONTROLS, wgettext("Controls")); + Environment->addButton(rect, this, GUI_ID_TAB_SETTINGS_CONTROLS, narrow_to_wide(gettext("Controls")).c_str()); } // Graphics Settings button { core::rect rect(0, 0, 180, 40); rect += v2s32(35, 305); - Environment->addButton(rect, this, GUI_ID_TAB_SETTINGS_GRAPHICS, wgettext("Graphics")); + Environment->addButton(rect, this, GUI_ID_TAB_SETTINGS_GRAPHICS, narrow_to_wide(gettext("Graphics")).c_str()); } // Video Settings button { core::rect rect(0, 0, 180, 40); rect += v2s32(35, 350); - Environment->addButton(rect, this, GUI_ID_TAB_SETTINGS_VIDEO, wgettext("Video")); + Environment->addButton(rect, this, GUI_ID_TAB_SETTINGS_VIDEO, narrow_to_wide(gettext("Video")).c_str()); } // Sound Settings button { core::rect rect(0, 0, 180, 40); rect += v2s32(35, 395); - Environment->addButton(rect, this, GUI_ID_TAB_SETTINGS_SOUND, wgettext("Sound")); + Environment->addButton(rect, this, GUI_ID_TAB_SETTINGS_SOUND, narrow_to_wide(gettext("Sound")).c_str()); } v2s32 topleft_content(250, 0); @@ -351,19 +351,19 @@ void GUISettingsMenu::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 550, 20); rect += topleft_content + v2s32(0, 20); - gui::IGUIStaticText *t = Environment->addStaticText(wgettext("Controls"), rect, false, true, this, -1); + gui::IGUIStaticText *t = Environment->addStaticText(narrow_to_wide(gettext("Controls")).c_str(), rect, false, true, this, -1); t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); } v2s32 offset(0, 40); for (int i=0; i rect(0, 0, 150, 20); rect += topleft_content + offset; - gui::IGUIStaticText *t = Environment->addStaticText(keynames[i], rect, false, true, this, -1); + gui::IGUIStaticText *t = Environment->addStaticText(keynames[i].c_str(), rect, false, true, this, -1); t->setTextAlignment(gui::EGUIA_LOWERRIGHT, gui::EGUIA_UPPERLEFT); } @@ -382,22 +382,22 @@ void GUISettingsMenu::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 550, 20); rect += topleft_content + v2s32(0, 20); - gui::IGUIStaticText *t = Environment->addStaticText(wgettext("Graphics"), rect, false, true, this, -1); + gui::IGUIStaticText *t = Environment->addStaticText(narrow_to_wide(gettext("Graphics")).c_str(), rect, false, true, this, -1); t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); } { core::rect rect(0, 0, 125, 20); rect += topleft_content + v2s32(40, 60); - gui::IGUIStaticText *t = Environment->addStaticText(wgettext("Terrain Mesh Detail"), rect, false, true, this, -1); + gui::IGUIStaticText *t = Environment->addStaticText(narrow_to_wide(gettext("Terrain Mesh Detail")).c_str(), rect, false, true, this, -1); t->setTextAlignment(gui::EGUIA_LOWERRIGHT, gui::EGUIA_UPPERLEFT); } { core::rect rect(0, 0, 240, 25); rect += topleft_content + v2s32(175, 55); gui::IGUIComboBox *c = Environment->addComboBox(rect, this, GUI_ID_MESH_DETAIL_COMBO); - u32 ld = c->addItem(wgettext("Low"),GUI_ID_MESH_DETAIL_LOW); - u32 md = c->addItem(wgettext("Medium"),GUI_ID_MESH_DETAIL_MEDIUM); - u32 hd = c->addItem(wgettext("High"),GUI_ID_MESH_DETAIL_HIGH); + u32 ld = c->addItem(narrow_to_wide(gettext("Low")).c_str(),GUI_ID_MESH_DETAIL_LOW); + u32 md = c->addItem(narrow_to_wide(gettext("Medium")).c_str(),GUI_ID_MESH_DETAIL_MEDIUM); + u32 hd = c->addItem(narrow_to_wide(gettext("High")).c_str(),GUI_ID_MESH_DETAIL_HIGH); switch (mesh_detail) { case 1: c->setSelected(ld); @@ -413,16 +413,16 @@ void GUISettingsMenu::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 125, 20); rect += topleft_content + v2s32(40, 90); - gui::IGUIStaticText *t = Environment->addStaticText(wgettext("Texture Detail"), rect, false, true, this, -1); + gui::IGUIStaticText *t = Environment->addStaticText(narrow_to_wide(gettext("Texture Detail")).c_str(), rect, false, true, this, -1); t->setTextAlignment(gui::EGUIA_LOWERRIGHT, gui::EGUIA_UPPERLEFT); } { core::rect rect(0, 0, 240, 25); rect += topleft_content + v2s32(175, 85); gui::IGUIComboBox *c = Environment->addComboBox(rect, this, GUI_ID_TEXTURE_DETAIL_COMBO); - u32 ld = c->addItem(wgettext("Low"),GUI_ID_TEXTURE_DETAIL_LOW); - u32 md = c->addItem(wgettext("Medium"),GUI_ID_TEXTURE_DETAIL_MEDIUM); - u32 hd = c->addItem(wgettext("High"),GUI_ID_TEXTURE_DETAIL_HIGH); + u32 ld = c->addItem(narrow_to_wide(gettext("Low")).c_str(),GUI_ID_TEXTURE_DETAIL_LOW); + u32 md = c->addItem(narrow_to_wide(gettext("Medium")).c_str(),GUI_ID_TEXTURE_DETAIL_MEDIUM); + u32 hd = c->addItem(narrow_to_wide(gettext("High")).c_str(),GUI_ID_TEXTURE_DETAIL_HIGH); switch (texture_detail) { case 1: c->setSelected(ld); @@ -438,16 +438,16 @@ void GUISettingsMenu::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 125, 20); rect += topleft_content + v2s32(40, 120); - gui::IGUIStaticText *t = Environment->addStaticText(wgettext("Light Detail"), rect, false, true, this, -1); + gui::IGUIStaticText *t = Environment->addStaticText(narrow_to_wide(gettext("Light Detail")).c_str(), rect, false, true, this, -1); t->setTextAlignment(gui::EGUIA_LOWERRIGHT, gui::EGUIA_UPPERLEFT); } { core::rect rect(0, 0, 240, 25); rect += topleft_content + v2s32(175, 115); gui::IGUIComboBox *c = Environment->addComboBox(rect, this, GUI_ID_LIGHT_DETAIL_COMBO); - u32 ld = c->addItem(wgettext("Low"),GUI_ID_LIGHT_DETAIL_LOW); - u32 md = c->addItem(wgettext("Medium"),GUI_ID_LIGHT_DETAIL_MEDIUM); - u32 hd = c->addItem(wgettext("High"),GUI_ID_LIGHT_DETAIL_HIGH); + u32 ld = c->addItem(narrow_to_wide(gettext("Low")).c_str(),GUI_ID_LIGHT_DETAIL_LOW); + u32 md = c->addItem(narrow_to_wide(gettext("Medium")).c_str(),GUI_ID_LIGHT_DETAIL_MEDIUM); + u32 hd = c->addItem(narrow_to_wide(gettext("High")).c_str(),GUI_ID_LIGHT_DETAIL_HIGH); switch (light_detail) { case 1: c->setSelected(ld); @@ -463,79 +463,79 @@ void GUISettingsMenu::regenerateGui(v2u32 screensize) { core::rect rect(0, 0, 200, 30); rect += topleft_content + v2s32(80, 160); - Environment->addCheckBox(hotbar, rect, this, GUI_ID_HOTBAR_CB, wgettext("Classic HUD")); + Environment->addCheckBox(hotbar, rect, this, GUI_ID_HOTBAR_CB, narrow_to_wide(gettext("Classic HUD")).c_str()); } { core::rect rect(0, 0, 200, 30); rect += topleft_content + v2s32(290, 160); - gui::IGUICheckBox *c = Environment->addCheckBox(wield_index, rect, this, GUI_ID_WIELDINDEX_CB, wgettext("Wieldring Index")); + gui::IGUICheckBox *c = Environment->addCheckBox(wield_index, rect, this, GUI_ID_WIELDINDEX_CB, narrow_to_wide(gettext("Wieldring Index")).c_str()); c->setEnabled(!hotbar); } if (m_is_ingame) { core::rect rect(0, 0, 550, 20); rect += topleft_content + v2s32(0, 220); - gui::IGUIStaticText *t = Environment->addStaticText(wgettext("Some settings cannot be changed in-game."), rect, false, true, this, -1); + gui::IGUIStaticText *t = Environment->addStaticText(narrow_to_wide(gettext("Some settings cannot be changed in-game.")).c_str(), rect, false, true, this, -1); t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); } }else if (m_data.selected_tab == TAB_SETTINGS_VIDEO) { { core::rect rect(0, 0, 550, 20); rect += topleft_content + v2s32(0, 20); - gui::IGUIStaticText *t = Environment->addStaticText(wgettext("Video"), rect, false, true, this, -1); + gui::IGUIStaticText *t = Environment->addStaticText(narrow_to_wide(gettext("Video")).c_str(), rect, false, true, this, -1); t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); } { core::rect rect(0, 0, 200, 30); rect += topleft_content + v2s32(80, 60); - Environment->addCheckBox(fullscreen, rect, this, GUI_ID_FULLSCREEN_CB, wgettext("Fullscreen")); + Environment->addCheckBox(fullscreen, rect, this, GUI_ID_FULLSCREEN_CB, narrow_to_wide(gettext("Fullscreen")).c_str()); } { core::rect rect(0, 0, 200, 30); rect += topleft_content + v2s32(80, 90); - Environment->addCheckBox(particles, rect, this, GUI_ID_PARTICLES_CB, wgettext("Particles")); + Environment->addCheckBox(particles, rect, this, GUI_ID_PARTICLES_CB, narrow_to_wide(gettext("Particles")).c_str()); } { core::rect rect(0, 0, 200, 30); rect += topleft_content + v2s32(80, 120); - Environment->addCheckBox(mipmap, rect, this, GUI_ID_MIPMAP_CB, wgettext("Mip-Mapping")); + Environment->addCheckBox(mipmap, rect, this, GUI_ID_MIPMAP_CB, narrow_to_wide(gettext("Mip-Mapping")).c_str()); } { core::rect rect(0, 0, 200, 30); rect += topleft_content + v2s32(80, 150); - Environment->addCheckBox(bilinear, rect, this, GUI_ID_BILINEAR_CB, wgettext("Bi-Linear Filtering")); + Environment->addCheckBox(bilinear, rect, this, GUI_ID_BILINEAR_CB, narrow_to_wide(gettext("Bi-Linear Filtering")).c_str()); } { core::rect rect(0, 0, 200, 30); rect += topleft_content + v2s32(80, 180); - Environment->addCheckBox(trilinear, rect, this, GUI_ID_TRILINEAR_CB, wgettext("Tri-Linear Filtering")); + Environment->addCheckBox(trilinear, rect, this, GUI_ID_TRILINEAR_CB, narrow_to_wide(gettext("Tri-Linear Filtering")).c_str()); } { core::rect rect(0, 0, 200, 30); rect += topleft_content + v2s32(80, 210); - Environment->addCheckBox(anisotropic, rect, this, GUI_ID_ANISOTROPIC_CB, wgettext("Anisotropic Filtering")); + Environment->addCheckBox(anisotropic, rect, this, GUI_ID_ANISOTROPIC_CB, narrow_to_wide(gettext("Anisotropic Filtering")).c_str()); } { core::rect rect(0, 0, 200, 30); rect += topleft_content + v2s32(80, 240); - Environment->addCheckBox(texture_animation, rect, this, GUI_ID_TEXTUREANIM_CB, wgettext("Enable Texture Animation")); + Environment->addCheckBox(texture_animation, rect, this, GUI_ID_TEXTUREANIM_CB, narrow_to_wide(gettext("Enable Texture Animation")).c_str()); } if (m_is_ingame) { core::rect rect(0, 0, 550, 20); rect += topleft_content + v2s32(0, 280); - gui::IGUIStaticText *t = Environment->addStaticText(wgettext("Some settings cannot be changed in-game."), rect, false, true, this, -1); + gui::IGUIStaticText *t = Environment->addStaticText(narrow_to_wide(gettext("Some settings cannot be changed in-game.")).c_str(), rect, false, true, this, -1); t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); } }else if (m_data.selected_tab == TAB_SETTINGS_SOUND) { { core::rect rect(0, 0, 550, 20); rect += topleft_content + v2s32(0, 20); - gui::IGUIStaticText *t = Environment->addStaticText(wgettext("Sound"), rect, false, true, this, -1); + gui::IGUIStaticText *t = Environment->addStaticText(narrow_to_wide(gettext("Sound")).c_str(), rect, false, true, this, -1); t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); } { core::rect rect(0, 0, 200, 15); rect += topleft_content + v2s32(80, 60); - Environment->addStaticText(wgettext("Volume:"), rect, false, false, this, -1); + Environment->addStaticText(narrow_to_wide(gettext("Volume:")).c_str(), rect, false, false, this, -1); } { core::rect rect(0, 0, 200, 15); @@ -553,6 +553,7 @@ void GUISettingsMenu::drawMenu() video::IVideoDriver* driver = Environment->getVideoDriver(); { + char buff[1024]; core::rect left( AbsoluteRect.UpperLeftCorner.X, AbsoluteRect.UpperLeftCorner.Y, @@ -567,18 +568,21 @@ void GUISettingsMenu::drawMenu() ); driver->draw2DRectangle(left, GUI_BG_BTM, GUI_BG_BTM, GUI_BG_BTM, GUI_BG_BTM, &AbsoluteClippingRect); driver->draw2DRectangle(right, GUI_BG_TOP, GUI_BG_BTM, GUI_BG_TOP, GUI_BG_BTM, &AbsoluteClippingRect); - video::ITexture *texture = driver->getTexture(getTexturePath("menulogo.png").c_str()); - if (texture != 0) { - const core::dimension2d& img_origsize = texture->getOriginalSize(); - core::rect logo( - AbsoluteRect.UpperLeftCorner.X+25, - AbsoluteRect.UpperLeftCorner.Y, - AbsoluteRect.UpperLeftCorner.X+225, - AbsoluteRect.UpperLeftCorner.Y+200 - ); - const video::SColor color(255,255,255,255); - const video::SColor colors[] = {color,color,color,color}; - driver->draw2DImage(texture, logo, core::rect(core::position2d(0,0),img_origsize), NULL, colors, true); + + if (path_get((char*)"texture",(char*)"menulogo.png",1,buff,1024)) { + video::ITexture *texture = driver->getTexture(buff); + if (texture != 0) { + const core::dimension2d& img_origsize = texture->getOriginalSize(); + core::rect logo( + AbsoluteRect.UpperLeftCorner.X+25, + AbsoluteRect.UpperLeftCorner.Y, + AbsoluteRect.UpperLeftCorner.X+225, + AbsoluteRect.UpperLeftCorner.Y+200 + ); + const video::SColor color(255,255,255,255); + const video::SColor colors[] = {color,color,color,color}; + driver->draw2DImage(texture, logo, core::rect(core::position2d(0,0),img_origsize), NULL, colors, true); + } } } @@ -710,7 +714,7 @@ bool GUISettingsMenu::resetMenu() gui::IGUIElement *e = getElementFromId(activeKey); if (e != NULL && e->getType() == gui::EGUIET_BUTTON) { e->setEnabled(true); - e->setText(keynames[activeKey-GUI_ID_KEYSETTINGS_BASE]); + e->setText(keynames[activeKey-GUI_ID_KEYSETTINGS_BASE].c_str()); } activeKey = -1; return false; @@ -751,7 +755,7 @@ bool GUISettingsMenu::OnEvent(const SEvent& event) activeKey = id; gui::IGUIElement *e = getElementFromId(id); if (e != NULL && e->getType() == gui::EGUIET_BUTTON) { - e->setText(wgettext("press Key")); + e->setText(narrow_to_wide(gettext("press Key")).c_str()); e->setEnabled(false); return true; } diff --git a/src/guiSettingsMenu.h b/src/guiSettingsMenu.h index 7405565..8c6b908 100644 --- a/src/guiSettingsMenu.h +++ b/src/guiSettingsMenu.h @@ -149,7 +149,7 @@ private: void save(); bool resetMenu(); - wchar_t* keynames[VLKC_MAX]; + std::wstring keynames[VLKC_MAX]; s32 activeKey; KeyPress keys[VLKC_MAX]; }; diff --git a/src/http.cpp b/src/http.cpp index cb801cd..6f7bb7e 100644 --- a/src/http.cpp +++ b/src/http.cpp @@ -35,6 +35,7 @@ #include "sha1.h" #include "path.h" #include "config.h" +#include "file.h" /* interface builders, these just keep some code below clean */ static std::string http_player_interface(Player *player, HTTPServer *server, bool full) @@ -268,10 +269,13 @@ int HTTPRemoteClient::handlePlayer() /* handle /texture/ url's */ int HTTPRemoteClient::handleTexture() { - std::string file = getPath("texture",m_recv_headers.getUrl(1),true); - if (file == "") + char buff[1024]; + + if (!path_get((char*)"texture",const_cast(m_recv_headers.getUrl(1).c_str()),1,buff,1024)) return handleSpecial("404 Not Found"); + m_send_headers.setHeader("Content-Type","image/png"); + std::string file(buff); sendFile(file); return 1; } @@ -418,54 +422,37 @@ void HTTPRemoteClient::send(char* data) /* send html data to a remote http client */ void HTTPRemoteClient::sendHTML(char* data) { - FILE *h; - FILE *f; - int l[4]; - char* b; - std::string file = getPath("html","header.html",true); - h = fopen(file.c_str(),"r"); - file = getPath("html","footer.html",true); - f = fopen(file.c_str(),"r"); + int l; + file_t *head; + file_t *foot; - if (h) { - fseek(h,0,SEEK_END); - l[0] = ftell(h); - fseek(h,0,SEEK_SET); - }else{ - l[0] = 0; - } - l[1] = strlen(data); - if (f) { - fseek(f,0,SEEK_END); - l[2] = ftell(f); - fseek(f,0,SEEK_SET); - }else{ - l[2] = 0; - } + head = file_load((char*)"html",(char*)"header.html"); + foot = file_load((char*)"html",(char*)"footer.html"); - if (l[0] > l[2]) { - b = new char[l[0]]; - }else{ - b = new char[l[2]]; - } + l = 0; + + if (head) + l += head->len; + if (foot) + l += foot->len; + + l += strlen(data); - l[3] = l[0]+l[1]+l[2]; m_send_headers.setHeader("Content-Type","text/html"); - m_send_headers.setLength(l[3]); + m_send_headers.setLength(l); sendHeaders(); - if (h) { - l[3] = fread(b,1,l[0],h); - m_socket->Send(b,l[3]); - fclose(h); - } - m_socket->Send(data,l[1]); - if (f) { - l[3] = fread(b,1,l[2],f); - m_socket->Send(b,l[3]); - fclose(f); - } - delete b; + l = strlen(data); + + if (head) { + m_socket->Send(head->data,head->len); + file_free(head); + } + m_socket->Send(data,l); + if (foot) { + m_socket->Send(foot->data,foot->len); + file_free(foot); + } } /* send a file to a remote http client */ diff --git a/src/http.h b/src/http.h index 5135eab..23955cf 100644 --- a/src/http.h +++ b/src/http.h @@ -29,6 +29,7 @@ #include "server.h" #include "player.h" #include +#include "auth.h" class HTTPServer; @@ -145,7 +146,12 @@ public: void start(u16 port); void stop(); void step(); - std::string getPlayerPrivs(std::string name) {return privsToString(m_server->getPlayerAuthPrivs(name));} + std::string getPlayerPrivs(std::string name) { + char buff[256]; + if (auth_privs2str(m_server->getPlayerAuthPrivs(name),buff,256) < 0) + return std::string(""); + return std::string(buff); + } Server *getGameServer() {return m_server;} private: TCPSocket *m_socket; diff --git a/src/hud.cpp b/src/hud.cpp index c5d9516..36d9b1c 100644 --- a/src/hud.cpp +++ b/src/hud.cpp @@ -30,6 +30,15 @@ #include "intl.h" #include "environment.h" +video::ITexture *getTexture(video::IVideoDriver *driver, const char* tex) +{ + char buff[1024]; + if (!path_get((char*)"texture",const_cast(tex),1,buff,1024)) + return NULL; + + return driver->getTexture(buff); +} + void draw_image( video::IVideoDriver *driver, video::ITexture *texture, @@ -117,7 +126,7 @@ void draw_progress_ring( { if (!value) return; - video::ITexture *texture = driver->getTexture(getTexturePath("progress_ring.png").c_str()); + video::ITexture *texture = getTexture(driver,"progress_ring.png"); core::rect rect(pos.X-radius,pos.Y-radius,pos.X+radius,pos.Y+radius); if (value >= 25) { if (value >= 50) { @@ -324,7 +333,7 @@ void hud_draw_old( for (s32 k=0; k<3; k++) { if (barData[k].count == 10 && !barData[k].show_full) continue; - video::ITexture *texture = driver->getTexture(getTexturePath(barData[k].texture).c_str()); + video::ITexture *texture = getTexture(driver,barData[k].texture); v2s32 p = pos + bar_base; for (s32 i=0; igetTexture(getTexturePath("ringbg.png").c_str()); + video::ITexture *texture = getTexture(driver,"ringbg.png"); core::rect rect(screensize.X-165,screensize.Y-165,screensize.X-19,screensize.Y-19); draw_image(driver,texture,color,rect,NULL,NULL); } @@ -455,7 +464,7 @@ void hud_draw( txt = itows(item->getCount()); } }else{ - texture = driver->getTexture(getTexturePath("wieldhand.png").c_str()); + texture = getTexture(driver,"wieldhand.png"); } draw_image(driver,texture,color,rect,NULL,NULL); @@ -570,7 +579,7 @@ void hud_draw( } } const video::SColor color(255,255,255,255); - video::ITexture *texture = driver->getTexture(getTexturePath(states[state]).c_str()); + video::ITexture *texture = getTexture(driver,states[state]); core::rect rect(screensize.X-51,screensize.Y-186,screensize.X-19,screensize.Y-154); draw_image(driver,texture,color,rect,NULL,NULL); @@ -604,7 +613,7 @@ void hud_draw( b = c; } const video::SColor color(220,r,0,b); - video::ITexture *texture = driver->getTexture(getTexturePath("heart.png").c_str()); + video::ITexture *texture = getTexture(driver,"heart.png"); core::rect rect(60,screensize.Y-108,108,screensize.Y-60); draw_image(driver,texture,color,rect,NULL,NULL); } @@ -640,7 +649,7 @@ void hud_draw( if ((damage_pos&a) == a) c = 0; const video::SColor color(255,255,c,c); - video::ITexture *texture = driver->getTexture(getTexturePath(image[i]).c_str()); + video::ITexture *texture = getTexture(driver,image[i]); core::rect rect(10,screensize.Y-172,42,screensize.Y-108); draw_image(driver,texture,color,rect,NULL,NULL); } @@ -681,7 +690,7 @@ void hud_draw( if (have_suffocation && air < 100) { int c = 55+(air*2); const video::SColor color(255,255,c,c); - video::ITexture *texture = driver->getTexture(getTexturePath("bubble.png").c_str()); + video::ITexture *texture = getTexture(driver,"bubble.png"); core::rect rect(100,screensize.Y-68,132,screensize.Y-36); draw_image(driver,texture,color,rect,NULL,NULL); @@ -702,7 +711,7 @@ void hud_draw( if (have_hunger) { int c = 55+(hunger*2); const video::SColor color(255,255,c,c); - video::ITexture *texture = driver->getTexture(getTexturePath("harvested_carrot.png").c_str()); + video::ITexture *texture = getTexture(driver,"harvested_carrot.png"); core::rect rect(36,screensize.Y-68,68,screensize.Y-36); draw_image(driver,texture,color,rect,NULL,NULL); @@ -726,13 +735,12 @@ void hud_draw( if (crosshair > 2) gb = 0; const video::SColor color(220,255,gb,gb); - std::string tex(""); + video::ITexture *texture; if (crosshair == 1) { - tex = getTexturePath("crosshair_unfocused.png"); + texture = getTexture(driver,"crosshair_unfocused.png"); }else{ - tex = getTexturePath("crosshair_focused.png"); + texture = getTexture(driver,"crosshair_focused.png"); } - video::ITexture *texture = driver->getTexture(tex.c_str()); core::rect rect((screensize.X/2)-16,(screensize.Y/2)-16,(screensize.X/2)+16,(screensize.Y/2)+16); draw_image(driver,texture,color,rect,NULL,NULL); } @@ -746,7 +754,7 @@ void hud_draw( txt += L","; txt += itows(pos.Z); txt += L") '"; - txt += f->description; + txt += narrow_to_wide(f->description); txt += L"' light="; if (f->light_propagates || f->sunlight_propagates) { txt += L"true "; @@ -891,7 +899,7 @@ void hud_draw( sprintf(buff,gettext("Energy Boost: %d:%02d"),m,s); const video::SColor color(255,255,255,255); - video::ITexture *texture = driver->getTexture(getTexturePath("energy.png").c_str()); + video::ITexture *texture = getTexture(driver,"energy.png"); core::rect rect(x_off+132,screensize.Y-36,x_off+164,screensize.Y-4); draw_image(driver,texture,color,rect,NULL,NULL); @@ -916,7 +924,7 @@ void hud_draw( sprintf(buff,gettext("Cold Protection: %d:%02d"),m,s); const video::SColor color(255,255,255,255); - video::ITexture *texture = driver->getTexture(getTexturePath("flame.png").c_str()); + video::ITexture *texture = getTexture(driver,"flame.png"); core::rect rect(x_off+132,screensize.Y-36,x_off+164,screensize.Y-4); draw_image(driver,texture,color,rect,NULL,NULL); diff --git a/src/intl.cpp b/src/intl.c similarity index 88% rename from src/intl.cpp rename to src/intl.c index a9cf234..6fbc5d7 100644 --- a/src/intl.cpp +++ b/src/intl.c @@ -16,12 +16,16 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see ************************************************************************/ +#include "file.h" +#include "crypto.h" #include #include #include #include #include +#include + #ifdef _WIN32 #ifdef _MSC_VER #include @@ -559,19 +563,19 @@ char* intl_nlookup(intl_t *intl, char* s1, char* s2, int n) } /* initialise an intl_t by loading in an mo file */ -int intl_init(intl_t *intl, const char* file) +int intl_load(intl_t *intl, char* file) { char fbuff[2048]; char lbuff[128]; - FILE *f; - int length; + file_t *f; uint32_t magic; char* head; char* p; char* e; - std::string path; - intl_getlang(lbuff,128); + strcpy(lbuff,"translation-"); + + intl_getlang(lbuff+12,116); intl->mo_data = NULL; intl->str_count = 0; @@ -582,46 +586,29 @@ int intl_init(intl_t *intl, const char* file) intl->plurals = 1; intl->plural = NULL; - path = std::string("translation-")+lbuff; - path = getPath(path.c_str(),file,true); - if (path == "") { + f = file_load(lbuff,file); + if (!f) { char* u = strchr(lbuff,'_'); if (!u) return 1; *u = 0; - path = std::string("translation-")+lbuff; - path = getPath(path.c_str(),file,true); - if (path == "") - return 1; + f = file_load(lbuff,file); + if (!f) + return 2; } - f = fopen(path.c_str(), "rb"); - if (!f) - return 2; - - fseek(f, 0, SEEK_END); - length = ftell(f); - fseek(f, 0, SEEK_SET); - - if (length < 24) { - fclose(f); + if (f->len < 24) { + file_free(f); return 3; } - intl->mo_data = malloc(length); - if (!intl->mo_data) { - fclose(f); - return 4; - } + intl->mo_data = f->data; + f->data = NULL; + f->len = 0; + f->size = 0; - if (length != (int)fread(intl->mo_data, 1, length, f)) { - fclose(f); - free(intl->mo_data); - intl->mo_data = NULL; - return 5; - } - fclose(f); + file_free(f); magic = ((uint32_t*)intl->mo_data)[0]; @@ -701,45 +688,13 @@ char* ngettext(const char* s1, const char* s2, int n) return intl_nlookup(&intl,(char*)s1,(char*)s2,n); } -wchar_t *mb2wc(const char *src) -{ -#ifdef _WIN32 - static wchar_t *w = (wchar_t*)L""; - int ol = MultiByteToWideChar(CP_UTF8, 0, src, -1, NULL, 0); - if (!ol) - return w; - wchar_t *buff = new wchar_t[ol]; - if (!MultiByteToWideChar(CP_UTF8, 0, src, -1, buff, ol)) - return w; - return buff; -#else - int l = strlen(src)+1; - wchar_t *buff = new wchar_t[l]; - mbstate_t state; - memset(&state, '\0', sizeof (state)); - size_t n = mbsrtowcs(buff, &src, l, &state); - buff[n] = L'\0'; - return buff; -#endif -} - -wchar_t* wgettext(const char *str) -{ - return mb2wc(intl_lookup(&intl,(char*)str,NULL)); -} - -wchar_t* wngettext(const char *str1, const char *str2, int n) -{ - return mb2wc(intl_nlookup(&intl,(char*)str1,(char*)str2,n)); -} - -void init_gettext() +void intl_init() { #ifndef _WIN32 setlocale(LC_MESSAGES, ""); setlocale(LC_CTYPE, ""); #endif - intl_init(&intl,"voxelands.mo"); + intl_load(&intl,"voxelands.mo"); #ifndef SERVER init_KeyNamesLang(); #endif diff --git a/src/intl.h b/src/intl.h index 9f2cd4b..c51afa2 100644 --- a/src/intl.h +++ b/src/intl.h @@ -1,25 +1,21 @@ -#ifndef GETTEXT_HEADER -#define GETTEXT_HEADER -#include +#ifndef _INTL_H_ +#define _INTL_H_ + +#ifdef __cplusplus +extern "C" { +#endif char* gettext(const char *s); char* ngettext(const char* s1, const char* s2, int n); -void init_gettext(); - -inline wchar_t* chartowchar_t(const char *str) -{ - size_t l = strlen(str)+1; - wchar_t* nstr = new wchar_t[l]; - mbstowcs(nstr, str, l); - return nstr; -} - -wchar_t* wgettext(const char *str); -wchar_t* wngettext(const char *str1, const char *str2, int n); +void intl_init(); #ifndef SERVER // Initialise KeyNamesLang array void init_KeyNamesLang(); #endif +#ifdef __cplusplus +} +#endif + #endif diff --git a/src/inventory.cpp b/src/inventory.cpp index f630860..6b5938e 100644 --- a/src/inventory.cpp +++ b/src/inventory.cpp @@ -227,37 +227,40 @@ video::ITexture * MaterialItem::getImage() const #endif std::wstring MaterialItem::getGuiName() { + char buff[256]; if (m_data == 0 || content_features(m_content).param_type != CPT_MINERAL) - return content_features(m_content).description; - return content_features(m_content).description+L" - "+mineral_features(m_data).description; + return narrow_to_wide(content_features(m_content).description); + + snprintf(buff,256,"%s - %s",content_features(m_content).description,mineral_features(m_data).description); + return narrow_to_wide(buff); } std::wstring MaterialItem::getGuiText() { - std::wstring txt(L" "); + std::string txt(" "); ContentFeatures *f = &content_features(m_content); txt += f->description; if (m_data != 0 && content_features(m_content).param_type == CPT_MINERAL) { - txt += L"\n"; - txt += wgettext("Contains: "); + txt += "\n"; + txt += gettext("Contains: "); txt += mineral_features(m_data).description; } if (f->cook_result != "" || f->fuel_time != 0.0) - txt += L"\n"; + txt += "\n"; if (f->cook_result != "") { - txt += L"\n"; - txt += wgettext("Cookable: Yes"); + txt += "\n"; + txt += gettext("Cookable: Yes"); } if (f->fuel_time != 0.0) { char buff[20]; - txt += L"\n"; - txt += wgettext("Fuel Burn Time: "); - txt += itows((int)f->fuel_time/60); - txt += L":"; + txt += "\n"; + txt += gettext("Fuel Burn Time: "); + txt += itos((int)f->fuel_time/60); + txt += ":"; sprintf(buff,"%02d",(int)f->fuel_time%60); - txt += narrow_to_wide(buff); + txt += buff; } - return txt; + return narrow_to_wide(txt); } bool MaterialItem::isCookable(CookType type) const @@ -331,75 +334,75 @@ video::ITexture * CraftItem::getImage() const #endif std::wstring CraftItem::getGuiName() { - return content_craftitem_features(m_content)->description; + return narrow_to_wide(content_craftitem_features(m_content)->description); } std::wstring CraftItem::getGuiText() { - std::wstring txt(L" "); + std::string txt(" "); CraftItemFeatures *f = content_craftitem_features(m_content); txt += f->description; if (f->consumable || f->cook_result != CONTENT_IGNORE || f->fuel_time != 0.0) - txt += L"\n"; + txt += "\n"; if (f->consumable) { if (f->hunger_effect) { - txt += L"\n"; - txt += wgettext("Hunger: "); - txt += itows(f->hunger_effect*5); - txt += L"%"; + txt += "\n"; + txt += gettext("Hunger: "); + txt += itos(f->hunger_effect*5); + txt += "%"; } if (f->health_effect) { - txt += L"\n"; - txt += wgettext("Health: "); - txt += itows(f->health_effect*5); - txt += L"%"; + txt += "\n"; + txt += gettext("Health: "); + txt += itos(f->health_effect*5); + txt += "%"; } if (f->cold_effect) { char buff[20]; - txt += L"\n"; - txt += wgettext("Cold Protection: "); - txt += itows(f->cold_effect/60); - txt += L":"; + txt += "\n"; + txt += gettext("Cold Protection: "); + txt += itos(f->cold_effect/60); + txt += ":"; sprintf(buff,"%02d",f->cold_effect%60); - txt += narrow_to_wide(buff); + txt += buff; } if (f->energy_effect) { char buff[20]; - txt += L"\n"; - txt += wgettext("Energy Boost: "); - txt += itows(f->energy_effect/60); - txt += L":"; + txt += "\n"; + txt += gettext("Energy Boost: "); + txt += itos(f->energy_effect/60); + txt += ":"; sprintf(buff,"%02d",f->energy_effect%60); - txt += narrow_to_wide(buff); + txt += buff; } } if (f->cook_result != CONTENT_IGNORE) { - txt += L"\n"; - txt += wgettext("Cookable: Yes"); + txt += "\n"; + txt += gettext("Cookable: Yes"); } if (f->fuel_time != 0.0) { char buff[20]; - txt += L"\n"; - txt += wgettext("Fuel Burn Time: "); - txt += itows((int)f->fuel_time/60); - txt += L":"; + txt += "\n"; + txt += gettext("Fuel Burn Time: "); + txt += itos((int)f->fuel_time/60); + txt += ":"; sprintf(buff,"%02d",(int)f->fuel_time%60); - txt += narrow_to_wide(buff); + txt += buff; } if (m_data > 0) { if (content_craftitem_features(m_content)->param_type == CPT_ENCHANTMENT) { EnchantmentInfo info; u16 data = m_data; - txt += L"\n"; + txt += "\n"; while (enchantment_get(&data,&info)) { - txt += L"\n"; + txt += "\n"; txt += info.name; - txt += L" "; - txt += itows(info.level); + txt += " "; + txt += itos(info.level); } } } - return txt; + return narrow_to_wide(txt); } ServerActiveObject* CraftItem::createSAO(ServerEnvironment *env, u16 id, v3f pos) @@ -541,26 +544,26 @@ video::ITexture *ToolItem::getImage() const std::wstring ToolItem::getGuiText() { - std::wstring txt(L" "); + std::string txt(" "); ToolItemFeatures *f = &content_toolitem_features(m_content); txt += f->description; - txt += L"\n\n"; - txt += wgettext("Uses: "); - txt += itows(m_wear); - txt += L"\n"; - txt += wgettext("Speed: "); - txt += ftows(f->diginfo.time); - txt += L"\n"; - txt += wgettext("Level: "); - txt += itows(f->diginfo.level); + txt += "\n\n"; + txt += gettext("Uses: "); + txt += itos(m_wear); + txt += "\n"; + txt += gettext("Speed: "); + txt += ftos(f->diginfo.time); + txt += "\n"; + txt += gettext("Level: "); + txt += itos(f->diginfo.level); if (f->fuel_time != 0.0) { char buff[20]; - txt += L"\n"; - txt += wgettext("Fuel Burn Time: "); - txt += itows((int)f->fuel_time/60); - txt += L":"; + txt += "\n"; + txt += gettext("Fuel Burn Time: "); + txt += itos((int)f->fuel_time/60); + txt += ":"; sprintf(buff,"%02d",(int)f->fuel_time%60); - txt += narrow_to_wide(buff); + txt += buff; } if (m_data > 0) { switch (content_toolitem_features(m_content).param_type) { @@ -568,20 +571,20 @@ std::wstring ToolItem::getGuiText() { EnchantmentInfo info; u16 data = m_data; - txt += L"\n"; + txt += "\n"; while (enchantment_get(&data,&info)) { - txt += L"\n"; + txt += "\n"; txt += info.name; - txt += L" "; - txt += itows(info.level); + txt += " "; + txt += itos(info.level); } break; } case CPT_DROP: { if ((m_data&CONTENT_MOB_MASK) == CONTENT_MOB_MASK) { - txt += L"\n"; - txt += wgettext("Contains: "); + txt += "\n"; + txt += gettext("Contains: "); txt += content_mob_features(m_data).description; } break; @@ -590,7 +593,7 @@ std::wstring ToolItem::getGuiText() } } - return txt; + return narrow_to_wide(txt); } bool ToolItem::isCookable(CookType type) const @@ -667,48 +670,48 @@ video::ITexture *ClothesItem::getImage() const std::wstring ClothesItem::getGuiText() { - std::wstring txt(L" "); + std::string txt(" "); ClothesItemFeatures *f = content_clothesitem_features(m_content); txt += f->description; if (f->armour > 0.0 || f->warmth > 0.0 || f->vacuum > 0.0 || f->suffocate > 0.0 || f->durability > 0.0 || f->effect > 1.0) - txt += L"\n"; + txt += "\n"; if (f->armour > 0.0) { - txt += L"\n"; - txt += wgettext("Armour: "); - txt += itows(f->armour*100.0); - txt += L"%"; + txt += "\n"; + txt += gettext("Armour: "); + txt += itos(f->armour*100.0); + txt += "%"; } if (f->warmth > 0.0) { - txt += L"\n"; - txt += wgettext("Warmth: "); - txt += itows(f->warmth*100.0); - txt += L"%"; + txt += "\n"; + txt += gettext("Warmth: "); + txt += itos(f->warmth*100.0); + txt += "%"; } if (f->vacuum > 0.0) { - txt += L"\n"; - txt += wgettext("Pressure: "); - txt += itows(f->vacuum*100.0); - txt += L"%"; + txt += "\n"; + txt += gettext("Pressure: "); + txt += itos(f->vacuum*100.0); + txt += "%"; } if (f->suffocate > 0.0) { - txt += L"\n"; - txt += wgettext("Suffocation: "); - txt += itows(f->suffocate*100.0); - txt += L"%"; + txt += "\n"; + txt += gettext("Suffocation: "); + txt += itos(f->suffocate*100.0); + txt += "%"; } if (f->durability > 0.0) { - txt += L"\n"; - txt += wgettext("Durability: "); - txt += itows(f->durability); + txt += "\n"; + txt += gettext("Durability: "); + txt += itos(f->durability); } if (f->effect != 1.0) { - txt += L"\n"; - txt += wgettext("Effect Boost: "); - txt += itows(f->effect*100.0); - txt += L"%"; + txt += "\n"; + txt += gettext("Effect Boost: "); + txt += itos(f->effect*100.0); + txt += "%"; } - return txt; + return narrow_to_wide(txt); } /* diff --git a/src/inventory.h b/src/inventory.h index 5099b88..b6e4dec 100644 --- a/src/inventory.h +++ b/src/inventory.h @@ -373,7 +373,7 @@ public: #endif std::wstring getGuiName() { - return content_toolitem_features(m_content).description; + return narrow_to_wide(content_toolitem_features(m_content).description); } std::wstring getGuiText(); std::string getText() @@ -462,7 +462,7 @@ public: #endif std::wstring getGuiName() { - return content_clothesitem_features(m_content)->description; + return narrow_to_wide(content_clothesitem_features(m_content)->description); } std::wstring getGuiText(); std::string getText() diff --git a/src/main.cpp b/src/main.cpp index b8575a8..730e75f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -76,6 +76,7 @@ #include "path.h" #include "gui_colours.h" #include "character_creator.h" +#include "thread.h" #if USE_FREETYPE #include "xCGUITTFont.h" #endif @@ -669,11 +670,19 @@ void SpeedTests() void drawMenuBackground(video::IVideoDriver* driver) { + char buff[1024]; core::dimension2d screensize = driver->getScreenSize(); - video::ITexture *mud = driver->getTexture(getTexturePath("mud.png").c_str()); - video::ITexture *stone = driver->getTexture(getTexturePath("stone.png").c_str()); - video::ITexture *grass = driver->getTexture(getTexturePath("grass_side.png").c_str()); + video::ITexture *mud = NULL; + video::ITexture *stone = NULL; + video::ITexture *grass = NULL; + + if (path_get((char*)"texture",(char*)"mud.png",1,buff,1024)) + mud = driver->getTexture(buff); + if (path_get((char*)"texture",(char*)"stone.png",1,buff,1024)) + stone = driver->getTexture(buff); + if (path_get((char*)"texture",(char*)"grass_side.png",1,buff,1024)) + grass = driver->getTexture(buff); if (mud && stone && grass) { video::ITexture *texture; s32 texturesize = 128; @@ -829,7 +838,8 @@ int main(int argc, char *argv[]) // Create user config directory fs::CreateDir(porting::path_configdata); #endif - init_gettext(); + + intl_init(); // Initialize debug streams #ifdef RUN_IN_PLACE @@ -859,6 +869,9 @@ int main(int argc, char *argv[]) Basic initialization */ + thread_init(); + path_init(); + // Initialize default settings set_default_settings(g_settings); @@ -1118,12 +1131,18 @@ int main(int argc, char *argv[]) guienv = device->getGUIEnvironment(); gui::IGUISkin* skin = guienv->getSkin(); + gui::IGUIFont* font = NULL; + { + char buff[1024]; #if USE_FREETYPE - u16 font_size = g_settings->getU16("font_size"); - gui::IGUIFont* font = gui::CGUITTFont::createTTFont(guienv, getPath("font","unifont.ttf",false).c_str(), font_size, true, true, 1, 128); + u16 font_size = g_settings->getU16("font_size"); + if (path_get((char*)"font",(char*)"unifont.ttf",1,buff,1024)) + font = gui::CGUITTFont::createTTFont(guienv, buff, font_size, true, true, 1, 128); #else - gui::IGUIFont* font = guienv->getFont(getTexturePath("fontlucida.png").c_str()); + if (path_get((char*)"texture",(char*)"fontlucida.png",1,buff,1024)) + font = guienv->getFont(buff); #endif + } if (font) { skin->setFont(font); }else{ @@ -1132,7 +1151,7 @@ int main(int argc, char *argv[]) // If font was not found, this will get us one font = skin->getFont(); assert(font); - drawLoadingScreen(device,wgettext("Setting Up UI")); + drawLoadingScreen(device,narrow_to_wide(gettext("Setting Up UI"))); u32 text_height = font->getDimension(L"Hello, world!").Height; infostream<<"text_height="<getTextureId("crack.png"); - drawLoadingScreen(device,wgettext("Setting Up Sound")); + drawLoadingScreen(device,narrow_to_wide(gettext("Setting Up Sound"))); #if USE_AUDIO == 1 sound = createSoundManager(); diff --git a/src/map.cpp b/src/map.cpp index b2f7552..1358aba 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -3636,25 +3636,28 @@ void ClientMap::renderPostFx() if (m_client->getServerSuffocation()) { u16 a = m_client->getAir(); if (a < 50) { + char buff[1024]; u8 c = 255-(a*5); const video::SColor color(c,255,255,255); const video::SColor colors[] = {color,color,color,color}; - std::string tex = getTexturePath("low_air.png"); - video::IVideoDriver* driver = SceneManager->getVideoDriver(); - v2u32 ss = driver->getScreenSize(); - video::ITexture *texture = driver->getTexture(tex.c_str()); - core::rect rect(0,0,ss.X,ss.Y); - driver->draw2DImage( - texture, - rect, - core::rect( - core::position2d(0,0), - core::dimension2di(texture->getOriginalSize()) - ), - NULL, - colors, - true - ); + + if (path_get((char*)"texture",(char*)"low_air.png",1,buff,1024)) { + video::IVideoDriver* driver = SceneManager->getVideoDriver(); + v2u32 ss = driver->getScreenSize(); + video::ITexture *texture = driver->getTexture(buff); + core::rect rect(0,0,ss.X,ss.Y); + driver->draw2DImage( + texture, + rect, + core::rect( + core::position2d(0,0), + core::dimension2di(texture->getOriginalSize()) + ), + NULL, + colors, + true + ); + } } } } diff --git a/src/mapnode.cpp b/src/mapnode.cpp index 72fae43..69e4ccc 100644 --- a/src/mapnode.cpp +++ b/src/mapnode.cpp @@ -283,10 +283,8 @@ void init_mapnode() Don't touch CONTENT_IGNORE or CONTENT_AIR. */ for (u16 i=0; i <= MAX_CONTENT; i++) { - char buf[10]; - sprintf(buf,"0x%.4X",i); ContentFeatures *f = &g_content_features[i]; - f->description = narrow_to_wide(std::string(buf)); + f->description = (char*)"???"; if (i == CONTENT_IGNORE || i == CONTENT_AIR) continue; f->draw_type = CDT_CUBELIKE; @@ -301,31 +299,31 @@ void init_mapnode() Initialize mapnode content */ #ifndef SERVER - drawLoadingScreen(device,wgettext("Loading Base MapNodes")); + drawLoadingScreen(device,narrow_to_wide(gettext("Loading Base MapNodes"))); #endif content_mapnode_init(repeat); #ifndef SERVER - drawLoadingScreen(device,wgettext("Loading Circuit MapNodes")); + drawLoadingScreen(device,narrow_to_wide(gettext("Loading Circuit MapNodes"))); #endif content_mapnode_circuit(repeat); #ifndef SERVER - drawLoadingScreen(device,wgettext("Loading Plant MapNodes")); + drawLoadingScreen(device,narrow_to_wide(gettext("Loading Plant MapNodes"))); #endif content_mapnode_plants(repeat); #ifndef SERVER - drawLoadingScreen(device,wgettext("Loading Farming MapNodes")); + drawLoadingScreen(device,narrow_to_wide(gettext("Loading Farming MapNodes"))); #endif content_mapnode_farm(repeat); #ifndef SERVER - drawLoadingScreen(device,wgettext("Loading Decorative MapNodes")); + drawLoadingScreen(device,narrow_to_wide(gettext("Loading Decorative MapNodes"))); #endif content_mapnode_furniture(repeat); #ifndef SERVER - drawLoadingScreen(device,wgettext("Loading Interactive MapNodes")); + drawLoadingScreen(device,narrow_to_wide(gettext("Loading Interactive MapNodes"))); #endif content_mapnode_door(repeat); #ifndef SERVER - drawLoadingScreen(device,wgettext("Loading Special MapNodes")); + drawLoadingScreen(device,narrow_to_wide(gettext("Loading Special MapNodes"))); #endif content_mapnode_stair(repeat); content_mapnode_slab(repeat); diff --git a/src/mapnode.h b/src/mapnode.h index 8b491d0..060bc85 100644 --- a/src/mapnode.h +++ b/src/mapnode.h @@ -326,7 +326,7 @@ struct ContentFeatures bool rotate_tile_with_nodebox; bool plantlike_tiled; bool wield_nodebox; - std::wstring description; + char* description; std::vector nodeboxes; std::vector wield_nodeboxes; @@ -534,7 +534,7 @@ struct ContentFeatures rotate_tile_with_nodebox = false; plantlike_tiled = false; wield_nodebox = true; - description = std::wstring(L""); + description = (char*)""; nodeboxes.clear(); nodeboxes.push_back(NodeBox( -0.5*BS, diff --git a/src/mesh.cpp b/src/mesh.cpp index 8804cfa..cbe2411 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -160,15 +160,17 @@ scene::IAnimatedMesh* createCubeMesh(v3f scale) #ifndef SERVER scene::IAnimatedMesh* createModelMesh(scene::ISceneManager* smgr, std::string model, bool unique) { - std::string model_path = getModelPath(model); - scene::IAnimatedMesh* mesh = smgr->getMesh(model_path.c_str()); + char buff[1024]; + if (!path_get((char*)"model",const_cast(model.c_str()),1,buff,1024)) + return 0; + scene::IAnimatedMesh* mesh = smgr->getMesh(buff); if (mesh && !unique) return mesh; #if (IRRLICHT_VERSION_MAJOR >= 1 && IRRLICHT_VERSION_MINOR >= 8) || IRRLICHT_VERSION_MAJOR >= 2 // irrlicht 1.8+ we just manually load the mesh scene::IMeshLoader *loader; u32 lc = smgr->getMeshLoaderCount(); - io::IReadFile* file = smgr->getFileSystem()->createAndOpenFile(model_path.c_str()); + io::IReadFile* file = smgr->getFileSystem()->createAndOpenFile(buff); if (!file) return 0; for (u32 i=0; idescription = wgettext("Coal"); + f->description = gettext("Coal"); f->texture = "mineral_coal.png"; f->dug_item = CONTENT_CRAFTITEM_COAL; i = MINERAL_IRON; f = &mineral_features(i); - f->description = wgettext("Iron"); + f->description = gettext("Iron"); f->texture = "mineral_iron.png"; f->dug_item = CONTENT_CRAFTITEM_IRON; f->min_level = 2; i = MINERAL_TIN; f = &mineral_features(i); - f->description = wgettext("Tin"); + f->description = gettext("Tin"); f->texture = "mineral_tin.png"; f->dug_item = CONTENT_CRAFTITEM_TIN; f->min_level = 2; i = MINERAL_COPPER; f = &mineral_features(i); - f->description = wgettext("Copper"); + f->description = gettext("Copper"); f->texture = "mineral_copper.png"; f->dug_item = CONTENT_CRAFTITEM_COPPER; f->dug_count_max = 4; @@ -118,35 +118,35 @@ void init_mineral() i = MINERAL_SILVER; f = &mineral_features(i); - f->description = wgettext("Silver"); + f->description = gettext("Silver"); f->texture = "mineral_silver.png"; f->dug_item = CONTENT_CRAFTITEM_SILVER; f->min_level = 3; i = MINERAL_GOLD; f = &mineral_features(i); - f->description = wgettext("Gold"); + f->description = gettext("Gold"); f->texture = "mineral_gold.png"; f->dug_item = CONTENT_CRAFTITEM_GOLD; f->min_level = 3; i = MINERAL_QUARTZ; f = &mineral_features(i); - f->description = wgettext("Quartz"); + f->description = gettext("Quartz"); f->texture = "mineral_quartz.png"; f->dug_item = CONTENT_CRAFTITEM_QUARTZ; f->min_level = 3; i = MINERAL_MITHRIL; f = &mineral_features(i); - f->description = wgettext("Mithril"); + f->description = gettext("Mithril"); f->texture = "mineral_mithril.png"; f->dug_item = CONTENT_CRAFTITEM_MITHRIL_RAW; f->min_level = 3; i = MINERAL_RUBY; f = &mineral_features(i); - f->description = wgettext("Ruby"); + f->description = gettext("Ruby"); f->texture = "mineral_ruby.png"; f->dug_item = CONTENT_CRAFTITEM_RUBY; f->min_level = 3; @@ -154,7 +154,7 @@ void init_mineral() i = MINERAL_TURQUOISE; f = &mineral_features(i); - f->description = wgettext("Turquoise"); + f->description = gettext("Turquoise"); f->texture = "mineral_turquoise.png"; f->dug_item = CONTENT_CRAFTITEM_TURQUOISE; f->min_level = 3; @@ -162,7 +162,7 @@ void init_mineral() i = MINERAL_AMETHYST; f = &mineral_features(i); - f->description = wgettext("Amethyst"); + f->description = gettext("Amethyst"); f->texture = "mineral_amethyst.png"; f->dug_item = CONTENT_CRAFTITEM_AMETHYST; f->min_level = 3; @@ -170,7 +170,7 @@ void init_mineral() i = MINERAL_SAPPHIRE; f = &mineral_features(i); - f->description = wgettext("Sapphire"); + f->description = gettext("Sapphire"); f->texture = "mineral_sapphire.png"; f->dug_item = CONTENT_CRAFTITEM_SAPPHIRE; f->min_level = 3; @@ -178,7 +178,7 @@ void init_mineral() i = MINERAL_SUNSTONE; f = &mineral_features(i); - f->description = wgettext("Sunstone"); + f->description = gettext("Sunstone"); f->texture = "mineral_sunstone.png"; f->dug_item = CONTENT_CRAFTITEM_SUNSTONE; f->min_level = 3; @@ -186,7 +186,7 @@ void init_mineral() i = MINERAL_SALT; f = &mineral_features(i); - f->description = wgettext("Salt"); + f->description = gettext("Salt"); f->texture = "mineral_salt.png"; f->dug_item = CONTENT_CRAFTITEM_SALT; f->min_level = 1; diff --git a/src/mineral.h b/src/mineral.h index b2d0cbd..a6dfdb2 100644 --- a/src/mineral.h +++ b/src/mineral.h @@ -46,7 +46,7 @@ #define MINERAL_SALT 14 struct MineralFeatures { - std::wstring description; + char* description; std::string texture; // the dug item content_t dug_item; @@ -57,13 +57,14 @@ struct MineralFeatures { u8 min_level; MineralFeatures(): - description(L""), texture(""), dug_item(CONTENT_IGNORE), dug_count_min(1), dug_count_max(5), min_level(1) - {} + { + description = (char*)""; + } }; /* diff --git a/src/path.c b/src/path.c new file mode 100644 index 0000000..1a2f3b6 --- /dev/null +++ b/src/path.c @@ -0,0 +1,699 @@ +/************************************************************************ +* path.c +* voxelands - 3d voxel world sandbox game +* Copyright (C) Lisa 'darkrose' Milne 2016 +* +* 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 3 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, see +************************************************************************/ + + +#ifndef LINUX +#ifdef __linux__ +#define LINUX +#endif +#endif + +#ifdef LINUX + +#ifdef _POSIX_C_SOURCE +#undef _POSIX_C_SOURCE +#endif +#define _POSIX_C_SOURCE 200112L + +#ifdef _XOPEN_SOURCE +#undef _XOPEN_SOURCE +#endif +#define _XOPEN_SOURCE 700 + +#ifdef _DEFAULT_SOURCE +#undef _DEFAULT_SOURCE +#endif +#define _DEFAULT_SOURCE +#endif + +#include "file.h" +#include "path.h" +#include "list.h" + +#ifdef WIN32 +#include +#define GAMEDATA "nfi" +#else +#define GAMEDATA "/usr/games/voxelands" +#include +#include +#include +#include +#include +#include +#include +#endif +#include +#include +#include +#include +#include + +static struct { + char* cwd; /* current working directory */ + char* data_custom; /* set by config data_path */ + char* data_user; /* ~/.local/share/voxelands */ + char* data_global; /* /usr/share/voxelands */ + char* data; /* ./data if it exists */ + char* world; /* data_user + /worlds/ + world name */ + char* home; /* ~/. */ + char* config; /* ~/.config/voxelands */ + char* screenshot; /* set by config screenshot_path */ +} path = { + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL +}; + +int path_check(char* base, char* rel) +{ + int l; + char path[2048]; +#ifndef WIN32 + struct stat st; +#else + DWORD atts; +#endif + + if (!rel) { + if (base) { + l = snprintf(path,2048,"%s",base); + }else{ + return -1; + } + }else if (base) { + l = snprintf(path,2048,"%s/%s",base,rel); + }else{ + l = snprintf(path,2048,"%s",rel); + } + if (l >= 2048) + return -1; + +#ifndef WIN32 + if (stat(path,&st) != 0) + return 0; + if ((st.st_mode&S_IFMT) == S_IFDIR) + return 2; + if ((st.st_mode&S_IFMT) == S_IFREG) + return 1; +#else + atts = GetFileAttributes(path); + if (atts == INVALID_FILE_ATTRIBUTES) + return 0; + if (atts == FILE_ATTRIBUTE_DIRECTORY) + return 2; + if (atts == FILE_ATTRIBUTE_NORMAL) + return 1; +#endif + + return 0; +} + +static char* path_set(char* base, char* rel, char* buff, int size) +{ + int l; + char path[2048]; + + if (base) { + l = snprintf(path,2048,"%s/%s",base,rel); + }else{ + l = snprintf(path,2048,"%s",rel); + } + if (l >= 2048) + return NULL; + + if (!buff) + return strdup(path); + + if (size <= l) + return NULL; + + if (!strcpy(buff,path)) + return NULL; + + return buff; +} + +static int dir_create(char* p); +static int dir_create(char* path) +{ +#ifdef WIN32 + if (CreateDirectory(path, NULL)) + return 0; + if (GetLastError() == ERROR_ALREADY_EXISTS) + return 0; +#else + mode_t process_mask = umask(0); + mode_t mode = S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH; + char* q; + char* r = NULL; + char* p = NULL; + char* up = NULL; + int ret = 1; + if (!strcmp(path, ".") || !strcmp(path, "/")) { + umask(process_mask); + return 0; + } + + if ((p = strdup(path)) == NULL) { + umask(process_mask); + return 1; + } + + if ((q = strdup(path)) == NULL) { + umask(process_mask); + return 1; + } + + if ((r = dirname(q)) == NULL) + goto out; + + if ((up = strdup(r)) == NULL) { + umask(process_mask); + return 1; + } + + if ((dir_create(up) == 1) && (errno != EEXIST)) + goto out; + + if ((mkdir(p, mode) == -1) && (errno != EEXIST)) { + ret = 1; + }else{ + ret = 0; + } + +out: + umask(process_mask); + if (up) + free(up); + free(q); + free(p); + return ret; +#endif + return 1; +} + +#ifndef WIN32 +int unlink_cb(const char* fpath, const struct stat *sb, int typeflag, struct FTW *ftwbuf) +{ + return remove(fpath); +} +#endif + +/* initialises the common paths */ +int path_init() +{ + char buff[2048]; + + path.data_global = strdup(GAMEDATA); + +#ifndef WIN32 + if (getcwd(buff,2048)) { + path.cwd = strdup(buff); + }else{ + path.cwd = strdup("."); + } + + path.home = getenv("HOME"); + if (path.home) { + path.home = strdup(path.home); + }else{ + path.home = strdup(path.cwd); + } + + path.data_user = getenv("XDG_DATA_HOME"); + if (path.data_user) { + path.data_user = path_set(path.data_user,"voxelands",NULL,0); + }else if (path.home) { + path.data_user = path_set(path.home,".local/share/voxelands",NULL,0); + }else{ + path.data_user = path_set(path.cwd,"data",NULL,0); + } + + path.config = getenv("XDG_CONFIG_HOME"); + if (path.config) { + path.config = path_set(path.config,"voxelands",NULL,0); + }else if (path.home) { + path.config = path_set(path.home,".config/voxelands",NULL,0); + }else{ + path.config = strdup(path.cwd); + } +#else + /* TODO: windows, and mac? */ +#endif + + if (snprintf(buff,2048,"%s/data",path.cwd) < 2048 && path_check(NULL,buff) == 2) + path.data = strdup(buff); + + return 0; +} + +/* frees all the paths */ +void path_exit() +{ + if (path.cwd) + free(path.cwd); + path.cwd = NULL; + + if (path.data_custom) + free(path.data_custom); + path.data_custom = NULL; + + if (path.data_user) + free(path.data_user); + path.data_user = NULL; + + if (path.data_global) + free(path.data_global); + path.data_global = NULL; + + if (path.data) + free(path.data); + path.data = NULL; + + if (path.world) + free(path.world); + path.world = NULL; + + if (path.home) + free(path.home); + path.home = NULL; + + if (path.config) + free(path.config); + path.config = NULL; + + if (path.screenshot) + free(path.screenshot); + path.screenshot = NULL; +} + +/* sets path.data_custom */ +int path_custom_setter(char* p) +{ + if (path.data_custom) + free(path.data_custom); + path.data_custom = NULL; + + if (p) + path.data_custom = strdup(p); + + return 0; +} + +/* sets path.screenshot */ +int path_screenshot_setter(char* p) +{ + if (path.screenshot) + free(path.screenshot); + path.screenshot = NULL; + + if (p) + path.screenshot = strdup(p); + + return 0; +} + +/* sets the world path to user_data + /worlds/ + p, creates the path if necessary */ +int path_world_setter(char* p) +{ + int c; + char buff[2048]; + char* base = path.data_user; + + if (path.world) + free(path.world); + path.world = NULL; + + if (!p) + return 1; + + if (p[0] == '/') { + path.world = strdup(p); + }else{ + if (snprintf(buff,2048,"worlds/%s",p) >= 2048) + return 1; + + if (!base) + base = path.data; + if (!base) + base = path.home; + if (!base) + base = path.cwd; + if (!base) + return 1; + + path.world = path_set(base,buff,NULL,0); + } + + c = path_check(path.world,NULL); + if (c == 2) + return 0; + if (c == 0) + return dir_create(path.world); + return 1; +} + +/* + * get the full path for a file/directory + * type is the usual "texture" "model" etc + * file is the file name + * must_exist is pretty self explanatory + * buff is a buffer to write the path into, if NULL allocate + * size is the size of buff + * + * returns the path or NULL if either: + * must_exist is non-zero and the path doesn't exist + * buff is not NULL and too small to hold the full path + */ +char* path_get(char* type, char* file, int must_exist, char* buff, int size) +{ + char rel_path[1024]; + + if (!file) + return NULL; + + if (file[0] == '/') { + return path_set(NULL,file,buff,size); + }else if (!type) { + strcpy(rel_path,file); + }else if (!strcmp(type,"world")) { + if (path.world && (!must_exist || path_check(path.world,file))) + return path_set(path.world,file,buff,size); + return NULL; + }else if (!strcmp(type,"worlds")) { + char* base = path.data_user; + if (!base) + base = path.data; + if (!base) + base = path.home; + if (!base) + base = path.cwd; + if (!base) + return NULL; + if (snprintf(rel_path,1024,"worlds/%s",file) >= 1024) + return NULL; + if (!must_exist || path_check(base,rel_path) == 2) + return path_set(base,rel_path,buff,size); + return NULL; + }else if (!strcmp(type,"screenshot")) { + if (path.screenshot) { + return path_set(path.screenshot,file,buff,size); + }else if (path.home) { + return path_set(path.home,file,buff,size); + }else if (path.data_user) { + return path_set(path.data_user,file,buff,size); + }else if (path.data_custom) { + return path_set(path.data_custom,file,buff,size); + } + return NULL; + }else if (!strcmp(type,"config")) { + if (path.config && (!must_exist || path_check(path.config,file))) + return path_set(path.config,file,buff,size); + return NULL; + }else if (!strcmp(type,"model")) { + snprintf(rel_path,1024,"models/%s",file); + }else if (!strcmp(type,"texture")) { + snprintf(rel_path,1024,"textures/%s",file); + }else if (!strcmp(type,"shader")) { + snprintf(rel_path,1024,"shaders/%s",file); + }else if (!strcmp(type,"html")) { + snprintf(rel_path,1024,"html/%s",file); + }else if (!strcmp(type,"skin")) { + snprintf(rel_path,1024,"textures/skins/%s",file); + }else if (!strcmp(type,"sound")) { + snprintf(rel_path,1024,"sounds/%s",file); + }else if (!strcmp(type,"font")) { + snprintf(rel_path,1024,"fonts/%s",file); + }else if (!strncmp(type,"translation-",12)) { + char* lang = type+12; + type = "translation"; + snprintf(rel_path,1024,"locale/%s/%s",lang,file); + }else{ + strcpy(rel_path,file); + } + + /* check from data_path */ + if (path.data_custom) { + if (path_check(path.data_custom,rel_path)) + return path_set(path.data_custom,rel_path,buff,size); + } + + /* check from user data directory */ + if (path.data_user) { + if (path_check(path.data_user,rel_path)) + return path_set(path.data_user,rel_path,buff,size); + } + + /* check from default data directory */ + if (path.data) { + if (path_check(path.data,rel_path)) + return path_set(path.data,rel_path,buff,size); + } + + /* check from default data directory */ + if (path.data_global) { + if (path_check(path.data_global,rel_path)) + return path_set(path.data_global,rel_path,buff,size); + } + + if (must_exist) + return NULL; + + if (path.data) + return path_set(path.data,rel_path,buff,size); + if (path.data_user) + return path_set(path.data_user,rel_path,buff,size); + if (path.data_custom) + return path_set(path.data_custom,rel_path,buff,size); + + return NULL; +} + +/* + * check if a path exists + * returns: + * -1 on error + * 0 if path does not exist + * 1 if path exists and is a file + * 2 if path exists and is a directory + */ +int path_exists(char* path) +{ + return path_check(NULL,path); +} + +/* + * create the full path for the type + * assumes that files have a dot somewhere in their name + * thus: + * if file is NULL, creates the base path for the type + * if file contains a dot, creates the base path for the type, and + * an empty file along with any subdirectories + * if file does not contain a dot, creates the base path for the + * /file + * if type is NULL, file must be an absolute path + * returns 0 if successful + */ +int path_create(char* type, char* file) +{ + char path[2048]; + char* fn = NULL; + FILE *f; + + if (!path_get(type,file,0,path,2048)) + return -1; + + if (file) { + char* b = strrchr(file,'/'); + if (!b) { + b = file; + }else{ + b++; + } + fn = strchr(b,'.'); + if (fn) { + fn = strrchr(path,'/'); + if (!fn) + return -1; + *fn = 0; + fn++; + } + } + + if (dir_create(path)) + return -1; + + if (!fn) + return 0; + + *fn = '/'; + + f = fopen(path,"w"); + if (!f) + return -1; + + fclose(f); + + return 0; +} + +/* removes (recursively) the last node in the full path of /file */ +int path_remove(char* type, char* file) +{ + char path[2048]; + if (!path_get(type,file,1,path,2048)) + return 0; + +#ifdef WIN32 + DWORD attributes = GetFileAttributes(path); + + /* delete if it's a file, or call recursive delete if a directory */ + if (attributes == INVALID_FILE_ATTRIBUTES) + return -1; + + if (attributes == FILE_ATTRIBUTE_DIRECTORY) { + char fpath[2048]; + dirlist_t *list; + dirlist_t *n; + int r = 0; + list = path_dirlist(NULL,path); + for (n=list; n != NULL && r == 0; n=n->next) { + if (snprintf(fpath,2048,"%s/%s",path,n->name) >= 2048) + r = -1; + if (path_remove(NULL,fpath)) + r = -1; + } + while ((n = list_pop(&list))) { + free(n->name); + free(n); + } + if (r != 0) + return r; + if (RemoveDirectory(path)) + return 0; + }else{ + if (DeleteFile(path)) + return 0; + } +#else + if (path[0] != '/' || path[1] == 0) + return -1; + /* file tree walk, calls the unlink_cb function on every file/directory */ + return nftw(path, unlink_cb, 64, FTW_DEPTH | FTW_PHYS); +#endif + return -1; +} + +dirlist_t *path_dirlist(char* type, char* file) +{ + dirlist_t *n; + dirlist_t *list = NULL; + char path[2048]; +#ifdef WIN32 + dirlist_t nn; + WIN32_FIND_DATA FindFileData; + HANDLE hFind = INVALID_HANDLE_VALUE; + DWORD dwError; + LPTSTR DirSpec; + INT retval; +#else + DIR *dp; + struct dirent *dirp; +#endif + if (!path_get(type,file,1,path,2048)) + return NULL; +#ifdef WIN32 + DirSpec = malloc(MAX_PATH); + + if (!DirSpec) { + retval = 1; + }else if (strlen(path) > (MAX_PATH-2)) { + retval = 3; + }else{ + retval = 0; + sprintf(DirSpec, "%s\\*", path); + + hFind = FindFirstFile(DirSpec, &FindFileData); + + if (hFind == INVALID_HANDLE_VALUE) { + retval = -1; + }else{ + nn.name = FindFileData.cFileName; + nn.dir = FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY; + if (n->name[0] != '.' || (n->name[1] && strcmp(n->name,".."))) { + n = malloc(sizeof(dirlist_t)); + n->name = strdup(nn.name); + n->dir = nn.dir; + list = list_push(&list,n); + } + + while (FindNextFile(hFind, &FindFileData) != 0) { + nn.name = FindFileData.cFileName; + nn.dir = FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY; + if (n->name[0] != '.' || (n->name[1] && strcmp(n->name,".."))) { + n = malloc(sizeof(dirlist_t)); + n->name = strdup(nn.name); + n->dir = nn.dir; + list = list_push(&list,n); + } + } + + dwError = GetLastError(); + FindClose(hFind); + if (dwError != ERROR_NO_MORE_FILES) + retval = -1; + } + } + + free(DirSpec); + + if (retval != 0 && list) { + while ((n = list_pop(&list))) { + free(n->name); + free(n); + } + } +#else + dp = opendir(path); + if (!dp) + return NULL; + + while ((dirp = readdir(dp)) != NULL) { + if (dirp->d_name[0] == '.' && (!dirp->d_name[1] || !strcmp(dirp->d_name,".."))) + continue; + n = malloc(sizeof(dirlist_t)); + n->name = strdup(dirp->d_name); + if (dirp->d_type == DT_DIR) { + n->dir = 1; + }else{ + n->dir = 0; + } + list = list_push(&list,n); + } + closedir(dp); +#endif + return list; +} diff --git a/src/path.cpp b/src/path.cpp deleted file mode 100644 index 4b21e73..0000000 --- a/src/path.cpp +++ /dev/null @@ -1,200 +0,0 @@ -/************************************************************************ -* Minetest-c55 -* Copyright (C) 2010-2011 celeron55, Perttu Ahola -* -* path.cpp -* voxelands - 3d voxel world sandbox game -* Copyright (C) Lisa 'darkrose' Milne 2013-2014 -* -* 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 3 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, see -* -* License updated from GPLv2 or later to GPLv3 or later by Lisa Milne -* for Voxelands. -************************************************************************/ - -#include "path.h" -#include "debug.h" -#include "main.h" // for g_settings -#include "filesys.h" -#include "utility.h" -#include "settings.h" - - -/* - A cache from texture name to texture path -*/ -MutexedMap g_texturename_to_path_cache; -MutexedMap g_modelname_to_path_cache; - -/* - Replaces the filename extension. - eg: - std::string image = "a/image.png" - replace_ext(image, "jpg") - -> image = "a/image.jpg" - Returns true on success. -*/ -static bool replace_ext(std::string &path, const char *ext) -{ - if(ext == NULL) - return false; - // Find place of last dot, fail if \ or / found. - s32 last_dot_i = -1; - for(s32 i=path.size()-1; i>=0; i--) - { - if(path[i] == '.') - { - last_dot_i = i; - break; - } - - if(path[i] == '\\' || path[i] == '/') - break; - } - // If not found, return an empty string - if(last_dot_i == -1) - return false; - // Else make the new path - path = path.substr(0, last_dot_i+1) + ext; - return true; -} - -/* - Find out the full path of an image by trying different filename - extensions. - - If failed, return "". -*/ -static std::string getImagePath(std::string path) -{ - // A NULL-ended list of possible image extensions - const char *extensions[] = { - "png", "jpg", "bmp", "tga", - "pcx", "ppm", "psd", "wal", "rgb", - NULL - }; - - const char **ext = extensions; - do{ - bool r = replace_ext(path, *ext); - if(r == false) - return ""; - if(fs::PathExists(path)) - return path; - } - while((++ext) != NULL); - - return ""; -} - -/* - * The new path resolver, so much prettier - * - * gets the path to a texture by first checking if the texture exists - * in data_path and if not, using the default data path. - * - * checks all supported extensions by replacing the original extension. - * - * if not found, returns "". - * - * utilizes a thread-safe cache. - */ -std::string getPath(const char* tp, const std::string &filename, bool must_exist) -{ - std::string fullpath = ""; - std::string type(tp); - - /* check from cache */ - bool incache = g_modelname_to_path_cache.get(filename, &fullpath); - if (incache) { - if (must_exist == true) { - if (!fs::PathExists(fullpath)) - fullpath = ""; - } - if (fullpath != "") - return fullpath; - } - - std::string rel_path = std::string(""); - if (type == "model") { - rel_path += std::string("models")+DIR_DELIM+filename; - }else if (type == "texture") { - rel_path += std::string("textures")+DIR_DELIM+filename; - }else if (type == "html") { - rel_path += std::string("html")+DIR_DELIM+filename; - }else if (type == "player") { - rel_path += std::string("textures")+DIR_DELIM+"players"+DIR_DELIM+filename; - }else if (type == "skin") { - rel_path += std::string("textures")+DIR_DELIM+"skins"+DIR_DELIM+filename; - }else if (type == "sound") { - rel_path += std::string("sounds")+DIR_DELIM+filename; - }else if (type == "font") { - rel_path += std::string("fonts")+DIR_DELIM+filename; - }else if (type.substr(0,11) == "translation") { - std::string lang = type.substr(12); - type = "translation"; - rel_path += std::string("locale")+DIR_DELIM+lang+DIR_DELIM+filename; - }else{ - rel_path += filename; - } - - /* check from data_path */ - if (g_settings->exists("data_path")) { - std::string data_path = g_settings->get("data_path"); - if (data_path != "") { - std::string testpath = data_path + DIR_DELIM + rel_path; - if (type != "texture") { - if (fs::PathExists(testpath)) - fullpath = std::string(testpath); - }else{ - fullpath = getImagePath(testpath); - } - } - } - - /* check from user data directory */ - if (fullpath == "") { - std::string testpath = porting::path_userdata + DIR_DELIM + rel_path; - if (type != "texture") { - if (fs::PathExists(testpath)) - fullpath = std::string(testpath); - }else{ - fullpath = getImagePath(testpath); - } - } - - /* check from default data directory */ - if (fullpath == "") { - std::string testpath = porting::path_data + DIR_DELIM + rel_path; - if (type != "texture") { - if (fs::PathExists(testpath)) - fullpath = std::string(testpath); - }else{ - fullpath = getImagePath(testpath); - } - } - - if (must_exist == false && fullpath == "") -#ifdef RUN_IN_PLACE - fullpath = porting::path_data + DIR_DELIM + rel_path; -#else - fullpath = porting::path_userdata + DIR_DELIM + rel_path; -#endif - - /* add to cache (also an empty result is cached) */ - g_modelname_to_path_cache.set(filename, fullpath); - - /* finally return it */ - return fullpath; -} diff --git a/src/path.h b/src/path.h index d9dbc07..09e85ee 100644 --- a/src/path.h +++ b/src/path.h @@ -1,54 +1,34 @@ -/************************************************************************ -* Minetest-c55 -* Copyright (C) 2010 celeron55, Perttu Ahola -* -* path.h -* voxelands - 3d voxel world sandbox game -* Copyright (C) Lisa 'darkrose' Milne 2014 -* -* 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 3 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, see -* -* License updated from GPLv2 or later to GPLv3 or later by Lisa Milne -* for Voxelands. -************************************************************************/ +#ifndef _PATH_H_ +#define _PATH_H_ -#ifndef PATH_HEADER -#define PATH_HEADER +#ifdef __cplusplus +extern "C" { +#endif -#include "filesys.h" -#include +#ifndef _HAVE_DIRLIST_TYPE +#define _HAVE_DIRLIST_TYPE +typedef struct dirlist_s { + struct dirlist_s *prev; + struct dirlist_s *next; + char* name; + int dir; +} dirlist_t; +#endif -/* - Gets the path to a texture/model by first checking if it exists - in data_path and if not, using the default data path. +/* defined in path.c */ +int path_init(void); +void path_exit(void); +int path_custom_setter(char* p); +int path_screenshot_setter(char* p); +int path_world_setter(char* p); +char* path_get(char* type, char* file, int must_exist, char* buff, int size); +int path_exists(char* path); +int path_create(char* type, char* file); +int path_remove(char* type, char* path); +dirlist_t *path_dirlist(char* type, char* path); - Checks all supported extensions by replacing the original extension. - - If not found, returns "". - - Utilizes a thread-safe cache. -*/ -std::string getPath(const char* type, const std::string &filename, bool must_exist); - -/* wrappers for the old functions, because too lazy to replace them all */ -inline std::string getTexturePath(const std::string &filename) -{ - return getPath("texture",filename,true); -} -inline std::string getModelPath(const std::string &filename) -{ - return getPath("model",filename,true); +#ifdef __cplusplus } +#endif #endif diff --git a/src/player.cpp b/src/player.cpp index 3d98c94..30b3e32 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -406,6 +406,9 @@ v3f Player::getScale() //M:10:10:fair:blue:brown:medium:human:green:blue:leather void Player::getSkin(std::vector &parts) { + char buff[1024]; + char buf[256]; + if (m_character == "") m_character = std::string(PLAYER_DEFAULT_CHARDEF); Strfnd f(m_character); @@ -421,24 +424,30 @@ void Player::getSkin(std::vector &parts) if (gender != "M" && gender != "F") gender = "M"; - if (getPath("skin",std::string("skintone_")+skintone+"_"+gender+".png",true) == "") + + snprintf(buf,256,"skintone_%s_%s.png",skintone.c_str(),gender.c_str()); + if (!path_get((char*)"skin",buf,1,buff,1024)) skintone = "fair"; - if (getPath("skin",std::string("eyes_")+eyes+".png",true) == "") + + snprintf(buf,256,"eyes_%s.png",eyes.c_str()); + if (!path_get((char*)"skin",buf,1,buff,1024)) eyes = "blue"; - if (hairtone == "" || hair == "" || getPath("skin",std::string("hair_")+hair+"_"+hairtone+"_"+gender+".png",true) == "") { + + snprintf(buf,256,"hair_%s_%s_%s.png",hair.c_str(),hairtone.c_str(),gender.c_str()); + if (hairtone == "" || hair == "" || !path_get((char*)"skin",buf,1,buff,1024)) { hairtone = "brown"; hair = "medium"; } - if (getPath("skin",std::string("face_")+face+gender+".png",true) == "") + + snprintf(buf,256,"face_%s%s.png",face.c_str(),gender.c_str()); + if (!path_get((char*)"skin",buf,1,buff,1024)) face = "human"; - //parts.push_back(std::string("skins")+DIR_DELIM+"skintone_"+skintone+"_"+gender+".png"); - - parts.push_back(std::string("skins")+DIR_DELIM+"skintone_"+skintone+".png"); - parts.push_back(std::string("skins")+DIR_DELIM+"gender_"+gender+".png"); - parts.push_back(std::string("skins")+DIR_DELIM+"face_"+face+"_"+skintone+"_"+gender+".png"); - parts.push_back(std::string("skins")+DIR_DELIM+"eyes_"+eyes+".png"); - parts.push_back(std::string("skins")+DIR_DELIM+"hair_"+hair+"_"+hairtone+"_"+gender+".png"); + parts.push_back(std::string("skins/")+"skintone_"+skintone+".png"); + parts.push_back(std::string("skins/")+"gender_"+gender+".png"); + parts.push_back(std::string("skins/")+"face_"+face+"_"+skintone+"_"+gender+".png"); + parts.push_back(std::string("skins/")+"eyes_"+eyes+".png"); + parts.push_back(std::string("skins/")+"hair_"+hair+"_"+hairtone+"_"+gender+".png"); } /* @@ -578,12 +587,14 @@ RemotePlayer::RemotePlayer( m_node = mgr->addAnimatedMeshSceneNode(mesh,this); if (m_node) { + char buff[1024]; m_node->setFrameLoop(0,79); m_node->setScale(Player::getScale()); setMeshColor(m_node->getMesh(), video::SColor(255,255,255,255)); // Set material flags and texture - m_node->setMaterialTexture(0, driver->getTexture(getTexturePath("character.png").c_str())); + if (path_get((char*)"texture",(char*)"character.png",1,buff,1024)) + m_node->setMaterialTexture(0, driver->getTexture(buff)); video::SMaterial& material = m_node->getMaterial(0); material.setFlag(video::EMF_LIGHTING, false); material.setFlag(video::EMF_BILINEAR_FILTER, false); diff --git a/src/server.cpp b/src/server.cpp index 5533fdc..59e72be 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -860,7 +860,6 @@ Server::Server( ): m_env(new ServerMap(mapsavedir), this), m_con(PROTOCOL_ID, 512, CONNECTION_TIMEOUT, this), - m_authmanager(mapsavedir+DIR_DELIM+"auth.txt"), m_banmanager(mapsavedir+DIR_DELIM+"ipban.txt"), m_thread(this), m_emergethread(this), @@ -871,6 +870,9 @@ Server::Server( m_shutdown_requested(false), m_ignore_map_edit_events(false) { + + auth_init((char*)"auth.txt"); + m_liquid_transform_timer = 0.0; m_print_info_timer = 0.0; m_objectdata_timer = 0.0; @@ -1632,8 +1634,7 @@ void Server::AsyncRunStep() ScopeProfiler sp(g_profiler, "Server: saving stuff"); // Auth stuff - if(m_authmanager.isModified()) - m_authmanager.save(); + auth_save(); //Bann stuff if(m_banmanager.isModified()) @@ -1854,30 +1855,31 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) return; } - if (g_settings->getBool("disallow_unknown_users") && - !m_authmanager.exists(playername)) { + if (g_settings->getBool("disallow_unknown_users") && !auth_exists(playername)) { infostream<<"Server: unknown player "<get("default_password"); - if (checkpwd.length() > 0) { - checkpwd = translatePassword(playername,narrow_to_wide(checkpwd)); + std::string defaultpwd = g_settings->get("default_password"); + if (defaultpwd.length() > 0) { + defaultpwd = translatePassword(playername,narrow_to_wide(defaultpwd)); + strcpy(checkpwd,defaultpwd.c_str()); }else{ - checkpwd = password; + strcpy(checkpwd,password); } } /*infostream<<"Server: Client gave password '"<get("default_privs"))); - m_authmanager.save(); + uint64_t privs; + + privs = auth_str2privs(const_cast(g_settings->get("default_privs").c_str())); + + auth_add(playername); + auth_setpwd(playername,checkpwd); + auth_setprivs(playername,privs); + auth_save(); } // Enforce user limit. // Don't enforce for users that have some admin right if ( m_clients.size() >= g_settings->getU16("max_users") - && (m_authmanager.getPrivs(playername) & (PRIV_SERVER|PRIV_BAN|PRIV_PRIVS)) == 0 + && (auth_getprivs(playername) & (PRIV_SERVER|PRIV_BAN|PRIV_PRIVS)) == 0 && playername != g_settings->get("name") ) { SendAccessDenied(m_con, peer_id, L"Too many users."); @@ -4669,18 +4675,16 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) std::string playername = player->getName(); - if(m_authmanager.exists(playername) == false) - { + if (!auth_exists(const_cast(playername.c_str()))) { infostream<<"Server: playername not found in authmanager"<(playername.c_str()),checkpwd) || oldpwd != checkpwd) { infostream<<"Server: invalid old password"<getName()<<" changes password"<(playername.c_str()),const_cast(newpwd.c_str())); infostream<<"Server: password change successful for "<(g_settings->get("default_privs").c_str())); + player = new ServerRemotePlayer(); - //player->peer_id = c.peer_id; - //player->peer_id = PEER_ID_INEXISTENT; player->peer_id = peer_id; player->updateName(name); - m_authmanager.add(name); - m_authmanager.setPassword(name, password); - m_authmanager.setPrivs(name, - stringToPrivs(g_settings->get("default_privs"))); + + auth_add((char*)name); + auth_setpwd((char*)name,(char*)password); + auth_setprivs((char*)name,privs); /* Set player position @@ -6055,9 +6061,9 @@ void Server::handlePeerChanges() void Server::addUser(const char *name, const char *password) { - m_authmanager.add(name); - m_authmanager.setPassword(name, password); - m_authmanager.save(); + auth_add((char*)name); + auth_setpwd((char*)name,(char*)password); + auth_save(); } uint64_t Server::getPlayerPrivs(Player *player) diff --git a/src/server.h b/src/server.h index c8e3554..f23fada 100644 --- a/src/server.h +++ b/src/server.h @@ -419,29 +419,21 @@ public: uint64_t getPlayerAuthPrivs(const std::string &name) { - try{ - return m_authmanager.getPrivs(name); - } - catch(AuthNotFoundException &e) - { - dstream<<"WARNING: Auth not found for "<(name.c_str())); } void setPlayerAuthPrivs(const std::string &name, uint64_t privs) { - try{ - return m_authmanager.setPrivs(name, privs); - } - catch(AuthNotFoundException &e) - { - dstream<<"WARNING: Auth not found for "<(name.c_str()),privs); + } + void setPlayerPassword(const char *name, const char *password) + { + auth_setpwd(const_cast(name),const_cast(password)); } - void setPlayerPassword(const char *name, const char *password) {m_authmanager.setPassword(name,password);} void addUser(const char *name, const char *password); - bool userExists(const char *name) {return m_authmanager.exists(name);} + bool userExists(const char *name) { + return auth_exists(const_cast(name)); + } Player *getPlayer(std::string name) {return m_env.getPlayer(name.c_str());} array_t *getPlayers() {return m_env.getPlayers();} @@ -609,9 +601,6 @@ private: // Connected clients (behind the con mutex) core::map m_clients; - // User authentication - AuthManager m_authmanager; - // Bann checking BanManager m_banmanager; diff --git a/src/servercommand.cpp b/src/servercommand.cpp index d481619..eea80c3 100644 --- a/src/servercommand.cpp +++ b/src/servercommand.cpp @@ -47,11 +47,15 @@ void cmd_me(std::wostringstream &os, void cmd_privs(std::wostringstream &os, ServerCommandContext *ctx) { - if(ctx->parms.size() == 1) { - // Show our own real privs, without any adjustments - // made for admin status - os<server->getPlayerAuthPrivs(ctx->player->getName()))); + char buff[256]; + if (ctx->parms.size() == 1) { + /* Show our own real privs, without any adjustments made for admin status */ + uint64_t privs = auth_getprivs((char*)ctx->player->getName()); + + if (auth_privs2str(privs,buff,256) < 0) + buff[0] = 0; + + os<server->getPlayerAuthPrivs(tp->getName()))); + uint64_t privs = auth_getprivs((char*)tp->getName()); + + if (auth_privs2str(privs,buff,256) < 0) + buff[0] = 0; + + os<parms.size() != 3) - { + char buff[256]; + if (ctx->parms.size() != 3) { os<privs & PRIV_PRIVS) == 0) - { + if ((ctx->privs & PRIV_PRIVS) == 0) { os<parms[2])); - if(newprivs == PRIV_INVALID) - { + uint64_t newprivs = auth_str2privs(const_cast(wide_to_narrow(ctx->parms[2]).c_str())); + if (newprivs == PRIV_INVALID) { os<env->getPlayer(wide_to_narrow(ctx->parms[1]).c_str()); - if(tp == NULL) - { + if (tp == NULL) { os<parms[2]; msg += L"\""; ctx->server->notifyPlayer(playername.c_str(), msg); - } else { + }else{ privs &= ~newprivs; actionstream<player->getName()<<" revokes " <parms[2])<<" from " @@ -130,7 +136,11 @@ void cmd_grantrevoke(std::wostringstream &os, ctx->server->setPlayerAuthPrivs(playername, privs); os<getVideoDriver()->getTexture(getTexturePath("sun.png").c_str())); + if (path_get((char*)"texture",(char*)"sun.png",1,buff,1024)) + m_materials[2].setTexture(0, mgr->getVideoDriver()->getTexture(buff)); m_materials[2].MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL; m_materials[3] = mat; - m_materials[3].setTexture(0, mgr->getVideoDriver()->getTexture(getTexturePath("moon.png").c_str())); + if (path_get((char*)"texture",(char*)"moon.png",1,buff,1024)) + m_materials[3].setTexture(0, mgr->getVideoDriver()->getTexture(buff)); m_materials[3].MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL; for (u32 i=0; i(filepath.c_str()),1,buff,1024)) return false; - SoundBuffer *buf = loadOggFile(path); + SoundBuffer *buf = loadOggFile(buff); if (buf == NULL) return false; buf->gain = gain; diff --git a/src/thread.c b/src/thread.c new file mode 100644 index 0000000..f4461f7 --- /dev/null +++ b/src/thread.c @@ -0,0 +1,290 @@ +/************************************************************************ +* file.c +* voxelands - 3d voxel world sandbox game +* Copyright (C) Lisa 'darkrose' Milne 2016 +* +* 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 3 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, see +************************************************************************/ + +#include "thread.h" +#include "list.h" +#include "array.h" + +#include +#ifndef WIN32 +#include +#endif + +#define IO_THREAD_STOPPED 0 +#define IO_THREAD_RUNNING 1 + +static struct { + thread_t *threads; + mutex_t *mutexes; + threadid_t main; +} thread_data = { + NULL, + NULL +}; + +int thread_init() +{ + thread_data.main = thread_get_current_id(); + + return 0; +} + +int thread_equal(threadid_t t1, threadid_t t2) +{ +#ifndef WIN32 + return pthread_equal(t1,t2); +#else + if (t1 == t2) + return 1; +#endif + return 0; +} + +int thread_is_main() +{ + threadid_t self = thread_get_current_id(); + + return thread_equal(self,thread_data.main); +} + +/* create a new thread */ +thread_t *thread_create(void *(*func)(), array_t *args) +{ + thread_t *t = malloc(sizeof(thread_t)); + + t->state = IO_THREAD_RUNNING; + t->func = func; + t->args = args; + t->exit = 0; + + thread_data.threads = list_push((void**)&thread_data.threads,t); + +#ifndef WIN32 + pthread_attr_init(&t->attr); + pthread_attr_setdetachstate(&t->attr, PTHREAD_CREATE_JOINABLE); + pthread_create(&t->thread, &t->attr, t->func, (void *)t); +#else + t->thread = CreateThread(NULL, 0, t->func, (void*)t, 0, NULL); +#endif + + return t; +} + +/* destroy a thread */ +void thread_free(thread_t *t) +{ + if (!t) + return; + + thread_stop(t); +#ifndef WIN32 + pthread_attr_destroy(&t->attr); +#endif + if (t->args) + array_free(t->args,1); + free(t); +} + +/* exit from a thread */ +void thread_exit(thread_t *t, int state) +{ + if (!t) + return; + + t->exit = state; + t->state = IO_THREAD_STOPPED; +#ifndef WIN32 + pthread_exit(NULL); +#else + ExitThread(state); +#endif +} + +/* stop a thread */ +void thread_stop(thread_t *t) +{ + if (!t) + return; + + if (t->state == IO_THREAD_RUNNING) { + t->state = IO_THREAD_STOPPED; +#ifndef WIN32 + pthread_kill(t->thread,SIGKILL); +#else + TerminateThread(t->thread,0); + CloseHandle(t->thread); +#endif + } +} + +/* restart a thread */ +int thread_wake(thread_t *t) +{ + if (!t) + return 0; + + if (t->state == IO_THREAD_RUNNING) { +#ifndef WIN32 + pthread_kill(t->thread,SIGCONT); +#else + ResumeThread(t->thread); +#endif + }else{ + t->state = IO_THREAD_RUNNING; +#ifndef WIN32 + pthread_create(&t->thread, &t->attr, t->func, (void *)t); +#else + t->thread = CreateThread(NULL, 0, t->func, (void*)t, 0, NULL); +#endif + } + return 0; +} + +/* wait for a thread to exit */ +void thread_wait(thread_t *t) +{ + if (!t) + return; + + if (t->state == IO_THREAD_RUNNING) { +#ifndef WIN32 + pthread_join(t->thread,NULL); +#else + WaitForSingleObject(t->thread, 2000); + CloseHandle(t->thread); +#endif + } + t->state = IO_THREAD_STOPPED; +} + +threadid_t thread_get_current_id() +{ +#ifdef WIN32 + return GetCurrentThreadId(); +#else + return pthread_self(); +#endif +} + +/* create a mutex */ +mutex_t *mutex_create() +{ + mutex_t *m = malloc(sizeof(mutex_t)); + +#ifndef WIN32 + pthread_mutexattr_init(&m->attr); + pthread_mutexattr_settype(&m->attr, PTHREAD_MUTEX_RECURSIVE); + pthread_mutex_init(&m->mut, &m->attr); +#else + InitializeCriticalSection(&m->mut); +#endif + + m->id = thread_get_current_id(); + m->count = 0; + + thread_data.mutexes = list_push((void**)&thread_data.mutexes,m); + + return m; +} + +/* destroy a mutex */ +void mutex_free(mutex_t *m) +{ + mutex_unlock(m); +#ifndef WIN32 + pthread_mutex_destroy(&m->mut); + pthread_mutexattr_destroy(&m->attr); +#else + DeleteCriticalSection(&m->mut); +#endif + + thread_data.mutexes = list_remove((void**)&thread_data.mutexes,m); + free(m); +} + +/* lock a mutex */ +void mutex_lock(mutex_t *m) +{ + if (!mutex_trylock(m)) + return; + + if (m->id == thread_get_current_id()) { + m->count++; + return; + } +#ifndef WIN32 + pthread_mutex_lock(&m->mut); +#else + EnterCriticalSection(&m->mut); +#endif + m->id = thread_get_current_id(); + m->count = 1; +} + +/* try to lock a mutex - return non-zero if not locked */ +int mutex_trylock(mutex_t *m) +{ +#ifndef WIN32 + if (pthread_mutex_trylock(&m->mut)) + return 1; +#else + if (!TryEnterCriticalSection(&m->mut)) + return 1; +#endif + m->id = thread_get_current_id(); + m->count = 1; + + return 0; +} + +/* unlock a mutex */ +void mutex_unlock(mutex_t *m) +{ + m->count--; + if (m->count > 0) + return; +#ifndef WIN32 + pthread_mutex_unlock(&m->mut); +#else + LeaveCriticalSection(&m->mut); +#endif +} + +static void *mutex_test_lock_t(thread_t *t) +{ + int r = mutex_trylock(((mutex_t**)(t->args->data))[0]); + thread_exit(t,r); + return NULL; +} + +/* try to force a mutex to unlock */ +void mutex_unlock_complete(mutex_t *m) +{ + array_t *a; + thread_t *t; + + a = array_create(ARRAY_TYPE_PTR); + array_push_ptr(a,m); + t = thread_create(mutex_test_lock_t,a); + thread_wait(t); + while (t->exit) { + thread_wake(t); + thread_wait(t); + } +} diff --git a/src/thread.h b/src/thread.h new file mode 100644 index 0000000..a38bb2e --- /dev/null +++ b/src/thread.h @@ -0,0 +1,82 @@ +#ifndef _THREAD_H_ +#define _THREAD_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "array.h" + +#ifdef WIN32 +#include +#else +#include +#endif + +#ifndef _HAVE_THREADID_TYPE +#define _HAVE_THREADID_TYPE +#ifdef WIN32 +typedef DWORD threadid_t; +#else +typedef pthread_t threadid_t; +#endif +#endif + +#ifndef _HAVE_THREAD_TYPE +#define _HAVE_THREAD_TYPE +#include "array.h" +typedef struct thread_s { + struct thread_s *prev; + struct thread_s *next; +#ifndef WIN32 + pthread_t thread; + pthread_attr_t attr; +#else + HANDLE thread; +#endif + unsigned int state; + int exit; + void *(*func)(); + array_t *args; +} thread_t; +#endif + +#ifndef _HAVE_MUTEX_TYPE +#define _HAVE_MUTEX_TYPE +typedef struct mutex_s { + struct mutex_s *prev; + struct mutex_s *next; +#ifndef WIN32 + pthread_mutexattr_t attr; + pthread_mutex_t mut; +#else + CRITICAL_SECTION mut; +#endif + threadid_t id; + int count; +} mutex_t; +#endif + +/* defined in thread.c */ +int thread_init(void); +int thread_equal(threadid_t t1, threadid_t t2); +int thread_is_main(void); +thread_t *thread_create(void *(*func)(), array_t *args); +void thread_free(thread_t *t); +void thread_exit(thread_t *t, int state); +void thread_stop(thread_t *t); +int thread_wake(thread_t *t); +void thread_wait(thread_t *t); +threadid_t thread_get_current_id(void); +mutex_t *mutex_create(void); +void mutex_free(mutex_t *m); +void mutex_lock(mutex_t *m); +int mutex_trylock(mutex_t *m); +void mutex_unlock(mutex_t *m); +void mutex_unlock_complete(mutex_t *m); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/tile.cpp b/src/tile.cpp index 8f9eb04..6466cce 100644 --- a/src/tile.cpp +++ b/src/tile.cpp @@ -1051,27 +1051,24 @@ video::IImage* generate_image_from_scratch(std::string name, bool generate_image(std::string part_of_name, video::IImage *& baseimg, IrrlichtDevice *device) { + char buff[1024]; video::IVideoDriver* driver = device->getVideoDriver(); assert(driver); if (part_of_name == "") return baseimg; // Stuff starting with [ are special commands - if(part_of_name[0] != '[') - { + if (part_of_name[0] != '[') { // A normal texture; load it from a file - std::string path = getTexturePath(part_of_name.c_str()); - /*infostream<<"generate_image(): Loading path \""<createImageFromFile(path.c_str()); + video::IImage *image = NULL; + if (path_get((char*)"texture",const_cast(part_of_name.c_str()),1,buff,1024)) + image = driver->createImageFromFile(buff); - if(image == NULL) - { + if (image == NULL) { if (part_of_name != "") { infostream<<"generate_image(): Could not load image \"" - <createImageFromFile(getTexturePath("crack.png").c_str()); + video::IImage *img_crack = NULL; + if (path_get((char*)"texture",(char*)"crack.png",1,buff,1024)) + img_crack = driver->createImageFromFile(buff); if (!img_crack) return true; @@ -1188,27 +1187,26 @@ bool generate_image(std::string part_of_name, video::IImage *& baseimg, infostream<<"Adding \""<createImageFromFile( - getTexturePath(filename.c_str()).c_str()); - if(img) - { - core::dimension2d dim = img->getDimension(); - infostream<<"Size "< pos_base(x, y); - video::IImage *img2 = - driver->createImage(video::ECF_A8R8G8B8, dim); - img->copyTo(img2); - img->drop(); - img2->copyToWithAlpha(baseimg, pos_base, - core::rect(v2s32(0,0), dim), - video::SColor(255,255,255,255), - NULL); - img2->drop(); - } - else - { - infostream<<"img==NULL"<(filename.c_str()),1,buff,1024)) { + video::IImage *img = driver->createImageFromFile(buff); + if (img) { + core::dimension2d dim = img->getDimension(); + infostream<<"Size "< pos_base(x, y); + video::IImage *img2 = + driver->createImage(video::ECF_A8R8G8B8, dim); + img->copyTo(img2); + img->drop(); + img2->copyToWithAlpha(baseimg, pos_base, + core::rect(v2s32(0,0), dim), + video::SColor(255,255,255,255), + NULL); + img2->drop(); + }else{ + infostream<<"img==NULL"<(filename.c_str()),1,buff,1024)) { - infostream<<"generate_image(): Loading path \""<createImageFromFile(path.c_str()); + video::IImage *image = driver->createImageFromFile(buff); - if (image == NULL) { - infostream<<"generate_image(): Loading path \"" - < dim = image->getDimension(); - baseimg = driver->createImage(video::ECF_A8R8G8B8, dim); + if (image == NULL) { + infostream<<"generate_image(): Loading path \"" + < dim = image->getDimension(); + baseimg = driver->createImage(video::ECF_A8R8G8B8, dim); - // Set alpha to full - for(u32 y=0; ygetPixel(x,y); - c.setAlpha(255); - image->setPixel(x,y,c); + // Set alpha to full + for(u32 y=0; ygetPixel(x,y); + c.setAlpha(255); + image->setPixel(x,y,c); + } + // Blit + image->copyTo(baseimg); + + image->drop(); } - // Blit - image->copyTo(baseimg); - - image->drop(); } } /* @@ -1298,39 +1295,36 @@ bool generate_image(std::string part_of_name, video::IImage *& baseimg, u32 b1 = mystoi(sf.next(":")); std::string filename = sf.next(""); - std::string path = getTexturePath(filename.c_str()); + if (path_get((char*)"texture",const_cast(filename.c_str()),1,buff,1024)) { - infostream<<"generate_image(): Loading path \""<createImageFromFile(path.c_str()); + video::IImage *image = driver->createImageFromFile(buff); - if(image == NULL) - { - infostream<<"generate_image(): Loading path \"" - < dim = image->getDimension(); - baseimg = driver->createImage(video::ECF_A8R8G8B8, dim); + if (image == NULL) { + infostream<<"generate_image(): Loading path \"" + < dim = image->getDimension(); + baseimg = driver->createImage(video::ECF_A8R8G8B8, dim); - // Blit - image->copyTo(baseimg); + // Blit + image->copyTo(baseimg); - image->drop(); + image->drop(); - for(u32 y=0; ygetPixel(x,y); - u32 r = c.getRed(); - u32 g = c.getGreen(); - u32 b = c.getBlue(); - if(!(r == r1 && g == g1 && b == b1)) - continue; - c.setAlpha(0); - baseimg->setPixel(x,y,c); + for(u32 y=0; ygetPixel(x,y); + u32 r = c.getRed(); + u32 g = c.getGreen(); + u32 b = c.getBlue(); + if(!(r == r1 && g == g1 && b == b1)) + continue; + c.setAlpha(0); + baseimg->setPixel(x,y,c); + } } } } @@ -1357,40 +1351,37 @@ bool generate_image(std::string part_of_name, video::IImage *& baseimg, u32 b2 = mystoi(sf.next(":")); std::string filename = sf.next(""); - std::string path = getTexturePath(filename.c_str()); + if (path_get((char*)"texture",const_cast(filename.c_str()),1,buff,1024)) { - infostream<<"generate_image(): Loading path \""<createImageFromFile(path.c_str()); + video::IImage *image = driver->createImageFromFile(buff); - if(image == NULL) - { - infostream<<"generate_image(): Loading path \"" - < dim = image->getDimension(); - baseimg = driver->createImage(video::ECF_A8R8G8B8, dim); + if (image == NULL) { + infostream<<"generate_image(): Loading path \"" + < dim = image->getDimension(); + baseimg = driver->createImage(video::ECF_A8R8G8B8, dim); - // Blit - image->copyTo(baseimg); + // Blit + image->copyTo(baseimg); - image->drop(); + image->drop(); - for(u32 y=0; ygetPixel(x,y); - u32 r = c.getRed(); - u32 g = c.getGreen(); - u32 b = c.getBlue(); - if(!(r == r1 && g == g1 && b == b1) && - !(r == r2 && g == g2 && b == b2)) - continue; - c.setAlpha(0); - baseimg->setPixel(x,y,c); + for(u32 y=0; ygetPixel(x,y); + u32 r = c.getRed(); + u32 g = c.getGreen(); + u32 b = c.getBlue(); + if(!(r == r1 && g == g1 && b == b1) && + !(r == r2 && g == g2 && b == b2)) + continue; + c.setAlpha(0); + baseimg->setPixel(x,y,c); + } } } } @@ -1807,7 +1798,8 @@ bool generate_image(std::string part_of_name, video::IImage *& baseimg, #if USE_FREETYPE tex_font = gui::CGUITTFont::createTTFont(guienv, getPath("font","unifont.ttf",false).c_str(),10); #else - tex_font = guienv->getFont(getTexturePath("fontlucida.png").c_str()); + if (path_get((char*)"texture",(char*)"fontlucida.png",1,buff,1024)) + tex_font = guienv->getFont(buff); #endif if (tex_font) skin->setFont(tex_font); @@ -1883,28 +1875,27 @@ bool generate_image(std::string part_of_name, video::IImage *& baseimg, float X = mystof(sf.next(",")); float Y = mystof(sf.next(",")); std::string path = sf.end(); - path = getTexturePath(path.c_str()); - video::IImage *image = driver->createImageFromFile(path.c_str()); + if (path_get((char*)"texture",const_cast(path.c_str()),1,buff,1024)) { + video::IImage *image = driver->createImageFromFile(buff); - if (baseimg == NULL) { - errorstream << "generateImagePart(): baseimg == NULL " - << "for part_of_name=\"" << part_of_name - << "\", cancelling." << std::endl; - return false; + if (baseimg == NULL) { + errorstream << "generateImagePart(): baseimg == NULL " + << "for part_of_name=\"" << part_of_name + << "\", cancelling." << std::endl; + return false; + } + if (image == NULL) { + errorstream << "generateImagePart(): image == NULL " + << "for part_of_name=\"" << part_of_name + << "\", cancelling." << std::endl; + return false; + } + float p[4] = {x,y,X,Y}; + alpha_blit(device,baseimg,image,p,p,part_of_name); + // Drop image + image->drop(); } - if (image == NULL) { - errorstream << "generateImagePart(): image == NULL " - << "for part_of_name=\"" << part_of_name - << "\", cancelling." << std::endl; - return false; - } - float p[4] = {x,y,X,Y}; - alpha_blit(device,baseimg,image,p,p,part_of_name); - // Drop image - image->drop(); - } - else - { + }else{ infostream<<"generate_image(): Invalid " " modification: \""<