Jump to content
Sign in to follow this  
dealman

EDEN Editor Notification/Messages?

Recommended Posts

I'm currently working on a plugin for the EDEN editor and I'd like to notify the user whenever he uses my tools as it copies data to the clipboard. However, since hints and the like don't seem to work I can't seem to find a way to display a message whilst in the editor.

 

Does anyone know if this is possible?

 

Edit:

 

I went through the 3den.pbo and found fn_3DENShowMessage.sqf and looked through it. From what I can understand, the editor uses the display ID if 313 and the text display uses ID 101(found these in resincl.inc). So I went in blind and simply gave this a shot, which unsurprisingly crashes ArmA 3.

_parentDisplay = findDisplay 313;
_display = _parentDisplay createdisplay "display3DENMsgBox";
_ctrlText = _display displayctrl 101;
_ctrlText ctrlsetstructuredtext parsetext "Hello World";

I say unsurprisingly because quite frankly I have no clue what I'm doing, I've never really worked with the displays before. Any help would be greatly appreciated :D

Crashing was happening because I need to disable serialization, I'm still trying to figure out whether we can easily make our own notifications or not.

 

Edit2:

 

I managed to get the message box to work, however I am still clueless as to how to make use of the notifications. It would be nice if we could easily add our own messages/notifications via dedicated functions for example BIS_fnc_DisplayCustom3DENNotification or whatever. Or maybe this is already possible, I just don't know how to nor have found information about it.

 

I managed to find this bug report and I can now make use of the function without the game crashing. However, I can't seem to find a similar function for the notifications which would be utmost useful.

 

Result;
LynGdnc.png

 

Edit3:

 

So I found that there is a function I can spawn to display notifications with, BIS_fnc_3DENNotification. However it doesn't seem like you can enter a custom message, only choose one of the predefined ones. I'll see if I can re-write it to support custom messages, shouldn't be too hard. Shouldn't, then again this is ArmA :P

disableserialization;
[0] spawn BIS_fnc_3DENNotification;

For example will display the Scenario saved message.

 

Edit4:

I finally managed to sort it out. See this thread if you'd like to see the code I made.

o0fhzvG.png

Share this post


Link to post
Share on other sites

There is a way to add custom notifications, assuming you can afford to have "addon".

 

Use this class to add custom messages. (This will require to have config.cpp)

class Cfg3DEN {
 class Notifications {
  class myMessage_1 {
   text = "$STR_A3_my_error_message_in_stringtable";
   isWarning = 1; //Will display RED warning
  };
  class myMessage_2 {
   text = "$STR_A3_my_warning_message_in_stringtable";
   isWarning = 0; //Will display GREEN warning
  };
 };
};

And now you can call it with

_name = "myMessage_1"; //What notification class to take
_duration = 5; //How long to display
[_name,_duration] call BIS_fnc_3DENNotification;

Share this post


Link to post
Share on other sites

Cheers for that, unfortunately it only allows for 2 different kinds of messages(green or red, with 2 different sounds). But I already made a function where I can change everything, which is rather odd we can't normally do otherwise since it looks like it's written to be easily modified.

Share this post


Link to post
Share on other sites

The notification is intentionally prepared with two message styles - note and warning - in order to clearly indicate to user what kind of message is being displayed. I recommend to use the pre-defined style to avoid confusing the user. Yes, you could use pink text on lime background, but the fact that something is possible doesn't necessarily mean it's useful.

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  

×