-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Button hudget #546
base: master
Are you sure you want to change the base?
Button hudget #546
Conversation
… button_hudget Conflicts: src/ui/hud/hud.cpp src/ui/hud/textfieldhudgetvoxels.cpp src/ui/hud/textfieldhudgetvoxels.h
… button_hudget Conflicts: src/ui/hud/hud.cpp src/ui/hud/hud.h src/world/world.cpp src/world/world.h
that was not supposed to be pushed, i'll fix it |
for (int i = 0; i < width; i++) { | ||
for (int j = 0; j < height; j++) { | ||
if (i == 0 || j == 0 || i == width - 1 || j == height - 1) { | ||
m_buttonVoxels->addVoxel(new Voxel(glm::ivec3(i, j, 0), 0x0FF00F)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume these are border and content colors? please make them constants
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or even better: configurable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will declare them at the beginning of the method (as it is done in all other hudgets). I created a #554 which addresses the issue of a configurable color theme.
… button_hudget Conflicts: src/ui/hud/hud.cpp src/ui/hud/hud.h src/ui/hud/textfieldhudgetvoxels.cpp src/ui/hud/textfieldhudgetvoxels.h src/world/world.h
TextFieldHudgetVoxels::draw(); | ||
} | ||
|
||
void ButtonHudgetVoxels::setContent(std::string content) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
constref ;)
@@ -258,4 +266,7 @@ void HUD::setView(const View* view) { | |||
m_view = view; | |||
} | |||
|
|||
void HUD::openMenu(ClickType clicktype) { | |||
glow::debug("Not yet implemented"); | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when should a callback with clicktype none be fired? Also, when I click I don't get debug output atm
@gersseba ping |
Well creating an enum with only one instance seemed wrong, once someone comes up with a different clicktype none can be replaced. |
I'd really like
either way. Please consider making the button useful though, maybe reset the scenario or something... |
this one needs merge, work, reviews and/or discussion... |
Crashes on multiple clicks on Reset |
… button_hudget Conflicts: src/ui/hud/hudelements.cpp src/ui/hud/textfieldhudgetvoxels.h
@mrzzzrm fixed the bug, if possible review again |
the github diff is rather useless here atm. |
… button_hudget Conflicts: src/display/rendering/starfield.h
Well awesome, the mergeconflict was an empty line note being empty enough... |
@psieg done merging, can this be shipped then? |
I'm ok, just have someone else confirm :P |
fair enough, I'll just strap on my confirmation-helmet, squeeze into my confirmation-cannon and fire of into confirmation-land 😉 |
m_soundManager(new SoundManager()) | ||
{ | ||
World::instance()->player().hud().resetButton()->setCallback((std::function<void(ClickType clickType)>)std::bind(&GamePlay::resetButtonCallback, this, std::placeholders::_1)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line seems to be the same as setResetCallback(). Please use this method then.
Still quite some comments from my side. I'm leaving again on Wednesday morning, so until then I will look into your fixes ;) Otherwise I'll return on the 17th. |
Depends on #588
Buttons with std::function Callbacks, implementation example in hud.cpp