change a few global Lua variables to be local

Running StepMania with the command line argument of --ExportLuaInformation while the current 5.1's default theme (Lambda) was selected added some seemingly stray Lua variables to the Constants table in ./Docs/Luadoc/Lua.xml.

I spotted them here: http://dguzek.github.io/Lua-For-SM5/LuaAPI#Constants

I'm assuming num, bPreference, and bCategory don't need global scope, so I added the local keyword where appropriate.
This commit is contained in:
Dan Guzek
2019-12-09 19:45:57 -05:00
parent c5096d24de
commit 9666bb0ae2
3 changed files with 9 additions and 9 deletions
@@ -70,7 +70,7 @@ end
-- Parses a speed mod and returns the pair (type, number) or nil if parsing -- Parses a speed mod and returns the pair (type, number) or nil if parsing
-- failed. -- failed.
local function CanonicalizeMod(mod) local function CanonicalizeMod(mod)
num = tonumber(mod:match("^(%d+.?%d*)[xX]$")) local num = tonumber(mod:match("^(%d+.?%d*)[xX]$"))
if num ~= nil then if num ~= nil then
return "x", num return "x", num
end end
+3 -3
View File
@@ -12,11 +12,11 @@ local tNotePositions = {
} }
function GetTapPosition( sType ) function GetTapPosition( sType )
bCategory = (sType == 'Standard') and 1 or 2 local bCategory = (sType == 'Standard') and 1 or 2
-- true: Normal -- true: Normal
-- false: Lower -- false: Lower
bPreference = ThemePrefs.Get("NotePosition") and "Normal" or "Lower" local bPreference = ThemePrefs.Get("NotePosition") and "Normal" or "Lower"
tNotePos = tNotePositions[bPreference] local tNotePos = tNotePositions[bPreference]
return tNotePos[bCategory] return tNotePos[bCategory]
end end
+3 -3
View File
@@ -12,11 +12,11 @@ local tNotePositions = {
} }
function GetTapPosition( sType ) function GetTapPosition( sType )
bCategory = (sType == 'Standard') and 1 or 2 local bCategory = (sType == 'Standard') and 1 or 2
-- true: Normal -- true: Normal
-- false: Lower -- false: Lower
bPreference = ThemePrefs.Get("NotePosition") and "Normal" or "Lower" local bPreference = ThemePrefs.Get("NotePosition") and "Normal" or "Lower"
tNotePos = tNotePositions[bPreference] local tNotePos = tNotePositions[bPreference]
return tNotePos[bCategory] return tNotePos[bCategory]
end end