fork/m-overlay
git clone https://git.julia.blue/fork/m-overlay
a7d6bcc
GUI
1local PANEL ={} 2 3local memory =require ( "memory.watcher" ) 4 5local BUTTONS ={ 6NONE =0x0000 , 7DPAD_LEFT =0x0001 , 8DPAD_RIGHT =0x0002 , 9DPAD_DOWN =0x0004 , 10DPAD_UP =0x0008 , 11Z =0x0010 , 12R =0x0020 , 13L =0x0040 , 14A =0x0100 , 15B =0x0200 , 16X =0x0400 , 17Y =0x0800 , 18START =0x1000 , 19} 20 21function PANEL : Initialize () 22self : super () 23 24self : MakeAccessor ( "Port" , "m_iPort" , 0 ) 25self : MakeAccessor ( "Button" , "m_sButton" , "NONE" ) 26end 27 28function PANEL : IsButtonPressed () 29local controller =memory . controller [ self . m_iPort ] 30local button =BUTTONS [ self . m_sButton : upper ()] 31 32if not button or not controller then return false end 33 34if controller . plugged ~= 0xFF and bit . band ( controller . buttons . pressed , button ) == button then 35return true 36end 37 38return false 39end 40 41gui . register ( "InputButton" , PANEL , "Panel" )