GI JOE RPG Launch
  1. #1

    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 &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>

  2. #2
    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

  3. #3

  4. #4
    Quote Originally Posted by Moon Wizard View Post
    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

  5. #5
    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

  6. #6
    Quote Originally Posted by Moon Wizard View Post
    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.

  7. #7
    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 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Fantasy Grounds Merchandise

Log in

Log in