Skip to content

Commit df9a7ea

Browse files
committed
Only use auto detect port when actually in the slippi online menu
1 parent bfc1f5f commit df9a7ea

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

source/main.lua

+7-5
Original file line numberDiff line numberDiff line change
@@ -111,20 +111,22 @@ function love.load(args, unfilteredArg)
111111
end
112112

113113
memory.hook("menu_minor", "Slippi Auto Port Switcher", function(menu)
114-
if PANEL_SETTINGS:IsSlippiNetplay() and PANEL_SETTINGS:IsSlippiAutoPortEnabled() then
115-
if menu == MENU_VS_CSS or menu == MENU_VS_STAGE_SELECT then
114+
-- MENU_VS_UNKNOWN = Slippi online
115+
if memory.menu_major == MENU_VS_UNKNOWN and PANEL_SETTINGS:IsSlippiNetplay() and PANEL_SETTINGS:IsSlippiAutoPortEnabled() then
116+
if menu == MENU_VS_UNKNOWN_CSS or menu == MENU_VS_UNKNOWN_SSS then
116117
-- Switch back to port 1 when not in a match
117118
PORT = 0
118119
log.debug("[AUTOPORT] Forcing port %d in menus", PORT)
119-
if menu ~= MENU_VS_STAGE_SELECT then
120+
if menu == MENU_VS_UNKNOWN_CSS then
121+
-- Display the port info only when swiching back to CSS
120122
CONTROLLER_PORT_DISPLAY = love.timer.getTime() + 1.5 -- Show the port display number for 1.5 seconds
121123
end
122-
elseif menu == MENU_VS_POSTGAME then
124+
elseif menu == MENU_VS_UNKNOWN_VERSUS then
123125
local port = memory.slippi.local_player.index % 4
124126
PORT_DISPLAY_OVERRIDE = port
125127
CONTROLLER_PORT_DISPLAY = love.timer.getTime() + 3 -- Show the port display number for 1.5 seconds
126128
log.debug("[AUTOPORT] Switching display icon to use port %d", PORT+1)
127-
elseif menu == MENU_VS_INGAME then
129+
elseif menu == MENU_VS_UNKNOWN_INGAME then
128130
-- Switch to the local player index whenever else
129131
PORT_DISPLAY_OVERRIDE = nil
130132
PORT = memory.slippi.local_player.index % 4

source/melee.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,11 @@ MENU_ALL_STAR_MODE = 0x05
190190
MENU_DEBUG = 0x06
191191
MENU_SOUND_TEST = 0x07
192192

193-
MENU_VS_UNKNOWN = 0x08 -- SLIPPI UNRANKED
193+
MENU_VS_UNKNOWN = 0x08 -- SLIPPI ONLINE
194194
MENU_VS_UNKNOWN_CSS = 0x00
195195
MENU_VS_UNKNOWN_SSS = 0x01
196196
MENU_VS_UNKNOWN_INGAME = 0x02
197-
MENU_VS_UNKNOWN_POSTGAME = 0x04
197+
MENU_VS_UNKNOWN_VERSUS = 0x04
198198

199199
MENU_UNKOWN_1 = 0x09
200200
MENU_CAMERA_MODE = 0x0A

0 commit comments

Comments
 (0)