Re: My popup widget (again) along with a demo[message #300392]
|
Mon, 27 February 2012 02:16
|
|
The_Bob |
|
Messages:415
Registered:May 2009 Location: Behind you. |
|
|
Update:
popup class:
Fixed subpopups (broke in previous release)
Fixed subpopup relative positioning (now they align nicely)
Added proper popup width estimating
Fixed some sanity checks
Subpopups now display shaded if they are empty
Subpopups can now have fancy colors
Inventory pocket popups:
Added popups for:
- LBE slots (combat pack, back pack, thigh rigs, vest)
- Knife pocket
- Face items
- Armor slots
- Hand and gun sling slots (don't work well with a lot of items yet)
Added grenade selector to LBE pocket popups (above ammo selector)
Added ctrl-click menu with all of the above, for any slot.
When picking items, the best ones are selected by default. Picking the best stack is kinda sketchy, but picking the best out of the first stack works.
Additionally, I've made a bunch of useful functions for getting stuff out of sector inventory and making other popups related to inv pockets, in case anyone else is playing with this stuff right now.
updated exe: http://www.fileden.com/files/2008/7/29/2025585/JA2_PO_Release_27-02-2012.7z
updated, old version exe: http://www.fileden.com/files/2008/7/29/2025585/JA2_PO_Release_old_27-02-2012.7z
source: http://www.fileden.com/files/2008/7/29/2025585/src_27-02-2012.7z
Report message to a moderator
|
|
|
|
|
|
|
Re: My popup widget (again) along with a demo[message #300879]
|
Sat, 03 March 2012 22:10
|
|
The_Bob |
|
Messages:415
Registered:May 2009 Location: Behind you. |
|
|
update:
popup class:
- fixed code to add a previously created subpopup to a popup box
- fixed code that changed popup option names
new - popup definitions:
- added runtime popup definition class
The popup definitions allow coders to store popup box templates and then apply them to existing boxes. The definitions may contain options with simple callbacks, submenus and generators.
The generators, in the simplest sense, are functions that take a pointer to a popup menu and add options to it. At this time, the generators are taken from a fixed index and can take no parameters.
While limited, popup definitions might help organizing static popup boxes.
The code is currently specialized for the inventory popups, but could be easily adapted for other purposes.
For details, see:
Build\Utils\popup_definition.cpp
Build\Utils\popup_definition.h
new - popup boxes defined in xml:
While not quite ready yet for general use, I've written a parser that converts xml code into popup definitions.
It reads in "PocketPopups.xml" and maps popup definitions to inventory pocket types, specialising the inventory popups for each pocket.
The xml syntax is very simple and its possibilities equally limited. While fun to work with, xml popup definitions don't offer much flexibility beyond rearranging static popus.
For details, see:
Build\Tactical\XML_LBEPocketPopup.cpp
GameDir\Data-AIM\TableData\PocketPopups.xml ( for AIMNAS21 )
GameDir\Data-1.13\TableData\PocketPopups.xml ( for 1.13 unstable )
inventory popups:
- fixed magazine counts for ammo-list generator
- added item counts for non-ammo slots
- non-ammo items are now stacked to full pocket capacity
- made pocketTypeInSlot() return -1 for all LBE slots
- divided weapon list submenu between weapon types
- separated grenades, rifle grenades and rpg rockets
- separated one-shot launchers from grenade launchers/reloadable rocket launchers
- added generators for misc items and kits
- specialised pocket popups for 1.13
- specialised pocket popups for AIMNAS21
note that my code is now [color:#CC0000]outdated[/color], I've yet to update it to latest SVN.
gamedir files: http://www.fileden.com/files/2008/7/29/2025585/GameDir-03_03_2012.7z
updated exe: http://www.fileden.com/files/2008/7/29/2025585/JA2_PO_Release-03_03_2012.7z
updated, old version exe: http://www.fileden.com/files/2008/7/29/2025585/JA2_PO_Release_old-03_03_2012.7z
source: http://www.fileden.com/files/2008/7/29/2025585/Build-03_03_2012.7z
Report message to a moderator
|
|
|
|
|
|
|
|
|
Re: My popup widget (again) along with a demo[message #301015]
|
Mon, 05 March 2012 15:14
|
|
The_Bob |
|
Messages:415
Registered:May 2009 Location: Behind you. |
|
|
how about these options:
global enable/disable
switches for where popups appear (on/off):
-LBE slots (vest, combat pack, back pack, thigh rigs)
-body slots (armor,head hear)
-hands, knife, gun sling
-LBE pockets
menus for body and LBE slots will likely be hardcoded, the rest will reside in two xml files, one for specific LBE pockets, other for default popup for pockets and popups for hand/gun sling/knife slots
[Updated on: Mon, 05 March 2012 15:16] by Moderator Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|