mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-05-31 19:54:58 +00:00
chore: format Minecraft.Client
This commit is contained in:
@@ -5,66 +5,51 @@
|
||||
#include "../../../Minecraft.World/Headers/net.minecraft.locale.h"
|
||||
#include "../../../Minecraft.World/Util/StringHelpers.h"
|
||||
|
||||
void InBedChatScreen::init()
|
||||
{
|
||||
void InBedChatScreen::init() {
|
||||
Keyboard::enableRepeatEvents(true);
|
||||
|
||||
Language *language = Language::getInstance();
|
||||
|
||||
buttons.push_back(new Button(WAKE_UP_BUTTON, width / 2 - 100, height - 40, language->getElement(L"multiplayer.stopSleeping")));
|
||||
Language* language = Language::getInstance();
|
||||
|
||||
buttons.push_back(
|
||||
new Button(WAKE_UP_BUTTON, width / 2 - 100, height - 40,
|
||||
language->getElement(L"multiplayer.stopSleeping")));
|
||||
}
|
||||
|
||||
void InBedChatScreen::removed()
|
||||
{
|
||||
Keyboard::enableRepeatEvents(false);
|
||||
}
|
||||
void InBedChatScreen::removed() { Keyboard::enableRepeatEvents(false); }
|
||||
|
||||
void InBedChatScreen::keyPressed(wchar_t ch, int eventKey)
|
||||
{
|
||||
if (eventKey == Keyboard::KEY_ESCAPE)
|
||||
{
|
||||
void InBedChatScreen::keyPressed(wchar_t ch, int eventKey) {
|
||||
if (eventKey == Keyboard::KEY_ESCAPE) {
|
||||
sendWakeUp();
|
||||
}
|
||||
else if (eventKey == Keyboard::KEY_RETURN)
|
||||
{
|
||||
} else if (eventKey == Keyboard::KEY_RETURN) {
|
||||
std::wstring msg = trimString(message);
|
||||
if (msg.length() > 0)
|
||||
{
|
||||
if (msg.length() > 0) {
|
||||
minecraft->player->chat(trimString(message));
|
||||
}
|
||||
message = L"";
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
ChatScreen::keyPressed(ch, eventKey);
|
||||
}
|
||||
}
|
||||
|
||||
void InBedChatScreen::render(int xm, int ym, float a)
|
||||
{
|
||||
ChatScreen::render(xm, ym, a);
|
||||
void InBedChatScreen::render(int xm, int ym, float a) {
|
||||
ChatScreen::render(xm, ym, a);
|
||||
}
|
||||
|
||||
void InBedChatScreen::buttonClicked(Button *button)
|
||||
{
|
||||
if (button->id == WAKE_UP_BUTTON)
|
||||
{
|
||||
void InBedChatScreen::buttonClicked(Button* button) {
|
||||
if (button->id == WAKE_UP_BUTTON) {
|
||||
sendWakeUp();
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
ChatScreen::buttonClicked(button);
|
||||
}
|
||||
}
|
||||
|
||||
void InBedChatScreen::sendWakeUp()
|
||||
{
|
||||
/* 4J - TODO
|
||||
if (minecraft.player instanceof MultiplayerLocalPlayer)
|
||||
{
|
||||
ClientConnection connection = ((MultiplayerLocalPlayer) minecraft.player).connection;
|
||||
connection.send(new PlayerCommandPacket(minecraft.player, PlayerCommandPacket.STOP_SLEEPING));
|
||||
}
|
||||
*/
|
||||
void InBedChatScreen::sendWakeUp() {
|
||||
/* 4J - TODO
|
||||
if (minecraft.player instanceof MultiplayerLocalPlayer)
|
||||
{
|
||||
ClientConnection connection = ((MultiplayerLocalPlayer)
|
||||
minecraft.player).connection; connection.send(new
|
||||
PlayerCommandPacket(minecraft.player, PlayerCommandPacket.STOP_SLEEPING));
|
||||
}
|
||||
*/
|
||||
}
|
||||
Reference in New Issue
Block a user