Jump to content
RealModScene
Sign in to follow this  
saywaking

[Bugfix][Script] Too fast Gizmo "runs" lead to crash

Recommended Posts

Apparently, too fast Gizmo invokes lead to crash.

function main()
  cmd = gizmo.run(table);
  if cmd.Result == "refresh" then
    main();
  end
end

I can workaround this, when i put wait(500) before the recursion.

But it would be better, if there is a Queue-System for Gizmo-Scenes.

Edit: Also, Script.ShowMessageBox() in Gizmo Scenes is not possible.

  • Like 1

Share this post


Link to post
Share on other sites

I'll look into a solution for running (2) gizmo scenes too fast.   For the message box, the gizmo object has a special message box function that should be used when in a gizmo.  Infact, this applies to keyboard and passcode as well.

static const luaL_Reg l_gizmoMethods[] = {
	// Methods added in 0.6b
	{ "RegisterCallback",			l_gizmoRegisterCallback },
	{ "RegisterAnimationCallback",	l_gizmoRegisterAnimationCallback },
	{ "Dismiss",					l_gizmoDismiss },
	{ "SetXLScene",					l_gizmoSetXLScene },
	{ "SetCommandText",				l_gizmoSetCommandText },
	{ "SetCommandEnabled",			l_gizmoSetCommandEnabled },
	{ "InvokeUI",					l_gizmoInvokeUI },
	{ "RegisterControl",			l_gizmoRegisterControl },
	{ "SetTimer",					l_gizmoSetTimer },
	{ "KillTimer",					l_gizmoKillTimer },
	{ "PlayTimeline",				l_gizmoPlayTimeline },
	{ "ShowKeyboard",				l_gizmoShowKeyboard },
	{ "ShowMessagebox",				l_gizmoShowMessagebox },
	{ "ShowPasscode",				l_gizmoShowPasscode },
	{ "Notify",						l_gizmoNotify },
	// Methods added in 0.7b
	{ "SetXLScene",					l_gizmoSetXLScene },
	{ nullptr,						nullptr }
};

 

Share this post


Link to post
Share on other sites

I see, that's why i got nil. I listed here, that it was not working.

There is 

Script.ShowMessageBox() and

userdata:ShowMessagebox()

In the Readme, there is userdata:ShowMessageBox()

:D

edit: it appears, that gizmo:ShowMessagebox() needs 4 arguments, and the first one must be a number.

In that method-list, i also see "Notify", which is not listed in the Readme (correctly). Well i decided to use Script.ShowNotification() and no MessageBox for that Temperature Manager Script.

Also SetXLScene is nice to see. I hope it's full screen xD

  • Like 1

Share this post


Link to post
Share on other sites
2 hours ago, saywaking said:

edit: it appears, that gizmo:ShowMessagebox() needs 4 arguments, and the first one must be a number.

The first argument is an arbitrary identifier number.   This number is supplied back to you in the OnMessageBoxReturn callback so you can tell which message box was closed in the event you have more than one message box to detect responses from.

Share this post


Link to post
Share on other sites

Another one:

When i work with timer and miliseconds, and close the Gizmo Scene, the console freezes.

"this:SetTimer(1, 1);"

I guess that's not a good idea.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...