diff --git a/data/IntroText.h b/data/IntroText.h index d74caa313..b069c4121 100644 --- a/data/IntroText.h +++ b/data/IntroText.h @@ -1,7 +1,7 @@ #pragma once const char *const introTextData = "\blThe Powder Toy - Version " MTOS(SAVE_VERSION) "." MTOS(MINOR_VERSION) " - https://powdertoy.co.uk, irc.freenode.net #powder\n" - "\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\n" + "\xEE\x81\xA9\xEE\x81\xA9\xEE\x81\xA9\xEE\x81\xA9\xEE\x81\xA9\xEE\x81\xA9\xEE\x81\xA9\xEE\x81\xA9\xEE\x81\xA9\xEE\x81\xA9\xEE\x81\xA9\xEE\x81\xA9\xEE\x81\xA9\xEE\x81\xA9\xEE\x81\xA9\xEE\x81\xA9\xEE\x81\xA9\xEE\x81\xA9\xEE\x81\xA9\n" "\n" "\bgControl+C/V/X are Copy, Paste and cut respectively.\n" "\bgTo choose a material, hover over one of the icons on the right, it will show a selection of elements in that group.\n" diff --git a/data/font.cpp b/data/font.cpp index 77a700441..b23faa2ba 100644 --- a/data/font.cpp +++ b/data/font.cpp @@ -177,8 +177,8 @@ extern const unsigned char font_data[] = { 0x04, 0x77, 0x11, 0x1D, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x1D, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0xC0, 0x0F, 0x30, 0x1D, 0x0C, 0xCD, 0x1F, 0xC3, 0xC0, 0x30, 0x34, 0xFC, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x74, 0x03, 0x22, 0x70, 0xD0, 0x3C, 0x30, 0x37, 0xCC, 0x28, 0x33, 0xDC, 0x0C, 0x3C, 0x03, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x07, 0xC0, 0x00, 0x18, 0x40, 0x1F, 0x74, 0x1C, 0x07, 0xCD, 0x00, 0x33, 0xD0, 0x1C, 0x1D, 0xFD, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x30, 0x00, 0x24, 0x40, 0x1F, 0x74, 0x1C, 0x07, 0xCD, 0x00, 0x33, 0xD0, 0x1C, 0x1D, 0xFD, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x07, 0xC0, 0x00, 0x18, 0x40, 0x1F, 0x74, 0x1C, 0x07, 0xCD, 0x00, 0x33, 0xD0, 0x1C, 0x1D, 0xFD, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xD0, 0x01, 0x88, 0x40, 0x1F, 0x74, 0x1C, 0x07, 0xCD, 0x00, 0x33, 0xD0, 0x1C, 0x1D, 0xFD, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x74, 0x03, 0x22, 0x40, 0x1F, 0x74, 0x1C, 0x07, 0xCD, 0x00, 0x33, 0xD0, 0x1C, 0x1D, 0xFD, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x74, 0x03, 0x44, 0x40, 0x1F, 0x74, 0x1C, 0x07, 0xCD, 0x00, 0x33, 0xD0, 0x1C, 0x1D, 0xFD, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -209,8 +209,8 @@ extern const unsigned char font_data[] = { 0x04, 0x00, 0x00, 0x11, 0x77, 0x00, 0x0D, 0x0C, 0x0C, 0x1D, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0xD0, 0x0D, 0x1D, 0xD8, 0xF4, 0x33, 0xCC, 0x34, 0x7D, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0xD0, 0x8D, 0x08, 0x7F, 0x1C, 0x33, 0xCC, 0x30, 0xD3, 0x00, 0x00, 0x00, 0x00, - 0x05, 0x00, 0x00, 0x00, 0x03, 0x06, 0x7D, 0x1C, 0x33, 0xCC, 0x34, 0x7D, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0xC0, 0x00, 0x09, 0x7D, 0x1C, 0x33, 0xCC, 0x34, 0x7D, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x00, 0x00, 0x03, 0x06, 0x7D, 0x1C, 0x33, 0xCC, 0x34, 0x7D, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0xD0, 0x81, 0x08, 0x7D, 0x1C, 0x33, 0xCC, 0x34, 0x7D, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0xD0, 0x8D, 0x08, 0x7D, 0x1C, 0x33, 0xCC, 0x34, 0x7D, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x70, 0x47, 0x04, 0x7D, 0x1C, 0x33, 0xCC, 0x34, 0x7D, 0x00, 0x00, 0x00, 0x00, @@ -328,7 +328,7 @@ extern const unsigned char font_data[] = { 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x68, 0x00, 0xA2, 0x02, 0x80, 0x0A, 0x00, 0x25, 0x00, 0x44, 0x08, 0x10, 0x01, 0x40, 0x04, 0x00, 0x14, 0x00, 0x10, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xFF, 0x00, 0xFF, 0x0F, 0xF0, 0xFF, 0x00, 0xFF, 0x0F, 0xF0, 0xFF, 0x00, 0xFF, 0x0F, 0xF0, 0xFA, 0x00, 0x5B, 0x0E, 0x60, 0x90, 0x00, 0x01, 0x04, 0x06, 0x00, 0x00, 0x00, 0xCD, 0xF1, 0x3F, 0xFD, 0x41, 0x06, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x06, 0x00, 0x00, 0x00, 0x74, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0x99, 0x31, 0x30, 0x89, 0x41, 0x07, + 0x04, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x74, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0x99, 0x31, 0x30, 0x89, 0x41, 0x07, 0x06, 0x00, 0x00, 0x00, 0x74, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0x99, 0x31, 0x30, 0x89, 0x41, 0x07, 0x06, 0x00, 0x00, 0x00, 0x74, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0xDC, 0xC0, 0x0C, 0x99, 0x31, 0x30, 0x89, 0x41, 0x07, @@ -398,11 +398,11 @@ extern const unsigned short font_ptrs[] = { 0x1746, 0x1765, 0x1784, 0x17A3, 0x17C2, 0x17E1, 0x1800, 0x181F, 0x183E, 0x184E, 0x1867, 0x1883, 0x18A2, 0x18C1, 0x18E0, 0x18FF, 0x191E, 0x1940, 0x195F, 0x197E, 0x199D, 0x19C2, 0x19E1, 0x1A00, - 0x1A1F, 0x1A32, 0x1A45, 0x1A58, 0x1A6B, 0x1A7E, 0x1A91, 0x1AA4, - 0x1AB7, 0x1ACA, 0x1ADD, 0x1AF0, 0x1B03, 0x1B16, 0x1B29, 0x1B3C, - 0x1B4F, 0x1B62, 0x1B75, 0x1B88, 0x1B9B, 0x1BAE, 0x1BC1, 0x1BD4, + 0x1A1F, 0x1A32, 0x1A3F, 0x1A52, 0x1A65, 0x1A78, 0x1A8B, 0x1A9E, + 0x1AB1, 0x1AC4, 0x1AD7, 0x1AEA, 0x1AFD, 0x1B10, 0x1B23, 0x1B36, + 0x1B49, 0x1B5C, 0x1B6F, 0x1B82, 0x1B95, 0x1BA8, 0x1BBB, 0x1BCE, - 0x1BE7, + 0x1BE1, }; extern const unsigned int font_ranges[][2] = { { 0x000000, 0x00007E }, diff --git a/src/gui/game/GameView.cpp b/src/gui/game/GameView.cpp index b992057f6..fe1e5417f 100644 --- a/src/gui/game/GameView.cpp +++ b/src/gui/game/GameView.cpp @@ -190,7 +190,7 @@ GameView::GameView(): buttonTip(""), isButtonTipFadingIn(false), introText(2048), - introTextMessage(ByteString(introTextData).FromAscii()), + introTextMessage(ByteString(introTextData).FromUtf8()), doScreenshot(false), screenshotIndex(0), diff --git a/src/gui/interface/Textbox.cpp b/src/gui/interface/Textbox.cpp index 4976d5e47..f96929663 100644 --- a/src/gui/interface/Textbox.cpp +++ b/src/gui/interface/Textbox.cpp @@ -263,7 +263,7 @@ bool Textbox::CharacterValid(int character) return true; case All: default: - return (character >= ' ' && character < 127); + return true; } return false; } @@ -494,7 +494,7 @@ void Textbox::OnTextInput(String text) { backingText.Insert(cursor, text); } - cursor++; + cursor += text.length(); } ClearSelection(); AfterTextChange(true); diff --git a/src/lua/LuaScriptInterface.cpp b/src/lua/LuaScriptInterface.cpp index 2f94acd4a..9851cc7ea 100644 --- a/src/lua/LuaScriptInterface.cpp +++ b/src/lua/LuaScriptInterface.cpp @@ -3930,13 +3930,14 @@ int LuaScriptInterface::Command(String command) if (lastCode.length()) lastCode += "\n"; lastCode += command; - String tmp = "return " + lastCode; + ByteString tmp = ("return " + lastCode).ToUtf8(); ui::Engine::Ref().LastTick(Platform::GetTime()); - luaL_loadbuffer(l, tmp.ToUtf8().c_str(), tmp.length(), "@console"); + luaL_loadbuffer(l, tmp.c_str(), tmp.length(), "@console"); if (lua_type(l, -1) != LUA_TFUNCTION) { lua_pop(l, 1); - luaL_loadbuffer(l, lastCode.ToUtf8().c_str(), lastCode.length(), "@console"); + ByteString lastCodeUtf8 = lastCode.ToUtf8(); + luaL_loadbuffer(l, lastCodeUtf8.c_str(), lastCodeUtf8.length(), "@console"); } if (lua_type(l, -1) != LUA_TFUNCTION) {