MadBeardMan
August 18th, 2019, 18:40
Folks,
In the Traveller ruleset, on the NPC sheet there's a section for Actions.
28521
It's all displaying correctly when in 'edit' mode but once edit is turned off and no actions are entered the controls below all 'move up'.
<!-- Attacks -->
<header_column name="header_actions" >
<static textres="npc_header_actions"/>
</header_column>
<button_iedit name="actions_iedit">
<anchored to="header_actions" position="righthigh" offset="-15,0" />
<target>actions</target>
</button_iedit>
<button_iadd name="actions_iadd">
<anchored to="actions_iedit" position="lefthigh" offset="5,0" />
<target>actions</target>
</button_iadd>
<label name="wpntitle">
<anchored width="155">
<top parent="header_actions" anchor="bottom" relation="relative" offset="3" />
<left offset="0" />
</anchored>
<static textres="npc_label_weapon" />
</label>
<label name="atktitle">
<anchored to="wpntitle" position="righthigh" offset="13,0" width="40" />
<static textres="npc_label_weaponattack" />
</label>
<label name="dmgtitle">
<anchored to="atktitle" position="righthigh" offset="25,0" width="68" />
<static textres="npc_label_weapondmg" />
</label>
<label name="rangetitle">
<anchored to="dmgtitle" position="righthigh" offset="15,0" width="55" />
<static textres="npc_label_weaponrange" />
</label>
<list_npcactions name="actions">
<script>
function onInit()
end
</script>
<anchored to="header_actions" position="bottom">
<top offset="25" />
<right offset="10" />
</anchored>
<datasource>.actions</datasource>
<class>npc_actions</class>
</list_npcactions>
<line_column name="divider4" />
And this is the class it's using:
<windowclass name="npc_actions">
<margins control="0,0,0,2" />
<script file="campaign/scripts/npc_weapons.lua" />
<sheetdata>
<genericcontrol name="rightanchor">
<anchored height="0" width="0">
<top/>
<right />
</anchored>
</genericcontrol>
<button_idelete name="idelete">
<anchored>
<top offset="2" />
<right parent="rightanchor" anchor="left" relation="relative" offset="-5" />
</anchored>
</button_idelete>
<basicstring name="name">
<bounds>5,2,160,20</bounds>
</basicstring>
<basicstring name="attack">
<anchored height="20" />
<bounds>175,2,30,20</bounds>
<hideonvalue>0</hideonvalue>
<rollable/>
<center />
<script>
function onInit()
if rollable or (gmrollable and User.isHost()) then
local w = addBitmapWidget("field_rollable");
w.setPosition("bottomleft", -1, -4);
setHoverCursor("hand");
elseif rollable2 or (gmrollable2 and User.isHost()) then
local w = addBitmapWidget("field_rollable_transparent");
w.setPosition("topright", 0, 2);
w.sendToBack();
setHoverCursor("hand");
end
end
function onDragStart(button, x, y, draginfo)
window.actionAttack(draginfo);
return true;
end
function onDoubleClick(button, x, y)
window.actionAttack();
return true;
end
</script>
</basicstring>
<basicstring name="damage">
<anchored height="20" />
<bounds>215,2,82,20</bounds>
<frame name="fielddark" offset="5,5,5,5" />
<rollable/>
<center />
<script>
function onInit()
if rollable or (gmrollable and User.isHost()) then
local w = addBitmapWidget("field_rollable");
w.setPosition("bottomleft", -1, -4);
setHoverCursor("hand");
elseif rollable2 or (gmrollable2 and User.isHost()) then
local w = addBitmapWidget("field_rollable_transparent");
w.setPosition("topright", 0, 2);
w.sendToBack();
setHoverCursor("hand");
end
end
function onDragStart(button, x, y, draginfo)
window.actionDamage(draginfo);
return true;
end
function onDoubleClick(button, x, y)
window.actionDamage();
return true;
end
</script>
</basicstring>
<basicstring name="range">
<bounds>305,2,62,20</bounds>
</basicstring>
</sheetdata>
</windowclass>
Any thoughts, or if not, a nice example where I can look to see what differences are.
Cheers,
MBM
In the Traveller ruleset, on the NPC sheet there's a section for Actions.
28521
It's all displaying correctly when in 'edit' mode but once edit is turned off and no actions are entered the controls below all 'move up'.
<!-- Attacks -->
<header_column name="header_actions" >
<static textres="npc_header_actions"/>
</header_column>
<button_iedit name="actions_iedit">
<anchored to="header_actions" position="righthigh" offset="-15,0" />
<target>actions</target>
</button_iedit>
<button_iadd name="actions_iadd">
<anchored to="actions_iedit" position="lefthigh" offset="5,0" />
<target>actions</target>
</button_iadd>
<label name="wpntitle">
<anchored width="155">
<top parent="header_actions" anchor="bottom" relation="relative" offset="3" />
<left offset="0" />
</anchored>
<static textres="npc_label_weapon" />
</label>
<label name="atktitle">
<anchored to="wpntitle" position="righthigh" offset="13,0" width="40" />
<static textres="npc_label_weaponattack" />
</label>
<label name="dmgtitle">
<anchored to="atktitle" position="righthigh" offset="25,0" width="68" />
<static textres="npc_label_weapondmg" />
</label>
<label name="rangetitle">
<anchored to="dmgtitle" position="righthigh" offset="15,0" width="55" />
<static textres="npc_label_weaponrange" />
</label>
<list_npcactions name="actions">
<script>
function onInit()
end
</script>
<anchored to="header_actions" position="bottom">
<top offset="25" />
<right offset="10" />
</anchored>
<datasource>.actions</datasource>
<class>npc_actions</class>
</list_npcactions>
<line_column name="divider4" />
And this is the class it's using:
<windowclass name="npc_actions">
<margins control="0,0,0,2" />
<script file="campaign/scripts/npc_weapons.lua" />
<sheetdata>
<genericcontrol name="rightanchor">
<anchored height="0" width="0">
<top/>
<right />
</anchored>
</genericcontrol>
<button_idelete name="idelete">
<anchored>
<top offset="2" />
<right parent="rightanchor" anchor="left" relation="relative" offset="-5" />
</anchored>
</button_idelete>
<basicstring name="name">
<bounds>5,2,160,20</bounds>
</basicstring>
<basicstring name="attack">
<anchored height="20" />
<bounds>175,2,30,20</bounds>
<hideonvalue>0</hideonvalue>
<rollable/>
<center />
<script>
function onInit()
if rollable or (gmrollable and User.isHost()) then
local w = addBitmapWidget("field_rollable");
w.setPosition("bottomleft", -1, -4);
setHoverCursor("hand");
elseif rollable2 or (gmrollable2 and User.isHost()) then
local w = addBitmapWidget("field_rollable_transparent");
w.setPosition("topright", 0, 2);
w.sendToBack();
setHoverCursor("hand");
end
end
function onDragStart(button, x, y, draginfo)
window.actionAttack(draginfo);
return true;
end
function onDoubleClick(button, x, y)
window.actionAttack();
return true;
end
</script>
</basicstring>
<basicstring name="damage">
<anchored height="20" />
<bounds>215,2,82,20</bounds>
<frame name="fielddark" offset="5,5,5,5" />
<rollable/>
<center />
<script>
function onInit()
if rollable or (gmrollable and User.isHost()) then
local w = addBitmapWidget("field_rollable");
w.setPosition("bottomleft", -1, -4);
setHoverCursor("hand");
elseif rollable2 or (gmrollable2 and User.isHost()) then
local w = addBitmapWidget("field_rollable_transparent");
w.setPosition("topright", 0, 2);
w.sendToBack();
setHoverCursor("hand");
end
end
function onDragStart(button, x, y, draginfo)
window.actionDamage(draginfo);
return true;
end
function onDoubleClick(button, x, y)
window.actionDamage();
return true;
end
</script>
</basicstring>
<basicstring name="range">
<bounds>305,2,62,20</bounds>
</basicstring>
</sheetdata>
</windowclass>
Any thoughts, or if not, a nice example where I can look to see what differences are.
Cheers,
MBM