remove _ascii and undeprecate conversions from string literals
This commit is contained in:
parent
e317164c2b
commit
6aeb0aa74b
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
struct LocaleEN : public Locale
|
struct LocaleEN : public Locale
|
||||||
{
|
{
|
||||||
String GetName() const { return "English"_ascii; }
|
String GetName() const { return "English"; }
|
||||||
|
|
||||||
size_t GetPluralIndex(size_t n) const
|
size_t GetPluralIndex(size_t n) const
|
||||||
{
|
{
|
||||||
@ -17,8 +17,8 @@ struct LocaleEN : public Locale
|
|||||||
using i18n::translation;
|
using i18n::translation;
|
||||||
using i18n::pluralForm;
|
using i18n::pluralForm;
|
||||||
|
|
||||||
pluralForm("save") = {"save"_ascii, "saves"_ascii};
|
pluralForm("save") = {"save", "saves"};
|
||||||
pluralForm("stamp") = {"stamp"_ascii, "stamps"_ascii};
|
pluralForm("stamp") = {"stamp", "stamps"};
|
||||||
}
|
}
|
||||||
|
|
||||||
String GetIntroText() const
|
String GetIntroText() const
|
||||||
|
@ -687,7 +687,7 @@ int main(int argc, char * argv[])
|
|||||||
}
|
}
|
||||||
#endif // I18N_DEBUG
|
#endif // I18N_DEBUG
|
||||||
|
|
||||||
String localeName = Client::Ref().GetPrefString("Locale", ""_ascii);
|
String localeName = Client::Ref().GetPrefString("Locale", "");
|
||||||
currentLocale = locales[0];
|
currentLocale = locales[0];
|
||||||
for(Locale const *locale : locales)
|
for(Locale const *locale : locales)
|
||||||
if(locale->GetName() == localeName)
|
if(locale->GetName() == localeName)
|
||||||
@ -733,7 +733,7 @@ int main(int argc, char * argv[])
|
|||||||
Client::Ref().SetPref("Proxy", arguments["proxy"]);
|
Client::Ref().SetPref("Proxy", arguments["proxy"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(Client::Ref().GetPrefString("Proxy", ""_ascii).length())
|
else if(Client::Ref().GetPrefString("Proxy", "").length())
|
||||||
{
|
{
|
||||||
proxyString = (Client::Ref().GetPrefByteString("Proxy", ""));
|
proxyString = (Client::Ref().GetPrefByteString("Proxy", ""));
|
||||||
}
|
}
|
||||||
|
@ -648,7 +648,7 @@ std::vector<std::pair<String, ByteString> > Client::GetServerNotifications()
|
|||||||
|
|
||||||
RequestStatus Client::ParseServerReturn(ByteString &result, int status, bool json)
|
RequestStatus Client::ParseServerReturn(ByteString &result, int status, bool json)
|
||||||
{
|
{
|
||||||
lastError = ""_ascii;
|
lastError = "";
|
||||||
// no server response, return "Malformed Response"
|
// no server response, return "Malformed Response"
|
||||||
if (status == 200 && !result.size())
|
if (status == 200 && !result.size())
|
||||||
{
|
{
|
||||||
@ -957,7 +957,7 @@ User Client::GetAuthUser()
|
|||||||
|
|
||||||
RequestStatus Client::UploadSave(SaveInfo & save)
|
RequestStatus Client::UploadSave(SaveInfo & save)
|
||||||
{
|
{
|
||||||
lastError = ""_ascii;
|
lastError = "";
|
||||||
unsigned int gameDataLength;
|
unsigned int gameDataLength;
|
||||||
char * gameData = NULL;
|
char * gameData = NULL;
|
||||||
int dataStatus;
|
int dataStatus;
|
||||||
@ -1166,7 +1166,7 @@ std::vector<ByteString> Client::GetStamps(int start, int count)
|
|||||||
|
|
||||||
RequestStatus Client::ExecVote(int saveID, int direction)
|
RequestStatus Client::ExecVote(int saveID, int direction)
|
||||||
{
|
{
|
||||||
lastError = ""_ascii;
|
lastError = "";
|
||||||
int dataStatus;
|
int dataStatus;
|
||||||
ByteString data;
|
ByteString data;
|
||||||
|
|
||||||
@ -1190,7 +1190,7 @@ RequestStatus Client::ExecVote(int saveID, int direction)
|
|||||||
|
|
||||||
std::vector<unsigned char> Client::GetSaveData(int saveID, int saveDate)
|
std::vector<unsigned char> Client::GetSaveData(int saveID, int saveDate)
|
||||||
{
|
{
|
||||||
lastError = ""_ascii;
|
lastError = "";
|
||||||
int dataStatus;
|
int dataStatus;
|
||||||
ByteString data;
|
ByteString data;
|
||||||
ByteString urlStr;
|
ByteString urlStr;
|
||||||
@ -1212,7 +1212,7 @@ std::vector<unsigned char> Client::GetSaveData(int saveID, int saveDate)
|
|||||||
|
|
||||||
LoginStatus Client::Login(ByteString username, ByteString password, User & user)
|
LoginStatus Client::Login(ByteString username, ByteString password, User & user)
|
||||||
{
|
{
|
||||||
lastError = ""_ascii;
|
lastError = "";
|
||||||
char passwordHash[33];
|
char passwordHash[33];
|
||||||
char totalHash[33];
|
char totalHash[33];
|
||||||
|
|
||||||
@ -1222,10 +1222,10 @@ LoginStatus Client::Login(ByteString username, ByteString password, User & user)
|
|||||||
user.SessionKey = "";
|
user.SessionKey = "";
|
||||||
|
|
||||||
//Doop
|
//Doop
|
||||||
md5_ascii(passwordHash, (const unsigned char *)password.c_str(), password.length());
|
md5(passwordHash, (const unsigned char *)password.c_str(), password.length());
|
||||||
passwordHash[32] = 0;
|
passwordHash[32] = 0;
|
||||||
ByteString total = ByteString::Build(username, "-", passwordHash);
|
ByteString total = ByteString::Build(username, "-", passwordHash);
|
||||||
md5_ascii(totalHash, (const unsigned char *)(total.c_str()), total.size());
|
md5(totalHash, (const unsigned char *)(total.c_str()), total.size());
|
||||||
totalHash[32] = 0;
|
totalHash[32] = 0;
|
||||||
|
|
||||||
ByteString data;
|
ByteString data;
|
||||||
@ -1283,7 +1283,7 @@ LoginStatus Client::Login(ByteString username, ByteString password, User & user)
|
|||||||
|
|
||||||
RequestStatus Client::DeleteSave(int saveID)
|
RequestStatus Client::DeleteSave(int saveID)
|
||||||
{
|
{
|
||||||
lastError = ""_ascii;
|
lastError = "";
|
||||||
ByteString data;
|
ByteString data;
|
||||||
ByteString url = ByteString::Build(SCHEME, SERVER, "/Browse/Delete.json?ID=", saveID, "&Mode=Delete&Key=", authUser.SessionKey);
|
ByteString url = ByteString::Build(SCHEME, SERVER, "/Browse/Delete.json?ID=", saveID, "&Mode=Delete&Key=", authUser.SessionKey);
|
||||||
int dataStatus;
|
int dataStatus;
|
||||||
@ -1303,7 +1303,7 @@ RequestStatus Client::DeleteSave(int saveID)
|
|||||||
|
|
||||||
RequestStatus Client::AddComment(int saveID, String comment)
|
RequestStatus Client::AddComment(int saveID, String comment)
|
||||||
{
|
{
|
||||||
lastError = ""_ascii;
|
lastError = "";
|
||||||
ByteString data;
|
ByteString data;
|
||||||
int dataStatus;
|
int dataStatus;
|
||||||
ByteString url = ByteString::Build(SCHEME, SERVER, "/Browse/Comments.json?ID=", saveID);
|
ByteString url = ByteString::Build(SCHEME, SERVER, "/Browse/Comments.json?ID=", saveID);
|
||||||
@ -1325,7 +1325,7 @@ RequestStatus Client::AddComment(int saveID, String comment)
|
|||||||
|
|
||||||
RequestStatus Client::FavouriteSave(int saveID, bool favourite)
|
RequestStatus Client::FavouriteSave(int saveID, bool favourite)
|
||||||
{
|
{
|
||||||
lastError = ""_ascii;
|
lastError = "";
|
||||||
ByteStringBuilder urlStream;
|
ByteStringBuilder urlStream;
|
||||||
ByteString data;
|
ByteString data;
|
||||||
int dataStatus;
|
int dataStatus;
|
||||||
@ -1348,7 +1348,7 @@ RequestStatus Client::FavouriteSave(int saveID, bool favourite)
|
|||||||
|
|
||||||
RequestStatus Client::ReportSave(int saveID, String message)
|
RequestStatus Client::ReportSave(int saveID, String message)
|
||||||
{
|
{
|
||||||
lastError = ""_ascii;
|
lastError = "";
|
||||||
ByteString data;
|
ByteString data;
|
||||||
int dataStatus;
|
int dataStatus;
|
||||||
ByteString url = ByteString::Build(SCHEME, SERVER, "/Browse/Report.json?ID=", saveID, "&Key=", authUser.SessionKey);
|
ByteString url = ByteString::Build(SCHEME, SERVER, "/Browse/Report.json?ID=", saveID, "&Key=", authUser.SessionKey);
|
||||||
@ -1370,7 +1370,7 @@ RequestStatus Client::ReportSave(int saveID, String message)
|
|||||||
|
|
||||||
RequestStatus Client::UnpublishSave(int saveID)
|
RequestStatus Client::UnpublishSave(int saveID)
|
||||||
{
|
{
|
||||||
lastError = ""_ascii;
|
lastError = "";
|
||||||
ByteString data;
|
ByteString data;
|
||||||
int dataStatus;
|
int dataStatus;
|
||||||
ByteString url = ByteString::Build(SCHEME, SERVER, "/Browse/Delete.json?ID=", saveID, "&Mode=Unpublish&Key=", authUser.SessionKey);
|
ByteString url = ByteString::Build(SCHEME, SERVER, "/Browse/Delete.json?ID=", saveID, "&Mode=Unpublish&Key=", authUser.SessionKey);
|
||||||
@ -1390,7 +1390,7 @@ RequestStatus Client::UnpublishSave(int saveID)
|
|||||||
|
|
||||||
RequestStatus Client::PublishSave(int saveID)
|
RequestStatus Client::PublishSave(int saveID)
|
||||||
{
|
{
|
||||||
lastError = ""_ascii;
|
lastError = "";
|
||||||
ByteString data;
|
ByteString data;
|
||||||
int dataStatus;
|
int dataStatus;
|
||||||
ByteString url = ByteString::Build(SCHEME, SERVER, "/Browse/View.json?ID=", saveID, "&Key=", authUser.SessionKey);
|
ByteString url = ByteString::Build(SCHEME, SERVER, "/Browse/View.json?ID=", saveID, "&Key=", authUser.SessionKey);
|
||||||
@ -1412,7 +1412,7 @@ RequestStatus Client::PublishSave(int saveID)
|
|||||||
|
|
||||||
SaveInfo * Client::GetSave(int saveID, int saveDate)
|
SaveInfo * Client::GetSave(int saveID, int saveDate)
|
||||||
{
|
{
|
||||||
lastError = ""_ascii;
|
lastError = "";
|
||||||
ByteStringBuilder urlStream;
|
ByteStringBuilder urlStream;
|
||||||
urlStream << SCHEME << SERVER << "/Browse/View.json?ID=" << saveID;
|
urlStream << SCHEME << SERVER << "/Browse/View.json?ID=" << saveID;
|
||||||
if(saveDate)
|
if(saveDate)
|
||||||
@ -1501,7 +1501,7 @@ SaveFile * Client::LoadSaveFile(ByteString filename)
|
|||||||
|
|
||||||
std::vector<std::pair<ByteString, int> > * Client::GetTags(int start, int count, String query, int & resultCount)
|
std::vector<std::pair<ByteString, int> > * Client::GetTags(int start, int count, String query, int & resultCount)
|
||||||
{
|
{
|
||||||
lastError = ""_ascii;
|
lastError = "";
|
||||||
resultCount = 0;
|
resultCount = 0;
|
||||||
std::vector<std::pair<ByteString, int> > * tagArray = new std::vector<std::pair<ByteString, int> >();
|
std::vector<std::pair<ByteString, int> > * tagArray = new std::vector<std::pair<ByteString, int> >();
|
||||||
ByteStringBuilder urlStream;
|
ByteStringBuilder urlStream;
|
||||||
@ -1547,7 +1547,7 @@ std::vector<std::pair<ByteString, int> > * Client::GetTags(int start, int count,
|
|||||||
|
|
||||||
std::vector<SaveInfo*> * Client::SearchSaves(int start, int count, String query, ByteString sort, ByteString category, int & resultCount)
|
std::vector<SaveInfo*> * Client::SearchSaves(int start, int count, String query, ByteString sort, ByteString category, int & resultCount)
|
||||||
{
|
{
|
||||||
lastError = ""_ascii;
|
lastError = "";
|
||||||
resultCount = 0;
|
resultCount = 0;
|
||||||
std::vector<SaveInfo*> * saveArray = new std::vector<SaveInfo*>();
|
std::vector<SaveInfo*> * saveArray = new std::vector<SaveInfo*>();
|
||||||
ByteStringBuilder urlStream;
|
ByteStringBuilder urlStream;
|
||||||
@ -1617,7 +1617,7 @@ std::vector<SaveInfo*> * Client::SearchSaves(int start, int count, String query,
|
|||||||
|
|
||||||
std::list<ByteString> * Client::RemoveTag(int saveID, ByteString tag)
|
std::list<ByteString> * Client::RemoveTag(int saveID, ByteString tag)
|
||||||
{
|
{
|
||||||
lastError = ""_ascii;
|
lastError = "";
|
||||||
std::list<ByteString> * tags = NULL;
|
std::list<ByteString> * tags = NULL;
|
||||||
ByteString data;
|
ByteString data;
|
||||||
int dataStatus;
|
int dataStatus;
|
||||||
@ -1656,7 +1656,7 @@ std::list<ByteString> * Client::RemoveTag(int saveID, ByteString tag)
|
|||||||
|
|
||||||
std::list<ByteString> * Client::AddTag(int saveID, ByteString tag)
|
std::list<ByteString> * Client::AddTag(int saveID, ByteString tag)
|
||||||
{
|
{
|
||||||
lastError = ""_ascii;
|
lastError = "";
|
||||||
std::list<ByteString> * tags = NULL;
|
std::list<ByteString> * tags = NULL;
|
||||||
ByteString data;
|
ByteString data;
|
||||||
int dataStatus;
|
int dataStatus;
|
||||||
|
@ -35,7 +35,7 @@ public:
|
|||||||
int Build;
|
int Build;
|
||||||
int Time;
|
int Time;
|
||||||
BuildType Type;
|
BuildType Type;
|
||||||
UpdateInfo() : File(""), Changelog(""_ascii), Major(0), Minor(0), Build(0), Time(0), Type(Stable) {}
|
UpdateInfo() : File(""), Changelog(""), Major(0), Minor(0), Build(0), Time(0), Type(Stable) {}
|
||||||
UpdateInfo(int major, int minor, int build, ByteString file, String changelog, BuildType type) : File(file), Changelog(changelog), Major(major), Minor(minor), Build(build), Time(0), Type(type) {}
|
UpdateInfo(int major, int minor, int build, ByteString file, String changelog, BuildType type) : File(file), Changelog(changelog), Major(major), Minor(minor), Build(build), Time(0), Type(type) {}
|
||||||
UpdateInfo(int time, ByteString file, String changelog, BuildType type) : File(file), Changelog(changelog), Major(0), Minor(0), Build(0), Time(time), Type(type) {}
|
UpdateInfo(int time, ByteString file, String changelog, BuildType type) : File(file), Changelog(changelog), Major(0), Minor(0), Build(0), Time(time), Type(type) {}
|
||||||
};
|
};
|
||||||
|
@ -675,7 +675,7 @@ void GameSave::readOPS(char * data, int dataLength)
|
|||||||
bson_iterator signiter;
|
bson_iterator signiter;
|
||||||
bson_iterator_subiterator(&subiter, &signiter);
|
bson_iterator_subiterator(&subiter, &signiter);
|
||||||
|
|
||||||
sign tempSign(""_ascii, 0, 0, sign::Left);
|
sign tempSign("", 0, 0, sign::Left);
|
||||||
while (bson_iterator_next(&signiter))
|
while (bson_iterator_next(&signiter))
|
||||||
{
|
{
|
||||||
if (!strcmp(bson_iterator_key(&signiter), "text") && bson_iterator_type(&signiter) == BSON_STRING)
|
if (!strcmp(bson_iterator_key(&signiter), "text") && bson_iterator_type(&signiter) == BSON_STRING)
|
||||||
@ -683,13 +683,13 @@ void GameSave::readOPS(char * data, int dataLength)
|
|||||||
tempSign.text = format::CleanString(ByteString(bson_iterator_string(&signiter)).FromUtf8(), true, true, true).Substr(0, 45);
|
tempSign.text = format::CleanString(ByteString(bson_iterator_string(&signiter)).FromUtf8(), true, true, true).Substr(0, 45);
|
||||||
if (majorVersion < 94 || (majorVersion == 94 && minorVersion < 2))
|
if (majorVersion < 94 || (majorVersion == 94 && minorVersion < 2))
|
||||||
{
|
{
|
||||||
if (tempSign.text == "{t}"_ascii)
|
if (tempSign.text == "{t}")
|
||||||
{
|
{
|
||||||
tempSign.text = "Temp: {t}"_ascii;
|
tempSign.text = "Temp: {t}";
|
||||||
}
|
}
|
||||||
else if (tempSign.text == "{p}"_ascii)
|
else if (tempSign.text == "{p}")
|
||||||
{
|
{
|
||||||
tempSign.text = "Pressure: {p}"_ascii;
|
tempSign.text = "Pressure: {p}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -826,7 +826,7 @@ void GameSave::readOPS(char * data, int dataLength)
|
|||||||
if (major > SAVE_VERSION || (major == SAVE_VERSION && minor > MINOR_VERSION))
|
if (major > SAVE_VERSION || (major == SAVE_VERSION && minor > MINOR_VERSION))
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
String errorMessage = String::Build("Save from a newer version: Requires version "_i18n, major, "."_ascii, minor);
|
String errorMessage = String::Build("Save from a newer version: Requires version "_i18n, major, ".", minor);
|
||||||
throw ParseException(ParseException::WrongVersion, errorMessage);
|
throw ParseException(ParseException::WrongVersion, errorMessage);
|
||||||
}
|
}
|
||||||
#if defined(SNAPSHOT) || defined(DEBUG)
|
#if defined(SNAPSHOT) || defined(DEBUG)
|
||||||
@ -1358,7 +1358,7 @@ void GameSave::readPSv(char * saveDataChar, int dataLength)
|
|||||||
|
|
||||||
std::vector<sign> tempSigns;
|
std::vector<sign> tempSigns;
|
||||||
char tempSignText[255];
|
char tempSignText[255];
|
||||||
sign tempSign(""_ascii, 0, 0, sign::Left);
|
sign tempSign("", 0, 0, sign::Left);
|
||||||
|
|
||||||
//Gol data used to read older saves
|
//Gol data used to read older saves
|
||||||
std::vector<int> goltype = LoadGOLTypes();
|
std::vector<int> goltype = LoadGOLTypes();
|
||||||
@ -1979,13 +1979,13 @@ void GameSave::readPSv(char * saveDataChar, int dataLength)
|
|||||||
memcpy(tempSignText, data+p, x);
|
memcpy(tempSignText, data+p, x);
|
||||||
tempSignText[x] = 0;
|
tempSignText[x] = 0;
|
||||||
tempSign.text = format::CleanString(ByteString(tempSignText).FromUtf8(), true, true, true).Substr(0, 45);
|
tempSign.text = format::CleanString(ByteString(tempSignText).FromUtf8(), true, true, true).Substr(0, 45);
|
||||||
if (tempSign.text == "{t}"_ascii)
|
if (tempSign.text == "{t}")
|
||||||
{
|
{
|
||||||
tempSign.text = "Temp: {t}"_ascii;
|
tempSign.text = "Temp: {t}";
|
||||||
}
|
}
|
||||||
else if (tempSign.text == "{p}"_ascii)
|
else if (tempSign.text == "{p}")
|
||||||
{
|
{
|
||||||
tempSign.text = "Pressure: {p}"_ascii;
|
tempSign.text = "Pressure: {p}";
|
||||||
}
|
}
|
||||||
tempSigns.push_back(tempSign);
|
tempSigns.push_back(tempSign);
|
||||||
p += x;
|
p += x;
|
||||||
|
@ -209,7 +209,7 @@ void md5_transform(unsigned buf[4], const unsigned char inraw[64])
|
|||||||
}
|
}
|
||||||
|
|
||||||
static char hexChars[] = "0123456789abcdef";
|
static char hexChars[] = "0123456789abcdef";
|
||||||
void md5_ascii(char *result, unsigned char const *buf, unsigned len)
|
void md5(char *result, unsigned char const *buf, unsigned len)
|
||||||
{
|
{
|
||||||
struct md5_context md5;
|
struct md5_context md5;
|
||||||
unsigned char hash[16];
|
unsigned char hash[16];
|
||||||
|
@ -13,6 +13,6 @@ void md5_update(struct md5_context *context, unsigned char const *buf, unsigned
|
|||||||
void md5_final(unsigned char digest[16], struct md5_context *context);
|
void md5_final(unsigned char digest[16], struct md5_context *context);
|
||||||
void md5_transform(unsigned buf[4], const unsigned char in[64]);
|
void md5_transform(unsigned buf[4], const unsigned char in[64]);
|
||||||
|
|
||||||
void md5_ascii(char *result, unsigned char const *buf, unsigned len);
|
void md5(char *result, unsigned char const *buf, unsigned len);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -15,7 +15,7 @@ SaveFile::SaveFile(ByteString filename):
|
|||||||
gameSave(NULL),
|
gameSave(NULL),
|
||||||
filename(filename),
|
filename(filename),
|
||||||
displayName(filename.FromUtf8()),
|
displayName(filename.FromUtf8()),
|
||||||
loadingError(""_ascii)
|
loadingError("")
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ SaveInfo::SaveInfo(int _id, int _createdDate, int _updatedDate, int _votesUp, in
|
|||||||
Version(0),
|
Version(0),
|
||||||
userName(_userName),
|
userName(_userName),
|
||||||
name(_name),
|
name(_name),
|
||||||
Description(""_ascii),
|
Description(""),
|
||||||
Published(false),
|
Published(false),
|
||||||
tags(),
|
tags(),
|
||||||
gameSave(NULL)
|
gameSave(NULL)
|
||||||
|
@ -401,7 +401,7 @@ public:
|
|||||||
inline String(super &&other): super(std::move(other)) {}
|
inline String(super &&other): super(std::move(other)) {}
|
||||||
inline String(String const &other): super(other) {}
|
inline String(String const &other): super(other) {}
|
||||||
inline String(String &&other): super(std::move(other)) {}
|
inline String(String &&other): super(std::move(other)) {}
|
||||||
template<size_t N> [[deprecated]] inline String(ByteString::value_type const (&ch)[N]): super(ByteString(ch, N - 1).FromAscii()) {}
|
template<size_t N> inline String(ByteString::value_type const (&ch)[N]): super(ByteString(ch, N - 1).FromAscii()) {}
|
||||||
|
|
||||||
inline String &operator=(String const &other) { super::operator=(other); return *this; }
|
inline String &operator=(String const &other) { super::operator=(other); return *this; }
|
||||||
inline String &operator=(String &&other) { super::operator=(other); return *this; }
|
inline String &operator=(String &&other) { super::operator=(other); return *this; }
|
||||||
@ -549,26 +549,26 @@ inline String operator+(String::value_type lhs, String const &rhs) { return lhs
|
|||||||
inline String operator+(String::value_type lhs, String &&rhs) { return lhs + static_cast<std::basic_string<char32_t> &&>(rhs); }
|
inline String operator+(String::value_type lhs, String &&rhs) { return lhs + static_cast<std::basic_string<char32_t> &&>(rhs); }
|
||||||
inline String operator+(String::value_type const *lhs, String const &rhs) { return lhs + static_cast<std::basic_string<char32_t> const &>(rhs); }
|
inline String operator+(String::value_type const *lhs, String const &rhs) { return lhs + static_cast<std::basic_string<char32_t> const &>(rhs); }
|
||||||
inline String operator+(String::value_type const *lhs, String &&rhs) { return lhs + static_cast<std::basic_string<char32_t> &&>(rhs); }
|
inline String operator+(String::value_type const *lhs, String &&rhs) { return lhs + static_cast<std::basic_string<char32_t> &&>(rhs); }
|
||||||
template<size_t N> [[deprecated]] inline String operator+(String const &lhs, ByteString::value_type const (&rhs)[N]) { return static_cast<std::basic_string<char32_t> const &>(lhs) + ByteString(rhs).FromAscii(); }
|
template<size_t N> inline String operator+(String const &lhs, ByteString::value_type const (&rhs)[N]) { return static_cast<std::basic_string<char32_t> const &>(lhs) + ByteString(rhs).FromAscii(); }
|
||||||
template<size_t N> [[deprecated]] inline String operator+(String &&lhs, ByteString::value_type const (&rhs)[N]) { return static_cast<std::basic_string<char32_t> &&>(lhs) + ByteString(rhs).FromAscii(); }
|
template<size_t N> inline String operator+(String &&lhs, ByteString::value_type const (&rhs)[N]) { return static_cast<std::basic_string<char32_t> &&>(lhs) + ByteString(rhs).FromAscii(); }
|
||||||
template<size_t N> [[deprecated]] inline String operator+(ByteString::value_type const (&lhs)[N], String const &rhs) { return ByteString(lhs).FromAscii() + static_cast<std::basic_string<char32_t> const &>(rhs); }
|
template<size_t N> inline String operator+(ByteString::value_type const (&lhs)[N], String const &rhs) { return ByteString(lhs).FromAscii() + static_cast<std::basic_string<char32_t> const &>(rhs); }
|
||||||
template<size_t N> [[deprecated]] inline String operator+(ByteString::value_type const (&lhs)[N], String &&rhs) { return ByteString(lhs).FromAscii() + static_cast<std::basic_string<char32_t> &&>(rhs); }
|
template<size_t N> inline String operator+(ByteString::value_type const (&lhs)[N], String &&rhs) { return ByteString(lhs).FromAscii() + static_cast<std::basic_string<char32_t> &&>(rhs); }
|
||||||
|
|
||||||
inline bool operator==(String const &lhs, String const &rhs) { return static_cast<std::basic_string<char32_t> const &>(lhs) == static_cast<std::basic_string<char32_t> const &>(rhs); }
|
inline bool operator==(String const &lhs, String const &rhs) { return static_cast<std::basic_string<char32_t> const &>(lhs) == static_cast<std::basic_string<char32_t> const &>(rhs); }
|
||||||
inline bool operator==(String const &lhs, std::basic_string<char32_t> const &rhs) { return static_cast<std::basic_string<char32_t> const &>(lhs) == rhs; }
|
inline bool operator==(String const &lhs, std::basic_string<char32_t> const &rhs) { return static_cast<std::basic_string<char32_t> const &>(lhs) == rhs; }
|
||||||
inline bool operator==(String const &lhs, String::value_type const *rhs) { return static_cast<std::basic_string<char32_t> const &>(lhs) == rhs; }
|
inline bool operator==(String const &lhs, String::value_type const *rhs) { return static_cast<std::basic_string<char32_t> const &>(lhs) == rhs; }
|
||||||
inline bool operator==(std::basic_string<char32_t> const &lhs, String const &rhs) { return lhs == static_cast<std::basic_string<char32_t> const &>(rhs); }
|
inline bool operator==(std::basic_string<char32_t> const &lhs, String const &rhs) { return lhs == static_cast<std::basic_string<char32_t> const &>(rhs); }
|
||||||
inline bool operator==(String::value_type const *lhs, String const &rhs) { return lhs == static_cast<std::basic_string<char32_t> const &>(rhs); }
|
inline bool operator==(String::value_type const *lhs, String const &rhs) { return lhs == static_cast<std::basic_string<char32_t> const &>(rhs); }
|
||||||
template<size_t N> [[deprecated]] inline bool operator==(String const &lhs, ByteString::value_type const (&rhs)[N]) { return static_cast<std::basic_string<char32_t> const &>(lhs) == ByteString(rhs).FromAscii(); }
|
template<size_t N> inline bool operator==(String const &lhs, ByteString::value_type const (&rhs)[N]) { return static_cast<std::basic_string<char32_t> const &>(lhs) == ByteString(rhs).FromAscii(); }
|
||||||
template<size_t N> [[deprecated]] inline bool operator==(ByteString::value_type const (&lhs)[N], String const &rhs) { return ByteString(lhs).FromAscii() == static_cast<std::basic_string<char32_t> const &>(rhs); }
|
template<size_t N> inline bool operator==(ByteString::value_type const (&lhs)[N], String const &rhs) { return ByteString(lhs).FromAscii() == static_cast<std::basic_string<char32_t> const &>(rhs); }
|
||||||
|
|
||||||
inline bool operator!=(String const &lhs, String const &rhs) { return static_cast<std::basic_string<char32_t> const &>(lhs) != static_cast<std::basic_string<char32_t> const &>(rhs); }
|
inline bool operator!=(String const &lhs, String const &rhs) { return static_cast<std::basic_string<char32_t> const &>(lhs) != static_cast<std::basic_string<char32_t> const &>(rhs); }
|
||||||
inline bool operator!=(String const &lhs, std::basic_string<char32_t> const &rhs) { return static_cast<std::basic_string<char32_t> const &>(lhs) != rhs; }
|
inline bool operator!=(String const &lhs, std::basic_string<char32_t> const &rhs) { return static_cast<std::basic_string<char32_t> const &>(lhs) != rhs; }
|
||||||
inline bool operator!=(String const &lhs, String::value_type const *rhs) { return static_cast<std::basic_string<char32_t> const &>(lhs) != rhs; }
|
inline bool operator!=(String const &lhs, String::value_type const *rhs) { return static_cast<std::basic_string<char32_t> const &>(lhs) != rhs; }
|
||||||
inline bool operator!=(std::basic_string<char32_t> const &lhs, String const &rhs) { return lhs != static_cast<std::basic_string<char32_t> const &>(rhs); }
|
inline bool operator!=(std::basic_string<char32_t> const &lhs, String const &rhs) { return lhs != static_cast<std::basic_string<char32_t> const &>(rhs); }
|
||||||
inline bool operator!=(String::value_type const *lhs, String const &rhs) { return lhs != static_cast<std::basic_string<char32_t> const &>(rhs); }
|
inline bool operator!=(String::value_type const *lhs, String const &rhs) { return lhs != static_cast<std::basic_string<char32_t> const &>(rhs); }
|
||||||
template<size_t N> [[deprecated]] inline bool operator!=(String const &lhs, ByteString::value_type const (&rhs)[N]) { return static_cast<std::basic_string<char32_t> const &>(lhs) != ByteString(rhs).FromAscii(); }
|
template<size_t N> inline bool operator!=(String const &lhs, ByteString::value_type const (&rhs)[N]) { return static_cast<std::basic_string<char32_t> const &>(lhs) != ByteString(rhs).FromAscii(); }
|
||||||
template<size_t N> [[deprecated]] inline bool operator!=(ByteString::value_type const (&lhs)[N], String const &rhs) { return ByteString(lhs).FromAscii() != static_cast<std::basic_string<char32_t> const &>(rhs); }
|
template<size_t N> inline bool operator!=(ByteString::value_type const (&lhs)[N], String const &rhs) { return ByteString(lhs).FromAscii() != static_cast<std::basic_string<char32_t> const &>(rhs); }
|
||||||
|
|
||||||
inline String ByteString::FromAscii() const
|
inline String ByteString::FromAscii() const
|
||||||
{
|
{
|
||||||
@ -673,7 +673,7 @@ StringBuilder &operator<<(StringBuilder &, String::value_type const *);
|
|||||||
StringBuilder &operator<<(StringBuilder &, String const &);
|
StringBuilder &operator<<(StringBuilder &, String const &);
|
||||||
StringBuilder &operator<<(StringBuilder &, float);
|
StringBuilder &operator<<(StringBuilder &, float);
|
||||||
StringBuilder &operator<<(StringBuilder &, double);
|
StringBuilder &operator<<(StringBuilder &, double);
|
||||||
template<size_t N> [[deprecated]] StringBuilder &operator<<(StringBuilder &b, ByteString::value_type const (&data)[N]) { return b << ByteString(data).FromUtf8(); }
|
template<size_t N> StringBuilder &operator<<(StringBuilder &b, ByteString::value_type const (&data)[N]) { return b << ByteString(data).FromUtf8(); }
|
||||||
|
|
||||||
template<typename... Ts> String String::Build(Ts&&... args)
|
template<typename... Ts> String String::Build(Ts&&... args)
|
||||||
{
|
{
|
||||||
@ -682,7 +682,5 @@ template<typename... Ts> String String::Build(Ts&&... args)
|
|||||||
return b.Build();
|
return b.Build();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline String operator""_ascii(ByteString::value_type const *ch, size_t N) { return ByteString(ch, N).FromAscii(); }
|
|
||||||
|
|
||||||
#include "common/Format.h"
|
#include "common/Format.h"
|
||||||
#include "common/Internationalization.h"
|
#include "common/Internationalization.h"
|
||||||
|
@ -32,10 +32,10 @@ void DebugLines::Draw()
|
|||||||
g->draw_line(drawPoint2.X, 0, drawPoint2.X, YRES, 255, 255, 255, 120);
|
g->draw_line(drawPoint2.X, 0, drawPoint2.X, YRES, 255, 255, 255, 120);
|
||||||
|
|
||||||
String info;
|
String info;
|
||||||
info = String::Build(drawPoint2.X, " x "_ascii, drawPoint2.Y);
|
info = String::Build(drawPoint2.X, " x ", drawPoint2.Y);
|
||||||
g->drawtext_outline(drawPoint2.X+(drawPoint2.X>drawPoint1.X?3:-g->textwidth(info)-3), drawPoint2.Y+(drawPoint2.Y<drawPoint1.Y?-10:3), info, 255, 255, 255, 200);
|
g->drawtext_outline(drawPoint2.X+(drawPoint2.X>drawPoint1.X?3:-g->textwidth(info)-3), drawPoint2.Y+(drawPoint2.Y<drawPoint1.Y?-10:3), info, 255, 255, 255, 200);
|
||||||
|
|
||||||
info = String::Build(drawPoint1.X, " x "_ascii, drawPoint1.Y);
|
info = String::Build(drawPoint1.X, " x ", drawPoint1.Y);
|
||||||
g->drawtext_outline(drawPoint1.X+(drawPoint2.X<drawPoint1.X?3:-g->textwidth(info)-2), drawPoint1.Y+(drawPoint2.Y>drawPoint1.Y?-10:3), info, 255, 255, 255, 200);
|
g->drawtext_outline(drawPoint1.X+(drawPoint2.X<drawPoint1.X?3:-g->textwidth(info)-2), drawPoint1.Y+(drawPoint2.Y>drawPoint1.Y?-10:3), info, 255, 255, 255, 200);
|
||||||
|
|
||||||
info = String::Build(std::abs(drawPoint2.X-drawPoint1.X));
|
info = String::Build(std::abs(drawPoint2.X-drawPoint1.X));
|
||||||
|
@ -18,7 +18,7 @@ void DebugParts::Draw()
|
|||||||
Graphics * g = ui::Engine::Ref().g;
|
Graphics * g = ui::Engine::Ref().g;
|
||||||
|
|
||||||
int x = 0, y = 0, lpx = 0, lpy = 0;
|
int x = 0, y = 0, lpx = 0, lpy = 0;
|
||||||
String info = String::Build(sim->parts_lastActiveIndex, '/', NPART, " ("_ascii, Format::Precision((float)sim->parts_lastActiveIndex/(NPART)*100.0f, 2), "%)"_ascii);
|
String info = String::Build(sim->parts_lastActiveIndex, '/', NPART, " (", Format::Precision((float)sim->parts_lastActiveIndex/(NPART)*100.0f, 2), "%)");
|
||||||
for (int i = 0; i < NPART; i++)
|
for (int i = 0; i < NPART; i++)
|
||||||
{
|
{
|
||||||
if (sim->parts[i].type)
|
if (sim->parts[i].type)
|
||||||
|
@ -74,7 +74,7 @@ void ElementPopulationDebug::Draw()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
g->drawtext(xStart + bars + 5, yBottom-5, "0"_ascii, 255, 255, 255, 255);
|
g->drawtext(xStart + bars + 5, yBottom-5, "0", 255, 255, 255, 255);
|
||||||
g->drawtext(xStart + bars + 5, yBottom-132, halfValString, 255, 255, 255, 255);
|
g->drawtext(xStart + bars + 5, yBottom-132, halfValString, 255, 255, 255, 255);
|
||||||
g->drawtext(xStart + bars + 5, yBottom-260, maxValString, 255, 255, 255, 255);
|
g->drawtext(xStart + bars + 5, yBottom-260, maxValString, 255, 255, 255, 255);
|
||||||
}
|
}
|
||||||
|
@ -592,7 +592,7 @@ void Graphics::textnpos(String str, int n, int w, int *cx, int *cy)
|
|||||||
while (*s&&n)
|
while (*s&&n)
|
||||||
{
|
{
|
||||||
wordlen = 0;
|
wordlen = 0;
|
||||||
while(*s && String(" .,!?\n"_ascii).Contains(*s))
|
while(*s && String(" .,!?\n").Contains(*s))
|
||||||
s++;
|
s++;
|
||||||
charspace = textwidthx(s, w-x);
|
charspace = textwidthx(s, w-x);
|
||||||
if (charspace<wordlen && wordlen && w-x<w/3)
|
if (charspace<wordlen && wordlen && w-x<w/3)
|
||||||
@ -653,7 +653,7 @@ int Graphics::textwrapheight(String str, int width)
|
|||||||
while (*s)
|
while (*s)
|
||||||
{
|
{
|
||||||
wordlen = 0;
|
wordlen = 0;
|
||||||
while(*s && String(" .,!?\n"_ascii).Contains(*s))
|
while(*s && String(" .,!?\n").Contains(*s))
|
||||||
s++;
|
s++;
|
||||||
charspace = textwidthx(s, width-x);
|
charspace = textwidthx(s, width-x);
|
||||||
if (charspace<wordlen && wordlen && width-x<width/3)
|
if (charspace<wordlen && wordlen && width-x<width/3)
|
||||||
|
@ -39,31 +39,31 @@ ColourPickerActivity::ColourPickerActivity(ui::Colour initialColour, OnPicked on
|
|||||||
UpdateTextboxes(r, g, b, alpha);
|
UpdateTextboxes(r, g, b, alpha);
|
||||||
};
|
};
|
||||||
|
|
||||||
rValue = new ui::Textbox(ui::Point(5, Size.Y-23), ui::Point(30, 17), "255"_ascii);
|
rValue = new ui::Textbox(ui::Point(5, Size.Y-23), ui::Point(30, 17), "255");
|
||||||
rValue->SetActionCallback({ colourChange });
|
rValue->SetActionCallback({ colourChange });
|
||||||
rValue->SetLimit(3);
|
rValue->SetLimit(3);
|
||||||
rValue->SetInputType(ui::Textbox::Number);
|
rValue->SetInputType(ui::Textbox::Number);
|
||||||
AddComponent(rValue);
|
AddComponent(rValue);
|
||||||
|
|
||||||
gValue = new ui::Textbox(ui::Point(40, Size.Y-23), ui::Point(30, 17), "255"_ascii);
|
gValue = new ui::Textbox(ui::Point(40, Size.Y-23), ui::Point(30, 17), "255");
|
||||||
gValue->SetActionCallback({ colourChange });
|
gValue->SetActionCallback({ colourChange });
|
||||||
gValue->SetLimit(3);
|
gValue->SetLimit(3);
|
||||||
gValue->SetInputType(ui::Textbox::Number);
|
gValue->SetInputType(ui::Textbox::Number);
|
||||||
AddComponent(gValue);
|
AddComponent(gValue);
|
||||||
|
|
||||||
bValue = new ui::Textbox(ui::Point(75, Size.Y-23), ui::Point(30, 17), "255"_ascii);
|
bValue = new ui::Textbox(ui::Point(75, Size.Y-23), ui::Point(30, 17), "255");
|
||||||
bValue->SetActionCallback({ colourChange });
|
bValue->SetActionCallback({ colourChange });
|
||||||
bValue->SetLimit(3);
|
bValue->SetLimit(3);
|
||||||
bValue->SetInputType(ui::Textbox::Number);
|
bValue->SetInputType(ui::Textbox::Number);
|
||||||
AddComponent(bValue);
|
AddComponent(bValue);
|
||||||
|
|
||||||
aValue = new ui::Textbox(ui::Point(110, Size.Y-23), ui::Point(30, 17), "255"_ascii);
|
aValue = new ui::Textbox(ui::Point(110, Size.Y-23), ui::Point(30, 17), "255");
|
||||||
aValue->SetActionCallback({ colourChange });
|
aValue->SetActionCallback({ colourChange });
|
||||||
aValue->SetLimit(3);
|
aValue->SetLimit(3);
|
||||||
aValue->SetInputType(ui::Textbox::Number);
|
aValue->SetInputType(ui::Textbox::Number);
|
||||||
AddComponent(aValue);
|
AddComponent(aValue);
|
||||||
|
|
||||||
hexValue = new::ui::Label(ui::Point(150, Size.Y-23), ui::Point(53, 17), "0xFFFFFFFF"_ascii);
|
hexValue = new::ui::Label(ui::Point(150, Size.Y-23), ui::Point(53, 17), "0xFFFFFFFF");
|
||||||
AddComponent(hexValue);
|
AddComponent(hexValue);
|
||||||
|
|
||||||
ui::Button * doneButton = new ui::Button(ui::Point(Size.X-45, Size.Y-23), ui::Point(40, 17), "Done"_i18n);
|
ui::Button * doneButton = new ui::Button(ui::Point(Size.X-45, Size.Y-23), ui::Point(40, 17), "Done"_i18n);
|
||||||
|
@ -23,7 +23,7 @@ void ConsoleController::EvaluateCommand(String command)
|
|||||||
{
|
{
|
||||||
if(command.length())
|
if(command.length())
|
||||||
{
|
{
|
||||||
if (command.BeginsWith("!load "_ascii))
|
if (command.BeginsWith("!load "))
|
||||||
CloseConsole();
|
CloseConsole();
|
||||||
int returnCode = commandInterface->Command(command);
|
int returnCode = commandInterface->Command(command);
|
||||||
consoleModel->AddLastCommand(ConsoleCommand(command, returnCode, commandInterface->GetLastError()));
|
consoleModel->AddLastCommand(ConsoleCommand(command, returnCode, commandInterface->GetLastError()));
|
||||||
|
@ -10,7 +10,7 @@ ConsoleModel::ConsoleModel() {
|
|||||||
{
|
{
|
||||||
if(previousCommands.size()<25)
|
if(previousCommands.size()<25)
|
||||||
{
|
{
|
||||||
previousCommands.push_front(ConsoleCommand(*iter, 0, ""_ascii));
|
previousCommands.push_front(ConsoleCommand(*iter, 0, ""));
|
||||||
currentCommandIndex = previousCommands.size();
|
currentCommandIndex = previousCommands.size();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -37,7 +37,7 @@ ConsoleCommand ConsoleModel::GetCurrentCommand()
|
|||||||
{
|
{
|
||||||
if (currentCommandIndex >= previousCommands.size())
|
if (currentCommandIndex >= previousCommands.size())
|
||||||
{
|
{
|
||||||
return ConsoleCommand(""_ascii, 0, ""_ascii);
|
return ConsoleCommand("", 0, "");
|
||||||
}
|
}
|
||||||
return previousCommands[currentCommandIndex];
|
return previousCommands[currentCommandIndex];
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ ConsoleView::ConsoleView():
|
|||||||
ui::Window(ui::Point(0, 0), ui::Point(WINDOWW, 150)),
|
ui::Window(ui::Point(0, 0), ui::Point(WINDOWW, 150)),
|
||||||
commandField(NULL)
|
commandField(NULL)
|
||||||
{
|
{
|
||||||
commandField = new ui::Textbox(ui::Point(0, Size.Y-16), ui::Point(Size.X, 16), ""_ascii);
|
commandField = new ui::Textbox(ui::Point(0, Size.Y-16), ui::Point(Size.X, 16), "");
|
||||||
commandField->Appearance.HorizontalAlign = ui::Appearance::AlignLeft;
|
commandField->Appearance.HorizontalAlign = ui::Appearance::AlignLeft;
|
||||||
commandField->Appearance.VerticalAlign = ui::Appearance::AlignMiddle;
|
commandField->Appearance.VerticalAlign = ui::Appearance::AlignMiddle;
|
||||||
commandField->SetActionCallback({ [this] { commandField->SetDisplayText(c->FormatCommand(commandField->GetText())); } });
|
commandField->SetActionCallback({ [this] { commandField->SetDisplayText(c->FormatCommand(commandField->GetText())); } });
|
||||||
@ -41,8 +41,8 @@ void ConsoleView::DoKeyPress(int key, int scan, bool repeat, bool shift, bool ct
|
|||||||
case SDLK_RETURN:
|
case SDLK_RETURN:
|
||||||
case SDLK_KP_ENTER:
|
case SDLK_KP_ENTER:
|
||||||
c->EvaluateCommand(commandField->GetText());
|
c->EvaluateCommand(commandField->GetText());
|
||||||
commandField->SetText(""_ascii);
|
commandField->SetText("");
|
||||||
commandField->SetDisplayText(""_ascii);
|
commandField->SetDisplayText("");
|
||||||
break;
|
break;
|
||||||
case SDLK_DOWN:
|
case SDLK_DOWN:
|
||||||
c->NextCommand();
|
c->NextCommand();
|
||||||
@ -62,7 +62,7 @@ void ConsoleView::DoKeyPress(int key, int scan, bool repeat, bool shift, bool ct
|
|||||||
|
|
||||||
void ConsoleView::DoTextInput(String text)
|
void ConsoleView::DoTextInput(String text)
|
||||||
{
|
{
|
||||||
if (text == "~"_ascii)
|
if (text == "~")
|
||||||
doClose = false;
|
doClose = false;
|
||||||
if (!doClose)
|
if (!doClose)
|
||||||
Window::DoTextInput(text);
|
Window::DoTextInput(text);
|
||||||
|
@ -20,7 +20,7 @@ ElementSearchActivity::ElementSearchActivity(GameController * gameController, st
|
|||||||
firstResult(NULL),
|
firstResult(NULL),
|
||||||
gameController(gameController),
|
gameController(gameController),
|
||||||
tools(tools),
|
tools(tools),
|
||||||
toolTip(""_ascii),
|
toolTip(""),
|
||||||
toolTipPresence(0),
|
toolTipPresence(0),
|
||||||
shiftPressed(false),
|
shiftPressed(false),
|
||||||
ctrlPressed(false),
|
ctrlPressed(false),
|
||||||
@ -33,7 +33,7 @@ ElementSearchActivity::ElementSearchActivity(GameController * gameController, st
|
|||||||
title->Appearance.HorizontalAlign = ui::Appearance::AlignLeft;
|
title->Appearance.HorizontalAlign = ui::Appearance::AlignLeft;
|
||||||
AddComponent(title);
|
AddComponent(title);
|
||||||
|
|
||||||
searchField = new ui::Textbox(ui::Point(8, 23), ui::Point(Size.X-16, 17), ""_ascii);
|
searchField = new ui::Textbox(ui::Point(8, 23), ui::Point(Size.X-16, 17), "");
|
||||||
searchField->SetActionCallback({ [this] { searchTools(searchField->GetText()); } });
|
searchField->SetActionCallback({ [this] { searchTools(searchField->GetText()); } });
|
||||||
searchField->Appearance.HorizontalAlign = ui::Appearance::AlignLeft;
|
searchField->Appearance.HorizontalAlign = ui::Appearance::AlignLeft;
|
||||||
AddComponent(searchField);
|
AddComponent(searchField);
|
||||||
@ -50,7 +50,7 @@ ElementSearchActivity::ElementSearchActivity(GameController * gameController, st
|
|||||||
AddComponent(okButton);
|
AddComponent(okButton);
|
||||||
AddComponent(closeButton);
|
AddComponent(closeButton);
|
||||||
|
|
||||||
searchTools(""_ascii);
|
searchTools("");
|
||||||
}
|
}
|
||||||
|
|
||||||
void ElementSearchActivity::searchTools(String query)
|
void ElementSearchActivity::searchTools(String query)
|
||||||
@ -143,7 +143,7 @@ void ElementSearchActivity::searchTools(String query)
|
|||||||
ToolButton * tempButton;
|
ToolButton * tempButton;
|
||||||
|
|
||||||
if(tempTexture)
|
if(tempTexture)
|
||||||
tempButton = new ToolButton(current+viewPosition, ui::Point(30, 18), ""_ascii, tool->GetIdentifier(), tool->GetDescription());
|
tempButton = new ToolButton(current+viewPosition, ui::Point(30, 18), "", tool->GetIdentifier(), tool->GetDescription());
|
||||||
else
|
else
|
||||||
tempButton = new ToolButton(current+viewPosition, ui::Point(30, 18), tool->GetName(), tool->GetIdentifier(), tool->GetDescription());
|
tempButton = new ToolButton(current+viewPosition, ui::Point(30, 18), tool->GetName(), tool->GetIdentifier(), tool->GetDescription());
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ FileBrowserActivity::FileBrowserActivity(ByteString directory, OnSelected onSele
|
|||||||
titleLabel->Appearance.VerticalAlign = ui::Appearance::AlignMiddle;
|
titleLabel->Appearance.VerticalAlign = ui::Appearance::AlignMiddle;
|
||||||
AddComponent(titleLabel);
|
AddComponent(titleLabel);
|
||||||
|
|
||||||
ui::Textbox * textField = new ui::Textbox(ui::Point(8, 25), ui::Point(Size.X-16, 16), ""_ascii, "[search]"_i18n);
|
ui::Textbox * textField = new ui::Textbox(ui::Point(8, 25), ui::Point(Size.X-16, 16), "", "[search]"_i18n);
|
||||||
textField->Appearance.VerticalAlign = ui::Appearance::AlignMiddle;
|
textField->Appearance.VerticalAlign = ui::Appearance::AlignMiddle;
|
||||||
textField->Appearance.HorizontalAlign = ui::Appearance::AlignLeft;
|
textField->Appearance.HorizontalAlign = ui::Appearance::AlignLeft;
|
||||||
textField->SetActionCallback({ [this, textField] { DoSearch(textField->GetText().ToUtf8()); } });
|
textField->SetActionCallback({ [this, textField] { DoSearch(textField->GetText().ToUtf8()); } });
|
||||||
@ -144,7 +144,7 @@ void FileBrowserActivity::SelectSave(SaveFile * file)
|
|||||||
void FileBrowserActivity::DeleteSave(SaveFile * file)
|
void FileBrowserActivity::DeleteSave(SaveFile * file)
|
||||||
{
|
{
|
||||||
auto deleteConfirm = i18nMulti("Are you sure you want to delete ", "?");
|
auto deleteConfirm = i18nMulti("Are you sure you want to delete ", "?");
|
||||||
String deleteMessage = deleteConfirm[0] + file->GetDisplayName() + ".cps"_ascii + deleteConfirm[1];
|
String deleteMessage = deleteConfirm[0] + file->GetDisplayName() + ".cps" + deleteConfirm[1];
|
||||||
if (ConfirmPrompt::Blocking("Delete Save"_i18n, deleteMessage))
|
if (ConfirmPrompt::Blocking("Delete Save"_i18n, deleteMessage))
|
||||||
{
|
{
|
||||||
remove(file->GetName().c_str());
|
remove(file->GetName().c_str());
|
||||||
@ -154,7 +154,7 @@ void FileBrowserActivity::DeleteSave(SaveFile * file)
|
|||||||
|
|
||||||
void FileBrowserActivity::RenameSave(SaveFile * file)
|
void FileBrowserActivity::RenameSave(SaveFile * file)
|
||||||
{
|
{
|
||||||
ByteString newName = TextPrompt::Blocking("Rename"_i18n, "Change save name"_i18n, file->GetDisplayName(), ""_ascii, 0).ToUtf8();
|
ByteString newName = TextPrompt::Blocking("Rename"_i18n, "Change save name"_i18n, file->GetDisplayName(), "", 0).ToUtf8();
|
||||||
if (newName.length())
|
if (newName.length())
|
||||||
{
|
{
|
||||||
newName = directory + PATH_SEP + newName + ".cps";
|
newName = directory + PATH_SEP + newName + ".cps";
|
||||||
|
@ -313,17 +313,17 @@ FontEditor::FontEditor(ByteString _dataFile):
|
|||||||
next->SetActionCallback({ [this] { NextChar(); } });
|
next->SetActionCallback({ [this] { NextChar(); } });
|
||||||
AddComponent(next);
|
AddComponent(next);
|
||||||
|
|
||||||
ui::Button *shrink = new ui::Button(ui::Point(currentX, baseline), ui::Point(17, 17), "><"_ascii);
|
ui::Button *shrink = new ui::Button(ui::Point(currentX, baseline), ui::Point(17, 17), "><");
|
||||||
currentX += 18;
|
currentX += 18;
|
||||||
shrink->SetActionCallback({ [this] { ShrinkChar(); } });
|
shrink->SetActionCallback({ [this] { ShrinkChar(); } });
|
||||||
AddComponent(shrink);
|
AddComponent(shrink);
|
||||||
|
|
||||||
ui::Button *grow = new ui::Button(ui::Point(currentX, baseline), ui::Point(17, 17), "<>"_ascii);
|
ui::Button *grow = new ui::Button(ui::Point(currentX, baseline), ui::Point(17, 17), "<>");
|
||||||
currentX += 18;
|
currentX += 18;
|
||||||
grow->SetActionCallback({ [this] { GrowChar(); } });
|
grow->SetActionCallback({ [this] { GrowChar(); } });
|
||||||
AddComponent(grow);
|
AddComponent(grow);
|
||||||
|
|
||||||
ui::Button *add = new ui::Button(ui::Point(currentX, baseline), ui::Point(36, 17), "Add"_ascii);
|
ui::Button *add = new ui::Button(ui::Point(currentX, baseline), ui::Point(36, 17), "Add");
|
||||||
currentX += 37;
|
currentX += 37;
|
||||||
add->SetActionCallback({ [this] {
|
add->SetActionCallback({ [this] {
|
||||||
if (fontWidths.find(currentChar) == fontWidths.end())
|
if (fontWidths.find(currentChar) == fontWidths.end())
|
||||||
@ -335,7 +335,7 @@ FontEditor::FontEditor(ByteString _dataFile):
|
|||||||
} });
|
} });
|
||||||
AddComponent(add);
|
AddComponent(add);
|
||||||
|
|
||||||
ui::Button *remove = new ui::Button(ui::Point(currentX, baseline), ui::Point(36, 17), "Remove"_ascii);
|
ui::Button *remove = new ui::Button(ui::Point(currentX, baseline), ui::Point(36, 17), "Remove");
|
||||||
currentX += 37;
|
currentX += 37;
|
||||||
remove->SetActionCallback({ [this] {
|
remove->SetActionCallback({ [this] {
|
||||||
if (fontWidths.find(currentChar) != fontWidths.end())
|
if (fontWidths.find(currentChar) != fontWidths.end())
|
||||||
@ -347,7 +347,7 @@ FontEditor::FontEditor(ByteString _dataFile):
|
|||||||
} });
|
} });
|
||||||
AddComponent(remove);
|
AddComponent(remove);
|
||||||
|
|
||||||
ui::Button *showGrid = new ui::Button(ui::Point(currentX, baseline), ui::Point(32, 17), "Grid"_ascii);
|
ui::Button *showGrid = new ui::Button(ui::Point(currentX, baseline), ui::Point(32, 17), "Grid");
|
||||||
currentX += 33;
|
currentX += 33;
|
||||||
showGrid->SetTogglable(true);
|
showGrid->SetTogglable(true);
|
||||||
showGrid->SetToggleState(grid);
|
showGrid->SetToggleState(grid);
|
||||||
@ -356,7 +356,7 @@ FontEditor::FontEditor(ByteString _dataFile):
|
|||||||
} });
|
} });
|
||||||
AddComponent(showGrid);
|
AddComponent(showGrid);
|
||||||
|
|
||||||
ui::Button *showRulers = new ui::Button(ui::Point(currentX, baseline), ui::Point(32, 17), "Rulers"_ascii);
|
ui::Button *showRulers = new ui::Button(ui::Point(currentX, baseline), ui::Point(32, 17), "Rulers");
|
||||||
currentX += 33;
|
currentX += 33;
|
||||||
showRulers->SetTogglable(true);
|
showRulers->SetTogglable(true);
|
||||||
showRulers->SetToggleState(rulers);
|
showRulers->SetToggleState(rulers);
|
||||||
@ -382,12 +382,12 @@ FontEditor::FontEditor(ByteString _dataFile):
|
|||||||
baseline += 18;
|
baseline += 18;
|
||||||
currentX = 1;
|
currentX = 1;
|
||||||
|
|
||||||
ui::Button *render = new ui::Button(ui::Point(currentX, baseline), ui::Point(50, 17), "Render"_ascii);
|
ui::Button *render = new ui::Button(ui::Point(currentX, baseline), ui::Point(50, 17), "Render");
|
||||||
currentX += 51;
|
currentX += 51;
|
||||||
render->SetActionCallback({ [this] { Render(); } });
|
render->SetActionCallback({ [this] { Render(); } });
|
||||||
AddComponent(render);
|
AddComponent(render);
|
||||||
|
|
||||||
savedButton = new ui::Button(ui::Point(currentX, baseline), ui::Point(50, 17), "Save"_ascii);
|
savedButton = new ui::Button(ui::Point(currentX, baseline), ui::Point(50, 17), "Save");
|
||||||
currentX += 51;
|
currentX += 51;
|
||||||
savedButton->SetTogglable(true);
|
savedButton->SetTogglable(true);
|
||||||
savedButton->SetToggleState(true);
|
savedButton->SetToggleState(true);
|
||||||
@ -398,7 +398,7 @@ FontEditor::FontEditor(ByteString _dataFile):
|
|||||||
|
|
||||||
ui::ScrollPanel *outputPanel = new ui::ScrollPanel(ui::Point(Size.X / 2, baseline), ui::Point(Size.X / 2, Size.Y - baseline));
|
ui::ScrollPanel *outputPanel = new ui::ScrollPanel(ui::Point(Size.X / 2, baseline), ui::Point(Size.X / 2, Size.Y - baseline));
|
||||||
AddComponent(outputPanel);
|
AddComponent(outputPanel);
|
||||||
StretchLabel *outputPreview = new StretchLabel(ui::Point(0, 0), ui::Point(Size.X / 2, 0), ""_ascii);
|
StretchLabel *outputPreview = new StretchLabel(ui::Point(0, 0), ui::Point(Size.X / 2, 0), "");
|
||||||
outputPreview->SetMultiline(true);
|
outputPreview->SetMultiline(true);
|
||||||
outputPreview->Appearance.HorizontalAlign = ui::Appearance::AlignLeft;
|
outputPreview->Appearance.HorizontalAlign = ui::Appearance::AlignLeft;
|
||||||
outputPreview->Appearance.VerticalAlign = ui::Appearance::AlignTop;
|
outputPreview->Appearance.VerticalAlign = ui::Appearance::AlignTop;
|
||||||
@ -454,9 +454,9 @@ FontEditor::FontEditor(ByteString _dataFile):
|
|||||||
if(p[0] < 0x20)
|
if(p[0] < 0x20)
|
||||||
p[0] = 0x20;
|
p[0] = 0x20;
|
||||||
if(p[0] == p[1])
|
if(p[0] == p[1])
|
||||||
input << p[0] << "\n"_ascii;
|
input << p[0] << "\n";
|
||||||
else
|
else
|
||||||
input << p[0] << ":"_ascii << p[1] << "\n"_ascii;
|
input << p[0] << ":" << p[1] << "\n";
|
||||||
}
|
}
|
||||||
inputPreview->SetText(input.Build());
|
inputPreview->SetText(input.Build());
|
||||||
textChangedCallback();
|
textChangedCallback();
|
||||||
@ -530,7 +530,7 @@ void FontEditor::OnDraw()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
g->drawtext(8, 8, "No character"_ascii, 255, 0, 0, 255);
|
g->drawtext(8, 8, "No character", 255, 0, 0, 255);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1403,7 +1403,7 @@ void GameController::OpenSaveWindow()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SaveInfo tempSave(0, 0, 0, 0, 0, gameModel->GetUser().Username, ""_ascii);
|
SaveInfo tempSave(0, 0, 0, 0, 0, gameModel->GetUser().Username, "");
|
||||||
tempSave.SetGameSave(gameSave);
|
tempSave.SetGameSave(gameSave);
|
||||||
new ServerSaveActivity(tempSave, [this](SaveInfo &save) {
|
new ServerSaveActivity(tempSave, [this](SaveInfo &save) {
|
||||||
save.SetVote(1);
|
save.SetVote(1);
|
||||||
@ -1441,7 +1441,7 @@ void GameController::SaveAsCurrent()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SaveInfo tempSave(0, 0, 0, 0, 0, gameModel->GetUser().Username, ""_ascii);
|
SaveInfo tempSave(0, 0, 0, 0, 0, gameModel->GetUser().Username, "");
|
||||||
tempSave.SetGameSave(gameSave);
|
tempSave.SetGameSave(gameSave);
|
||||||
new ServerSaveActivity(tempSave, true, [this](SaveInfo &save) { LoadSave(&save); });
|
new ServerSaveActivity(tempSave, true, [this](SaveInfo &save) { LoadSave(&save); });
|
||||||
}
|
}
|
||||||
@ -1498,7 +1498,7 @@ String GameController::ElementResolve(int type, int ctype)
|
|||||||
{
|
{
|
||||||
return gameModel->GetSimulation()->ElementResolve(type, ctype);
|
return gameModel->GetSimulation()->ElementResolve(type, ctype);
|
||||||
}
|
}
|
||||||
return ""_ascii;
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
String GameController::BasicParticleInfo(Particle const &sample_part)
|
String GameController::BasicParticleInfo(Particle const &sample_part)
|
||||||
@ -1507,7 +1507,7 @@ String GameController::BasicParticleInfo(Particle const &sample_part)
|
|||||||
{
|
{
|
||||||
return gameModel->GetSimulation()->BasicParticleInfo(sample_part);
|
return gameModel->GetSimulation()->BasicParticleInfo(sample_part);
|
||||||
}
|
}
|
||||||
return ""_ascii;
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameController::ReloadSim()
|
void GameController::ReloadSim()
|
||||||
|
@ -310,7 +310,7 @@ void GameModel::BuildMenus()
|
|||||||
//Build other menus from wall data
|
//Build other menus from wall data
|
||||||
for(int i = 0; i < UI_WALLCOUNT; i++)
|
for(int i = 0; i < UI_WALLCOUNT; i++)
|
||||||
{
|
{
|
||||||
Tool * tempTool = new WallTool(i, ""_ascii, sim->wtypes[i].descs, PIXR(sim->wtypes[i].colour), PIXG(sim->wtypes[i].colour), PIXB(sim->wtypes[i].colour), sim->wtypes[i].identifier, sim->wtypes[i].textureGen);
|
Tool * tempTool = new WallTool(i, "", sim->wtypes[i].descs, PIXR(sim->wtypes[i].colour), PIXG(sim->wtypes[i].colour), PIXB(sim->wtypes[i].colour), sim->wtypes[i].identifier, sim->wtypes[i].textureGen);
|
||||||
menuList[SC_WALL]->AddTool(tempTool);
|
menuList[SC_WALL]->AddTool(tempTool);
|
||||||
//sim->wtypes[i]
|
//sim->wtypes[i]
|
||||||
}
|
}
|
||||||
@ -330,19 +330,19 @@ void GameModel::BuildMenus()
|
|||||||
menuList[SC_TOOL]->AddTool(tempTool);
|
menuList[SC_TOOL]->AddTool(tempTool);
|
||||||
}
|
}
|
||||||
//Add special sign and prop tools
|
//Add special sign and prop tools
|
||||||
menuList[SC_TOOL]->AddTool(new WindTool(0, "WIND"_ascii, "Creates air movement."_i18n, 64, 64, 64, "DEFAULT_UI_WIND"));
|
menuList[SC_TOOL]->AddTool(new WindTool(0, "WIND", "Creates air movement."_i18n, 64, 64, 64, "DEFAULT_UI_WIND"));
|
||||||
menuList[SC_TOOL]->AddTool(new PropertyTool());
|
menuList[SC_TOOL]->AddTool(new PropertyTool());
|
||||||
menuList[SC_TOOL]->AddTool(new SignTool(this));
|
menuList[SC_TOOL]->AddTool(new SignTool(this));
|
||||||
menuList[SC_TOOL]->AddTool(new SampleTool(this));
|
menuList[SC_TOOL]->AddTool(new SampleTool(this));
|
||||||
|
|
||||||
//Add decoration tools to menu
|
//Add decoration tools to menu
|
||||||
menuList[SC_DECO]->AddTool(new DecorationTool(ren, DECO_ADD, "ADD"_ascii, "Colour blending: Add."_i18n, 0, 0, 0, "DEFAULT_DECOR_ADD"));
|
menuList[SC_DECO]->AddTool(new DecorationTool(ren, DECO_ADD, "ADD", "Colour blending: Add."_i18n, 0, 0, 0, "DEFAULT_DECOR_ADD"));
|
||||||
menuList[SC_DECO]->AddTool(new DecorationTool(ren, DECO_SUBTRACT, "SUB"_ascii, "Colour blending: Subtract."_i18n, 0, 0, 0, "DEFAULT_DECOR_SUB"));
|
menuList[SC_DECO]->AddTool(new DecorationTool(ren, DECO_SUBTRACT, "SUB", "Colour blending: Subtract."_i18n, 0, 0, 0, "DEFAULT_DECOR_SUB"));
|
||||||
menuList[SC_DECO]->AddTool(new DecorationTool(ren, DECO_MULTIPLY, "MUL"_ascii, "Colour blending: Multiply."_i18n, 0, 0, 0, "DEFAULT_DECOR_MUL"));
|
menuList[SC_DECO]->AddTool(new DecorationTool(ren, DECO_MULTIPLY, "MUL", "Colour blending: Multiply."_i18n, 0, 0, 0, "DEFAULT_DECOR_MUL"));
|
||||||
menuList[SC_DECO]->AddTool(new DecorationTool(ren, DECO_DIVIDE, "DIV"_ascii, "Colour blending: Divide."_i18n , 0, 0, 0, "DEFAULT_DECOR_DIV"));
|
menuList[SC_DECO]->AddTool(new DecorationTool(ren, DECO_DIVIDE, "DIV", "Colour blending: Divide."_i18n , 0, 0, 0, "DEFAULT_DECOR_DIV"));
|
||||||
menuList[SC_DECO]->AddTool(new DecorationTool(ren, DECO_SMUDGE, "SMDG"_ascii, "Smudge tool, blends surrounding deco together."_i18n, 0, 0, 0, "DEFAULT_DECOR_SMDG"));
|
menuList[SC_DECO]->AddTool(new DecorationTool(ren, DECO_SMUDGE, "SMDG", "Smudge tool, blends surrounding deco together."_i18n, 0, 0, 0, "DEFAULT_DECOR_SMDG"));
|
||||||
menuList[SC_DECO]->AddTool(new DecorationTool(ren, DECO_CLEAR, "CLR"_ascii, "Erase any set decoration."_i18n, 0, 0, 0, "DEFAULT_DECOR_CLR"));
|
menuList[SC_DECO]->AddTool(new DecorationTool(ren, DECO_CLEAR, "CLR", "Erase any set decoration."_i18n, 0, 0, 0, "DEFAULT_DECOR_CLR"));
|
||||||
menuList[SC_DECO]->AddTool(new DecorationTool(ren, DECO_DRAW, "SET"_ascii, "Draw decoration (No blending)."_i18n, 0, 0, 0, "DEFAULT_DECOR_SET"));
|
menuList[SC_DECO]->AddTool(new DecorationTool(ren, DECO_DRAW, "SET", "Draw decoration (No blending)."_i18n, 0, 0, 0, "DEFAULT_DECOR_SET"));
|
||||||
SetColourSelectorColour(colour); // update tool colors
|
SetColourSelectorColour(colour); // update tool colors
|
||||||
decoToolset[0] = GetToolFromIdentifier("DEFAULT_DECOR_SET");
|
decoToolset[0] = GetToolFromIdentifier("DEFAULT_DECOR_SET");
|
||||||
decoToolset[1] = GetToolFromIdentifier("DEFAULT_DECOR_CLR");
|
decoToolset[1] = GetToolFromIdentifier("DEFAULT_DECOR_CLR");
|
||||||
|
@ -180,16 +180,16 @@ GameView::GameView():
|
|||||||
lastMenu(-1),
|
lastMenu(-1),
|
||||||
|
|
||||||
toolTipPresence(0),
|
toolTipPresence(0),
|
||||||
toolTip(""_ascii),
|
toolTip(""),
|
||||||
isToolTipFadingIn(false),
|
isToolTipFadingIn(false),
|
||||||
toolTipPosition(-1, -1),
|
toolTipPosition(-1, -1),
|
||||||
infoTipPresence(0),
|
infoTipPresence(0),
|
||||||
infoTip(""_ascii),
|
infoTip(""),
|
||||||
buttonTipShow(0),
|
buttonTipShow(0),
|
||||||
buttonTip(""_ascii),
|
buttonTip(""),
|
||||||
isButtonTipFadingIn(false),
|
isButtonTipFadingIn(false),
|
||||||
introText(2048),
|
introText(2048),
|
||||||
introTextMessage(currentLocale->GetIntroText() + "\n\bt" BUILD_FLAVOR_STRING ""_ascii),
|
introTextMessage(currentLocale->GetIntroText() + "\n\bt" BUILD_FLAVOR_STRING ""),
|
||||||
|
|
||||||
doScreenshot(false),
|
doScreenshot(false),
|
||||||
screenshotIndex(0),
|
screenshotIndex(0),
|
||||||
@ -216,14 +216,14 @@ GameView::GameView():
|
|||||||
int currentX = 1;
|
int currentX = 1;
|
||||||
//Set up UI
|
//Set up UI
|
||||||
|
|
||||||
scrollBar = new ui::Button(ui::Point(0,YRES+21), ui::Point(XRES, 2), ""_ascii);
|
scrollBar = new ui::Button(ui::Point(0,YRES+21), ui::Point(XRES, 2), "");
|
||||||
scrollBar->Appearance.BorderHover = ui::Colour(200, 200, 200);
|
scrollBar->Appearance.BorderHover = ui::Colour(200, 200, 200);
|
||||||
scrollBar->Appearance.BorderActive = ui::Colour(200, 200, 200);
|
scrollBar->Appearance.BorderActive = ui::Colour(200, 200, 200);
|
||||||
scrollBar->Appearance.HorizontalAlign = ui::Appearance::AlignCentre;
|
scrollBar->Appearance.HorizontalAlign = ui::Appearance::AlignCentre;
|
||||||
scrollBar->Appearance.VerticalAlign = ui::Appearance::AlignMiddle;
|
scrollBar->Appearance.VerticalAlign = ui::Appearance::AlignMiddle;
|
||||||
AddComponent(scrollBar);
|
AddComponent(scrollBar);
|
||||||
|
|
||||||
searchButton = new ui::Button(ui::Point(currentX, Size.Y-16), ui::Point(17, 15), ""_ascii, "Find & open a simulation. Hold Ctrl to load offline saves."_i18n); //Open
|
searchButton = new ui::Button(ui::Point(currentX, Size.Y-16), ui::Point(17, 15), "", "Find & open a simulation. Hold Ctrl to load offline saves."_i18n); //Open
|
||||||
searchButton->SetIcon(IconOpen);
|
searchButton->SetIcon(IconOpen);
|
||||||
currentX+=18;
|
currentX+=18;
|
||||||
searchButton->SetTogglable(false);
|
searchButton->SetTogglable(false);
|
||||||
@ -231,18 +231,18 @@ GameView::GameView():
|
|||||||
if (CtrlBehaviour())
|
if (CtrlBehaviour())
|
||||||
c->OpenLocalBrowse();
|
c->OpenLocalBrowse();
|
||||||
else
|
else
|
||||||
c->OpenSearch(""_ascii);
|
c->OpenSearch("");
|
||||||
} });
|
} });
|
||||||
AddComponent(searchButton);
|
AddComponent(searchButton);
|
||||||
|
|
||||||
reloadButton = new ui::Button(ui::Point(currentX, Size.Y-16), ui::Point(17, 15), ""_ascii, "Reload the simulation"_i18n);
|
reloadButton = new ui::Button(ui::Point(currentX, Size.Y-16), ui::Point(17, 15), "", "Reload the simulation"_i18n);
|
||||||
reloadButton->SetIcon(IconReload);
|
reloadButton->SetIcon(IconReload);
|
||||||
reloadButton->Appearance.Margin.Left+=2;
|
reloadButton->Appearance.Margin.Left+=2;
|
||||||
currentX+=18;
|
currentX+=18;
|
||||||
reloadButton->SetActionCallback({ [this] { c->ReloadSim(); }, [this] { c->OpenSavePreview(); } });
|
reloadButton->SetActionCallback({ [this] { c->ReloadSim(); }, [this] { c->OpenSavePreview(); } });
|
||||||
AddComponent(reloadButton);
|
AddComponent(reloadButton);
|
||||||
|
|
||||||
saveSimulationButton = new SplitButton(ui::Point(currentX, Size.Y-16), ui::Point(150, 15), "[untitled simulation]"_i18n, ""_ascii, ""_ascii, 19);
|
saveSimulationButton = new SplitButton(ui::Point(currentX, Size.Y-16), ui::Point(150, 15), "[untitled simulation]"_i18n, "", "", 19);
|
||||||
saveSimulationButton->Appearance.HorizontalAlign = ui::Appearance::AlignLeft;
|
saveSimulationButton->Appearance.HorizontalAlign = ui::Appearance::AlignLeft;
|
||||||
saveSimulationButton->SetIcon(IconSave);
|
saveSimulationButton->SetIcon(IconSave);
|
||||||
currentX+=151;
|
currentX+=151;
|
||||||
@ -263,7 +263,7 @@ GameView::GameView():
|
|||||||
SetSaveButtonTooltips();
|
SetSaveButtonTooltips();
|
||||||
AddComponent(saveSimulationButton);
|
AddComponent(saveSimulationButton);
|
||||||
|
|
||||||
upVoteButton = new ui::Button(ui::Point(currentX, Size.Y-16), ui::Point(39, 15), ""_ascii, "Like this save"_i18n);
|
upVoteButton = new ui::Button(ui::Point(currentX, Size.Y-16), ui::Point(39, 15), "", "Like this save"_i18n);
|
||||||
upVoteButton->SetIcon(IconVoteUp);
|
upVoteButton->SetIcon(IconVoteUp);
|
||||||
upVoteButton->Appearance.Margin.Top+=2;
|
upVoteButton->Appearance.Margin.Top+=2;
|
||||||
upVoteButton->Appearance.Margin.Left+=2;
|
upVoteButton->Appearance.Margin.Left+=2;
|
||||||
@ -271,7 +271,7 @@ GameView::GameView():
|
|||||||
upVoteButton->SetActionCallback({ [this] { c->Vote(1); } });
|
upVoteButton->SetActionCallback({ [this] { c->Vote(1); } });
|
||||||
AddComponent(upVoteButton);
|
AddComponent(upVoteButton);
|
||||||
|
|
||||||
downVoteButton = new ui::Button(ui::Point(currentX, Size.Y-16), ui::Point(15, 15), ""_ascii, "Dislike this save"_i18n);
|
downVoteButton = new ui::Button(ui::Point(currentX, Size.Y-16), ui::Point(15, 15), "", "Dislike this save"_i18n);
|
||||||
downVoteButton->SetIcon(IconVoteDown);
|
downVoteButton->SetIcon(IconVoteDown);
|
||||||
downVoteButton->Appearance.Margin.Bottom+=2;
|
downVoteButton->Appearance.Margin.Bottom+=2;
|
||||||
downVoteButton->Appearance.Margin.Left+=2;
|
downVoteButton->Appearance.Margin.Left+=2;
|
||||||
@ -286,7 +286,7 @@ GameView::GameView():
|
|||||||
tagSimulationButton->SetActionCallback({ [this] { c->OpenTags(); } });
|
tagSimulationButton->SetActionCallback({ [this] { c->OpenTags(); } });
|
||||||
AddComponent(tagSimulationButton);
|
AddComponent(tagSimulationButton);
|
||||||
|
|
||||||
clearSimButton = new ui::Button(ui::Point(Size.X-159, Size.Y-16), ui::Point(17, 15), ""_ascii, "Erase everything"_i18n);
|
clearSimButton = new ui::Button(ui::Point(Size.X-159, Size.Y-16), ui::Point(17, 15), "", "Erase everything"_i18n);
|
||||||
clearSimButton->SetIcon(IconNew);
|
clearSimButton->SetIcon(IconNew);
|
||||||
clearSimButton->Appearance.Margin.Left+=2;
|
clearSimButton->Appearance.Margin.Left+=2;
|
||||||
clearSimButton->SetActionCallback({ [this] { c->ClearSim(); } });
|
clearSimButton->SetActionCallback({ [this] { c->ClearSim(); } });
|
||||||
@ -301,19 +301,19 @@ GameView::GameView():
|
|||||||
});
|
});
|
||||||
AddComponent(loginButton);
|
AddComponent(loginButton);
|
||||||
|
|
||||||
simulationOptionButton = new ui::Button(ui::Point(Size.X-48, Size.Y-16), ui::Point(15, 15), ""_ascii, "Simulation options"_i18n);
|
simulationOptionButton = new ui::Button(ui::Point(Size.X-48, Size.Y-16), ui::Point(15, 15), "", "Simulation options"_i18n);
|
||||||
simulationOptionButton->SetIcon(IconSimulationSettings);
|
simulationOptionButton->SetIcon(IconSimulationSettings);
|
||||||
simulationOptionButton->Appearance.Margin.Left+=2;
|
simulationOptionButton->Appearance.Margin.Left+=2;
|
||||||
simulationOptionButton->SetActionCallback({ [this] { c->OpenOptions(); } });
|
simulationOptionButton->SetActionCallback({ [this] { c->OpenOptions(); } });
|
||||||
AddComponent(simulationOptionButton);
|
AddComponent(simulationOptionButton);
|
||||||
|
|
||||||
displayModeButton = new ui::Button(ui::Point(Size.X-32, Size.Y-16), ui::Point(15, 15), ""_ascii, "Renderer options"_i18n);
|
displayModeButton = new ui::Button(ui::Point(Size.X-32, Size.Y-16), ui::Point(15, 15), "", "Renderer options"_i18n);
|
||||||
displayModeButton->SetIcon(IconRenderSettings);
|
displayModeButton->SetIcon(IconRenderSettings);
|
||||||
displayModeButton->Appearance.Margin.Left+=2;
|
displayModeButton->Appearance.Margin.Left+=2;
|
||||||
displayModeButton->SetActionCallback({ [this] { c->OpenRenderOptions(); } });
|
displayModeButton->SetActionCallback({ [this] { c->OpenRenderOptions(); } });
|
||||||
AddComponent(displayModeButton);
|
AddComponent(displayModeButton);
|
||||||
|
|
||||||
pauseButton = new ui::Button(ui::Point(Size.X-16, Size.Y-16), ui::Point(15, 15), ""_ascii, "Pause/Resume the simulation"_i18n); //Pause
|
pauseButton = new ui::Button(ui::Point(Size.X-16, Size.Y-16), ui::Point(15, 15), "", "Pause/Resume the simulation"_i18n); //Pause
|
||||||
pauseButton->SetIcon(IconPause);
|
pauseButton->SetIcon(IconPause);
|
||||||
pauseButton->SetTogglable(true);
|
pauseButton->SetTogglable(true);
|
||||||
pauseButton->SetActionCallback({ [this] { c->SetPaused(pauseButton->GetToggleState()); } });
|
pauseButton->SetActionCallback({ [this] { c->SetPaused(pauseButton->GetToggleState()); } });
|
||||||
@ -324,7 +324,7 @@ GameView::GameView():
|
|||||||
tempButton->SetActionCallback({ [this] { c->OpenElementSearch(); } });
|
tempButton->SetActionCallback({ [this] { c->OpenElementSearch(); } });
|
||||||
AddComponent(tempButton);
|
AddComponent(tempButton);
|
||||||
|
|
||||||
colourPicker = new ui::Button(ui::Point((XRES/2)-8, YRES+1), ui::Point(16, 16), ""_ascii, "Pick Colour"_i18n);
|
colourPicker = new ui::Button(ui::Point((XRES/2)-8, YRES+1), ui::Point(16, 16), "", "Pick Colour"_i18n);
|
||||||
colourPicker->SetActionCallback({ [this] { c->OpenColourPicker(); } });
|
colourPicker->SetActionCallback({ [this] { c->OpenColourPicker(); } });
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -411,7 +411,7 @@ void GameView::NotifyMenuListChanged(GameModel * sender)
|
|||||||
{
|
{
|
||||||
if (menuList[i]->GetVisible())
|
if (menuList[i]->GetVisible())
|
||||||
{
|
{
|
||||||
String tempString = ""_ascii;
|
String tempString = "";
|
||||||
tempString += menuList[i]->GetIcon();
|
tempString += menuList[i]->GetIcon();
|
||||||
String description = menuList[i]->GetDescription();
|
String description = menuList[i]->GetDescription();
|
||||||
if (i == SC_FAVORITES && !Favorite::Ref().AnyFavorites())
|
if (i == SC_FAVORITES && !Favorite::Ref().AnyFavorites())
|
||||||
@ -569,7 +569,7 @@ void GameView::NotifyToolListChanged(GameModel * sender)
|
|||||||
tempTexture = ((DecorationTool*)tool)->GetIcon(tool->GetToolID(), 26, 14);
|
tempTexture = ((DecorationTool*)tool)->GetIcon(tool->GetToolID(), 26, 14);
|
||||||
|
|
||||||
if(tempTexture)
|
if(tempTexture)
|
||||||
tempButton = new ToolButton(ui::Point(currentX, YRES+1), ui::Point(30, 18), ""_ascii, tool->GetIdentifier(), tool->GetDescription());
|
tempButton = new ToolButton(ui::Point(currentX, YRES+1), ui::Point(30, 18), "", tool->GetIdentifier(), tool->GetDescription());
|
||||||
else
|
else
|
||||||
tempButton = new ToolButton(ui::Point(currentX, YRES+1), ui::Point(30, 18), tool->GetName(), tool->GetIdentifier(), tool->GetDescription());
|
tempButton = new ToolButton(ui::Point(currentX, YRES+1), ui::Point(30, 18), tool->GetName(), tool->GetIdentifier(), tool->GetDescription());
|
||||||
|
|
||||||
@ -684,7 +684,7 @@ void GameView::NotifyColourPresetsChanged(GameModel * sender)
|
|||||||
int i = 0;
|
int i = 0;
|
||||||
for(std::vector<ui::Colour>::iterator iter = colours.begin(), end = colours.end(); iter != end; ++iter)
|
for(std::vector<ui::Colour>::iterator iter = colours.begin(), end = colours.end(); iter != end; ++iter)
|
||||||
{
|
{
|
||||||
ToolButton * tempButton = new ToolButton(ui::Point(currentX, YRES+1), ui::Point(30, 18), ""_ascii, "", "Decoration Presets."_i18n);
|
ToolButton * tempButton = new ToolButton(ui::Point(currentX, YRES+1), ui::Point(30, 18), "", "", "Decoration Presets."_i18n);
|
||||||
tempButton->Appearance.BackgroundInactive = *iter;
|
tempButton->Appearance.BackgroundInactive = *iter;
|
||||||
tempButton->SetActionCallback({ [this, i, tempButton] {
|
tempButton->SetActionCallback({ [this, i, tempButton] {
|
||||||
c->SetActiveColourPreset(i);
|
c->SetActiveColourPreset(i);
|
||||||
@ -816,7 +816,7 @@ void GameView::NotifySaveChanged(GameModel * sender)
|
|||||||
for (std::list<ByteString>::const_iterator iter = tags.begin(), begin = tags.begin(), end = tags.end(); iter != end; iter++)
|
for (std::list<ByteString>::const_iterator iter = tags.begin(), begin = tags.begin(), end = tags.end(); iter != end; iter++)
|
||||||
{
|
{
|
||||||
if (iter != begin)
|
if (iter != begin)
|
||||||
tagsStream << " "_ascii;
|
tagsStream << " ";
|
||||||
tagsStream << iter->FromUtf8();
|
tagsStream << iter->FromUtf8();
|
||||||
}
|
}
|
||||||
tagSimulationButton->SetText(tagsStream.Build());
|
tagSimulationButton->SetText(tagsStream.Build());
|
||||||
@ -2150,7 +2150,7 @@ void GameView::OnDraw()
|
|||||||
sampleInfo << c->ElementResolve(type, ctype);
|
sampleInfo << c->ElementResolve(type, ctype);
|
||||||
auto filtModes = i18nMulti("set colour", "AND", "OR", "subtract colour", "red shift", "blue shift", "no effect", "XOR", "NOT", "old QRTZ scattering", "variable red shift", "variable blue shift");
|
auto filtModes = i18nMulti("set colour", "AND", "OR", "subtract colour", "red shift", "blue shift", "no effect", "XOR", "NOT", "old QRTZ scattering", "variable red shift", "variable blue shift");
|
||||||
if (sample.particle.tmp>=0 && sample.particle.tmp<=11)
|
if (sample.particle.tmp>=0 && sample.particle.tmp<=11)
|
||||||
sampleInfo << " ("_ascii << filtModes[sample.particle.tmp] << ")"_ascii;
|
sampleInfo << " (" << filtModes[sample.particle.tmp] << ")";
|
||||||
else
|
else
|
||||||
sampleInfo << " (unknown mode)"_i18n;
|
sampleInfo << " (unknown mode)"_i18n;
|
||||||
}
|
}
|
||||||
@ -2158,14 +2158,14 @@ void GameView::OnDraw()
|
|||||||
{
|
{
|
||||||
sampleInfo << c->ElementResolve(type, ctype);
|
sampleInfo << c->ElementResolve(type, ctype);
|
||||||
if (wavelengthGfx)
|
if (wavelengthGfx)
|
||||||
sampleInfo << " ("_ascii << ctype << ")"_ascii;
|
sampleInfo << " (" << ctype << ")";
|
||||||
// Some elements store extra LIFE info in upper bits of ctype, instead of tmp/tmp2
|
// Some elements store extra LIFE info in upper bits of ctype, instead of tmp/tmp2
|
||||||
else if (type == PT_CRAY || type == PT_DRAY || type == PT_CONV)
|
else if (type == PT_CRAY || type == PT_DRAY || type == PT_CONV)
|
||||||
sampleInfo << " ("_ascii << c->ElementResolve(TYP(ctype), ID(ctype)) << ")"_ascii;
|
sampleInfo << " (" << c->ElementResolve(TYP(ctype), ID(ctype)) << ")";
|
||||||
else if (c->IsValidElement(ctype))
|
else if (c->IsValidElement(ctype))
|
||||||
sampleInfo << " ("_ascii << c->ElementResolve(ctype, -1) << ")"_ascii;
|
sampleInfo << " (" << c->ElementResolve(ctype, -1) << ")";
|
||||||
else
|
else
|
||||||
sampleInfo << " ()"_ascii;
|
sampleInfo << " ()";
|
||||||
}
|
}
|
||||||
sampleInfo << ", Temp: "_i18n << (sample.particle.temp - 273.15f) << " C"_i18n;
|
sampleInfo << ", Temp: "_i18n << (sample.particle.temp - 273.15f) << " C"_i18n;
|
||||||
sampleInfo << ", Life: "_i18n << sample.particle.life;
|
sampleInfo << ", Life: "_i18n << sample.particle.life;
|
||||||
@ -2176,7 +2176,7 @@ void GameView::OnDraw()
|
|||||||
String elemName = c->ElementResolve(
|
String elemName = c->ElementResolve(
|
||||||
TYP(sample.particle.tmp),
|
TYP(sample.particle.tmp),
|
||||||
ID(sample.particle.tmp));
|
ID(sample.particle.tmp));
|
||||||
if (elemName == ""_ascii)
|
if (elemName == "")
|
||||||
sampleInfo << ", Tmp: "_i18n << sample.particle.tmp;
|
sampleInfo << ", Tmp: "_i18n << sample.particle.tmp;
|
||||||
else
|
else
|
||||||
sampleInfo << ", Tmp: "_i18n << elemName;
|
sampleInfo << ", Tmp: "_i18n << elemName;
|
||||||
@ -2259,12 +2259,12 @@ void GameView::OnDraw()
|
|||||||
sampleInfo << Format::Precision(2);
|
sampleInfo << Format::Precision(2);
|
||||||
|
|
||||||
if (type)
|
if (type)
|
||||||
sampleInfo << "#"_ascii << sample.ParticleID << ", "_ascii;
|
sampleInfo << "#" << sample.ParticleID << ", ";
|
||||||
|
|
||||||
sampleInfo << "X:"_ascii << sample.PositionX << " Y:"_ascii << sample.PositionY;
|
sampleInfo << "X:" << sample.PositionX << " Y:" << sample.PositionY;
|
||||||
|
|
||||||
if (sample.Gravity)
|
if (sample.Gravity)
|
||||||
sampleInfo << ", GX: "_ascii << sample.GravityVelocityX << " GY: "_ascii << sample.GravityVelocityY;
|
sampleInfo << ", GX: " << sample.GravityVelocityX << " GY: " << sample.GravityVelocityY;
|
||||||
|
|
||||||
if (c->GetAHeatEnable())
|
if (c->GetAHeatEnable())
|
||||||
sampleInfo << ", AHeat: "_i18n << sample.AirTemperature - 273.15f << " C"_i18n;
|
sampleInfo << ", AHeat: "_i18n << sample.AirTemperature - 273.15f << " C"_i18n;
|
||||||
@ -2284,7 +2284,7 @@ void GameView::OnDraw()
|
|||||||
if (showDebug)
|
if (showDebug)
|
||||||
{
|
{
|
||||||
if (ren->findingElement)
|
if (ren->findingElement)
|
||||||
fpsInfo << " Parts: "_i18n << ren->foundElements << "/"_ascii << sample.NumParts;
|
fpsInfo << " Parts: "_i18n << ren->foundElements << "/" << sample.NumParts;
|
||||||
else
|
else
|
||||||
fpsInfo << " Parts: "_i18n << sample.NumParts;
|
fpsInfo << " Parts: "_i18n << sample.NumParts;
|
||||||
}
|
}
|
||||||
|
@ -69,10 +69,10 @@ sim(sim_)
|
|||||||
}
|
}
|
||||||
property->SetOption(Client::Ref().GetPrefInteger("Prop.Type", 0));
|
property->SetOption(Client::Ref().GetPrefInteger("Prop.Type", 0));
|
||||||
|
|
||||||
textField = new ui::Textbox(ui::Point(8, 46), ui::Point(Size.X-16, 16), ""_ascii, "[value]"_i18n);
|
textField = new ui::Textbox(ui::Point(8, 46), ui::Point(Size.X-16, 16), "", "[value]"_i18n);
|
||||||
textField->Appearance.HorizontalAlign = ui::Appearance::AlignLeft;
|
textField->Appearance.HorizontalAlign = ui::Appearance::AlignLeft;
|
||||||
textField->Appearance.VerticalAlign = ui::Appearance::AlignMiddle;
|
textField->Appearance.VerticalAlign = ui::Appearance::AlignMiddle;
|
||||||
textField->SetText(Client::Ref().GetPrefString("Prop.Value", ""_ascii));
|
textField->SetText(Client::Ref().GetPrefString("Prop.Value", ""));
|
||||||
AddComponent(textField);
|
AddComponent(textField);
|
||||||
FocusComponent(textField);
|
FocusComponent(textField);
|
||||||
|
|
||||||
@ -91,12 +91,12 @@ void PropertyWindow::SetProperty()
|
|||||||
case StructProperty::ParticleType:
|
case StructProperty::ParticleType:
|
||||||
{
|
{
|
||||||
int v;
|
int v;
|
||||||
if(value.length() > 2 && value.BeginsWith("0x"_ascii))
|
if(value.length() > 2 && value.BeginsWith("0x"))
|
||||||
{
|
{
|
||||||
//0xC0FFEE
|
//0xC0FFEE
|
||||||
v = value.Substr(2).ToNumber<unsigned int>(Format::Hex());
|
v = value.Substr(2).ToNumber<unsigned int>(Format::Hex());
|
||||||
}
|
}
|
||||||
else if(value.length() > 1 && value.BeginsWith("#"_ascii))
|
else if(value.length() > 1 && value.BeginsWith("#"))
|
||||||
{
|
{
|
||||||
//#C0FFEE
|
//#C0FFEE
|
||||||
v = value.Substr(1).ToNumber<unsigned int>(Format::Hex());
|
v = value.Substr(1).ToNumber<unsigned int>(Format::Hex());
|
||||||
@ -134,12 +134,12 @@ void PropertyWindow::SetProperty()
|
|||||||
case StructProperty::UInteger:
|
case StructProperty::UInteger:
|
||||||
{
|
{
|
||||||
unsigned int v;
|
unsigned int v;
|
||||||
if(value.length() > 2 && value.BeginsWith("0x"_ascii))
|
if(value.length() > 2 && value.BeginsWith("0x"))
|
||||||
{
|
{
|
||||||
//0xC0FFEE
|
//0xC0FFEE
|
||||||
v = value.Substr(2).ToNumber<unsigned int>(Format::Hex());
|
v = value.Substr(2).ToNumber<unsigned int>(Format::Hex());
|
||||||
}
|
}
|
||||||
else if(value.length() > 1 && value.BeginsWith("#"_ascii))
|
else if(value.length() > 1 && value.BeginsWith("#"))
|
||||||
{
|
{
|
||||||
//#C0FFEE
|
//#C0FFEE
|
||||||
v = value.Substr(1).ToNumber<unsigned int>(Format::Hex());
|
v = value.Substr(1).ToNumber<unsigned int>(Format::Hex());
|
||||||
@ -156,12 +156,12 @@ void PropertyWindow::SetProperty()
|
|||||||
}
|
}
|
||||||
case StructProperty::Float:
|
case StructProperty::Float:
|
||||||
{
|
{
|
||||||
if (value.EndsWith("C"_ascii))
|
if (value.EndsWith("C"))
|
||||||
{
|
{
|
||||||
float v = value.SubstrFromEnd(1).ToNumber<float>();
|
float v = value.SubstrFromEnd(1).ToNumber<float>();
|
||||||
tool->propValue.Float = v + 273.15;
|
tool->propValue.Float = v + 273.15;
|
||||||
}
|
}
|
||||||
else if(value.EndsWith("F"_ascii))
|
else if(value.EndsWith("F"))
|
||||||
{
|
{
|
||||||
float v = value.SubstrFromEnd(1).ToNumber<float>();
|
float v = value.SubstrFromEnd(1).ToNumber<float>();
|
||||||
tool->propValue.Float = (v-32.0f)*5/9+273.15f;
|
tool->propValue.Float = (v-32.0f)*5/9+273.15f;
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#include "simulation/Simulation.h"
|
#include "simulation/Simulation.h"
|
||||||
|
|
||||||
SandEffectOption::SandEffectOption(GameModel * m):
|
SandEffectOption::SandEffectOption(GameModel * m):
|
||||||
QuickOption("P"_ascii, "Sand effect"_i18n, m, Toggle)
|
QuickOption("P", "Sand effect"_i18n, m, Toggle)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -22,7 +22,7 @@ void SandEffectOption::perform()
|
|||||||
|
|
||||||
|
|
||||||
DrawGravOption::DrawGravOption(GameModel * m):
|
DrawGravOption::DrawGravOption(GameModel * m):
|
||||||
QuickOption("G"_ascii, "Draw gravity field \bg(ctrl+g)"_i18n, m, Toggle)
|
QuickOption("G", "Draw gravity field \bg(ctrl+g)"_i18n, m, Toggle)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -38,7 +38,7 @@ void DrawGravOption::perform()
|
|||||||
|
|
||||||
|
|
||||||
DecorationsOption::DecorationsOption(GameModel * m):
|
DecorationsOption::DecorationsOption(GameModel * m):
|
||||||
QuickOption("D"_ascii, "Draw decorations \bg(ctrl+b)"_i18n, m, Toggle)
|
QuickOption("D", "Draw decorations \bg(ctrl+b)"_i18n, m, Toggle)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -54,7 +54,7 @@ void DecorationsOption::perform()
|
|||||||
|
|
||||||
|
|
||||||
NGravityOption::NGravityOption(GameModel * m):
|
NGravityOption::NGravityOption(GameModel * m):
|
||||||
QuickOption("N"_ascii, "Newtonian Gravity \bg(n)"_i18n, m, Toggle)
|
QuickOption("N", "Newtonian Gravity \bg(n)"_i18n, m, Toggle)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -70,7 +70,7 @@ void NGravityOption::perform()
|
|||||||
|
|
||||||
|
|
||||||
AHeatOption::AHeatOption(GameModel * m):
|
AHeatOption::AHeatOption(GameModel * m):
|
||||||
QuickOption("A"_ascii, "Ambient heat \bg(u)"_i18n, m, Toggle)
|
QuickOption("A", "Ambient heat \bg(u)"_i18n, m, Toggle)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -86,7 +86,7 @@ void AHeatOption::perform()
|
|||||||
|
|
||||||
|
|
||||||
ConsoleShowOption::ConsoleShowOption(GameModel * m, GameController * c_):
|
ConsoleShowOption::ConsoleShowOption(GameModel * m, GameController * c_):
|
||||||
QuickOption("C"_ascii, "Show Console \bg(~)"_i18n, m, Toggle)
|
QuickOption("C", "Show Console \bg(~)"_i18n, m, Toggle)
|
||||||
{
|
{
|
||||||
c = c_;
|
c = c_;
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ public:
|
|||||||
std::vector<unsigned int> DisplayModes;
|
std::vector<unsigned int> DisplayModes;
|
||||||
unsigned int ColourMode;
|
unsigned int ColourMode;
|
||||||
|
|
||||||
RenderPreset(): Name(""_ascii), ColourMode(0) {}
|
RenderPreset(): Name(""), ColourMode(0) {}
|
||||||
RenderPreset(String name, std::vector<unsigned int> renderModes, std::vector<unsigned int> displayModes, unsigned int colourMode):
|
RenderPreset(String name, std::vector<unsigned int> renderModes, std::vector<unsigned int> displayModes, unsigned int colourMode):
|
||||||
Name(name),
|
Name(name),
|
||||||
RenderModes(renderModes),
|
RenderModes(renderModes),
|
||||||
|
@ -100,7 +100,7 @@ SignWindow::SignWindow(SignTool * tool_, Simulation * sim_, int signID_, ui::Poi
|
|||||||
justification->SetOption(1);
|
justification->SetOption(1);
|
||||||
justification->Appearance.HorizontalAlign = ui::Appearance::AlignLeft;
|
justification->Appearance.HorizontalAlign = ui::Appearance::AlignLeft;
|
||||||
|
|
||||||
textField = new ui::Textbox(ui::Point(8, 25), ui::Point(Size.X-16, 17), ""_ascii, "[message]"_i18n);
|
textField = new ui::Textbox(ui::Point(8, 25), ui::Point(Size.X-16, 17), "", "[message]"_i18n);
|
||||||
textField->Appearance.HorizontalAlign = ui::Appearance::AlignLeft;
|
textField->Appearance.HorizontalAlign = ui::Appearance::AlignLeft;
|
||||||
textField->Appearance.VerticalAlign = ui::Appearance::AlignMiddle;
|
textField->Appearance.VerticalAlign = ui::Appearance::AlignMiddle;
|
||||||
textField->SetLimit(45);
|
textField->SetLimit(45);
|
||||||
|
@ -47,7 +47,7 @@ class SignTool: public Tool
|
|||||||
public:
|
public:
|
||||||
GameModel * gameModel;
|
GameModel * gameModel;
|
||||||
SignTool(GameModel *model):
|
SignTool(GameModel *model):
|
||||||
Tool(0, "SIGN"_ascii, "Sign. Displays text. Click on a sign to edit it or anywhere else to place a new one."_i18n, 0, 0, 0, "DEFAULT_UI_SIGN", SignTool::GetIcon),
|
Tool(0, "SIGN", "Sign. Displays text. Click on a sign to edit it or anywhere else to place a new one."_i18n, 0, 0, 0, "DEFAULT_UI_SIGN", SignTool::GetIcon),
|
||||||
gameModel(model)
|
gameModel(model)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -65,7 +65,7 @@ class SampleTool: public Tool
|
|||||||
GameModel * gameModel;
|
GameModel * gameModel;
|
||||||
public:
|
public:
|
||||||
SampleTool(GameModel *model):
|
SampleTool(GameModel *model):
|
||||||
Tool(0, "SMPL"_ascii, "Sample an element on the screen."_i18n, 0, 0, 0, "DEFAULT_UI_SAMPLE", SampleTool::GetIcon),
|
Tool(0, "SMPL", "Sample an element on the screen."_i18n, 0, 0, 0, "DEFAULT_UI_SAMPLE", SampleTool::GetIcon),
|
||||||
gameModel(model)
|
gameModel(model)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -82,7 +82,7 @@ class PropertyTool: public Tool
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PropertyTool():
|
PropertyTool():
|
||||||
Tool(0, "PROP"_ascii, "Property Drawing Tool. Use to alter the properties of elements in the field."_i18n, 0xfe, 0xa9, 0x00, "DEFAULT_UI_PROPERTY", NULL)
|
Tool(0, "PROP", "Property Drawing Tool. Use to alter the properties of elements in the field."_i18n, 0xfe, 0xa9, 0x00, "DEFAULT_UI_PROPERTY", NULL)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
StructProperty::PropertyType propType;
|
StructProperty::PropertyType propType;
|
||||||
|
@ -29,7 +29,7 @@ void Button::TextPosition(String ButtonText)
|
|||||||
{
|
{
|
||||||
int position = Graphics::textwidthx(buttonDisplayText, Size.X - (Appearance.icon? 38 : 22));
|
int position = Graphics::textwidthx(buttonDisplayText, Size.X - (Appearance.icon? 38 : 22));
|
||||||
buttonDisplayText = buttonDisplayText.erase(position, buttonDisplayText.length()-position);
|
buttonDisplayText = buttonDisplayText.erase(position, buttonDisplayText.length()-position);
|
||||||
buttonDisplayText += "..."_ascii;
|
buttonDisplayText += "...";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ std::pair<String, int> DropDown::GetOption()
|
|||||||
{
|
{
|
||||||
return options[optionIndex];
|
return options[optionIndex];
|
||||||
}
|
}
|
||||||
return std::pair<String, int>(""_ascii, -1);
|
return std::pair<String, int>("", -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DropDown::SetOption(String option)
|
void DropDown::SetOption(String option)
|
||||||
|
@ -206,8 +206,8 @@ void Label::updateSelection()
|
|||||||
{
|
{
|
||||||
auto indexL = displayTextWrapper.Clear2Index(selectionIndexL.clear_index);
|
auto indexL = displayTextWrapper.Clear2Index(selectionIndexL.clear_index);
|
||||||
auto indexH = displayTextWrapper.Clear2Index(selectionIndexH.clear_index);
|
auto indexH = displayTextWrapper.Clear2Index(selectionIndexH.clear_index);
|
||||||
displayTextWithSelection.Insert(indexL.wrapped_index , "\x01"_ascii);
|
displayTextWithSelection.Insert(indexL.wrapped_index , "\x01");
|
||||||
displayTextWithSelection.Insert(indexH.wrapped_index + 1, "\x01"_ascii);
|
displayTextWithSelection.Insert(indexH.wrapped_index + 1, "\x01");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ ProgressBar::ProgressBar(Point position, Point size, int startProgress, String s
|
|||||||
Component(position, size),
|
Component(position, size),
|
||||||
progress(0),
|
progress(0),
|
||||||
intermediatePos(0.0f),
|
intermediatePos(0.0f),
|
||||||
progressStatus(""_ascii)
|
progressStatus("")
|
||||||
{
|
{
|
||||||
SetStatus(startStatus);
|
SetStatus(startStatus);
|
||||||
SetProgress(startProgress);
|
SetProgress(startProgress);
|
||||||
|
@ -29,7 +29,7 @@ public:
|
|||||||
RichLabel::RichLabel(Point position, Point size, String labelText):
|
RichLabel::RichLabel(Point position, Point size, String labelText):
|
||||||
Component(position, size),
|
Component(position, size),
|
||||||
textSource(labelText),
|
textSource(labelText),
|
||||||
displayText(""_ascii)
|
displayText("")
|
||||||
{
|
{
|
||||||
updateRichText();
|
updateRichText();
|
||||||
}
|
}
|
||||||
@ -42,7 +42,7 @@ RichLabel::~RichLabel()
|
|||||||
void RichLabel::updateRichText()
|
void RichLabel::updateRichText()
|
||||||
{
|
{
|
||||||
regions.clear();
|
regions.clear();
|
||||||
displayText = ""_ascii;
|
displayText = "";
|
||||||
|
|
||||||
if(textSource.length())
|
if(textSource.length())
|
||||||
{
|
{
|
||||||
|
@ -41,7 +41,7 @@ SaveButton::SaveButton(Point position, Point size, SaveInfo * save_) : SaveButto
|
|||||||
{
|
{
|
||||||
int position = Graphics::textwidthx(name, Size.X - 22);
|
int position = Graphics::textwidthx(name, Size.X - 22);
|
||||||
name = name.erase(position, name.length()-position);
|
name = name.erase(position, name.length()-position);
|
||||||
name += "..."_ascii;
|
name += "...";
|
||||||
}
|
}
|
||||||
|
|
||||||
String votes, icon;
|
String votes, icon;
|
||||||
@ -102,7 +102,7 @@ SaveButton::SaveButton(Point position, Point size, SaveFile * file_) : SaveButto
|
|||||||
{
|
{
|
||||||
int position = Graphics::textwidthx(name, Size.X - 22);
|
int position = Graphics::textwidthx(name, Size.X - 22);
|
||||||
name = name.erase(position, name.length()-position);
|
name = name.erase(position, name.length()-position);
|
||||||
name += "..."_ascii;
|
name += "...";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
using namespace ui;
|
using namespace ui;
|
||||||
|
|
||||||
Textbox::Textbox(Point position, Point size, String textboxText, String textboxPlaceholder):
|
Textbox::Textbox(Point position, Point size, String textboxText, String textboxPlaceholder):
|
||||||
Label(position, size, ""_ascii),
|
Label(position, size, ""),
|
||||||
ReadOnly(false),
|
ReadOnly(false),
|
||||||
inputType(All),
|
inputType(All),
|
||||||
limit(String::npos),
|
limit(String::npos),
|
||||||
@ -369,8 +369,8 @@ void Textbox::OnVKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl,
|
|||||||
if (ctrl)
|
if (ctrl)
|
||||||
{
|
{
|
||||||
size_t stopChar;
|
size_t stopChar;
|
||||||
stopChar = backingText.SplitByNot(" .,!?\n"_ascii, cursor).PositionBefore();
|
stopChar = backingText.SplitByNot(" .,!?\n", cursor).PositionBefore();
|
||||||
stopChar = backingText.SplitByAny(" .,!?\n"_ascii, stopChar).PositionBefore();
|
stopChar = backingText.SplitByAny(" .,!?\n", stopChar).PositionBefore();
|
||||||
backingText.EraseBetween(cursor, stopChar);
|
backingText.EraseBetween(cursor, stopChar);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -395,11 +395,11 @@ void Textbox::OnVKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl,
|
|||||||
if (ctrl)
|
if (ctrl)
|
||||||
{
|
{
|
||||||
size_t stopChar;
|
size_t stopChar;
|
||||||
stopChar = backingText.SplitFromEndByNot(" .,!?\n"_ascii, cursor).PositionBefore();
|
stopChar = backingText.SplitFromEndByNot(" .,!?\n", cursor).PositionBefore();
|
||||||
if (stopChar == backingText.npos)
|
if (stopChar == backingText.npos)
|
||||||
stopChar = -1;
|
stopChar = -1;
|
||||||
else
|
else
|
||||||
stopChar = backingText.SplitFromEndByAny(" .,!?\n"_ascii, stopChar).PositionBefore();
|
stopChar = backingText.SplitFromEndByAny(" .,!?\n", stopChar).PositionBefore();
|
||||||
backingText.EraseBetween(stopChar+1, cursor);
|
backingText.EraseBetween(stopChar+1, cursor);
|
||||||
cursor = stopChar+1;
|
cursor = stopChar+1;
|
||||||
}
|
}
|
||||||
@ -413,14 +413,14 @@ void Textbox::OnVKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl,
|
|||||||
ClearSelection();
|
ClearSelection();
|
||||||
break;
|
break;
|
||||||
case SDLK_RETURN:
|
case SDLK_RETURN:
|
||||||
OnTextInput("\n"_ascii);
|
OnTextInput("\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (std::out_of_range &e)
|
catch (std::out_of_range &e)
|
||||||
{
|
{
|
||||||
cursor = 0;
|
cursor = 0;
|
||||||
backingText = ""_ascii;
|
backingText = "";
|
||||||
}
|
}
|
||||||
AfterTextChange(changed);
|
AfterTextChange(changed);
|
||||||
}
|
}
|
||||||
|
@ -236,8 +236,8 @@ void Window::DoDraw()
|
|||||||
Graphics * g = ui::Engine::Ref().g;
|
Graphics * g = ui::Engine::Ref().g;
|
||||||
String tempString, tempString2;
|
String tempString, tempString2;
|
||||||
|
|
||||||
tempString = String::Build("Position: L "_ascii, focusedComponent_->Position.X, ", R "_ascii, Size.X-(focusedComponent_->Position.X+focusedComponent_->Size.X), ", T: "_ascii, focusedComponent_->Position.Y, ", B: "_ascii, Size.Y-(focusedComponent_->Position.Y+focusedComponent_->Size.Y));
|
tempString = String::Build("Position: L ", focusedComponent_->Position.X, ", R ", Size.X-(focusedComponent_->Position.X+focusedComponent_->Size.X), ", T: ", focusedComponent_->Position.Y, ", B: ", Size.Y-(focusedComponent_->Position.Y+focusedComponent_->Size.Y));
|
||||||
tempString2 = String::Build("Size: "_ascii, focusedComponent_->Size.X, ", "_ascii, focusedComponent_->Size.Y);
|
tempString2 = String::Build("Size: ", focusedComponent_->Size.X, ", ", focusedComponent_->Size.Y);
|
||||||
|
|
||||||
if (Graphics::textwidth(tempString)+xPos > WINDOWW)
|
if (Graphics::textwidth(tempString)+xPos > WINDOWW)
|
||||||
xPos = WINDOWW-(Graphics::textwidth(tempString)+5);
|
xPos = WINDOWW-(Graphics::textwidth(tempString)+5);
|
||||||
|
@ -29,13 +29,13 @@ LocalBrowserView::LocalBrowserView():
|
|||||||
AddComponent(previousButton);
|
AddComponent(previousButton);
|
||||||
AddComponent(undeleteButton);
|
AddComponent(undeleteButton);
|
||||||
|
|
||||||
pageTextbox = new ui::Textbox(ui::Point(283, WINDOWH-18), ui::Point(41, 16), ""_ascii);
|
pageTextbox = new ui::Textbox(ui::Point(283, WINDOWH-18), ui::Point(41, 16), "");
|
||||||
pageTextbox->SetActionCallback({ [this] { textChanged(); } });
|
pageTextbox->SetActionCallback({ [this] { textChanged(); } });
|
||||||
pageTextbox->SetInputType(ui::Textbox::Number);
|
pageTextbox->SetInputType(ui::Textbox::Number);
|
||||||
auto pageOf = i18nMulti("Page", "of "); //page [TEXTBOX] of y
|
auto pageOf = i18nMulti("Page", "of "); //page [TEXTBOX] of y
|
||||||
pageLabel = new ui::Label(ui::Point(0, WINDOWH-18), ui::Point(30, 16), pageOf[0]);
|
pageLabel = new ui::Label(ui::Point(0, WINDOWH-18), ui::Point(30, 16), pageOf[0]);
|
||||||
pageLabel->Appearance.HorizontalAlign = ui::Appearance::AlignRight;
|
pageLabel->Appearance.HorizontalAlign = ui::Appearance::AlignRight;
|
||||||
pageCountLabel = new ui::Label(ui::Point(WINDOWW/2+6, WINDOWH-18), ui::Point(50, 16), ""_ascii);
|
pageCountLabel = new ui::Label(ui::Point(WINDOWW/2+6, WINDOWH-18), ui::Point(50, 16), "");
|
||||||
pageCountLabel->Appearance.HorizontalAlign = ui::Appearance::AlignLeft;
|
pageCountLabel->Appearance.HorizontalAlign = ui::Appearance::AlignLeft;
|
||||||
AddComponent(pageLabel);
|
AddComponent(pageLabel);
|
||||||
AddComponent(pageCountLabel);
|
AddComponent(pageCountLabel);
|
||||||
|
@ -19,9 +19,9 @@ LoginView::LoginView():
|
|||||||
loginButton(new ui::Button(ui::Point(200-100, 87-17), ui::Point(100, 17), "Sign in"_i18n)),
|
loginButton(new ui::Button(ui::Point(200-100, 87-17), ui::Point(100, 17), "Sign in"_i18n)),
|
||||||
cancelButton(new ui::Button(ui::Point(0, 87-17), ui::Point(101, 17), "Sign Out"_i18n)),
|
cancelButton(new ui::Button(ui::Point(0, 87-17), ui::Point(101, 17), "Sign Out"_i18n)),
|
||||||
titleLabel(new ui::Label(ui::Point(4, 5), ui::Point(200-16, 16), "Server login"_i18n)),
|
titleLabel(new ui::Label(ui::Point(4, 5), ui::Point(200-16, 16), "Server login"_i18n)),
|
||||||
infoLabel(new ui::Label(ui::Point(8, 67), ui::Point(200-16, 16), ""_ascii)),
|
infoLabel(new ui::Label(ui::Point(8, 67), ui::Point(200-16, 16), "")),
|
||||||
usernameField(new ui::Textbox(ui::Point(8, 25), ui::Point(200-16, 17), Client::Ref().GetAuthUser().Username.FromUtf8(), "[username]"_i18n)),
|
usernameField(new ui::Textbox(ui::Point(8, 25), ui::Point(200-16, 17), Client::Ref().GetAuthUser().Username.FromUtf8(), "[username]"_i18n)),
|
||||||
passwordField(new ui::Textbox(ui::Point(8, 46), ui::Point(200-16, 17), ""_ascii, "[password]"_i18n)),
|
passwordField(new ui::Textbox(ui::Point(8, 46), ui::Point(200-16, 17), "", "[password]"_i18n)),
|
||||||
targetSize(0, 0)
|
targetSize(0, 0)
|
||||||
{
|
{
|
||||||
targetSize = Size;
|
targetSize = Size;
|
||||||
|
@ -55,7 +55,7 @@ OptionsView::OptionsView():
|
|||||||
|
|
||||||
AddComponent(scrollPanel);
|
AddComponent(scrollPanel);
|
||||||
|
|
||||||
heatSimulation = new ui::Checkbox(ui::Point(8, currentY), ui::Point(1, 16), "Heat simulation \bgIntroduced in version 34"_i18n, ""_ascii);
|
heatSimulation = new ui::Checkbox(ui::Point(8, currentY), ui::Point(1, 16), "Heat simulation \bgIntroduced in version 34"_i18n, "");
|
||||||
autowidth(heatSimulation);
|
autowidth(heatSimulation);
|
||||||
heatSimulation->SetActionCallback({ [this] { c->SetHeatSimulation(heatSimulation->GetChecked()); } });
|
heatSimulation->SetActionCallback({ [this] { c->SetHeatSimulation(heatSimulation->GetChecked()); } });
|
||||||
scrollPanel->AddChild(heatSimulation);
|
scrollPanel->AddChild(heatSimulation);
|
||||||
@ -67,7 +67,7 @@ OptionsView::OptionsView():
|
|||||||
scrollPanel->AddChild(tempLabel);
|
scrollPanel->AddChild(tempLabel);
|
||||||
|
|
||||||
currentY+=16;
|
currentY+=16;
|
||||||
ambientHeatSimulation = new ui::Checkbox(ui::Point(8, currentY), ui::Point(1, 16), "Ambient heat simulation \bgIntroduced in version 50"_i18n, ""_ascii);
|
ambientHeatSimulation = new ui::Checkbox(ui::Point(8, currentY), ui::Point(1, 16), "Ambient heat simulation \bgIntroduced in version 50"_i18n, "");
|
||||||
autowidth(ambientHeatSimulation);
|
autowidth(ambientHeatSimulation);
|
||||||
ambientHeatSimulation->SetActionCallback({ [this] { c->SetAmbientHeatSimulation(ambientHeatSimulation->GetChecked()); } });
|
ambientHeatSimulation->SetActionCallback({ [this] { c->SetAmbientHeatSimulation(ambientHeatSimulation->GetChecked()); } });
|
||||||
scrollPanel->AddChild(ambientHeatSimulation);
|
scrollPanel->AddChild(ambientHeatSimulation);
|
||||||
@ -79,7 +79,7 @@ OptionsView::OptionsView():
|
|||||||
scrollPanel->AddChild(tempLabel);
|
scrollPanel->AddChild(tempLabel);
|
||||||
|
|
||||||
currentY+=16;
|
currentY+=16;
|
||||||
newtonianGravity = new ui::Checkbox(ui::Point(8, currentY), ui::Point(1, 16), "Newtonian gravity \bgIntroduced in version 48"_i18n, ""_ascii);
|
newtonianGravity = new ui::Checkbox(ui::Point(8, currentY), ui::Point(1, 16), "Newtonian gravity \bgIntroduced in version 48"_i18n, "");
|
||||||
autowidth(newtonianGravity);
|
autowidth(newtonianGravity);
|
||||||
newtonianGravity->SetActionCallback({ [this] { c->SetNewtonianGravity(newtonianGravity->GetChecked()); } });
|
newtonianGravity->SetActionCallback({ [this] { c->SetNewtonianGravity(newtonianGravity->GetChecked()); } });
|
||||||
scrollPanel->AddChild(newtonianGravity);
|
scrollPanel->AddChild(newtonianGravity);
|
||||||
@ -91,7 +91,7 @@ OptionsView::OptionsView():
|
|||||||
scrollPanel->AddChild(tempLabel);
|
scrollPanel->AddChild(tempLabel);
|
||||||
|
|
||||||
currentY+=16;
|
currentY+=16;
|
||||||
waterEqualisation = new ui::Checkbox(ui::Point(8, currentY), ui::Point(1, 16), "Water equalisation \bgIntroduced in version 61"_i18n, ""_ascii);
|
waterEqualisation = new ui::Checkbox(ui::Point(8, currentY), ui::Point(1, 16), "Water equalisation \bgIntroduced in version 61"_i18n, "");
|
||||||
autowidth(waterEqualisation);
|
autowidth(waterEqualisation);
|
||||||
waterEqualisation->SetActionCallback({ [this] { c->SetWaterEqualisation(waterEqualisation->GetChecked()); } });
|
waterEqualisation->SetActionCallback({ [this] { c->SetWaterEqualisation(waterEqualisation->GetChecked()); } });
|
||||||
scrollPanel->AddChild(waterEqualisation);
|
scrollPanel->AddChild(waterEqualisation);
|
||||||
@ -173,7 +173,7 @@ OptionsView::OptionsView():
|
|||||||
scrollPanel->AddChild(tempLabel);
|
scrollPanel->AddChild(tempLabel);
|
||||||
|
|
||||||
currentY+=20;
|
currentY+=20;
|
||||||
resizable = new ui::Checkbox(ui::Point(8, currentY), ui::Point(1, 16), "Resizable"_i18n, ""_ascii);
|
resizable = new ui::Checkbox(ui::Point(8, currentY), ui::Point(1, 16), "Resizable"_i18n, "");
|
||||||
autowidth(resizable);
|
autowidth(resizable);
|
||||||
resizable->SetActionCallback({ [this] { c->SetResizable(resizable->GetChecked()); } });
|
resizable->SetActionCallback({ [this] { c->SetResizable(resizable->GetChecked()); } });
|
||||||
tempLabel = new ui::Label(ui::Point(resizable->Position.X+Graphics::textwidth(resizable->GetText())+20, currentY), ui::Point(1, 16), "\bg- Allow resizing and maximizing window"_i18n);
|
tempLabel = new ui::Label(ui::Point(resizable->Position.X+Graphics::textwidth(resizable->GetText())+20, currentY), ui::Point(1, 16), "\bg- Allow resizing and maximizing window"_i18n);
|
||||||
@ -184,7 +184,7 @@ OptionsView::OptionsView():
|
|||||||
scrollPanel->AddChild(resizable);
|
scrollPanel->AddChild(resizable);
|
||||||
|
|
||||||
currentY+=20;
|
currentY+=20;
|
||||||
fullscreen = new ui::Checkbox(ui::Point(8, currentY), ui::Point(1, 16), "Fullscreen"_i18n, ""_ascii);
|
fullscreen = new ui::Checkbox(ui::Point(8, currentY), ui::Point(1, 16), "Fullscreen"_i18n, "");
|
||||||
autowidth(fullscreen);
|
autowidth(fullscreen);
|
||||||
fullscreen->SetActionCallback({ [this] { c->SetFullscreen(fullscreen->GetChecked()); } });
|
fullscreen->SetActionCallback({ [this] { c->SetFullscreen(fullscreen->GetChecked()); } });
|
||||||
tempLabel = new ui::Label(ui::Point(fullscreen->Position.X+Graphics::textwidth(fullscreen->GetText())+20, currentY), ui::Point(1, 16), "\bg- Fill the entire screen"_i18n);
|
tempLabel = new ui::Label(ui::Point(fullscreen->Position.X+Graphics::textwidth(fullscreen->GetText())+20, currentY), ui::Point(1, 16), "\bg- Fill the entire screen"_i18n);
|
||||||
@ -195,7 +195,7 @@ OptionsView::OptionsView():
|
|||||||
scrollPanel->AddChild(fullscreen);
|
scrollPanel->AddChild(fullscreen);
|
||||||
|
|
||||||
currentY+=20;
|
currentY+=20;
|
||||||
altFullscreen = new ui::Checkbox(ui::Point(23, currentY), ui::Point(1, 16), "Change Resolution"_i18n, ""_ascii);
|
altFullscreen = new ui::Checkbox(ui::Point(23, currentY), ui::Point(1, 16), "Change Resolution"_i18n, "");
|
||||||
autowidth(altFullscreen);
|
autowidth(altFullscreen);
|
||||||
altFullscreen->SetActionCallback({ [this] { c->SetAltFullscreen(altFullscreen->GetChecked()); } });
|
altFullscreen->SetActionCallback({ [this] { c->SetAltFullscreen(altFullscreen->GetChecked()); } });
|
||||||
tempLabel = new ui::Label(ui::Point(altFullscreen->Position.X+Graphics::textwidth(altFullscreen->GetText())+20, currentY), ui::Point(1, 16), "\bg- Set optimal screen resolution"_i18n);
|
tempLabel = new ui::Label(ui::Point(altFullscreen->Position.X+Graphics::textwidth(altFullscreen->GetText())+20, currentY), ui::Point(1, 16), "\bg- Set optimal screen resolution"_i18n);
|
||||||
@ -206,7 +206,7 @@ OptionsView::OptionsView():
|
|||||||
scrollPanel->AddChild(altFullscreen);
|
scrollPanel->AddChild(altFullscreen);
|
||||||
|
|
||||||
currentY+=20;
|
currentY+=20;
|
||||||
forceIntegerScaling = new ui::Checkbox(ui::Point(23, currentY), ui::Point(1, 16), "Force Integer Scaling"_i18n, ""_ascii);
|
forceIntegerScaling = new ui::Checkbox(ui::Point(23, currentY), ui::Point(1, 16), "Force Integer Scaling"_i18n, "");
|
||||||
autowidth(forceIntegerScaling);
|
autowidth(forceIntegerScaling);
|
||||||
forceIntegerScaling->SetActionCallback({ [this] { c->SetForceIntegerScaling(forceIntegerScaling->GetChecked()); } });
|
forceIntegerScaling->SetActionCallback({ [this] { c->SetForceIntegerScaling(forceIntegerScaling->GetChecked()); } });
|
||||||
tempLabel = new ui::Label(ui::Point(altFullscreen->Position.X+Graphics::textwidth(forceIntegerScaling->GetText())+20, currentY), ui::Point(1, 16), "\bg- Less blurry"_i18n);
|
tempLabel = new ui::Label(ui::Point(altFullscreen->Position.X+Graphics::textwidth(forceIntegerScaling->GetText())+20, currentY), ui::Point(1, 16), "\bg- Less blurry"_i18n);
|
||||||
@ -217,7 +217,7 @@ OptionsView::OptionsView():
|
|||||||
scrollPanel->AddChild(forceIntegerScaling);
|
scrollPanel->AddChild(forceIntegerScaling);
|
||||||
|
|
||||||
currentY+=20;
|
currentY+=20;
|
||||||
fastquit = new ui::Checkbox(ui::Point(8, currentY), ui::Point(1, 16), "Fast Quit"_i18n, ""_ascii);
|
fastquit = new ui::Checkbox(ui::Point(8, currentY), ui::Point(1, 16), "Fast Quit"_i18n, "");
|
||||||
autowidth(fastquit);
|
autowidth(fastquit);
|
||||||
fastquit->SetActionCallback({ [this] { c->SetFastQuit(fastquit->GetChecked()); } });
|
fastquit->SetActionCallback({ [this] { c->SetFastQuit(fastquit->GetChecked()); } });
|
||||||
tempLabel = new ui::Label(ui::Point(fastquit->Position.X+Graphics::textwidth(fastquit->GetText())+20, currentY), ui::Point(1, 16), "\bg- Always exit completely when hitting close"_i18n);
|
tempLabel = new ui::Label(ui::Point(fastquit->Position.X+Graphics::textwidth(fastquit->GetText())+20, currentY), ui::Point(1, 16), "\bg- Always exit completely when hitting close"_i18n);
|
||||||
@ -228,7 +228,7 @@ OptionsView::OptionsView():
|
|||||||
scrollPanel->AddChild(fastquit);
|
scrollPanel->AddChild(fastquit);
|
||||||
|
|
||||||
currentY+=20;
|
currentY+=20;
|
||||||
showAvatars = new ui::Checkbox(ui::Point(8, currentY), ui::Point(1, 16), "Show Avatars"_i18n, ""_ascii);
|
showAvatars = new ui::Checkbox(ui::Point(8, currentY), ui::Point(1, 16), "Show Avatars"_i18n, "");
|
||||||
autowidth(showAvatars);
|
autowidth(showAvatars);
|
||||||
showAvatars->SetActionCallback({ [this] { c->SetShowAvatars(showAvatars->GetChecked()); } });
|
showAvatars->SetActionCallback({ [this] { c->SetShowAvatars(showAvatars->GetChecked()); } });
|
||||||
tempLabel = new ui::Label(ui::Point(showAvatars->Position.X+Graphics::textwidth(showAvatars->GetText())+20, currentY), ui::Point(1, 16), "\bg- Disable if you have a slow connection"_i18n);
|
tempLabel = new ui::Label(ui::Point(showAvatars->Position.X+Graphics::textwidth(showAvatars->GetText())+20, currentY), ui::Point(1, 16), "\bg- Disable if you have a slow connection"_i18n);
|
||||||
@ -239,7 +239,7 @@ OptionsView::OptionsView():
|
|||||||
scrollPanel->AddChild(showAvatars);
|
scrollPanel->AddChild(showAvatars);
|
||||||
|
|
||||||
currentY+=20;
|
currentY+=20;
|
||||||
mouseClickRequired = new ui::Checkbox(ui::Point(8, currentY), ui::Point(1, 16), "Sticky Categories"_i18n, ""_ascii);
|
mouseClickRequired = new ui::Checkbox(ui::Point(8, currentY), ui::Point(1, 16), "Sticky Categories"_i18n, "");
|
||||||
autowidth(mouseClickRequired);
|
autowidth(mouseClickRequired);
|
||||||
mouseClickRequired->SetActionCallback({ [this] { c->SetMouseClickrequired(mouseClickRequired->GetChecked()); } });
|
mouseClickRequired->SetActionCallback({ [this] { c->SetMouseClickrequired(mouseClickRequired->GetChecked()); } });
|
||||||
tempLabel = new ui::Label(ui::Point(mouseClickRequired->Position.X+Graphics::textwidth(mouseClickRequired->GetText())+20, currentY), ui::Point(1, 16), "\bg- Switch between categories by clicking"_i18n);
|
tempLabel = new ui::Label(ui::Point(mouseClickRequired->Position.X+Graphics::textwidth(mouseClickRequired->GetText())+20, currentY), ui::Point(1, 16), "\bg- Switch between categories by clicking"_i18n);
|
||||||
@ -250,7 +250,7 @@ OptionsView::OptionsView():
|
|||||||
scrollPanel->AddChild(mouseClickRequired);
|
scrollPanel->AddChild(mouseClickRequired);
|
||||||
|
|
||||||
currentY+=20;
|
currentY+=20;
|
||||||
includePressure = new ui::Checkbox(ui::Point(8, currentY), ui::Point(1, 16), "Include Pressure"_i18n, ""_ascii);
|
includePressure = new ui::Checkbox(ui::Point(8, currentY), ui::Point(1, 16), "Include Pressure"_i18n, "");
|
||||||
autowidth(includePressure);
|
autowidth(includePressure);
|
||||||
includePressure->SetActionCallback({ [this] { c->SetIncludePressure(includePressure->GetChecked()); } });
|
includePressure->SetActionCallback({ [this] { c->SetIncludePressure(includePressure->GetChecked()); } });
|
||||||
tempLabel = new ui::Label(ui::Point(includePressure->Position.X+Graphics::textwidth(includePressure->GetText())+20, currentY), ui::Point(1, 16), "\bg- When saving, copying, stamping, etc."_i18n);
|
tempLabel = new ui::Label(ui::Point(includePressure->Position.X+Graphics::textwidth(includePressure->GetText())+20, currentY), ui::Point(1, 16), "\bg- When saving, copying, stamping, etc."_i18n);
|
||||||
@ -261,7 +261,7 @@ OptionsView::OptionsView():
|
|||||||
scrollPanel->AddChild(includePressure);
|
scrollPanel->AddChild(includePressure);
|
||||||
|
|
||||||
currentY+=20;
|
currentY+=20;
|
||||||
perfectCirclePressure = new ui::Checkbox(ui::Point(8, currentY), ui::Point(1, 16), "Perfect Circle"_i18n, ""_ascii);
|
perfectCirclePressure = new ui::Checkbox(ui::Point(8, currentY), ui::Point(1, 16), "Perfect Circle"_i18n, "");
|
||||||
autowidth(perfectCirclePressure);
|
autowidth(perfectCirclePressure);
|
||||||
perfectCirclePressure->SetActionCallback({ [this] { c->SetPerfectCircle(perfectCirclePressure->GetChecked()); } });
|
perfectCirclePressure->SetActionCallback({ [this] { c->SetPerfectCircle(perfectCirclePressure->GetChecked()); } });
|
||||||
tempLabel = new ui::Label(ui::Point(perfectCirclePressure->Position.X+Graphics::textwidth(perfectCirclePressure->GetText())+20, currentY), ui::Point(1, 16), "\bg- Better circle brush, without incorrect points on edges"_i18n);
|
tempLabel = new ui::Label(ui::Point(perfectCirclePressure->Position.X+Graphics::textwidth(perfectCirclePressure->GetText())+20, currentY), ui::Point(1, 16), "\bg- Better circle brush, without incorrect points on edges"_i18n);
|
||||||
|
@ -40,7 +40,7 @@ PreviewView::PreviewView():
|
|||||||
userIsAuthor(false),
|
userIsAuthor(false),
|
||||||
doOpen(false),
|
doOpen(false),
|
||||||
doError(false),
|
doError(false),
|
||||||
doErrorMessage(""_ascii),
|
doErrorMessage(""),
|
||||||
showAvatars(true),
|
showAvatars(true),
|
||||||
prevPage(false),
|
prevPage(false),
|
||||||
commentBoxHeight(20),
|
commentBoxHeight(20),
|
||||||
@ -72,7 +72,7 @@ PreviewView::PreviewView():
|
|||||||
reportButton->Appearance.VerticalAlign = ui::Appearance::AlignMiddle;
|
reportButton->Appearance.VerticalAlign = ui::Appearance::AlignMiddle;
|
||||||
reportButton->SetIcon(IconReport);
|
reportButton->SetIcon(IconReport);
|
||||||
reportButton->SetActionCallback({ [this] {
|
reportButton->SetActionCallback({ [this] {
|
||||||
new TextPrompt("Report Save"_i18n, "Things to consider when reporting:\n\bw1)\bg When reporting stolen saves, please include the ID of the original save.\n\bw2)\bg Do not ask for saves to be removed from front page unless they break the rules.\n\bw3)\bg You may report saves for comments or tags too (including your own saves)"_i18n, ""_ascii, "[reason]"_i18n, true, { [this](String const &resultText) {
|
new TextPrompt("Report Save"_i18n, "Things to consider when reporting:\n\bw1)\bg When reporting stolen saves, please include the ID of the original save.\n\bw2)\bg Do not ask for saves to be removed from front page unless they break the rules.\n\bw3)\bg You may report saves for comments or tags too (including your own saves)"_i18n, "", "[reason]"_i18n, true, { [this](String const &resultText) {
|
||||||
c->Report(resultText);
|
c->Report(resultText);
|
||||||
} });
|
} });
|
||||||
} });
|
} });
|
||||||
@ -94,17 +94,17 @@ PreviewView::PreviewView():
|
|||||||
AddComponent(browserOpenButton);
|
AddComponent(browserOpenButton);
|
||||||
|
|
||||||
if(showAvatars)
|
if(showAvatars)
|
||||||
saveNameLabel = new ui::Label(ui::Point(39, (YRES/2)+4), ui::Point(100, 16), ""_ascii);
|
saveNameLabel = new ui::Label(ui::Point(39, (YRES/2)+4), ui::Point(100, 16), "");
|
||||||
else
|
else
|
||||||
saveNameLabel = new ui::Label(ui::Point(5, (YRES/2)+4), ui::Point(100, 16), ""_ascii);
|
saveNameLabel = new ui::Label(ui::Point(5, (YRES/2)+4), ui::Point(100, 16), "");
|
||||||
saveNameLabel->Appearance.HorizontalAlign = ui::Appearance::AlignLeft;
|
saveNameLabel->Appearance.HorizontalAlign = ui::Appearance::AlignLeft;
|
||||||
saveNameLabel->Appearance.VerticalAlign = ui::Appearance::AlignMiddle;
|
saveNameLabel->Appearance.VerticalAlign = ui::Appearance::AlignMiddle;
|
||||||
AddComponent(saveNameLabel);
|
AddComponent(saveNameLabel);
|
||||||
|
|
||||||
if(showAvatars)
|
if(showAvatars)
|
||||||
saveDescriptionLabel = new ui::Label(ui::Point(5, (YRES/2)+4+15+21), ui::Point((XRES/2)-10, Size.Y-((YRES/2)+4+15+17)-25), ""_ascii);
|
saveDescriptionLabel = new ui::Label(ui::Point(5, (YRES/2)+4+15+21), ui::Point((XRES/2)-10, Size.Y-((YRES/2)+4+15+17)-25), "");
|
||||||
else
|
else
|
||||||
saveDescriptionLabel = new ui::Label(ui::Point(5, (YRES/2)+4+15+19), ui::Point((XRES/2)-10, Size.Y-((YRES/2)+4+15+17)-23), ""_ascii);
|
saveDescriptionLabel = new ui::Label(ui::Point(5, (YRES/2)+4+15+19), ui::Point((XRES/2)-10, Size.Y-((YRES/2)+4+15+17)-23), "");
|
||||||
saveDescriptionLabel->SetMultiline(true);
|
saveDescriptionLabel->SetMultiline(true);
|
||||||
saveDescriptionLabel->Appearance.HorizontalAlign = ui::Appearance::AlignLeft;
|
saveDescriptionLabel->Appearance.HorizontalAlign = ui::Appearance::AlignLeft;
|
||||||
saveDescriptionLabel->Appearance.VerticalAlign = ui::Appearance::AlignTop;
|
saveDescriptionLabel->Appearance.VerticalAlign = ui::Appearance::AlignTop;
|
||||||
@ -112,9 +112,9 @@ PreviewView::PreviewView():
|
|||||||
AddComponent(saveDescriptionLabel);
|
AddComponent(saveDescriptionLabel);
|
||||||
|
|
||||||
if(showAvatars)
|
if(showAvatars)
|
||||||
authorDateLabel = new ui::Label(ui::Point(39, (YRES/2)+4+15), ui::Point(180, 16), ""_ascii);
|
authorDateLabel = new ui::Label(ui::Point(39, (YRES/2)+4+15), ui::Point(180, 16), "");
|
||||||
else
|
else
|
||||||
authorDateLabel = new ui::Label(ui::Point(5, (YRES/2)+4+15), ui::Point(200, 16), ""_ascii);
|
authorDateLabel = new ui::Label(ui::Point(5, (YRES/2)+4+15), ui::Point(200, 16), "");
|
||||||
authorDateLabel->Appearance.HorizontalAlign = ui::Appearance::AlignLeft;
|
authorDateLabel->Appearance.HorizontalAlign = ui::Appearance::AlignLeft;
|
||||||
authorDateLabel->Appearance.VerticalAlign = ui::Appearance::AlignMiddle;
|
authorDateLabel->Appearance.VerticalAlign = ui::Appearance::AlignMiddle;
|
||||||
AddComponent(authorDateLabel);
|
AddComponent(authorDateLabel);
|
||||||
@ -131,12 +131,12 @@ PreviewView::PreviewView():
|
|||||||
AddComponent(avatarButton);
|
AddComponent(avatarButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
viewsLabel = new ui::Label(ui::Point((XRES/2)-80, (YRES/2)+4+15), ui::Point(80, 16), ""_ascii);
|
viewsLabel = new ui::Label(ui::Point((XRES/2)-80, (YRES/2)+4+15), ui::Point(80, 16), "");
|
||||||
viewsLabel->Appearance.HorizontalAlign = ui::Appearance::AlignRight;
|
viewsLabel->Appearance.HorizontalAlign = ui::Appearance::AlignRight;
|
||||||
viewsLabel->Appearance.VerticalAlign = ui::Appearance::AlignMiddle;
|
viewsLabel->Appearance.VerticalAlign = ui::Appearance::AlignMiddle;
|
||||||
AddComponent(viewsLabel);
|
AddComponent(viewsLabel);
|
||||||
|
|
||||||
pageInfo = new ui::Label(ui::Point((XRES/2) + 85, Size.Y+1), ui::Point(70, 16), ""_ascii);
|
pageInfo = new ui::Label(ui::Point((XRES/2) + 85, Size.Y+1), ui::Point(70, 16), "");
|
||||||
pageInfo->Appearance.HorizontalAlign = ui::Appearance::AlignCentre;
|
pageInfo->Appearance.HorizontalAlign = ui::Appearance::AlignCentre;
|
||||||
AddComponent(pageInfo);
|
AddComponent(pageInfo);
|
||||||
|
|
||||||
@ -211,7 +211,7 @@ bool PreviewView::CheckSwearing(String text)
|
|||||||
for(auto const &pair : swearWords)
|
for(auto const &pair : swearWords)
|
||||||
for(size_t i = 0; i + pair.second <= bytes.length(); i++)
|
for(size_t i = 0; i + pair.second <= bytes.length(); i++)
|
||||||
{
|
{
|
||||||
md5_ascii(hash, (unsigned char *)(bytes.data() + i), pair.second);
|
md5(hash, (unsigned char *)(bytes.data() + i), pair.second);
|
||||||
if(pair.first == hash)
|
if(pair.first == hash)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -223,7 +223,7 @@ void PreviewView::CheckComment()
|
|||||||
if (!commentWarningLabel)
|
if (!commentWarningLabel)
|
||||||
return;
|
return;
|
||||||
String text = addCommentBox->GetText().ToLower();
|
String text = addCommentBox->GetText().ToLower();
|
||||||
if (!userIsAuthor && (text.Contains("stolen"_ascii) || text.Contains("copied"_ascii)))
|
if (!userIsAuthor && (text.Contains("stolen") || text.Contains("copied")))
|
||||||
{
|
{
|
||||||
if (!commentHelpText)
|
if (!commentHelpText)
|
||||||
{
|
{
|
||||||
@ -234,7 +234,7 @@ void PreviewView::CheckComment()
|
|||||||
commentHelpText = true;
|
commentHelpText = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (userIsAuthor && text.Contains("vote"_ascii))
|
else if (userIsAuthor && text.Contains("vote"))
|
||||||
{
|
{
|
||||||
commentWarningLabel->SetText("Do not ask for votes"_i18n);
|
commentWarningLabel->SetText("Do not ask for votes"_i18n);
|
||||||
commentHelpText = true;
|
commentHelpText = true;
|
||||||
@ -438,11 +438,11 @@ void PreviewView::NotifySaveChanged(PreviewModel * sender)
|
|||||||
if (showAvatars)
|
if (showAvatars)
|
||||||
{
|
{
|
||||||
avatarButton->SetUsername(save->userName);
|
avatarButton->SetUsername(save->userName);
|
||||||
authorDateLabel->SetText("\bw"_ascii + save->userName.FromUtf8() + " \bg"_ascii + dateType + " \bw"_ascii + format::UnixtimeToDateMini(save->updatedDate).FromAscii());
|
authorDateLabel->SetText("\bw" + save->userName.FromUtf8() + " \bg" + dateType + " \bw" + format::UnixtimeToDateMini(save->updatedDate).FromAscii());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
authorDateLabel->SetText("\bgAuthor:\bw "_i18n + save->userName.FromUtf8() + " \bg"_ascii + dateType + " \bw"_ascii + format::UnixtimeToDateMini(save->updatedDate).FromAscii());
|
authorDateLabel->SetText("\bgAuthor:\bw "_i18n + save->userName.FromUtf8() + " \bg" + dateType + " \bw" + format::UnixtimeToDateMini(save->updatedDate).FromAscii());
|
||||||
}
|
}
|
||||||
if (Client::Ref().GetAuthUser().UserID && save->userName == Client::Ref().GetAuthUser().Username)
|
if (Client::Ref().GetAuthUser().UserID && save->userName == Client::Ref().GetAuthUser().Username)
|
||||||
userIsAuthor = true;
|
userIsAuthor = true;
|
||||||
@ -490,9 +490,9 @@ void PreviewView::NotifySaveChanged(PreviewModel * sender)
|
|||||||
{
|
{
|
||||||
votesUp = 0;
|
votesUp = 0;
|
||||||
votesDown = 0;
|
votesDown = 0;
|
||||||
saveNameLabel->SetText(""_ascii);
|
saveNameLabel->SetText("");
|
||||||
authorDateLabel->SetText(""_ascii);
|
authorDateLabel->SetText("");
|
||||||
saveDescriptionLabel->SetText(""_ascii);
|
saveDescriptionLabel->SetText("");
|
||||||
favButton->Enabled = false;
|
favButton->Enabled = false;
|
||||||
if (!sender->GetCanOpen())
|
if (!sender->GetCanOpen())
|
||||||
openButton->Enabled = false;
|
openButton->Enabled = false;
|
||||||
@ -505,7 +505,7 @@ void PreviewView::submitComment()
|
|||||||
{
|
{
|
||||||
String comment = addCommentBox->GetText();
|
String comment = addCommentBox->GetText();
|
||||||
submitCommentButton->Enabled = false;
|
submitCommentButton->Enabled = false;
|
||||||
addCommentBox->SetText(""_ascii);
|
addCommentBox->SetText("");
|
||||||
addCommentBox->SetPlaceholder("Submitting comment"_i18n); //This doesn't appear to ever show since no separate thread is created
|
addCommentBox->SetPlaceholder("Submitting comment"_i18n); //This doesn't appear to ever show since no separate thread is created
|
||||||
FocusComponent(NULL);
|
FocusComponent(NULL);
|
||||||
|
|
||||||
@ -540,7 +540,7 @@ void PreviewView::NotifyCommentBoxEnabledChanged(PreviewModel * sender)
|
|||||||
commentBoxSizeX = Size.X-(XRES/2)-48;
|
commentBoxSizeX = Size.X-(XRES/2)-48;
|
||||||
commentBoxSizeY = 17;
|
commentBoxSizeY = 17;
|
||||||
|
|
||||||
addCommentBox = new ui::Textbox(ui::Point((XRES/2)+4, Size.Y-19), ui::Point(Size.X-(XRES/2)-48, 17), ""_ascii, "Add Comment"_i18n);
|
addCommentBox = new ui::Textbox(ui::Point((XRES/2)+4, Size.Y-19), ui::Point(Size.X-(XRES/2)-48, 17), "", "Add Comment"_i18n);
|
||||||
addCommentBox->SetActionCallback({ [this] {
|
addCommentBox->SetActionCallback({ [this] {
|
||||||
CheckComment();
|
CheckComment();
|
||||||
commentBoxAutoHeight();
|
commentBoxAutoHeight();
|
||||||
|
@ -17,7 +17,7 @@ ProfileActivity::ProfileActivity(ByteString username) :
|
|||||||
loading(false),
|
loading(false),
|
||||||
saving(false),
|
saving(false),
|
||||||
doError(false),
|
doError(false),
|
||||||
doErrorMessage(""_ascii)
|
doErrorMessage("")
|
||||||
{
|
{
|
||||||
editable = Client::Ref().GetAuthUser().UserID && Client::Ref().GetAuthUser().Username == username;
|
editable = Client::Ref().GetAuthUser().UserID && Client::Ref().GetAuthUser().Username == username;
|
||||||
|
|
||||||
|
@ -21,12 +21,12 @@ public:
|
|||||||
RenderView::RenderView():
|
RenderView::RenderView():
|
||||||
ui::Window(ui::Point(0, 0), ui::Point(XRES, WINDOWH)),
|
ui::Window(ui::Point(0, 0), ui::Point(XRES, WINDOWH)),
|
||||||
ren(NULL),
|
ren(NULL),
|
||||||
toolTip(""_ascii),
|
toolTip(""),
|
||||||
toolTipPresence(0),
|
toolTipPresence(0),
|
||||||
isToolTipFadingIn(false)
|
isToolTipFadingIn(false)
|
||||||
{
|
{
|
||||||
auto addPresetButton = [this](int index, Icon icon, ui::Point offset, String tooltip) {
|
auto addPresetButton = [this](int index, Icon icon, ui::Point offset, String tooltip) {
|
||||||
auto *presetButton = new ui::Button(ui::Point(XRES, YRES) + offset, ui::Point(30, 13), ""_ascii, tooltip);
|
auto *presetButton = new ui::Button(ui::Point(XRES, YRES) + offset, ui::Point(30, 13), "", tooltip);
|
||||||
presetButton->SetIcon(icon);
|
presetButton->SetIcon(icon);
|
||||||
presetButton->SetActionCallback({ [this, index] { c->LoadRenderPreset(index); } });
|
presetButton->SetActionCallback({ [this, index] { c->LoadRenderPreset(index); } });
|
||||||
AddComponent(presetButton);
|
AddComponent(presetButton);
|
||||||
@ -44,7 +44,7 @@ RenderView::RenderView():
|
|||||||
addPresetButton(10, IconLife , ui::Point(-232, 6), "Life display mode preset"_i18n);
|
addPresetButton(10, IconLife , ui::Point(-232, 6), "Life display mode preset"_i18n);
|
||||||
|
|
||||||
auto addRenderModeCheckbox = [this](unsigned int mode, Icon icon, ui::Point offset, String tooltip) {
|
auto addRenderModeCheckbox = [this](unsigned int mode, Icon icon, ui::Point offset, String tooltip) {
|
||||||
auto *renderModeCheckbox = new ModeCheckbox(ui::Point(0, YRES) + offset, ui::Point(30, 16), ""_ascii, tooltip);
|
auto *renderModeCheckbox = new ModeCheckbox(ui::Point(0, YRES) + offset, ui::Point(30, 16), "", tooltip);
|
||||||
renderModes.push_back(renderModeCheckbox);
|
renderModes.push_back(renderModeCheckbox);
|
||||||
renderModeCheckbox->mode = mode;
|
renderModeCheckbox->mode = mode;
|
||||||
renderModeCheckbox->SetIcon(icon);
|
renderModeCheckbox->SetIcon(icon);
|
||||||
@ -65,7 +65,7 @@ RenderView::RenderView():
|
|||||||
addRenderModeCheckbox(RENDER_SPRK, IconEffect, ui::Point(97, 4), "Glow effect on sparks"_i18n);
|
addRenderModeCheckbox(RENDER_SPRK, IconEffect, ui::Point(97, 4), "Glow effect on sparks"_i18n);
|
||||||
|
|
||||||
auto addDisplayModeCheckbox = [this](unsigned int mode, Icon icon, ui::Point offset, String tooltip) {
|
auto addDisplayModeCheckbox = [this](unsigned int mode, Icon icon, ui::Point offset, String tooltip) {
|
||||||
auto *displayModeCheckbox = new ModeCheckbox(ui::Point(0, YRES) + offset, ui::Point(30, 16), ""_ascii, tooltip);
|
auto *displayModeCheckbox = new ModeCheckbox(ui::Point(0, YRES) + offset, ui::Point(30, 16), "", tooltip);
|
||||||
displayModes.push_back(displayModeCheckbox);
|
displayModes.push_back(displayModeCheckbox);
|
||||||
displayModeCheckbox->mode = mode;
|
displayModeCheckbox->mode = mode;
|
||||||
displayModeCheckbox->SetIcon(icon);
|
displayModeCheckbox->SetIcon(icon);
|
||||||
@ -95,7 +95,7 @@ RenderView::RenderView():
|
|||||||
line3 = 270;
|
line3 = 270;
|
||||||
|
|
||||||
auto addColourModeCheckbox = [this](unsigned int mode, Icon icon, ui::Point offset, String tooltip) {
|
auto addColourModeCheckbox = [this](unsigned int mode, Icon icon, ui::Point offset, String tooltip) {
|
||||||
auto *colourModeCheckbox = new ModeCheckbox(ui::Point(0, YRES) + offset, ui::Point(30, 16), ""_ascii, tooltip);
|
auto *colourModeCheckbox = new ModeCheckbox(ui::Point(0, YRES) + offset, ui::Point(30, 16), "", tooltip);
|
||||||
colourModes.push_back(colourModeCheckbox);
|
colourModes.push_back(colourModeCheckbox);
|
||||||
colourModeCheckbox->mode = mode;
|
colourModeCheckbox->mode = mode;
|
||||||
colourModeCheckbox->SetIcon(icon);
|
colourModeCheckbox->SetIcon(icon);
|
||||||
|
@ -76,7 +76,7 @@ void LocalSaveActivity::OnTick(float dt)
|
|||||||
|
|
||||||
void LocalSaveActivity::Save()
|
void LocalSaveActivity::Save()
|
||||||
{
|
{
|
||||||
if (filenameField->GetText().Contains('/') || filenameField->GetText().BeginsWith("."_ascii))
|
if (filenameField->GetText().Contains('/') || filenameField->GetText().BeginsWith("."))
|
||||||
{
|
{
|
||||||
new ErrorMessage("Error"_i18n, "Invalid filename."_i18n);
|
new ErrorMessage("Error"_i18n, "Invalid filename."_i18n);
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ ServerSaveActivity::ServerSaveActivity(SaveInfo save, OnUploaded onUploaded_) :
|
|||||||
onUploaded(onUploaded_),
|
onUploaded(onUploaded_),
|
||||||
saveUploadTask(NULL)
|
saveUploadTask(NULL)
|
||||||
{
|
{
|
||||||
titleLabel = new ui::Label(ui::Point(4, 5), ui::Point((Size.X/2)-8, 16), ""_ascii);
|
titleLabel = new ui::Label(ui::Point(4, 5), ui::Point((Size.X/2)-8, 16), "");
|
||||||
titleLabel->SetTextColour(style::Colour::InformationTitle);
|
titleLabel->SetTextColour(style::Colour::InformationTitle);
|
||||||
titleLabel->Appearance.HorizontalAlign = ui::Appearance::AlignLeft;
|
titleLabel->Appearance.HorizontalAlign = ui::Appearance::AlignLeft;
|
||||||
titleLabel->Appearance.VerticalAlign = ui::Appearance::AlignMiddle;
|
titleLabel->Appearance.VerticalAlign = ui::Appearance::AlignMiddle;
|
||||||
@ -88,7 +88,7 @@ ServerSaveActivity::ServerSaveActivity(SaveInfo save, OnUploaded onUploaded_) :
|
|||||||
descriptionField->Appearance.HorizontalAlign = ui::Appearance::AlignLeft;
|
descriptionField->Appearance.HorizontalAlign = ui::Appearance::AlignLeft;
|
||||||
AddComponent(descriptionField);
|
AddComponent(descriptionField);
|
||||||
|
|
||||||
publishedCheckbox = new ui::Checkbox(ui::Point(8, 45), ui::Point((Size.X/2)-80, 16), "Publish"_i18n, ""_ascii);
|
publishedCheckbox = new ui::Checkbox(ui::Point(8, 45), ui::Point((Size.X/2)-80, 16), "Publish"_i18n, "");
|
||||||
if(Client::Ref().GetAuthUser().Username != save.GetUserName())
|
if(Client::Ref().GetAuthUser().Username != save.GetUserName())
|
||||||
{
|
{
|
||||||
//Save is not owned by the user, disable by default
|
//Save is not owned by the user, disable by default
|
||||||
@ -101,7 +101,7 @@ ServerSaveActivity::ServerSaveActivity(SaveInfo save, OnUploaded onUploaded_) :
|
|||||||
}
|
}
|
||||||
AddComponent(publishedCheckbox);
|
AddComponent(publishedCheckbox);
|
||||||
|
|
||||||
pausedCheckbox = new ui::Checkbox(ui::Point(160, 45), ui::Point(55, 16), "Paused"_i18n, ""_ascii);
|
pausedCheckbox = new ui::Checkbox(ui::Point(160, 45), ui::Point(55, 16), "Paused"_i18n, "");
|
||||||
pausedCheckbox->SetChecked(save.GetGameSave()->paused);
|
pausedCheckbox->SetChecked(save.GetGameSave()->paused);
|
||||||
AddComponent(pausedCheckbox);
|
AddComponent(pausedCheckbox);
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ SearchController::SearchController(std::function<void ()> onDone_):
|
|||||||
searchModel->AddObserver(searchView);
|
searchModel->AddObserver(searchView);
|
||||||
searchView->AttachController(this);
|
searchView->AttachController(this);
|
||||||
|
|
||||||
searchModel->UpdateSaveList(1, ""_ascii);
|
searchModel->UpdateSaveList(1, "");
|
||||||
|
|
||||||
onDone = onDone_;
|
onDone = onDone_;
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,7 @@ void SearchModel::updateSaveListT()
|
|||||||
void SearchModel::updateTagListT()
|
void SearchModel::updateTagListT()
|
||||||
{
|
{
|
||||||
int tagResultCount;
|
int tagResultCount;
|
||||||
std::vector<std::pair<ByteString, int> > * tagList = Client::Ref().GetTags(0, 24, ""_ascii, tagResultCount);
|
std::vector<std::pair<ByteString, int> > * tagList = Client::Ref().GetTags(0, 24, "", tagResultCount);
|
||||||
|
|
||||||
updateTagListResult = tagList;
|
updateTagListResult = tagList;
|
||||||
updateTagListFinished = true;
|
updateTagListFinished = true;
|
||||||
@ -66,13 +66,13 @@ bool SearchModel::UpdateSaveList(int pageNumber, String query)
|
|||||||
if (!updateSaveListWorking)
|
if (!updateSaveListWorking)
|
||||||
{
|
{
|
||||||
lastQuery = query;
|
lastQuery = query;
|
||||||
lastError = ""_ascii;
|
lastError = "";
|
||||||
saveListLoaded = false;
|
saveListLoaded = false;
|
||||||
saveList.clear();
|
saveList.clear();
|
||||||
//resultCount = 0;
|
//resultCount = 0;
|
||||||
currentPage = pageNumber;
|
currentPage = pageNumber;
|
||||||
|
|
||||||
if(pageNumber == 1 && !showOwn && !showFavourite && currentSort == "best" && query == ""_ascii)
|
if(pageNumber == 1 && !showOwn && !showFavourite && currentSort == "best" && query == "")
|
||||||
SetShowTags(true);
|
SetShowTags(true);
|
||||||
else
|
else
|
||||||
SetShowTags(false);
|
SetShowTags(false);
|
||||||
@ -133,7 +133,7 @@ void SearchModel::Update()
|
|||||||
if(updateSaveListFinished)
|
if(updateSaveListFinished)
|
||||||
{
|
{
|
||||||
updateSaveListWorking = false;
|
updateSaveListWorking = false;
|
||||||
lastError = ""_ascii;
|
lastError = "";
|
||||||
saveListLoaded = true;
|
saveListLoaded = true;
|
||||||
|
|
||||||
std::vector<SaveInfo *> *tempSaveList = updateSaveListResult;
|
std::vector<SaveInfo *> *tempSaveList = updateSaveListResult;
|
||||||
@ -149,7 +149,7 @@ void SearchModel::Update()
|
|||||||
{
|
{
|
||||||
lastError = Client::Ref().GetLastError();
|
lastError = Client::Ref().GetLastError();
|
||||||
if (lastError == "Unspecified Error"_i18n)
|
if (lastError == "Unspecified Error"_i18n)
|
||||||
lastError = ""_ascii;
|
lastError = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
resultCount = thResultCount;
|
resultCount = thResultCount;
|
||||||
@ -286,7 +286,7 @@ SearchModel::~SearchModel()
|
|||||||
|
|
||||||
int SearchModel::GetPageCount()
|
int SearchModel::GetPageCount()
|
||||||
{
|
{
|
||||||
if (!showOwn && !showFavourite && currentSort == "best" && lastQuery == ""_ascii)
|
if (!showOwn && !showFavourite && currentSort == "best" && lastQuery == "")
|
||||||
return std::max(1, (int)(ceil(resultCount/20.0f))+1); //add one for front page (front page saves are repeated twice)
|
return std::max(1, (int)(ceil(resultCount/20.0f))+1); //add one for front page (front page saves are repeated twice)
|
||||||
else
|
else
|
||||||
return std::max(1, (int)(ceil(resultCount/20.0f)));
|
return std::max(1, (int)(ceil(resultCount/20.0f)));
|
||||||
|
@ -45,19 +45,19 @@ SearchView::SearchView():
|
|||||||
}
|
}
|
||||||
catch (std::exception & e) { }
|
catch (std::exception & e) { }
|
||||||
|
|
||||||
pageTextbox = new ui::Textbox(ui::Point(283, WINDOWH-18), ui::Point(41, 16), ""_ascii);
|
pageTextbox = new ui::Textbox(ui::Point(283, WINDOWH-18), ui::Point(41, 16), "");
|
||||||
pageTextbox->SetActionCallback({ [this] { textChanged(); } });
|
pageTextbox->SetActionCallback({ [this] { textChanged(); } });
|
||||||
pageTextbox->SetInputType(ui::Textbox::Number);
|
pageTextbox->SetInputType(ui::Textbox::Number);
|
||||||
auto pageOf = i18nMulti("Page", "of "); //page [TEXTBOX] of y
|
auto pageOf = i18nMulti("Page", "of "); //page [TEXTBOX] of y
|
||||||
pageLabel = new ui::Label(ui::Point(0, WINDOWH-18), ui::Point(30, 16), pageOf[0]);
|
pageLabel = new ui::Label(ui::Point(0, WINDOWH-18), ui::Point(30, 16), pageOf[0]);
|
||||||
pageLabel->Appearance.HorizontalAlign = ui::Appearance::AlignRight;
|
pageLabel->Appearance.HorizontalAlign = ui::Appearance::AlignRight;
|
||||||
pageCountLabel = new ui::Label(ui::Point(WINDOWW/2+6, WINDOWH-18), ui::Point(50, 16), ""_ascii);
|
pageCountLabel = new ui::Label(ui::Point(WINDOWW/2+6, WINDOWH-18), ui::Point(50, 16), "");
|
||||||
pageCountLabel->Appearance.HorizontalAlign = ui::Appearance::AlignLeft;
|
pageCountLabel->Appearance.HorizontalAlign = ui::Appearance::AlignLeft;
|
||||||
AddComponent(pageLabel);
|
AddComponent(pageLabel);
|
||||||
AddComponent(pageCountLabel);
|
AddComponent(pageCountLabel);
|
||||||
AddComponent(pageTextbox);
|
AddComponent(pageTextbox);
|
||||||
|
|
||||||
searchField = new ui::Textbox(ui::Point(60, 10), ui::Point(WINDOWW-238, 17), ""_ascii, "[search]"_i18n);
|
searchField = new ui::Textbox(ui::Point(60, 10), ui::Point(WINDOWW-238, 17), "", "[search]"_i18n);
|
||||||
searchField->Appearance.icon = IconSearch;
|
searchField->Appearance.icon = IconSearch;
|
||||||
searchField->Appearance.HorizontalAlign = ui::Appearance::AlignLeft;
|
searchField->Appearance.HorizontalAlign = ui::Appearance::AlignLeft;
|
||||||
searchField->Appearance.VerticalAlign = ui::Appearance::AlignMiddle;
|
searchField->Appearance.VerticalAlign = ui::Appearance::AlignMiddle;
|
||||||
@ -80,7 +80,7 @@ SearchView::SearchView():
|
|||||||
ownButton->Appearance.VerticalAlign = ui::Appearance::AlignMiddle;
|
ownButton->Appearance.VerticalAlign = ui::Appearance::AlignMiddle;
|
||||||
AddComponent(ownButton);
|
AddComponent(ownButton);
|
||||||
|
|
||||||
favButton = new ui::Button(searchField->Position+ui::Point(searchField->Size.X+15, 0), ui::Point(17, 17), ""_ascii);
|
favButton = new ui::Button(searchField->Position+ui::Point(searchField->Size.X+15, 0), ui::Point(17, 17), "");
|
||||||
favButton->SetIcon(IconFavourite);
|
favButton->SetIcon(IconFavourite);
|
||||||
favButton->SetTogglable(true);
|
favButton->SetTogglable(true);
|
||||||
favButton->Appearance.Margin.Left+=2;
|
favButton->Appearance.Margin.Left+=2;
|
||||||
@ -90,7 +90,7 @@ SearchView::SearchView():
|
|||||||
favButton->Appearance.BorderInactive = ui::Colour(170,170,170);
|
favButton->Appearance.BorderInactive = ui::Colour(170,170,170);
|
||||||
AddComponent(favButton);
|
AddComponent(favButton);
|
||||||
|
|
||||||
ui::Button * clearSearchButton = new ui::Button(searchField->Position+ui::Point(searchField->Size.X-1, 0), ui::Point(17, 17), ""_ascii);
|
ui::Button * clearSearchButton = new ui::Button(searchField->Position+ui::Point(searchField->Size.X-1, 0), ui::Point(17, 17), "");
|
||||||
clearSearchButton->SetIcon(IconClose);
|
clearSearchButton->SetIcon(IconClose);
|
||||||
clearSearchButton->SetActionCallback({ [this] { clearSearch(); } });
|
clearSearchButton->SetActionCallback({ [this] { clearSearch(); } });
|
||||||
clearSearchButton->Appearance.Margin.Left+=2;
|
clearSearchButton->Appearance.Margin.Left+=2;
|
||||||
@ -167,7 +167,7 @@ void SearchView::doSearch()
|
|||||||
|
|
||||||
void SearchView::clearSearch()
|
void SearchView::clearSearch()
|
||||||
{
|
{
|
||||||
searchField->SetText(""_ascii);
|
searchField->SetText("");
|
||||||
c->DoSearch(searchField->GetText(), true);
|
c->DoSearch(searchField->GetText(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -513,7 +513,7 @@ void SearchView::NotifySaveListChanged(SearchModel * sender)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(sender->GetLastError().length())
|
if(sender->GetLastError().length())
|
||||||
errorLabel->SetText("\bo"_ascii + sender->GetLastError());
|
errorLabel->SetText("\bo" + sender->GetLastError());
|
||||||
else
|
else
|
||||||
errorLabel->SetText("\boNo saves found"_i18n);
|
errorLabel->SetText("\boNo saves found"_i18n);
|
||||||
}
|
}
|
||||||
@ -568,8 +568,8 @@ void SearchView::NotifySaveListChanged(SearchModel * sender)
|
|||||||
saveButton->AddContextMenu(0);
|
saveButton->AddContextMenu(0);
|
||||||
saveButton->SetActionCallback({
|
saveButton->SetActionCallback({
|
||||||
[this, saveButton] { c->OpenSave(saveButton->GetSave()->GetID(), saveButton->GetSave()->GetVersion()); },
|
[this, saveButton] { c->OpenSave(saveButton->GetSave()->GetID(), saveButton->GetSave()->GetVersion()); },
|
||||||
[this, saveButton] { Search(String::Build("history:"_ascii, saveButton->GetSave()->GetID())); },
|
[this, saveButton] { Search(String::Build("history:", saveButton->GetSave()->GetID())); },
|
||||||
[this, saveButton] { Search(String::Build("user:"_ascii, saveButton->GetSave()->GetUserName().FromUtf8())); },
|
[this, saveButton] { Search(String::Build("user:", saveButton->GetSave()->GetUserName().FromUtf8())); },
|
||||||
[this, saveButton] { c->Selected(saveButton->GetSave()->GetID(), saveButton->GetSelected()); }
|
[this, saveButton] { c->Selected(saveButton->GetSave()->GetID(), saveButton->GetSelected()); }
|
||||||
});
|
});
|
||||||
if(Client::Ref().GetAuthUser().UserID)
|
if(Client::Ref().GetAuthUser().UserID)
|
||||||
|
@ -25,7 +25,7 @@ TagsView::TagsView():
|
|||||||
AddComponent(closeButton);
|
AddComponent(closeButton);
|
||||||
SetCancelButton(closeButton);
|
SetCancelButton(closeButton);
|
||||||
|
|
||||||
tagInput = new ui::Textbox(ui::Point(8, Size.Y-40), ui::Point(Size.X-60, 16), ""_ascii, "[new tag]"_i18n);
|
tagInput = new ui::Textbox(ui::Point(8, Size.Y-40), ui::Point(Size.X-60, 16), "", "[new tag]"_i18n);
|
||||||
tagInput->Appearance.icon = IconTag;
|
tagInput->Appearance.icon = IconTag;
|
||||||
tagInput->Appearance.HorizontalAlign = ui::Appearance::AlignLeft;
|
tagInput->Appearance.HorizontalAlign = ui::Appearance::AlignLeft;
|
||||||
tagInput->Appearance.VerticalAlign = ui::Appearance::AlignMiddle;
|
tagInput->Appearance.VerticalAlign = ui::Appearance::AlignMiddle;
|
||||||
@ -132,5 +132,5 @@ void TagsView::addTag()
|
|||||||
{
|
{
|
||||||
new ErrorMessage("Could not add tag"_i18n, ByteString(ex.what()).FromUtf8());
|
new ErrorMessage("Could not add tag"_i18n, ByteString(ex.what()).FromUtf8());
|
||||||
}
|
}
|
||||||
tagInput->SetText(""_ascii);
|
tagInput->SetText("");
|
||||||
}
|
}
|
||||||
|
@ -560,12 +560,12 @@ int luatpt_setconsole(lua_State* l)
|
|||||||
int luatpt_log(lua_State* l)
|
int luatpt_log(lua_State* l)
|
||||||
{
|
{
|
||||||
int args = lua_gettop(l);
|
int args = lua_gettop(l);
|
||||||
String text = ""_ascii;
|
String text = "";
|
||||||
for(int i = 1; i <= args; i++)
|
for(int i = 1; i <= args; i++)
|
||||||
{
|
{
|
||||||
luaL_tostring(l, -1);
|
luaL_tostring(l, -1);
|
||||||
if(text.length())
|
if(text.length())
|
||||||
text=ByteString(luaL_optstring(l, -1, "")).FromUtf8() + ", "_ascii + text;
|
text=ByteString(luaL_optstring(l, -1, "")).FromUtf8() + ", " + text;
|
||||||
else
|
else
|
||||||
text=ByteString(luaL_optstring(l, -1, "")).FromUtf8();
|
text=ByteString(luaL_optstring(l, -1, "")).FromUtf8();
|
||||||
lua_pop(l, 2);
|
lua_pop(l, 2);
|
||||||
@ -573,7 +573,7 @@ int luatpt_log(lua_State* l)
|
|||||||
if((*luacon_currentCommand))
|
if((*luacon_currentCommand))
|
||||||
{
|
{
|
||||||
if(luacon_lastError->length())
|
if(luacon_lastError->length())
|
||||||
*luacon_lastError += "; "_ascii;
|
*luacon_lastError += "; ";
|
||||||
*luacon_lastError += text;
|
*luacon_lastError += text;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -29,7 +29,7 @@ LuaCheckbox::LuaCheckbox(lua_State * l) :
|
|||||||
int sizeY = luaL_optinteger(l, 4, 10);
|
int sizeY = luaL_optinteger(l, 4, 10);
|
||||||
String text = ByteString(luaL_optstring(l, 5, "")).FromUtf8();
|
String text = ByteString(luaL_optstring(l, 5, "")).FromUtf8();
|
||||||
|
|
||||||
checkbox = new ui::Checkbox(ui::Point(posX, posY), ui::Point(sizeX, sizeY), text, ""_ascii);
|
checkbox = new ui::Checkbox(ui::Point(posX, posY), ui::Point(sizeX, sizeY), text, "");
|
||||||
component = checkbox;
|
component = checkbox;
|
||||||
checkbox->SetActionCallback({ [this] { triggerAction(); } });
|
checkbox->SetActionCallback({ [this] { triggerAction(); } });
|
||||||
}
|
}
|
||||||
|
@ -221,7 +221,7 @@ LuaScriptInterface::LuaScriptInterface(GameController * c, GameModel * m):
|
|||||||
luacon_currentCommand = ¤tCommand;
|
luacon_currentCommand = ¤tCommand;
|
||||||
luacon_lastError = &lastError;
|
luacon_lastError = &lastError;
|
||||||
|
|
||||||
lastCode = ""_ascii;
|
lastCode = "";
|
||||||
|
|
||||||
//Replace print function with our screen logging thingy
|
//Replace print function with our screen logging thingy
|
||||||
lua_pushcfunction(l, luatpt_log);
|
lua_pushcfunction(l, luatpt_log);
|
||||||
@ -2703,7 +2703,7 @@ void luaCreateWrapper(ELEMENT_CREATE_FUNC_ARGS)
|
|||||||
lua_pushinteger(luacon_ci->l, v);
|
lua_pushinteger(luacon_ci->l, v);
|
||||||
if (lua_pcall(luacon_ci->l, 5, 0, 0))
|
if (lua_pcall(luacon_ci->l, 5, 0, 0))
|
||||||
{
|
{
|
||||||
luacon_ci->Log(CommandInterface::LogError, "In create func: "_ascii + luacon_geterror().FromUtf8());
|
luacon_ci->Log(CommandInterface::LogError, "In create func: " + luacon_geterror().FromUtf8());
|
||||||
lua_pop(luacon_ci->l, 1);
|
lua_pop(luacon_ci->l, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2721,7 +2721,7 @@ bool luaCreateAllowedWrapper(ELEMENT_CREATE_ALLOWED_FUNC_ARGS)
|
|||||||
lua_pushinteger(luacon_ci->l, t);
|
lua_pushinteger(luacon_ci->l, t);
|
||||||
if (lua_pcall(luacon_ci->l, 4, 1, 0))
|
if (lua_pcall(luacon_ci->l, 4, 1, 0))
|
||||||
{
|
{
|
||||||
luacon_ci->Log(CommandInterface::LogError, "In create allowed: "_ascii + luacon_geterror().FromUtf8());
|
luacon_ci->Log(CommandInterface::LogError, "In create allowed: " + luacon_geterror().FromUtf8());
|
||||||
lua_pop(luacon_ci->l, 1);
|
lua_pop(luacon_ci->l, 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -2746,7 +2746,7 @@ void luaChangeTypeWrapper(ELEMENT_CHANGETYPE_FUNC_ARGS)
|
|||||||
lua_pushinteger(luacon_ci->l, to);
|
lua_pushinteger(luacon_ci->l, to);
|
||||||
if (lua_pcall(luacon_ci->l, 5, 0, 0))
|
if (lua_pcall(luacon_ci->l, 5, 0, 0))
|
||||||
{
|
{
|
||||||
luacon_ci->Log(CommandInterface::LogError, "In change type: "_ascii + luacon_geterror().FromUtf8());
|
luacon_ci->Log(CommandInterface::LogError, "In change type: " + luacon_geterror().FromUtf8());
|
||||||
lua_pop(luacon_ci->l, 1);
|
lua_pop(luacon_ci->l, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3916,7 +3916,7 @@ int LuaScriptInterface::Command(String command)
|
|||||||
{
|
{
|
||||||
if (command[0] == '!')
|
if (command[0] == '!')
|
||||||
{
|
{
|
||||||
lastError = ""_ascii;
|
lastError = "";
|
||||||
int ret = legacy->Command(command.Substr(1));
|
int ret = legacy->Command(command.Substr(1));
|
||||||
lastError = legacy->GetLastError();
|
lastError = legacy->GetLastError();
|
||||||
return ret;
|
return ret;
|
||||||
@ -3924,13 +3924,13 @@ int LuaScriptInterface::Command(String command)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
int level = lua_gettop(l), ret = -1;
|
int level = lua_gettop(l), ret = -1;
|
||||||
String text = ""_ascii;
|
String text = "";
|
||||||
lastError = ""_ascii;
|
lastError = "";
|
||||||
currentCommand = true;
|
currentCommand = true;
|
||||||
if (lastCode.length())
|
if (lastCode.length())
|
||||||
lastCode += "\n"_ascii;
|
lastCode += "\n";
|
||||||
lastCode += command;
|
lastCode += command;
|
||||||
ByteString tmp = ("return "_ascii + lastCode).ToUtf8();
|
ByteString tmp = ("return " + lastCode).ToUtf8();
|
||||||
ui::Engine::Ref().LastTick(Platform::GetTime());
|
ui::Engine::Ref().LastTick(Platform::GetTime());
|
||||||
luaL_loadbuffer(l, tmp.c_str(), tmp.length(), "@console");
|
luaL_loadbuffer(l, tmp.c_str(), tmp.length(), "@console");
|
||||||
if (lua_type(l, -1) != LUA_TFUNCTION)
|
if (lua_type(l, -1) != LUA_TFUNCTION)
|
||||||
@ -3944,13 +3944,13 @@ int LuaScriptInterface::Command(String command)
|
|||||||
ByteString err = luacon_geterror();
|
ByteString err = luacon_geterror();
|
||||||
lastError = err.FromUtf8();
|
lastError = err.FromUtf8();
|
||||||
if (err.Contains("near '<eof>'")) //the idea stolen from lua-5.1.5/lua.c
|
if (err.Contains("near '<eof>'")) //the idea stolen from lua-5.1.5/lua.c
|
||||||
lastError = "..."_ascii;
|
lastError = "...";
|
||||||
else
|
else
|
||||||
lastCode = ""_ascii;
|
lastCode = "";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
lastCode = ""_ascii;
|
lastCode = "";
|
||||||
ret = lua_pcall(l, 0, LUA_MULTRET, 0);
|
ret = lua_pcall(l, 0, LUA_MULTRET, 0);
|
||||||
if (ret)
|
if (ret)
|
||||||
lastError = luacon_geterror().FromUtf8();
|
lastError = luacon_geterror().FromUtf8();
|
||||||
@ -3960,7 +3960,7 @@ int LuaScriptInterface::Command(String command)
|
|||||||
{
|
{
|
||||||
luaL_tostring(l, level);
|
luaL_tostring(l, level);
|
||||||
if (text.length())
|
if (text.length())
|
||||||
text += ", "_ascii + ByteString(luaL_optstring(l, -1, "")).FromUtf8();
|
text += ", " + ByteString(luaL_optstring(l, -1, "")).FromUtf8();
|
||||||
else
|
else
|
||||||
text = ByteString(luaL_optstring(l, -1, "")).FromUtf8();
|
text = ByteString(luaL_optstring(l, -1, "")).FromUtf8();
|
||||||
lua_pop(l, 1);
|
lua_pop(l, 1);
|
||||||
@ -3968,7 +3968,7 @@ int LuaScriptInterface::Command(String command)
|
|||||||
if (text.length())
|
if (text.length())
|
||||||
{
|
{
|
||||||
if (lastError.length())
|
if (lastError.length())
|
||||||
lastError += "; "_ascii + text;
|
lastError += "; " + text;
|
||||||
else
|
else
|
||||||
lastError = text;
|
lastError = text;
|
||||||
}
|
}
|
||||||
@ -4014,13 +4014,13 @@ String highlight(String command)
|
|||||||
String::value_type const *wstart = raw + pos;
|
String::value_type const *wstart = raw + pos;
|
||||||
while((w = wstart[len]) && ((w >= 'A' && w <= 'Z') || (w >= 'a' && w <= 'z') || (w >= '0' && w <= '9') || w == '_'))
|
while((w = wstart[len]) && ((w >= 'A' && w <= 'Z') || (w >= 'a' && w <= 'z') || (w >= '0' && w <= '9') || w == '_'))
|
||||||
len++;
|
len++;
|
||||||
#define CMP(X) (String(wstart, len) == X##_ascii)
|
#define CMP(X) (String(wstart, len) == X)
|
||||||
if(CMP("and") || CMP("break") || CMP("do") || CMP("else") || CMP("elseif") || CMP("end") || CMP("for") || CMP("function") || CMP("if") || CMP("in") || CMP("local") || CMP("not") || CMP("or") || CMP("repeat") || CMP("return") || CMP("then") || CMP("until") || CMP("while"))
|
if(CMP("and") || CMP("break") || CMP("do") || CMP("else") || CMP("elseif") || CMP("end") || CMP("for") || CMP("function") || CMP("if") || CMP("in") || CMP("local") || CMP("not") || CMP("or") || CMP("repeat") || CMP("return") || CMP("then") || CMP("until") || CMP("while"))
|
||||||
result << "\x0F\xB5\x89\x01"_ascii << String(wstart, len) << "\bw"_ascii;
|
result << "\x0F\xB5\x89\x01" << String(wstart, len) << "\bw";
|
||||||
else if(CMP("false") || CMP("nil") || CMP("true"))
|
else if(CMP("false") || CMP("nil") || CMP("true"))
|
||||||
result << "\x0F\xCB\x4B\x16"_ascii << String(wstart, len) << "\bw"_ascii;
|
result << "\x0F\xCB\x4B\x16" << String(wstart, len) << "\bw";
|
||||||
else
|
else
|
||||||
result << "\x0F\x2A\xA1\x98"_ascii << String(wstart, len) << "\bw"_ascii;
|
result << "\x0F\x2A\xA1\x98" << String(wstart, len) << "\bw";
|
||||||
#undef CMP
|
#undef CMP
|
||||||
pos += len;
|
pos += len;
|
||||||
}
|
}
|
||||||
@ -4033,7 +4033,7 @@ String highlight(String command)
|
|||||||
String::value_type const *wstart = raw + pos;
|
String::value_type const *wstart = raw + pos;
|
||||||
while((w = wstart[len]) && ((w >= '0' && w <= '9') || (w >= 'A' && w <= 'F') || (w >= 'a' && w <= 'f')))
|
while((w = wstart[len]) && ((w >= '0' && w <= '9') || (w >= 'A' && w <= 'F') || (w >= 'a' && w <= 'f')))
|
||||||
len++;
|
len++;
|
||||||
result << "\x0F\xD3\x36\x82"_ascii << String(wstart, len) << "\bw"_ascii;
|
result << "\x0F\xD3\x36\x82" << String(wstart, len) << "\bw";
|
||||||
pos += len;
|
pos += len;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -4062,7 +4062,7 @@ String highlight(String command)
|
|||||||
while((w = wstart[len]) && (w >= '0' && w <= '9'))
|
while((w = wstart[len]) && (w >= '0' && w <= '9'))
|
||||||
len++;
|
len++;
|
||||||
}
|
}
|
||||||
result << "\x0F\xD3\x36\x82"_ascii << String(wstart, len) << "\bw"_ascii;
|
result << "\x0F\xD3\x36\x82" << String(wstart, len) << "\bw";
|
||||||
pos += len;
|
pos += len;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4094,7 +4094,7 @@ String highlight(String command)
|
|||||||
}
|
}
|
||||||
len++;
|
len++;
|
||||||
}
|
}
|
||||||
result << "\x0F\xDC\x32\x2F"_ascii << String(wstart, len) << "\bw"_ascii;
|
result << "\x0F\xDC\x32\x2F" << String(wstart, len) << "\bw";
|
||||||
pos += len;
|
pos += len;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -4110,7 +4110,7 @@ String highlight(String command)
|
|||||||
}
|
}
|
||||||
if(w == c)
|
if(w == c)
|
||||||
len++;
|
len++;
|
||||||
result << "\x0F\xDC\x32\x2F"_ascii << String(wstart, len) << "\bw"_ascii;
|
result << "\x0F\xDC\x32\x2F" << String(wstart, len) << "\bw";
|
||||||
pos += len;
|
pos += len;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4142,7 +4142,7 @@ String highlight(String command)
|
|||||||
}
|
}
|
||||||
len++;
|
len++;
|
||||||
}
|
}
|
||||||
result << "\x0F\x85\x99\x01"_ascii << String(wstart, len) << "\bw"_ascii;
|
result << "\x0F\x85\x99\x01" << String(wstart, len) << "\bw";
|
||||||
pos += len;
|
pos += len;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -4152,18 +4152,18 @@ String highlight(String command)
|
|||||||
String::value_type const *wstart = raw + pos;
|
String::value_type const *wstart = raw + pos;
|
||||||
while((w = wstart[len]) && (w != '\n'))
|
while((w = wstart[len]) && (w != '\n'))
|
||||||
len++;
|
len++;
|
||||||
result << "\x0F\x85\x99\x01"_ascii << String(wstart, len) << "\bw"_ascii;
|
result << "\x0F\x85\x99\x01" << String(wstart, len) << "\bw";
|
||||||
pos += len;
|
pos += len;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(c == '{' || c == '}')
|
else if(c == '{' || c == '}')
|
||||||
{
|
{
|
||||||
result << "\x0F\xCB\x4B\x16"_ascii << c << "\bw"_ascii;
|
result << "\x0F\xCB\x4B\x16" << c << "\bw";
|
||||||
pos++;
|
pos++;
|
||||||
}
|
}
|
||||||
else if(c == '.' && raw[pos + 1] == '.' && raw[pos + 2] == '.')
|
else if(c == '.' && raw[pos + 1] == '.' && raw[pos + 2] == '.')
|
||||||
{
|
{
|
||||||
result << "\x0F\x2A\xA1\x98...\bw"_ascii;
|
result << "\x0F\x2A\xA1\x98...\bw";
|
||||||
pos += 3;
|
pos += 3;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -4179,7 +4179,7 @@ String LuaScriptInterface::FormatCommand(String command)
|
|||||||
{
|
{
|
||||||
if(command.size() && command[0] == '!')
|
if(command.size() && command[0] == '!')
|
||||||
{
|
{
|
||||||
return "!"_ascii + legacy->FormatCommand(command.Substr(1));
|
return "!" + legacy->FormatCommand(command.Substr(1));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return highlight(command);
|
return highlight(command);
|
||||||
|
@ -71,7 +71,7 @@ AnyType::operator PointType()
|
|||||||
{
|
{
|
||||||
int x, y;
|
int x, y;
|
||||||
if(String::Split comma = (*value.str).SplitNumber(x))
|
if(String::Split comma = (*value.str).SplitNumber(x))
|
||||||
if(comma.After().BeginsWith(","_ascii))
|
if(comma.After().BeginsWith(","))
|
||||||
if(String::Split end = comma.After().Substr(1).SplitNumber(y))
|
if(String::Split end = comma.After().Substr(1).SplitNumber(y))
|
||||||
if(!end.After().size())
|
if(!end.After().size())
|
||||||
return PointType(x, y);
|
return PointType(x, y);
|
||||||
|
@ -26,7 +26,7 @@ TPTScriptInterface::TPTScriptInterface(GameController * c, GameModel * m): Comma
|
|||||||
|
|
||||||
int TPTScriptInterface::Command(String command)
|
int TPTScriptInterface::Command(String command)
|
||||||
{
|
{
|
||||||
lastError = ""_ascii;
|
lastError = "";
|
||||||
std::deque<String> words;
|
std::deque<String> words;
|
||||||
std::deque<AnyType> commandWords;
|
std::deque<AnyType> commandWords;
|
||||||
int retCode = -1;
|
int retCode = -1;
|
||||||
@ -62,21 +62,21 @@ ValueType TPTScriptInterface::testType(String word)
|
|||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
String::value_type const *rawWord = word.c_str();
|
String::value_type const *rawWord = word.c_str();
|
||||||
//Function
|
//Function
|
||||||
if (word == "set"_ascii)
|
if (word == "set")
|
||||||
return TypeFunction;
|
return TypeFunction;
|
||||||
else if (word == "create"_ascii)
|
else if (word == "create")
|
||||||
return TypeFunction;
|
return TypeFunction;
|
||||||
else if (word == "delete"_ascii)
|
else if (word == "delete")
|
||||||
return TypeFunction;
|
return TypeFunction;
|
||||||
else if (word == "kill"_ascii)
|
else if (word == "kill")
|
||||||
return TypeFunction;
|
return TypeFunction;
|
||||||
else if (word == "load"_ascii)
|
else if (word == "load")
|
||||||
return TypeFunction;
|
return TypeFunction;
|
||||||
else if (word == "reset"_ascii)
|
else if (word == "reset")
|
||||||
return TypeFunction;
|
return TypeFunction;
|
||||||
else if (word == "bubble"_ascii)
|
else if (word == "bubble")
|
||||||
return TypeFunction;
|
return TypeFunction;
|
||||||
else if (word == "quit"_ascii)
|
else if (word == "quit")
|
||||||
return TypeFunction;
|
return TypeFunction;
|
||||||
|
|
||||||
//Basic type
|
//Basic type
|
||||||
@ -181,19 +181,19 @@ AnyType TPTScriptInterface::eval(std::deque<String> * words)
|
|||||||
switch(wordType)
|
switch(wordType)
|
||||||
{
|
{
|
||||||
case TypeFunction:
|
case TypeFunction:
|
||||||
if(word == "set"_ascii)
|
if(word == "set")
|
||||||
return tptS_set(words);
|
return tptS_set(words);
|
||||||
else if(word == "create"_ascii)
|
else if(word == "create")
|
||||||
return tptS_create(words);
|
return tptS_create(words);
|
||||||
else if(word == "delete"_ascii || word == "kill"_ascii)
|
else if(word == "delete" || word == "kill")
|
||||||
return tptS_delete(words);
|
return tptS_delete(words);
|
||||||
else if(word == "load"_ascii)
|
else if(word == "load")
|
||||||
return tptS_load(words);
|
return tptS_load(words);
|
||||||
else if(word == "reset"_ascii)
|
else if(word == "reset")
|
||||||
return tptS_reset(words);
|
return tptS_reset(words);
|
||||||
else if(word == "bubble"_ascii)
|
else if(word == "bubble")
|
||||||
return tptS_bubble(words);
|
return tptS_bubble(words);
|
||||||
else if(word == "quit"_ascii)
|
else if(word == "quit")
|
||||||
return tptS_quit(words);
|
return tptS_quit(words);
|
||||||
break;
|
break;
|
||||||
case TypeNumber:
|
case TypeNumber:
|
||||||
@ -204,7 +204,7 @@ AnyType TPTScriptInterface::eval(std::deque<String> * words)
|
|||||||
{
|
{
|
||||||
int x, y;
|
int x, y;
|
||||||
if(String::Split comma = word.SplitNumber(x))
|
if(String::Split comma = word.SplitNumber(x))
|
||||||
if(comma.After().BeginsWith(","_ascii))
|
if(comma.After().BeginsWith(","))
|
||||||
if(comma.After().Substr(1).SplitNumber(y))
|
if(comma.After().Substr(1).SplitNumber(y))
|
||||||
return PointType(x, y);
|
return PointType(x, y);
|
||||||
return PointType(0, 0);
|
return PointType(0, 0);
|
||||||
@ -232,20 +232,20 @@ String TPTScriptInterface::FormatCommand(String command)
|
|||||||
switch(cType)
|
switch(cType)
|
||||||
{
|
{
|
||||||
case TypeFunction:
|
case TypeFunction:
|
||||||
outputData += "\bt"_ascii;
|
outputData += "\bt";
|
||||||
break;
|
break;
|
||||||
case TypeNumber:
|
case TypeNumber:
|
||||||
case TypePoint:
|
case TypePoint:
|
||||||
outputData += "\bo"_ascii;
|
outputData += "\bo";
|
||||||
break;
|
break;
|
||||||
case TypeString:
|
case TypeString:
|
||||||
outputData += "\bg"_ascii;
|
outputData += "\bg";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
outputData += "\bw"_ascii;
|
outputData += "\bw";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
outputData += words.front() + " "_ascii;
|
outputData += words.front() + " ";
|
||||||
words.pop_front();
|
words.pop_front();
|
||||||
}
|
}
|
||||||
return outputData;
|
return outputData;
|
||||||
@ -281,7 +281,7 @@ AnyType TPTScriptInterface::tptS_set(std::deque<String> * words)
|
|||||||
}
|
}
|
||||||
else if(value.GetType() == TypeString)
|
else if(value.GetType() == TypeString)
|
||||||
{
|
{
|
||||||
if (property.Value() == "temp"_ascii)
|
if (property.Value() == "temp")
|
||||||
{
|
{
|
||||||
String newString = ((StringType)value).Value();
|
String newString = ((StringType)value).Value();
|
||||||
if (newString.at(newString.length()-1) == 'C')
|
if (newString.at(newString.length()-1) == 'C')
|
||||||
@ -305,7 +305,7 @@ AnyType TPTScriptInterface::tptS_set(std::deque<String> * words)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
throw GeneralException("Invalid value for assignment"_i18n);
|
throw GeneralException("Invalid value for assignment"_i18n);
|
||||||
if (property.Value() == "type"_ascii && (newValue < 0 || newValue >= PT_NUM || !sim->elements[newValue].Enabled))
|
if (property.Value() == "type" && (newValue < 0 || newValue >= PT_NUM || !sim->elements[newValue].Enabled))
|
||||||
throw GeneralException("Invalid element"_i18n);
|
throw GeneralException("Invalid element"_i18n);
|
||||||
|
|
||||||
if (selector.GetType() == TypePoint || selector.GetType() == TypeNumber)
|
if (selector.GetType() == TypePoint || selector.GetType() == TypeNumber)
|
||||||
@ -339,7 +339,7 @@ AnyType TPTScriptInterface::tptS_set(std::deque<String> * words)
|
|||||||
}
|
}
|
||||||
returnValue = 1;
|
returnValue = 1;
|
||||||
}
|
}
|
||||||
else if (selector.GetType() == TypeString && ((StringType)selector).Value() == "all"_ascii)
|
else if (selector.GetType() == TypeString && ((StringType)selector).Value() == "all")
|
||||||
{
|
{
|
||||||
switch(propertyFormat)
|
switch(propertyFormat)
|
||||||
{
|
{
|
||||||
@ -548,7 +548,7 @@ AnyType TPTScriptInterface::tptS_reset(std::deque<String> * words)
|
|||||||
|
|
||||||
Simulation * sim = m->GetSimulation();
|
Simulation * sim = m->GetSimulation();
|
||||||
|
|
||||||
if (resetStr == "pressure"_ascii)
|
if (resetStr == "pressure")
|
||||||
{
|
{
|
||||||
for (int nx = 0; nx < XRES/CELL; nx++)
|
for (int nx = 0; nx < XRES/CELL; nx++)
|
||||||
for (int ny = 0; ny < YRES/CELL; ny++)
|
for (int ny = 0; ny < YRES/CELL; ny++)
|
||||||
@ -556,7 +556,7 @@ AnyType TPTScriptInterface::tptS_reset(std::deque<String> * words)
|
|||||||
sim->air->pv[ny][nx] = 0;
|
sim->air->pv[ny][nx] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (resetStr == "velocity"_ascii)
|
else if (resetStr == "velocity")
|
||||||
{
|
{
|
||||||
for (int nx = 0; nx < XRES/CELL; nx++)
|
for (int nx = 0; nx < XRES/CELL; nx++)
|
||||||
for (int ny = 0; ny < YRES/CELL; ny++)
|
for (int ny = 0; ny < YRES/CELL; ny++)
|
||||||
@ -565,11 +565,11 @@ AnyType TPTScriptInterface::tptS_reset(std::deque<String> * words)
|
|||||||
sim->air->vy[ny][nx] = 0;
|
sim->air->vy[ny][nx] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (resetStr == "sparks"_ascii)
|
else if (resetStr == "sparks")
|
||||||
{
|
{
|
||||||
c->ResetSpark();
|
c->ResetSpark();
|
||||||
}
|
}
|
||||||
else if (resetStr == "temp"_ascii)
|
else if (resetStr == "temp")
|
||||||
{
|
{
|
||||||
for (int i = 0; i < NPART; i++)
|
for (int i = 0; i < NPART; i++)
|
||||||
{
|
{
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
Element::Element():
|
Element::Element():
|
||||||
Identifier("DEFAULT_INVALID"),
|
Identifier("DEFAULT_INVALID"),
|
||||||
Name(""_ascii),
|
Name(""),
|
||||||
Colour(PIXPACK(0xFF00FF)),
|
Colour(PIXPACK(0xFF00FF)),
|
||||||
MenuVisible(0),
|
MenuVisible(0),
|
||||||
MenuSection(0),
|
MenuSection(0),
|
||||||
|
@ -55,7 +55,7 @@ String sign::getDisplayText(Simulation *sim, int &x0, int &y0, int &w, int &h, b
|
|||||||
formatted_text << split_left_curly.Before();
|
formatted_text << split_left_curly.Before();
|
||||||
remaining_text = split_right_curly.After();
|
remaining_text = split_right_curly.After();
|
||||||
String between_curlies = split_right_curly.Before();
|
String between_curlies = split_right_curly.Before();
|
||||||
if (between_curlies == "t"_ascii || between_curlies == "temp"_ascii)
|
if (between_curlies == "t" || between_curlies == "temp")
|
||||||
{
|
{
|
||||||
formatted_text << Format::Precision(Format::ShowPoint(part ? part->temp - 273.15f : 0.0f), 2);
|
formatted_text << Format::Precision(Format::ShowPoint(part ? part->temp - 273.15f : 0.0f), 2);
|
||||||
// * We would really only need to do this if the sign used the new
|
// * We would really only need to do this if the sign used the new
|
||||||
@ -65,43 +65,43 @@ String sign::getDisplayText(Simulation *sim, int &x0, int &y0, int &w, int &h, b
|
|||||||
if (v95)
|
if (v95)
|
||||||
*v95 = true;
|
*v95 = true;
|
||||||
}
|
}
|
||||||
else if (between_curlies == "p"_ascii || between_curlies == "pres"_ascii)
|
else if (between_curlies == "p" || between_curlies == "pres")
|
||||||
{
|
{
|
||||||
formatted_text << Format::Precision(Format::ShowPoint(pressure), 2);
|
formatted_text << Format::Precision(Format::ShowPoint(pressure), 2);
|
||||||
if (v95)
|
if (v95)
|
||||||
*v95 = true;
|
*v95 = true;
|
||||||
}
|
}
|
||||||
else if (between_curlies == "a"_ascii || between_curlies == "aheat"_ascii)
|
else if (between_curlies == "a" || between_curlies == "aheat")
|
||||||
{
|
{
|
||||||
formatted_text << Format::Precision(Format::ShowPoint(aheat), 2);
|
formatted_text << Format::Precision(Format::ShowPoint(aheat), 2);
|
||||||
if (v95)
|
if (v95)
|
||||||
*v95 = true;
|
*v95 = true;
|
||||||
}
|
}
|
||||||
else if (between_curlies == "type"_ascii)
|
else if (between_curlies == "type")
|
||||||
{
|
{
|
||||||
formatted_text << (part ? sim->BasicParticleInfo(*part) : (formatted_text.Size() ? "empty"_i18n : "Empty"_i18n));
|
formatted_text << (part ? sim->BasicParticleInfo(*part) : (formatted_text.Size() ? "empty"_i18n : "Empty"_i18n));
|
||||||
if (v95)
|
if (v95)
|
||||||
*v95 = true;
|
*v95 = true;
|
||||||
}
|
}
|
||||||
else if (between_curlies == "ctype"_ascii)
|
else if (between_curlies == "ctype")
|
||||||
{
|
{
|
||||||
formatted_text << (part ? ((part->ctype && sim->IsValidElement(part->ctype)) ? sim->ElementResolve(part->ctype, -1) : String::Build(part->ctype)) : (formatted_text.Size() ? "empty"_i18n : "Empty"_i18n));
|
formatted_text << (part ? ((part->ctype && sim->IsValidElement(part->ctype)) ? sim->ElementResolve(part->ctype, -1) : String::Build(part->ctype)) : (formatted_text.Size() ? "empty"_i18n : "Empty"_i18n));
|
||||||
if (v95)
|
if (v95)
|
||||||
*v95 = true;
|
*v95 = true;
|
||||||
}
|
}
|
||||||
else if (between_curlies == "life"_ascii)
|
else if (between_curlies == "life")
|
||||||
{
|
{
|
||||||
formatted_text << (part ? part->life : 0);
|
formatted_text << (part ? part->life : 0);
|
||||||
if (v95)
|
if (v95)
|
||||||
*v95 = true;
|
*v95 = true;
|
||||||
}
|
}
|
||||||
else if (between_curlies == "tmp"_ascii)
|
else if (between_curlies == "tmp")
|
||||||
{
|
{
|
||||||
formatted_text << (part ? part->tmp : 0);
|
formatted_text << (part ? part->tmp : 0);
|
||||||
if (v95)
|
if (v95)
|
||||||
*v95 = true;
|
*v95 = true;
|
||||||
}
|
}
|
||||||
else if (between_curlies == "tmp2"_ascii)
|
else if (between_curlies == "tmp2")
|
||||||
{
|
{
|
||||||
formatted_text << (part ? part->tmp2 : 0);
|
formatted_text << (part ? part->tmp2 : 0);
|
||||||
if (v95)
|
if (v95)
|
||||||
@ -127,10 +127,10 @@ String sign::getDisplayText(Simulation *sim, int &x0, int &y0, int &w, int &h, b
|
|||||||
switch (si.second)
|
switch (si.second)
|
||||||
{
|
{
|
||||||
case Normal: break;
|
case Normal: break;
|
||||||
case Save: drawable_text = "\bt"_ascii + drawable_text; break;
|
case Save: drawable_text = "\bt" + drawable_text; break;
|
||||||
case Thread: drawable_text = "\bl"_ascii + drawable_text; break;
|
case Thread: drawable_text = "\bl" + drawable_text; break;
|
||||||
case Button: drawable_text = "\bo"_ascii + drawable_text; break;
|
case Button: drawable_text = "\bo" + drawable_text; break;
|
||||||
case Search: drawable_text = "\bu"_ascii + drawable_text; break;
|
case Search: drawable_text = "\bu" + drawable_text; break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
SimTool::SimTool():
|
SimTool::SimTool():
|
||||||
Identifier("DEFAULT_TOOL_INVALID"),
|
Identifier("DEFAULT_TOOL_INVALID"),
|
||||||
Name(""_ascii),
|
Name(""),
|
||||||
Colour(PIXPACK(0xFFFFFF)),
|
Colour(PIXPACK(0xFFFFFF)),
|
||||||
Description("NULL Tool, does NOTHING"_i18n)
|
Description("NULL Tool, does NOTHING"_i18n)
|
||||||
{
|
{
|
||||||
|
@ -14,30 +14,30 @@ std::vector<gol_menu> LoadGOLMenu()
|
|||||||
{
|
{
|
||||||
return
|
return
|
||||||
std::vector<gol_menu>{
|
std::vector<gol_menu>{
|
||||||
{"GOL"_ascii, PIXPACK(0x0CAC00), 0, "Game Of Life: Begin 3/Stay 23"_i18n},
|
{"GOL", PIXPACK(0x0CAC00), 0, "Game Of Life: Begin 3/Stay 23"_i18n},
|
||||||
{"HLIF"_ascii, PIXPACK(0xFF0000), 1, "High Life: B36/S23"_i18n},
|
{"HLIF", PIXPACK(0xFF0000), 1, "High Life: B36/S23"_i18n},
|
||||||
{"ASIM"_ascii, PIXPACK(0x0000FF), 2, "Assimilation: B345/S4567"_i18n},
|
{"ASIM", PIXPACK(0x0000FF), 2, "Assimilation: B345/S4567"_i18n},
|
||||||
{"2x2"_ascii, PIXPACK(0xFFFF00), 3, "2x2: B36/S125"_i18n},
|
{"2x2", PIXPACK(0xFFFF00), 3, "2x2: B36/S125"_i18n},
|
||||||
{"DANI"_ascii, PIXPACK(0x00FFFF), 4, "Day and Night: B3678/S34678"_i18n},
|
{"DANI", PIXPACK(0x00FFFF), 4, "Day and Night: B3678/S34678"_i18n},
|
||||||
{"AMOE"_ascii, PIXPACK(0xFF00FF), 5, "Amoeba: B357/S1358"_i18n},
|
{"AMOE", PIXPACK(0xFF00FF), 5, "Amoeba: B357/S1358"_i18n},
|
||||||
{"MOVE"_ascii, PIXPACK(0xFFFFFF), 6, "'Move' particles. Does not move things.. it is a life type: B368/S245"_i18n},
|
{"MOVE", PIXPACK(0xFFFFFF), 6, "'Move' particles. Does not move things.. it is a life type: B368/S245"_i18n},
|
||||||
{"PGOL"_ascii, PIXPACK(0xE05010), 7, "Pseudo Life: B357/S238"_i18n},
|
{"PGOL", PIXPACK(0xE05010), 7, "Pseudo Life: B357/S238"_i18n},
|
||||||
{"DMOE"_ascii, PIXPACK(0x500000), 8, "Diamoeba: B35678/S5678"_i18n},
|
{"DMOE", PIXPACK(0x500000), 8, "Diamoeba: B35678/S5678"_i18n},
|
||||||
{"34"_ascii, PIXPACK(0x500050), 9, "34: B34/S34"_i18n},
|
{"34", PIXPACK(0x500050), 9, "34: B34/S34"_i18n},
|
||||||
{"LLIF"_ascii, PIXPACK(0x505050), 10, "Long Life: B345/S5"_i18n},
|
{"LLIF", PIXPACK(0x505050), 10, "Long Life: B345/S5"_i18n},
|
||||||
{"STAN"_ascii, PIXPACK(0x5000FF), 11, "Stains: B3678/S235678"_i18n},
|
{"STAN", PIXPACK(0x5000FF), 11, "Stains: B3678/S235678"_i18n},
|
||||||
{"SEED"_ascii, PIXPACK(0xFBEC7D), 12, "Seeds: B2/S"_i18n},
|
{"SEED", PIXPACK(0xFBEC7D), 12, "Seeds: B2/S"_i18n},
|
||||||
{"MAZE"_ascii, PIXPACK(0xA8E4A0), 13, "Maze: B3/S12345"_i18n},
|
{"MAZE", PIXPACK(0xA8E4A0), 13, "Maze: B3/S12345"_i18n},
|
||||||
{"COAG"_ascii, PIXPACK(0x9ACD32), 14, "Coagulations: B378/S235678"_i18n},
|
{"COAG", PIXPACK(0x9ACD32), 14, "Coagulations: B378/S235678"_i18n},
|
||||||
{"WALL"_ascii, PIXPACK(0x0047AB), 15, "Walled cities: B45678/S2345"_i18n},
|
{"WALL", PIXPACK(0x0047AB), 15, "Walled cities: B45678/S2345"_i18n},
|
||||||
{"GNAR"_ascii, PIXPACK(0xE5B73B), 16, "Gnarl: B1/S1"_i18n},
|
{"GNAR", PIXPACK(0xE5B73B), 16, "Gnarl: B1/S1"_i18n},
|
||||||
{"REPL"_ascii, PIXPACK(0x259588), 17, "Replicator: B1357/S1357"_i18n},
|
{"REPL", PIXPACK(0x259588), 17, "Replicator: B1357/S1357"_i18n},
|
||||||
{"MYST"_ascii, PIXPACK(0x0C3C00), 18, "Mystery: B3458/S05678"_i18n},
|
{"MYST", PIXPACK(0x0C3C00), 18, "Mystery: B3458/S05678"_i18n},
|
||||||
{"LOTE"_ascii, PIXPACK(0xFF0000), 19, "Living on the Edge: B37/S3458/4"_i18n},
|
{"LOTE", PIXPACK(0xFF0000), 19, "Living on the Edge: B37/S3458/4"_i18n},
|
||||||
{"FRG2"_ascii, PIXPACK(0x00FF00), 20, "Like Frogs rule: B3/S124/3"_i18n},
|
{"FRG2", PIXPACK(0x00FF00), 20, "Like Frogs rule: B3/S124/3"_i18n},
|
||||||
{"STAR"_ascii, PIXPACK(0x0000FF), 21, "Like Star Wars rule: B278/S3456/6"_i18n},
|
{"STAR", PIXPACK(0x0000FF), 21, "Like Star Wars rule: B278/S3456/6"_i18n},
|
||||||
{"FROG"_ascii, PIXPACK(0x00AA00), 22, "Frogs: B34/S12/3"_i18n},
|
{"FROG", PIXPACK(0x00AA00), 22, "Frogs: B34/S12/3"_i18n},
|
||||||
{"BRAN"_ascii, PIXPACK(0xCCCC00), 23, "Brian 6: B246/S6/3"_i18n}
|
{"BRAN", PIXPACK(0xCCCC00), 23, "Brian 6: B246/S6/3"_i18n}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -109,25 +109,25 @@ std::vector<wall_type> LoadWalls()
|
|||||||
{
|
{
|
||||||
return
|
return
|
||||||
std::vector<wall_type>{
|
std::vector<wall_type>{
|
||||||
{PIXPACK(0x808080), PIXPACK(0x000000), 0, Renderer::WallIcon, "ERASE"_ascii, "DEFAULT_WL_ERASE", "Erases walls."_i18n},
|
{PIXPACK(0x808080), PIXPACK(0x000000), 0, Renderer::WallIcon, "ERASE", "DEFAULT_WL_ERASE", "Erases walls."_i18n},
|
||||||
{PIXPACK(0xC0C0C0), PIXPACK(0x101010), 0, Renderer::WallIcon, "CONDUCTIVE WALL"_ascii, "DEFAULT_WL_CNDTW", "Blocks everything. Conductive."_i18n},
|
{PIXPACK(0xC0C0C0), PIXPACK(0x101010), 0, Renderer::WallIcon, "CONDUCTIVE WALL", "DEFAULT_WL_CNDTW", "Blocks everything. Conductive."_i18n},
|
||||||
{PIXPACK(0x808080), PIXPACK(0x808080), 0, Renderer::WallIcon, "EWALL"_ascii, "DEFAULT_WL_EWALL", "E-Wall. Becomes transparent when electricity is connected."_i18n},
|
{PIXPACK(0x808080), PIXPACK(0x808080), 0, Renderer::WallIcon, "EWALL", "DEFAULT_WL_EWALL", "E-Wall. Becomes transparent when electricity is connected."_i18n},
|
||||||
{PIXPACK(0xFF8080), PIXPACK(0xFF2008), 1, Renderer::WallIcon, "DETECTOR"_ascii, "DEFAULT_WL_DTECT", "Detector. Generates electricity when a particle is inside."_i18n},
|
{PIXPACK(0xFF8080), PIXPACK(0xFF2008), 1, Renderer::WallIcon, "DETECTOR", "DEFAULT_WL_DTECT", "Detector. Generates electricity when a particle is inside."_i18n},
|
||||||
{PIXPACK(0x808080), PIXPACK(0x000000), 0, Renderer::WallIcon, "STREAMLINE"_ascii, "DEFAULT_WL_STRM", "Streamline. Set start point of a streamline."_i18n},
|
{PIXPACK(0x808080), PIXPACK(0x000000), 0, Renderer::WallIcon, "STREAMLINE", "DEFAULT_WL_STRM", "Streamline. Set start point of a streamline."_i18n},
|
||||||
{PIXPACK(0x8080FF), PIXPACK(0x000000), 1, Renderer::WallIcon, "FAN"_ascii, "DEFAULT_WL_FAN", "Fan. Accelerates air. Use the line tool to set direction and strength."_i18n},
|
{PIXPACK(0x8080FF), PIXPACK(0x000000), 1, Renderer::WallIcon, "FAN", "DEFAULT_WL_FAN", "Fan. Accelerates air. Use the line tool to set direction and strength."_i18n},
|
||||||
{PIXPACK(0xC0C0C0), PIXPACK(0x101010), 2, Renderer::WallIcon, "LIQUID WALL"_ascii, "DEFAULT_WL_LIQD", "Allows liquids, blocks all other particles. Conductive."_i18n},
|
{PIXPACK(0xC0C0C0), PIXPACK(0x101010), 2, Renderer::WallIcon, "LIQUID WALL", "DEFAULT_WL_LIQD", "Allows liquids, blocks all other particles. Conductive."_i18n},
|
||||||
{PIXPACK(0x808080), PIXPACK(0x000000), 1, Renderer::WallIcon, "ABSORB WALL"_ascii, "DEFAULT_WL_ABSRB", "Absorbs particles but lets air currents through."_i18n},
|
{PIXPACK(0x808080), PIXPACK(0x000000), 1, Renderer::WallIcon, "ABSORB WALL", "DEFAULT_WL_ABSRB", "Absorbs particles but lets air currents through."_i18n},
|
||||||
{PIXPACK(0x808080), PIXPACK(0x000000), 3, Renderer::WallIcon, "WALL"_ascii, "DEFAULT_WL_WALL", "Basic wall, blocks everything."_i18n},
|
{PIXPACK(0x808080), PIXPACK(0x000000), 3, Renderer::WallIcon, "WALL", "DEFAULT_WL_WALL", "Basic wall, blocks everything."_i18n},
|
||||||
{PIXPACK(0x3C3C3C), PIXPACK(0x000000), 1, Renderer::WallIcon, "AIRONLY WALL"_ascii, "DEFAULT_WL_AIR", "Allows air, but blocks all particles."_i18n},
|
{PIXPACK(0x3C3C3C), PIXPACK(0x000000), 1, Renderer::WallIcon, "AIRONLY WALL", "DEFAULT_WL_AIR", "Allows air, but blocks all particles."_i18n},
|
||||||
{PIXPACK(0x575757), PIXPACK(0x000000), 1, Renderer::WallIcon, "POWDER WALL"_ascii, "DEFAULT_WL_POWDR", "Allows powders, blocks all other particles."_i18n},
|
{PIXPACK(0x575757), PIXPACK(0x000000), 1, Renderer::WallIcon, "POWDER WALL", "DEFAULT_WL_POWDR", "Allows powders, blocks all other particles."_i18n},
|
||||||
{PIXPACK(0xFFFF22), PIXPACK(0x101010), 2, Renderer::WallIcon, "CONDUCTOR"_ascii, "DEFAULT_WL_CNDTR", "Conductor. Allows all particles to pass through and conducts electricity."_i18n},
|
{PIXPACK(0xFFFF22), PIXPACK(0x101010), 2, Renderer::WallIcon, "CONDUCTOR", "DEFAULT_WL_CNDTR", "Conductor. Allows all particles to pass through and conducts electricity."_i18n},
|
||||||
{PIXPACK(0x242424), PIXPACK(0x101010), 0, Renderer::WallIcon, "EHOLE"_ascii, "DEFAULT_WL_EHOLE", "E-Hole. absorbs particles, releases them when powered."_i18n},
|
{PIXPACK(0x242424), PIXPACK(0x101010), 0, Renderer::WallIcon, "EHOLE", "DEFAULT_WL_EHOLE", "E-Hole. absorbs particles, releases them when powered."_i18n},
|
||||||
{PIXPACK(0x579777), PIXPACK(0x000000), 1, Renderer::WallIcon, "GAS WALL"_ascii, "DEFAULT_WL_GAS", "Allows gases, blocks all other particles."_i18n},
|
{PIXPACK(0x579777), PIXPACK(0x000000), 1, Renderer::WallIcon, "GAS WALL", "DEFAULT_WL_GAS", "Allows gases, blocks all other particles."_i18n},
|
||||||
{PIXPACK(0xFFEE00), PIXPACK(0xAA9900), 4, Renderer::WallIcon, "GRAVITY WALL"_ascii, "DEFAULT_WL_GRVTY", "Gravity wall. Newtonian Gravity has no effect inside a box drawn with this."_i18n},
|
{PIXPACK(0xFFEE00), PIXPACK(0xAA9900), 4, Renderer::WallIcon, "GRAVITY WALL", "DEFAULT_WL_GRVTY", "Gravity wall. Newtonian Gravity has no effect inside a box drawn with this."_i18n},
|
||||||
{PIXPACK(0xFFAA00), PIXPACK(0xAA5500), 4, Renderer::WallIcon, "ENERGY WALL"_ascii, "DEFAULT_WL_ENRGY", "Allows energy particles, blocks all other particles."_i18n},
|
{PIXPACK(0xFFAA00), PIXPACK(0xAA5500), 4, Renderer::WallIcon, "ENERGY WALL", "DEFAULT_WL_ENRGY", "Allows energy particles, blocks all other particles."_i18n},
|
||||||
{PIXPACK(0xDCDCDC), PIXPACK(0x000000), 1, Renderer::WallIcon, "AIRBLOCK WALL"_ascii, "DEFAULT_WL_NOAIR", "Allows all particles, but blocks air."_i18n},
|
{PIXPACK(0xDCDCDC), PIXPACK(0x000000), 1, Renderer::WallIcon, "AIRBLOCK WALL", "DEFAULT_WL_NOAIR", "Allows all particles, but blocks air."_i18n},
|
||||||
{PIXPACK(0x808080), PIXPACK(0x000000), 0, Renderer::WallIcon, "ERASEALL"_ascii, "DEFAULT_WL_ERASEA", "Erases walls, particles, and signs."_i18n},
|
{PIXPACK(0x808080), PIXPACK(0x000000), 0, Renderer::WallIcon, "ERASEALL", "DEFAULT_WL_ERASEA", "Erases walls, particles, and signs."_i18n},
|
||||||
{PIXPACK(0x800080), PIXPACK(0x000000), 0, Renderer::WallIcon, "STASIS WALL"_ascii, "DEFAULT_WL_STASIS", "Freezes particles inside the wall in place until powered."_i18n},
|
{PIXPACK(0x800080), PIXPACK(0x000000), 0, Renderer::WallIcon, "STASIS WALL", "DEFAULT_WL_STASIS", "Freezes particles inside the wall in place until powered."_i18n},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ static int graphics(GRAPHICS_FUNC_ARGS);
|
|||||||
void Element::Element_ACEL()
|
void Element::Element_ACEL()
|
||||||
{
|
{
|
||||||
Identifier = "DEFAULT_PT_ACEL";
|
Identifier = "DEFAULT_PT_ACEL";
|
||||||
Name = "ACEL"_ascii;
|
Name = "ACEL";
|
||||||
Colour = PIXPACK(0x0099CC);
|
Colour = PIXPACK(0x0099CC);
|
||||||
MenuVisible = 1;
|
MenuVisible = 1;
|
||||||
MenuSection = SC_FORCE;
|
MenuSection = SC_FORCE;
|
||||||
|
@ -6,7 +6,7 @@ static int graphics(GRAPHICS_FUNC_ARGS);
|
|||||||
void Element::Element_ACID()
|
void Element::Element_ACID()
|
||||||
{
|
{
|
||||||
Identifier = "DEFAULT_PT_ACID";
|
Identifier = "DEFAULT_PT_ACID";
|
||||||
Name = "ACID"_ascii;
|
Name = "ACID";
|
||||||
Colour = PIXPACK(0xED55FF);
|
Colour = PIXPACK(0xED55FF);
|
||||||
MenuVisible = 1;
|
MenuVisible = 1;
|
||||||
MenuSection = SC_LIQUID;
|
MenuSection = SC_LIQUID;
|
||||||
|
@ -6,7 +6,7 @@ static int graphics(GRAPHICS_FUNC_ARGS);
|
|||||||
void Element::Element_AMTR()
|
void Element::Element_AMTR()
|
||||||
{
|
{
|
||||||
Identifier = "DEFAULT_PT_AMTR";
|
Identifier = "DEFAULT_PT_AMTR";
|
||||||
Name = "AMTR"_ascii;
|
Name = "AMTR";
|
||||||
Colour = PIXPACK(0x808080);
|
Colour = PIXPACK(0x808080);
|
||||||
MenuVisible = 1;
|
MenuVisible = 1;
|
||||||
MenuSection = SC_NUCLEAR;
|
MenuSection = SC_NUCLEAR;
|
||||||
|
@ -5,7 +5,7 @@ static int update(UPDATE_FUNC_ARGS);
|
|||||||
void Element::Element_ANAR()
|
void Element::Element_ANAR()
|
||||||
{
|
{
|
||||||
Identifier = "DEFAULT_PT_ANAR";
|
Identifier = "DEFAULT_PT_ANAR";
|
||||||
Name = "ANAR"_ascii;
|
Name = "ANAR";
|
||||||
Colour = PIXPACK(0xFFFFEE);
|
Colour = PIXPACK(0xFFFFEE);
|
||||||
MenuVisible = 1;
|
MenuVisible = 1;
|
||||||
MenuSection = SC_POWDERS;
|
MenuSection = SC_POWDERS;
|
||||||
|
@ -5,7 +5,7 @@ static int update(UPDATE_FUNC_ARGS);
|
|||||||
void Element::Element_ARAY()
|
void Element::Element_ARAY()
|
||||||
{
|
{
|
||||||
Identifier = "DEFAULT_PT_ARAY";
|
Identifier = "DEFAULT_PT_ARAY";
|
||||||
Name = "ARAY"_ascii;
|
Name = "ARAY";
|
||||||
Colour = PIXPACK(0xFFBB00);
|
Colour = PIXPACK(0xFFBB00);
|
||||||
MenuVisible = 1;
|
MenuVisible = 1;
|
||||||
MenuSection = SC_ELEC;
|
MenuSection = SC_ELEC;
|
||||||
|
@ -5,7 +5,7 @@ static int update(UPDATE_FUNC_ARGS);
|
|||||||
void Element::Element_BANG()
|
void Element::Element_BANG()
|
||||||
{
|
{
|
||||||
Identifier = "DEFAULT_PT_BANG";
|
Identifier = "DEFAULT_PT_BANG";
|
||||||
Name = "TNT"_ascii;
|
Name = "TNT";
|
||||||
Colour = PIXPACK(0xC05050);
|
Colour = PIXPACK(0xC05050);
|
||||||
MenuVisible = 1;
|
MenuVisible = 1;
|
||||||
MenuSection = SC_EXPLOSIVE;
|
MenuSection = SC_EXPLOSIVE;
|
||||||
|
@ -5,7 +5,7 @@ static int update(UPDATE_FUNC_ARGS);
|
|||||||
void Element::Element_BCLN()
|
void Element::Element_BCLN()
|
||||||
{
|
{
|
||||||
Identifier = "DEFAULT_PT_BCLN";
|
Identifier = "DEFAULT_PT_BCLN";
|
||||||
Name = "BCLN"_ascii;
|
Name = "BCLN";
|
||||||
Colour = PIXPACK(0xFFD040);
|
Colour = PIXPACK(0xFFD040);
|
||||||
MenuVisible = 1;
|
MenuVisible = 1;
|
||||||
MenuSection = SC_SPECIAL;
|
MenuSection = SC_SPECIAL;
|
||||||
|
@ -6,7 +6,7 @@ int Element_COAL_graphics(GRAPHICS_FUNC_ARGS);
|
|||||||
void Element::Element_BCOL()
|
void Element::Element_BCOL()
|
||||||
{
|
{
|
||||||
Identifier = "DEFAULT_PT_BCOL";
|
Identifier = "DEFAULT_PT_BCOL";
|
||||||
Name = "BCOL"_ascii;
|
Name = "BCOL";
|
||||||
Colour = PIXPACK(0x333333);
|
Colour = PIXPACK(0x333333);
|
||||||
MenuVisible = 1;
|
MenuVisible = 1;
|
||||||
MenuSection = SC_POWDERS;
|
MenuSection = SC_POWDERS;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
void Element::Element_BGLA()
|
void Element::Element_BGLA()
|
||||||
{
|
{
|
||||||
Identifier = "DEFAULT_PT_BGLA";
|
Identifier = "DEFAULT_PT_BGLA";
|
||||||
Name = "BGLA"_ascii;
|
Name = "BGLA";
|
||||||
Colour = PIXPACK(0x606060);
|
Colour = PIXPACK(0x606060);
|
||||||
MenuVisible = 1;
|
MenuVisible = 1;
|
||||||
MenuSection = SC_POWDERS;
|
MenuSection = SC_POWDERS;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
void Element::Element_BHOL()
|
void Element::Element_BHOL()
|
||||||
{
|
{
|
||||||
Identifier = "DEFAULT_PT_BHOL";
|
Identifier = "DEFAULT_PT_BHOL";
|
||||||
Name = "VACU"_ascii;
|
Name = "VACU";
|
||||||
Colour = PIXPACK(0x303030);
|
Colour = PIXPACK(0x303030);
|
||||||
MenuVisible = 1;
|
MenuVisible = 1;
|
||||||
MenuSection = SC_SPECIAL;
|
MenuSection = SC_SPECIAL;
|
||||||
|
@ -6,7 +6,7 @@ int Element_BIZR_graphics(GRAPHICS_FUNC_ARGS);
|
|||||||
void Element::Element_BIZR()
|
void Element::Element_BIZR()
|
||||||
{
|
{
|
||||||
Identifier = "DEFAULT_PT_BIZR";
|
Identifier = "DEFAULT_PT_BIZR";
|
||||||
Name = "BIZR"_ascii;
|
Name = "BIZR";
|
||||||
Colour = PIXPACK(0x00FF77);
|
Colour = PIXPACK(0x00FF77);
|
||||||
MenuVisible = 1;
|
MenuVisible = 1;
|
||||||
MenuSection = SC_LIQUID;
|
MenuSection = SC_LIQUID;
|
||||||
|
@ -6,7 +6,7 @@ int Element_BIZR_graphics(GRAPHICS_FUNC_ARGS);
|
|||||||
void Element::Element_BIZRG()
|
void Element::Element_BIZRG()
|
||||||
{
|
{
|
||||||
Identifier = "DEFAULT_PT_BIZRG";
|
Identifier = "DEFAULT_PT_BIZRG";
|
||||||
Name = "BIZG"_ascii;
|
Name = "BIZG";
|
||||||
Colour = PIXPACK(0x00FFBB);
|
Colour = PIXPACK(0x00FFBB);
|
||||||
MenuVisible = 1;
|
MenuVisible = 1;
|
||||||
MenuSection = SC_CRACKER2;
|
MenuSection = SC_CRACKER2;
|
||||||
|
@ -6,7 +6,7 @@ int Element_BIZR_graphics(GRAPHICS_FUNC_ARGS);
|
|||||||
void Element::Element_BIZRS()
|
void Element::Element_BIZRS()
|
||||||
{
|
{
|
||||||
Identifier = "DEFAULT_PT_BIZRS";
|
Identifier = "DEFAULT_PT_BIZRS";
|
||||||
Name = "BIZS"_ascii;
|
Name = "BIZS";
|
||||||
Colour = PIXPACK(0x00E455);
|
Colour = PIXPACK(0x00E455);
|
||||||
MenuVisible = 1;
|
MenuVisible = 1;
|
||||||
MenuSection = SC_CRACKER2;
|
MenuSection = SC_CRACKER2;
|
||||||
|
@ -5,7 +5,7 @@ static int update(UPDATE_FUNC_ARGS);
|
|||||||
void Element::Element_BMTL()
|
void Element::Element_BMTL()
|
||||||
{
|
{
|
||||||
Identifier = "DEFAULT_PT_BMTL";
|
Identifier = "DEFAULT_PT_BMTL";
|
||||||
Name = "BMTL"_ascii;
|
Name = "BMTL";
|
||||||
Colour = PIXPACK(0x505070);
|
Colour = PIXPACK(0x505070);
|
||||||
MenuVisible = 1;
|
MenuVisible = 1;
|
||||||
MenuSection = SC_SOLIDS;
|
MenuSection = SC_SOLIDS;
|
||||||
|
@ -6,7 +6,7 @@ static int graphics(GRAPHICS_FUNC_ARGS);
|
|||||||
void Element::Element_BOMB()
|
void Element::Element_BOMB()
|
||||||
{
|
{
|
||||||
Identifier = "DEFAULT_PT_BOMB";
|
Identifier = "DEFAULT_PT_BOMB";
|
||||||
Name = "BOMB"_ascii;
|
Name = "BOMB";
|
||||||
Colour = PIXPACK(0xFFF288);
|
Colour = PIXPACK(0xFFF288);
|
||||||
MenuVisible = 1;
|
MenuVisible = 1;
|
||||||
MenuSection = SC_EXPLOSIVE;
|
MenuSection = SC_EXPLOSIVE;
|
||||||
|
@ -5,7 +5,7 @@ static int update(UPDATE_FUNC_ARGS);
|
|||||||
void Element::Element_BOYL()
|
void Element::Element_BOYL()
|
||||||
{
|
{
|
||||||
Identifier = "DEFAULT_PT_BOYL";
|
Identifier = "DEFAULT_PT_BOYL";
|
||||||
Name = "BOYL"_ascii;
|
Name = "BOYL";
|
||||||
Colour = PIXPACK(0x0A3200);
|
Colour = PIXPACK(0x0A3200);
|
||||||
MenuVisible = 1;
|
MenuVisible = 1;
|
||||||
MenuSection = SC_GAS;
|
MenuSection = SC_GAS;
|
||||||
|
@ -5,7 +5,7 @@ static int graphics(GRAPHICS_FUNC_ARGS);
|
|||||||
void Element::Element_BRAY()
|
void Element::Element_BRAY()
|
||||||
{
|
{
|
||||||
Identifier = "DEFAULT_PT_BRAY";
|
Identifier = "DEFAULT_PT_BRAY";
|
||||||
Name = "BRAY"_ascii;
|
Name = "BRAY";
|
||||||
Colour = PIXPACK(0xFFFFFF);
|
Colour = PIXPACK(0xFFFFFF);
|
||||||
MenuVisible = 0;
|
MenuVisible = 0;
|
||||||
MenuSection = SC_ELEC;
|
MenuSection = SC_ELEC;
|
||||||
|
@ -5,7 +5,7 @@ static int graphics(GRAPHICS_FUNC_ARGS);
|
|||||||
void Element::Element_BRCK()
|
void Element::Element_BRCK()
|
||||||
{
|
{
|
||||||
Identifier = "DEFAULT_PT_BRCK";
|
Identifier = "DEFAULT_PT_BRCK";
|
||||||
Name = "BRCK"_ascii;
|
Name = "BRCK";
|
||||||
Colour = PIXPACK(0x808080);
|
Colour = PIXPACK(0x808080);
|
||||||
MenuVisible = 1;
|
MenuVisible = 1;
|
||||||
MenuSection = SC_SOLIDS;
|
MenuSection = SC_SOLIDS;
|
||||||
|
@ -5,7 +5,7 @@ static int update(UPDATE_FUNC_ARGS);
|
|||||||
void Element::Element_BREC()
|
void Element::Element_BREC()
|
||||||
{
|
{
|
||||||
Identifier = "DEFAULT_PT_BREC";
|
Identifier = "DEFAULT_PT_BREC";
|
||||||
Name = "BREL"_ascii;
|
Name = "BREL";
|
||||||
Colour = PIXPACK(0x707060);
|
Colour = PIXPACK(0x707060);
|
||||||
MenuVisible = 1;
|
MenuVisible = 1;
|
||||||
MenuSection = SC_POWDERS;
|
MenuSection = SC_POWDERS;
|
||||||
|
@ -5,7 +5,7 @@ static int update(UPDATE_FUNC_ARGS);
|
|||||||
void Element::Element_BRMT()
|
void Element::Element_BRMT()
|
||||||
{
|
{
|
||||||
Identifier = "DEFAULT_PT_BRMT";
|
Identifier = "DEFAULT_PT_BRMT";
|
||||||
Name = "BRMT"_ascii;
|
Name = "BRMT";
|
||||||
Colour = PIXPACK(0x705060);
|
Colour = PIXPACK(0x705060);
|
||||||
MenuVisible = 1;
|
MenuVisible = 1;
|
||||||
MenuSection = SC_POWDERS;
|
MenuSection = SC_POWDERS;
|
||||||
|
@ -5,7 +5,7 @@ static int update(UPDATE_FUNC_ARGS);
|
|||||||
void Element::Element_BTRY()
|
void Element::Element_BTRY()
|
||||||
{
|
{
|
||||||
Identifier = "DEFAULT_PT_BTRY";
|
Identifier = "DEFAULT_PT_BTRY";
|
||||||
Name = "BTRY"_ascii;
|
Name = "BTRY";
|
||||||
Colour = PIXPACK(0x858505);
|
Colour = PIXPACK(0x858505);
|
||||||
MenuVisible = 1;
|
MenuVisible = 1;
|
||||||
MenuSection = SC_ELEC;
|
MenuSection = SC_ELEC;
|
||||||
|
@ -6,7 +6,7 @@ int Element_VIBR_graphics(GRAPHICS_FUNC_ARGS);
|
|||||||
void Element::Element_BVBR()
|
void Element::Element_BVBR()
|
||||||
{
|
{
|
||||||
Identifier = "DEFAULT_PT_BVBR";
|
Identifier = "DEFAULT_PT_BVBR";
|
||||||
Name = "BVBR"_ascii;
|
Name = "BVBR";
|
||||||
Colour = PIXPACK(0x005000);
|
Colour = PIXPACK(0x005000);
|
||||||
MenuVisible = 1;
|
MenuVisible = 1;
|
||||||
MenuSection = SC_NUCLEAR;
|
MenuSection = SC_NUCLEAR;
|
||||||
|
@ -6,7 +6,7 @@ static int graphics(GRAPHICS_FUNC_ARGS);
|
|||||||
void Element::Element_C5()
|
void Element::Element_C5()
|
||||||
{
|
{
|
||||||
Identifier = "DEFAULT_PT_C5";
|
Identifier = "DEFAULT_PT_C5";
|
||||||
Name = "C-5"_ascii;
|
Name = "C-5";
|
||||||
Colour = PIXPACK(0x2050E0);
|
Colour = PIXPACK(0x2050E0);
|
||||||
MenuVisible = 1;
|
MenuVisible = 1;
|
||||||
MenuSection = SC_EXPLOSIVE;
|
MenuSection = SC_EXPLOSIVE;
|
||||||
|
@ -5,7 +5,7 @@ static int update(UPDATE_FUNC_ARGS);
|
|||||||
void Element::Element_CAUS()
|
void Element::Element_CAUS()
|
||||||
{
|
{
|
||||||
Identifier = "DEFAULT_PT_CAUS";
|
Identifier = "DEFAULT_PT_CAUS";
|
||||||
Name = "CAUS"_ascii;
|
Name = "CAUS";
|
||||||
Colour = PIXPACK(0x80FFA0);
|
Colour = PIXPACK(0x80FFA0);
|
||||||
MenuVisible = 1;
|
MenuVisible = 1;
|
||||||
MenuSection = SC_GAS;
|
MenuSection = SC_GAS;
|
||||||
|
@ -6,7 +6,7 @@ static int graphics(GRAPHICS_FUNC_ARGS);
|
|||||||
void Element::Element_CBNW()
|
void Element::Element_CBNW()
|
||||||
{
|
{
|
||||||
Identifier = "DEFAULT_PT_CBNW";
|
Identifier = "DEFAULT_PT_CBNW";
|
||||||
Name = "BUBW"_ascii;
|
Name = "BUBW";
|
||||||
Colour = PIXPACK(0x2030D0);
|
Colour = PIXPACK(0x2030D0);
|
||||||
MenuVisible = 1;
|
MenuVisible = 1;
|
||||||
MenuSection = SC_LIQUID;
|
MenuSection = SC_LIQUID;
|
||||||
|
@ -7,7 +7,7 @@ static void create(ELEMENT_CREATE_FUNC_ARGS);
|
|||||||
void Element::Element_CFLM()
|
void Element::Element_CFLM()
|
||||||
{
|
{
|
||||||
Identifier = "DEFAULT_PT_HFLM";
|
Identifier = "DEFAULT_PT_HFLM";
|
||||||
Name = "CFLM"_ascii;
|
Name = "CFLM";
|
||||||
Colour = PIXPACK(0x8080FF);
|
Colour = PIXPACK(0x8080FF);
|
||||||
MenuVisible = 1;
|
MenuVisible = 1;
|
||||||
MenuSection = SC_EXPLOSIVE;
|
MenuSection = SC_EXPLOSIVE;
|
||||||
|
@ -5,7 +5,7 @@ static int update(UPDATE_FUNC_ARGS);
|
|||||||
void Element::Element_CLNE()
|
void Element::Element_CLNE()
|
||||||
{
|
{
|
||||||
Identifier = "DEFAULT_PT_CLNE";
|
Identifier = "DEFAULT_PT_CLNE";
|
||||||
Name = "CLNE"_ascii;
|
Name = "CLNE";
|
||||||
Colour = PIXPACK(0xFFD010);
|
Colour = PIXPACK(0xFFD010);
|
||||||
MenuVisible = 1;
|
MenuVisible = 1;
|
||||||
MenuSection = SC_SPECIAL;
|
MenuSection = SC_SPECIAL;
|
||||||
|
@ -7,7 +7,7 @@ static void create(ELEMENT_CREATE_FUNC_ARGS);
|
|||||||
void Element::Element_CLST()
|
void Element::Element_CLST()
|
||||||
{
|
{
|
||||||
Identifier = "DEFAULT_PT_CLST";
|
Identifier = "DEFAULT_PT_CLST";
|
||||||
Name = "CLST"_ascii;
|
Name = "CLST";
|
||||||
Colour = PIXPACK(0xE4A4A4);
|
Colour = PIXPACK(0xE4A4A4);
|
||||||
MenuVisible = 1;
|
MenuVisible = 1;
|
||||||
MenuSection = SC_POWDERS;
|
MenuSection = SC_POWDERS;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
void Element::Element_CNCT()
|
void Element::Element_CNCT()
|
||||||
{
|
{
|
||||||
Identifier = "DEFAULT_PT_CNCT";
|
Identifier = "DEFAULT_PT_CNCT";
|
||||||
Name = "CNCT"_ascii;
|
Name = "CNCT";
|
||||||
Colour = PIXPACK(0xC0C0C0);
|
Colour = PIXPACK(0xC0C0C0);
|
||||||
MenuVisible = 1;
|
MenuVisible = 1;
|
||||||
MenuSection = SC_POWDERS;
|
MenuSection = SC_POWDERS;
|
||||||
|
@ -5,7 +5,7 @@ static int update(UPDATE_FUNC_ARGS);
|
|||||||
void Element::Element_CO2()
|
void Element::Element_CO2()
|
||||||
{
|
{
|
||||||
Identifier = "DEFAULT_PT_CO2";
|
Identifier = "DEFAULT_PT_CO2";
|
||||||
Name = "CO2"_ascii;
|
Name = "CO2";
|
||||||
Colour = PIXPACK(0x666666);
|
Colour = PIXPACK(0x666666);
|
||||||
MenuVisible = 1;
|
MenuVisible = 1;
|
||||||
MenuSection = SC_GAS;
|
MenuSection = SC_GAS;
|
||||||
|
@ -6,7 +6,7 @@ int Element_COAL_graphics(GRAPHICS_FUNC_ARGS);
|
|||||||
void Element::Element_COAL()
|
void Element::Element_COAL()
|
||||||
{
|
{
|
||||||
Identifier = "DEFAULT_PT_COAL";
|
Identifier = "DEFAULT_PT_COAL";
|
||||||
Name = "COAL"_ascii;
|
Name = "COAL";
|
||||||
Colour = PIXPACK(0x222222);
|
Colour = PIXPACK(0x222222);
|
||||||
MenuVisible = 1;
|
MenuVisible = 1;
|
||||||
MenuSection = SC_SOLIDS;
|
MenuSection = SC_SOLIDS;
|
||||||
|
@ -5,7 +5,7 @@ static int update(UPDATE_FUNC_ARGS);
|
|||||||
void Element::Element_CONV()
|
void Element::Element_CONV()
|
||||||
{
|
{
|
||||||
Identifier = "DEFAULT_PT_CONV";
|
Identifier = "DEFAULT_PT_CONV";
|
||||||
Name = "CONV"_ascii;
|
Name = "CONV";
|
||||||
Colour = PIXPACK(0x0AAB0A);
|
Colour = PIXPACK(0x0AAB0A);
|
||||||
MenuVisible = 1;
|
MenuVisible = 1;
|
||||||
MenuSection = SC_SPECIAL;
|
MenuSection = SC_SPECIAL;
|
||||||
|
@ -7,7 +7,7 @@ static unsigned int wavelengthToDecoColour(int wavelength);
|
|||||||
void Element::Element_CRAY()
|
void Element::Element_CRAY()
|
||||||
{
|
{
|
||||||
Identifier = "DEFAULT_PT_CRAY";
|
Identifier = "DEFAULT_PT_CRAY";
|
||||||
Name = "CRAY"_ascii;
|
Name = "CRAY";
|
||||||
Colour = PIXPACK(0xBBFF00);
|
Colour = PIXPACK(0xBBFF00);
|
||||||
MenuVisible = 1;
|
MenuVisible = 1;
|
||||||
MenuSection = SC_ELEC;
|
MenuSection = SC_ELEC;
|
||||||
|
@ -7,7 +7,7 @@ static void create(ELEMENT_CREATE_FUNC_ARGS);
|
|||||||
void Element::Element_CRMC()
|
void Element::Element_CRMC()
|
||||||
{
|
{
|
||||||
Identifier = "DEFAULT_PT_CRMC";
|
Identifier = "DEFAULT_PT_CRMC";
|
||||||
Name = "CRMC"_ascii;
|
Name = "CRMC";
|
||||||
Colour = PIXPACK(0xD6D1D4);
|
Colour = PIXPACK(0xD6D1D4);
|
||||||
MenuVisible = 1;
|
MenuVisible = 1;
|
||||||
MenuSection = SC_SOLIDS;
|
MenuSection = SC_SOLIDS;
|
||||||
|
@ -6,7 +6,7 @@ static int graphics(GRAPHICS_FUNC_ARGS);
|
|||||||
void Element::Element_DCEL()
|
void Element::Element_DCEL()
|
||||||
{
|
{
|
||||||
Identifier = "DEFAULT_PT_DCEL";
|
Identifier = "DEFAULT_PT_DCEL";
|
||||||
Name = "DCEL"_ascii;
|
Name = "DCEL";
|
||||||
Colour = PIXPACK(0x99CC00);
|
Colour = PIXPACK(0x99CC00);
|
||||||
MenuVisible = 1;
|
MenuVisible = 1;
|
||||||
MenuSection = SC_FORCE;
|
MenuSection = SC_FORCE;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
void Element::Element_DESL()
|
void Element::Element_DESL()
|
||||||
{
|
{
|
||||||
Identifier = "DEFAULT_PT_DESL";
|
Identifier = "DEFAULT_PT_DESL";
|
||||||
Name = "DESL"_ascii;
|
Name = "DESL";
|
||||||
Colour = PIXPACK(0x440000);
|
Colour = PIXPACK(0x440000);
|
||||||
MenuVisible = 1;
|
MenuVisible = 1;
|
||||||
MenuSection = SC_LIQUID;
|
MenuSection = SC_LIQUID;
|
||||||
|
@ -6,7 +6,7 @@ static int graphics(GRAPHICS_FUNC_ARGS);
|
|||||||
void Element::Element_DEST()
|
void Element::Element_DEST()
|
||||||
{
|
{
|
||||||
Identifier = "DEFAULT_PT_DEST";
|
Identifier = "DEFAULT_PT_DEST";
|
||||||
Name = "DEST"_ascii;
|
Name = "DEST";
|
||||||
Colour = PIXPACK(0xFF3311);
|
Colour = PIXPACK(0xFF3311);
|
||||||
MenuVisible = 1;
|
MenuVisible = 1;
|
||||||
MenuSection = SC_EXPLOSIVE;
|
MenuSection = SC_EXPLOSIVE;
|
||||||
|
@ -7,7 +7,7 @@ static int graphics(GRAPHICS_FUNC_ARGS);
|
|||||||
void Element::Element_DEUT()
|
void Element::Element_DEUT()
|
||||||
{
|
{
|
||||||
Identifier = "DEFAULT_PT_DEUT";
|
Identifier = "DEFAULT_PT_DEUT";
|
||||||
Name = "DEUT"_ascii;
|
Name = "DEUT";
|
||||||
Colour = PIXPACK(0x00153F);
|
Colour = PIXPACK(0x00153F);
|
||||||
MenuVisible = 1;
|
MenuVisible = 1;
|
||||||
MenuSection = SC_NUCLEAR;
|
MenuSection = SC_NUCLEAR;
|
||||||
|
@ -6,7 +6,7 @@ static int graphics(GRAPHICS_FUNC_ARGS);
|
|||||||
void Element::Element_DLAY()
|
void Element::Element_DLAY()
|
||||||
{
|
{
|
||||||
Identifier = "DEFAULT_PT_DLAY";
|
Identifier = "DEFAULT_PT_DLAY";
|
||||||
Name = "DLAY"_ascii;
|
Name = "DLAY";
|
||||||
Colour = PIXPACK(0x753590);
|
Colour = PIXPACK(0x753590);
|
||||||
MenuVisible = 1;
|
MenuVisible = 1;
|
||||||
MenuSection = SC_POWERED;
|
MenuSection = SC_POWERED;
|
||||||
|
@ -6,7 +6,7 @@ static int graphics(GRAPHICS_FUNC_ARGS);
|
|||||||
void Element::Element_DMG()
|
void Element::Element_DMG()
|
||||||
{
|
{
|
||||||
Identifier = "DEFAULT_PT_DMG";
|
Identifier = "DEFAULT_PT_DMG";
|
||||||
Name = "DMG"_ascii;
|
Name = "DMG";
|
||||||
Colour = PIXPACK(0x88FF88);
|
Colour = PIXPACK(0x88FF88);
|
||||||
MenuVisible = 1;
|
MenuVisible = 1;
|
||||||
MenuSection = SC_FORCE;
|
MenuSection = SC_FORCE;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
void Element::Element_DMND()
|
void Element::Element_DMND()
|
||||||
{
|
{
|
||||||
Identifier = "DEFAULT_PT_DMND";
|
Identifier = "DEFAULT_PT_DMND";
|
||||||
Name = "DMND"_ascii;
|
Name = "DMND";
|
||||||
Colour = PIXPACK(0xCCFFFF);
|
Colour = PIXPACK(0xCCFFFF);
|
||||||
MenuVisible = 1;
|
MenuVisible = 1;
|
||||||
MenuSection = SC_SPECIAL;
|
MenuSection = SC_SPECIAL;
|
||||||
|
@ -5,7 +5,7 @@ static int update(UPDATE_FUNC_ARGS);
|
|||||||
void Element::Element_DRAY()
|
void Element::Element_DRAY()
|
||||||
{
|
{
|
||||||
Identifier = "DEFAULT_PT_DRAY";
|
Identifier = "DEFAULT_PT_DRAY";
|
||||||
Name = "DRAY"_ascii;
|
Name = "DRAY";
|
||||||
Colour = PIXPACK(0xFFAA22);
|
Colour = PIXPACK(0xFFAA22);
|
||||||
MenuVisible = 1;
|
MenuVisible = 1;
|
||||||
MenuSection = SC_ELEC;
|
MenuSection = SC_ELEC;
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user