this is what happens when darkrose rages at code

This commit is contained in:
darkrose 2017-05-10 15:37:26 +10:00
parent 9135bc808a
commit f0e36c0404
68 changed files with 4003 additions and 2543 deletions

View File

@ -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}")

424
src/auth.c Normal file
View File

@ -0,0 +1,424 @@
/************************************************************************
* auth.c
* voxelands - 3d voxel world sandbox game
* Copyright (C) Lisa 'darkrose' Milne 2016 <lisa@ltmnet.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 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 <http://www.gnu.org/licenses/>
************************************************************************/
#include "auth.h"
#include "thread.h"
#include "nvp.h"
#include "file.h"
#include "path.h"
#include <stdlib.h>
#include <string.h>
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; i<PRIV_COUNT; i++) {
p = (1<<i);
if ((privs&p) != p)
continue;
l = strlen(auth.privstr[i]);
if ((o+l+2) < size)
continue;
if (r) {
strcat(buff,",");
o++;
}
strcat(buff,auth.privstr[i]);
o += l;
r++;
}
return r;
}
/* convert a string to privs */
uint64_t auth_str2privs(char* str)
{
uint64_t privs = 0;
char buff[256];
char* b;
char* e;
int i;
if (!str)
return 0;
if (!strcpy(buff,str))
return 0;
b = buff;
while (1) {
e = strchr(b,',');
if (e)
*e = 0;
for (i=0; i<PRIV_COUNT; i++) {
if (strcmp(auth.privstr[i],b))
continue;
privs |= (1<<i);
break;
}
if (i == PRIV_COUNT)
return PRIV_INVALID;
if (e) {
b = e+1;
continue;
}
break;
}
return privs;
}
/* init auth system for the given file */
int auth_init(char* file)
{
char* path;
if (!auth.mutex) {
auth.mutex = mutex_create();
if (!auth.mutex)
return -1;
}
path = path_get("game",file,0,NULL,0);
if (!path)
return -1;
if (auth.file) {
if (!strcmp(auth.file,path)) {
free(path);
auth_load();
return 0;
}
if (auth.file)
free(auth.file);
auth.file = NULL;
nvp_free(&auth.data,1);
auth.data = NULL;
}
auth.file = path;
auth.modified = 0;
auth_load();
return 0;
}
/* free auth memory, reset auth struct */
void auth_exit()
{
if (auth.modified)
auth_save();
mutex_free(auth.mutex);
auth.mutex = NULL;
if (auth.file)
free(auth.file);
auth.file = NULL;
nvp_free(&auth.data,1);
auth.data = NULL;
auth.modified = 0;
}
/* load auth data from file */
void auth_load()
{
file_t *f;
char line[512];
char* n;
char* p;
char* s;
uint64_t privs;
authdata_t *d;
mutex_lock(auth.mutex);
f = file_load(NULL,auth.file);
if (!f) {
mutex_unlock(auth.mutex);
return;
}
while (file_readline(f,line,512)) {
n = line;
p = strchr(n,':');
if (!p)
continue;
*p = 0;
p++;
s = strchr(p,':');
if (!s)
continue;
*s = 0;
s++;
privs = auth_str2privs(s);
d = malloc(sizeof(authdata_t));
if (!d)
continue;
strcpy(d->pwd,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;
}

View File

@ -1,274 +0,0 @@
/************************************************************************
* Minetest-c55
* Copyright (C) 2011 celeron55, Perttu Ahola <celeron55@gmail.com>
*
* auth.cpp
* voxelands - 3d voxel world sandbox game
* Copyright (C) Lisa 'darkrose' Milne 2014 <lisa@ltmnet.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 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 <http://www.gnu.org/licenses/>
*
* License updated from GPLv2 or later to GPLv3 or later by Lisa Milne
* for Voxelands.
************************************************************************/
#include "auth.h"
#include <fstream>
#include <jmutexautolock.h>
//#include "main.h" // for g_settings
#include <sstream>
#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 "
<<m_authfilepath<<std::endl;
}
}
AuthManager::~AuthManager()
{
save();
}
void AuthManager::load()
{
JMutexAutoLock lock(m_mutex);
dstream<<"AuthManager: loading from "<<m_authfilepath<<std::endl;
std::ifstream is(m_authfilepath.c_str(), std::ios::binary);
if(is.good() == false)
{
dstream<<"AuthManager: failed loading from "<<m_authfilepath<<std::endl;
throw SerializationError("AuthManager::load(): Couldn't open file");
}
for(;;)
{
if(is.eof() || is.good() == false)
break;
// Read a line
std::string line;
std::getline(is, line, '\n');
std::istringstream iss(line);
// Read name
std::string name;
std::getline(iss, name, ':');
// Read password
std::string pwd;
std::getline(iss, pwd, ':');
// Read privileges
std::string stringprivs;
std::getline(iss, stringprivs, ':');
uint64_t privs = stringToPrivs(stringprivs);
// Store it
AuthData ad;
ad.pwd = pwd;
ad.privs = privs;
m_authdata[name] = ad;
}
m_modified = false;
}
void AuthManager::save()
{
JMutexAutoLock lock(m_mutex);
dstream<<"AuthManager: saving to "<<m_authfilepath<<std::endl;
std::ofstream os(m_authfilepath.c_str(), std::ios::binary);
if(os.good() == false)
{
dstream<<"AuthManager: failed saving to "<<m_authfilepath<<std::endl;
throw SerializationError("AuthManager::save(): Couldn't open file");
}
for(core::map<std::string, AuthData>::Iterator
i = m_authdata.getIterator();
i.atEnd()==false; i++)
{
std::string name = i.getNode()->getKey();
if(name == "")
continue;
AuthData ad = i.getNode()->getValue();
os<<name<<":"<<ad.pwd<<":"<<privsToString(ad.privs)<<"\n";
}
m_modified = false;
}
bool AuthManager::exists(const std::string &username)
{
JMutexAutoLock lock(m_mutex);
core::map<std::string, AuthData>::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<std::string, AuthData>::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<std::string, AuthData>::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<std::string, AuthData>::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<std::string, AuthData>::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;
}

View File

@ -1,108 +1,53 @@
/************************************************************************
* Minetest-c55
* Copyright (C) 2011 celeron55, Perttu Ahola <celeron55@gmail.com>
*
* auth.h
* voxelands - 3d voxel world sandbox game
* Copyright (C) Lisa 'darkrose' Milne 2014 <lisa@ltmnet.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 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 <http://www.gnu.org/licenses/>
*
* License updated from GPLv2 or later to GPLv3 or later by Lisa Milne
* for Voxelands.
************************************************************************/
#ifndef AUTH_HEADER
#define AUTH_HEADER
#include <string>
#include <jthread.h>
#include <jmutex.h>
#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<std::string, AuthData> m_authdata;
bool m_modified;
};
#ifndef _AUTH_H_
#define _AUTH_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#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

View File

@ -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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<u32>& img_origsize = texture->getOriginalSize();
core::rect<s32> 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<s32>(core::position2d<s32>(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<u32>& img_origsize = texture->getOriginalSize();
core::rect<s32> 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<s32>(core::position2d<s32>(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";
}

View File

@ -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<char*>(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<char*>(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);

File diff suppressed because it is too large Load Diff

View File

@ -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];

File diff suppressed because it is too large Load Diff

View File

@ -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();

View File

@ -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;

View File

@ -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;

View File

@ -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");

View File

@ -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;

View File

@ -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");

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -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 "<<wide_to_narrow(m.description)<<" ("<<m.content<<") mob spawns at "<<PP(floatToInt(p,BS))<<std::endl;
actionstream<<"A "<<m.description<<" ("<<m.content<<") mob spawns at "<<PP(floatToInt(p,BS))<<std::endl;
ServerActiveObject *obj = new MobSAO(env, 0, p, m.content);
u16 id = env->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";

View File

@ -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 = "";

View File

@ -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 += "]";
}

View File

@ -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();

View File

@ -1381,7 +1381,7 @@ u16 MobSAO::punch(content_t punch_item, v3f dir, const std::string &playername)
u16 wear = 655;
actionstream<<playername<<" punches mob id="<<m_id
<<" with a \""<<wide_to_narrow(f.description)<<"\" at "
<<" with a \""<<f.description<<"\" at "
<<PP(m_base_position/BS)<<std::endl;
if (m.special_dropped_item != CONTENT_IGNORE && (m.special_punch_item == TT_NONE || f.type == m.special_punch_item))

View File

@ -277,7 +277,7 @@ void content_toolitem_init()
f->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;

View File

@ -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;

View File

@ -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;

View File

@ -37,7 +37,7 @@ struct EnchantmentInfo {
uint8_t level;
uint16_t mask;
std::string overlay;
std::wstring name;
char* name;
content_t gem;
};

446
src/file.c Normal file
View File

@ -0,0 +1,446 @@
/************************************************************************
* file.c
* voxelands - 3d voxel world sandbox game
* Copyright (C) Lisa 'darkrose' Milne 2016 <lisa@ltmnet.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 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 <http://www.gnu.org/licenses/>
************************************************************************/
#include "file.h"
#include "path.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <stdarg.h>
#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; r<file->len; 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;
}

50
src/file.h Normal file
View File

@ -0,0 +1,50 @@
#ifndef _FILE_H_
#define _FILE_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#include <stdint.h>
#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

View File

@ -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<s32> rect(x-100,y-150,x+100,y+50);
driver->draw2DImage(logotexture, rect,
core::rect<s32>(core::position2d<s32>(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<s32> rect(x-100,y-150,x+100,y+50);
driver->draw2DImage(logotexture, rect,
core::rect<s32>(core::position2d<s32>(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<u32> textsize = guienv->getSkin()->getFont()->getDimension(m.c_str());
core::rect<s32> 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> 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"<<std::endl;
server = new Server(map_dir, configpath);
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"<<std::endl;
MapDrawControl draw_control;
Client client(device, playername.c_str(), password, draw_control, sound);
drawLoadingScreen(device,wgettext("Resolving address..."));
drawLoadingScreen(device,narrow_to_wide(gettext("Resolving address...")));
Address connect_address(0,0,0,0, port);
try{
if(address == "")
@ -696,7 +700,7 @@ void the_game(
catch(ResolveError &e)
{
errorstream<<"Couldn't resolve address"<<std::endl;
error_message = wgettext("Couldn't resolve address");
error_message = narrow_to_wide(gettext("Couldn't resolve address"));
return;
}
@ -730,12 +734,12 @@ void the_game(
break;
}
wchar_t buff[512];
char buff[512];
int tot = (10.0 - time_counter + 1.0);
swprintf(
snprintf(
buff,
512,
wngettext(
ngettext(
"Connecting to server... (timeout in %d second)",
"Connecting to server... (timeout in %d seconds)",
tot
@ -743,7 +747,7 @@ void the_game(
tot
);
//draw_load_screen(ss.str(), driver, font);
drawLoadingScreen(device, (wchar_t *)buff);
drawLoadingScreen(device, narrow_to_wide(buff).c_str());
// Update client and server
client.step(0.1);
@ -764,15 +768,15 @@ void the_game(
if (could_connect == false) {
if (client.accessDenied()) {
wchar_t buff[512];
swprintf(buff,512,wgettext("Access denied. Reason: %ls"),client.accessDeniedReason().c_str());
error_message = std::wstring(buff);
errorstream<<wide_to_narrow(error_message)<<std::endl;
char buff[512];
snprintf(buff,512,gettext("Access denied. Reason: %s"),wide_to_narrow(client.accessDeniedReason()).c_str());
error_message = narrow_to_wide(buff);
errorstream<<buff<<std::endl;
}else if (server != NULL) {
error_message = wgettext("Unable to Connect (port already in use?).");
error_message = narrow_to_wide(gettext("Unable to Connect (port already in use?)."));
errorstream<<"Timed out."<<std::endl;
}else{
error_message = wgettext("Connection timed out.");
error_message = narrow_to_wide(gettext("Connection timed out."));
errorstream<<"Timed out."<<std::endl;
}
return;
@ -920,7 +924,7 @@ void the_game(
//std::cerr<<"frame"<<std::endl;
if (client.accessDenied()) {
error_message = wgettext("Access denied. Reason: ")
error_message = narrow_to_wide(gettext("Access denied. Reason: "))
+client.accessDeniedReason();
errorstream<<wide_to_narrow(error_message)<<std::endl;
break;
@ -1152,11 +1156,11 @@ void the_game(
}else if(input->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 << "'"<<std::endl;
@ -1180,33 +1184,33 @@ void the_game(
}else if (input->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"<<std::endl;
statustext = wgettext("Enabled full viewing range");
statustext = narrow_to_wide(gettext("Enabled full viewing range"));
statustext_time = 0;
}else{
infostream<<"Disabled full viewing range"<<std::endl;
statustext = wgettext("Disabled full viewing range");
statustext = narrow_to_wide(gettext("Disabled full viewing range"));
statustext_time = 0;
}
}
@ -1931,7 +1935,7 @@ void the_game(
float client_rtt = client.getRTT();
if (client_rtt < -1000) {
error_message = wgettext("Disconnected (Network Timeout)");
error_message = narrow_to_wide(gettext("Disconnected (Network Timeout)"));
break;
}
@ -2365,6 +2369,6 @@ void the_game(
generator and other stuff quits
*/
{
drawLoadingScreen(device,wgettext("Shutting down..."));
drawLoadingScreen(device,narrow_to_wide(gettext("Shutting down...")).c_str());
}
}

View File

@ -94,12 +94,12 @@ void GUIDeathScreen::regenerateGui(v2u32 screensize)
{
core::rect<s32> 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<s32> 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);
}
}

View File

@ -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<char*>(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<s32> 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<s32>(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<char*>(s.background.c_str()),1,buff,1024))
bg_texture = driver->getTexture(buff);
}
core::rect<s32> imgrect(0,0,imgsize.X,imgsize.Y);
@ -621,7 +626,10 @@ void GUIFormSpecMenu::drawMenu()
for (u32 i=0; i<m_images.size(); i++) {
const ImageDrawSpec &spec = m_images[i];
video::ITexture *texture = driver->getTexture(getTexturePath(spec.name).c_str());
char buff[1024];
video::ITexture *texture = NULL;
if (path_get((char*)"texture",const_cast<char*>(spec.name.c_str()),1,buff,1024))
texture = driver->getTexture(buff);
// Image size on screen
core::rect<s32> imgrect(0, 0, spec.geom.X, spec.geom.Y);
// Image rectangle on screen

View File

@ -318,37 +318,37 @@ void GUIMainMenu::regenerateGui(v2u32 screensize)
{
core::rect<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<u32>& img_origsize = texture->getOriginalSize();
core::rect<s32> 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<s32>(core::position2d<s32>(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<u32>& img_origsize = texture->getOriginalSize();
core::rect<s32> 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<s32>(core::position2d<s32>(0,0),img_origsize), NULL, colors, true);
}
}
}

View File

@ -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);
}
}

View File

@ -132,33 +132,33 @@ void GUIMultiplayerMenu::regenerateGui(v2u32 screensize)
{
core::rect<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> rect(0, 0, 230, 30);
@ -237,7 +237,7 @@ void GUIMultiplayerMenu::regenerateGui(v2u32 screensize)
{
core::rect<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<u32>& img_origsize = texture->getOriginalSize();
core::rect<s32> 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<s32>(core::position2d<s32>(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<u32>& img_origsize = texture->getOriginalSize();
core::rect<s32> 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<s32>(core::position2d<s32>(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<char*>("/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;

View File

@ -102,7 +102,7 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize)
{
core::rect<s32> 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<s32> rect(0, 0, 230, 30);
@ -120,7 +120,7 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize)
{
core::rect<s32> 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<s32> rect(0, 0, 230, 30);
@ -137,7 +137,7 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize)
{
core::rect<s32> 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<s32> rect(0, 0, 230, 30);
@ -155,7 +155,7 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize)
{
core::rect<s32> 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<s32> 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);
}

View File

@ -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<s32> 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<s32> 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<s32> 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<s32> 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());
}
}

View File

@ -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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<VLKC_MAX; i++) {
if (keynames[i] == NULL)
if (keynames[i] == L"")
continue;
{
core::rect < s32 > 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> rect(0, 0, 200, 15);
@ -553,6 +553,7 @@ void GUISettingsMenu::drawMenu()
video::IVideoDriver* driver = Environment->getVideoDriver();
{
char buff[1024];
core::rect<s32> 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<u32>& img_origsize = texture->getOriginalSize();
core::rect<s32> 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<s32>(core::position2d<s32>(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<u32>& img_origsize = texture->getOriginalSize();
core::rect<s32> 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<s32>(core::position2d<s32>(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;
}

View File

@ -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];
};

View File

@ -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/<file> 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<char*>(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 */

View File

@ -29,6 +29,7 @@
#include "server.h"
#include "player.h"
#include <map>
#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;

View File

@ -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<char*>(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<s32> 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; i<barData[k].count; i++) {
const video::SColor color(255,255,255,255);
@ -396,7 +405,7 @@ void hud_draw(
// background
{
const video::SColor color(255,255,255,255);
video::ITexture *texture = driver->getTexture(getTexturePath("ringbg.png").c_str());
video::ITexture *texture = getTexture(driver,"ringbg.png");
core::rect<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> 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<s32> rect(x_off+132,screensize.Y-36,x_off+164,screensize.Y-4);
draw_image(driver,texture,color,rect,NULL,NULL);

View File

@ -16,12 +16,16 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
************************************************************************/
#include "file.h"
#include "crypto.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h>
#include <ctype.h>
#include <locale.h>
#ifdef _WIN32
#ifdef _MSC_VER
#include <Windows.h>
@ -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

View File

@ -1,25 +1,21 @@
#ifndef GETTEXT_HEADER
#define GETTEXT_HEADER
#include <iostream>
#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

View File

@ -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);
}
/*

View File

@ -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()

View File

@ -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<u32> 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="<<text_height<<std::endl;
@ -1155,14 +1174,14 @@ int main(int argc, char *argv[])
Preload some textures and stuff
*/
drawLoadingScreen(device,wgettext("Loading MapNodes"));
drawLoadingScreen(device,narrow_to_wide(gettext("Loading MapNodes")));
init_mapnode(device); // Second call with g_texturesource set
drawLoadingScreen(device,wgettext("Loading Creatures"));
drawLoadingScreen(device,narrow_to_wide(gettext("Loading Creatures")));
content_mob_init();
// preloading this reduces some hud flicker
g_texturesource->getTextureId("crack.png");
drawLoadingScreen(device,wgettext("Setting Up Sound"));
drawLoadingScreen(device,narrow_to_wide(gettext("Setting Up Sound")));
#if USE_AUDIO == 1
sound = createSoundManager();

View File

@ -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<s32> rect(0,0,ss.X,ss.Y);
driver->draw2DImage(
texture,
rect,
core::rect<s32>(
core::position2d<s32>(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<s32> rect(0,0,ss.X,ss.Y);
driver->draw2DImage(
texture,
rect,
core::rect<s32>(
core::position2d<s32>(0,0),
core::dimension2di(texture->getOriginalSize())
),
NULL,
colors,
true
);
}
}
}
}

View File

@ -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);

View File

@ -326,7 +326,7 @@ struct ContentFeatures
bool rotate_tile_with_nodebox;
bool plantlike_tiled;
bool wield_nodebox;
std::wstring description;
char* description;
std::vector<NodeBox> nodeboxes;
std::vector<NodeBox> 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,

View File

@ -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<char*>(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; i<lc; i++) {

View File

@ -90,27 +90,27 @@ void init_mineral()
i = MINERAL_COAL;
f = &mineral_features(i);
f->description = 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;

View File

@ -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*)"";
}
};
/*

699
src/path.c Normal file
View File

@ -0,0 +1,699 @@
/************************************************************************
* path.c
* voxelands - 3d voxel world sandbox game
* Copyright (C) Lisa 'darkrose' Milne 2016 <lisa@ltmnet.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 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 <http://www.gnu.org/licenses/>
************************************************************************/
#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 <windows.h>
#define GAMEDATA "nfi"
#else
#define GAMEDATA "/usr/games/voxelands"
#include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <libgen.h>
#include <dirent.h>
#include <errno.h>
#include <ftw.h>
#endif
#include <unistd.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
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
* <type>/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 <type>/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;
}

View File

@ -1,200 +0,0 @@
/************************************************************************
* Minetest-c55
* Copyright (C) 2010-2011 celeron55, Perttu Ahola <celeron55@gmail.com>
*
* path.cpp
* voxelands - 3d voxel world sandbox game
* Copyright (C) Lisa 'darkrose' Milne 2013-2014 <lisa@ltmnet.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 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 <http://www.gnu.org/licenses/>
*
* 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<std::string, std::string> g_texturename_to_path_cache;
MutexedMap<std::string, std::string> 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;
}

View File

@ -1,54 +1,34 @@
/************************************************************************
* Minetest-c55
* Copyright (C) 2010 celeron55, Perttu Ahola <celeron55@gmail.com>
*
* path.h
* voxelands - 3d voxel world sandbox game
* Copyright (C) Lisa 'darkrose' Milne 2014 <lisa@ltmnet.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 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 <http://www.gnu.org/licenses/>
*
* 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 <string>
#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

View File

@ -406,6 +406,9 @@ v3f Player::getScale()
//M:10:10:fair:blue:brown:medium:human:green:blue:leather
void Player::getSkin(std::vector<std::string> &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<std::string> &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);

View File

@ -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 "<<playername
<<" was blocked"<<std::endl;
SendAccessDenied(m_con, peer_id, L"No unknown players allowed.");
return;
}
std::string checkpwd;
if (m_authmanager.exists(playername)) {
checkpwd = m_authmanager.getPassword(playername);
char checkpwd[64];
if (auth_exists(playername)) {
if (auth_getpwd(playername,checkpwd))
checkpwd[0] = 0;
}else{
checkpwd = g_settings->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 '"<<password
<<"', the correct one is '"<<checkpwd<<"'"<<std::endl;*/
if (password != checkpwd) {
if (strcmp(password,checkpwd)) {
infostream<<"Server: peer_id="<<peer_id
<<": supplied invalid password for "
<<playername<<std::endl;
@ -1886,19 +1888,23 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
}
// Add player to auth manager
if (m_authmanager.exists(playername) == false) {
if (!auth_exists(playername)) {
infostream<<"Server: adding player "<<playername<<" to auth manager"<<std::endl;
m_authmanager.add(playername);
m_authmanager.setPassword(playername, checkpwd);
m_authmanager.setPrivs(playername, stringToPrivs(g_settings->get("default_privs")));
m_authmanager.save();
uint64_t privs;
privs = auth_str2privs(const_cast<char*>(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<char*>(playername.c_str()))) {
infostream<<"Server: playername not found in authmanager"<<std::endl;
// Wrong old password supplied!!
SendChatMessage(peer_id, L"playername not found in authmanager");
return;
}
std::string checkpwd = m_authmanager.getPassword(playername);
char checkpwd[64];
if(oldpwd != checkpwd)
{
if (auth_getpwd(const_cast<char*>(playername.c_str()),checkpwd) || oldpwd != checkpwd) {
infostream<<"Server: invalid old password"<<std::endl;
// Wrong old password supplied!!
SendChatMessage(peer_id, L"Invalid old password supplied. Password NOT changed.");
@ -4689,7 +4693,7 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
actionstream<<player->getName()<<" changes password"<<std::endl;
m_authmanager.setPassword(playername, newpwd);
auth_setpwd(const_cast<char*>(playername.c_str()),const_cast<char*>(newpwd.c_str()));
infostream<<"Server: password change successful for "<<playername
<<std::endl;
@ -5877,15 +5881,17 @@ Player *Server::emergePlayer(const char *name, const char *password, u16 peer_id
Create a new player
*/
{
uint64_t privs;
privs = auth_str2privs(const_cast<char*>(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)

View File

@ -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<<std::endl;
return 0;
}
return auth_getprivs(const_cast<char*>(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<<std::endl;
}
auth_setprivs(const_cast<char*>(name.c_str()),privs);
}
void setPlayerPassword(const char *name, const char *password)
{
auth_setpwd(const_cast<char*>(name),const_cast<char*>(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<char*>(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<u16, RemoteClient*> m_clients;
// User authentication
AuthManager m_authmanager;
// Bann checking
BanManager m_banmanager;

View File

@ -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<<L"-!- " + narrow_to_wide(privsToString(
ctx->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<<L"-!- " + narrow_to_wide(buff);
return;
}
@ -66,34 +70,36 @@ void cmd_privs(std::wostringstream &os,
return;
}
os<<L"-!- " + narrow_to_wide(privsToString(ctx->server->getPlayerAuthPrivs(tp->getName())));
uint64_t privs = auth_getprivs((char*)tp->getName());
if (auth_privs2str(privs,buff,256) < 0)
buff[0] = 0;
os<<L"-!- " + narrow_to_wide(buff);
}
void cmd_grantrevoke(std::wostringstream &os,
ServerCommandContext *ctx)
{
if(ctx->parms.size() != 3)
{
char buff[256];
if (ctx->parms.size() != 3) {
os<<L"-!- Missing parameter";
return;
}
if((ctx->privs & PRIV_PRIVS) == 0)
{
if ((ctx->privs & PRIV_PRIVS) == 0) {
os<<L"-!- You don't have permission to do that";
return;
}
uint64_t newprivs = stringToPrivs(wide_to_narrow(ctx->parms[2]));
if(newprivs == PRIV_INVALID)
{
uint64_t newprivs = auth_str2privs(const_cast<char*>(wide_to_narrow(ctx->parms[2]).c_str()));
if (newprivs == PRIV_INVALID) {
os<<L"-!- Invalid privileges specified";
return;
}
Player *tp = ctx->env->getPlayer(wide_to_narrow(ctx->parms[1]).c_str());
if(tp == NULL)
{
if (tp == NULL) {
os<<L"-!- No such player";
return;
}
@ -113,7 +119,7 @@ void cmd_grantrevoke(std::wostringstream &os,
msg += ctx->parms[2];
msg += L"\"";
ctx->server->notifyPlayer(playername.c_str(), msg);
} else {
}else{
privs &= ~newprivs;
actionstream<<ctx->player->getName()<<" revokes "
<<wide_to_narrow(ctx->parms[2])<<" from "
@ -130,7 +136,11 @@ void cmd_grantrevoke(std::wostringstream &os,
ctx->server->setPlayerAuthPrivs(playername, privs);
os<<L"-!- Privileges change to ";
os<<narrow_to_wide(privsToString(privs));
if (auth_privs2str(privs,buff,256) < 0) {
os<<L"???";
}else{
os<<narrow_to_wide(buff);
}
}
void cmd_time(std::wostringstream &os,

View File

@ -47,6 +47,7 @@ Sky::Sky(scene::ISceneNode* parent, scene::ISceneManager* mgr, s32 id):
m_skycolor_bright_f(1,0,0,0),
m_cloudcolor_bright_f(1,1,1,1)
{
char buff[1024];
setAutomaticCulling(scene::EAC_OFF);
Box.MaxEdge.set(0,0,0);
Box.MinEdge.set(0,0,0);
@ -68,11 +69,13 @@ Sky::Sky(scene::ISceneNode* parent, scene::ISceneManager* mgr, s32 id):
m_materials[1].MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
m_materials[2] = mat;
m_materials[2].setTexture(0, mgr->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<SKY_STAR_COUNT; i++) {

View File

@ -498,10 +498,10 @@ public:
bool loadSound(const std::string &name, const std::string &filepath, float gain)
{
std::string path = getPath("sound",filepath,true);
if (path == "")
char buff[1024];
if (!path_get((char*)"sound",const_cast<char*>(filepath.c_str()),1,buff,1024))
return false;
SoundBuffer *buf = loadOggFile(path);
SoundBuffer *buf = loadOggFile(buff);
if (buf == NULL)
return false;
buf->gain = gain;

290
src/thread.c Normal file
View File

@ -0,0 +1,290 @@
/************************************************************************
* file.c
* voxelands - 3d voxel world sandbox game
* Copyright (C) Lisa 'darkrose' Milne 2016 <lisa@ltmnet.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 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 <http://www.gnu.org/licenses/>
************************************************************************/
#include "thread.h"
#include "list.h"
#include "array.h"
#include <stdlib.h>
#ifndef WIN32
#include <signal.h>
#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);
}
}

82
src/thread.h Normal file
View File

@ -0,0 +1,82 @@
#ifndef _THREAD_H_
#define _THREAD_H_
#ifdef __cplusplus
extern "C" {
#endif
#include "array.h"
#ifdef WIN32
#include <windows.h>
#else
#include <pthread.h>
#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

View File

@ -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 \""<<path
<<"\""<<std::endl;*/
video::IImage *image = driver->createImageFromFile(path.c_str());
video::IImage *image = NULL;
if (path_get((char*)"texture",const_cast<char*>(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 \""
<<part_of_name<<"\" from path \""<<path<<"\""
<<" while building texture"<<std::endl;
<<part_of_name<<"\" while building texture"<<std::endl;
infostream<<"generate_image(): Creating a dummy"
<<" image for \""<<part_of_name<<"\""<<std::endl;
@ -1144,7 +1141,9 @@ bool generate_image(std::string part_of_name, video::IImage *& baseimg,
It is an image with a number of cracking stages
horizontally tiled.
*/
video::IImage *img_crack = driver->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 \""<<filename
<<"\" to combined ("<<x<<","<<y<<")"
<<std::endl;
video::IImage *img = driver->createImageFromFile(
getTexturePath(filename.c_str()).c_str());
if(img)
{
core::dimension2d<u32> dim = img->getDimension();
infostream<<"Size "<<dim.Width
<<"x"<<dim.Height<<std::endl;
core::position2d<s32> 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<s32>(v2s32(0,0), dim),
video::SColor(255,255,255,255),
NULL);
img2->drop();
}
else
{
infostream<<"img==NULL"<<std::endl;
if (path_get((char*)"texture",const_cast<char*>(filename.c_str()),1,buff,1024)) {
video::IImage *img = driver->createImageFromFile(buff);
if (img) {
core::dimension2d<u32> dim = img->getDimension();
infostream<<"Size "<<dim.Width
<<"x"<<dim.Height<<std::endl;
core::position2d<s32> 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<s32>(v2s32(0,0), dim),
video::SColor(255,255,255,255),
NULL);
img2->drop();
}else{
infostream<<"img==NULL"<<std::endl;
}
}
}
}
@ -1248,34 +1246,33 @@ bool generate_image(std::string part_of_name, video::IImage *& baseimg,
std::string filename = part_of_name.substr(9);
std::string path = getTexturePath(filename.c_str());
if (path_get((char*)"texture",const_cast<char*>(filename.c_str()),1,buff,1024)) {
infostream<<"generate_image(): Loading path \""<<path
<<"\""<<std::endl;
infostream<<"generate_image(): Loading path \""<<buff
<<"\""<<std::endl;
video::IImage *image = driver->createImageFromFile(path.c_str());
video::IImage *image = driver->createImageFromFile(buff);
if (image == NULL) {
infostream<<"generate_image(): Loading path \""
<<path<<"\" failed"<<std::endl;
}
else
{
core::dimension2d<u32> dim = image->getDimension();
baseimg = driver->createImage(video::ECF_A8R8G8B8, dim);
if (image == NULL) {
infostream<<"generate_image(): Loading path \""
<<buff<<"\" failed"<<std::endl;
}else{
core::dimension2d<u32> dim = image->getDimension();
baseimg = driver->createImage(video::ECF_A8R8G8B8, dim);
// Set alpha to full
for(u32 y=0; y<dim.Height; y++)
for(u32 x=0; x<dim.Width; x++)
{
video::SColor c = image->getPixel(x,y);
c.setAlpha(255);
image->setPixel(x,y,c);
// Set alpha to full
for(u32 y=0; y<dim.Height; y++)
for(u32 x=0; x<dim.Width; x++)
{
video::SColor c = image->getPixel(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<char*>(filename.c_str()),1,buff,1024)) {
infostream<<"generate_image(): Loading path \""<<path
<<"\""<<std::endl;
infostream<<"generate_image(): Loading path \""<<buff<<"\""<<std::endl;
video::IImage *image = driver->createImageFromFile(path.c_str());
video::IImage *image = driver->createImageFromFile(buff);
if(image == NULL)
{
infostream<<"generate_image(): Loading path \""
<<path<<"\" failed"<<std::endl;
}
else
{
core::dimension2d<u32> dim = image->getDimension();
baseimg = driver->createImage(video::ECF_A8R8G8B8, dim);
if (image == NULL) {
infostream<<"generate_image(): Loading path \""
<<buff<<"\" failed"<<std::endl;
}else{
core::dimension2d<u32> 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; y<dim.Height; y++)
for(u32 x=0; x<dim.Width; x++)
{
video::SColor c = baseimg->getPixel(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; y<dim.Height; y++)
for(u32 x=0; x<dim.Width; x++)
{
video::SColor c = baseimg->getPixel(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<char*>(filename.c_str()),1,buff,1024)) {
infostream<<"generate_image(): Loading path \""<<path
<<"\""<<std::endl;
infostream<<"generate_image(): Loading path \""<<buff<<"\""<<std::endl;
video::IImage *image = driver->createImageFromFile(path.c_str());
video::IImage *image = driver->createImageFromFile(buff);
if(image == NULL)
{
infostream<<"generate_image(): Loading path \""
<<path<<"\" failed"<<std::endl;
}
else
{
core::dimension2d<u32> dim = image->getDimension();
baseimg = driver->createImage(video::ECF_A8R8G8B8, dim);
if (image == NULL) {
infostream<<"generate_image(): Loading path \""
<<buff<<"\" failed"<<std::endl;
}else{
core::dimension2d<u32> 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; y<dim.Height; y++)
for(u32 x=0; x<dim.Width; x++)
{
video::SColor c = baseimg->getPixel(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; y<dim.Height; y++)
for(u32 x=0; x<dim.Width; x++)
{
video::SColor c = baseimg->getPixel(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<char*>(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: \""<<part_of_name<<"\""<<std::endl;
}