Varsuuk
February 17th, 2021, 01:23
I really think this one will stump me for a long time given the amount of possibilities and the even bigger amount of my xml/control/ui ineptitude (it's why so much of my customization in my first run will be lua driven and not xml driven :( )
I made changes to record_npc.xml to change what and how some things are displayed on the npc_main tab. That worked out fine (after many stop/starts ;P)
Then I realized I DID need size/reach after all (when seeing ow used in FG - hey... I never even DMed in FG, I only play - so limited technical use ;) )
I thought, I didn't want it at the top of every NPC - especially as it wil be defaulted to 1,1 99% of the time. So, I thought, instead of putting at the bottom (which is really out of the way) - how about on the top of the "notes" page tab? So I put it there to see and it looked fine. Well, except what I did did not put the formatted text thing - jsut my new fields. OK. So I did what I always do - test random small changes to get understanding and quickly realized I really don't know how these work right now.
So... to recap base morecore:
<root>
<windowclass name="npc">
<frame>recordsheet</frame>
<placement>
<size width="350" height="600" />
</placement>
<sizelimits>
<minimum width="350" height="350" />
<dynamic />
</sizelimits>
<minimize>minimized_npc</minimize>
<tooltip field="name" />
<nodelete />
<script>
...
</script>
<sheetdata>
<sub_record_header name="header">
<class>npc_header</class>
</sub_record_header>
<frame_record_content_tabbed name="contentframe" />
<subwindow_record name="main">
<class>npc_main</class>
</subwindow_record>
<ft_record name="notes">
<anchored to="contentframe" position="over" />
<empty textres="ft_empty" />
<invisible />
</ft_record>
<scrollbar_record>
<target>main</target>
</scrollbar_record>
<scrollbar_record>
<target>notes</target>
</scrollbar_record>
<tabs_recordsheet>
<tab>
<icon>tab_main</icon>
<subwindow>main</subwindow>
</tab>
<tab>
<icon>tab_notes</icon>
<subwindow>notes</subwindow>
</tab>
</tabs_recordsheet>
<resize_recordsheet />
<close_recordsheet />
</sheetdata>
</windowclass>
<windowclass name="npc_header">
<margins control="0,0,0,7" />
<script>
function onInit()
update();
end
function update()
local bReadOnly = WindowManager.getReadOnlyState(getDatabaseNode());
name.setReadOnly(bReadOnly);
token.setReadOnly(bReadOnly);
end
</script>
<sheetdata>
<link_record_header>
<class>npc</class>
</link_record_header>
<anchor_record_header_right />
<button_activateid>
<anchored to="rightanchor" width="23" height="22">
...
</sheetdata>
</windowclass>
<windowclass name="npc_main">
<margins control="0,0,0,2" />
<script>
...
---> This is the stuff I moved to sheetdata on the newly added windowclass="npc_notes" etc...
</script>
<sheetdata>
<anchor_column name="columnanchor" />
<label_column name="space_label">
<static textres="npc_label_size" />
</label_column>
<number_column name="space">
<default>1</default>
</number_column>
<label_column_right name="reach_label">
<anchored to="space" />
<static textres="npc_label_reach" />
</label_column_right>
<number_column_right name="reach">
<anchored to="space" />
<default>1</default>
</number_column_right>
<line_column name="divider" />
...
----> continues with the npc_main controls below...
...
So, I tried doing:
<subwindow_record name="main">
<class>npc_main</class>
</subwindow_record>
<subwindow_record name="notes">
<class>npc_notes</class>
</subwindow_record>
And defined the windowclass "npc_notes" with the size/reach/divider controls and all went well..
BUT - how do I use
<ft_record name="notes">
<anchored to="contentframe" position="over" />
<empty textres="ft_empty" />
<invisible />
</ft_record>
or something LIKE it on that tab to fill out the REST of the window, ie - like "insert before" the size/reach/divider controls?
I am not sure I am describing what I want here right - I wish I could SPEAK it vs typing it cos communication, especially written, is not my forte ;P Talking is... but that's another issue.
I am not sure if it is easy to describe the general solution even if you can understand what I am asking for.
Thanks, as always, for your support!
I made changes to record_npc.xml to change what and how some things are displayed on the npc_main tab. That worked out fine (after many stop/starts ;P)
Then I realized I DID need size/reach after all (when seeing ow used in FG - hey... I never even DMed in FG, I only play - so limited technical use ;) )
I thought, I didn't want it at the top of every NPC - especially as it wil be defaulted to 1,1 99% of the time. So, I thought, instead of putting at the bottom (which is really out of the way) - how about on the top of the "notes" page tab? So I put it there to see and it looked fine. Well, except what I did did not put the formatted text thing - jsut my new fields. OK. So I did what I always do - test random small changes to get understanding and quickly realized I really don't know how these work right now.
So... to recap base morecore:
<root>
<windowclass name="npc">
<frame>recordsheet</frame>
<placement>
<size width="350" height="600" />
</placement>
<sizelimits>
<minimum width="350" height="350" />
<dynamic />
</sizelimits>
<minimize>minimized_npc</minimize>
<tooltip field="name" />
<nodelete />
<script>
...
</script>
<sheetdata>
<sub_record_header name="header">
<class>npc_header</class>
</sub_record_header>
<frame_record_content_tabbed name="contentframe" />
<subwindow_record name="main">
<class>npc_main</class>
</subwindow_record>
<ft_record name="notes">
<anchored to="contentframe" position="over" />
<empty textres="ft_empty" />
<invisible />
</ft_record>
<scrollbar_record>
<target>main</target>
</scrollbar_record>
<scrollbar_record>
<target>notes</target>
</scrollbar_record>
<tabs_recordsheet>
<tab>
<icon>tab_main</icon>
<subwindow>main</subwindow>
</tab>
<tab>
<icon>tab_notes</icon>
<subwindow>notes</subwindow>
</tab>
</tabs_recordsheet>
<resize_recordsheet />
<close_recordsheet />
</sheetdata>
</windowclass>
<windowclass name="npc_header">
<margins control="0,0,0,7" />
<script>
function onInit()
update();
end
function update()
local bReadOnly = WindowManager.getReadOnlyState(getDatabaseNode());
name.setReadOnly(bReadOnly);
token.setReadOnly(bReadOnly);
end
</script>
<sheetdata>
<link_record_header>
<class>npc</class>
</link_record_header>
<anchor_record_header_right />
<button_activateid>
<anchored to="rightanchor" width="23" height="22">
...
</sheetdata>
</windowclass>
<windowclass name="npc_main">
<margins control="0,0,0,2" />
<script>
...
---> This is the stuff I moved to sheetdata on the newly added windowclass="npc_notes" etc...
</script>
<sheetdata>
<anchor_column name="columnanchor" />
<label_column name="space_label">
<static textres="npc_label_size" />
</label_column>
<number_column name="space">
<default>1</default>
</number_column>
<label_column_right name="reach_label">
<anchored to="space" />
<static textres="npc_label_reach" />
</label_column_right>
<number_column_right name="reach">
<anchored to="space" />
<default>1</default>
</number_column_right>
<line_column name="divider" />
...
----> continues with the npc_main controls below...
...
So, I tried doing:
<subwindow_record name="main">
<class>npc_main</class>
</subwindow_record>
<subwindow_record name="notes">
<class>npc_notes</class>
</subwindow_record>
And defined the windowclass "npc_notes" with the size/reach/divider controls and all went well..
BUT - how do I use
<ft_record name="notes">
<anchored to="contentframe" position="over" />
<empty textres="ft_empty" />
<invisible />
</ft_record>
or something LIKE it on that tab to fill out the REST of the window, ie - like "insert before" the size/reach/divider controls?
I am not sure I am describing what I want here right - I wish I could SPEAK it vs typing it cos communication, especially written, is not my forte ;P Talking is... but that's another issue.
I am not sure if it is easy to describe the general solution even if you can understand what I am asking for.
Thanks, as always, for your support!