Set paletteX callback

From Unofficial QEdit Wiki Guide
Revision as of 01:29, 15 May 2013 by Japanaman2 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Syntax

Syntax: set_paletteX_callback register1, function

  • register1 = Reserved register 250 players slot number.
  • function = Function to call.

Use

Used to define what function should be called when paletteX (or <- action palette) is activated and enabled.

Note: The function containing this op code is usually called from the floor handlers function.

Example


100:     get_slotnumber R250 //Stores the players slot number in register 250.
         call 101 //calls function 101.
         ret 
101:     set_paletteX_callback R250 105//When paletteX is activated and enabled player in slot register 250 will call function 105 when x button (or <- action palette) is pressed.
         ret 
102:     activate_paletteX R250 //Allows for x button (or <- action palette) to be changed to the call script function button.
         enable_paletteX R250 //Changes the x button (or <- action palette) to the call script function button.
         ret 
103:     disable_paletteX R250 //Removes the call script function button from x button (or <- action palette).
         restore_paletteX R250 //Restores x button (or <- action palette) to what the player has setup for the x button (or <- action palette).
         ret 
104:     call 102 //Calls function 102.(Function 104 would go on or be part of a forest console('s) function.)
         window_msg PaletteX has been swapped with<cr>the call function button<cr>and is ready to be pressed. //Displays a window message.
         winend  //Closes the window message.
         ret 
105:     call 103 //Calls function 103.
         window_msg paletteX (or <- action palette)<cr>has been pressed. //Displays a window message.
         winend  //Closes the window message.
         ret 

Also see

get_slotnumber, call, ret, set_paletteX_callback,

activate_paletteX, enable_paletteX, disable_paletteX,

restore_paletteX, window_msg, winend, reservedregisters