Separate styles for players. Notefields positioned between margins. Edit mode works for kickbox.
This commit is contained in:
@@ -27,6 +27,55 @@ function GetExtraColorThreshold()
|
||||
return Modes[CurGameName()] or 10
|
||||
end
|
||||
|
||||
-- GameplayMargins exists to provide a layer of backwards compatibility for
|
||||
-- people using the X position metrics to set where the notefields are.
|
||||
-- This makes it somewhat complex.
|
||||
-- Rather than trying to understand how it works, you can simply do this:
|
||||
-- (example values in parentheses)
|
||||
-- 1. Decide how much space you want in the center between notefields. (80)
|
||||
-- 2. Decide how much space you want on each side. (40)
|
||||
-- 3. Write a simple function that just returns those numbers:
|
||||
-- function GameplayMargins() return 40, 80, 40 end
|
||||
-- Then the engine does the work of figuring out where each notefield should
|
||||
-- be centered.
|
||||
function GameplayMargins(enabled_players, styletype)
|
||||
local other= {[PLAYER_1]= PLAYER_2, [PLAYER_2]= PLAYER_1}
|
||||
local margins= {[PLAYER_1]= {40, 40}, [PLAYER_2]= {40, 40}}
|
||||
-- Use a fake style width because calculating the real style width throws off
|
||||
-- the code in the engine.
|
||||
local fake_style_width= 272
|
||||
-- Handle the case of a single player that is centered first because it's
|
||||
-- simpler.
|
||||
if Center1Player() then
|
||||
local pn= enabled_players[1]
|
||||
fake_style_width= 544
|
||||
local center= _screen.cx
|
||||
local left= center - (fake_style_width / 2)
|
||||
local right= _screen.w - center - (fake_style_width / 2)
|
||||
-- center margin width will be ignored.
|
||||
return left, 80, right
|
||||
end
|
||||
local half_screen= _screen.w / 2
|
||||
local left= {[PLAYER_1]= 0, [PLAYER_2]= half_screen}
|
||||
for i, pn in ipairs(enabled_players) do
|
||||
local edge= left[pn]
|
||||
local center= THEME:GetMetric("ScreenGameplay",
|
||||
"Player"..ToEnumShortString(pn)..ToEnumShortString(styletype).."X")
|
||||
-- Adjust for the p2 center being on the right side.
|
||||
center= center - edge
|
||||
margins[pn][1]= center - (fake_style_width / 2)
|
||||
margins[pn][2]= half_screen - center - (fake_style_width / 2)
|
||||
if #enabled_players == 1 then
|
||||
margins[other[pn]][1]= margins[pn][2]
|
||||
margins[other[pn]][2]= margins[pn][1]
|
||||
end
|
||||
end
|
||||
local left= margins[PLAYER_1][1]
|
||||
local center= margins[PLAYER_1][2] + margins[PLAYER_2][1]
|
||||
local right= margins[PLAYER_2][2]
|
||||
return left, center, right
|
||||
end
|
||||
|
||||
-- AllowOptionsMenu()
|
||||
-- [en] returns if you are able to select options
|
||||
-- on ScreenSelectMusic.
|
||||
|
||||
@@ -1130,7 +1130,7 @@ AttackDisplayXOffsetOneSideP2=0
|
||||
AttackDisplayXOffsetBothSides=0
|
||||
AttackDisplayY=-70
|
||||
AttackDisplayYReverse=70
|
||||
; HACK: These shouldn't go to the render pipe at all if IsGame("pump")
|
||||
# HACK: These shouldn't go to the render pipe at all if IsGame("pump")
|
||||
HoldJudgmentYStandard=IsGame("pump") and -99999 or -90
|
||||
HoldJudgmentYReverse=IsGame("pump") and -99999 or 90
|
||||
BrightGhostComboThreshold=100
|
||||
@@ -3413,7 +3413,25 @@ MusicFadeOutSeconds=0.5
|
||||
OutTransitionLength=5
|
||||
CourseTransitionLength=0.5
|
||||
BeginFailedDelay=1.0
|
||||
#
|
||||
# New way to control where the notefields are on gameplay.
|
||||
# The MarginFunction will be passed GAMESTATE:EnabledPlayers() and the
|
||||
# current styletype. The function must return three values:
|
||||
# Left margin width, center margin width, right margin width.
|
||||
# The engine will then position the notefields and adjust their size to fit
|
||||
# in the space not occupied by the margins. If there is only one player and
|
||||
# that player would normally be centered (OnePlayerTwoSides or
|
||||
# TwoPlayersSharedSides, or the Center1Player preference), then the center
|
||||
# margin value will be ignored.
|
||||
# Mods applied to the player may still move the notefield into the margin,
|
||||
# this is just for controlling its initial position and size.
|
||||
# The purpose of this is to allow the engine more flexibility in styles,
|
||||
# for example, one player playing dance-solo while the other plays
|
||||
# dance-single.
|
||||
MarginFunction=GameplayMargins
|
||||
# These X values for each player and styletype are deprecated in favor of
|
||||
# writing a MarginFunction that returns the margin sizes you prefer.
|
||||
# The MarginFunction supplied by _fallback will use these metrics for
|
||||
# backwards compatibility.
|
||||
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))
|
||||
PlayerP1TwoPlayersTwoSidesX=math.floor(scale((0.85/3),0,1,SCREEN_LEFT,SCREEN_RIGHT))
|
||||
|
||||
Reference in New Issue
Block a user