Cleaned up ProductivityHelpers (move some stuff from ProductivityHelpers to compat, among other things)
This commit is contained in:
@@ -27,3 +27,17 @@ function GameState:GetSongBeatNoOffset() return self:GetSongPosition():GetSongBe
|
|||||||
function GameState:GetSongBPS() return self:GetSongPosition():GetCurBPS() end
|
function GameState:GetSongBPS() return self:GetSongPosition():GetCurBPS() end
|
||||||
function GameState:GetSongDelay() return self:GetSongPosition():GetDelay() end
|
function GameState:GetSongDelay() return self:GetSongPosition():GetDelay() end
|
||||||
function GameState:GetSongFreeze() return self:GetSongPosition():GetFreeze() end
|
function GameState:GetSongFreeze() return self:GetSongPosition():GetFreeze() end
|
||||||
|
|
||||||
|
--[[ 3.9 Conditionals ]]
|
||||||
|
Condition = {
|
||||||
|
Hour = function() return Hour() end,
|
||||||
|
IsDemonstration = function() return GAMESTATE:IsDemonstration() end,
|
||||||
|
CurSong = function(sSongName)
|
||||||
|
return GAMESTATE:GetCurrentSong():GetDisplayMainTitle() == sSongName
|
||||||
|
end,
|
||||||
|
DayOfMonth = function() return DayOfMonth() end,
|
||||||
|
MonthOfYear = function() return MonthOfYear() end,
|
||||||
|
UsingModifier = function(pnPlayer, sModifier)
|
||||||
|
return GAMESTATE:PlayerIsUsingModifier( pnPlayer, sModifier );
|
||||||
|
end,
|
||||||
|
}
|
||||||
@@ -1,17 +1,15 @@
|
|||||||
-- ProductivityHelpers: A set of useful aliases for theming.
|
-- ProductivityHelpers: A set of useful aliases for theming.
|
||||||
-- This is the sm-ssc version. You should not be using this in themes for
|
|
||||||
-- SM4 right now... We'll post an updated version soon.
|
|
||||||
|
|
||||||
--[[ Globals ]]
|
--[[ Globals ]]
|
||||||
function IsArcade()
|
function IsArcade()
|
||||||
local sPayMode = GAMESTATE:GetCoinMode();
|
local sCoinMode = GAMESTATE:GetCoinMode();
|
||||||
local bIsArcade = (sPayMode ~= 'CoinMode_Home');
|
local bIsArcade = (sCoinMode ~= 'CoinMode_Home');
|
||||||
return bIsArcade;
|
return bIsArcade;
|
||||||
end
|
end
|
||||||
|
|
||||||
function IsHome()
|
function IsHome()
|
||||||
local sPayMode = GAMESTATE:GetCoinMode();
|
local sCoinMode = GAMESTATE:GetCoinMode();
|
||||||
local bIsHome = (sPayMode == 'CoinMode_Home');
|
local bIsHome = (sCoinMode == 'CoinMode_Home');
|
||||||
return bIsHome;
|
return bIsHome;
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -24,45 +22,19 @@ function IsFreePlay()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function Center1Player()
|
function Center1Player()
|
||||||
if GAMESTATE:GetCurrentStyle():GetStyleType() == "StyleType_OnePlayerTwoSides" then
|
local styleType = GAMESTATE:GetCurrentStyle():GetStyleType()
|
||||||
|
-- always center in OnePlayerTwoSides.
|
||||||
|
if styleType == "StyleType_OnePlayerTwoSides" then
|
||||||
return true
|
return true
|
||||||
|
-- only Center1P if Pref enabled and OnePlayerOneSide.
|
||||||
|
-- (implicitly excludes Rave, Battle, Versus, Routine)
|
||||||
elseif PREFSMAN:GetPreference("Center1Player") then
|
elseif PREFSMAN:GetPreference("Center1Player") then
|
||||||
if GAMESTATE:GetCurrentStyle():GetStyleType() == "StyleType_OnePlayerOneSide" then
|
return styleType == "StyleType_OnePlayerOneSide"
|
||||||
return true
|
|
||||||
else
|
else
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
else
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
--[[ return PREFSMAN:GetPreference("Center1Player") and
|
|
||||||
THEME:GetMetric("ScreenGameplay","AllowCenter1Player") and
|
|
||||||
not GAMESTATE:GetPlayMode("PlayMode_Battle") and
|
|
||||||
not GAMESTATE:GetPlayMode("PlayMode_Rave") and
|
|
||||||
GAMESTATE:GetCurrentStyle():GetStyleType() == "StyleType_OnePlayerOneSide"; --]]
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--[[ 3.9 Conditionals ]]
|
|
||||||
Condition = {
|
|
||||||
Hour = function()
|
|
||||||
return Hour()
|
|
||||||
end,
|
|
||||||
IsDemonstration = function()
|
|
||||||
return GAMESTATE:IsDemonstration()
|
|
||||||
end,
|
|
||||||
CurSong = function(sSongName)
|
|
||||||
return GAMESTATE:GetCurrentSong():GetDisplayMainTitle() == sSongName
|
|
||||||
end,
|
|
||||||
DayOfMonth = function()
|
|
||||||
return DayOfMonth()
|
|
||||||
end,
|
|
||||||
MonthOfYear = function()
|
|
||||||
return MonthOfYear()
|
|
||||||
end,
|
|
||||||
UsingModifier = function(pnPlayer, sModifier)
|
|
||||||
return GAMESTATE:PlayerIsUsingModifier( pnPlayer, sModifier );
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
--[[ 3.9 Functions ]]
|
--[[ 3.9 Functions ]]
|
||||||
Game = {
|
Game = {
|
||||||
GetStage = function()
|
GetStage = function()
|
||||||
@@ -76,11 +48,31 @@ Game = {
|
|||||||
Blend = {
|
Blend = {
|
||||||
Normal = 'BlendMode_Normal',
|
Normal = 'BlendMode_Normal',
|
||||||
Add = 'BlendMode_Add',
|
Add = 'BlendMode_Add',
|
||||||
|
Subtract = 'BlendMode_Subtract',
|
||||||
Modulate = 'BlendMode_Modulate',
|
Modulate = 'BlendMode_Modulate',
|
||||||
|
CopySource = 'BlendMode_CopySrc',
|
||||||
|
AlphaMask = 'BlendMode_AlphaMask',
|
||||||
|
AlphaKnockout = 'BlendMode_AlphaKnockout',
|
||||||
|
AlphaMultiply = 'BlendMode_AlphaMultiply',
|
||||||
Multiply = 'BlendMode_WeightedMultiply',
|
Multiply = 'BlendMode_WeightedMultiply',
|
||||||
Invert = 'BlendMode_InvertDest',
|
Invert = 'BlendMode_InvertDest',
|
||||||
NoEffect = 'BlendMode_NoEffect',
|
NoEffect = 'BlendMode_NoEffect',
|
||||||
}
|
}
|
||||||
|
function StringToBlend(s) return Blend[s] or nil end
|
||||||
|
|
||||||
|
-- EffectMode
|
||||||
|
-- Aliases for EffectMode (aka shaders)
|
||||||
|
EffectMode = {
|
||||||
|
Normal = 'EffectMode_Normal',
|
||||||
|
Unpremultiply = 'EffectMode_Unpremultiply',
|
||||||
|
ColorBurn = 'EffectMode_ColorBurn',
|
||||||
|
ColorDodge = 'EffectMode_ColorDodge',
|
||||||
|
VividLight = 'EffectMode_VividLight',
|
||||||
|
HardMix = 'EffectMode_HardMix',
|
||||||
|
Overlay = 'EffectMode_Overlay',
|
||||||
|
Screen = 'EffectMode_Screen',
|
||||||
|
YUYV422 = 'EffectMode_YUYV422',
|
||||||
|
}
|
||||||
|
|
||||||
-- Health Declarations
|
-- Health Declarations
|
||||||
-- Used primarily for lifebars.
|
-- Used primarily for lifebars.
|
||||||
@@ -260,9 +252,7 @@ function tobool(v)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function pname(pn)
|
function pname(pn) return ToEnumShortString(pn) end
|
||||||
return ToEnumShortString(pn)
|
|
||||||
end
|
|
||||||
|
|
||||||
function math.round(num, pre)
|
function math.round(num, pre)
|
||||||
if pre and pre < 0 then pre = 0 end
|
if pre and pre < 0 then pre = 0 end
|
||||||
|
|||||||
@@ -3090,8 +3090,6 @@ OutTransitionLength=5
|
|||||||
CourseTransitionLength=0.5
|
CourseTransitionLength=0.5
|
||||||
BeginFailedDelay=1.0
|
BeginFailedDelay=1.0
|
||||||
#
|
#
|
||||||
AllowCenter1Player=true
|
|
||||||
#
|
|
||||||
PlayerP1OnePlayerOneSideX=math.floor(scale((0.85/3),0,1,SCREEN_LEFT,SCREEN_RIGHT))
|
PlayerP1OnePlayerOneSideX=math.floor(scale((0.85/3),0,1,SCREEN_LEFT,SCREEN_RIGHT))
|
||||||
PlayerP2OnePlayerOneSideX=math.floor(scale((2.15/3),0,1,SCREEN_LEFT,SCREEN_RIGHT))
|
PlayerP2OnePlayerOneSideX=math.floor(scale((2.15/3),0,1,SCREEN_LEFT,SCREEN_RIGHT))
|
||||||
PlayerP1TwoPlayersTwoSidesX=math.floor(scale((0.85/3),0,1,SCREEN_LEFT,SCREEN_RIGHT))
|
PlayerP1TwoPlayersTwoSidesX=math.floor(scale((0.85/3),0,1,SCREEN_LEFT,SCREEN_RIGHT))
|
||||||
@@ -3885,7 +3883,7 @@ PrevScreen="ScreenOptionsExtended"
|
|||||||
NextScreen="ScreenOptionsExtended"
|
NextScreen="ScreenOptionsExtended"
|
||||||
PlayerType="PlayerSyncMachine"
|
PlayerType="PlayerSyncMachine"
|
||||||
|
|
||||||
AllowCenter1Player=false
|
#AllowCenter1Player=false
|
||||||
SyncInfoOnCommand=x,PositionPerPlayer(GAMESTATE:GetMasterPlayerNumber(),SCREEN_CENTER_X+160,SCREEN_CENTER_X-160);y,SCREEN_CENTER_Y;zoom,0;decelerate,0.5;zoom,0.6
|
SyncInfoOnCommand=x,PositionPerPlayer(GAMESTATE:GetMasterPlayerNumber(),SCREEN_CENTER_X+160,SCREEN_CENTER_X-160);y,SCREEN_CENTER_Y;zoom,0;decelerate,0.5;zoom,0.6
|
||||||
|
|
||||||
# hidden by default:
|
# hidden by default:
|
||||||
|
|||||||
Reference in New Issue
Block a user