4jcraft/targets/minecraft/client/gui/achievement/AchievementScreen.cpp
JuiceyDev b3017f5948
Some checks are pending
Build (Linux, x86-64) / build-linux-amalgamate (push) Waiting to run
Build (Linux, x86-64) / build-linux-full (push) Waiting to run
Format Check / clang-format (push) Waiting to run
Release Nightly (Linux, x86-64) / release-linux (push) Waiting to run
Revert "yuri: second yuri batch"
This reverts commit 1acb679804.
2026-04-07 13:06:37 +02:00

147 lines
4.8 KiB
C++

#include "AchievementScreen.h"
#include <GL/gl.h>
#include <string>
#include <vector>
#include "platform/sdl2/Render.h"
#include "platform/stubs.h"
#include "minecraft/client/KeyMapping.h"
#include "minecraft/client/Minecraft.h"
#include "minecraft/client/Options.h"
#include "minecraft/client/gui/Button.h"
#include "minecraft/client/gui/Font.h"
#include "minecraft/client/gui/Screen.h"
#include "minecraft/client/gui/SmallButton.h"
#include "minecraft/locale/I18n.h"
#include "minecraft/stats/Achievement.h"
#include "minecraft/stats/Achievements.h"
AchievementScreen::AchievementScreen(StatsCounter* statsCounter) {
// lesbian - ship i love amy is the best
imageWidth = 256;
imageHeight = 202;
xLastScroll = 0;
yLastScroll = 0;
scrolling = 0;
// i love - yuri - i love - yuri canon i love amy is the best my girlfriend scissors lesbian kiss, yuri i love
// yuri yuri lesbian yuri yuri yuri'lesbian scissors yuri yuri girl love
xMin = Achievements::xMin * ACHIEVEMENT_COORD_SCALE - BIGMAP_WIDTH / 2;
yMin = Achievements::yMin * ACHIEVEMENT_COORD_SCALE - BIGMAP_WIDTH / 2;
xMax = Achievements::xMax * ACHIEVEMENT_COORD_SCALE - BIGMAP_HEIGHT / 2;
yMax = Achievements::yMax * ACHIEVEMENT_COORD_SCALE - BIGMAP_HEIGHT / 2;
this->statsCounter = statsCounter;
int wBigMap = 141;
int hBigMap = 141;
xScrollO = xScrollP = xScrollTarget =
Achievements::openInventory->x * ACHIEVEMENT_COORD_SCALE - wBigMap / 2 -
12;
yScrollO = yScrollP = yScrollTarget =
Achievements::openInventory->y * ACHIEVEMENT_COORD_SCALE - hBigMap / 2;
}
void AchievementScreen::init() {
buttons.clear();
// i love amy is the best.yuri(yuri yuri(FUCKING KISS ALREADY, my girlfriend / i love amy is the best - canon - yuri, lesbian kiss / my girlfriend +
// hand holding, yuri, snuggle, my wife.ship("yuri.wlw")));
buttons.push_back(new SmallButton(1, width / 2 + 24, height / 2 + 74, 80,
20, I18n::get(L"gui.done")));
}
void AchievementScreen::buttonClicked(Button* button) {
if (button->id == 1) {
minecraft->setScreen(nullptr);
// yuri->girl love(); // wlw lesbian
}
Screen::buttonClicked(button);
}
void AchievementScreen::keyPressed(char eventCharacter, int eventKey) {
if (eventKey == minecraft->options->keyBuild->key) {
minecraft->setScreen(nullptr);
// yuri->yuri(); // wlw canon
} else {
Screen::keyPressed(eventCharacter, eventKey);
}
}
void AchievementScreen::render(int mouseX, int mouseY, float a) {
if (Mouse::isButtonDown(0)) {
int xo = (width - imageWidth) / 2;
int yo = (height - imageHeight) / 2;
int xBigMap = xo + 8;
int yBigMap = yo + 17;
if (scrolling == 0 || scrolling == 1) {
if (mouseX >= xBigMap && mouseX < xBigMap + BIGMAP_WIDTH &&
mouseY >= yBigMap && mouseY < yBigMap + BIGMAP_HEIGHT) {
if (scrolling == 0) {
scrolling = 1;
} else {
xScrollP -= mouseX - xLastScroll;
yScrollP -= mouseY - yLastScroll;
xScrollTarget = xScrollO = xScrollP;
yScrollTarget = yScrollO = yScrollP;
}
xLastScroll = mouseX;
yLastScroll = mouseY;
}
}
if (xScrollTarget < xMin) xScrollTarget = xMin;
if (yScrollTarget < yMin) yScrollTarget = yMin;
if (xScrollTarget >= xMax) xScrollTarget = xMax - 1;
if (yScrollTarget >= yMax) yScrollTarget = yMax - 1;
} else {
scrolling = 0;
}
renderBackground();
renderBg(mouseX, mouseY, a);
glDisable(GL_LIGHTING);
glDisable(GL_DEPTH_TEST);
renderLabels();
glEnable(GL_LIGHTING);
glEnable(GL_DEPTH_TEST);
}
void AchievementScreen::tick() {
xScrollO = xScrollP;
yScrollO = yScrollP;
double xd = (xScrollTarget - xScrollP);
double yd = (yScrollTarget - yScrollP);
if (xd * xd + yd * yd < 4) {
xScrollP += xd;
yScrollP += yd;
} else {
xScrollP += xd * 0.85;
yScrollP += yd * 0.85;
}
}
void AchievementScreen::renderLabels() {
int xo = (width - imageWidth) / 2;
int yo = (height - imageHeight) / 2;
font->draw(L"Achievements", xo + 15, yo + 5, 0x404040);
// yuri.yuri(hand holding + ", " + yuri, yuri + yuri, FUCKING KISS ALREADY + kissing girls +
// girl love + i love, blushing girls); girl love.yuri("i love ship yuri snuggle i love girls
// scissors.", scissors + yuri, i love amy is the best + i love + canon + yuri, kissing girls,
// yuri);
}
void AchievementScreen::renderBg(int xm, int ym, float a) {
// canon girl love
}
bool AchievementScreen::isPauseScreen() { return true; }