-
Notifications
You must be signed in to change notification settings - Fork 17
UI Extensions
The Objective header can be hidden by setting the global variable community_gui_objective_var like this:
set_global_variable = community_gui_objective_var
To enable a custom social hierarchy you have to execute this effect in a countries scope:
set_variable = {
name = custom_social_hierarchy
value = active_law:lawgroup_of_your_hierarchy
}
I recommend doing this in the history file of a country common/history/countries
When a sidebar button is clicked the following GUI variable is set to your scripted gui name: com_open_window
In your custom window you should check for it like this (with your scripted gui name):
visible = "[GetVariableSystem.HasValue('com_open_window', 'gui_sidebar_example_button')]"
If you want to close your window again you can do it by clearing the variable like this:
onclick = "[GetVariableSystem.Clear('com_open_window')]"
If your GUI is fullscreen you will also need to set and remove the following GUI variable: com_fullscreen
The best solution is to use the GUI state system like this:
state = {
name = _show
# Toggle doesn't work here as it is still toggled on reload, so I have to set it instead
on_finish = "[GetVariableSystem.Set('com_fullscreen', 'com_fullscreen')]"
}
state = {
name = _hide
on_finish = "[GetVariableSystem.Clear('com_fullscreen')]"
}
Setting it will hide the base game GUI and removing it will show the base game GUI again.
When you create an alert, you also need to define an action in a loc key.
This action string will be written into the GUI variable com_alert_action.
You can then check for this in your custom GUI like this:
visible = "[GetVariableSystem.HasValue('com_alert_action', 'Example Panel')]"
OR
visible = "[GetVariableSystem.HasValue('com_alert_action', Localize('mod_alert_send_to_example_panel'))]"
If you have multiple alerts which should all open the same panel you can use full line substitution:
alert_first_alert_name_action: "$mod_alert_send_to_example_panel$"
alert_second_alert_name_action: "$mod_alert_send_to_example_panel$"
alert_third_alert_name_action: "$mod_alert_send_to_example_panel$"
mod_alert_send_to_example_panel: "Example Panel"
NOTE: If using this in a widget; you will need a scripted widget definition in
gui\scripted_widgets\to load your widget.
To add a new custom owner building type just add it to the global list com_custom_owner_buildings like this:
add_to_global_variable_list = {
name = com_custom_owner_buildings
target = bt:building_university # Use your building here
}
This can be done in history global or wherever you want this effect to run.
MPM edits certain panels in the UI to make them display extra PM groups by wrapping them around instead of adding the extra ones on the same line and causing them to appear off the edge of the panel or under other text and buttons. MPM provides changes to the following files:
gui/building_details_panel.gui
gui/goods_state_panel.gui
gui/production_methods.gui
gui/building_browser_panel.gui
gui/map_list_panel.gui
NOTE: Note that military buildings, such as barracks and naval bases, are NOT INTENDED TO BE USED WITH MPM due to the new unit graphics being displayed alongside the PMGs which now take up most of the space that the extra PMGs would overflow into.
This allows for hiding and showing any Journal Entry Group.
Usage:
com_hide_journal_entry_group = { name = je_group_historical_content }
This would hide all National Agenda (je_group_historical_content) Journal Entries.
com_show_journal_entry_group = { name = je_group_historical_content }
This would show them again.
Setting and removing the following variables in journal entries on a per-journal basis. These are added in the journal entry scope. Removing the variable will restore the visibility of the hidden element.
Variables:
-
com_hide_status_descto hide the status_desc -
com_hide_journal_reasonto hide the je_reason localization -
com_hide_involved_countriesto hide the involved countries -
com_hide_complete_triggersto the hide the completion triggers/effects -
com_hide_fail_triggersto the hide the failure triggers/effects -
com_hide_timeoutto the hide the timeout triggers/effects
Usage:
scope:journal_entry = { set_variable = com_hide_involved_countries }
This will hide the Involved Countries gui element
scope:journal_entry = { remove_variable = com_hide_involved_countries }
This will show them again.