12#ifndef ZOAPPUIRECORDSBROWSER_H
13#define ZOAPPUIRECORDSBROWSER_H
15#define GLM_ENABLE_EXPERIMENTAL
16#include <glm/gtx/string_cast.hpp>
19#include "toymaker/sim_system.hpp"
33 inline static std::string getSimObjectAspectTypeName() {
return "UrUIRecordsBrowser"; }
34 static std::shared_ptr<BaseSimObjectAspect> create(
const nlohmann::json& jsonAspectProperties);
35 std::shared_ptr<BaseSimObjectAspect>
clone()
const override;
38 void loadScene(
const std::string& sceneResourceName);
41 Mode mMode { Mode::BROWSE };
43 std::vector<GameRecord> mFetchedRecords {};
45 void refreshRecords();
46 void onButtonClicked(
const std::string& button);
49 bool hasPage(uint32_t page)
const;
50 void openPage(uint32_t page);
52 void openDetailedRecord(uint32_t entry);
53 void closeDetailedRecord();
59 return this->onCancel(actionData, actionDefinition);
62 std::weak_ptr<ToyMaker::FixedActionBinding> handlerLeftRelease {
65 return this->onCancel(actionData, actionDefinition);
71 *
this,
"ButtonClickedObserved",
72 [
this](
const std::string& button) { this->onButtonClicked(button); }
std::weak_ptr< FixedActionBinding > declareFixedActionBinding(const std::string &context, const std::string &action, std::function< bool(const ActionData &, const ActionDefinition &)>)
Binds some method (or any function) present on this object to an action generated by the InputManager...
Definition sim_system.cpp:219
A SignalObserver object, which can subscribe to Signals matching its data signature and receive signa...
Definition signals.hpp:412
An object containing closely related methods and data, and exposing object lifecycle and application ...
Definition sim_system.hpp:956
void onActivated() override
Callback for when the aspect is activated (after it is attached to an active SimObject,...
Definition ur_ui_records_browser.cpp:21
std::shared_ptr< BaseSimObjectAspect > clone() const override
A method which must be overridden to specify how a new aspect should be constructed as a copy of this...
Definition ur_ui_records_browser.cpp:16
The definition of a single action, including whether it represents state or change,...
Definition input_data.hpp:511
A union that may contain any one of SimpleActionData, OneAxisActionData, TwoAxisActionData,...
Definition input_data.hpp:721
Contains aspect class definition for the records save system.