mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-08-19 19:17:18 +00:00
chore: fmt
This commit is contained in:
parent
1a478c8a5b
commit
02845d9a5f
|
|
@ -43,7 +43,7 @@ void Button::render(Minecraft* minecraft, int xm, int ym) {
|
||||||
Font* font = minecraft->font;
|
Font* font = minecraft->font;
|
||||||
|
|
||||||
// glBindTexture(GL_TEXTURE_2D, minecraft->textures->loadTexture(
|
// glBindTexture(GL_TEXTURE_2D, minecraft->textures->loadTexture(
|
||||||
// TN_GUI_GUI)); // 4J was L"/gui/gui.png"
|
// TN_GUI_GUI)); // 4J was L"/gui/gui.png"
|
||||||
minecraft->textures->bindTexture(&GUI_GUI_LOCATION);
|
minecraft->textures->bindTexture(&GUI_GUI_LOCATION);
|
||||||
glColor4f(1, 1, 1, 1);
|
glColor4f(1, 1, 1, 1);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -68,14 +68,14 @@ void AchievementPopup::prepareWindow() {
|
||||||
void AchievementPopup::render() {
|
void AchievementPopup::render() {
|
||||||
// 4J Unused
|
// 4J Unused
|
||||||
#if ENABLE_JAVA_GUIS
|
#if ENABLE_JAVA_GUIS
|
||||||
if (Minecraft::warezTime > 0)
|
if (Minecraft::warezTime > 0) {
|
||||||
{
|
|
||||||
glDisable(GL_DEPTH_TEST);
|
glDisable(GL_DEPTH_TEST);
|
||||||
glDepthMask(false);
|
glDepthMask(false);
|
||||||
Lighting::turnOff();
|
Lighting::turnOff();
|
||||||
prepareWindow();
|
prepareWindow();
|
||||||
|
|
||||||
std::wstring title = L"Minecraft " + SharedConstants::VERSION_STRING + L" Unlicensed Copy :(";
|
std::wstring title = L"Minecraft " + SharedConstants::VERSION_STRING +
|
||||||
|
L" Unlicensed Copy :(";
|
||||||
std::wstring msg1 = L"(Or logged in from another location)";
|
std::wstring msg1 = L"(Or logged in from another location)";
|
||||||
std::wstring msg2 = L"Purchase at minecraft.net";
|
std::wstring msg2 = L"Purchase at minecraft.net";
|
||||||
|
|
||||||
|
|
@ -89,16 +89,12 @@ void AchievementPopup::render() {
|
||||||
if (ach == NULL || startTime == 0) return;
|
if (ach == NULL || startTime == 0) return;
|
||||||
|
|
||||||
double time = (System::currentTimeMillis() - startTime) / 3000.0;
|
double time = (System::currentTimeMillis() - startTime) / 3000.0;
|
||||||
if (isHelper)
|
if (isHelper) {
|
||||||
{
|
} else if (!isHelper && (time < 0 || time > 1)) {
|
||||||
}
|
|
||||||
else if (!isHelper && (time < 0 || time > 1))
|
|
||||||
{
|
|
||||||
startTime = 0;
|
startTime = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
prepareWindow();
|
prepareWindow();
|
||||||
glDisable(GL_DEPTH_TEST);
|
glDisable(GL_DEPTH_TEST);
|
||||||
glDepthMask(false);
|
glDepthMask(false);
|
||||||
|
|
@ -112,7 +108,7 @@ void AchievementPopup::render() {
|
||||||
yo = yo * yo;
|
yo = yo * yo;
|
||||||
|
|
||||||
int xx = width - 160;
|
int xx = width - 160;
|
||||||
int yy = 0 - (int) (yo * 36);
|
int yy = 0 - (int)(yo * 36);
|
||||||
int tex = mc->textures->loadTexture(TN_ACHIEVEMENT_BG);
|
int tex = mc->textures->loadTexture(TN_ACHIEVEMENT_BG);
|
||||||
glColor4f(1, 1, 1, 1);
|
glColor4f(1, 1, 1, 1);
|
||||||
glEnable(GL_TEXTURE_2D);
|
glEnable(GL_TEXTURE_2D);
|
||||||
|
|
@ -122,13 +118,13 @@ void AchievementPopup::render() {
|
||||||
blit(xx, yy, 96, 202, 160, 32);
|
blit(xx, yy, 96, 202, 160, 32);
|
||||||
|
|
||||||
// if (isHelper)
|
// if (isHelper)
|
||||||
// {
|
// {
|
||||||
// mc->font->drawWordWrap(desc, xx + 30, yy + 7, 120, 0xffffffff);
|
// mc->font->drawWordWrap(desc, xx + 30, yy + 7, 120, 0xffffffff);
|
||||||
// }
|
// }
|
||||||
// else
|
// else
|
||||||
// {
|
// {
|
||||||
mc->font->draw(title, xx + 30, yy + 7, 0xffffff00);
|
mc->font->draw(title, xx + 30, yy + 7, 0xffffff00);
|
||||||
mc->font->draw(desc, xx + 30, yy + 18, 0xffffffff);
|
mc->font->draw(desc, xx + 30, yy + 18, 0xffffffff);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,8 @@ ResourceLocation GUI_CRAFTING_LOCATION = ResourceLocation(TN_GUI_CRAFTING);
|
||||||
CraftingScreen::CraftingScreen(std::shared_ptr<Inventory> inventory,
|
CraftingScreen::CraftingScreen(std::shared_ptr<Inventory> inventory,
|
||||||
Level* level, int x, int y, int z)
|
Level* level, int x, int y, int z)
|
||||||
: AbstractContainerScreen(new CraftingMenu(inventory, level, x, y, z)) {
|
: AbstractContainerScreen(new CraftingMenu(inventory, level, x, y, z)) {
|
||||||
this->inventory = inventory;
|
this->inventory = inventory;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CraftingScreen::removed() {
|
void CraftingScreen::removed() {
|
||||||
AbstractContainerScreen::removed();
|
AbstractContainerScreen::removed();
|
||||||
|
|
@ -21,7 +21,8 @@ void CraftingScreen::removed() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void CraftingScreen::renderLabels() {
|
void CraftingScreen::renderLabels() {
|
||||||
font->draw(Language::getInstance()->getElement(L"container.crafting"), 8 + 16 + 4, 2 + 2 + 2, 0x404040);
|
font->draw(Language::getInstance()->getElement(L"container.crafting"),
|
||||||
|
8 + 16 + 4, 2 + 2 + 2, 0x404040);
|
||||||
font->draw(inventory->getName(), 8, imageHeight - 96 + 2, 0x404040);
|
font->draw(inventory->getName(), 8, imageHeight - 96 + 2, 0x404040);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,9 @@ void SelectWorldScreen::buttonClicked(Button* button) {
|
||||||
minecraft->setScreen(
|
minecraft->setScreen(
|
||||||
new RenameWorldScreen(this, getWorldId(selectedWorld)));
|
new RenameWorldScreen(this, getWorldId(selectedWorld)));
|
||||||
} else if (button->id == BUTTON_CANCEL_ID) {
|
} else if (button->id == BUTTON_CANCEL_ID) {
|
||||||
app.DebugPrintf("SelectWorldScreen::buttonClicked 'Cancel' minecraft->setScreen(lastScreen)\n");
|
app.DebugPrintf(
|
||||||
|
"SelectWorldScreen::buttonClicked 'Cancel' "
|
||||||
|
"minecraft->setScreen(lastScreen)\n");
|
||||||
minecraft->setScreen(lastScreen);
|
minecraft->setScreen(lastScreen);
|
||||||
} else {
|
} else {
|
||||||
worldSelectionList->buttonClicked(button);
|
worldSelectionList->buttonClicked(button);
|
||||||
|
|
@ -181,9 +183,9 @@ void SelectWorldScreen::render(int xm, int ym, float a) {
|
||||||
static bool forceCreateLevel = false;
|
static bool forceCreateLevel = false;
|
||||||
if (count++ >= 100) {
|
if (count++ >= 100) {
|
||||||
if (!forceCreateLevel && levelList->size() > 0) {
|
if (!forceCreateLevel && levelList->size() > 0) {
|
||||||
// 4J Stu - For some obscures reason the "delete" button is called
|
// 4J Stu - For some obscures reason the "delete" button is
|
||||||
// "renameButton" and vice versa.
|
// called "renameButton" and vice versa. if( levelList->size() >
|
||||||
// if( levelList->size() > 2 && deleteButton->active )
|
// 2 && deleteButton->active )
|
||||||
//{
|
//{
|
||||||
// this->selectedWorld = 2;
|
// this->selectedWorld = 2;
|
||||||
// count = 0;
|
// count = 0;
|
||||||
|
|
@ -205,7 +207,9 @@ void SelectWorldScreen::render(int xm, int ym, float a) {
|
||||||
count = 0;
|
count = 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
app.DebugPrintf("SelectWorldScreen::render minecraft->setScreen(new CreateWorldScreen(this))\n");
|
app.DebugPrintf(
|
||||||
|
"SelectWorldScreen::render minecraft->setScreen(new "
|
||||||
|
"CreateWorldScreen(this))\n");
|
||||||
minecraft->setScreen(new CreateWorldScreen(this));
|
minecraft->setScreen(new CreateWorldScreen(this));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ protected:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// final DateFormat DATE_FORMAT = new SimpleDateFormat(); // 4J -
|
// final DateFormat DATE_FORMAT = new SimpleDateFormat(); // 4J -
|
||||||
//removed
|
// removed
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Screen* lastScreen;
|
Screen* lastScreen;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue