[V3.0] controls.xml → templates.xml — Watch Out for the Root Element Rename

controls.xml has been renamed to templates.xml, and the root element has also changed from <controls> to <templates>. This change resolves the confusion between the XUi controller classes and the XML templates. The folder has also moved from XUi to XUi_InGame.

Key Changes

  • Root element: <controls><templates> (most important)
  • File name: controls.xmltemplates.xml
  • panel → rect: <panel disableautobackground="true"> within templates has become <rect> (e.g. active_buff_entry, players_header)
  • Removed templates: debugslider, backpack_item_stack (merged into item_stack), prefab_folder_entry, and the old item_stack/category_icon (due to redefinition)
  • New templates: drag_item_stack, equipment_stack, the full set of sign_* templates from the reworked sign editor, and spawn_block_selection_entry
  • item_stack now uses size expressions: fixed values like width="78" have become arithmetic expression bindings such as cell_size="[itemStack:width]" plus ${3+cell_size}. globalopacityglobalopacitymod, and the durability display has been extended to permadurability and the like
  • Removal of |once from {value|once}, deletion of some width="100%", and removal of collider_scale

Impact on MODs

  • Any xpath starting with /controls will now miss entirely at the root. Replace every leading /controls with /templates (e.g. /controls/recipe_entry/rect/label/templates/recipe_entry/rect/label).
  • Patch placement also moves from Config/XUi/controls.xml to Config/XUi_InGame/templates.xml.
  • Because the parent of active_buff_entry and others changed from panel to rect, any path that includes panel needs rewriting.
  • Modifications that relied on the removed templates (backpack_item_stack, debugslider) will need to be ported.

Reference: Diff Example

-<controls>
+<templates>
    <active_buff_entry>
-       <panel ... controller="ActiveBuffEntry" disableautobackground="true" ...>
+       <rect ... controller="ActiveBuffEntry" ...>
-           <sprite depth="2" name="Icon" sprite="{bufficon|once}" .../>
+           <sprite depth="2" name="Icon" sprite="{bufficon}" .../>
-       </panel>
+       </rect>
    </active_buff_entry>

* Based on investigation immediately after applying the experimental build (equivalent to B252).


Related: List of MOD-making articles

コメントする

お名前(ニックネーム)だけで投稿できます。ログイン・メール登録は不要です。お気軽にどうぞ。

※ AIの回答は管理者の確認後に表示されます。内容は不正確な場合があります。