Skip to content

Commit 8c6f0c3

Browse files
committed
Remove "Slippi netplay" mode and auto detect if we are in netplay mode based on the changed gameid
Renamed "Slippi replay" to "Replay/Mirror" to be more clear on what the setting actually does
1 parent 8cc4785 commit 8c6f0c3

File tree

3 files changed

+8
-31
lines changed

3 files changed

+8
-31
lines changed

source/main.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ function love.load(args, unfilteredArg)
7878
end
7979

8080
memory.hook("slippi.player.*.name", "Slippi Auto Port Switcher", function(port, name)
81-
if PANEL_SETTINGS:IsSlippiNetplay() and PANEL_SETTINGS:IsSlippiAutoPortEnabled() then
81+
if memory.IsSlippiNetplay() and PANEL_SETTINGS:IsSlippiAutoPortEnabled() then
8282
if PANEL_SETTINGS:GetSlippiUsername() == melee.convertStr(name) then
8383
PORT = port - 1
8484
CONTROLLER_PORT_DISPLAY = love.timer.getTime() + 1.5 -- Show the port display number for 3 seconds
@@ -87,7 +87,7 @@ memory.hook("slippi.player.*.name", "Slippi Auto Port Switcher", function(port,
8787
end)
8888

8989
memory.hook("menu", "Slippi Auto Port Switcher", function(menu)
90-
if PANEL_SETTINGS:IsSlippiNetplay() and PANEL_SETTINGS:IsSlippiAutoPortEnabled() and menu ~= 2 then
90+
if memory.IsSlippiNetplay() and PANEL_SETTINGS:IsSlippiAutoPortEnabled() and menu ~= 2 then
9191
-- Switch back to port 1 when leaving a game of melee (In netplay only)
9292
PORT = 0
9393
end

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

+1-17
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,10 @@ function PANEL:Initialize()
3333
self.m_pRLABEL:Dock(DOCK_TOP)
3434

3535
self.m_pSLIPPIREPLAY = self.m_pRIGHT:Add("Checkbox")
36-
self.m_pSLIPPIREPLAY:SetText("Slippi Replay")
36+
self.m_pSLIPPIREPLAY:SetText("Replay/Mirror")
3737
self.m_pSLIPPIREPLAY:Dock(DOCK_TOP)
3838

39-
self.m_pSLIPPI = self.m_pRIGHT:Add("Checkbox")
40-
self.m_pSLIPPI:SetText("Slippi Netplay")
41-
self.m_pSLIPPI:Dock(DOCK_TOP)
42-
43-
function self.m_pSLIPPI:OnToggle(on)
44-
self:GetParent():GetParent().m_pAUTOPORT:SetEnabled(on)
45-
self:GetParent():GetParent().m_pSLIPPINAME:SetEnabled(on)
46-
end
47-
4839
self.m_pAUTOPORT = self.m_pRIGHT:Add("Checkbox")
49-
self.m_pAUTOPORT:SetEnabled(false)
5040
self.m_pAUTOPORT:SetText("Detect port")
5141
self.m_pAUTOPORT:Dock(DOCK_TOP)
5242

@@ -110,7 +100,6 @@ end
110100
function PANEL:GetSaveTable()
111101
return {
112102
["slippi-replay"] = self:IsSlippiReplay(),
113-
["slippi-netplay"] = self:IsSlippiNetplay(),
114103
["slippi-auto-detect-port"] = self:IsSlippiAutoPortEnabled(),
115104
["slippi-username"] = self:GetSlippiUsername(),
116105
["port-in-title"] = self:IsPortTitleEnabled(),
@@ -125,10 +114,6 @@ function PANEL:IsSlippiReplay()
125114
return self.m_pSLIPPIREPLAY:IsToggled()
126115
end
127116

128-
function PANEL:IsSlippiNetplay()
129-
return self.m_pSLIPPI:IsToggled()
130-
end
131-
132117
function PANEL:IsSlippiAutoPortEnabled()
133118
return self.m_pAUTOPORT:IsToggled()
134119
end
@@ -176,7 +161,6 @@ function PANEL:LoadSettings()
176161
local settings = json.decode(f:read())
177162
f:close()
178163
self.m_pSLIPPIREPLAY:SetToggle(settings["slippi-replay"] or false)
179-
self.m_pSLIPPI:SetToggle(settings["slippi-netplay"] or false)
180164
self.m_pAUTOPORT:SetToggle(settings["slippi-auto-detect-port"] or false)
181165
self.m_pSLIPPINAME:SetText(settings["slippi-username"] or "")
182166
self.m_pPORTTITLE:SetToggle(settings["port-in-title"] or false)

source/modules/memory/init.lua

+5-12
Original file line numberDiff line numberDiff line change
@@ -280,29 +280,22 @@ end
280280
function watcher.isMelee()
281281
local gid = watcher.readGameID()
282282

283-
-- Force the GAMEID and VERSION to be Melee 1.02, since Fizzi seems to be using the gameid address space for something..
284-
if PANEL_SETTINGS:IsSlippiNetplay() then
285-
gid = "GALE01"
286-
version = 0x02
287-
end
288-
289283
local clone = clones[gid]
290284
if clone then gid = clone.id end
291285

292286
return gid == "GALE01"
293287
end
294288

289+
function watcher.IsSlippiNetplay()
290+
local gid = watcher.readGameID()
291+
return gid == string.char(0x47, 0x41, 0x02, 0x21, 0x21, 0x31)
292+
end
293+
295294
function watcher.checkmemoryvalues()
296295
local frame = watcher.frame or 0
297296
local gid = watcher.readGameID()
298297
local version = watcher.readGameVersion()
299298

300-
-- Force the GAMEID and VERSION to be Melee 1.02, since Fizzi seems to be using the gameid address space for something..
301-
if PANEL_SETTINGS:IsSlippiNetplay() then
302-
gid = "GALE01"
303-
version = 0x02
304-
end
305-
306299
if watcher.gameid ~= gid or watcher.version ~= version then
307300
watcher.reset()
308301
watcher.gameid = gid

0 commit comments

Comments
 (0)