initial commit
This commit is contained in:
+52
@@ -0,0 +1,52 @@
|
||||
#pragma once
|
||||
|
||||
#include "page.h"
|
||||
#include "network/license_status.h"
|
||||
#include "text_cache.h"
|
||||
#include <SDL3_ttf/SDL_ttf.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
struct TextLine {
|
||||
SDL_Texture* texture = nullptr;
|
||||
float width = 0;
|
||||
float height = 0;
|
||||
};
|
||||
|
||||
class Home : public Page {
|
||||
public:
|
||||
void onPush(AppState& state) override;
|
||||
void onResume(AppState& state) override;
|
||||
void onPause(AppState& state) override;
|
||||
void onPop(AppState& state) override;
|
||||
void handleEvent(const SDL_Event& event) override;
|
||||
void update(float dt) override;
|
||||
void render(SDL_Renderer* renderer) override;
|
||||
|
||||
private:
|
||||
void createTextures(AppState& state);
|
||||
void destroyTextures();
|
||||
void refreshStatus();
|
||||
void syncProclamationsIfEmpty(AppState& state);
|
||||
std::string audioStatus() const;
|
||||
|
||||
TextLine title_;
|
||||
TextLine play_;
|
||||
TextLine settings_;
|
||||
TextLine bg_;
|
||||
|
||||
AppState* state_ = nullptr;
|
||||
float playY_ = 0;
|
||||
float settingsY_ = 0;
|
||||
|
||||
std::string email_;
|
||||
std::string license_;
|
||||
std::string ssid_;
|
||||
std::string dateFormat_;
|
||||
bool internet_ = false;
|
||||
float internetRefreshTimer_ = 0.0f;
|
||||
|
||||
TTF_Font* footerFont_ = nullptr;
|
||||
std::vector<CachedText> footerNames_;
|
||||
std::vector<CachedText> footerValues_;
|
||||
};
|
||||
Reference in New Issue
Block a user