Prep for the actually making ritual crafting work.

This commit is contained in:
Zed A. Shaw 2025-04-26 02:21:59 -04:00
parent ad1d08ca96
commit 292711f91f
10 changed files with 56 additions and 74 deletions

View file

@ -29,13 +29,12 @@ namespace gui {
}
void RitualUI::init() {
std::vector<std::string> junk_list{
{"chess_pawn"},
{"dirty_kerchief"},
{"mushroom"},
{"pocket_watch"},
{"rusty_nails"},
{"severed_finger"}
Config config("assets/rituals.json");
std::vector<std::string> junk_list;
for(auto& el : config["junk"]) {
std::string name = el["name"];
junk_list.push_back(name);
};
for(auto& [name, cell] : $gui.cells()) {
@ -70,7 +69,6 @@ namespace gui {
$ritual_anim = animation::load("ritual_blanket");
$gui.init();
}
bool RitualUI::is_open() {
@ -91,6 +89,8 @@ namespace gui {
float y = Random::uniform(inner_y, inner_y + ritual_cell.h / 2);
bs.sprite->setPosition({float(x), float(y)});
}
// this is where we add the junk to the engine
}
void RitualUI::reset_inv_positions() {
@ -113,6 +113,9 @@ namespace gui {
bs.sprite->setColor({200, 0, 0});
animation::center(*bs.sprite, {(float)cell.x, (float)cell.y});
animation::rotate(*bs.sprite, 20.0);
// finalize here ritual here
// add it to the belt
}
bool RitualUI::mouse(float x, float y, bool hover) {