First cut of pulling out the relevant parts of my original game to make a little framework.

This commit is contained in:
Zed A. Shaw 2026-03-22 10:37:45 -04:00
commit 6a0c9e8d46
177 changed files with 18197 additions and 0 deletions

37
src/gui/loot_ui.hpp Normal file
View file

@ -0,0 +1,37 @@
#pragma once
#include "gui/guecstra.hpp"
#include <SFML/Graphics/RenderWindow.hpp>
#include <SFML/Graphics/Font.hpp>
#include <guecs/ui.hpp>
#include "events.hpp"
#include "game/inventory.hpp"
namespace gui {
class LootUI {
public:
bool active = false;
guecs::UI $gui;
DinkyECS::Entity $temp_loot = DinkyECS::NONE;
DinkyECS::Entity $target = DinkyECS::NONE;
LootUI();
void set_target(DinkyECS::Entity entity) {
$target = entity;
}
void init();
void update();
void render(sf::RenderWindow& window);
void update_level();
bool mouse(float x, float y, guecs::Modifiers mods);
void make_button(const std::string &name, const std::wstring& label, game::Event event);
void remove_slot(guecs::Entity slot_id);
bool place_slot(guecs::Entity gui_id, DinkyECS::Entity world_entity);
void add_loose_item(DinkyECS::Entity entity);
void drop_item(DinkyECS::Entity item_id);
bool occupied(guecs::Entity gui_id);
void swap(guecs::Entity gui_a, guecs::Entity gui_b);
};
}