I now have a semi-functional GUI system that uses the ECS style to build gui elements rather than inheritance.
This commit is contained in:
parent
615599084a
commit
46de98e6f4
12 changed files with 213 additions and 146 deletions
8
gui.cpp
8
gui.cpp
|
@ -361,10 +361,8 @@ namespace gui {
|
|||
}
|
||||
|
||||
void FSM::mouse() {
|
||||
if(sf::Mouse::isButtonPressed(sf::Mouse::Button::Left)) {
|
||||
sf::Vector2f pos = $window.mapPixelToCoords(sf::Mouse::getPosition($window));
|
||||
$combat_view.click(pos.x, pos.y);
|
||||
}
|
||||
// need to sort out how this will be easier with multiple UIs
|
||||
$combat_view.$gui.mouse($window);
|
||||
}
|
||||
|
||||
void FSM::generate_map() {
|
||||
|
@ -411,6 +409,8 @@ namespace gui {
|
|||
} else {
|
||||
$status_view.log("You MISSED the enemy.");
|
||||
}
|
||||
|
||||
// this is where we tell the combat ui about the damage
|
||||
}
|
||||
break;
|
||||
case eGUI::COMBAT_START:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue