Skip to content

Commit

Permalink
sound notifications: tutorialmode fix (#4264)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruwetuin authored Feb 1, 2025
1 parent a84d7e6 commit 4461c7b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions luaui/Widgets/snd_notifications.lua
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ local isSpec = Spring.GetSpectatingState()
local isReplay = Spring.IsReplay()
local myTeamID = Spring.GetMyTeamID()
local myPlayerID = Spring.GetMyPlayerID()
local myAllyTeamID = Spring.GetMyAllyTeamID()
local myRank = select(9, Spring.GetPlayerInfo(myPlayerID))

local spGetTeamResources = Spring.GetTeamResources
Expand Down Expand Up @@ -310,7 +309,6 @@ function widget:PlayerChanged(playerID)
isSpec = Spring.GetSpectatingState()
myTeamID = Spring.GetMyTeamID()
myPlayerID = Spring.GetMyPlayerID()
myAllyTeamID = Spring.GetMyAllyTeamID()
doTutorialMode = (not isReplay and not isSpec and tutorialMode)
updateCommanders()
end
Expand All @@ -332,9 +330,7 @@ local function gadgetNotificationEvent(msg)
end

function widget:Initialize()
if isReplay or spGetGameFrame() > 0 then
widget:PlayerChanged()
end
widget:PlayerChanged()

widgetHandler:RegisterGlobal('NotificationEvent', gadgetNotificationEvent)

Expand Down Expand Up @@ -866,6 +862,7 @@ function widget:SetConfigData(data)
end
if data.tutorialMode ~= nil then
tutorialMode = data.tutorialMode
doTutorialMode = tutorialMode
end
if spGetGameFrame() > 0 then
if data.LastPlay then
Expand Down

0 comments on commit 4461c7b

Please sign in to comment.