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
Double clicking planets #194
Conversation
|
||
// open production screen | ||
if (!m_in_production_view_mode) { | ||
if (!m_production_wnd->Visible()) |
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.
replace tabs with 4 spaces
Done, should've got them all. |
ToggleProduction(); | ||
CenterOnObject(planet->SystemID()); | ||
m_production_wnd->SelectSystem(planet->SystemID()); | ||
} |
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.
tab
Updated |
more tabs scattered about. |
Untabified. |
GG::Connect(m_button_prev->LeftClickedSignal, &SidePanel::PrevButtonClicked, this); | ||
GG::Connect(m_button_next->LeftClickedSignal, &SidePanel::NextButtonClicked, this); | ||
GG::Connect(m_planet_panel_container->PlanetSelectedSignal, &SidePanel::PlanetSelected, this); | ||
GG::Connect(m_planet_panel_container->PlanetLeftDoubleClickedSignal, &SidePanel::PlanetDoubleClicked, this); |
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.
You don't appear to be doing anything in SidePanel::PlanetDoubleClicked so why not connect directly to the signal as in the following 2 lines?
Function removed. |
@@ -487,6 +488,10 @@ class SidePanel::PlanetPanel : public GG::Control { | |||
* returns the id of the clicked planet */ | |||
mutable boost::signals2::signal<void (int)> LeftClickedSignal; | |||
|
|||
/** emitted when the planet is left double clicked by the user. |
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.
What's the difference between LeftDoubleClickedSignal and PlanetLeftDoubleClickedSignal?
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.
LDCS is emitted by the PlanetPanel, PLDCS is emitted by the PlanetPanelContainer. This is how it is handled with (single) left as well as right-clicking. My understanding is that the signal gets passed down from PlanetPanel to PlanetPanelContainer to SidePanel, so that every class is notified of the click-event.
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.
Ah, OK. Didn't notice these two additions were in separate classes.
Looks OK, but could you squash a few of the grooming commits that were just adjusting previous commit changes in the same pull request? |
I think I get your meaning, but how do I do that? |
With various git stuff? I can do it in the TortoiseGit GUI from the show log list, by selecting commits and combining them. There have been discussions of it on the forums as well for alternative means. |
That should've done it. |
Please don't commit yet, there's one unused function declaration, I will fix it in a couple of hours and merge into one commit again. |
Doesn't need to be just one commit if there are parts of it that would work on their own. |
left double clicking planets will now open the production screen. tested and working; squashed into one commit Replacing tabs with spaces Grooming (1 tab removed, 2 functions reduced to one line) Used: Edit>Advanced>Untabify Removed PlanetDoubleClicked function and connect signals directly. Removed PlanetLeftDoubleClicked function Removed unnecessary function declaration
Well in this case - overall a small commit, after initial commit just grooming - I think one commit makes good sense. Ready to merge I think? |
Left double clicking planets will open the production screen.