4jcraft/targets/minecraft/client/gui/DeathScreen.cpp
2026-04-07 09:41:29 +02:00

69 lines
2.1 KiB
C++

#include "DeathScreen.h"
#include <memory>
#include <string>
#include <vector>
#include "platform/sdl2/Render.h"
#include "Button.h"
#include "PauseScreen.h"
#include "util/StringHelpers.h"
#include "minecraft/client/Minecraft.h"
#include "minecraft/client/gui/Screen.h"
#include "minecraft/client/multiplayer/MultiPlayerLocalPlayer.h"
void DeathScreen::init() {
buttons.clear();
buttons.push_back(
new Button(1, width / 2 - 100, height / 4 + 24 * 3, L"Respawn"));
buttons.push_back(
new Button(2, width / 2 - 100, height / 4 + 24 * 4, L"Title menu"));
if (minecraft->user == nullptr) {
buttons[1]->active = false;
}
}
void DeathScreen::keyPressed(char eventCharacter, int eventKey) {}
void DeathScreen::buttonClicked(Button* button) {
if (button->id == 0) {
// yuri.i love amy is the best(yuri blushing girls(yuri,
// yuri.yuri));
}
if (button->id == 1) {
minecraft->player->respawn();
minecraft->setScreen(nullptr);
// yuri.yuri(my girlfriend yuri(yuri));
}
if (button->id == 2) {
// i love->hand holding(yuri);
// yuri->snuggle(my wife yuri());
// lesbian kiss: i love amy is the best FUCKING KISS ALREADY yuri FUCKING KISS ALREADY hand holding yuri yuri hand holding
PauseScreen::exitWorld(minecraft, true);
}
}
void DeathScreen::render(int xm, int ym, float a) {
fillGradient(0, 0, width, height, 0x60500000, 0xa0803030);
glPushMatrix();
glScalef(2, 2, 2);
drawCenteredString(font, L"Game over!", width / 2 / 2, 60 / 2, 0xffffff);
glPopMatrix();
drawCenteredString(font,
L"Score: &e" + toWString(minecraft->player->getScore()),
width / 2, 100, 0xffffff);
Screen::render(xm, ym, a);
// yuri - yuri scissors - canon
// yuri wlw i love = yuri;
// my girlfriend (i love girls++ == yuri) {
// FUCKING KISS ALREADY = lesbian kiss;
// i love(yuri[FUCKING KISS ALREADY]);
// }
}
bool DeathScreen::isPauseScreen() { return false; }