Added BackgroundFitMode preference and setting screen for controlling how backgrounds are fitted to the screen.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
local Color1 = color(Var "Color1");
|
||||
local Color2 = color(Var "Color2");
|
||||
local stretchBG = PREFSMAN:GetPreference("StretchBackgrounds")
|
||||
|
||||
local t = Def.ActorFrame {};
|
||||
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
local Color1 = color(Var "Color1");
|
||||
local Color2 = color(Var "Color2");
|
||||
local stretchBG = PREFSMAN:GetPreference("StretchBackgrounds")
|
||||
|
||||
local t = Def.ActorFrame {
|
||||
Def.Sprite {
|
||||
OnCommand=function(self)
|
||||
self:LoadFromCurrentSongBackground()
|
||||
self:xy(SCREEN_CENTER_X,SCREEN_CENTER_Y)
|
||||
if stretchBG then self:SetSize(SCREEN_WIDTH,SCREEN_HEIGHT)
|
||||
else self:scale_or_crop_background();
|
||||
end
|
||||
self:scale_or_crop_background();
|
||||
self:diffuse(Color1)
|
||||
self:effectclock("music")
|
||||
end;
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
local Color1 = color(Var "Color1");
|
||||
local stretchBG = PREFSMAN:GetPreference("StretchBackgrounds")
|
||||
|
||||
local t = Def.ActorFrame {
|
||||
LoadActor(Var "File1") .. {
|
||||
OnCommand=function(self)
|
||||
self:xy(SCREEN_CENTER_X,SCREEN_CENTER_Y)
|
||||
if stretchBG then self:SetSize(SCREEN_WIDTH,SCREEN_HEIGHT)
|
||||
else self:scale_or_crop_background();
|
||||
end
|
||||
self:scale_or_crop_background();
|
||||
self:diffuse(Color1)
|
||||
self:effectclock("music")
|
||||
end;
|
||||
|
||||
@@ -0,0 +1,147 @@
|
||||
-- General layout: There is one choice for each possible background fitting
|
||||
-- mode. Each choice will have three examples showing how backgrounds of
|
||||
-- common aspect ratios will be stretched or clipped by that fitting mode.
|
||||
|
||||
-- fit_choices will be used later to tell the actor that controls input what
|
||||
-- actors to use for each choice.
|
||||
local fit_choices= {}
|
||||
-- actors will contain all the actors on the screen.
|
||||
local actors= {}
|
||||
-- width_per_choice is how much of the screen width will be used to separate
|
||||
-- each choice
|
||||
local width_per_choice= _screen.w / #BackgroundFitMode
|
||||
-- xstart is the x position of the first choice. It starts at
|
||||
-- width_per_choice / 2 because that's the x coordinate of the center of the
|
||||
-- first choice.
|
||||
local xstart= width_per_choice / 2
|
||||
-- mini_screen_w and mini_screen_h are the size of the miniature screen used
|
||||
-- in the examples.
|
||||
local mini_screen_w= _screen.w * .1
|
||||
local mini_screen_h= _screen.h * .1
|
||||
|
||||
-- This function returns a BitmapText that will be used to label each example
|
||||
-- in each choice.
|
||||
-- w and h are the width and height of the aspect ratio, passed in so they
|
||||
-- can be displayed to be read.
|
||||
function BGFitNormalExampleText(w, h)
|
||||
return Def.BitmapText{
|
||||
-- To use a different font for the text, change the Font field.
|
||||
Name= "example_label", Font= "Common Normal",
|
||||
-- The "BG" part of the text is fetched with THEME:GetString so that it
|
||||
-- can be translated.
|
||||
Text= w .. ":" .. h .. " " .. THEME:GetString("ScreenSetBGFit", "BG"),
|
||||
InitCommand= function(self)
|
||||
-- This positions the text underneath its corresponding example.
|
||||
self:y(mini_screen_h * .5 + 9)
|
||||
self:zoom(.375)
|
||||
end
|
||||
}
|
||||
end
|
||||
|
||||
-- This loop goes through all the array elements of the BackgroundFitMode
|
||||
-- table and creates a choice actor for each one. The BackgroundFitMode
|
||||
-- table contains an entry for each background fitting mode.
|
||||
for i, mode in ipairs(BackgroundFitMode) do
|
||||
actors[#actors+1]= Def.ActorFrame{
|
||||
Name= mode, InitCommand= function(self)
|
||||
-- This adds the actor to fit_choices so it can be used by the input
|
||||
-- controller.
|
||||
fit_choices[i]= self
|
||||
-- This positions the choice on the screen. Choices are placed in a
|
||||
-- row across the center of the screen, evenly spaced.
|
||||
self:xy(xstart + ((i-1) * width_per_choice), _screen.cy)
|
||||
end,
|
||||
Def.BitmapText{
|
||||
-- This actor is a label for the choice, so the player knows the name
|
||||
-- of their choice.
|
||||
Name= "mode_label", Font= "Common Normal",
|
||||
Text= THEME:GetString("ScreenSetBGFit", ToEnumShortString(mode)),
|
||||
InitCommand= function(self)
|
||||
-- Position the label above the topmost example.
|
||||
self:y(mini_screen_h * -2.5)
|
||||
self:zoom(.75)
|
||||
end
|
||||
},
|
||||
-- BGFitChoiceExample is a function that creates an example to show how
|
||||
-- a bg with a given aspect ratio is affected by the fitting mode for
|
||||
-- this choice. It takes a number of parameters that control how the
|
||||
-- example is created.
|
||||
-- The simplest way to modify it to suit your theme is to just change
|
||||
-- the png files and the two colors.
|
||||
BGFitChoiceExample{
|
||||
-- exname is the name of the image in Graphics that will be used as an
|
||||
-- example bg to show distortion/cropping. "16_12_example.png" means
|
||||
-- that "Graphics/ScreenSetBGFit 16_12_example.png" will be loaded.
|
||||
exname= "16_12_example.png",
|
||||
-- x and y are the position this example will be placed at.
|
||||
-- x is 0 because the x positioning was handled above, when the choice
|
||||
-- this example is part of was positioned.
|
||||
-- This is the first example of 3, so y is set to position it above
|
||||
-- the other two.
|
||||
x= 0, y= mini_screen_h * -1.5,
|
||||
-- mini_screen_w and mini_screen_h are the size of the miniature screen
|
||||
-- the example will draw.
|
||||
mini_screen_w= mini_screen_w, mini_screen_h= mini_screen_h,
|
||||
-- example_function is the background fitting function for the mode
|
||||
-- that will be set by this choice. bg_fit_functions is a table
|
||||
-- that contains a function for each mode, so we set example_function
|
||||
-- to the element of bg_fit_functions that has the same name as the
|
||||
-- mode this choice is for.
|
||||
example_function= bg_fit_functions[mode],
|
||||
-- example_label is an actor that will be used to label this example,
|
||||
-- so the player knows what size of bg is shown in this example.
|
||||
example_label= BGFitNormalExampleText(16, 12),
|
||||
-- sbg_color is the color of the quad representing the screen in the
|
||||
-- example. sbg_color is the color of the outline representing the
|
||||
-- screen in the example.
|
||||
-- The quad is visible behind the example bg, so it's seen around the
|
||||
-- edges when the example doesn't fill the miniature screen.
|
||||
-- The outline is drawn over everything else so the player can see what
|
||||
-- part of the example bg will be cut off.
|
||||
sbg_color= color("0,0,0,1"), soutline_color= color("#39b54a")},
|
||||
-- The parameters passed to the other examples have the same meaning as
|
||||
-- above.
|
||||
BGFitChoiceExample{
|
||||
exname= "16_10_example.png", x= 0, y= 0,
|
||||
mini_screen_w= mini_screen_w, mini_screen_h= mini_screen_h,
|
||||
example_function= bg_fit_functions[mode],
|
||||
example_label= BGFitNormalExampleText(16, 10),
|
||||
sbg_color= color("0,0,0,1"), soutline_color= color("#39b54a")},
|
||||
BGFitChoiceExample{
|
||||
exname= "16_9_example.png", x= 0, y= mini_screen_h * 1.5,
|
||||
mini_screen_w= mini_screen_w, mini_screen_h= mini_screen_h,
|
||||
example_function= bg_fit_functions[mode],
|
||||
example_label= BGFitNormalExampleText(16, 9),
|
||||
sbg_color= color("0,0,0,1"), soutline_color= color("#39b54a")},
|
||||
}
|
||||
end
|
||||
|
||||
-- LoseFocus and GainFocus will be used on each choice to show which one
|
||||
-- is currently selected.
|
||||
local function LoseFocus(self)
|
||||
-- We use stoptweening so that the player can't overflow the tween buffer
|
||||
-- through repeated rapid input. Using stoptweening means that the actor
|
||||
-- will stop at its current state and start tweening towards the new state
|
||||
-- we are about to add to the tween stack.
|
||||
-- If finishtweening was used, there would be jerking from the actor
|
||||
-- suddenly reaching the end tween state.
|
||||
self:stoptweening()
|
||||
-- .25 seconds is a fine time for changing zoom size.
|
||||
self:linear(.25)
|
||||
-- Unfocused choices are normal size.
|
||||
self:zoom(1)
|
||||
end
|
||||
|
||||
local function GainFocus(self)
|
||||
self:stoptweening()
|
||||
self:linear(.25)
|
||||
-- The choice with focus is 1.5 size.
|
||||
self:zoom(1.5)
|
||||
end
|
||||
|
||||
-- BGFitInputActor returns the actor that will handle input from the player
|
||||
-- and apply their choice to the preference. We pass it fit_choices so that
|
||||
-- it has the choice actors so it can show the player which once they have
|
||||
-- selected.
|
||||
actors[#actors+1]= BGFitInputActor(fit_choices, LoseFocus, GainFocus)
|
||||
return Def.ActorFrame(actors)
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 160 B |
Binary file not shown.
|
After Width: | Height: | Size: 160 B |
Binary file not shown.
|
After Width: | Height: | Size: 160 B |
@@ -345,6 +345,7 @@ AutogenGroupCourses=Show group Nonstop and Endless courses that were created by
|
||||
AutogenSteps=Automatically generate steps from other game types.
|
||||
BGBrightness=Controls how bright the background will appear. Turn this setting down if you have a hard time seeing the notes.
|
||||
Background=Change options that control the backgrounds that play during gameplay.
|
||||
BackgroundFitMode=Change the way backgrounds are scaled to fit the screen.
|
||||
BarDrain=BarDrain
|
||||
BatLives=BatLives
|
||||
Bookkeeping=Check coin drop statistics.
|
||||
@@ -456,6 +457,7 @@ Scoreboard=Enables scoreboard
|
||||
ScoringType=Defines which scoring method to use.
|
||||
ScreenFilter=Screen Filter
|
||||
Scroll=Scroll
|
||||
Set BG Fit Mode=Set background fitting mode.
|
||||
Select Group=Toggle Songs in this Group.
|
||||
Select Profile=Choose a profile
|
||||
Server=Start Local Server
|
||||
@@ -636,6 +638,8 @@ Connect=Connect...
|
||||
Copy Left To Right=Copy Left To Right
|
||||
Copy Right To Left=Copy Right To Left
|
||||
Courses Only=Courses Only
|
||||
CoverDistort=Cover Distort
|
||||
CoverPreserve=Cover Preserve
|
||||
Create New=Create New
|
||||
Cross=Cross
|
||||
Custom=Custom
|
||||
@@ -664,6 +668,9 @@ Expand 2->3=Expand 2->3
|
||||
Expand 2x=Expand 2x
|
||||
Expand 3->4=Expand 3->4
|
||||
Fast=Fast
|
||||
FitInside=Fit Inside
|
||||
FitInsideAvoidLetter=Avoid Letter
|
||||
FitInsideAvoidPillar=Avoid Pillar
|
||||
Five Key Menu=Five Key
|
||||
Flat=Flat
|
||||
Flip=Flip
|
||||
@@ -850,6 +857,7 @@ AutogenGroupCourses=Autogen Group Courses
|
||||
AutogenSteps=Autogen Steps
|
||||
BGBrightness=Brightness
|
||||
Background=Background
|
||||
BackgroundFitMode=BG Fit Mode
|
||||
BarDrain=Bar Drain
|
||||
BatLives=Bat Lives
|
||||
Base Difficulty=Base Difficulty
|
||||
@@ -1074,6 +1082,7 @@ Secret=Secret
|
||||
Secs Remaining=Seconds Remaining
|
||||
Server=Server
|
||||
Servers=Servers
|
||||
Set BG Fit Mode=Set BG Fit Mode
|
||||
Set P1=Set P1
|
||||
Set P2=Set P2
|
||||
Set modifiers=Set modifiers
|
||||
@@ -1608,6 +1617,14 @@ size ???=size ???
|
||||
HeaderText=Options
|
||||
HeaderSubText=You can configure the game here
|
||||
|
||||
[ScreenSetBGFit]
|
||||
CoverDistort=Distort
|
||||
CoverPreserve=Preserve
|
||||
FitInside=Fit
|
||||
FitInsideAvoidLetter=Avoid Letter
|
||||
FitInsideAvoidPillar=Avoid Pillar
|
||||
BG=BG
|
||||
|
||||
[ScreenPackages]
|
||||
DL @ %d KB/s=DL @ %d KB/s
|
||||
Download cancelled.=Download cancelled.
|
||||
|
||||
@@ -151,8 +151,40 @@ function Actor:FullScreen()
|
||||
self:stretchto( 0,0,SCREEN_WIDTH,SCREEN_HEIGHT )
|
||||
end
|
||||
|
||||
bg_fit_functions= {
|
||||
BackgroundFitMode_CoverDistort= function(self, width, height)
|
||||
local xscale= width / self:GetWidth()
|
||||
local yscale= height / self:GetHeight()
|
||||
self:zoomx(xscale)
|
||||
self:zoomy(yscale)
|
||||
end,
|
||||
BackgroundFitMode_CoverPreserve= function(self, width, height)
|
||||
local xscale= width / self:GetWidth()
|
||||
local yscale= height / self:GetHeight()
|
||||
self:zoom(math.max(xscale, yscale))
|
||||
end,
|
||||
BackgroundFitMode_FitInside= function(self, width, height)
|
||||
local xscale= width / self:GetWidth()
|
||||
local yscale= height / self:GetHeight()
|
||||
self:zoom(math.min(xscale, yscale))
|
||||
end,
|
||||
BackgroundFitMode_FitInsideAvoidLetter= function(self, width, height)
|
||||
local yscale= height / self:GetHeight()
|
||||
self:zoom(yscale)
|
||||
end,
|
||||
BackgroundFitMode_FitInsideAvoidPillar= function(self, width, height)
|
||||
local xscale= width / self:GetWidth()
|
||||
self:zoom(xscale)
|
||||
end
|
||||
}
|
||||
|
||||
function Actor:scale_or_crop_background()
|
||||
self:scaletocover(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)
|
||||
local fit_mode= PREFSMAN:GetPreference("BackgroundFitMode")
|
||||
if bg_fit_functions[fit_mode] then
|
||||
bg_fit_functions[fit_mode](self, SCREEN_WIDTH, SCREEN_HEIGHT)
|
||||
else
|
||||
self:scaletocover(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)
|
||||
end
|
||||
end
|
||||
|
||||
function Actor:CenterX() self:x(SCREEN_CENTER_X) end
|
||||
|
||||
@@ -319,3 +319,19 @@ function Def.LogDisplay(params)
|
||||
_G[params.Name .. "LogDisplay"]= new_log_display
|
||||
return new_log_display:create_actors(params)
|
||||
end
|
||||
|
||||
--[[
|
||||
Copyright © 2014 Eric Reese / Kyzentun
|
||||
All rights reserved.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
]]
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
function BGFitChoiceExample(params)
|
||||
-- verify all the parameters, emitting an error for omitted ones.
|
||||
local default_params= {
|
||||
exname= "16_12_example.png", x= 0, y= 0,
|
||||
mini_screen_w= 0, mini_screen_h= 0,
|
||||
example_function= bg_fit_functions.BackgroundFitMode_CoverDistort,
|
||||
sbg_color= Color.Black, soutline_color= Color.Green
|
||||
}
|
||||
for name, value in pairs(default_params) do
|
||||
if not params[name] then
|
||||
lua.ReportScriptError("BGFitChoiceExample not passed a '" .. name ..
|
||||
"' param.")
|
||||
params[name]= value
|
||||
end
|
||||
end
|
||||
return Def.ActorFrame{
|
||||
Name= params.exname, InitCommand= function(self)
|
||||
self:xy(params.x, params.y)
|
||||
end,
|
||||
-- Quad representing the screen, to show behind the example quad.
|
||||
Def.Quad{
|
||||
Name="mini_scr", InitCommand= function(self)
|
||||
self:setsize(params.mini_screen_w, params.mini_screen_h)
|
||||
self:diffuse(params.sbg_color)
|
||||
end
|
||||
},
|
||||
-- Sprite representing the example bg.
|
||||
Def.Sprite{
|
||||
Name="mini_ex", InitCommand= function(self)
|
||||
self:LoadBackground(THEME:GetPathG("ScreenSetBGFit", params.exname))
|
||||
self:SetTextureFiltering(false)
|
||||
params.example_function(self, params.mini_screen_w, params.mini_screen_h)
|
||||
end
|
||||
},
|
||||
-- AMV for the outline of the screen, to show where the screen is so
|
||||
-- cropping is visible.
|
||||
Def.ActorMultiVertex{
|
||||
Name="mini_outline", InitCommand= function(self)
|
||||
local hw= params.mini_screen_w / 2
|
||||
local hh= params.mini_screen_h / 2
|
||||
local verts= {
|
||||
{{-hw, -hh, 0}, params.soutline_color},
|
||||
{{hw, -hh, 0}, params.soutline_color},
|
||||
{{hw, hh, 0}, params.soutline_color},
|
||||
{{-hw, hh, 0}, params.soutline_color},
|
||||
{{-hw, -hh, 0}, params.soutline_color},
|
||||
}
|
||||
self:SetVertices(verts)
|
||||
self:SetLineWidth(1)
|
||||
self:SetDrawState{Mode= "DrawMode_LineStrip"}
|
||||
end
|
||||
},
|
||||
params.example_label,
|
||||
}
|
||||
end
|
||||
|
||||
function BGFitInputActor(choices, lose_focus, gain_focus)
|
||||
local curr_choice= BackgroundFitMode:Reverse()[PREFSMAN:GetPreference("BackgroundFitMode")] + 1 -- reverse is 0-indexed
|
||||
local left_buttons= {MenuLeft= true, MenuUp= true}
|
||||
local right_buttons= {MenuRight= true, MenuDown= true}
|
||||
local saw_press= false
|
||||
if not lose_focus then
|
||||
lua.ReportScriptError("BGFitInputActor not given a lose_focus function.")
|
||||
lose_focus= function() end
|
||||
end
|
||||
if not gain_focus then
|
||||
lua.ReportScriptError("BGFitInputActor not given a gain_focus function.")
|
||||
gain_focus= function() end
|
||||
end
|
||||
local function check_choice_and_change_focus(focus_func)
|
||||
if choices[curr_choice] then
|
||||
focus_func(choices[curr_choice])
|
||||
else
|
||||
lua.ReportScriptError("BGFitInputActor not given a choice actor for the " .. BackgroundFitMode[curr_choice] .. " mode.")
|
||||
end
|
||||
end
|
||||
local function input(event)
|
||||
if event.type == "InputEventType_Release" then return false end
|
||||
if event.type == "InputEventType_Repeat" and not saw_press then
|
||||
return false
|
||||
end
|
||||
if not event.GameButton then return false end
|
||||
saw_press= true
|
||||
if left_buttons[event.GameButton] or right_buttons[event.GameButton] then
|
||||
check_choice_and_change_focus(lose_focus)
|
||||
if left_buttons[event.GameButton] then
|
||||
curr_choice= math.max(curr_choice - 1, 1)
|
||||
else
|
||||
curr_choice= math.min(curr_choice + 1, #choices)
|
||||
end
|
||||
check_choice_and_change_focus(gain_focus)
|
||||
PREFSMAN:SetPreference("BackgroundFitMode", BackgroundFitMode[curr_choice])
|
||||
SOUND:PlayOnce(THEME:GetPathS("ScreenSelectMaster", "change"))
|
||||
elseif event.GameButton == "Start" or event.GameButton == "Back" then
|
||||
SOUND:PlayOnce(THEME:GetPathS("ScreenSelectMaster", "start"))
|
||||
SCREENMAN:GetTopScreen():StartTransitioningScreen("SM_GoToNextScreen")
|
||||
end
|
||||
return false
|
||||
end
|
||||
return Def.ActorFrame{
|
||||
Name= "input_init",
|
||||
OnCommand= function(self)
|
||||
local screen= SCREENMAN:GetTopScreen()
|
||||
screen:AddInputCallback(input)
|
||||
choices[curr_choice]:stoptweening()
|
||||
choices[curr_choice]:linear(.25)
|
||||
choices[curr_choice]:zoom(1.5)
|
||||
end
|
||||
}
|
||||
end
|
||||
|
||||
--[[
|
||||
Copyright © 2014 Eric Reese / Kyzentun
|
||||
All rights reserved.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
]]
|
||||
@@ -1644,6 +1644,13 @@ TimerY=
|
||||
TimerOnCommand=
|
||||
TimerOffCommand=
|
||||
|
||||
[ScreenSetBGFit]
|
||||
Class="ScreenWithMenuElements"
|
||||
Fallback="ScreenWithMenuElements"
|
||||
NextScreen="ScreenOptionsService"
|
||||
RepeatRate=10
|
||||
RepeatDelay=.25
|
||||
|
||||
[ScreenWithMenuElementsBlank]
|
||||
Fallback="ScreenWithMenuElements"
|
||||
UpdateOnMessage=""
|
||||
@@ -2689,7 +2696,7 @@ Fallback="ScreenOptionsSimpleService"
|
||||
NextScreen=Branch.AfterInit()
|
||||
PrevScreen=Branch.AfterInit()
|
||||
|
||||
LineNames="Sync,GameType,KeyConfig,TestInput,Input,Reload,Arcade,Appearance,GraphicSound,Profiles,Network,UI,Advanced,Credits"
|
||||
LineNames="Sync,GameType,KeyConfig,TestInput,Input,Reload,Arcade,Appearance,BGFit,GraphicSound,Profiles,Network,UI,Advanced,Credits"
|
||||
LineSync="gamecommand;screen,ScreenGameplaySyncMachine;name,Calibrate Machine Sync"
|
||||
LineGameType="gamecommand;screen,ScreenSelectGame;name,Select Game"
|
||||
LineKeyConfig="gamecommand;screen,ScreenMapControllers;name,Key Joy Mappings"
|
||||
@@ -2698,7 +2705,7 @@ LineInput="gamecommand;screen,ScreenOptionsInput;name,Input Options"
|
||||
LineReload="gamecommand;screen,ScreenReloadSongs;name,Reload Songs"
|
||||
LineArcade="gamecommand;screen,ScreenOptionsArcade;name,Arcade Options"
|
||||
LineAppearance="gamecommand;screen,ScreenAppearanceOptions;name,Appearance Options"
|
||||
|
||||
LineBGFit="gamecommand;screen,ScreenSetBGFit;name,Set BG Fit Mode"
|
||||
LineGraphicSound="gamecommand;screen,ScreenOptionsGraphicsSound;name,Graphics/Sound Options"
|
||||
LineProfiles="gamecommand;screen,ScreenOptionsManageProfiles;name,Profiles"
|
||||
LineNetwork="gamecommand;screen,ScreenNetworkOptions;name,Network Options"
|
||||
@@ -2970,7 +2977,7 @@ Line4="conf,DefaultNoteSkin"
|
||||
Line5="conf,PercentageScoring"
|
||||
Line14="conf,RandomBackgroundMode"
|
||||
Line15="conf,BGBrightness"
|
||||
LineSB="conf,StretchBackgrounds"
|
||||
LineSB="conf,BackgroundFitMode"
|
||||
Line17="conf,ShowDancingCharacters"
|
||||
Line18="conf,ShowBeginnerHelper"
|
||||
Line19="conf,NumBackgrounds"
|
||||
|
||||
@@ -38,11 +38,7 @@ else
|
||||
InitCommand=cmd(Center;diffusealpha,0);
|
||||
BeginCommand=cmd(LoadFromCurrentSongBackground);
|
||||
OnCommand=function(self)
|
||||
if PREFSMAN:GetPreference("StretchBackgrounds") then
|
||||
self:SetSize(SCREEN_WIDTH,SCREEN_HEIGHT)
|
||||
else
|
||||
self:scale_or_crop_background()
|
||||
end
|
||||
self:scale_or_crop_background()
|
||||
self:sleep(0.5)
|
||||
self:linear(0.50)
|
||||
self:diffusealpha(1)
|
||||
|
||||
@@ -1262,7 +1262,7 @@ ExplanationTogetherOffCommand=stoptweening
|
||||
[ScreenOptionsService]
|
||||
ShowHeader=true
|
||||
|
||||
LineNames="Sync,GameType,KeyConfig,TestInput,Input,Reload,Arcade,Appearance,Theme,GraphicSound,Profiles,Network,UI,Advanced,Credits"
|
||||
LineNames="Sync,GameType,KeyConfig,TestInput,Input,Reload,Arcade,Appearance,Theme,BGFit,GraphicSound,Profiles,Network,UI,Advanced,Credits"
|
||||
LineTheme="gamecommand;screen,ScreenOptionsTheme;name,Theme Options"
|
||||
|
||||
# ScreenOptionsSystemDirection"
|
||||
|
||||
@@ -125,6 +125,17 @@ XToString( CourseSortOrders );
|
||||
StringToX( CourseSortOrders );
|
||||
LuaXType( CourseSortOrders );
|
||||
|
||||
static const char *BackgroundFitModeNames[] = {
|
||||
"CoverDistort",
|
||||
"CoverPreserve",
|
||||
"FitInside",
|
||||
"FitInsideAvoidLetter",
|
||||
"FitInsideAvoidPillar",
|
||||
};
|
||||
XToString( BackgroundFitMode );
|
||||
StringToX( BackgroundFitMode );
|
||||
LuaXType( BackgroundFitMode );
|
||||
|
||||
bool g_bAutoRestart = false;
|
||||
#ifdef DEBUG
|
||||
# define TRUE_IF_DEBUG true
|
||||
@@ -162,6 +173,7 @@ PrefsManager::PrefsManager() :
|
||||
m_iTextureColorDepth ( "TextureColorDepth", 16 ),
|
||||
m_iMovieColorDepth ( "MovieColorDepth", 16 ),
|
||||
m_bStretchBackgrounds ( "StretchBackgrounds", false ),
|
||||
m_BGFitMode("BackgroundFitMode", BFM_CoverPreserve),
|
||||
m_HighResolutionTextures ( "HighResolutionTextures", HighResolutionTextures_Auto ),
|
||||
m_iMaxTextureResolution ( "MaxTextureResolution", 2048 ),
|
||||
m_iRefreshRate ( "RefreshRate", REFRESH_DEFAULT ),
|
||||
|
||||
@@ -111,6 +111,16 @@ enum CourseSortOrders
|
||||
NUM_CourseSortOrders,
|
||||
CourseSortOrders_Invalid
|
||||
};
|
||||
enum BackgroundFitMode
|
||||
{
|
||||
BFM_CoverDistort,
|
||||
BFM_CoverPreserve,
|
||||
BFM_FitInside,
|
||||
BFM_FitInsideAvoidLetter,
|
||||
BFM_FitInsideAvoidPillar,
|
||||
NUM_BackgroundFitMode,
|
||||
BackgroundFitMode_Invalid
|
||||
};
|
||||
|
||||
/** @brief Holds user-chosen preferences that are saved between sessions. */
|
||||
class PrefsManager
|
||||
@@ -154,6 +164,7 @@ public:
|
||||
Preference<int> m_iTextureColorDepth;
|
||||
Preference<int> m_iMovieColorDepth;
|
||||
Preference<bool> m_bStretchBackgrounds;
|
||||
Preference<BackgroundFitMode> m_BGFitMode;
|
||||
Preference<HighResolutionTextures> m_HighResolutionTextures;
|
||||
Preference<int> m_iMaxTextureResolution;
|
||||
Preference<int> m_iRefreshRate;
|
||||
|
||||
@@ -692,7 +692,8 @@ static void InitializeConfOptions()
|
||||
g_ConfOptions.back().m_sPrefName = "BGBrightness";
|
||||
ADD( ConfOption( "BGBrightnessOrStatic", BGBrightnessOrStatic, "Disabled","25% Bright","50% Bright","75% Bright" ) );
|
||||
g_ConfOptions.back().m_sPrefName = "BGBrightness";
|
||||
ADD( ConfOption( "StretchBackgrounds", MovePref<bool>, "Off","On" ) );
|
||||
ADD( ConfOption( "StretchBackgrounds", MovePref<bool>, "Off","On" ) ); // Deprecated, unused by default/_fallback. -Kyz
|
||||
ADD( ConfOption( "BackgroundFitMode", MovePref<BackgroundFitMode>, "CoverDistort", "CoverPreserve", "FitInside", "FitInsideAvoidLetter", "FitInsideAvoidPillar") );
|
||||
|
||||
ADD( ConfOption( "ShowDanger", MovePref<bool>, "Hide","Show" ) );
|
||||
ADD( ConfOption( "ShowDancingCharacters", MovePref<ShowDancingCharacters>, "Default to Off","Default to Random","Select" ) );
|
||||
|
||||
Reference in New Issue
Block a user