Skip to content

Instantly share code, notes, and snippets.

@collinticer
Created July 9, 2020 05:22
Show Gist options
  • Save collinticer/87a7b69a06b3c6ca1bbe08a048df8f74 to your computer and use it in GitHub Desktop.
Save collinticer/87a7b69a06b3c6ca1bbe08a048df8f74 to your computer and use it in GitHub Desktop.
var instance = argument0;//instance should be a "standard_obj" with the objectProperties attribute
var textToAdd = argument1;//the text the new "new_dialog" obj should init
var typeOfDialog = argument2;//dialog type of click or delay. default to click
var delayTiming = argument3;//delay time in seconds if typeOfDialog is delay. default is 3 seconds
with( instance )
{
var tmpDialog = new_dialog();
ds_map_set( tmpDialog, "text", textToAdd );
ds_map_set( tmpDialog, "type", typeOfDialog );
ds_map_set( tmpDialog, "delay", delayTiming );
var tmpObjProps = instance.objectProperties;
var dialogsList = tmpObjProps[? "dialogs"];
ds_list_add( dialogsList, tmpDialog );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment