PDA

View Full Version : How do I switch two tables in the record_item.xml file?



alloowishus
November 27th, 2024, 04:05
I am trying to switch the placement of two tables (62769) which seems exceedingly difficult. Code is attached below


<line_column name="divider" />

<spacer_column_item name="attacktable_spacer" />
<hs name="attacktableID" source="attacktable.tableid" />
<string_columnh_tablename name="attacktablename" source="attacktable.name">
<anchored width="138" />
<sourcename>attacktable</sourcename>
<tabletype>Attack</tabletype>
<disabled />
</string_columnh_tablename>
<DropDown name="attacktablenamedropdown">
<target>attacktablename</target>
<position>0,5</position>
</DropDown>
<number_columnh_tablemod name="max_level">
<invisible />
</number_columnh_tablemod>
<string_columnh_item name="max_rank_size">
<anchored>
<top relation="current" />
<left offset="258" />
</anchored>
<disabled />
<script>
function onInit()
super.onInit();
setValue(Rules_Combat.GetMaxRankSize(window.max_le vel.getValue()));
end

function onValueChanged()
if super and super.onValueChanged then
super.onValueChanged();
end
window.max_level.setValue(Rules_Combat.GetMaxLevel (getValue()));
end
</script>
</string_columnh_item>
<DropDown name="max_rank_sizedropdown">
<target>max_rank_size</target>
<position>0,5</position>
<script>
function onInit()
super.onInit();
updateList();
end

function updateList()
local maxRankSizeList = Rules_Combat.MaxRankSizeList();
if #maxRankSizeList &gt; 0 then
clear();
addItems(maxRankSizeList);
end
end
</script>
</DropDown>
<label_fieldtop name="attacktablename_label">
<anchored to="attacktablename" />
<center merge="delete" />
<static textres="item_label_tablename" />
</label_fieldtop>
<label_fieldtop name="max_rank_size_label">
<anchored to="max_rank_size" />
<center merge="delete" />
<static textres="item_label_max_rank_size" />
</label_fieldtop>
<label_column_CoreRPG name="attacktable_label">
<anchored>
<top relation="relative" offset="10" />
</anchored>
<static textres="item_label_attacktable" />
<tooltip textres="item_tooltip_attacktable" />
<script>
function onDrop(x,y,dragdata)
local customData = dragdata.getCustomData();
if not customData or not customData.type or customData.type~="RMCTable" then
return false;
end
window.attacktablename.setValue(customData.tableID , customData.tableName);
return true;
end
</script>
</label_column_CoreRPG>

Moon Wizard
November 27th, 2024, 06:58
You'd have to override the anchoring for "attacktablename" and "max_rank_size" to be where you want them to be.

It looks like you're using RMC ruleset, and templates specific to that ruleset. So, you'd need to look up the anchoring for those, and swap the values and the order they are defined probably as well. I'm not familiar with those templates, as they are not part of CoreRPG.

Regards,
JPG

damned
November 27th, 2024, 10:55
You could try swapping the words

string_columnh_item with DropDown and then also swapping their order?

alloowishus
November 27th, 2024, 18:31
You'd have to override the anchoring for "attacktablename" and "max_rank_size" to be where you want them to be.

It looks like you're using RMC ruleset, and templates specific to that ruleset. So, you'd need to look up the anchoring for those, and swap the values and the order they are defined probably as well. I'm not familiar with those templates, as they are not part of CoreRPG.

Regards,
JPG

Ok which template would it be? I can't find one for record_item.xml

Moon Wizard
November 27th, 2024, 18:52
I'm not familiar with how the RMC templates work; so you'd have to work backward through the templates to see what they are doing.

If I had to do it, I would work backward to find and combine all anchored tags in the hierarchy, then override with the final version of the anchored tag I wanted where the final controls are defined using a merge="replace" tag to make sure only the new anchoring is used.

Regards,
JPG

alloowishus
November 27th, 2024, 19:52
I'm not familiar with how the RMC templates work; so you'd have to work backward through the templates to see what they are doing.

If I had to do it, I would work backward to find and combine all anchored tags in the hierarchy, then override with the final version of the anchored tag I wanted where the final controls are defined using a merge="replace" tag to make sure only the new anchoring is used.

Regards,
JPG

Actually, I figured it out. All I had to do was change the width value of the attack table and the left offset of the max size one, easier than swapping them. I don't think there is a template.

Moon Wizard
November 27th, 2024, 21:16
Glad you got it working.

There are actually multiple templates in the example code you posted.
RMC Specific: spacer_column_item, string_columnh_tablename, DropDown, number_columnh_tablemod, string_columnh_item, label_column_CoreRPG.
CoreRPG: line_column, hs, label_fieldtop

If it's not one of the base control types (genericcontrol, stringcontrol/field, numbercontrol/field, etc.); then it's always a template that is defined somewhere in the rulesets.

Regards,
JPG