-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
function widget:GetInfo() | ||
return { | ||
name = "Mute Game Spec v1", | ||
desc = "Disables sound when you start spectating battle (you can enable with F6)", | ||
author = "[teh]decay aka [teh]undertaker aka [DoR]Saruman", | ||
date = "10 jan 2015", | ||
license = "The BSD License", | ||
layer = 0, | ||
version = 1, | ||
enabled = true -- loaded by default | ||
} | ||
end | ||
|
||
|
||
-- project page on github: https://github.com/SpringWidgets/mute-game-spec | ||
|
||
--Changelog | ||
-- v2 | ||
|
||
|
||
local spGetMyPlayerID = Spring.GetMyPlayerID | ||
local spGetPlayerInfo = Spring.GetPlayerInfo | ||
local spSendCommands = Spring.SendCommands | ||
|
||
function widget:Initialize() | ||
local playerID = spGetMyPlayerID() | ||
local _, _, spec, _, _, _, _, _ = spGetPlayerInfo(playerID) | ||
|
||
if ( spec == true ) then | ||
spSendCommands("mutesound") | ||
end | ||
|
||
widgetHandler:RemoveWidget() | ||
end |