fork/m-overlay
git clone https://git.julia.blue/fork/m-overlay
650c9b1
gui
1love . filesystem . setRequirePath ( "?.lua;?/init.lua;modules/?.lua;modules/?/init.lua" ) 2 3require ( "errorhandler" ) 4 5require ( "extensions.love" ) 6require ( "util.color" ) 7 8local watcher =require ( "memory.watcher" ) 9local gui =require ( "gui" ) 10local icons =require ( "smash.icons" ) 11 12local graphics =love . graphics 13 14function love . load () 15graphics . setBackgroundColor ( 0 , 0 , 0 , 0 ) -- Transparent background for OBS 16love . window . setTitle ( "M'Overlay - Waiting for Dolphin.exe" ) 17 18gui . init () 19watcher . init () 20icons . init () 21 22local display =gui . createScenePanel ( "ControllerDisplay" ) 23display : SetPort ( 1 ) 24 25--[[local test = gui.createScenePanel("Label") 26test:SetFont("fonts/A-OTF-FolkPro-Heavy.otf") 27test:SetBGColor(color_white) 28test:SetText("THIS IS A TEST OVERLAY ELEMENT") 29test:SizeToText()]] 30 31--local test = gui.createScenePanel("PlayerPercent") 32--test:SetPort(1) 33 34local map =gui . createScenePanel ( "MiniMap" ) 35 36local test =gui . createScenePanel ( "KillFeed" ) 37 38--[[local test = gui.createScenePanel("PlayerPercent") 39test:SetPort(2) 40test:SetSize(200, 128)]] 41 42--gui.saveSceneLayout() 43 44--gui.loadConfig(gui.getDefaultConfig()) 45end 46 47function love . update ( dt ) 48gui . tick ( dt ) 49watcher . update ( "Dolphin.exe" ) -- Look for Dolphin.exe 50end 51 52function love . resize ( w , h ) 53gui . resize ( w , h ) 54end 55 56function love . joystickpressed ( joy , but ) 57gui . joyPressed ( joy , but ) 58end 59 60function love . joystickreleased ( joy , but ) 61gui . joyReleased ( joy , but ) 62end 63 64function love . keypressed ( key , scancode , isrepeat ) 65gui . keyPressed ( key , scancode , isrepeat ) 66end 67 68function love . keyreleased ( key ) 69gui . keyReleased ( key ) 70end 71 72function love . textinput ( text ) 73gui . textInput ( text ) 74end 75 76function love . mousemoved ( x , y , dx , dy , istouch ) 77gui . mouseMoved ( x , y , dx , dy , istouch ) 78end 79 80function love . mousepressed ( x , y , button , istouch , presses ) 81gui . mousePressed ( x , y , button , istouch , presses ) 82end 83 84function love . mousereleased ( x , y , button , istouch , presses ) 85gui . mouseReleased ( x , y , button , istouch , presses ) 86end 87 88function love . wheelmoved ( x , y ) 89gui . mouseWheeled ( x , y ) 90end 91 92function love . draw () 93gui . render () 94end 95 96function love . quit () 97gui . shutdown () 98end 99 100local FPS_LIMIT =60 101 102function love . run () 103if love . load then love . load ( love . arg . parseGameArguments ( arg ), arg ) end 104 105-- We don't want the first frame's dt to include time taken by love.load. 106if love . timer then love . timer . step () end 107 108local dt =0 109 110-- Main loop time. 111return function () 112local frame_start =love . timer . getTime () 113 114-- Process events. 115if love . event then 116love . event . pump () 117for name , a , b , c , d , e , f in love . event . poll () do 118if name == "quit" then 119if not love . quit or not love . quit () then 120return a or 0 121end 122end 123love . handlers [ name ]( a , b , c , d , e , f ) 124end 125end 126 127-- Update dt, as we'll be passing it to update 128if love . timer then dt =love . timer . step () end 129 130-- Call update and draw 131if love . update then love . update ( dt ) end -- will pass 0 if love.timer is disabled 132 133if love . graphics and love . graphics . isActive () then 134love . graphics . origin () 135love . graphics . clear ( love . graphics . getBackgroundColor ()) 136 137if love . draw then love . draw () end 138 139love . graphics . present () 140end 141 142if love . timer then 143local frame_time =love . timer . getTime () - frame_start 144love . timer . sleep ( 1 / FPS_LIMIT - frame_time ) 145end 146end 147end