Difference between revisions of "Set paletteX callback"
From Unofficial QEdit Wiki Guide
Japanaman2 (Talk | contribs) |
Japanaman2 (Talk | contribs) |
||
Line 15: | Line 15: | ||
<span style='color:blue'>100: </span><span style='color:green'>get_slotnumber </span>R250 <span style='color:orange'>//Stores the players slot number in register 250.</span> | <span style='color:blue'>100: </span><span style='color:green'>get_slotnumber </span>R250 <span style='color:orange'>//Stores the players slot number in register 250.</span> | ||
<span style='color:green'> call </span>101 <span style='color:orange'>//Calls function 101.</span> | <span style='color:green'> call </span>101 <span style='color:orange'>//Calls function 101.</span> | ||
+ | <span style='color:green'> thread_stg </span>106 <span style='color:orange'>//Threads function 106 until the player leaves the current floor.</span> | ||
<span style='color:green'> ret </span> | <span style='color:green'> ret </span> | ||
<span style='color:blue'>101: </span><span style='color:red'>set_paletteX_callback </span>R250, 105 <span style='color:orange'>//When paletteX is activated and enabled player in slot register 250 will call function 105 when x button (or <- action palette) is pressed.</span> | <span style='color:blue'>101: </span><span style='color:red'>set_paletteX_callback </span>R250, 105 <span style='color:orange'>//When paletteX is activated and enabled player in slot register 250 will call function 105 when x button (or <- action palette) is pressed.</span> | ||
Line 32: | Line 33: | ||
<span style='color:green'> winend </span> <span style='color:orange'>//Closes the window message.</span> | <span style='color:green'> winend </span> <span style='color:orange'>//Closes the window message.</span> | ||
<span style='color:green'> ret </span> | <span style='color:green'> ret </span> | ||
+ | <span style='color:blue'>106: </span><span style='color:green'>sync </span> <span style='color:orange'>//Waits 1 frame.</span> | ||
+ | <span style='color:red'> get_paletteX_activated </span>R250, R1 <span style='color:orange'>//Makes register 1 equal 00000000 if paletteX (or <- action palette) is not ready to be pressed. Makes register 1 equal 00000001 if paletteX (or <- action palette) is ready to be pressed.</span> | ||
+ | <span style='color:green'> jmp </span>106 <span style='color:orange'>//Jumps to function 106.</span> | ||
</span> | </span> | ||
==Also see== | ==Also see== | ||
− | [[get_slotnumber]], [[call]], [[ret]], [[ | + | [[get_slotnumber]], [[call]], [[ret]], [[thread_stg]], |
− | [[ | + | [[set_paletteX_callback]], [[activate_paletteX]], [[enable_paletteX]], |
− | [[restore_paletteX]], [[window_msg]], [[winend]], [[reservedregisters]] | + | [[disable_paletteX]], [[restore_paletteX]], [[window_msg]], [[winend]], |
+ | |||
+ | [[sync]], [[get_paletteX_activated]], [[jmp]], [[reservedregisters]] |
Revision as of 03:07, 15 May 2013
Contents
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, enabled, and pressed.
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.
thread_stg 106 //Threads function 106 until the player leaves the current floor.
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
106: sync //Waits 1 frame.
get_paletteX_activated R250, R1 //Makes register 1 equal 00000000 if paletteX (or <- action palette) is not ready to be pressed. Makes register 1 equal 00000001 if paletteX (or <- action palette) is ready to be pressed.
jmp 106 //Jumps to function 106.
Also see
get_slotnumber, call, ret, thread_stg,
set_paletteX_callback, activate_paletteX, enable_paletteX,