小 (文本替换 - 替换“Category:Modding”为“Category:模组制作”) |
(09:58, 19 April 2019 Dauth) |
||
第1行: | 第1行: | ||
{{version|2. | {{version|2.8}} | ||
'''Interface modding''' allows to change some vanilla screens, but there are important limitations: | '''Interface modding''' allows to change some vanilla screens, but there are important limitations: | ||
*interfaces are hardcoded to match vanilla religion groups. | *interfaces are hardcoded to match vanilla religion groups. | ||
第231行: | 第231行: | ||
{{ModdingNavbox}} | {{ModdingNavbox}} | ||
[[Category:模组制作]] | [[Category:模组制作]] | ||
[[Category: | [[Category: 列表]] | ||
[[en:Interface modding]] |
2020年12月25日 (五) 21:05的最新版本
Interface modding allows to change some vanilla screens, but there are important limitations:
- interfaces are hardcoded to match vanilla religion groups.
- behavior of UI buttons is hardcoded and not moddable, though existing buttons can be moved or hidden.
To identify interface elements, activate interface debug mode by pressing the same keys as for opening the console while still being in the main menu (does not work anymore once you've loaded into a campaign). It will display in which file and which line the elements are defined.
List of interface files
Here is a list of the most important interface files, and what they contain:
Name | Description |
---|---|
main.gui | Main interface when running the game (minimap, chat, ...) |
frontend.gui | Lobby interface (choose starting era, country selection, multiplayer, ...) |
domestic_overview.gui | Primary title tab |
domestic_dynastic.gui | Character tab |
domestic_court.gui | Councillors tab |
domestic_law.gui | Laws tab |
domestic_technology.gui | Technology tab |
domestic_military.gui | Military tab |
domestic_plots.gui | Intrigue tab |
domestic_factions.gui | Factions tab |
domestic_religion.gui | Religion / College of Cardinal tabs |
province.gui | Province window, with its settlements/fort/trade post |
focusview.gui | Focus window |
combat.gui | Combat window |
waroverview.gui | Warscore window |
unitpanel.gui | Army window |
domestic_diplomacy.gui | Diplomacy popup |
eventwindow.gui | Event popups (normal, narrative, letter, ...) |
Structure of .gui files
这是一篇小作品。你可以通过编辑或修订扩充其内容。 如果可以请尽你所能的去协助完善这篇文章。 |
Choose starting era window
As of patch 2.5, starting eras no longer require interface modding to be changed, see bookmark modding. |
The first two starting eras are DLC-locked, so best thing to do is to hide them by overriding interface/frontend.gui in the mod and by replacing position for picture / dlc_requirement / load_progress / label / year boxes dark_ages_window and viking_era_window windows, with:
position = { x=-2000 y=-2000}
In bookmarks.txt, give the hardcoded name from vanilla to the 3 bookmarks you want to see on the era screen:
- 3rd era:
name = "BM_FATE_OF_ENGLAND"
- 4th era:
name = "BM_THE_MONGOLS"
- 5th era:
name = "BM_100_YEARS_WAR"
You can, if needed move these around and center them, with some fitting positions.
Override the following hardcoded localization keys inside a .csv file in the localization folder of the mod:
- PICK_STARTING_ERA_TEXT
- 3rd era: BM_FATE_OF_ENGLAND, EARLY_MED, EARLY_MED_INFO
- 4th era: BM_THE_MONGOLS, HIGH_MED, HIGH_MED_INFO
- 5th era: BM_100_YEARS_WAR, LATE_MED, LATE_MED_INFO
For each bookmark, the 1st 6 characters defined in common/bookmarks.txt will appear, and will need to be described by adding localization keys:
ERA_CHAR_INFO_%chararcter_id%
For instance with:
bookmark = { name = "BM_FATE_OF_ENGLAND" desc = "BM_FATE_OF_ENGLAND_DESC" date = 1066.9.15 character = 140 # William the Conqueror character = 1316 # Kaiser Heinrich IV character = 1128 # Robert de Hauteville character = 3096 # Caliph Al-Mustansir of Fatimids character = 3040 # Alp Arslan of Seljuks character = 74441 # Somesvara I of Chalukyas character = 122 # Harold Godwinson character = 102531 # Harald Hårdråde character = 20663 # Isaac of Khazaria }
then ERA_CHAR_INFO_140, ERA_CHAR_INFO_1316, ERA_CHAR_INFO_1128, ERA_CHAR_INFO_1128 and ERA_CHAR_INFO_74441 have to be localized.
Finally the era images can be customized, by overriding (or updating frontend.gui) with your own gfx: GFX_pick_era_image_3, GFX_pick_era_image_4, GFX_pick_era_image_5
Papal succession
In order to use Papal succession (succ_papal_succession) for another religion, the first step is to mod the sucession laws:
succ_papal_succession = { potential = { OR = { title = k_papal_state title = d_<my_religion> } } effect = { succession = papal_succession } revoke_allowed = { always = no } }
A button to open cardinal screen should magically appear in the religion screen ! However clicking the button will cause a CTD, and a bit of interface modding is required:
- Open domestic_religion.gui and copy the definition for window named domestic_religion_title_fraticelli_cardinal
- Create a file <my_religion>_domestic_religion.gui and paste the code.
- Replace occurrences of title_fraticelli_cardinal by the new religious title defined inside folder common/religious_titles (ex: title_<my_religion>_cardinal)
guiTypes = { windowType = { name = "domestic_religion_title_<my_religion>_cardinal" (...) ### title cardinal entry 1 windowType = { name = "title_<my_religion>_cardinal_entry_1" (...) } (...) } }
Adding a focus
In focusview.gfx, the number of frames needs to be increased:
spriteType = { name = "GFX_focusicons" texturefile = "gfx\\interface\\focusicons.tga" noOfFrames = 20 loadType = "INGAME" }
Add a 32*32 version of your icon in gfx/ambitions/, and reference it with spriteType name GFX_<focus_name>, <focus_name> being the new focus defined in common/ambitions/00_focuses.txt
spriteType = { name = "GFX_<focus_name>" texturefile = "gfx/ambitions/<focus_name>.tga" noOfFrames = 1 norefcount = yes effectFile = "gfx/FX/buttonstate.lua" }
In focusview.gui, add an 11th focus, and adjust its position:
iconType = { name ="focusicon_11_selected" spriteType = "GFX_focusview_selected_focus" position = { x = 23 y = 154 } } positionType = { name = "focusicon_11" position = { x = 40 y = 171 } }
Shortcuts
New keyboard shortcuts can be added via shortcut = "<key>"
.[1]
If using priority_shortcut
flag, it will fire before any other shortcuts.
Minimap
- 主条目:Minimap modding
See also
References
历史 | 角色 • 家族 • 省份 • 头衔 • 剧本 |
脚本 | 指令 • 条件 • 作用域 • 修正 • 事件 • 决议 |
常规 | 定义 • 游戏规则 • 另类开局 • 宗教 • 文化 • 政体 • 特质 • 血脉 • 科技 • 法律 • 建筑 • 宣战理由 • 朝贡国 • 单位 • 目标 • 疾病 • 死亡 • 荣誉头衔 • 社团 • 宝物 • 地图外政权 • 内阁成员 • 贸易路线 • 继承 • 奇观 • 称号 |
图像/音效/本地化 | 地图 • 图形 • 盾徽 • 肖像 • 界面 • 小地图 • 音乐 • 本地化 |
其他 | 故障排除 • 验证器 • 控制台指令 • 编辑游戏存档 • Steam创意工坊 • EU4转档器模组制作 |