-
Notifications
You must be signed in to change notification settings - Fork 27
Implement Technology Menu #334
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
base: master
Are you sure you want to change the base?
Conversation
891c6c1 to
0f67b06
Compare
game/src/Game/GameSession/NationManagementScreen/TechnologyMenu.gd
Outdated
Show resolved
Hide resolved
cae21ea to
6b9a012
Compare
game/src/Game/GameSession/NationManagementScreen/TechnologyMenu.gd
Outdated
Show resolved
Hide resolved
game/src/Game/GameSession/NationManagementScreen/TechnologyMenu.gd
Outdated
Show resolved
Hide resolved
game/src/Game/GameSession/NationManagementScreen/TechnologyMenu.gd
Outdated
Show resolved
Hide resolved
game/src/Game/GameSession/NationManagementScreen/TechnologyMenu.gd
Outdated
Show resolved
Hide resolved
game/src/Game/GameSession/NationManagementScreen/TechnologyMenu.gd
Outdated
Show resolved
Hide resolved
0375be8 to
1a82237
Compare
game/src/Game/GameSession/NationManagementScreen/TechnologyMenu.gd
Outdated
Show resolved
Hide resolved
game/src/Game/GameSession/NationManagementScreen/TechnologyMenu.gd
Outdated
Show resolved
Hide resolved
game/src/Game/GameSession/NationManagementScreen/TechnologyMenu.gd
Outdated
Show resolved
Hide resolved
| add_gui_element("country_technology", "tech_group") | ||
|
|
||
| var area_node : Node = get_node(^"./tech_group") | ||
|
|
||
| area_node.reparent(root_node) |
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.
Rather than generating at the top level and reparenting, you can use GUINode.generate_gui_element, store the result in a variable, and then add_child it to the desired parent if it's not null (applies to similar cases throughout this file)
game/src/Game/GameSession/NationManagementScreen/TechnologyMenu.gd
Outdated
Show resolved
Hide resolved
| main_icon.mouse_filter = Control.MOUSE_FILTER_PASS | ||
| main_icon.set_tooltip_string(mod_tooltips[i]) |
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.
set_tooltip_string automatically changes mouse filter to PASS if it's currently IGNORE, so the change above isn't necessary unless you're changing it from something other than IGNORE
| _current_research_progressbar.set_tooltip_string_and_substitution_dict( | ||
| tr("TECHNOLOGYVIEW_RESEARCH_TOOLTIP") + "\n" + | ||
| tr("TECHNOLOGYVIEW_RESEARCH_INVESTED_TOOLTIP") + | ||
| MenuSingleton.get_tooltip_separator() + | ||
| info.get("current_research_effect_tt", ""), | ||
| { | ||
| "TECH": tr(current_research), | ||
| "DATE": info.get("current_research_finish_date", "1836.1.1"), | ||
| "INVESTED": info.get("current_research_invested", 0), | ||
| "COST": info.get("current_research_cost", 0) | ||
| } | ||
| ) |
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.
We already generate the top half of this tooltip here, so you could separate out that code into a helper function under MenuSingleton then store its result in the info dictionary rather than passing up all the constituent parts
game/src/Game/GameSession/NationManagementScreen/TechnologyMenu.gd
Outdated
Show resolved
Hide resolved
|
Also you'll probably have to rebase onto master to account for the submodule already being updated |
|
Also needs for techs:
And for inventions:
|
_make_modifier_effect_tooltipfor single modifiers