EncyclopediaDetailPanel question
Moderator: Committer
EncyclopediaDetailPanel question
Hello,
I'm trying to understand how the opening of a new EncyclopediaDetailPanel (f.e. the prodwnd or researchwnd ones) can alter what is shown in another (the mapwnd one).
I'm starting to think it's coming from a chain of signals, because I can't find anything in the code that does this directly. Maybe I'm not looking hard enough, can someone help ?
I'm trying to understand how the opening of a new EncyclopediaDetailPanel (f.e. the prodwnd or researchwnd ones) can alter what is shown in another (the mapwnd one).
I'm starting to think it's coming from a chain of signals, because I can't find anything in the code that does this directly. Maybe I'm not looking hard enough, can someone help ?
All the patches I'll provide for freeorion will be released under the GPL v2 or later license.
Let's unleash the dyson forest powa!
Let's unleash the dyson forest powa!
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: EncyclopediaDetailPanel question
There is probably a mix of different things happening.
MapWnd::ShowProduction() explicitly calls m_pedia_panel->SetIndex() and ShowResearch calls m_pedia_panel->SetText("ENC_TECH", false), neither of which are necessary, I think.
BuildDesignatorWnd::BuildSelector::BuildItemLeftClicked emits DisplayBuildingTypeSignal which is connected to EncyclopediaDetailPanel::SetItem, which changes the production pedia panel, without changing the map pedia panel.
MapWnd::ShowProduction() explicitly calls m_pedia_panel->SetIndex() and ShowResearch calls m_pedia_panel->SetText("ENC_TECH", false), neither of which are necessary, I think.
BuildDesignatorWnd::BuildSelector::BuildItemLeftClicked emits DisplayBuildingTypeSignal which is connected to EncyclopediaDetailPanel::SetItem, which changes the production pedia panel, without changing the map pedia panel.
Re: EncyclopediaDetailPanel question
D'oh, this was it, I was already in these code path for the other patches, and did not see what was right in front of me... Thanks...Geoff the Medio wrote:MapWnd::ShowProduction() explicitly calls m_pedia_panel->SetIndex() and ShowResearch calls m_pedia_panel->SetText("ENC_TECH", false), neither of which are necessary, I think.
All the patches I'll provide for freeorion will be released under the GPL v2 or later license.
Let's unleash the dyson forest powa!
Let's unleash the dyson forest powa!
Re: EncyclopediaDetailPanel question
I'd even say they are wrong, there's no need to change the mapwnd's EncyclopediaDetailPanel in those methods, and if that EDP is to stay opened, it better has to stay where the user wants it.Geoff the Medio wrote:MapWnd::ShowProduction() explicitly calls m_pedia_panel->SetIndex() and ShowResearch calls m_pedia_panel->SetText("ENC_TECH", false), neither of which are necessary, I think.
All the patches I'll provide for freeorion will be released under the GPL v2 or later license.
Let's unleash the dyson forest powa!
Let's unleash the dyson forest powa!
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: EncyclopediaDetailPanel question
Thanks, I was testing with the calls removed and found it more pleasant. Especially when the pedia toggling does not get you out of prodwnd, for example.
All the patches I'll provide for freeorion will be released under the GPL v2 or later license.
Let's unleash the dyson forest powa!
Let's unleash the dyson forest powa!
Re: EncyclopediaDetailPanel question
Hello,
in the same vein, I stumbled upon something that looks strange, all the MapWnd::ShowXXX() methods start with a call to ClearProjectedFleetMovementLines(); but not ShowEmpires(). I didn't look further into it, but that made me wonder if it was just forgotten, or if there is something else I don't understand about that...
in the same vein, I stumbled upon something that looks strange, all the MapWnd::ShowXXX() methods start with a call to ClearProjectedFleetMovementLines(); but not ShowEmpires(). I didn't look further into it, but that made me wonder if it was just forgotten, or if there is something else I don't understand about that...
All the patches I'll provide for freeorion will be released under the GPL v2 or later license.
Let's unleash the dyson forest powa!
Let's unleash the dyson forest powa!
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: EncyclopediaDetailPanel question
Probably. I'm not really sure what the ClearProjectedFleetMovementLines() call actually accomplishes anyway, but presumably there was a reason?vincele wrote:all the MapWnd::ShowXXX() methods start with a call to ClearProjectedFleetMovementLines(); but not ShowEmpires(). I didn't look further into it, but that made me wonder if it was just forgotten...
Re: EncyclopediaDetailPanel question
Another thing I saw: the encyclopedia in designwnd has an "X"-close button that is not working, whereas prodwnd or researchwnd don't have that button. I searched for differences in code that can explain the presence/absence of the button but found nothing... Where is it hidden ?
All the patches I'll provide for freeorion will be released under the GPL v2 or later license.
Let's unleash the dyson forest powa!
Let's unleash the dyson forest powa!
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: EncyclopediaDetailPanel question
Thanks, and sorry, I should have searched before asking...
All the patches I'll provide for freeorion will be released under the GPL v2 or later license.
Let's unleash the dyson forest powa!
Let's unleash the dyson forest powa!
Re: EncyclopediaDetailPanel question
I tried another approach, adding a CUIWnd mutator to set the closable flag, and this is working for me, would the constructor modification be prefered ?
See the attached patch... What do you think ?
See the attached patch... What do you think ?
All the patches I'll provide for freeorion will be released under the GPL v2 or later license.
Let's unleash the dyson forest powa!
Let's unleash the dyson forest powa!
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: EncyclopediaDetailPanel question
Having a mutator isn't necessary because it's unlikely one would need to change whether a Wnd is closable after it has been created. The CLOSABLE flag already lets one specify this.
Re: EncyclopediaDetailPanel question
OK, I'll redo it the other way then
All the patches I'll provide for freeorion will be released under the GPL v2 or later license.
Let's unleash the dyson forest powa!
Let's unleash the dyson forest powa!
Re: EncyclopediaDetailPanel question
What about this one ?
All the patches I'll provide for freeorion will be released under the GPL v2 or later license.
Let's unleash the dyson forest powa!
Let's unleash the dyson forest powa!