easter: add easter_egg
This commit is contained in:
@@ -17,7 +17,8 @@
|
||||
#include "../format.h"
|
||||
#include <tesla.hpp>
|
||||
#include <string>
|
||||
|
||||
#include "cat.h"
|
||||
#include "ult_ext.h"
|
||||
tsl::elm::ListItem* SpeedoItem = NULL;
|
||||
tsl::elm::ListItem* IddqItem = NULL;
|
||||
|
||||
@@ -174,6 +175,16 @@ void AboutGui::listUI()
|
||||
this->listElement->addItem(
|
||||
new tsl::elm::ListItem("The Switch Homebrew Community")
|
||||
);
|
||||
|
||||
this->listElement->addItem(
|
||||
new tsl::elm::CategoryHeader("Cat")
|
||||
);
|
||||
this->listElement->addItem(
|
||||
new ImageElement(CAT_DATA, CAT_WIDTH, CAT_HEIGHT)
|
||||
);
|
||||
|
||||
this->listElement->addItem(new tsl::elm::CustomDrawer([](tsl::gfx::Renderer*, s32, s32, s32, s32) {}), 75); // add a bit of space
|
||||
|
||||
}
|
||||
|
||||
void AboutGui::update()
|
||||
|
||||
4101
Source/sys-clk/overlay/src/ui/gui/cat.h
Normal file
4101
Source/sys-clk/overlay/src/ui/gui/cat.h
Normal file
File diff suppressed because it is too large
Load Diff
36
Source/sys-clk/overlay/src/ui/gui/ult_ext.h
Normal file
36
Source/sys-clk/overlay/src/ui/gui/ult_ext.h
Normal file
@@ -0,0 +1,36 @@
|
||||
#pragma once
|
||||
#include <tesla.hpp>
|
||||
|
||||
class ImageElement : public tsl::elm::ListItem {
|
||||
private:
|
||||
const uint8_t* imgData;
|
||||
uint32_t imgWidth, imgHeight;
|
||||
|
||||
public:
|
||||
ImageElement(const uint8_t* data, uint32_t w, uint32_t h)
|
||||
: tsl::elm::ListItem(""), imgData(data), imgWidth(w), imgHeight(h) {}
|
||||
|
||||
virtual void draw(tsl::gfx::Renderer *renderer) override {
|
||||
// Draw image centered horizontally
|
||||
u16 centerX = this->getX() + (this->getWidth() - imgWidth) / 2;
|
||||
renderer->drawBitmap(
|
||||
centerX,
|
||||
this->getY() + 10,
|
||||
imgWidth,
|
||||
imgHeight,
|
||||
imgData
|
||||
);
|
||||
}
|
||||
|
||||
virtual void drawHighlight(tsl::gfx::Renderer *renderer) override {
|
||||
// Do nothing - no highlight
|
||||
}
|
||||
|
||||
virtual bool onClick(u64 keys) override {
|
||||
return false; // Non-clickable
|
||||
}
|
||||
|
||||
virtual Element* requestFocus(Element *oldFocus, tsl::FocusDirection direction) override {
|
||||
return nullptr; // Make it non-focusable so it can't be selected
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user