-
Notifications
You must be signed in to change notification settings - Fork 17
Additional Journal Widgets
With patch 1.13, Journal Entries have anchor points allowing mods to inject custom UI elements. The Community Mod Framework provides a set of custom elements for modders to use in their mods.
All CMF elements are injected like this:
widget = {
gui = "gui/com_journal_injects/injects.gui"
name = "name_of_custom_element"
container = "inject_anchor"
}
- DLC Icon
- Characters with Opinions
- Wrap Modifiers
- Progress Bar Styling
- EU5 Style Situation
- Building
- Company
-
Injection Name:
com_journal_entry_dlc_icon -
Recommended Anchor:
custom_widget_container_7 - Screenshots: DLC icon
To add DLC/Mod information to a journal entry, CMF offers the scripted effect add_com_dlc_icon.
It needs to be run in the journal entry scope.
The best place for that is the immediate block of a journal entry:
je_some_journal = {
# journal definition
widget = {
gui = "gui/com_journal_injects/injects.gui"
name = "com_journal_entry_dlc_icon"
container = "custom_widget_container_7"
}
immediate = {
scope:journal_entry = {
add_com_dlc_icon = {
dlc = dlc_magic_gate
}
}
}
# some more journal definition
}
-
Injection Name:
com_journal_entry_characters -
Recommended Anchor:
custom_widget_container_1 - Screenshots: Single Character with Opinion, Multiple Characters without Opinions
To add one or more characters to a journal entry you need
to add them to a variable list called com_journal_characters in
the immediate block of a journal entry.
Here is an example where a countries ruler is added to a journal entry, but theoretically you can add whoever you want:
je_example_entry = {
...
widget = {
gui = "gui/com_journal_injects/injects.gui"
name = "com_journal_entry_characters"
container = "custom_widget_container_1"
}
immediate = {
# Adding the ruler to the journal
scope:journal_entry = {
add_to_variable_list = {
name = com_journal_characters
target = prev.ruler
}
}
}
...
}
Characters in journal entries can also have opinions.
To define them, you need to set the flag variable com_opinion on the character.
set_variable = {
name = com_opinion
value = flag:gui_character_opinion_example
}
The text behind flag: is a localization key (See com_gui_l_english.yml).
NOTE: Only one opinion can be set on a character at a time. So if you are using a character in multiple journal entries be aware of this.
-
Injection Name:
com_journal_entry_header -
Recommended Anchor:
custom_widget_container_je_icon
This causes the journal modifiers to wrap in lines of 5. Now, up to 15 modifiers looks fine and don't just cross the screen.
-
Injection Name:
com_journal_entry_progress_bars -
Required Anchor:
com_custom_widget_container_scripted_progress_bars(This may change in the future) - Screenshots: Example drifting progress bar
Scripted progress bars can be styled with a color, a drift effect, and a target marker, all dynamically settable and unsettable. For more details, see the progress bar documentation
-
Injection Names:
com_situation_header_versuscom_situation_header_singlecom_situation_header_no_sidecom_situation_header_textcom_situation_victory_conditionscom_situation_faction_list
- Screenshots: No sides, One sides
NOTE: CMF Situations do not work with the new global journal entries. Help us fix this by contributing!
Situations are meant to model international events, such as clashes between factions, pandemics, and more.
Each situation can have multiple, different journal entries associated with it and provides a tool to model complex power struggles.
In the background, situations are Journal Entries with a few extra variables and a whole new UI. This means using them should come natural to modders who have already used those.
Situations were inspired by EU5.
The usage documentation can be found here.
While the script documentation can be found here.
-
Injection Name:
com_journal_entry_building -
Recommended Anchor:
custom_widget_container_1 - Screenshots: Example
To add a building you will need to set the building scope to a journal entry variable called com_journal_entry_building in the immediate block of a journal entry.
Here is an example where a railway is added to a journal entry, but theoretically you can add whatever building you want:
je_example_entry = {
...
widget = {
gui = "gui/com_journal_injects/injects.gui"
name = "com_journal_entry_building"
container = "custom_widget_container_1"
}
immediate = {
# Adding railway building to the variable
random_scope_building = {
limit = {
is_building_type = building_railway
}
scope:journal_entry = {
set_variable = {
name = com_journal_entry_building
value = prev
}
}
}
}
...
}
-
Injection Name:
com_journal_entry_company -
Recommended Anchor:
custom_widget_container_2 - Screenshots: Example
To add a company you will need to set the company scope to a journal entry variable called com_journal_entry_company in the immediate block of a journal entry.
Here is an example where a company is added to a standard prestige good journal entry, but theoretically you can add whatever company you want:
je_example_entry = {
...
widget = {
gui = "gui/com_journal_injects/injects.gui"
name = "com_journal_entry_company"
container = "custom_widget_container_2"
}
immediate = {
# Adding a potential prestige good company
random_company = {
limit = {
can_potentially_produce_prestige_goods = prestige_good_gate_dwarven_iron
is_producing_prestige_goods = no
company_is_prosperous = yes
NOT = {
has_variable = gate_prestige_good_dwarven_iron
}
}
save_scope_as = relevant_company
scope:journal_entry = {
set_variable = {
name = com_journal_entry_company
value = prev
}
}
}
}
...
}
/gui/com_journal_injects/com_shared_widgets.gui
-
com_journal_modifiers_container- Screenshot -
com_journal_scripted_buttons- Screenshot -
com_journal_reason_text- Contains blocks for visibility, text, and background -
com_journal_involved_countries- Contains block for element header -
com_journal_involved_countries_tiny_flags- Contains block for element header with tiny flags -
com_journal_involved_countries_tiny_flags_with_scrollbar- Contains block for element header with tiny flags and a scrollbar so the element doesn't use too much space
-
com_journal_scripted_button_item- Resized to 460x38
/gui/com_journal_injects/interorg_widgets.gui
See International Organizations for usage notes.
widget_com_international_organization_basewidget_com_supranational_organizationwidget_com_regional_organizationwidget_com_religious_organizationwidget_com_non_governmental_organizationwidget_com_sporting_organizationwidget_com_international_conference
com_international_organization_panelcom_international_organization_detailscom_international_organization_panel
/gui/com_journal_injects/situation_widgets.gui
See International Situations for usage notes.
widget_com_international_situationwidget_com_international_situation_illustrationwidget_com_international_situation_phase_informationwidget_com_international_situation_involved_countrieswidget_com_international_situation_outcome_containerwidget_com_international_situation_phase_progress
com_international_situation_headercom_international_situation_illustrationcom_international_situation_phase_informationcom_international_situation_timeoutcom_international_situation_involved_countriescom_international_situation_outcome_containercom_international_situation_phase_progress
/gui/com_journal_injects/victoria_base_widgets.gui
These are the base game journal entry elements.
com_default_journal_buttonscom_default_journal_reasoncom_default_journal_timeout