PDA

View Full Version : Help moving the modifier box



dr_venture
May 1st, 2012, 04:27
I've had multiple players complain that the modifier box in Castles & Crusades is blocking the bottom of the chat window. It currently sits below the Chat panel, justified to the left side of the window. What I'd like to do is slide it a couple hundred pixels to the right - far enough so that on small screens, it sits next to the chat window instead of on top of it. Make sense?

The code appears to live in the 'desktop_classes.xml' file. The code for the box is below. I tried to change the first parameter of the 'base' control's 'bounds' element from '0' to '80' as a test. The result is the PNG for the modifier box successfully moving to the right as expected, but the right half of the PNG is invisible - it's like the PNG is being drawn half outside of some kind of drawing area for the control.

So I'm out of my leage here - before I spend hours randomly poking through X/Y values, does anyone have any tips on how to slide the Mod box over to the right?

Thanks in advance!



<windowclass name="modifierstack">
<script>
function onInit()
ModifierStack.registerControl(self);
end

function onClose()
ModifierStack.registerControl(nil);
end
</script>
<sheetdata>
<genericcontrol name="base">
<bounds>0,5,64,52</bounds>
<icon>modcollector</icon>
<counters>
<icon>modcollector_counter</icon>
<offset>
<x>11</x>
<y>47</y>
</offset>
<spacing>9</spacing>
<hoversize>4</hoversize>
</counters>
<script file="scripts/modifierstack_base.lua" />
</genericcontrol>
<numbercontrol name="modifier">
<bounds>5,0,54,42</bounds>
<font>modcollector</font>
<displaysign />
<keyeditframe>
<name>modstackfocus</name>
<offset>-1,-11,-1,-8</offset>
</keyeditframe>
<droptypes>
<type>number</type>
</droptypes>
<stateframe>
<drophilight>
<name>modstackfocus</name>
<offset>0,-11,0,3</offset>
</drophilight>
</stateframe>
<script file="scripts/modifierstack_modifier.lua" />
</numbercontrol>
<stringcontrol name="label">
<bounds>5,34,54,12</bounds>
<font>modcollectorlabel</font>
<static>Modifier</static>
<center />
<script>
function onDrop(x, y, draginfo)
return window.base.onDrop(x, y, draginfo);
end
</script>
</stringcontrol>
</sheetdata>
</windowclass>

Dakadin
May 1st, 2012, 05:27
Check in the desktop_panels.xml file for a panel with a class of modifierstack. Here is what it looks like in the 4E ruleset:



<panel name="modifierstack" modes="host,client">
<class>modifierstack</class>
<bounds>20,-100,64,57</bounds>
</panel>


Just change the equivalent of the 20 in the bounds field so that it is just outside of the width of the chat.

dr_venture
May 1st, 2012, 06:18
Duh - I totally didn't even notice those other desktop files... don't ask. Anyway, C&C looks different, but is just as easy to mod. You're my hero!!! Thanks, Dakadin!

Dakadin
May 1st, 2012, 06:27
One other thing to be aware of is right now, I don't think you can change panel locations or sizes in an extension so you might need to make the change to the ruleset. I believe JPG is changing this with version 2.9 but we will need him to verify that.

dr_venture
May 1st, 2012, 08:49
You know, I was thinking that I really *should* make it into an extension, but then I just got lazy and left it a core rules set mod. Score one for lazy!!!

Dakadin
May 1st, 2012, 15:29
LOL. Glad to hear it! :D