How would have an EXPERIENCED xml guy done this change to a MoreCore window
Hey there, I was trying to change a couple fields in MoreCore's record_spells.xml (campaign) in my extension.
So I added the file, removed the unchanging stuff and tried to merge some changes. No matter what I did, I could not get them to go in right place (replacing existing Spell Level / Spell Cost elements.
(one thing, the first divider is not given a name so I cannot remove it or reference it so it was "extra" no matter what.)
Eventually I gave up and did the "test" update to the roller part and did a delete after delete merge rule to "clear" everything then readded my updated fields. No linking original since it is there for anyone with MoreCore (1.62):
Code:
...
<windowclass name="spells_stats" merge="join">
<script>
function onInit()
update();
end
function update()
local bReadOnly = WindowManager.getReadOnlyState(getDatabaseNode());
description.setReadOnly(bReadOnly);
end
</script>
<sheetdata>
<!-- <anchor_column name="columnanchor" />
<label_column>
<static textres="ref_label_command" />
</label_column> -->
<string_column name="clichatcommand" merge="join">
<script>
function onLoseFocus( )
local nameWindowDBNode = window.getDatabaseNode()
local nodeWin = nameWindowDBNode
local sName = nodeWin.getChild("name").getValue()
local sCommand = nodeWin.getChild("clichatcommand").getValue()
local sRollstype = nodeWin.getChild("rollstype").getValue();
local nStart,nEnd,sCommand,sParams = string.find(sCommand, '^/([^%s]+)%s*(.*)');
--[[ Will add my own icon overrides here calling "base" if not handled --]]
if sCommand == "TEST" then
nodeWin.getChild("rollstype").setValue("heal")
else
super.onLoseFocus()
end
end
</script>
</string_column>
<label_column name="new_spells_lvl" merge="delete"/>
<number_column name="new_spells_level" merge="delete"/>
<label_column_right name="new_spells_cst" merge="delete"/>
<number_column_right name="new_spells_cost" merge="delete"/>
<line_column name="divider" merge="delete"/>
<ft_columnh name="description" merge="delete"/>
<label_column name="label_new_spells_class">
<static textres="new_spells_class" />
</label_column>
<string_column name="new_spells_class"/>
<label_column name="new_spells_lvl">
<static textres="new_spells_level" />
</label_column>
<number_column name="new_spells_level">
<default>1</default>
</number_column>
<line_column name="divider" />
<ft_columnh name="description">
<separator>line_desc</separator>
</ft_columnh>
</sheetdata>
</windowclass>