Help Dialog

ShootingBlanks

OpenDayZ Guru!
This is a help dialog or a whatever-you-want dialog. Its just a simple dialog but is designed for a help page. We used to use a Hint for a help, but it didn't display enough information. With this you can have pages and pages of colored text and images because it uses HTML tags. Imagine a webpage with text and images.
download link
http://opendayz.net/resources/help-dialog-1-0.3/
http://iaretech.com/files/public/dayz

I should have used some color in my example .. I didnt so here is an image from the Arma2 wiki page on the HTML control. It says in this image that you can link to other sections of your page, like a table of contents, but I didnt test the anchors.
https://community.bistudio.com/wiki/File:HTMLControl.jpg

It has a space on the upper right for your logo, and on the upper left for a list of admins, contact info etc.
The main area is full width below this and can be multiple pages long. If you information is longer than can be displayed a "next page" and "previous page" button is automatically displayed.

The dialog itself is simple grey and half transparent so you can see the zombies coming to eat your intestines and close your dialog. The text areas are HTML controls. You edit the main body contents by editing the help.html file that is included. The upper left HTML control is filled with text from help_txt.html.

You can edit the colors of the dialogs by changing the parent class that is located in the hlp_defines.hpp file. A default logo is included but you can insert whatever one you want. The image control will fit a 500x120 image and scale it nicely if its in paa format. If you want to use a jpg image, the image MUST be twice as wide as it is high (256x128 .. 1024x512 etc). Since the image control is not quite this proportions it will distort a jpg some. I will remake a dialog with a 2x proportional image control so the jpgs fit in nicely too.
Because of the distortion, you should use a paa file (I designed it to fit a 512x120 paa logo I had). The paa files seem to resize to fit in the box without any distortion. To use a paa file, simply save your logo as a png, download texview2 from bis, open the png file, save as paa. Paa files support transparency while jpgs do not so you can have a nicer logo to boot.

To use this dialog, put the help folder in your mission and add these two lines to your description.ext
Code:
#include "help\hlp_defines.hpp"
#include "help\hlp_dialog.hpp"

To display the dialog you need to use some method of your choice to call this code. You can set it in the init.sqf, your selfactions or some keypress like the debug monitors.
Code:
_hlpdialog = createdialog "HELP_DIALOG";

To use a keypress look for this code in your compiles.sqf (or in dayz_spaceinterrupt in epoch)
Code:
dayz_spaceInterrupt = {
        private "_handled";
        _dikCode = _this select 1;
        _shiftState = _this select 2;
        _ctrlState = _this select 3;
        _altState = _this select 4;
        _handled = false;

After that insert this code which uses the INSERT key to call up the help menu.
Code:
  if (_dikCode == 0xD2) then {
        _hndl = createdialog "help_dialog";
        };

You could use a menu option in your self actions if you prefer. Same code applies,
Code:
player addaction["Help Dialog", "createdialog 'help_dialog'];

Refer to this page for a list of Dik codes so you can set it to activate with whatever key you want.
https://community.bistudio.com/wiki/DIK_KeyCodes
Wiki information on dialogs if you want to try and edit the colors or some other setting.
https://community.bistudio.com/wiki/Dialog_Control
https://resources.bisimulations.com/w/index.php?title=Dialog_Control
Page on Text and HTML dialog controls .
https://community.bistudio.com/wiki/DialogControls-Text
 
Last edited:
Some info on editing your HTML text.
The tags you can use are
<p> pararaph

<b> bold .. this has a color setting in the hlp_defines.hpp so you can change the color of all bold text

<br/> line break

<font size="25" color="#08298A"> use this color chart to change font color http://html-color-codes.info/ The font size is usually a number from 1-7 but a 6 is just barely visible. This size is probably adjusted by the Arma2 font size in some manner. I applied this to my demo text and size="12" was about the same size as the rest of the standard text. 25 was much larger. Anything below 6 is too small to be read.

<img src="texture.jpg" height="42" width="42"> Works, you can resize the image. I put the image in my help folder and it didn't matter if I used help\texture.jpg or texture.jpg , both were located and displayed.

<a id="tips">Useful Tips Section</a> The links to other parts of your document will display onpage if within a <p> tag </p> but they don't seem to work.

I tested the <hr>, <ul>, <ol>,<table> and these did not seem to be supported.

So there you go. Sized and Colored text using the supported tags. If you happen to test and find something else working let us know. The Arma2 docs claim the links work, but not as I used them. probably only work within the same page of displayed text which is useless for us.

BTW: there is another text control called the Structured Text that is formatted like the debug monitor are and you have some other options there. I chose to use the HTML control because you can edit the file separately and its easily displayed on an html editor so you can create one visually.
 
Back
Top