Skip to content

Commit ca121fc

Browse files
committed
Fixed not being able to change ports if a game is not detected
Started working on a "Slippi Netplay" mode to try and fix issue #10
1 parent 8d256a4 commit ca121fc

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

source/main.lua

+2-6
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ local newImage = graphics.newImage
1616
local PORT_FONT = graphics.newFont("fonts/melee-bold.otf", 42)
1717
local DEBUG_FONT = graphics.newFont("fonts/melee-bold.otf", 12)
1818

19-
local PANEL_SETTINGS
19+
--PANEL_SETTINGS
2020

2121
local MAX_PORTS = 4
2222
local PORT = 0
@@ -89,8 +89,6 @@ function love.keypressed(key, scancode, isrepeat)
8989

9090
gui.keyPressed(key, scancode, isrepeat)
9191

92-
if not watcher.isReady() then return end
93-
9492
local num = tonumber(key)
9593

9694
if not PANEL_SETTINGS:IsVisible() and num and num >= 1 and num <= 4 then
@@ -124,9 +122,7 @@ function love.wheelmoved(x, y)
124122
gui.mouseWheeled(x, y)
125123
return
126124
end
127-
128-
if not watcher.isReady() then return end
129-
125+
130126
if y > 0 then
131127
PORT = PORT - 1
132128
elseif y < 0 then

source/modules/gui/panels/core/settings.lua

+11-1
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@ function PANEL:Initialize()
77

88
self:SetTitle("Settings")
99
self:SetHideOnClose(true)
10-
self:SetSize(156, 160)
10+
self:SetSize(156, 188)
1111
self:Center()
1212

13+
self.m_pSLIPPI = self:Add("Checkbox")
14+
self.m_pSLIPPI:SetText("Slippi Netplay")
15+
self.m_pSLIPPI:Dock(DOCK_TOP)
16+
1317
self.m_pDPAD = self:Add("Checkbox")
1418
self.m_pDPAD:SetText("Hide D-PAD")
1519
self.m_pDPAD:Dock(DOCK_TOP)
@@ -50,12 +54,17 @@ end
5054

5155
function PANEL:GetSaveTable()
5256
return {
57+
["slippi-netplay"] = self:IsSlippiNetplay(),
5358
["hide-dpad"] = self:IsDPADHidden(),
5459
["debugging"] = self:IsDebugging(),
5560
["transparency"] = self:GetTransparency(),
5661
}
5762
end
5863

64+
function PANEL:IsSlippiNetplay()
65+
return self.m_pSLIPPI:IsToggled()
66+
end
67+
5968
function PANEL:IsDPADHidden()
6069
return self.m_pDPAD:IsToggled()
6170
end
@@ -82,6 +91,7 @@ function PANEL:LoadSettings()
8291
if f then
8392
local settings = json.decode(f:read())
8493
f:close()
94+
self.m_pSLIPPI:SetToggled(settings["slippi-netplay"] or false)
8595
self.m_pDPAD:SetToggled(settings["hide-dpad"] or false)
8696
self.m_pDEBUG:SetToggled(settings["debugging"] or false)
8797
self.m_pTRANSPARENCY:SetValue(settings["transparency"] or 100)

source/modules/memory/init.lua

+6
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,12 @@ function watcher.checkmemoryvalues()
277277
local gid = watcher.readGameID()
278278
local version = watcher.readGameVersion()
279279

280+
-- Force the GAMEID and VERSION to be Melee 1.02, since Fizzi seems to be using this address space for something..
281+
if PANEL_SETTINGS:IsSlippiNetplay() then
282+
gid = "GALE01"
283+
version = 0x02
284+
end
285+
280286
if watcher.gameid ~= gid or watcher.version ~= version then
281287
watcher.reset()
282288
watcher.gameid = gid

0 commit comments

Comments
 (0)