Varsuuk
February 7th, 2021, 02:13
I was making changes to the NPC Sheet in a MoreCore extension. I wanted to make the label for "CT Rolls" and "Attributes" be immutable. I took the existing template "
[EDIT: TO BE CLEAR - The template allows editing of the label text BUT it reverts back to the <static> value when you reopen it - which is fine - I just wonder why it just simply doesn't disallow any editing? ]
<template name="string_useredit_bold">
<stringfield>
<font>reference-b</font>
<anchored position="insidetop" offset="0,10" />
<center />
</stringfield>
</template>
and first simply tried:
<template name="string_no_useredit_bold"> <!-- Non-editable version of string_useredit_bold -->
<label>
<font>reference-b</font>
<anchored position="insidetop" offset="0,10" />
<center />
</label>
</template>
(For reference, here is the template "label" from CoreRPG:
<template name="label">
<stringcontrol>
<anchored height="20" />
<font>sheetlabel</font>
<nodrag />
<readonly />
</stringcontrol>
</template>
-- note it has <readonly /> - I even added the readonly to my "no_useredit" template.
But - it still allows editing:
<string_no_useredit_bold name="cas1_label">
<anchored to="cas1" position="insidetop" offset="0,8" height="20" />
<static>CT Rolls</static>
<tooltip textres="label_editable_stats" />
</string_no_useredit_bold>
"static" was originally "default" - I changed it while trying to figure out why I can still click on the label and edit it (on re-open it goes back to CT Rolls) - any ideas what I am missing in the definition?
[EDIT: TO BE CLEAR - The template allows editing of the label text BUT it reverts back to the <static> value when you reopen it - which is fine - I just wonder why it just simply doesn't disallow any editing? ]
<template name="string_useredit_bold">
<stringfield>
<font>reference-b</font>
<anchored position="insidetop" offset="0,10" />
<center />
</stringfield>
</template>
and first simply tried:
<template name="string_no_useredit_bold"> <!-- Non-editable version of string_useredit_bold -->
<label>
<font>reference-b</font>
<anchored position="insidetop" offset="0,10" />
<center />
</label>
</template>
(For reference, here is the template "label" from CoreRPG:
<template name="label">
<stringcontrol>
<anchored height="20" />
<font>sheetlabel</font>
<nodrag />
<readonly />
</stringcontrol>
</template>
-- note it has <readonly /> - I even added the readonly to my "no_useredit" template.
But - it still allows editing:
<string_no_useredit_bold name="cas1_label">
<anchored to="cas1" position="insidetop" offset="0,8" height="20" />
<static>CT Rolls</static>
<tooltip textres="label_editable_stats" />
</string_no_useredit_bold>
"static" was originally "default" - I changed it while trying to figure out why I can still click on the label and edit it (on re-open it goes back to CT Rolls) - any ideas what I am missing in the definition?