Have a few basic monochrome test items and the first little leather pouches on the 'tool belt'.
|
@ -55,7 +55,29 @@
|
|||
"ritual_crafting_area": "assets/ritual_crafting_area.png",
|
||||
"the_ritual_circle": "assets/the_ritual_circle.png",
|
||||
"paper_ui_background": "assets/paper_ui_background.png",
|
||||
"full_screen_paper": "assets/full_screen_paper.png"
|
||||
"full_screen_paper": "assets/full_screen_paper.png",
|
||||
"broken_locket-64": "assets/rituals/broken_locket-64.png",
|
||||
"broken_locket-128": "assets/rituals/broken_locket-128.png",
|
||||
"broken_pen_knife-64": "assets/rituals/broken_pen_knife-64.png",
|
||||
"broken_pen_knife-128": "assets/rituals/broken_pen_knife-128.png",
|
||||
"broken_yoyo-64": "assets/rituals/broken_yoyo-64.png",
|
||||
"broken_yoyo-128": "assets/rituals/broken_yoyo-128.png",
|
||||
"chess_pawn-64": "assets/rituals/chess_pawn-64.png",
|
||||
"chess_pawn-128": "assets/rituals/chess_pawn-128.png",
|
||||
"dirty_kerchief-64": "assets/rituals/dirty_kerchief-64.png",
|
||||
"dirty_kerchief-128": "assets/rituals/dirty_kerchief-128.png",
|
||||
"leather_pouch-64": "assets/rituals/leather_pouch-64.png",
|
||||
"leather_pouch-128": "assets/rituals/leather_pouch-128.png",
|
||||
"mushroom-64": "assets/rituals/mushroom-64.png",
|
||||
"mushroom-128": "assets/rituals/mushroom-128.png",
|
||||
"pocket_watch-64": "assets/rituals/pocket_watch-64.png",
|
||||
"pocket_watch-128": "assets/rituals/pocket_watch-128.png",
|
||||
"rusty_nails-64": "assets/rituals/rusty_nails-64.png",
|
||||
"rusty_nails-128": "assets/rituals/rusty_nails-128.png",
|
||||
"severed_finger-64": "assets/rituals/severed_finger-64.png",
|
||||
"severed_finger-128": "assets/rituals/severed_finger-128.png",
|
||||
"stone_doll_cursed-64": "assets/rituals/stone_doll_cursed-64.png",
|
||||
"stone_doll_cursed-128": "assets/rituals/stone_doll_cursed-128.png"
|
||||
},
|
||||
"worldgen": {
|
||||
"enemy_probability": 50,
|
||||
|
|
BIN
assets/rituals/broken_locket-128.png
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
assets/rituals/broken_locket-64.png
Normal file
After Width: | Height: | Size: 8.1 KiB |
BIN
assets/rituals/broken_pen_knife-128.png
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
assets/rituals/broken_pen_knife-64.png
Normal file
After Width: | Height: | Size: 6.9 KiB |
BIN
assets/rituals/broken_yoyo-128.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
assets/rituals/broken_yoyo-64.png
Normal file
After Width: | Height: | Size: 6.1 KiB |
BIN
assets/rituals/chess_pawn-128.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
assets/rituals/chess_pawn-64.png
Normal file
After Width: | Height: | Size: 5.8 KiB |
BIN
assets/rituals/dirty_kerchief-128.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
assets/rituals/dirty_kerchief-64.png
Normal file
After Width: | Height: | Size: 6.5 KiB |
BIN
assets/rituals/leather_pouch-128.png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
assets/rituals/leather_pouch-64.png
Normal file
After Width: | Height: | Size: 5.9 KiB |
BIN
assets/rituals/mushroom-128.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
assets/rituals/mushroom-64.png
Normal file
After Width: | Height: | Size: 6.9 KiB |
BIN
assets/rituals/pocket_watch-128.png
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
assets/rituals/pocket_watch-64.png
Normal file
After Width: | Height: | Size: 8.9 KiB |
BIN
assets/rituals/rusty_nails-128.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
assets/rituals/rusty_nails-64.png
Normal file
After Width: | Height: | Size: 6.5 KiB |
BIN
assets/rituals/severed_finger-128.png
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
assets/rituals/severed_finger-64.png
Normal file
After Width: | Height: | Size: 9.2 KiB |
BIN
assets/rituals/stone_doll_cursed-128.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
assets/rituals/stone_doll_cursed-64.png
Normal file
After Width: | Height: | Size: 6.1 KiB |
|
@ -11,29 +11,20 @@ namespace gui {
|
|||
{
|
||||
$gui.position(COMBAT_UI_X, COMBAT_UI_Y, COMBAT_UI_WIDTH, COMBAT_UI_HEIGHT);
|
||||
$gui.layout(
|
||||
"[*%(100,150)button_attack1 | *%(100,150)button_attack2 | *%(100,150)button_attack3 | *%(100,150)button_heal]"
|
||||
"[ >.%(100,50)label_hp | *%.(198,50)bar_hp | _ ]");
|
||||
"[*%(100,150)button_attack1 | *%(100,150)button_attack2 | *%(100,150)button_attack3 | *%(100,150)button_heal]");
|
||||
}
|
||||
|
||||
void CombatUI::init() {
|
||||
auto& world = $gui.world();
|
||||
|
||||
world.set_the<Background>({$gui.$parser});
|
||||
world.set_the<Background>({$gui.$parser, ColorValue::DARK_MID});
|
||||
|
||||
for(auto& [name, cell] : $gui.cells()) {
|
||||
if(name.starts_with("button_")) {
|
||||
auto button = $gui.entity(name);
|
||||
world.set<Rectangle>(button, {});
|
||||
world.set<Sprite>(button, {"leather_pouch-128"});
|
||||
world.set<Clickable>(button,
|
||||
guecs::make_action(*$level.world, Events::GUI::ATTACK));
|
||||
world.set<Label>(button, {"Attack"});
|
||||
} else if(name.starts_with("bar_")) {
|
||||
$meter = $gui.entity(name);
|
||||
world.set<Rectangle>($meter, {});
|
||||
world.set<Meter>($meter, {});
|
||||
} else {
|
||||
// ignored, it's just space
|
||||
$gui.entity(name);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -46,9 +37,7 @@ namespace gui {
|
|||
$gui.render(window);
|
||||
}
|
||||
|
||||
void CombatUI::set_damage(float percent) {
|
||||
auto& meter = $gui.world().get<Meter>($meter);
|
||||
meter.percent = percent;
|
||||
void CombatUI::set_damage(float) {
|
||||
}
|
||||
|
||||
void CombatUI::update_level(GameLevel &level) {
|
||||
|
|
|
@ -8,7 +8,6 @@ namespace gui {
|
|||
class CombatUI {
|
||||
public:
|
||||
guecs::UI $gui;
|
||||
DinkyECS::Entity $meter;
|
||||
GameLevel $level;
|
||||
|
||||
CombatUI(GameLevel level);
|
||||
|
|
|
@ -170,11 +170,12 @@ namespace guecs {
|
|||
|
||||
shared_ptr<sf::RectangleShape> shape = nullptr;
|
||||
|
||||
Background(lel::Parser& parser) :
|
||||
Background(lel::Parser& parser, sf::Color bg_color=GUECS_BG_COLOR) :
|
||||
x(parser.grid_x),
|
||||
y(parser.grid_y),
|
||||
w(parser.grid_w),
|
||||
h(parser.grid_h)
|
||||
h(parser.grid_h),
|
||||
color(bg_color)
|
||||
{}
|
||||
|
||||
Background() {}
|
||||
|
|
|
@ -29,6 +29,15 @@ namespace gui {
|
|||
}
|
||||
|
||||
void RitualUI::init() {
|
||||
std::vector<std::string> junk_list{
|
||||
{"chess_pawn"},
|
||||
{"dirty_kerchief"},
|
||||
{"mushroom"},
|
||||
{"pocket_watch"},
|
||||
{"rusty_nails"},
|
||||
{"severed_finger"}
|
||||
};
|
||||
|
||||
for(auto& [name, cell] : $gui.cells()) {
|
||||
auto button = $gui.entity(name);
|
||||
|
||||
|
@ -38,15 +47,8 @@ namespace gui {
|
|||
[&](auto ent, auto){ ritual_circle_clicked(ent); }
|
||||
});
|
||||
} else if(name.starts_with("inv_slot")) {
|
||||
|
||||
if(button % 5 == 0) {
|
||||
$gui.set<Sprite>(button, {"cinqueda"});
|
||||
} else if(button % 9 == 0) {
|
||||
$gui.set<Sprite>(button, {"healing_potion_small"});
|
||||
} else if(button % 3 == 0) {
|
||||
$gui.set<Sprite>(button, {"torch_horizontal_floor"});
|
||||
}
|
||||
|
||||
$gui.set<Sprite>(button, {
|
||||
fmt::format("{}-64", junk_list[button % junk_list.size()])});
|
||||
$gui.set<Clickable>(button, {
|
||||
[&](auto ent, auto){ inv_slot_clicked(ent); }
|
||||
});
|
||||
|
|