View Full Version : no create item option in radial menu
Kurald
May 15th, 2010, 10:41
Hi,
I'm trying to create a weapon-list for the charactersheet. I learn by copying and pasting into my sheet and changing a value here and there. But now I'm stuck.
I defined a windowclass "charsheet_gunslistitem" and a windowclass "charsheet_guns". This windowclass has a windowlist "gunlist" inside which has a charsheet_gunlistitem as class.
My problem: the create item does not show in the radial menu. What could be my problem? <allowcreate/> is included
Additional question: what does the datasource mean?
Moon Wizard
May 15th, 2010, 18:39
When the allowcreate tag is used, the create item menu option will appear as long as there is a datasource defined, and the datasource is modifiable by the current user.
The datasource is the path to the place in the database where the list objects will be stored.
To modify a data source, the user has to either be the host, or the owner of that data object. Also, non-host module data can not be modified.
Hope that helps,
JPG
Kurald
May 16th, 2010, 07:15
then the datasource is my problem. I guess it's not defined yet. Where / how do I do that?
I have the following code:
<?xml version="1.0" encoding="iso-8859-1"?>
<root version="2.0">
<windowclass name="charsheet_gunslistitem">
<sizelimits>
<minimum>
<height>10</height>
</minimum>
</sizelimits>
<sheetdata>
<stringfield name="name">
<anchored>
<left>
<anchor>left</anchor>
<offset>0</offset>
</left>
<top>
<anchor>top</anchor>
<offset>0</offset>
</top>
<size>
<width>110</width>
</size>
</anchored>
<frame>
<textwidth>110</textwidth>
<offset>0,0,0,0</offset>
</frame>
</stringfield>
</sheetdata>
</windowclass>
<windowclass name="charsheet_guns">
<placement>
<size>
<width>252</width>
<height>611</height>
</size>
</placement>
<nodelete />
<sheetdata>
<genericcontrol name="weaponframe">
<!-- x, y, x-size?, y-size? -->
<bounds>15,20,480,570</bounds>
<frame>
<name>sheetgroup</name>
</frame>
</genericcontrol>
<stringcontrol>
<anchored>
<to>weaponframe</to>
<position>insidetop</position>
<offset>0,11</offset>
</anchored>
<center />
<font>sheetlabel</font>
<static>Weapons</static>
</stringcontrol>
<stringcontrol>
<anchored>
<to>weaponframe</to>
<position>insidetopleft</position>
<offset>13,25</offset>
</anchored>
<center />
<font>sheetlabelsmall</font>
<static>Name</static>
</stringcontrol>
<stringcontrol>
<anchored>
<to>weaponframe</to>
<position>insidetopleft</position>
<offset>130,25</offset>
</anchored>
<center />
<font>sheetlabelsmall</font>
<static>Acc</static>
</stringcontrol>
<stringcontrol>
<anchored>
<to>weaponframe</to>
<position>insidetopleft</position>
<offset>150,25</offset>
</anchored>
<center />
<font>sheetlabelsmall</font>
<static>Range</static>
</stringcontrol>
<stringcontrol>
<anchored>
<to>weaponframe</to>
<position>insidetopleft</position>
<offset>240,25</offset>
</anchored>
<center />
<font>sheetlabelsmall</font>
<static>RoF</static>
</stringcontrol>
<stringcontrol>
<anchored>
<to>weaponframe</to>
<position>insidetopleft</position>
<offset>260,25</offset>
</anchored>
<center />
<font>sheetlabelsmall</font>
<static>Shots</static>
</stringcontrol>
<stringcontrol>
<anchored>
<to>weaponframe</to>
<position>insidetopleft</position>
<offset>290,25</offset>
</anchored>
<center />
<font>sheetlabelsmall</font>
<static>ST</static>
</stringcontrol>
<stringcontrol>
<anchored>
<to>weaponframe</to>
<position>insidetopleft</position>
<offset>310,25</offset>
</anchored>
<center />
<font>sheetlabelsmall</font>
<static>Bulk</static>
</stringcontrol>
<stringcontrol>
<anchored>
<to>weaponframe</to>
<position>insidetopleft</position>
<offset>340,25</offset>
</anchored>
<center />
<font>sheetlabelsmall</font>
<static>Rcl</static>
</stringcontrol>
<stringcontrol>
<anchored>
<to>weaponframe</to>
<position>insidetopleft</position>
<offset>360,25</offset>
</anchored>
<center />
<font>sheetlabelsmall</font>
<static>Damage</static>
</stringcontrol>
<windowlist name="gunlist">
<anchored>
<to>weaponframe</to>
<position>over</position>
<offset>-12,-9</offset>
<top>
<parent>weaponframe</parent>
<offset>35</offset>
</top>
</anchored>
<datasource>.gunlist</datasource>
<class>charsheet_gunlistitem</class>
<allowcreate />
<allowdelete />
<script>
function onSortCompare(w1, w2)
if w1.name.getValue() == "" then
return true;
elseif w2.name.getValue() == "" then
return false;
end
return w1.name.getValue() > w2.name.getValue();
end
function onInit()
end
</script>
</windowlist>
</sheetdata>
</windowclass>
</root>
Moon Wizard
May 17th, 2010, 02:23
You shouldn't need to define the datasource, and your list datasource field is similar to ones in other rulesets. So, your list should work, unless the datasource is defined as something other than a list.
One issue that I have found sometimes when developing rulesets is that I will sometimes have created the same datasource path as a different object type, either through LUA script or when working out the kinks. Try opening a brand new ruleset, and see if you still have the issue.
Also, you can look in the campaign's db.xml file to see whether the gunlist tag is being created in the right spot.
Regards,
JPG
Fenloh
May 17th, 2010, 05:55
Sometimes, especially when it is as subwindow, the Class that is being used needs to be on top of the file to ensure the correct position. (charsheet_guns in ur case) If that is not the case it is like an invisible window -> you can see, but you cant click.
Fenloh
Kurald
May 18th, 2010, 05:38
could it be the problem that I introduced this code in a new tab?
Fenloh
May 18th, 2010, 05:57
Did you change the Code like this? Only the Sorting of your Window Classes?
Fenloh
<?xml version="1.0" encoding="iso-8859-1"?>
<root version="2.0">
<windowclass name="charsheet_guns">
<placement>
<size>
<width>252</width>
<height>611</height>
</size>
</placement>
<nodelete />
<sheetdata>
<genericcontrol name="weaponframe">
<!-- x, y, x-size?, y-size? -->
<bounds>15,20,480,570</bounds>
<frame>
<name>sheetgroup</name>
</frame>
</genericcontrol>
<stringcontrol>
<anchored>
<to>weaponframe</to>
<position>insidetop</position>
<offset>0,11</offset>
</anchored>
<center />
<font>sheetlabel</font>
<static>Weapons</static>
</stringcontrol>
<stringcontrol>
<anchored>
<to>weaponframe</to>
<position>insidetopleft</position>
<offset>13,25</offset>
</anchored>
<center />
<font>sheetlabelsmall</font>
<static>Name</static>
</stringcontrol>
<stringcontrol>
<anchored>
<to>weaponframe</to>
<position>insidetopleft</position>
<offset>130,25</offset>
</anchored>
<center />
<font>sheetlabelsmall</font>
<static>Acc</static>
</stringcontrol>
<stringcontrol>
<anchored>
<to>weaponframe</to>
<position>insidetopleft</position>
<offset>150,25</offset>
</anchored>
<center />
<font>sheetlabelsmall</font>
<static>Range</static>
</stringcontrol>
<stringcontrol>
<anchored>
<to>weaponframe</to>
<position>insidetopleft</position>
<offset>240,25</offset>
</anchored>
<center />
<font>sheetlabelsmall</font>
<static>RoF</static>
</stringcontrol>
<stringcontrol>
<anchored>
<to>weaponframe</to>
<position>insidetopleft</position>
<offset>260,25</offset>
</anchored>
<center />
<font>sheetlabelsmall</font>
<static>Shots</static>
</stringcontrol>
<stringcontrol>
<anchored>
<to>weaponframe</to>
<position>insidetopleft</position>
<offset>290,25</offset>
</anchored>
<center />
<font>sheetlabelsmall</font>
<static>ST</static>
</stringcontrol>
<stringcontrol>
<anchored>
<to>weaponframe</to>
<position>insidetopleft</position>
<offset>310,25</offset>
</anchored>
<center />
<font>sheetlabelsmall</font>
<static>Bulk</static>
</stringcontrol>
<stringcontrol>
<anchored>
<to>weaponframe</to>
<position>insidetopleft</position>
<offset>340,25</offset>
</anchored>
<center />
<font>sheetlabelsmall</font>
<static>Rcl</static>
</stringcontrol>
<stringcontrol>
<anchored>
<to>weaponframe</to>
<position>insidetopleft</position>
<offset>360,25</offset>
</anchored>
<center />
<font>sheetlabelsmall</font>
<static>Damage</static>
</stringcontrol>
<windowlist name="gunlist">
<anchored>
<to>weaponframe</to>
<position>over</position>
<offset>-12,-9</offset>
<top>
<parent>weaponframe</parent>
<offset>35</offset>
</top>
</anchored>
<datasource>.gunlist</datasource>
<class>charsheet_gunlistitem</class>
<allowcreate />
<allowdelete />
<script>
function onSortCompare(w1, w2)
if w1.name.getValue() == "" then
return true;
elseif w2.name.getValue() == "" then
return false;
end
return w1.name.getValue() > w2.name.getValue();
end
function onInit()
end
</script>
</windowlist>
</sheetdata>
</windowclass>
<windowclass name="charsheet_gunslistitem">
<sizelimits>
<minimum>
<height>10</height>
</minimum>
</sizelimits>
<sheetdata>
<stringfield name="name">
<anchored>
<left>
<anchor>left</anchor>
<offset>0</offset>
</left>
<top>
<anchor>top</anchor>
<offset>0</offset>
</top>
<size>
<width>110</width>
</size>
</anchored>
<frame>
<textwidth>110</textwidth>
<offset>0,0,0,0</offset>
</frame>
</stringfield>
</sheetdata>
</windowclass>
</root>
Kurald
May 18th, 2010, 20:25
I just pasted your code into my file - it did not help.
Moon Wizard
May 18th, 2010, 22:40
* What does your db.xml file show for the gunlist tag?
* Did you try a new campaign?
* Are you having trouble on the client or the host or both?
I don't see anything in the code you posted which should be causing a problem, so my guess at this point is that the problem is somewhere else in your ruleset, perhaps in some script code that attempts to read/populate the gunlist.
Thanks,
JPG
Kurald
May 19th, 2010, 06:00
- the db.xml shows nothing for the gunlist tag. Inserting something does not help either.
- yes, I tried a new campaign.
- host - I never tried the client.
I did not change any lua code. Where do I have to look?
Moon Wizard
May 19th, 2010, 21:38
Please send me your ruleset in a ZIP file to
[email protected], and I'll take a look.
Cheers,
JPG
Fenloh
May 20th, 2010, 15:58
For one i experience a similar Problem, the Radial Menue does not show a create Item and no delete Item.
The Windowlist Skills has its Items defined in Skills.xml when the List is integrated there it works find
the Windowlist Skills is also called upon in a window "combat" on Combat.xml. It works fine there.
Due to some issues i had to place it in Weapons.xml which is a subwindow of combat.xml. The Setup did not change, but the radial Menue does not work there. It is not a biggi atm, but it may well be the same problem.
There is another thing that i do not understand concerning the radial Menue. If you rightcklick On a window, where a windowlist is called upon, which has no entries at all, or you click a spot where there is no entry, then the Radial Menue that pops up is a different one that pops up when you rightclick on an existing Item.
My problem atm is, that i can overwrite the Create Item Selection with my own definition, on the Radial Menue that pops up when rightclicking on an existing Item, but i cannot change the one that pops up when rightclicking on an empty space.
I need it to create an item within a filtered windowlist, with the correct value for the filter applied, in order to show up. I solved this so far by bypassing the standard Create Item on the Radial Menue and start a createWindow() function, but that only works on rightclicking on an already existing Item.
I hope it is written in understandable english. O_O
thanks in advance for some hints,
Fenloh
Moon Wizard
May 22nd, 2010, 07:50
Kurald,
In this case, the problem is the class of your gun list item does not match the item class specified for the windowlist. ("charsheet_gunslistitem" != "charsheet_gunlistitem") If the class specified by a windowlist does not exist, then the windowlist is not created. I added a chat message output to the onInit function for the windowlist, and noticed it wasn't being called and looked more.
Fenloh,
Normally, when the standard menus are not appearing, it is because controls are overlapping each other and intercepting the mouse events, or the control is not the size that you are expecting.
For windowlists, the only difference between clicking on or off an item is that you get a "Delete Item" menu entry when right-clicking on an existing item. Otherwise, the menus should be the same. If you are getting a different menu, then it seems like you must be clicking on a different control.
You can also post your windowlist code if you would like some of us to take a look.
Cheers,
JPG
Kurald
May 22nd, 2010, 13:04
thank you moon_wizard
Powered by vBulletin® Version 4.2.1 Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.