Home » MODDING HQ 1.13 » v1.13 Coding Talk » My popup widget (again) along with a demo
Re: My popup widget (again) along with a demo[message #299509] Mon, 20 February 2012 07:10 Go to previous messageGo to next message
Torres

 
Messages:181
Registered:June 2010
Location: Canary Islands
WOOOW this looks awesome ! Oh come on this can save HOURS when equipping your mercs for different roles !

Is this a full release compatible with latest 1.13 version??
Re: My popup widget (again) along with a demo[message #299517] Mon, 20 February 2012 09:18 Go to previous messageGo to next message
The_Bob

 
Messages:395
Registered:May 2009
Location: Behind you.
4947 exe should be more or less compatible with latest unstable SCI, old exe is some ancient version I still play a long campaign with. Source files are from the new version.

Re: My popup widget (again) along with a demo[message #299619] Mon, 20 February 2012 23:43 Go to previous messageGo to next message
The_Bob

 
Messages:395
Registered:May 2009
Location: Behind you.
Update:

http://www.fileden.com/files/2008/7/29/2025585/ammoPopups3.png

popup class:

added support for fancy colors Smile
POPUP_OPTION * o = sAmmoPopup->addOption( &std::wstring( L"- no matching ammo -" ), NULL );
// 1 - passing NULL to an option as its callback pointer makes it always display shaded
// 2 - sAmmoPopup->addOption(), when given option params instead of a pointer, returns the new option pointer
o->color_shade = COLOR_RED;
// options now have color values:
/*
	UINT8 color_foreground;
	UINT8 color_background;
	UINT8 color_highlight;
	UINT8 color_shade;
*/

added UINT32 stringHandle to each option, assigned when boxes are created - basically whenever popups are shown. This can be used for some other fancy stuff via old popUpBox API.

mag-maker popups:
fixed the bug with boxes remaining visible after selecting an option
fixed bug with boxes not appearing when they should
added fancy colors Smile


updated exe: http://www.fileden.com/files/2008/7/29/2025585/JA2_PO_Release-20-02-2012.7z
updated, old version exe: http://www.fileden.com/files/2008/7/29/2025585/JA2_PO_Release_old-20-02-2012.7z
source: http://www.fileden.com/files/2008/7/29/2025585/src-20-02-2012.7z

Re: My popup widget (again) along with a demo[message #300392] Mon, 27 February 2012 02:16 Go to previous messageGo to next message
The_Bob

 
Messages:395
Registered:May 2009
Location: Behind you.
Update:
http://www.fileden.com/files/2008/7/29/2025585/morePopups.png

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

Re: My popup widget (again) along with a demo[message #300395] Mon, 27 February 2012 02:33 Go to previous messageGo to next message
Gambigobilla

 
Messages:717
Registered:July 2008
Sir, you deserve a huge bag of gummy bears.
Re: My popup widget (again) along with a demo[message #300413] Mon, 27 February 2012 11:06 Go to previous messageGo to next message
Slax

 
Messages:1434
Registered:July 2006
Location: People riding polar bears...
Bear hug!

Re: My popup widget (again) along with a demo[message #300449] Tue, 28 February 2012 00:54 Go to previous messageGo to next message
The_Bob

 
Messages:395
Registered:May 2009
Location: Behind you.
minor update:
http://www.fileden.com/files/2008/7/29/2025585/morePopups2.png
Popups can display quite a lot of stuff without crashing Smile

popup class:

Made subPopups highlight yellow when selected
Made subPopups clean up the screen after closing (force redraw, only in strategic for now)
Added a function to estimate popup height (needs some tweaking)


Inventory pocket popups:
Fixed and simplified the selection of best available items
Fixed positioning of long lists of stuff


updated exe: http://www.fileden.com/files/2008/7/29/2025585/JA2_PO_Release_27-02-2012_2.7z
updated, old version exe: http://www.fileden.com/files/2008/7/29/2025585/JA2_PO_Release_old_27-02-2012_2.7z
source: http://www.fileden.com/files/2008/7/29/2025585/src_27-02-2012_2.7z

Re: My popup widget (again) along with a demo[message #300879] Sat, 03 March 2012 22:10 Go to previous messageGo to next message
The_Bob

 
Messages:395
Registered:May 2009
Location: Behind you.
update:
http://www.fileden.com/files/2008/7/29/2025585/itemPopups2.png

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

Re: My popup widget (again) along with a demo[message #300923] Sun, 04 March 2012 12:23 Go to previous messageGo to next message
Slax

 
Messages:1434
Registered:July 2006
Location: People riding polar bears...
Feeling lazy so I'll just ask instead of testing.
This thing got any ini options? You know, varying levels of complexity and all that.

Re: My popup widget (again) along with a demo[message #300924] Sun, 04 March 2012 12:46 Go to previous messageGo to next message
The_Bob

 
Messages:395
Registered:May 2009
Location: Behind you.
Planned but not yet implemented. What kind of options would you like anyway?

Re: My popup widget (again) along with a demo[message #300926] Sun, 04 March 2012 12:58 Go to previous messageGo to next message
Randok

 
Messages:310
Registered:March 2004
Are you could do this function?
I go to the shop BR. I choose a weapon. I see a list of attachments to this weapon. From this list, I would immediately choose things to buy (no additional finding attachments to the weapon). It would be faster and more efficiently.
Re: My popup widget (again) along with a demo[message #300980] Mon, 05 March 2012 04:24 Go to previous messageGo to next message
Tao

 
Messages:2135
Registered:August 2009
Location: The Known Universe
I like that idea Randok.
Re: My popup widget (again) along with a demo[message #301008] Mon, 05 March 2012 14:03 Go to previous messageGo to next message
Slax

 
Messages:1434
Registered:July 2006
Location: People riding polar bears...
The_Bob
Planned but not yet implemented. What kind of options would you like anyway?

Pretty sure I had something in mind but it slipped away. Disregard my comment. :crazy:

Re: My popup widget (again) along with a demo[message #301015] Mon, 05 March 2012 15:14 Go to previous messageGo to next message
The_Bob

 
Messages:395
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


Re: My popup widget (again) along with a demo[message #301029] Mon, 05 March 2012 18:36 Go to previous messageGo to next message
lockie

 
Messages:3928
Registered:February 2006
Location: Scotland
Those look good , and Randoks suggestion could be a winner if possible ?


Re: My popup widget (again) along with a demo[message #301953] Sun, 18 March 2012 22:13 Go to previous messageGo to next message
Madd_Mugsy

 
Messages:637
Registered:July 2005
Location: Canada
This is great stuff. I've been using it in my own dev build for a while now. Not sure how much externalization is required, as it's one of those features that stays out of sight until you want to use it.

Anyone have any objections to adding these popups to the dev trunk?


Re: My popup widget (again) along with a demo[message #301973] Mon, 19 March 2012 15:29 Go to previous messageGo to next message
The_Bob

 
Messages:395
Registered:May 2009
Location: Behind you.
The project is on hold due to coffee maker malfunction.

Re: My popup widget (again) along with a demo[message #301974] Mon, 19 March 2012 15:49 Go to previous messageGo to next message
Sam Hotte

 
Messages:2020
Registered:March 2009
Location: Middle of Germany
Holy Crap! Failure of the HTCPCP Server?
Look at RFC 2324 for help!

May the caffeine be with you!
Smile
Re: My popup widget (again) along with a demo[message #304423] Sun, 06 May 2012 00:36 Go to previous messageGo to next message
The_Bob

 
Messages:395
Registered:May 2009
Location: Behind you.
update:
inventory popups:
- added option (opt. screen and .ini) to disable the popups
- added full translation support

quick attachment popup:
- added search for least damaged attachment in sector (this needs some testing...)

Also...
- Translated my popups' and other option screen options into Polish

updated exe: http://www.fileden.com/files/2008/7/29/2025585/JA2_EN_Release_5-5-2012.7z
patch file: http://www.fileden.com/files/2008/7/29/2025585/popups_5-5-2012.patch
source (SVN 5262): http://www.fileden.com/files/2008/7/29/2025585/code_5-5-2012.7z

Re: My popup widget (again) along with a demo[message #304502] Tue, 08 May 2012 17:04 Go to previous messageGo to next message
Nixou

 
Messages:50
Registered:January 2008
Location: France
Sorry for dumb question, but did RoWA integrate it to the trunk?
Re: My popup widget (again) along with a demo[message #304503] Tue, 08 May 2012 17:44 Go to previous messageGo to next message
The_Bob

 
Messages:395
Registered:May 2009
Location: Behind you.
Not sure about the last update but some version is already in the latest SCI.

[Updated on: Tue, 08 May 2012 17:45] by Moderator


Re: My popup widget (again) along with a demo[message #307981] Mon, 23 July 2012 15:50 Go to previous message
RoWa21

 
Messages:2039
Registered:October 2005
Location: Austria
@all: I have just merged the latest popup code.


Previous Topic: New BR Misc Filters
Next Topic: STOMP ( v1.2 )
Goto Forum:
  


Current Time: Thu Jul 19 20:44:33 EEST 2018

Total time taken to generate the page: 0.01220 seconds