-
November 27th, 2024, 05:05 #1
- Join Date
- Feb 2021
- Posts
- 443
How do I switch two tables in the record_item.xml file?
I am trying to switch the placement of two tables (attacktable.PNG) which seems exceedingly difficult. Code is attached below
Code:<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_level.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 > 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>
-
November 27th, 2024, 07:58 #2
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 21,509
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
-
November 27th, 2024, 11:55 #3
You could try swapping the words
string_columnh_item with DropDown and then also swapping their order?
-
November 27th, 2024, 19:31 #4
- Join Date
- Feb 2021
- Posts
- 443
-
November 27th, 2024, 19:52 #5
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 21,509
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
-
November 27th, 2024, 20:52 #6
- Join Date
- Feb 2021
- Posts
- 443
-
November 27th, 2024, 22:16 #7
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 21,509
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
Thread Information
Users Browsing this Thread
There are currently 4 users browsing this thread. (0 members and 4 guests)
Bookmarks