mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-05-23 02:05:31 +00:00
chore: format Minecraft.Client
This commit is contained in:
@@ -6,59 +6,47 @@
|
||||
#include "../Textures/Textures.h"
|
||||
#include "../../Minecraft.World/Util/SoundTypes.h"
|
||||
|
||||
|
||||
|
||||
Screen::Screen() // 4J added
|
||||
Screen::Screen() // 4J added
|
||||
{
|
||||
minecraft = NULL;
|
||||
width = 0;
|
||||
minecraft = NULL;
|
||||
width = 0;
|
||||
height = 0;
|
||||
passEvents = false;
|
||||
font = NULL;
|
||||
particles = NULL;
|
||||
clickedButton = NULL;
|
||||
passEvents = false;
|
||||
font = NULL;
|
||||
particles = NULL;
|
||||
clickedButton = NULL;
|
||||
}
|
||||
|
||||
void Screen::render(int xm, int ym, float a)
|
||||
{
|
||||
AUTO_VAR(itEnd, buttons.end());
|
||||
for (AUTO_VAR(it, buttons.begin()); it != itEnd; it++)
|
||||
{
|
||||
Button *button = *it; //buttons[i];
|
||||
void Screen::render(int xm, int ym, float a) {
|
||||
AUTO_VAR(itEnd, buttons.end());
|
||||
for (AUTO_VAR(it, buttons.begin()); it != itEnd; it++) {
|
||||
Button* button = *it; // buttons[i];
|
||||
button->render(minecraft, xm, ym);
|
||||
}
|
||||
}
|
||||
|
||||
void Screen::keyPressed(wchar_t eventCharacter, int eventKey)
|
||||
{
|
||||
if (eventKey == Keyboard::KEY_ESCAPE)
|
||||
{
|
||||
minecraft->setScreen(NULL);
|
||||
// minecraft->grabMouse(); // 4J - removed
|
||||
}
|
||||
void Screen::keyPressed(wchar_t eventCharacter, int eventKey) {
|
||||
if (eventKey == Keyboard::KEY_ESCAPE) {
|
||||
minecraft->setScreen(NULL);
|
||||
// minecraft->grabMouse(); // 4J - removed
|
||||
}
|
||||
}
|
||||
|
||||
std::wstring Screen::getClipboard()
|
||||
{
|
||||
// 4J - removed
|
||||
return NULL;
|
||||
std::wstring Screen::getClipboard() {
|
||||
// 4J - removed
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void Screen::setClipboard(const std::wstring& str)
|
||||
{
|
||||
// 4J - removed
|
||||
void Screen::setClipboard(const std::wstring& str) {
|
||||
// 4J - removed
|
||||
}
|
||||
|
||||
void Screen::mouseClicked(int x, int y, int buttonNum)
|
||||
{
|
||||
if (buttonNum == 0)
|
||||
{
|
||||
AUTO_VAR(itEnd, buttons.end());
|
||||
for (AUTO_VAR(it, buttons.begin()); it != itEnd; it++)
|
||||
{
|
||||
Button *button = *it; //buttons[i];
|
||||
if (button->clicked(minecraft, x, y))
|
||||
{
|
||||
void Screen::mouseClicked(int x, int y, int buttonNum) {
|
||||
if (buttonNum == 0) {
|
||||
AUTO_VAR(itEnd, buttons.end());
|
||||
for (AUTO_VAR(it, buttons.begin()); it != itEnd; it++) {
|
||||
Button* button = *it; // buttons[i];
|
||||
if (button->clicked(minecraft, x, y)) {
|
||||
clickedButton = button;
|
||||
minecraft->soundEngine->playUI(eSoundType_RANDOM_CLICK, 1, 1);
|
||||
buttonClicked(button);
|
||||
@@ -67,21 +55,16 @@ void Screen::mouseClicked(int x, int y, int buttonNum)
|
||||
}
|
||||
}
|
||||
|
||||
void Screen::mouseReleased(int x, int y, int buttonNum)
|
||||
{
|
||||
if (clickedButton!=NULL && buttonNum==0)
|
||||
{
|
||||
void Screen::mouseReleased(int x, int y, int buttonNum) {
|
||||
if (clickedButton != NULL && buttonNum == 0) {
|
||||
clickedButton->released(x, y);
|
||||
clickedButton = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void Screen::buttonClicked(Button *button)
|
||||
{
|
||||
}
|
||||
void Screen::buttonClicked(Button* button) {}
|
||||
|
||||
void Screen::init(Minecraft *minecraft, int width, int height)
|
||||
{
|
||||
void Screen::init(Minecraft* minecraft, int width, int height) {
|
||||
particles = new GuiParticles(minecraft);
|
||||
this->minecraft = minecraft;
|
||||
this->font = minecraft->font;
|
||||
@@ -91,97 +74,71 @@ void Screen::init(Minecraft *minecraft, int width, int height)
|
||||
init();
|
||||
}
|
||||
|
||||
void Screen::setSize(int width, int height)
|
||||
{
|
||||
void Screen::setSize(int width, int height) {
|
||||
this->width = width;
|
||||
this->height = height;
|
||||
}
|
||||
|
||||
void Screen::init()
|
||||
{
|
||||
void Screen::init() {}
|
||||
|
||||
void Screen::updateEvents() {
|
||||
/* 4J - TODO
|
||||
while (Mouse.next()) {
|
||||
mouseEvent();
|
||||
}
|
||||
|
||||
void Screen::updateEvents()
|
||||
{
|
||||
/* 4J - TODO
|
||||
while (Mouse.next()) {
|
||||
mouseEvent();
|
||||
}
|
||||
|
||||
while (Keyboard.next()) {
|
||||
keyboardEvent();
|
||||
}
|
||||
*/
|
||||
|
||||
while (Keyboard.next()) {
|
||||
keyboardEvent();
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
void Screen::mouseEvent()
|
||||
{
|
||||
/* 4J - TODO
|
||||
if (Mouse.getEventButtonState()) {
|
||||
int xm = Mouse.getEventX() * width / minecraft.width;
|
||||
int ym = height - Mouse.getEventY() * height / minecraft.height - 1;
|
||||
mouseClicked(xm, ym, Mouse.getEventButton());
|
||||
void Screen::mouseEvent() {
|
||||
/* 4J - TODO
|
||||
if (Mouse.getEventButtonState()) {
|
||||
int xm = Mouse.getEventX() * width / minecraft.width;
|
||||
int ym = height - Mouse.getEventY() * height / minecraft.height - 1;
|
||||
mouseClicked(xm, ym, Mouse.getEventButton());
|
||||
} else {
|
||||
int xm = Mouse.getEventX() * width / minecraft.width;
|
||||
int ym = height - Mouse.getEventY() * height / minecraft.height - 1;
|
||||
mouseReleased(xm, ym, Mouse.getEventButton());
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
void Screen::keyboardEvent() {
|
||||
/* 4J - TODO
|
||||
if (Keyboard.getEventKeyState()) {
|
||||
if (Keyboard.getEventKey() == Keyboard.KEY_F11) {
|
||||
minecraft.toggleFullScreen();
|
||||
return;
|
||||
}
|
||||
keyPressed(Keyboard.getEventCharacter(), Keyboard.getEventKey());
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
void Screen::tick() {}
|
||||
|
||||
void Screen::removed() {}
|
||||
|
||||
void Screen::renderBackground() { renderBackground(0); }
|
||||
|
||||
void Screen::renderBackground(int vo) {
|
||||
if (minecraft->level != NULL) {
|
||||
fillGradient(0, 0, width, height, 0xc0101010, 0xd0101010);
|
||||
} else {
|
||||
int xm = Mouse.getEventX() * width / minecraft.width;
|
||||
int ym = height - Mouse.getEventY() * height / minecraft.height - 1;
|
||||
mouseReleased(xm, ym, Mouse.getEventButton());
|
||||
renderDirtBackground(vo);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
void Screen::keyboardEvent()
|
||||
{
|
||||
/* 4J - TODO
|
||||
if (Keyboard.getEventKeyState()) {
|
||||
if (Keyboard.getEventKey() == Keyboard.KEY_F11) {
|
||||
minecraft.toggleFullScreen();
|
||||
return;
|
||||
}
|
||||
keyPressed(Keyboard.getEventCharacter(), Keyboard.getEventKey());
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
void Screen::tick()
|
||||
{
|
||||
}
|
||||
|
||||
void Screen::removed()
|
||||
{
|
||||
}
|
||||
|
||||
void Screen::renderBackground()
|
||||
{
|
||||
renderBackground(0);
|
||||
}
|
||||
|
||||
void Screen::renderBackground(int vo)
|
||||
{
|
||||
if (minecraft->level != NULL)
|
||||
{
|
||||
fillGradient(0, 0, width, height, 0xc0101010, 0xd0101010);
|
||||
}
|
||||
else
|
||||
{
|
||||
renderDirtBackground(vo);
|
||||
}
|
||||
}
|
||||
|
||||
void Screen::renderDirtBackground(int vo)
|
||||
{
|
||||
void Screen::renderDirtBackground(int vo) {
|
||||
// 4J Unused - Iggy Flash UI renders the background on consoles
|
||||
}
|
||||
|
||||
bool Screen::isPauseScreen()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
bool Screen::isPauseScreen() { return true; }
|
||||
|
||||
void Screen::confirmResult(bool result, int id)
|
||||
{
|
||||
}
|
||||
void Screen::confirmResult(bool result, int id) {}
|
||||
|
||||
void Screen::tabPressed()
|
||||
{
|
||||
}
|
||||
void Screen::tabPressed() {}
|
||||
|
||||
Reference in New Issue
Block a user