super lua update

This commit is contained in:
AJ Kelly
2011-08-20 20:17:00 -05:00
parent 0d483d1781
commit 5cdcba047d
8 changed files with 40 additions and 65 deletions
+19 -2
View File
@@ -197,6 +197,24 @@ function Actor:bezier(...)
self:tween(a[2], "TweenMode_Bezier", b)
end
-- formerly in 02 HelpDisplay.lua, although nothing uses it:
function HelpDisplay:setfromsongorcourse()
local Artists = {}
local AltArtists = {}
local Song = GAMESTATE:GetCurrentSong()
local Trail = GAMESTATE:GetCurrentTrail( GAMESTATE:GetMasterPlayerNumber() )
if Song then
table.insert( Artists, Song:GetDisplayArtist() )
table.insert( AltArtists, Song:GetTranslitArtist() )
elseif Trail then
Artists, AltArtists = Trail:GetArtists()
end
self:settips( Artists, AltArtists )
end
-- (c) 2006 Glenn Maynard
-- All rights reserved.
--
@@ -218,5 +236,4 @@ end
-- OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
-- OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-- PERFORMANCE OF THIS SOFTWARE.
-- PERFORMANCE OF THIS SOFTWARE.
+3 -4
View File
@@ -6,10 +6,9 @@ function Enum:Compare( e1, e2 )
assert( Value1, tostring(e1) .. " is not an enum of type " .. self:GetName() )
assert( Value2, tostring(e2) .. " is not an enum of type " .. self:GetName() )
-- Nil enums correspond to "invalid". These compare greater
-- than any valid enum value, to line up with the equivalent
-- C++ code.
-- Nil enums correspond to "invalid". These compare greater than any valid
-- enum value, to line up with the equivalent C++ code.
-- should this be changed to math.huge()? -shake
if not e1 then
Value1 = 99999999
@@ -1,39 +0,0 @@
function HelpDisplay:setfromsongorcourse()
local Artists = {}
local AltArtists = {}
local Song = GAMESTATE:GetCurrentSong()
local Trail = GAMESTATE:GetCurrentTrail( GAMESTATE:GetMasterPlayerNumber() )
if Song then
table.insert( Artists, Song:GetDisplayArtist() )
table.insert( AltArtists, Song:GetTranslitArtist() )
elseif Trail then
Artists, AltArtists = Trail:GetArtists()
end
self:settips( Artists, AltArtists )
end
-- (c) 2006 Glenn Maynard
-- All rights reserved.
--
-- Permission is hereby granted, free of charge, to any person obtaining a
-- copy of this software and associated documentation files (the
-- "Software"), to deal in the Software without restriction, including
-- without limitation the rights to use, copy, modify, merge, publish,
-- distribute, and/or sell copies of the Software, and to permit persons to
-- whom the Software is furnished to do so, provided that the above
-- copyright notice(s) and this permission notice appear in all copies of
-- the Software and that both the above copyright notice(s) and this
-- permission notice appear in supporting documentation.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
-- THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
-- INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
-- OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
-- OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-- PERFORMANCE OF THIS SOFTWARE.
@@ -62,6 +62,7 @@ OptionRowTable =
end
}
-- ScreenJukeboxMenu RandomOptions item
function OptionsRandomJukebox()
local function AllChoices()
Trace('all choices')
+4 -4
View File
@@ -1,6 +1,7 @@
local g_metrics_group = nil;
local g_element = nil;
-- legacy:
SSC = (ProductID() == "sm-ssc");
function LoadFallbackB()
@@ -93,7 +94,7 @@ end
function GetCoursesToShowRanking()
local CoursesToShowRanking = PREFSMAN:GetPreference("CoursesToShowRanking")
if CoursesToShowRanking ~= "" then return CoursesToShowRanking end
return "Courses/Default/MostPlayed_01-04.crs,Courses/Default/MostPlayed_05-08.crs,Courses/Default/MostPlayed_09-12.crs"
return "Courses/Default/MostPlayed_01-04.crs,Courses/Default/ChallengingRandom5.crs,Courses/Default/Jupiter.crs"
end
-- Get a metric from the currently-loading screen. This is only valid while loading
@@ -118,13 +119,13 @@ function TextBannerAfterSet(self,param)
Title:maxwidth(208)
Title:y(0)
Title:zoom(1)
Subtitle:visible(false)
else
Title:zoom(1)
Title:y(-6)
Title:zoom(0.9)
-- subtitle below title
Subtitle:visible(true)
Subtitle:zoom(0.6)
@@ -154,4 +155,3 @@ end
-- OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-- PERFORMANCE OF THIS SOFTWARE.
+4 -4
View File
@@ -4,9 +4,9 @@ function Serialize(t)
local queue = { }
local already_queued = { }
-- Convert a value to an identifier. If we encounter a table that we've never seen before,
-- it's an anonymous table and we'll create a name for it; for example, in t = { [ {10} ] = 1 },
-- "{10}" has no name.
-- Convert a value to an identifier. If we encounter a table that we've
-- never seen before, it's an anonymous table and we'll create a name for it;
-- for example, in t = { [ {10} ] = 1 }, "{10}" has no name.
local next_id = 1
local function convert_to_identifier( v, name )
-- print("convert_to_identifier: " .. (name or "nil"))
@@ -24,7 +24,7 @@ function Serialize(t)
return already_queued[v]
end
-- Create the table. If we have no name, give it one; be sure to make it local.
-- Create the table. If we have no name, give it one; be sure to make it local.
if not name then
name = "tab" .. next_id
next_id = next_id + 1
+1
View File
@@ -1,4 +1,5 @@
-- Can this be moved into some other file? Feels like clutter. -shake
-- Play the sound on the given player's side. Must set SupportPan = true
-- on load.
function ActorSound:playforplayer(pn)
+8 -12
View File
@@ -1,21 +1,18 @@
function AreStagePlayerModsForced()
local bExtraStage = GAMESTATE:IsAnExtraStage()
local bOni = GAMESTATE:GetPlayMode() == "PlayMode_Oni"
return bExtraStage or bOni
return GAMESTATE:IsAnExtraStage() or (GAMESTATE:GetPlayMode() == "PlayMode_Oni")
end
function AreStageSongModsForced()
local bExtraStage = GAMESTATE:IsAnExtraStage()
local pm = GAMESTATE:GetPlayMode()
local bOni = pm == "PlayMode_Oni"
local bBattle = pm == "PlayMode_Battle"
local bRave = pm == "PlayMode_Rave"
return bExtraStage or bOni or bBattle or bRave
return GAMESTATE:IsAnExtraStage() or bOni or bBattle or bRave
end
function SetFail()
local sFail = ""
if GetGamePref("DefaultFail") then
sFail = string.format("Fail%s", GetGamePref("DefaultFail"))
else
@@ -23,11 +20,11 @@ function SetFail()
end
sFail = tostring(sFail)
for pn in ivalues(GAMESTATE:GetHumanPlayers()) do
MESSAGEMAN:Broadcast( "PlayerOptionsChanged", {PlayerNumber = pn} )
end
GAMESTATE:ApplyGameCommand( "mod," .. sFail)
MESSAGEMAN:Broadcast( "SongOptionsChanged" )
end
@@ -35,12 +32,12 @@ end
function ScreenSelectMusic:setupmusicstagemods()
Trace( "setupmusicstagemods" )
local pm = GAMESTATE:GetPlayMode()
if pm == "PlayMode_Battle" or pm == "PlayMode_Rave" then
local so = GAMESTATE:GetDefaultSongOptions()
GAMESTATE:SetSongOptions( "ModsLevel_Stage", so )
MESSAGEMAN:Broadcast( "SongOptionsChanged" )
elseif GAMESTATE:IsAnExtraStage() then
elseif GAMESTATE:IsAnExtraStage() then
if GAMESTATE:GetPreferredSongGroup() == "---Group All---" then
local song = GAMESTATE:GetCurrentSong()
GAMESTATE:SetPreferredSongGroup( song:GetGroupName() )
@@ -57,7 +54,7 @@ function ScreenSelectMusic:setupmusicstagemods()
po = THEME:GetMetric("SongManager","ExtraStagePlayerModifiers")
so = THEME:GetMetric("SongManager","ExtraStageStageModifiers")
end
local difficulty = steps:GetDifficulty()
local Reverse = PlayerNumber:Reverse()
@@ -96,7 +93,6 @@ function ScreenSelectMusic:setupcoursestagemods()
end
end
--
-- (c) 2006-2007 Steve Checkoway
-- All rights reserved.
--