Jump to content
Sign in to follow this  
ricki

How to get a Dialog work in config.cpp

Recommended Posts

hi there

how can i get a dialog to work in an addon ?

as you know, you define a dialog in the .ext or in a .hpp file wich you can #include in the .ext.

but how is it done with an addon ? i don't get it.

i could define my dialog as RscTitle ... but there it is not controlable and disappears after one second.

i'd like to add an interface "dialog-style" to my model, with map, buttons and all that stuff !

thanks for any hints or solutions

regards

edit: my dialog is working, only need to know how to get it in my config.

Share this post


Link to post
Share on other sites

here ya go:

config.cpp

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

class CfgPatches

{

class RCK_Dialog

{

units[] = { };

weapons[] = { };

requiredVersion = 0.108000;

requiredAddons[] = { };

};

};

// Control types

#define CT_STATIC           0

#define CT_BUTTON           1

#define CT_EDIT             2

#define CT_SLIDER           3

#define CT_COMBO            4

#define CT_LISTBOX          5

#define CT_TOOLBOX          6

#define CT_CHECKBOXES       7

#define CT_PROGRESS         8

#define CT_HTML             9

#define CT_STATIC_SKEW      10

#define CT_ACTIVETEXT       11

#define CT_TREE             12

#define CT_STRUCTURED_TEXT  13

#define CT_CONTEXT_MENU     14

#define CT_CONTROLS_GROUP   15

#define CT_XKEYDESC         40

#define CT_XBUTTON          41

#define CT_XLISTBOX         42

#define CT_XSLIDER          43

#define CT_XCOMBO           44

#define CT_ANIMATED_TEXTURE 45

#define CT_OBJECT           80

#define CT_OBJECT_ZOOM      81

#define CT_OBJECT_CONTAINER 82

#define CT_OBJECT_CONT_ANIM 83

#define CT_LINEBREAK        98

#define CT_USER             99

#define CT_MAP              100

#define CT_MAP_MAIN         101

// Static styles

#define ST_POS            0x0F

#define ST_HPOS           0x03

#define ST_VPOS           0x0C

#define ST_LEFT           0x00

#define ST_RIGHT          0x01

#define ST_CENTER         0x02

#define ST_DOWN           0x04

#define ST_UP             0x08

#define ST_VCENTER        0x0c

#define ST_TYPE           0xF0

#define ST_SINGLE         0

#define ST_MULTI          16

#define ST_TITLE_BAR      32

#define ST_PICTURE        48

#define ST_FRAME          64

#define ST_BACKGROUND     80

#define ST_GROUP_BOX      96

#define ST_GROUP_BOX2     112

#define ST_HUD_BACKGROUND 128

#define ST_TILE_PICTURE   144

#define ST_WITH_RECT      160

#define ST_LINE           176

#define FontM             "Zeppelin32"

class MyAddonDialog

{

idd = 666;

            ...

            class ExampleOne

            {...};

            class ExampleTwo

            {...};

};

Save this config.cpp in a folder called RCK_Dialog (see class CfgPatches and see how my subclass is named) and pbo it.

Call with

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_ok  = createDialog "MyAddonDialog";

Done.

Share this post


Link to post
Share on other sites
Quote[/b] ]Nice, thanks

I'll second that!

The forums should be used to provide additional, self-contained and practical examples to compliment the official Wiki. That way, this site can be a valuable resource for future developers  thumbs-up.gif

Share this post


Link to post
Share on other sites

ît is possible to include also .hpp's etc. but didnt figured out yet how.

in config.cpp

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

#include "pathtoaddon\foldername\some.hpp"

somhow like that.

referring to #include

Share this post


Link to post
Share on other sites

It might be worth taking a look at the Editor Update V1.02 config by Lowfly. He does lot's of stuff with dialogs and addons thumbs-up.gif

Share this post


Link to post
Share on other sites

File paths (for execVM and the like) in scripts seem to be absolute (from root dir).

#include paths in scripts/config seem to be relative rather than absolute. Sadly, since the pre-processor seems to not understand something like "..\my.cpp", you can be limited in what files you can #include (if the file that is #including is in a subdirectory).

Nothing like consistency, eh?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×