mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-09-24 20:40:47 +00:00
refactor: unglob std::wstring
This commit is contained in:
@@ -96,7 +96,7 @@ void AbstractContainerScreen::render(int xm, int ym, float a)
|
||||
if (inventory->getCarried() == NULL && hoveredSlot != NULL && hoveredSlot->hasItem())
|
||||
{
|
||||
|
||||
wstring elementName = trimString(Language::getInstance()->getElementName(hoveredSlot->getItem()->getDescriptionId()));
|
||||
std::wstring elementName = trimString(Language::getInstance()->getElementName(hoveredSlot->getItem()->getDescriptionId()));
|
||||
|
||||
if (elementName.length() > 0)
|
||||
{
|
||||
|
||||
@@ -77,9 +77,9 @@ void AchievementPopup::render()
|
||||
Lighting::turnOff();
|
||||
prepareWindow();
|
||||
|
||||
wstring title = L"Minecraft " + SharedConstants::VERSION_STRING + L" Unlicensed Copy :(";
|
||||
wstring msg1 = L"(Or logged in from another location)";
|
||||
wstring msg2 = L"Purchase at minecraft.net";
|
||||
std::wstring title = L"Minecraft " + SharedConstants::VERSION_STRING + L" Unlicensed Copy :(";
|
||||
std::wstring msg1 = L"(Or logged in from another location)";
|
||||
std::wstring msg2 = L"Purchase at minecraft.net";
|
||||
|
||||
mc->font->drawShadow(title, 2, 2 + 9 * 0, 0xffffff);
|
||||
mc->font->drawShadow(msg1, 2, 2 + 9 * 1, 0xffffff);
|
||||
|
||||
@@ -10,8 +10,8 @@ private:
|
||||
Minecraft *mc;
|
||||
int width, height;
|
||||
|
||||
wstring title;
|
||||
wstring desc;
|
||||
std::wstring title;
|
||||
std::wstring desc;
|
||||
Achievement *ach;
|
||||
__int64 startTime;
|
||||
ItemRenderer *ir;
|
||||
|
||||
@@ -380,8 +380,8 @@ void AchievementScreen::renderBg(int xm, int ym, float a)
|
||||
if (hoveredAchievement != NULL)
|
||||
{
|
||||
Achievement *ach = hoveredAchievement;
|
||||
wstring name = ach->name;
|
||||
wstring descr = ach->getDescription();
|
||||
std::wstring name = ach->name;
|
||||
std::wstring descr = ach->getDescription();
|
||||
|
||||
int x = xm + 12;
|
||||
int y = ym - 4;
|
||||
@@ -405,7 +405,7 @@ void AchievementScreen::renderBg(int xm, int ym, float a)
|
||||
else
|
||||
{
|
||||
int width = Math::_max(font->width(name), 120);
|
||||
wstring msg = I18n::get(L"achievement.requires", ach->requires->name);
|
||||
std::wstring msg = I18n::get(L"achievement.requires", ach->requires->name);
|
||||
int height = font->wordWrapHeight(msg, width);
|
||||
fillGradient(x - 3, y - 3, x + width + 3, y + height + 12 + 3, 0xc0000000, 0xc0000000);
|
||||
font->drawWordWrap(msg, x, y + 12, width, 0xff705050);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "../../../Minecraft.World/Util/SharedConstants.h"
|
||||
#include "../../../Minecraft.World/Util/StringHelpers.h"
|
||||
|
||||
const wstring ChatScreen::allowedChars = SharedConstants::readAcceptableChars();
|
||||
const std::wstring ChatScreen::allowedChars = SharedConstants::readAcceptableChars();
|
||||
|
||||
ChatScreen::ChatScreen()
|
||||
{
|
||||
@@ -35,10 +35,10 @@ void ChatScreen::keyPressed(wchar_t ch, int eventKey)
|
||||
}
|
||||
if (eventKey == Keyboard::KEY_RETURN)
|
||||
{
|
||||
wstring msg = trimString(message);
|
||||
std::wstring msg = trimString(message);
|
||||
if (msg.length() > 0)
|
||||
{
|
||||
wstring trim = trimString(message);
|
||||
std::wstring trim = trimString(message);
|
||||
if (!minecraft->handleClientSideCommand(trim))
|
||||
{
|
||||
minecraft->player->chat(trim);
|
||||
|
||||
@@ -5,7 +5,7 @@ using namespace std;
|
||||
class ChatScreen : public Screen
|
||||
{
|
||||
protected:
|
||||
wstring message;
|
||||
std::wstring message;
|
||||
private:
|
||||
int frame;
|
||||
|
||||
@@ -15,7 +15,7 @@ public:
|
||||
virtual void removed();
|
||||
virtual void tick();
|
||||
private:
|
||||
static const wstring allowedChars;
|
||||
static const std::wstring allowedChars;
|
||||
protected:
|
||||
void keyPressed(wchar_t ch, int eventKey);
|
||||
public:
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "../SmallButton.h"
|
||||
#include "../../../Minecraft.World/Headers/net.minecraft.locale.h"
|
||||
|
||||
ConfirmScreen::ConfirmScreen(Screen *parent, const wstring& title1, const wstring& title2, int id)
|
||||
ConfirmScreen::ConfirmScreen(Screen *parent, const std::wstring& title1, const std::wstring& title2, int id)
|
||||
{
|
||||
this->parent = parent;
|
||||
this->title1 = title1;
|
||||
@@ -15,7 +15,7 @@ ConfirmScreen::ConfirmScreen(Screen *parent, const wstring& title1, const wstrin
|
||||
noButton = language->getElement(L"gui.no");
|
||||
}
|
||||
|
||||
ConfirmScreen::ConfirmScreen(Screen *parent, const wstring& title1, const wstring& title2, const wstring& yesButton, const wstring& noButton, int id)
|
||||
ConfirmScreen::ConfirmScreen(Screen *parent, const std::wstring& title1, const std::wstring& title2, const std::wstring& yesButton, const std::wstring& noButton, int id)
|
||||
{
|
||||
this->parent = parent;
|
||||
this->title1 = title1;
|
||||
|
||||
@@ -6,15 +6,15 @@ class ConfirmScreen : public Screen
|
||||
{
|
||||
private:
|
||||
Screen *parent;
|
||||
wstring title1;
|
||||
wstring title2;
|
||||
wstring yesButton;
|
||||
wstring noButton;
|
||||
std::wstring title1;
|
||||
std::wstring title2;
|
||||
std::wstring yesButton;
|
||||
std::wstring noButton;
|
||||
int id;
|
||||
|
||||
public:
|
||||
ConfirmScreen(Screen *parent, const wstring& title1, const wstring& title2, int id);
|
||||
ConfirmScreen(Screen *parent, const wstring& title1, const wstring& title2, const wstring& yesButton, const wstring& noButton, int id);
|
||||
ConfirmScreen(Screen *parent, const std::wstring& title1, const std::wstring& title2, int id);
|
||||
ConfirmScreen(Screen *parent, const std::wstring& title1, const std::wstring& title2, const std::wstring& yesButton, const std::wstring& noButton, int id);
|
||||
virtual void init();
|
||||
protected:
|
||||
virtual void buttonClicked(Button *button);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "../../../Minecraft.World/Headers/net.minecraft.locale.h"
|
||||
|
||||
|
||||
ConnectScreen::ConnectScreen(Minecraft *minecraft, const wstring& ip, int port)
|
||||
ConnectScreen::ConnectScreen(Minecraft *minecraft, const std::wstring& ip, int port)
|
||||
{
|
||||
aborted = false;
|
||||
// System.out.println("Connecting to " + ip + ", " + port);
|
||||
|
||||
@@ -11,7 +11,7 @@ private:
|
||||
ClientConnection *connection;
|
||||
bool aborted;
|
||||
public:
|
||||
ConnectScreen(Minecraft *minecraft, const wstring& ip, int port);
|
||||
ConnectScreen(Minecraft *minecraft, const std::wstring& ip, int port);
|
||||
virtual void tick();
|
||||
protected:
|
||||
virtual void keyPressed(char eventCharacter, int eventKey);
|
||||
|
||||
@@ -8,7 +8,7 @@ class ControlsScreen : public Screen
|
||||
private:
|
||||
Screen *lastScreen;
|
||||
protected:
|
||||
wstring title;
|
||||
std::wstring title;
|
||||
private:
|
||||
Options *options;
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ void CreateWorldScreen::updateResultFolder()
|
||||
for( int i = 0; i < SharedConstants::ILLEGAL_FILE_CHARACTERS_LENGTH; i++ )
|
||||
{
|
||||
size_t pos;
|
||||
while( (pos = resultFolder.find(SharedConstants::ILLEGAL_FILE_CHARACTERS[i])) != wstring::npos)
|
||||
while( (pos = resultFolder.find(SharedConstants::ILLEGAL_FILE_CHARACTERS[i])) != std::wstring::npos)
|
||||
{
|
||||
resultFolder[pos] = L'_';
|
||||
}
|
||||
@@ -65,9 +65,9 @@ void CreateWorldScreen::updateResultFolder()
|
||||
|
||||
}
|
||||
|
||||
wstring CreateWorldScreen::findAvailableFolderName(LevelStorageSource *levelSource, const wstring& folder)
|
||||
std::wstring CreateWorldScreen::findAvailableFolderName(LevelStorageSource *levelSource, const std::wstring& folder)
|
||||
{
|
||||
wstring folder2 = folder; // 4J - copy input as it is const
|
||||
std::wstring folder2 = folder; // 4J - copy input as it is const
|
||||
|
||||
#if 0
|
||||
while (levelSource->getDataTagFor(folder2) != NULL)
|
||||
@@ -98,7 +98,7 @@ void CreateWorldScreen::buttonClicked(Button *button)
|
||||
done = true;
|
||||
|
||||
__int64 seedValue = (new Random())->nextLong();
|
||||
wstring seedString = seedEdit->getValue();
|
||||
std::wstring seedString = seedEdit->getValue();
|
||||
|
||||
if (seedString.length() != 0)
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@ private:
|
||||
Screen *lastScreen;
|
||||
EditBox *nameEdit;
|
||||
EditBox *seedEdit;
|
||||
wstring resultFolder;
|
||||
std::wstring resultFolder;
|
||||
bool done;
|
||||
|
||||
public:
|
||||
@@ -20,7 +20,7 @@ public:
|
||||
private:
|
||||
void updateResultFolder();
|
||||
public:
|
||||
static wstring findAvailableFolderName(LevelStorageSource *levelSource, const wstring& folder);
|
||||
static std::wstring findAvailableFolderName(LevelStorageSource *levelSource, const std::wstring& folder);
|
||||
virtual void removed();
|
||||
protected:
|
||||
virtual void buttonClicked(Button *button);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "../Button.h"
|
||||
#include "../../../Minecraft.World/Headers/net.minecraft.locale.h"
|
||||
|
||||
DisconnectedScreen::DisconnectedScreen(const wstring& title, const wstring reason, void *reasonObjects, ...)
|
||||
DisconnectedScreen::DisconnectedScreen(const std::wstring& title, const std::wstring reason, void *reasonObjects, ...)
|
||||
{
|
||||
Language *language = Language::getInstance();
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@ using namespace std;
|
||||
class DisconnectedScreen : public Screen
|
||||
{
|
||||
private:
|
||||
wstring title, reason;
|
||||
std::wstring title, reason;
|
||||
|
||||
public:
|
||||
DisconnectedScreen(const wstring& title, const wstring reason, void *reasonObjects, ...);
|
||||
DisconnectedScreen(const std::wstring& title, const std::wstring reason, void *reasonObjects, ...);
|
||||
virtual void tick();
|
||||
protected:
|
||||
using Screen::keyPressed;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "../../Build/stdafx.h"
|
||||
#include "ErrorScreen.h"
|
||||
|
||||
ErrorScreen::ErrorScreen(const wstring& title, const wstring& message)
|
||||
ErrorScreen::ErrorScreen(const std::wstring& title, const std::wstring& message)
|
||||
{
|
||||
this->title = title;
|
||||
this->message = message;
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
class ErrorScreen : public Screen
|
||||
{
|
||||
private:
|
||||
wstring title, message;
|
||||
std::wstring title, message;
|
||||
public:
|
||||
ErrorScreen(const wstring& title, const wstring& message);
|
||||
ErrorScreen(const std::wstring& title, const std::wstring& message);
|
||||
virtual void init();
|
||||
virtual void render(int xm, int ym, float a);
|
||||
protected:
|
||||
|
||||
@@ -28,7 +28,7 @@ void InBedChatScreen::keyPressed(wchar_t ch, int eventKey)
|
||||
}
|
||||
else if (eventKey == Keyboard::KEY_RETURN)
|
||||
{
|
||||
wstring msg = trimString(message);
|
||||
std::wstring msg = trimString(message);
|
||||
if (msg.length() > 0)
|
||||
{
|
||||
minecraft->player->chat(trimString(message));
|
||||
|
||||
@@ -24,7 +24,7 @@ void JoinMultiplayerScreen::init()
|
||||
buttons.clear();
|
||||
buttons.push_back(new Button(0, width / 2 - 100, height / 4 + 24 * 4 + 12, language->getElement(L"multiplayer.connect")));
|
||||
buttons.push_back(new Button(1, width / 2 - 100, height / 4 + 24 * 5 + 12, language->getElement(L"gui.cancel")));
|
||||
wstring ip = replaceAll(minecraft->options->lastMpIp,L"_", L":");
|
||||
std::wstring ip = replaceAll(minecraft->options->lastMpIp,L"_", L":");
|
||||
buttons[0]->active = ip.length() > 0;
|
||||
|
||||
ipEdit = new EditBox(this, font, width / 2 - 100, height / 4 - 10 + 50 + 18, 200, 20, ip);
|
||||
@@ -47,19 +47,19 @@ void JoinMultiplayerScreen::buttonClicked(Button *button)
|
||||
}
|
||||
else if (button->id == 0)
|
||||
{
|
||||
wstring ip = trimString(ipEdit->getValue());
|
||||
std::wstring ip = trimString(ipEdit->getValue());
|
||||
|
||||
minecraft->options->lastMpIp = replaceAll(ip,L":", L"_");
|
||||
minecraft->options->save();
|
||||
|
||||
vector<wstring> parts = stringSplit(ip,L'L');
|
||||
vector<std::wstring> parts = stringSplit(ip,L'L');
|
||||
if (ip[0]==L'[')
|
||||
{
|
||||
int pos = (int)ip.find(L"]");
|
||||
if (pos != wstring::npos)
|
||||
if (pos != std::wstring::npos)
|
||||
{
|
||||
wstring path = ip.substr(1, pos);
|
||||
wstring port = trimString(ip.substr(pos + 1));
|
||||
std::wstring path = ip.substr(1, pos);
|
||||
std::wstring port = trimString(ip.substr(pos + 1));
|
||||
if (port[0]==L':' && port.length() > 0)
|
||||
{
|
||||
port = port.substr(1);
|
||||
@@ -86,7 +86,7 @@ void JoinMultiplayerScreen::buttonClicked(Button *button)
|
||||
}
|
||||
}
|
||||
|
||||
int JoinMultiplayerScreen::parseInt(const wstring& str, int def)
|
||||
int JoinMultiplayerScreen::parseInt(const std::wstring& str, int def)
|
||||
{
|
||||
return _fromString<int>(str);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ public:
|
||||
protected:
|
||||
virtual void buttonClicked(Button *button);
|
||||
private:
|
||||
virtual int parseInt(const wstring& str, int def);
|
||||
virtual int parseInt(const std::wstring& str, int def);
|
||||
protected:
|
||||
virtual void keyPressed(wchar_t ch, int eventKey);
|
||||
virtual void mouseClicked(int x, int y, int buttonNum);
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
#include "../Button.h"
|
||||
#include "../../../Minecraft.World/Util/StringHelpers.h"
|
||||
|
||||
const wstring NameEntryScreen::allowedChars = L"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ,.:-_'*!\"#%/()=+?[]{}<>";
|
||||
const std::wstring NameEntryScreen::allowedChars = L"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ,.:-_'*!\"#%/()=+?[]{}<>";
|
||||
|
||||
NameEntryScreen::NameEntryScreen(Screen *lastScreen, const wstring& oldName, int slot)
|
||||
NameEntryScreen::NameEntryScreen(Screen *lastScreen, const std::wstring& oldName, int slot)
|
||||
{
|
||||
frame = 0; // 4J added
|
||||
|
||||
@@ -53,7 +53,7 @@ void NameEntryScreen::buttonClicked(Button button)
|
||||
void NameEntryScreen::keyPressed(wchar_t ch, int eventKey)
|
||||
{
|
||||
if (eventKey == Keyboard::KEY_BACK && name.length() > 0) name = name.substr(0, name.length() - 1);
|
||||
if (allowedChars.find(ch) != wstring::npos && name.length()<64)
|
||||
if (allowedChars.find(ch) != std::wstring::npos && name.length()<64)
|
||||
{
|
||||
name += ch;
|
||||
}
|
||||
|
||||
@@ -6,20 +6,20 @@ class NameEntryScreen : public Screen
|
||||
private:
|
||||
Screen *lastScreen;
|
||||
protected:
|
||||
wstring title;
|
||||
std::wstring title;
|
||||
private:
|
||||
int slot;
|
||||
wstring name;
|
||||
std::wstring name;
|
||||
int frame;
|
||||
public:
|
||||
NameEntryScreen(Screen *lastScreen, const wstring& oldName, int slot);
|
||||
NameEntryScreen(Screen *lastScreen, const std::wstring& oldName, int slot);
|
||||
virtual void init();
|
||||
virtual void removed();
|
||||
virtual void tick();
|
||||
protected:
|
||||
virtual void buttonClicked(Button button);
|
||||
private:
|
||||
static const wstring allowedChars;
|
||||
static const std::wstring allowedChars;
|
||||
protected:
|
||||
virtual void keyPressed(wchar_t ch, int eventKey);
|
||||
public:
|
||||
|
||||
@@ -10,7 +10,7 @@ private:
|
||||
static const int VIDEO_BUTTON_ID = 101;
|
||||
Screen *lastScreen;
|
||||
protected:
|
||||
wstring title;
|
||||
std::wstring title;
|
||||
private:
|
||||
Options *options;
|
||||
public:
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "../../../Minecraft.World/Headers/net.minecraft.world.level.h"
|
||||
#include "../../../Minecraft.World/Headers/net.minecraft.world.level.storage.h"
|
||||
|
||||
RenameWorldScreen::RenameWorldScreen(Screen *lastScreen, const wstring& levelId)
|
||||
RenameWorldScreen::RenameWorldScreen(Screen *lastScreen, const std::wstring& levelId)
|
||||
{
|
||||
nameEdit = NULL;
|
||||
this->lastScreen = lastScreen;
|
||||
@@ -31,7 +31,7 @@ void RenameWorldScreen::init()
|
||||
|
||||
LevelStorageSource *levelSource = minecraft->getLevelSource();
|
||||
LevelData *levelData = levelSource->getDataTagFor(levelId);
|
||||
wstring currentName = levelData->getLevelName();
|
||||
std::wstring currentName = levelData->getLevelName();
|
||||
|
||||
nameEdit = new EditBox(this, font, width / 2 - 100, 60, 200, 20, currentName);
|
||||
nameEdit->inFocus = true;
|
||||
|
||||
@@ -9,10 +9,10 @@ class RenameWorldScreen : public Screen
|
||||
private:
|
||||
Screen *lastScreen;
|
||||
EditBox *nameEdit;
|
||||
wstring levelId;
|
||||
std::wstring levelId;
|
||||
|
||||
public:
|
||||
RenameWorldScreen(Screen *lastScreen, const wstring& levelId);
|
||||
RenameWorldScreen(Screen *lastScreen, const std::wstring& levelId);
|
||||
virtual void tick();
|
||||
virtual void init() ;
|
||||
virtual void removed();
|
||||
|
||||
@@ -48,14 +48,14 @@ void SelectWorldScreen::loadLevelList()
|
||||
selectedWorld = -1;
|
||||
}
|
||||
|
||||
wstring SelectWorldScreen::getWorldId(int id)
|
||||
std::wstring SelectWorldScreen::getWorldId(int id)
|
||||
{
|
||||
return levelList->at(id)->getLevelId();
|
||||
}
|
||||
|
||||
wstring SelectWorldScreen::getWorldName(int id)
|
||||
std::wstring SelectWorldScreen::getWorldName(int id)
|
||||
{
|
||||
wstring levelName = levelList->at(id)->getLevelName();
|
||||
std::wstring levelName = levelList->at(id)->getLevelName();
|
||||
|
||||
if ( levelName.length() == 0 )
|
||||
{
|
||||
@@ -87,16 +87,16 @@ void SelectWorldScreen::buttonClicked(Button *button)
|
||||
if (!button->active) return;
|
||||
if (button->id == BUTTON_DELETE_ID)
|
||||
{
|
||||
wstring worldName = getWorldName(selectedWorld);
|
||||
std::wstring worldName = getWorldName(selectedWorld);
|
||||
if (worldName != L"")
|
||||
{
|
||||
isDeleting = true;
|
||||
|
||||
Language *language = Language::getInstance();
|
||||
wstring title = language->getElement(L"selectWorld.deleteQuestion");
|
||||
wstring warning = L"'" + worldName + L"' " + language->getElement(L"selectWorld.deleteWarning");
|
||||
wstring yes = language->getElement(L"selectWorld.deleteButton");
|
||||
wstring no = language->getElement(L"gui.cancel");
|
||||
std::wstring title = language->getElement(L"selectWorld.deleteQuestion");
|
||||
std::wstring warning = L"'" + worldName + L"' " + language->getElement(L"selectWorld.deleteWarning");
|
||||
std::wstring yes = language->getElement(L"selectWorld.deleteButton");
|
||||
std::wstring no = language->getElement(L"gui.cancel");
|
||||
|
||||
ConfirmScreen *confirmScreen = new ConfirmScreen(this, title, warning, yes, no, selectedWorld);
|
||||
minecraft->setScreen(confirmScreen);
|
||||
@@ -147,7 +147,7 @@ void SelectWorldScreen::worldSelected(int id)
|
||||
done = true;
|
||||
minecraft->gameMode = NULL; //new SurvivalMode(minecraft);
|
||||
|
||||
wstring worldFolderName = getWorldId(id);
|
||||
std::wstring worldFolderName = getWorldId(id);
|
||||
if (worldFolderName == L"") // 4J - was NULL comparison
|
||||
{
|
||||
worldFolderName = L"World" + _toString<int>(id);
|
||||
@@ -271,13 +271,13 @@ void SelectWorldScreen::WorldSelectionList::renderItem(int i, int x, int y, int
|
||||
{
|
||||
LevelSummary *levelSummary = parent->levelList->at(i);
|
||||
|
||||
wstring name = levelSummary->getLevelName();
|
||||
std::wstring name = levelSummary->getLevelName();
|
||||
if (name.length()==0)
|
||||
{
|
||||
name = parent->worldLang + L" " + _toString<int>(i + 1);
|
||||
}
|
||||
|
||||
wstring id = levelSummary->getLevelId();
|
||||
std::wstring id = levelSummary->getLevelId();
|
||||
|
||||
ULARGE_INTEGER rawtime;
|
||||
rawtime.QuadPart = levelSummary->getLastPlayed() * 10000; // Convert it from milliseconds back to FileTime
|
||||
@@ -296,7 +296,7 @@ void SelectWorldScreen::WorldSelectionList::renderItem(int i, int x, int y, int
|
||||
|
||||
__int64 size = levelSummary->getSizeOnDisk();
|
||||
id = id + L", " + _toString<float>(size / 1024 * 100 / 1024 / 100.0f) + L" MB)";
|
||||
wstring info;
|
||||
std::wstring info;
|
||||
|
||||
if (levelSummary->isRequiresConversion())
|
||||
{
|
||||
|
||||
@@ -25,14 +25,14 @@ private:
|
||||
|
||||
protected:
|
||||
Screen *lastScreen;
|
||||
wstring title;
|
||||
std::wstring title;
|
||||
private:
|
||||
bool done;
|
||||
int selectedWorld;
|
||||
vector<LevelSummary *> *levelList;
|
||||
WorldSelectionList *worldSelectionList;
|
||||
wstring worldLang;
|
||||
wstring conversionLang;
|
||||
std::wstring worldLang;
|
||||
std::wstring conversionLang;
|
||||
bool isDeleting;
|
||||
|
||||
Button *deleteButton;
|
||||
@@ -45,8 +45,8 @@ public:
|
||||
private:
|
||||
void loadLevelList();
|
||||
protected:
|
||||
wstring getWorldId(int id);
|
||||
wstring getWorldName(int id);
|
||||
std::wstring getWorldId(int id);
|
||||
std::wstring getWorldName(int id);
|
||||
public:
|
||||
virtual void postInit();
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ void StatsScreen::GeneralStatisticsList::renderItem(int i, int x, int y, int h,
|
||||
{
|
||||
Stat *stat = Stats::generalStats->at(i);
|
||||
parent->drawString(parent->font, stat->name, x + 2, y + 1, i % 2 == 0 ? 0xffffff : 0x909090);
|
||||
wstring msg = stat->format(parent->stats->getTotalValue(stat));
|
||||
std::wstring msg = stat->format(parent->stats->getTotalValue(stat));
|
||||
parent->drawString(parent->font, msg, x + 2 + 213 - parent->font->width(msg), y + 1, i % 2 == 0 ? 0xffffff : 0x909090);
|
||||
}
|
||||
|
||||
@@ -305,12 +305,12 @@ void StatsScreen::StatisticsList::renderStat(ItemStat *stat, int x, int y, bool
|
||||
{
|
||||
if (stat != NULL)
|
||||
{
|
||||
wstring msg = stat->format(parent->stats->getTotalValue(stat));
|
||||
std::wstring msg = stat->format(parent->stats->getTotalValue(stat));
|
||||
parent->drawString(parent->font, msg, x - parent->font->width(msg), y + SLOT_TEXT_OFFSET, shaded ? 0xffffff : 0x909090);
|
||||
}
|
||||
else
|
||||
{
|
||||
wstring msg = L"-";
|
||||
std::wstring msg = L"-";
|
||||
parent->drawString(parent->font, msg, x - parent->font->width(msg), y + SLOT_TEXT_OFFSET, shaded ? 0xffffff : 0x909090);
|
||||
}
|
||||
}
|
||||
@@ -336,7 +336,7 @@ void StatsScreen::StatisticsList::renderDecorations(int mouseX, int mouseY)
|
||||
}
|
||||
else
|
||||
{
|
||||
wstring elementName;
|
||||
std::wstring elementName;
|
||||
if (mouseX >= (rowX + ROW_COL_1 - SLOT_BG_SIZE) && mouseX <= (rowX + ROW_COL_1))
|
||||
{
|
||||
elementName = getHeaderDescriptionId(0);
|
||||
@@ -380,7 +380,7 @@ void StatsScreen::StatisticsList::renderMousehoverTooltip(ItemStat *stat, int x,
|
||||
|
||||
Item *item = Item::items[stat->getItemId()];
|
||||
|
||||
wstring elementName = trimString(L"" + Language::getInstance()->getElementName(item->getDescriptionId()));
|
||||
std::wstring elementName = trimString(L"" + Language::getInstance()->getElementName(item->getDescriptionId()));
|
||||
|
||||
if (elementName.length() > 0)
|
||||
{
|
||||
@@ -526,7 +526,7 @@ void StatsScreen::ItemStatisticsList::renderItem(int i, int x, int y, int h, Tes
|
||||
renderStat((ItemStat *) stat, x + ROW_COL_3, y, i % 2 == 0);*/
|
||||
}
|
||||
|
||||
wstring StatsScreen::ItemStatisticsList::getHeaderDescriptionId(int column)
|
||||
std::wstring StatsScreen::ItemStatisticsList::getHeaderDescriptionId(int column)
|
||||
{
|
||||
if (column == COLUMN_CRAFTED)
|
||||
{
|
||||
@@ -653,7 +653,7 @@ void StatsScreen::BlockStatisticsList::renderItem(int i, int x, int y, int h, Te
|
||||
renderStat((ItemStat *) mineCount, x + ROW_COL_3, y, i % 2 == 0);*/
|
||||
}
|
||||
|
||||
wstring StatsScreen::BlockStatisticsList::getHeaderDescriptionId(int column)
|
||||
std::wstring StatsScreen::BlockStatisticsList::getHeaderDescriptionId(int column)
|
||||
{
|
||||
if (column == COLUMN_CRAFTED)
|
||||
{
|
||||
|
||||
@@ -15,7 +15,7 @@ protected:
|
||||
static const int BUTTON_ITEMSTATS_ID = 3;
|
||||
|
||||
Screen *lastScreen;
|
||||
wstring title;
|
||||
std::wstring title;
|
||||
public:
|
||||
class GeneralStatisticsList;
|
||||
class ItemStatisticsList;
|
||||
@@ -92,7 +92,7 @@ private:
|
||||
virtual void clickedHeader(int headerMouseX, int headerMouseY);
|
||||
virtual int getNumberOfItems();
|
||||
ItemStat *getSlotStat(int slot);
|
||||
virtual wstring getHeaderDescriptionId(int column) = 0;
|
||||
virtual std::wstring getHeaderDescriptionId(int column) = 0;
|
||||
virtual void renderStat(ItemStat *stat, int x, int y, bool shaded);
|
||||
virtual void renderDecorations(int mouseX, int mouseY);
|
||||
virtual void renderMousehoverTooltip(ItemStat *stat, int x, int y);
|
||||
@@ -112,7 +112,7 @@ public:
|
||||
ItemStatisticsList(StatsScreen *ss); // 4J - added parameter so we can access parent
|
||||
virtual void renderHeader(int x, int y, Tesselator *t);
|
||||
virtual void renderItem(int i, int x, int y, int h, Tesselator *t);
|
||||
virtual wstring getHeaderDescriptionId(int column);
|
||||
virtual std::wstring getHeaderDescriptionId(int column);
|
||||
};
|
||||
|
||||
class BlockStatisticsList : public StatisticsList
|
||||
@@ -127,7 +127,7 @@ public:
|
||||
BlockStatisticsList(StatsScreen *ss); // 4J - added parameter so we can access parent
|
||||
virtual void renderHeader(int x, int y, Tesselator *t);
|
||||
virtual void renderItem(int i, int x, int y, int h, Tesselator *t);
|
||||
virtual wstring getHeaderDescriptionId(int column);
|
||||
virtual std::wstring getHeaderDescriptionId(int column);
|
||||
};
|
||||
|
||||
};
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "../../../Minecraft.World/Headers/net.minecraft.world.level.tile.h"
|
||||
|
||||
|
||||
const wstring TextEditScreen::allowedChars = SharedConstants::readAcceptableChars();
|
||||
const std::wstring TextEditScreen::allowedChars = SharedConstants::readAcceptableChars();
|
||||
|
||||
TextEditScreen::TextEditScreen(std::shared_ptr<SignTileEntity> sign)
|
||||
{
|
||||
@@ -61,12 +61,12 @@ void TextEditScreen::keyPressed(wchar_t ch, int eventKey)
|
||||
if (eventKey == Keyboard::KEY_UP) line = (line - 1) & 3;
|
||||
if (eventKey == Keyboard::KEY_DOWN || eventKey == Keyboard::KEY_RETURN) line = (line + 1) & 3;
|
||||
|
||||
wstring temp=sign->GetMessage(line);
|
||||
std::wstring temp=sign->GetMessage(line);
|
||||
if (eventKey == Keyboard::KEY_BACK && temp.length() > 0)
|
||||
{
|
||||
temp = temp.substr(0, temp.length() - 1);
|
||||
}
|
||||
if (allowedChars.find(ch) != wstring::npos && temp.length() < 15)
|
||||
if (allowedChars.find(ch) != std::wstring::npos && temp.length() < 15)
|
||||
{
|
||||
temp += ch;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ using namespace std;
|
||||
class TextEditScreen : public Screen
|
||||
{
|
||||
protected:
|
||||
wstring title;
|
||||
std::wstring title;
|
||||
private:
|
||||
std::shared_ptr<SignTileEntity> sign;
|
||||
int frame;
|
||||
@@ -20,7 +20,7 @@ public:
|
||||
protected:
|
||||
virtual void buttonClicked(Button *button);
|
||||
private:
|
||||
static const wstring allowedChars;
|
||||
static const std::wstring allowedChars;
|
||||
protected:
|
||||
virtual void keyPressed(wchar_t ch, int eventKey);
|
||||
public:
|
||||
|
||||
@@ -22,12 +22,12 @@ TitleScreen::TitleScreen()
|
||||
|
||||
splash = L"missingno";
|
||||
// try { // 4J - removed try/catch
|
||||
vector<wstring> splashes;
|
||||
vector<std::wstring> splashes;
|
||||
|
||||
/*
|
||||
BufferedReader *br = new BufferedReader(new InputStreamReader(InputStream::getResourceAsStream(L"res\\title\\splashes.txt"))); //, Charset.forName("UTF-8")
|
||||
|
||||
wstring line = L"";
|
||||
std::wstring line = L"";
|
||||
while ( !(line = br->readLine()).empty() )
|
||||
{
|
||||
line = trimString( line );
|
||||
|
||||
@@ -11,7 +11,7 @@ private:
|
||||
|
||||
float vo;
|
||||
|
||||
wstring splash;
|
||||
std::wstring splash;
|
||||
Button *multiplayerButton;
|
||||
|
||||
public:
|
||||
|
||||
@@ -8,7 +8,7 @@ class VideoSettingsScreen : public Screen
|
||||
private:
|
||||
Screen *lastScreen;
|
||||
protected:
|
||||
wstring title;
|
||||
std::wstring title;
|
||||
private:
|
||||
Options *options;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user