ApesAmongUs
September 7th, 2020, 02:58
<edit - my fix was wrong - do not ignore>
OK, I know this is a common question since I've read several threads on the subject, but I can't get it to work.
I am attempting to replace 2 functions in a file named modifierstack_damageraise.lua (SavageWorlds ruleset). This file is only referred to in the template_desktop.xml file -
<template name="desktop_damageraise_toggle">
<genericcontrol>
<anchored width="40" height="40" />
<icon>damageraise_off</icon>
<script file="desktop/scripts/modifierstack_damageraise.lua" />
</genericcontrol>
</template>
As I understand it, I can't just replace one element in a script, but would need to make a copy of that file and make my changes and then load it. But since the "script" tag doesn't have a name, I'm not sure I'm overwriting it correctly. In fact, I know I'm not, since nothing happens. I tried this -
<template name="desktop_damageraise_toggle" merge="replace">
<genericcontrol merge="replace">
<anchored width="40" height="40" />
<icon>damageraise_off</icon>
<script file="/desktop/scripts/modifierstack_damageraise_replace.lua" />
</genericcontrol>
</template>
But nothing happens - I haven't even written a working script yet, I just made an obvious change that (switching out one screen icon for another after the button is pressed), but it does nothing. After searching I started to wonder if the fact that it was a template mattered and maybe I needed to also override the creation of the element using the new template, so I tried this -
<windowclass name="modifierstack" merge="replace">
<sheetdata>
<desktop_damageraise_toggle name="damageraise" merge="replace">
<anchored>
<top offset="45" />
<right offset="-45" />
</anchored>
</desktop_damageraise_toggle>
</sheetdata>
</windowclass>
There are no changes in that beyond the merge="replace", since I'm just try9ing to get it to create it exactly the same, only with the new button functioning. But still nothing - or at least, I'm getting the message that it loaded. The ext is loading and I'm still getting nothing. Is there any additional step needed to replace the functioning of a button on the desktop?
OK, I know this is a common question since I've read several threads on the subject, but I can't get it to work.
I am attempting to replace 2 functions in a file named modifierstack_damageraise.lua (SavageWorlds ruleset). This file is only referred to in the template_desktop.xml file -
<template name="desktop_damageraise_toggle">
<genericcontrol>
<anchored width="40" height="40" />
<icon>damageraise_off</icon>
<script file="desktop/scripts/modifierstack_damageraise.lua" />
</genericcontrol>
</template>
As I understand it, I can't just replace one element in a script, but would need to make a copy of that file and make my changes and then load it. But since the "script" tag doesn't have a name, I'm not sure I'm overwriting it correctly. In fact, I know I'm not, since nothing happens. I tried this -
<template name="desktop_damageraise_toggle" merge="replace">
<genericcontrol merge="replace">
<anchored width="40" height="40" />
<icon>damageraise_off</icon>
<script file="/desktop/scripts/modifierstack_damageraise_replace.lua" />
</genericcontrol>
</template>
But nothing happens - I haven't even written a working script yet, I just made an obvious change that (switching out one screen icon for another after the button is pressed), but it does nothing. After searching I started to wonder if the fact that it was a template mattered and maybe I needed to also override the creation of the element using the new template, so I tried this -
<windowclass name="modifierstack" merge="replace">
<sheetdata>
<desktop_damageraise_toggle name="damageraise" merge="replace">
<anchored>
<top offset="45" />
<right offset="-45" />
</anchored>
</desktop_damageraise_toggle>
</sheetdata>
</windowclass>
There are no changes in that beyond the merge="replace", since I'm just try9ing to get it to create it exactly the same, only with the new button functioning. But still nothing - or at least, I'm getting the message that it loaded. The ext is loading and I'm still getting nothing. Is there any additional step needed to replace the functioning of a button on the desktop?