1:1 source port of the engine and game code; Windows build and system layer; docs. No game files or SDK headers.

This commit is contained in:
CRTkafa 2026-10-22 16:30:40 +08:00
parent c3b032a45a
commit 0ecb47e9cb
3871 changed files with 91080 additions and 1640063 deletions

View file

@ -1,41 +0,0 @@
#pragma once
#include <filesystem>
#include <string>
#include "ui/ui_runtime.h"
namespace choco {
// Hosts the original shop and quantity dialogs in GameSim's Lua VM. The
// original shop invokes DisplayDialog synchronously; the adapter defers that
// nested dialog until the current mouse callback has returned.
class ShopUi {
public:
ShopUi(const Vfs& assets, const StringTable& strings):runtime_(assets,strings) {}
~ShopUi();
bool open(GameSim& sim, const std::filesystem::path& luaRoot,
const std::string& shopName, std::string& error);
void close();
void mouseMove(float x,float y) { runtime_.menu().mouseMove(x,y); }
void mouseDown(float x,float y) { runtime_.menu().mouseDown(x,y); }
void mouseUp(float x,float y);
void textInput(const std::string& utf8) { runtime_.menu().textInput(utf8); }
void backspace() { runtime_.menu().backspace(); }
Menu& menu() { return runtime_.menu(); }
const Menu& menu() const { return runtime_.menu(); }
bool active() const { return active_; }
std::string takeResult();
private:
enum class View { Shop, Register };
UiRuntime runtime_;
GameSim* sim_ = nullptr;
std::string shopName_;
bool active_ = false;
bool sold_ = false;
View view_ = View::Shop;
std::string result_;
bool showShop(std::string& error);
bool processPending(std::string& error);
};
}