Jump to content

Photo
- - - - -

Dialog Template, plus Standard Dialogs


  • Please log in to reply
40 replies to this topic
Thread Starter
dr_eyeball
dr_eyeball

    Master Sergeant

  • Members
  • 604 posts

  • Joined: 17-December 2005

Posted 18 May 2007 - 13:56 #1

I have completed version 1.1 of a simple Dialog Template Framework. Hopefully I can get some feedback on improving it.

Goal:
The goal is to provide a basic dialog framework to allow other users to include standard dialogs and to create new dialogs (utilising the template) in their missions, to provide a more user friendly interface.

Features:
- A base dialog template (which you can modify to create a new one fairly easily)
- A popup menu system (for dialogs and MapClicks). You can avoid dialog code totally by using this.
- A basic Yes/No dialog
(Planning a few more base dialogs in future)
- Base control classes separated into separate files - (hopefully) no need to edit it, in general
- Uses full inheritence, minimising the code you work with significantly
- A color scheme (which you can alter - saves fussing with colors for all controls & dialogs)
- Hundreds of color constants
- Dialog specific functions script (only a few functions so far).

Notes:
Remember, the focus of this is the dialogs themselves. The functionality and scripting required behind all this may still be missing.
(Eg: The popup menu may have a "Request pickup" menu item, but clicking it may not necessarily do anything functional yet.)

Downloads: v1.1
- Armaholic
- StavangerĀ“s Militaria
- UploadPower (temp)

Screenshots:
- Base Dialog with sample controls
- YesNo Dialog
- PopupMenu MapClick

- Debug Dialog
- Hints examples

- PopupMenu TerrainDetail example
- PopupMenu ViewDistance example
- PopupMenu HQ example
- PopupMenu Support example
- PopupMenu Voting example

Posted Image Posted Image Posted Image

Posted Image Posted Image

Future Plans:
- Additional standard dialogs.
Eg: debug output dialog, Text/Ok dialog, Image/Ok dialog
- More controls in the base dialog
- Need a better system for tracking IDD's & IDC's.
- Menu definition strucuture is currently array based, but could easily be converted to use class definitions instead.

Problems:
- Missing command to GetMousePosition (to match setMousePosition). There might be a work around for it, using dialog events.

Mission Developer Usage - Creating a new dialog or popup menu for a mission.
See the second post (just below) in this thread.

Edited by Dr_Eyeball, 17 April 2009 - 04:12.
reformat

Posted Image

Thread Starter
dr_eyeball
dr_eyeball

    Master Sergeant

  • Members
  • 604 posts

  • Joined: 17-December 2005

Posted 20 May 2007 - 01:39 #2

Related resources links:
- to be advised. (None at this stage. Was going to be a few links to other dialog projects.)


Changelog:
Code Sample
v1.1 change log
============
Main changes:
--------------
- Expand the PopupMenu functionality to a usable level.
- Added a debug output dialog, which logs any data type, auto parses arrays and allows word wrapped text viewing for long outputs.
- Added structured hint examples (HintStructuredText.sqf), for those who want to avoid dialogs where possible.

Minor change details:
--------------------
- restructured folders and file locations to a more sensible modular structure
- Popup menu now includes: 
  - disabling menus, 
  - hints, 
  - temp click markers, 
  - menu activation via shortcut key (default T key - "TeamSwitch" key)
 - automatic parameter substitution into Actions and Captions (for mapClick pos, player pos, current waypoint pos, gridRef's for all pos's, etc).
  - provisions for current waypoint handling 
    - Since there is no GetCurrentWaypoint command yet, it defaults to first waypoint. 
    - However another "Logistics" project which I will release will handle this better.
- minor bug fixes & removal of irrelevant code
- further standardise base control class definitions (DialogControlClasses.hpp)
  - all class properties are now initialized with a default value to prevent ArmA warnings (only demonstrated classes)
  - fix control class sounds



Mission Developer Usage - Incorporating the PopUp menus into a mission.

These are just rough details.

  • for existing missions, do not copy mission.sqm, description.ext, init.sqf & stringtable.csv
  • copy the other project sub-folders and their files
  • modify/merge description.ext
  • modify/merge init.sqf
  • add radio/action menu items to activate the popup menu script, similar to the way it was done in PopupMenuInit.sqf, or leave it as is
  • modify CreatePopupMenu.sqf with the array containing your desired menu structure

To simplify this final stage, simply replace the entire contents of the file CreatePopupMenu.sqf with this code block, then expand with the ideas from the original file:
Code Sample
[COLOR=#000000]_MenuStructureArray =
[
  ["MainMenu",
    [
      ["Caption", "My Menu"],
      ["Items",
        [
          [ ["Item", "Item 1"], ["Action", "nul=[1] execVM 'Item.sqf';"] ],
          [ ["Item", "Item 2"], ["Action", "nul=[2] execVM 'Item.sqf';"] ]
        ]
      ]
    ]
  ]
];
nul=_MenuStructureArray execVM "Dialogs\Common\PopupMenu.sqf";
[/COLOR]


Mission Developer Usage - Creating a new dialog for a mission.

These are just rough details.

  • for existing missions, do not copy mission.sqm, description.ext, init.sqf & stringtable.csv
  • copy the other project sub-folders and their files
  • modify/merge description.ext
  • modify/merge init.sqf
  • Copy and rename MyTestDialog.hpp & MyTestDialog.sqf to your preference into the same folder. Eg: NewDialog.hpp & NewDialog.sqf
  • In your 2 new files, globally search & replace the prefix "LOC3_" to your preference. Eg: "ABC_"
  • In your 2 new files, globally search & replace the word "MyTestDialog" to your preference. Eg: "NewDialog"
  • Modify description.ext to include your new dialog class definition.
    Eg: Code Sample
    #include "Dialogs\NewDialog.hpp"
  • Add a temp action to display your new dialog, similar to the way it was done in SampleDialogsInit.sqf
    Code Sample
    _Action = player addAction ["New Dialog", "Dialogs\NewDialog.sqf", [ /* params */ ], 0, false, false, "" ];
  • (Save and) Reload your mission in the editor (to reread the description.ext file & new hpp files)
  • If reloading works, that's a very good sign, otherwise examine arma.rpt for error log.
  • Test that your dialog works
  • If all is working, modify your new dialog to suit.


Please report any errors with the above "usage" procedures.

Edited by Dr_Eyeball, 17 April 2009 - 04:19.
reformat

Posted Image

Taurus
Taurus

    First Sergeant

  • Members
  • 863 posts

  • Joined: 09-January 2002

Posted 20 May 2007 - 02:04 #3

I so want to download this, but the dl side you have chosen simply doesn't work for me Posted Image

Ruckus
Ruckus

    Sergeant

  • Members
  • 114 posts

  • Joined: 13-September 2006

Posted 20 May 2007 - 02:24 #4

Downloading now. I definatly want to use these Posted Image

UNN
UNN

    Sergeant Major

  • Members
  • 1755 posts

  • Joined: 29-January 2005

Posted 21 May 2007 - 16:09 #5

Nice Idea, I'm sure this will prove usefull. Any chance of adding a template for the camera views you get during a missions breifing?

Op4 BuhBye
Op4 BuhBye

    Gunnery Sergeant

  • Members
  • 401 posts

  • Joined: 31-March 2007

Posted 21 May 2007 - 21:07 #6

Eyeball you rock man! I was just about to get into learning this. Posted Image
When you kill a man you're a murderer.....Kill many and you're a conqueror....Killem all and you're a GOD!

Nicolas Eymerich
Nicolas Eymerich

    Sergeant

  • Members
  • 169 posts

  • Joined: 13-June 2005

Posted 22 May 2007 - 07:27 #7

Just downloaded!

Congratulation for this good idea!

Posted Image

MattXR
MattXR

    Captain

  • Members
  • 6026 posts

  • Joined: 17-January 2005

Posted 22 May 2007 - 14:42 #8

Dr Eyeball is there any way i can get this to start at the start of the mission though the init without using the action menu.

Quote[/b] ]_Action = player addAction ["> Test Yes No Dialog", "Dialogs\Common\ActivateYesNoDialogViaAction.sqf",
Ā [ ["Question", "The <t color='#f000ff00'>helicopter</t> is now over the landing zone.<br/> Do you want to eject from the helicopter?"] ] ];


everytime i try this i get an error no question when the diologue appears..

Quote[/b] ]nul=execVM "Dialogs\Common\ActivateYesNoDialogViaAction.sqf",
["Question", "The <t color='#f000ff00'>helicopter</t> is now over the landing zone.<br/> Do you want to eject from the helicopter?"];






MattXR ( MxR )
Posted Image
Check out my Twitter BIS Fans and Sub! :)
-- MRKCCO Twitter --


shiner
shiner

    Private First Class

  • Members
  • 39 posts

  • Joined: 16-January 2007

Posted 22 May 2007 - 16:19 #9

I just need to complement you that this may prove to be the most significant contribution to the community of all the scripts I have seen. Dialogs/UI is by far the hardest, most time consuming process in mission making, but is the most crucial aspect of us moving beyond the limitations of the action & radio menus for commands.

I'm looking forward to working with v1 and future revisions!
Posted Image

MattXR
MattXR

    Captain

  • Members
  • 6026 posts

  • Joined: 17-January 2005

Posted 22 May 2007 - 21:01 #10

Im implemeting these into my missions with working scripts i just need to knw how to set the diologue off from a script and not the action menu.


MattXR ( MxR )
Posted Image
Check out my Twitter BIS Fans and Sub! :)
-- MRKCCO Twitter --


Thread Starter
dr_eyeball
dr_eyeball

    Master Sergeant

  • Members
  • 604 posts

  • Joined: 17-December 2005

Posted 23 May 2007 - 02:51 #11

Thanks for the support guys.

Notes: the PopUpMenu system has been improved since v1.0. I can release v1.1 in a few days or just the core files, upon request.
It now handles: disabling menus, hints, current waypoint handling, temp click markers, automatic parameter substitution into Actions and Captions (for mapClick pos, player pos, current waypoint pos, gridRef's for all pos's, etc). We really need proper string functions.


@Matt Rochelle: Syntax, it's an array of arrays, so that it can look up a parameter by name. So for the YesNoDialog, use something like:
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">nul=[["Question", "My Question"]] execVM "Dialogs\Common\YesNoDialog.sqf";
[/QUOTE]


I haven't explained this new paired parameter concept anywhere, which I started using. It allows for future expansion of including extra parameters or user defined parameters, without having to rewrite all the code to handle the new parameters.

The general format is:
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[
["Item1", "Value1"],
["Item2", "Value2"],
["Item3", [["A much more complicated Value3 Array"], [52,0.7], "Hello"] ],
...
["ItemX", _etc]
][/QUOTE]


I'm currently working on a "Logistics Control Menu" using the PopUpMenu system. I'll reveal those details soon. So far it handles:
- simple soldier recruitment (20 roles) - completed
- air drop requests (via AI aircraft) of: ammo crate, PBX, landrover - 100% complete
- a transport request system, including acknowledgement, pick-up & destination handling, waiting durations (plus transport type & purpose) - 80% complete
- Waypoint system - 100% complete.
- Configuration menu - 99% complete (same as demo)

It should be good. I'd like to know what scripts you guys are attaching to these menus. I think a new thread on scripting the PopUpMenu alone would be worthwhile.

Edit:
@UNN: Camera Views
I think camera views is outside of the scope of dialogs and is not something I'm familiar with yet.




Posted Image

MattXR
MattXR

    Captain

  • Members
  • 6026 posts

  • Joined: 17-January 2005

Posted 23 May 2007 - 13:10 #12

Wow Dr_Eyeball Im very interested in this project as for me and many other mission makers found it hard to create Dialogs but with a template we can work from this gives up a big opening and lets us drive deeper into our mission editing.

All in all 1.1 looks like its going to be great and keep up the good work, i think more people need to know about this. Excelent. I will definitly add these Dialogs into my new upcoming mission to show off the full potential abilitys Posted Image

Great Work.


MattXR ( MxR )
Posted Image
Check out my Twitter BIS Fans and Sub! :)
-- MRKCCO Twitter --


zwobot
zwobot

    Master Sergeant

  • Members
  • 620 posts

  • Joined: 09-September 2004

Posted 23 May 2007 - 15:32 #13

I haven't tried it out yet but it definitely is a good thing to have generally as dialog making is quite annyoing. Especially placing the controls in a proper layout.

TJ72
TJ72

    Staff Sergeant

  • Members
  • 388 posts

  • Joined: 12-January 2002

Posted 23 May 2007 - 15:53 #14

Thanks much very,

I needed something like this and this is like first class silver platter service.
Rock on!
[ CAS_Heli v.1.51] [ AIRLIFT v.1.73 -hotfix ]

shiner
shiner

    Private First Class

  • Members
  • 39 posts

  • Joined: 16-January 2007

Posted 28 May 2007 - 01:29 #15

Wow is this great to work with. Looking forward to enhancements to this and the MP Respawn project based on this.

I did find a design flaw in this version. The PanMap function has hardcoded the LOC3 prefix. At this point if running multiple dialogs I would need to make multiple functions and link to the appropriate one for my particular dialog:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Dlg_PanMapBetweenTwoPositions =
{
_IDC_Map = _this select 0;
_startPos1 = _this select 1;
_endPos2 = _this select 2;

_ctrl = LOC3_display displayctrl _IDC_Map;
ctrlMapAnimClear _ctrl; // stops previous panning

// [duration, zoom, pos]
_ctrl ctrlmapanimadd [0.0, 1.00, _startPos1]; // show home base
_ctrl ctrlmapanimadd [1.2, 1.00, _endPos2]; // show map location
_ctrl ctrlmapanimadd [0.2, 0.30, _endPos2]; // zoom map location
ctrlmapanimcommit _ctrl;
};[/QUOTE]

Also your SS above show a very nice blue theme, but I believe the theme packaged with the v1.0 is a grey/red theme. Can you share the theme document used above?




Posted Image

Thread Starter
dr_eyeball
dr_eyeball

    Master Sergeant

  • Members
  • 604 posts

  • Joined: 17-December 2005

Posted 31 May 2007 - 05:57 #16

Version 1.1 of the Dialog Framework is now available.
It's a small update, but required for the release of some of its other dependent projects (which are due soon and are more interesting).

N.B.: Be aware that some things were renamed or moved around (especiall file locations), for the sake of modularity.

<span style='color:blue'>v1.1 change log</span>
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Main changes:
=============
- Expand the PopupMenu functionality to a usable level.
- Added a debug output dialog, which logs any data type, auto parses arrays and allows word wrapped text viewing for long outputs. The "sideChat debug system" just doesn't cut it.
- Added structured hint examples (HintStructuredText.sqf), for those who want to avoid dialogs where possible.

Minor change details:
================
- restructured folders and file locations to a more sensible modular structure
- Popup menu now includes:
- menu activation via shortcut key (default T key - "TeamSwitch" key) and priority set down to 0.
- disabling menus,
- hints,
- temp click markers,
- automatic parameter substitution into Actions and Captions (for mapClick pos, player pos, current waypoint pos, gridRef's for all pos's, etc).
- provisions for current waypoint handling
- Since there is no GetCurrentWaypoint command yet, it defaults to first waypoint.
- However another "Logistics" project which I will release will handle this better.
- minor bug fixes & removal of irrelevant code
- further standardise base control class definitions (DialogControlClasses.hpp)
- all class properties are now initialized with a default value to prevent ArmA warnings (only demonstrated classes)
- fix control class sounds
[/QUOTE]

<span style='color:blue'>New screenshots:</span>
- Debug Dialog
- Hints examples

Posted Image Posted Image

<span style='color:blue'>Downloads:</span> v1.1
- see first post for updated links

-----------------------------

@Shiner, thanks for the "LOC3_display" bug report. That's fixed now.
The color scheme file is already part of the download in the file called "DialogColorScheme.hpp". Just modify the Dlg_ColorScheme_CaptionBackground value. (I know I haven't explained any of this yet.)




Posted Image

sickboy
sickboy

    Colonel

  • Members
  • 9947 posts

  • Joined: 11-May 2005

Posted 31 May 2007 - 07:31 #17

Totally ... totally ... wicked! Big thanks, to my opinion dialogs are always horrible in terms of creating headaches :P

Debug dialog, nice! I will be toying around with these over the weekend! Posted Image

Nutty_101
Nutty_101

    Gunnery Sergeant

  • Members
  • 522 posts

  • Joined: 30-January 2007

Posted 01 June 2007 - 08:03 #18

Dr Eye,
Do you know if we can use links in the html to fire off a script or event? I was also curious if there is a way to build a listbox with images in it.

Thread Starter
dr_eyeball
dr_eyeball

    Master Sergeant

  • Members
  • 604 posts

  • Joined: 17-December 2005

Posted 01 June 2007 - 09:57 #19

Not aware of html control being able to perform any additional actions except show marker position and other html pages.

I'll have to check if list boxes support images. Never tried or seen it, but I'd say they would. I meant to add that to the demo, but forgot. I know they work for combo's. Try something like:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_idc = your_combo_control_id;
_value = "text";
_picture = "\CA\ui\data\ui_action_heal_ca.paa";
_data = "data";

_index = lbAdd [_idc, _value];
lbSetPicture [_idc, _index, _picture];
lbSetData [_idc, _index, _data];
[/QUOTE]




Posted Image

Nutty_101
Nutty_101

    Gunnery Sergeant

  • Members
  • 522 posts

  • Joined: 30-January 2007

Posted 01 June 2007 - 17:33 #20

Ahh you rock. Ill use that for now.