Thread: System list windows
-
November 20th, 2022, 13:07 #1
System list windows
In the system list windows (I don't know what to call them, I mean the system windows that show the list of Items, Npc, Tables, etc. - could be resource list windows?) is it possible to modify the list shown by adding a column?
I saw that you can add custom filters, but I need to add information to the list. It can be done? If yes, how?
-
November 20th, 2022, 14:14 #2
Look at equipment lists in 5E
there are a few steps to it
-
November 20th, 2022, 16:05 #3
@Xarxus - are you referring to the grouped list (viewed by pressing a button at the top of the main list window)? Or the main campaign data lists themselves?
If you're referring to the grouped lists - for example, the Armor or Weapons button at the top of the items campaign data list in 5E (as mentioned by @damned) then look in the ruleset specific /scripts/data_library_<ruleset>.lua file - where the "aListViews" LUA tables define the grouped lists. /scripts/data_library.lua in CoreRPG has some comments at the top of the file that provide information on the fields.
If you're referring to adding fields to the master campaign data list, then you'll need to extend/override the masterindex_<record name> windowclass as needed. For example, in the PFRPG2 ruleset, I've added two fields to the Item record - refer to the masterindexitem_item windowclass data at the bottom of campaign\record_item.xml in the PFRPG2 ruleset.
See the screenshot below - I've added the level field (which changes colour based off the item rarity) and the little "A" field that is show if there's automation in the item record.
Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
November 20th, 2022, 17:34 #4
-
December 10th, 2022, 16:26 #5
After researching I made my own masterindex which adds the field I wanted (I needed a column for the level, as the one @Trenloe showed me).
It works fine, but I have a problem and I don't understand what to do. If I take an Item and move it, it should copy it, but it doesn't. In CoreRPG it works, in my list it doesn't and I don't understand why.
Do you have any suggestions on what I should study?
-
December 10th, 2022, 17:13 #6
Here is my code
Code:<windowclass name="masterindexitem_item"> <margins control="0,0,0,2" /> <script file="campaign/scripts/masterindexitem_window.lua" /> <sheetdata> <hidden_record_isidentified name="isidentified" /> <masterindexitem_link_id name="link" /> <masterindexitem_anchor_right name="rightanchor" /> <masterindexitem_idelete name="idelete" /> <masterindexitem_access name="access" /> <masterindexitem_modified name="modified" /> <masterindexitem_category name="category" /> <masterindexitem_level_MY name="level" /> <masterindexitem_name_MY name="name" /> <masterindexitem_name_MY name="nonid_name" /> </sheetdata> </windowclass> <template name="masterindexitem_level_MY"> <numbercontrol> <anchored position="insidetopleft" offset="30,2" height="20" width="30" /> <font>reference-r</font> <nodrag /> <static /> <script> function onInit() local nodeItem = window.getDatabaseNode(); local nodeItemLevel = DB.getChild(nodeItem, "level"); local nodeItemIdentified = DB.getChild(nodeItem, "isidentified"); nodeItemLevel.onUpdate = updateLevel; nodeItemIdentified.onUpdate = updateLevel; updateLevel(); end function updateLevel() local nodeItem = window.getDatabaseNode(); local nodeItemLevel = DB.getChild(nodeItem, "level"); local bIsIdentified = DB.getValue(nodeItem, "isidentified"); if Session.IsHost or bIsIdentified == 1 then self.setValue(nodeItemLevel.getValue()); else self.setValue(1); end end </script> </numbercontrol> </template> <template name="masterindexitem_name_MY"> <masterindexitem_name> <anchored position="insidetopleft" offset="65,2" height="20"> <right parent="rightanchor" anchor="left" relation="relative" offset="-5" /> </anchored> </masterindexitem_name> </template>
-
December 10th, 2022, 18:27 #7
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,559
Has you already looked at "masterindexitem_id", and the fact that you can specify the master index entry window used in the record type registration in LibraryData (see sListDisplayClass in CoreRPG LibraryData script)?
Regards,
JPG
-
December 10th, 2022, 20:29 #8
I debugged all the scripts and figured out the problem when I got to the handleAnyDrop function inside manager_item.lua.
Basically I used a different tag from item (I was using itemdescription) and this gives problems to the function that doesn't recognize the source type and therefore doesn't know how to determine the target.
Back to the original item and all goes well now!
Thanks for your moral support!
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks