Related resources links:
- to be advised. (None at this stage. Was going to be a few links to other dialog projects.)
Changelog:
Code Sample
Code:
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
Code:
_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";
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
Code:
#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
Code:
_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.