HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.

Author Topic: [Resolved] _closeWindow don't work  (Read 813 times)

Grogard

  • World Owners
  • ****
  • Posts: 36
    • View Profile
[Resolved] _closeWindow don't work
« on: Jan 07, 13, 09:17:36 AM »

Hello.

I have the modal window, that open from other window:
I have two buttons: Close and Logoff and I havethe next code:

Code: [Select]
public function Open() as NodeRef of Class GUIControl
// typically args["names"] will contain a list of character names to populate the control
//   additional information may be included depending on game specific implementations
//
// called from $CHARACTERSELECTIONSYSTEM._CSSInvokeGUI
  //$GUI._clearGUI()
  wndMainMenu as NodeRef of Class GUIControl = CreateNodeFromPrototype( "DMWndMainMenu" )
  wndMainMenu.build = true
  wndMainMenu.centerControlOver( 0 )
  wndMainMenu.createModalDialog(None)
 
  return wndMainMenu
.

//Button callback
method _OnButtonMouseClick(button as NodeRef of Class _GUIButton, args references Class GUIMouseEvent)
  when button.name
    is "btnReturnToGame"
      println("btnReturnToGame pressed")
      me._closeWindow()
    .
    is "btnExitGame"
      println("btnExitGame pressed")
      SendCommand("/exit")
    .
    default
      ScriptError( "Unknown button: " + button.name + "." )
    .
  .
.


But the "me._closeWindow()" and "SendCommand("/exit")" don't work. WHY?
« Last Edit: Nov 04, 13, 07:04:18 PM by HE-Cooper »
Logged

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Re: _closeWindow don't work
« Reply #1 on: Jan 07, 13, 10:26:07 AM »

I am not familiar with the closeWindow method, as I typically just use DestroyNode(me) to have a window close itself.  Also, for exiting the game, I believe there is an external function for that.  Look in the client _ExternalFunctions script.
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.

Thazager

  • General Accounts
  • *
  • Posts: 1149
  • Never stop learning
    • View Profile
    • Heroes and Villains MMORPG
Re: _closeWindow don't work
« Reply #2 on: Oct 05, 13, 03:45:57 PM »

Sorry for late post.

I believe I found how to exit for client. In _BaseClientClassMethods is a function that can be used.
called on client side with $BASECLIENT._Exit()

Code: [Select]
remote method _Exit()
  handled as Boolean 
  if hasMethod( me, "HE_Exit" )
    handled = me.HE_Exit()
  .
 
  // optional processing
  if not handled
   
  .
 
  CloseClient()
.

« Last Edit: Oct 05, 13, 03:49:19 PM by Thazager »
Logged