Merge branch 'master' of https://github.com/stepmania/stepmania
This commit is contained in:
@@ -9,6 +9,9 @@ charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.txt]
|
||||
indent_style = space
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
|
||||
@@ -874,7 +874,7 @@ sm-ssc v1.0 Release Candidate 1 | 20100627
|
||||
* [Screen] add GetScreenType() Lua binding.
|
||||
* howl's patch for fixing LowLevelWindow
|
||||
(stepmania4-fullscreen-focus-lost-and-restore-resolution2.patch)
|
||||
http://www.stepmania.com/forums/showthread.php?t=23693
|
||||
http://old.stepmania.com/forums/showthread.php?t=23693
|
||||
|
||||
20100608
|
||||
--------
|
||||
@@ -1564,7 +1564,7 @@ Theme-related additions/bugfixes aren't listed here, usually.
|
||||
--------
|
||||
* (smpackage) sm4svn r28243: "fix for FlushDirCache" [Chris Danford]
|
||||
* Fix Beginner Helper rest location [sy567]
|
||||
(see http://www.stepmania.com/forums/showpost.php?p=158721&postcount=12)
|
||||
(see http://old.stepmania.com/forums/showpost.php?p=158721&postcount=12)
|
||||
|
||||
20091211
|
||||
--------
|
||||
@@ -1596,7 +1596,7 @@ the gametype causes the DifficultyList/StepsDisplayList to not show anything.
|
||||
20091206
|
||||
--------
|
||||
Implement a patch to support modern versions of ffmpeg.
|
||||
(See http://www.stepmania.com/forums/showthread.php?t=21434 for more info.)
|
||||
(See http://old.stepmania.com/forums/showthread.php?t=21434 for more info.)
|
||||
|
||||
Petr Baudis (3):
|
||||
video.m4: Add libswscale checks.
|
||||
@@ -1681,7 +1681,7 @@ changes are from baseline StepMania 4 SVN, in order to keep compatibility.
|
||||
--------
|
||||
* [ArchHooks_Unix] Follow user's system language as default.
|
||||
[David Santamaría Rogado (howl)]
|
||||
See http://www.stepmania.com/forums/showthread.php?t=21471 for more info.
|
||||
See http://old.stepmania.com/forums/showthread.php?t=21471 for more info.
|
||||
|
||||
20091120
|
||||
--------
|
||||
@@ -1707,7 +1707,7 @@ changes are from baseline StepMania 4 SVN, in order to keep compatibility.
|
||||
--------
|
||||
* Prevent focus lost at Fullscreen on X11, fix windowed->fullscreen resolution
|
||||
changes so that they save [David Santamaría Rogado (howl)]
|
||||
(http://www.stepmania.com/forums/showthread.php?t=21430)
|
||||
(http://old.stepmania.com/forums/showthread.php?t=21430)
|
||||
|
||||
20091114
|
||||
--------
|
||||
@@ -1754,10 +1754,10 @@ changes are from baseline StepMania 4 SVN, in order to keep compatibility.
|
||||
* r28221: "allow overriding, like PRODUCT_ID" [Glenn Maynard]
|
||||
* r28222-28223: "adding support for pms files" [GRIM657]
|
||||
* The pulseaudio patch [David Santamaría Rogado (howl), Ondřej Hošek, Damien Thébault]
|
||||
(see http://www.stepmania.com/forums/showthread.php?t=21348)
|
||||
(see http://old.stepmania.com/forums/showthread.php?t=21348)
|
||||
* Greg Nadja's OpenGL/Windows patch
|
||||
* Load Splash.png instead of an .xpm [David Santamaría Rogado (howl)]
|
||||
(http://www.stepmania.com/forums/showpost.php?p=157340&postcount=3)
|
||||
(http://old.stepmania.com/forums/showpost.php?p=157340&postcount=3)
|
||||
|
||||
* sm-ssc Changes:
|
||||
* [ScreenSelectMusic.cpp] Add SelectMenuInputMessage, has params Player and
|
||||
|
||||
+10
-6
@@ -1,4 +1,4 @@
|
||||
StepMania 5 Changelog
|
||||
StepMania 5 Changelog
|
||||
________________________________________________________________________________
|
||||
The StepMania 5 Changelog covers all post-sm-ssc changes. For a list of changes
|
||||
from StepMania 4 alpha 5 to sm-ssc v1.2.5, see Changelog_sm-ssc.txt.
|
||||
@@ -8,6 +8,10 @@ ________________________________________________________________________________
|
||||
StepMania current development
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
2014/09/02
|
||||
----------
|
||||
* Changed ES/OMES speed mod to 2x from 1.5x.
|
||||
|
||||
2014/08/06
|
||||
----------
|
||||
* [ScreenGameplay] LifeMeterChangedP1 message is no longer broadcast for for
|
||||
@@ -582,7 +586,7 @@ StepMania 5.0 alpha 1 | 20120108
|
||||
* [ScreenManager] Made AddScreenToTop take a second (optional) parameter for
|
||||
posting a ScreenMessage on screen pop. [AJ]
|
||||
* Only read certain tags during first load; makes song loading faster. [theDtTvB]
|
||||
|
||||
|
||||
2012/01/07
|
||||
----------
|
||||
* Fix Portable.ini not working on Mac OS X. [shakesoda]
|
||||
@@ -691,8 +695,8 @@ StepMania 5.0 alpha 1 | 20120108
|
||||
2011/11/15
|
||||
----------
|
||||
* [LifeMeterBar] Added the ForceLifeDifficultyOnExtraStage metric and
|
||||
the ExtraStageLifeDifficulty metric. Let the themer decide if extra stages
|
||||
should have their own life bar behavior. Note that this metric does NOT
|
||||
the ExtraStageLifeDifficulty metric. Let the themer decide if extra stages
|
||||
should have their own life bar behavior. Note that this metric does NOT
|
||||
change the lifebar to the battery style. [Wolfman2000/FSX]
|
||||
|
||||
2011/11/14
|
||||
@@ -1237,7 +1241,7 @@ StepMania 5.0 Preview 2 | 20110703
|
||||
2011/06/12
|
||||
----------
|
||||
* [ScreenNetSelectMusic] Add PlayerOptionsScreen metric. [AJ]
|
||||
* [ScreenEdit] Restore the old PageUp/PageDown behavior, added Control +
|
||||
* [ScreenEdit] Restore the old PageUp/PageDown behavior, added Control +
|
||||
PageUp/PageDown to use recent time signature behavior. Laptop users, that
|
||||
includes you guys too: semicolon and apostrophe are still good. [Wolfman2000]
|
||||
|
||||
@@ -1376,7 +1380,7 @@ StepMania 5.0 Preview 1 | 20110529
|
||||
----------
|
||||
* [ScreenGameplay] Removed hardcoded commands for Debug (give up text) and
|
||||
replace them with DebugStartOnCommand, DebugBackOnCommand, and
|
||||
DebugTweenOffCommand. [AJ]
|
||||
DebugTweenOffCommand. [AJ]
|
||||
* Added #SPEEDS to the SSC format. This multiplies your scrolling speed during
|
||||
gameplay, not replaces it (see mod attacks for replacing). [Wolfman2000]
|
||||
|
||||
|
||||
@@ -30,5 +30,5 @@ The Credentials section seems to be optional, but is useful to know about:
|
||||
from the web site to StepMania for things like in-game uploads (instead of going
|
||||
to stepmaniashare.com)"[1]
|
||||
__________________________________________________________
|
||||
[1] http://www.stepmania.com/forums/showthread.php?t=24203
|
||||
[2] http://www.stepmania.com/test.smxml
|
||||
[1] http://old.stepmania.com/forums/showthread.php?t=24203
|
||||
[2] http://old.stepmania.com/test.smxml
|
||||
@@ -490,6 +490,7 @@
|
||||
<Function name='GetDestFirstToDraw'/>
|
||||
<Function name='GetDestNumToDraw'/>
|
||||
<Function name='GetNumVertices'/>
|
||||
<Function name='GetTexture'/>
|
||||
<Function name='LoadTexture'/>
|
||||
<Function name='SetDrawState'/>
|
||||
<Function name='SetEffectMode'/>
|
||||
@@ -810,6 +811,8 @@
|
||||
<Function name='HasEarnedExtraStage'/>
|
||||
<Function name='HaveProfileToLoad'/>
|
||||
<Function name='HaveProfileToSave'/>
|
||||
<Function name='InsertCoin'/>
|
||||
<Function name='InsertCredit'/>
|
||||
<Function name='InStepEditor'/>
|
||||
<Function name='IsAnExtraStage'/>
|
||||
<Function name='IsAnyHumanPlayerUsingMemoryCard'/>
|
||||
@@ -1297,6 +1300,7 @@
|
||||
<Function name='loop'/>
|
||||
<Function name='position'/>
|
||||
<Function name='rate'/>
|
||||
<Function name='Reload'/>
|
||||
</Class>
|
||||
<Class base='RageTexture' name='RageTextureRenderTarget'>
|
||||
<Function name='BeginRenderingTo'/>
|
||||
@@ -1316,6 +1320,7 @@
|
||||
<Function name='Metric'/>
|
||||
<Function name='PostScreenMessage'/>
|
||||
<Function name='RemoveInputCallback'/>
|
||||
<Function name='SetNextScreenName'/>
|
||||
<Function name='String'/>
|
||||
<Function name='lockinput'/>
|
||||
</Class>
|
||||
|
||||
@@ -1538,6 +1538,9 @@ save yourself some time, copy this for undocumented things:
|
||||
<Function name='GetCurrNumToDraw' return='int' arguments='void'>
|
||||
Get the NumToDraw of the current tween state.
|
||||
</Function>
|
||||
<Function name='GetTexture' return='RageTexture' arguments=''>
|
||||
Returns the ActorMultiVertex's texture.
|
||||
</Function>
|
||||
<Function name='SetEffectMode' return='void' arguments='EffectMode em'>
|
||||
Sets the <Link class='ENUM' function='EffectMode'>EffectMode</Link> of the ActorMultiVertex.
|
||||
</Function>
|
||||
@@ -2478,6 +2481,13 @@ save yourself some time, copy this for undocumented things:
|
||||
editing portion. If in recording or playing mode, this will return
|
||||
<code>false</code>.
|
||||
</Function>
|
||||
<Function name='InsertCoin' return='void' arguments='int iCoins'>
|
||||
Inserts <code>iCoins</code> number of coins. <code>iCoins</code> can be negative or positive.
|
||||
</Function>
|
||||
<Function name='InsertCredit' return='void' arguments=''>
|
||||
Inserts one credit. To deduct a credit, pass a negative integer representing the number
|
||||
of coins per credit to <Link class='GameState' function='InsertCoin'>InsertCoin</Link>.
|
||||
</Function>
|
||||
<Function name='IsAnExtraStage' return='bool' arguments=''>
|
||||
Returns <code>true</code> if this is an extra stage.
|
||||
</Function>
|
||||
@@ -3724,6 +3734,9 @@ save yourself some time, copy this for undocumented things:
|
||||
<Function name='rate' return='void' arguments='float fRate'>
|
||||
Sets the animation or movie playback rate to <code>fRate</code>.
|
||||
</Function>
|
||||
<Function name='Reload' return='void' arguments=''>
|
||||
Reloads the texture.
|
||||
</Function>
|
||||
</Class>
|
||||
<Class name='RollingNumbers'>
|
||||
<Function name='Load' return='void' arguments='string sGroupName'>
|
||||
@@ -3779,6 +3792,9 @@ save yourself some time, copy this for undocumented things:
|
||||
<Function name='RemoveInputCallback' return='void' arguments='function callback'>
|
||||
This removes the callback from the list.
|
||||
</Function>
|
||||
<Function name='SetNextScreenName' return='void' arguments='string name'>
|
||||
Sets the NextScreen value to name.
|
||||
</Function>
|
||||
<Function name='String' theme='_fallback' return='string' arguments='string sName'>
|
||||
[02 Other.lua] Gets a string from the current Screen in the current language.
|
||||
</Function>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Used by Pocket DDR (http://www.stepmania.com/forums/showthread.php?t=6621).
|
||||
Used by Pocket DDR (http://old.stepmania.com/forums/showthread.php?t=6621).
|
||||
Basically a compressed version of a .SM that includes the banner and background
|
||||
in the file as well.
|
||||
|
||||
|
||||
@@ -0,0 +1,134 @@
|
||||
-- This is the example for how to theme ScreenMapControllers, the Config
|
||||
-- Key/Joy Mappings screen.
|
||||
|
||||
-- The contents of this file will actually be in several sections, each
|
||||
-- intended to be placed in its own file.
|
||||
-- Sections will be seperated by lines of dashes to make the separation clear.
|
||||
-- The first line inside the dashes will have the name of the file to copy the
|
||||
-- section to.
|
||||
-- The rest of the area inside the dashes will discuss general aspects of the
|
||||
-- section being discussed.
|
||||
|
||||
|
||||
----------------------------------------------------------------
|
||||
-- metrics.ini - the metrics you might want to set
|
||||
-- See the ScreenMapControllers section of _fallback/metrics.ini
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
-- overlay, underlay, decorations, transitions
|
||||
-- ScreenMapControllers supports the standard layers and transitions:
|
||||
-- Layers: overlay, underlay, decorations
|
||||
-- Transitions: in, out, cancel
|
||||
-- Details of creating the layers and transitions for a screen are covered in
|
||||
-- ScreenWithLayersAndTransitions.lua.
|
||||
-- Previous versions of ScreenMapControllers had the warning in the overlay.
|
||||
-- The warning has been moved to Graphics/ScreenMapControllers warning.lua. If
|
||||
-- you have previously made a theme, update your theme to match the new
|
||||
-- convention.
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
-- Graphics/ScreenMapControllers warning.lua
|
||||
-- The warning that is displayed when entering the screen.
|
||||
-- The _fallback warning uses the WarningHeader and WarningText strings from
|
||||
-- en.ini. If all you want to do is change the text, add those entries to your
|
||||
-- en.ini.
|
||||
-- The actor returned by your lua file must handle TweenOn and TweenOff commands.
|
||||
-- TweenOn will occur when the screen starts.
|
||||
-- TweenOff will occur when the warning is dismissed.
|
||||
-- Here is a simple actor that dims the screen and displays the text.
|
||||
----------------------------------------------------------------
|
||||
return Def.ActorFrame{
|
||||
InitCommand=cmd(xy, SCREEN_CENTER_X, SCREEN_CENTER_Y),
|
||||
Def.Quad{
|
||||
TweenOnCommand=cmd(zoomto, SCREEN_WIDTH, SCREEN_HEIGHT; diffuse, Color.Black),
|
||||
TweenOffCommand=cmd(linear, 0.5; diffusealpha, 0),
|
||||
},
|
||||
Def.BitmapText{
|
||||
Font="Common Normal",
|
||||
Text=ScreenString("WarningHeader"),
|
||||
TweenOnCommand=cmd(y,-80;diffuse,Color.Red),
|
||||
TweenOffCommand=cmd(linear,0.5;diffusealpha,0),
|
||||
|
||||
},
|
||||
Def.BitmapText{
|
||||
Font="Common Normal",
|
||||
Text=ScreenString("WarningText"),
|
||||
TweenOnCommand=cmd(y,10;wrapwidthpixels,SCREEN_WIDTH-48),
|
||||
TweenOffCommand=cmd(linear,0.5;diffusealpha,0),
|
||||
},
|
||||
}
|
||||
|
||||
----------------------------------------------------------------
|
||||
-- Graphics/ScreenMapControllers action.lua
|
||||
-- The fallback actor that is used when there isn't a specific actor for an
|
||||
-- action. At a minimum, this should display the name of the action, in order
|
||||
-- to correctly handle the possibility of actions being added in the future.
|
||||
-- _fallback's version accomplishes this by being a BitmapText and fetching the
|
||||
-- text from en.ini.
|
||||
----------------------------------------------------------------
|
||||
return Def.BitmapText{
|
||||
Font="Common Normal",
|
||||
InitCommand= cmd(x, SCREEN_CENTER_X; zoom, .75; diffuse, color("#808080")),
|
||||
OnCommand= function(self)
|
||||
self:diffusealpha(0)
|
||||
self:decelerate(0.5)
|
||||
self:diffusealpha(1)
|
||||
-- This code is in the OnCommand because the screen sets the name of this
|
||||
-- actor after loading it. If this code was in the InitCommand, it would
|
||||
-- not work because the name is blank at that point.
|
||||
-- fancy effect: Look at the name (which is set by the screen) to set text
|
||||
-- The name is concatenated with "Action" so that the strings used will be
|
||||
-- unique, next to each other in the language file, and clear in usage.
|
||||
self:settext(
|
||||
THEME:GetString("ScreenMapControllers", "Action" .. self:GetName()))
|
||||
end,
|
||||
OffCommand=cmd(stoptweening;accelerate,0.3;diffusealpha,0;queuecommand,"Hide"),
|
||||
HideCommand=cmd(visible,false),
|
||||
GainFocusCommand=cmd(diffuseshift;effectcolor2,color("#808080");effectcolor1,color("#FFFFFF")),
|
||||
LoseFocusCommand=cmd(stopeffect),
|
||||
}
|
||||
|
||||
----------------------------------------------------------------
|
||||
-- Graphics/ScreenMapControllers <action name>.lua
|
||||
-- Every action can have its own special actor which will be used if it exists.
|
||||
-- Replace "<action name>" with the lowercase name of the action you are making
|
||||
-- an actor for and create the actor you want for that action.
|
||||
-- As of this writing, action names are:
|
||||
-- "clear", "reload", "save", "setlist", "exit"
|
||||
-- Creating actors is discussed in Examples/anatomy_of_an_actor.lua, so an
|
||||
-- example is not provided here.
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
-- Graphics/ScreenMapControllers nosetlistprompt.lua
|
||||
-- This is the actor that is displayed when the player attempts to use the
|
||||
-- SetList (or "Assign List") action without anything in the list.
|
||||
-- It should tell the player that the list is empty and how to add things to
|
||||
-- the list.
|
||||
-- It must handle TweenOn and TweenOff commands.
|
||||
-- TweenOn occurs when the player tries to perform the action and fails.
|
||||
-- TweenOff occurs when the prompt is dismissed.
|
||||
-- _fallback's does this by dimming the screen with a quad and using a
|
||||
-- BitmapText to display the string from the language file.
|
||||
-- Note the use of stoptweening in TweenOn and TweenOff. This is to prevent
|
||||
-- the player from overflowing the tween stack by mashing.
|
||||
----------------------------------------------------------------
|
||||
return Def.ActorFrame{
|
||||
InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y),
|
||||
Def.Quad{
|
||||
InitCommand=cmd(zoomto,SCREEN_WIDTH,SCREEN_HEIGHT;diffuse,Color.Black;diffusealpha,0),
|
||||
TweenOnCommand=cmd(stoptweening;diffusealpha,1;linear,0.5;diffusealpha,0.8),
|
||||
TweenOffCommand=cmd(stoptweening;linear,0.5;diffusealpha,0),
|
||||
},
|
||||
Def.ActorFrame{
|
||||
Def.BitmapText{
|
||||
Font="Common Normal",
|
||||
Text=ScreenString("NoSetListPrompt"),
|
||||
InitCommand=cmd(y,10;wrapwidthpixels,SCREEN_WIDTH-48;diffusealpha,0),
|
||||
TweenOnCommand=cmd(stoptweening;diffusealpha,0;sleep,0.5125;linear,0.125;diffusealpha,1),
|
||||
TweenOffCommand=cmd(stoptweening;linear,0.5;diffusealpha,0),
|
||||
},
|
||||
},
|
||||
}
|
||||
+1
-1
@@ -89,7 +89,7 @@ Macgravel
|
||||
|
||||
hanubeki (@803832, formerly sy567)
|
||||
* Small beginner helper fix
|
||||
(http://www.stepmania.com/forums/showpost.php?p=158721&postcount=12)
|
||||
(http://old.stepmania.com/forums/showpost.php?p=158721&postcount=12)
|
||||
* Lots of code changes from hanubeki-modified-sm-ssc:
|
||||
http://code.google.com/r/hanubeki-modified-sm-ssc/
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ r111 | 20091122 10:21:30
|
||||
------------------------
|
||||
* [ArchHooks_Unix] Follow user's system language as default.
|
||||
[David Santamaría Rogado (howl)]
|
||||
See http://www.stepmania.com/forums/showthread.php?t=21471 for more info.
|
||||
See http://old.stepmania.com/forums/showthread.php?t=21471 for more info.
|
||||
|
||||
r110 | 20091120 14:03:17
|
||||
------------------------
|
||||
@@ -119,7 +119,7 @@ r106 | 20091115 21:33:28
|
||||
------------------------
|
||||
* Prevent focus lost at Fullscreen on X11, fix windowed->fullscreen resolution
|
||||
changes so that they save [David Santamaría Rogado (howl)]
|
||||
(http://www.stepmania.com/forums/showthread.php?t=21430)
|
||||
(http://old.stepmania.com/forums/showthread.php?t=21430)
|
||||
|
||||
r105 | 20091114 15:07:58
|
||||
------------------------
|
||||
@@ -153,7 +153,7 @@ r102 | 20091111 04:00:46
|
||||
r101 | 20091109 19:33:55
|
||||
------------------------
|
||||
* Implemented David Santamaría Rogado (howl)'s patch for loading Splash.png instead of an .xpm
|
||||
(http://www.stepmania.com/forums/showpost.php?p=157340&postcount=3)
|
||||
(http://old.stepmania.com/forums/showpost.php?p=157340&postcount=3)
|
||||
|
||||
r089-100 | 20091103 01:45:01 - 20091109 04:01:31
|
||||
------------------------------------------------
|
||||
@@ -176,7 +176,7 @@ Okay let's just say it's r089 to r100 and call it a week.
|
||||
* r28221: "allow overriding, like PRODUCT_ID" [Glenn Maynard]
|
||||
* r28222-28223: "adding support for pms files" [GRIM657]
|
||||
* The pulseaudio patch [David Santamaría Rogado (howl), OndÅ™ej HoÅ¡ek, Damien Thébault]
|
||||
(see http://www.stepmania.com/forums/showthread.php?t=21348)
|
||||
(see http://old.stepmania.com/forums/showthread.php?t=21348)
|
||||
* Greg Nadja's OpenGL/Windows patch
|
||||
|
||||
* sm-ssc Changes:
|
||||
@@ -784,7 +784,7 @@ r1136 | 20091115 20:43:48
|
||||
[Modified /sm-ssc3/src/arch/LowLevelWindow/LowLevelWindowX11.cpp]
|
||||
-------------------------
|
||||
howl did it
|
||||
http://www.stepmania.com/forums/showthread.php?p=157603#post157603
|
||||
http://old.stepmania.com/forums/showthread.php?p=157603#post157603
|
||||
|
||||
r1137 | 20091115 21:05:36
|
||||
[Modified /sm-ssc3/src/arch/LowLevelWindow/LowLevelWindowX11.cpp]
|
||||
|
||||
@@ -1,153 +1,49 @@
|
||||
local function Fooled()
|
||||
local phrases = {
|
||||
"hornswaggled",
|
||||
"bamboozled",
|
||||
"hoodwinked",
|
||||
"swindled",
|
||||
"duped",
|
||||
"hoaxed",
|
||||
"fleeced",
|
||||
"shafted",
|
||||
"caboodled",
|
||||
"beguiled",
|
||||
"finagled",
|
||||
"two-timed",
|
||||
"suckered",
|
||||
"flimflammed"
|
||||
}
|
||||
return phrases[math.random(#phrases)]
|
||||
end
|
||||
-- To add a section to the credits, use the following:
|
||||
-- local theme_credits= {
|
||||
-- name= "Theme Credits", -- the name of your section
|
||||
-- "Me", -- The people you want to list in your section.
|
||||
-- "Myself",
|
||||
-- "My other self",
|
||||
-- {logo= "pro_dude", name= "Pro self"}, -- Someone who has a logo image.
|
||||
-- -- This logo image would be "Graphics/CreditsLogo pro_dude.png".
|
||||
-- }
|
||||
-- StepManiaCredits.AddSection(theme_credits)
|
||||
--
|
||||
-- If you want to add your section after an existing section, use the following:
|
||||
-- StepManiaCredits.AddSection(theme_credits, 7)
|
||||
--
|
||||
-- Or position can be the name of a section to insert after:
|
||||
-- StepManiaCredits.AddSection(theme_credits, "Special Thanks")
|
||||
--
|
||||
-- Or if you want to add your section before a section:
|
||||
-- StepManiaCredits.AddSection(theme_credits, "Special Thanks", true)
|
||||
|
||||
local ssc = {
|
||||
"AJ Kelly as freem",
|
||||
"Jonathan Payne (Midiman)",
|
||||
"Colby Klein (shakesoda)",
|
||||
}
|
||||
|
||||
local sm_ssc = {
|
||||
"Jason Felds (wolfman2000)", -- Timing Segments, Split Timing, optimization
|
||||
"Thai Pangsakulyanont (theDtTvB)", -- BMS, Split Timing, optimization
|
||||
"Alberto Ramos (Daisuke Master)",
|
||||
"Jack Walstrom (FSX)",
|
||||
}
|
||||
|
||||
local stepmania = {
|
||||
"Chris Danford",
|
||||
"Glenn Maynard",
|
||||
"Steve Checkoway",
|
||||
-- and various other contributors
|
||||
}
|
||||
|
||||
local oitg = {
|
||||
"infamouspat",
|
||||
"Mark Cannon (vyhd)",
|
||||
}
|
||||
|
||||
local contrib = {
|
||||
"Aldo Fregoso (Aldo_MX)", -- delays and much more. StepMania AMX creator
|
||||
"A.C/@waiei", -- custom scoring fixes + Hybrid scoring
|
||||
"cerbo", -- lua bindings and other fun stuff
|
||||
"cesarmades", -- pump/cmd* noteskins
|
||||
"Chris Eldridge (kurisu)", -- dance-threepanel stepstype support
|
||||
"Christophe Goulet-LeBlanc (Kommisar)", -- songs
|
||||
"corec", -- various fixes
|
||||
"galopin", -- piu PlayStation2 usb mat support
|
||||
"gholms", -- automake 1.11 support
|
||||
"juanelote", -- SongManager:GetSongGroupByIndex, JumpToNext/PrevGroup logic mods
|
||||
"Kaox", -- pump/default noteskin
|
||||
"NitroX72", -- pump/frame noteskin
|
||||
"Petriform", -- default theme music
|
||||
"桜為小鳩/Sakurana-Kobato (@sakuraponila)", -- custom scoring fixes
|
||||
"Samuel Kim (1a2a3a2a1a)", -- various beat mode fixes
|
||||
"hanubeki (@803832)", -- beginner helper fix, among various other things
|
||||
"v1toko", -- x-mode from StepNXA
|
||||
"Alfred Sorenson", -- new lua bindings
|
||||
}
|
||||
|
||||
local translators = {
|
||||
"John Reactor (Polish)",
|
||||
"DHalens (Spanish)",
|
||||
"@Niler_jp (Japanese)",
|
||||
"Deamon007 (Dutch)"
|
||||
}
|
||||
|
||||
local thanks = {
|
||||
"A Pseudonymous Coder", -- support
|
||||
"Bill Shillito (DM Ashura)", -- Music (not yet though)
|
||||
"cpubasic13", -- testing (a lot)
|
||||
"Dreamwoods",
|
||||
"Jason Bolt (LightningXCE)",
|
||||
"Jousway", -- Noteskins
|
||||
"Luizsan", -- creator of Delta theme
|
||||
"Matt1360", -- Automake magic + oitg bro
|
||||
"Renard",
|
||||
"Ryan McKanna (Plaguefox)",
|
||||
"Sta Kousin", --help with Japanese bug reports
|
||||
}
|
||||
|
||||
local shoutout = {
|
||||
"The Lua team", -- lua project lead or some shit. super nerdy but oh hell.
|
||||
"Mojang AB", -- minecraft forever -freem
|
||||
"Wolfire Games", -- piles of inspiration
|
||||
"NAKET Coder",
|
||||
"Ciera Boyd", -- you bet your ass I'm putting my girlfriend in the credits
|
||||
--Image(), -- we should have some logos probably to look super pro
|
||||
"#KBO",
|
||||
"Celestia Radio", -- LOVE AND TOLERANCE
|
||||
"You showed us... your ultimate dance",
|
||||
}
|
||||
|
||||
local copyright = {
|
||||
"StepMania is released under the terms of the MIT license.",
|
||||
"If you paid for the program you've been " .. Fooled() .. ".",
|
||||
"All content is the sole property of their respectful owners."
|
||||
}
|
||||
|
||||
local sections = {
|
||||
{ "the spinal shark collective (project lead)", ssc },
|
||||
{ "sm-ssc Team", sm_ssc },
|
||||
{ "StepMania Team", stepmania },
|
||||
{ "OpenITG Team", oitg },
|
||||
{ "Translators", translators },
|
||||
{ "Other Contributors", contrib },
|
||||
{ "Special Thanks", thanks },
|
||||
{ "Shoutouts", shoutout },
|
||||
{ "Copyright", copyright },
|
||||
}
|
||||
|
||||
-- To add people or sections modify the above.
|
||||
-- StepManiaCredits is defined in _fallback/Scripts/04 CreditsHelpers.lua.
|
||||
|
||||
local lineOn = cmd(zoom,0.875;strokecolor,color("#444444");shadowcolor,color("#444444");shadowlength,3)
|
||||
local sectionOn = cmd(diffuse,color("#88DDFF");strokecolor,color("#446688");shadowcolor,color("#446688");shadowlength,3)
|
||||
local item_padding_start = 4;
|
||||
local line_height= 30
|
||||
-- Tell the credits table the line height so it can use it for logo sizing.
|
||||
StepManiaCredits.SetLineHeight(line_height)
|
||||
|
||||
local creditScroller = Def.ActorScroller {
|
||||
SecondsPerItem = 0.5;
|
||||
NumItemsToDraw = 40;
|
||||
TransformFunction = function( self, offset, itemIndex, numItems)
|
||||
self:y(30*offset)
|
||||
self:y(line_height*offset)
|
||||
end;
|
||||
OnCommand = cmd(scrollwithpadding,item_padding_start,15);
|
||||
}
|
||||
|
||||
local function AddLine( text, command )
|
||||
local text = Def.ActorFrame{
|
||||
LoadFont("Common normal")..{
|
||||
Text = text or "";
|
||||
OnCommand = command or lineOn;
|
||||
}
|
||||
}
|
||||
table.insert( creditScroller, text )
|
||||
end
|
||||
|
||||
-- Add sections with padding.
|
||||
for section in ivalues(sections) do
|
||||
AddLine( section[1], sectionOn )
|
||||
for name in ivalues(section[2]) do
|
||||
AddLine( name )
|
||||
for section in ivalues(StepManiaCredits.Get()) do
|
||||
StepManiaCredits.AddLineToScroller(creditScroller, section.name, sectionOn)
|
||||
for name in ivalues(section) do
|
||||
StepManiaCredits.AddLineToScroller(creditScroller, name)
|
||||
end
|
||||
AddLine()
|
||||
AddLine()
|
||||
StepManiaCredits.AddLineToScroller(creditScroller)
|
||||
StepManiaCredits.AddLineToScroller(creditScroller)
|
||||
end
|
||||
|
||||
creditScroller.BeginCommand=function(self)
|
||||
@@ -158,4 +54,4 @@ return Def.ActorFrame{
|
||||
creditScroller..{
|
||||
InitCommand=cmd(CenterX;y,SCREEN_BOTTOM-64),
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
local waitTime = 7.5
|
||||
|
||||
local t = Def.ActorFrame {
|
||||
InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y);
|
||||
OnCommand=cmd(queuecommand,"TweenOn";sleep,waitTime;queuecommand,"TweenOff");
|
||||
}
|
||||
t[#t+1] = Def.Quad {
|
||||
InitCommand=cmd(zoomto,SCREEN_WIDTH,SCREEN_HEIGHT;diffuse,Color.Black);
|
||||
TweenOnCommand=cmd(diffusealpha,1;linear,0.5;diffusealpha,0.8);
|
||||
TweenOffCommand=cmd(linear,0.5;diffusealpha,0);
|
||||
};
|
||||
t[#t+1] = Def.ActorFrame {
|
||||
LoadFont("Common Normal") .. {
|
||||
Text=ScreenString("WarningHeader");
|
||||
InitCommand=cmd(y,-70;diffuse,Color.Red);
|
||||
TweenOnCommand=cmd(diffusealpha,0;zoomx,2;zoomy,0;sleep,0.5;smooth,0.25;zoom,1;diffusealpha,1);
|
||||
TweenOffCommand=cmd(linear,0.5;diffusealpha,0);
|
||||
};
|
||||
LoadFont("Common Normal") .. {
|
||||
Text=ScreenString("WarningText");
|
||||
InitCommand=cmd(y,10;wrapwidthpixels,SCREEN_WIDTH-48);
|
||||
TweenOnCommand=cmd(diffusealpha,0;sleep,0.5125;linear,0.125;diffusealpha,1);
|
||||
TweenOffCommand=cmd(linear,0.5;diffusealpha,0);
|
||||
};
|
||||
};
|
||||
|
||||
return t
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
@@ -0,0 +1,16 @@
|
||||
return Def.BitmapText{
|
||||
Font="Common Normal",
|
||||
InitCommand= cmd(x, SCREEN_CENTER_X; zoom, .75, 0; diffuse, color("#808080")),
|
||||
OnCommand= function(self)
|
||||
self:diffusealpha(0)
|
||||
self:decelerate(0.5)
|
||||
self:diffusealpha(1)
|
||||
-- fancy effect: Look at the name (which is set by the screen) to set text
|
||||
self:settext(
|
||||
THEME:GetString("ScreenMapControllers", "Action" .. self:GetName()))
|
||||
end,
|
||||
OffCommand=cmd(stoptweening;accelerate,0.3;diffusealpha,0;queuecommand,"Hide"),
|
||||
HideCommand=cmd(visible,false),
|
||||
GainFocusCommand=cmd(diffuseshift;effectcolor2,color("#808080");effectcolor1,color("#FFFFFF")),
|
||||
LoseFocusCommand=cmd(stopeffect),
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
return LoadFont("Common Normal") .. {
|
||||
Text="Exit";
|
||||
InitCommand=cmd(x,SCREEN_CENTER_X;zoom,0.75;shadowlength,0;diffuse,color("#808080"));
|
||||
OnCommand=cmd(diffusealpha,0;decelerate,0.5;diffusealpha,1);
|
||||
OffCommand=cmd(stoptweening;accelerate,0.3;diffusealpha,0;queuecommand,"Hide");
|
||||
HideCommand=cmd(visible,false);
|
||||
|
||||
GainFocusCommand=cmd(diffuseshift;effectcolor2,color("#808080");effectcolor1,color("#FFFFFF"));
|
||||
LoseFocusCommand=cmd(stopeffect);
|
||||
};
|
||||
@@ -0,0 +1,17 @@
|
||||
return Def.ActorFrame{
|
||||
InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y),
|
||||
Def.Quad{
|
||||
InitCommand=cmd(zoomto,SCREEN_WIDTH,SCREEN_HEIGHT;diffuse,Color.Black;diffusealpha,0),
|
||||
TweenOnCommand=cmd(stoptweening;diffusealpha,1;linear,0.5;diffusealpha,0.8),
|
||||
TweenOffCommand=cmd(stoptweening;linear,0.5;diffusealpha,0),
|
||||
},
|
||||
Def.ActorFrame{
|
||||
Def.BitmapText{
|
||||
Font="Common Normal",
|
||||
Text=ScreenString("NoSetListPrompt"),
|
||||
InitCommand=cmd(y,10;wrapwidthpixels,SCREEN_WIDTH-48;diffusealpha,0),
|
||||
TweenOnCommand=cmd(stoptweening;diffusealpha,0;sleep,0.5125;linear,0.125;diffusealpha,1),
|
||||
TweenOffCommand=cmd(stoptweening;linear,0.5;diffusealpha,0),
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
return Def.ActorFrame{
|
||||
InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y),
|
||||
Def.Quad{
|
||||
InitCommand=cmd(zoomto,SCREEN_WIDTH,SCREEN_HEIGHT;diffuse,Color.Black),
|
||||
TweenOnCommand=cmd(diffusealpha,1;linear,0.5;diffusealpha,0.8),
|
||||
TweenOffCommand=cmd(linear,0.5;diffusealpha,0),
|
||||
},
|
||||
Def.ActorFrame{
|
||||
Def.BitmapText{
|
||||
Font="Common Normal",
|
||||
Text=ScreenString("WarningHeader"),
|
||||
InitCommand=cmd(y,-80;diffuse,Color.Red),
|
||||
TweenOnCommand=cmd(diffusealpha,0;zoomx,2;zoomy,0;sleep,0.5;smooth,0.25;zoom,1;diffusealpha,1),
|
||||
TweenOffCommand=cmd(linear,0.5;diffusealpha,0),
|
||||
},
|
||||
Def.BitmapText{
|
||||
Font="Common Normal",
|
||||
Text=ScreenString("WarningText"),
|
||||
InitCommand=cmd(y,10;wrapwidthpixels,SCREEN_WIDTH-48),
|
||||
TweenOnCommand=cmd(diffusealpha,0;sleep,0.5125;linear,0.125;diffusealpha,1),
|
||||
TweenOffCommand=cmd(linear,0.5;diffusealpha,0),
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1531,15 +1531,23 @@ Warning=Warning
|
||||
BodyText=The StepMania program source code is licensed under a permissive open-source license.\n\nThe StepMania name and logos are protected by Trademark law.\n\nThe StepMania default theme SOUNDS ARE SEPARATELY OWNED BY THE AUTHORS. ALL OTHER THEME COMPONENTS ARE LICENSED UNDER THE STEPMANIA LICENSE.\n\nSee license.txt for details.
|
||||
|
||||
[ScreenMapControllers]
|
||||
ActionClear=Clear To Default
|
||||
ActionReload=Reload From Disk
|
||||
ActionSave=Save To Disk
|
||||
ActionSetList=Assign List
|
||||
ActionExit=Exit
|
||||
Default=Default
|
||||
HeaderText=Map Controllers
|
||||
InvalidButton=That key can not be mapped.
|
||||
KeyName=Key Name
|
||||
NoSetListPrompt=No entries in the list to set. Add entries to the list by hitting 'm' when the cursor is on them.
|
||||
%s slots=%s slots
|
||||
Primary=Primary
|
||||
SavePrompt=Save settings before exiting?
|
||||
Secondary=Secondary
|
||||
WarningHeader=WARNING!
|
||||
WarningText=Please ensure that you do not overwrite any important keymappings, such as:\n&MENULEFT; LEFT &MENURIGHT; RIGHT &MENUUP; UP &MENUDOWN; DOWN &START; START &BACK; BACK or &SELECT; SELECT. Do not apply keymappings that you do not know the function of or unmap important keys!
|
||||
|
||||
[ScreenMapControllers2]
|
||||
Add Mapping=Add Mapping
|
||||
|
||||
[ScreenNetRoom]
|
||||
Enter a description for the room:=Enter a description for the room:
|
||||
Enter a password for the room (blank, no password):=Enter a password for the room (blank, no password):
|
||||
@@ -1656,6 +1664,9 @@ Cancel=CANCEL
|
||||
HeaderText=High Scores
|
||||
HeaderSubText=Who's the top dog?
|
||||
|
||||
[ScreenContinue]
|
||||
HelpText=&START; Advance Timer
|
||||
|
||||
[ScreenRanking]
|
||||
|
||||
[ScreenSMOnlineLogin]
|
||||
|
||||
@@ -232,7 +232,7 @@ Branch = {
|
||||
end
|
||||
|
||||
if STATSMAN:GetStagesPlayed() == 0 then
|
||||
return "ScreenSelectPlayMode"
|
||||
return "ScreenSelectStyle"
|
||||
end
|
||||
|
||||
return "ScreenProfileLoad"
|
||||
|
||||
@@ -12,7 +12,7 @@ Color = {
|
||||
Yellow = color("#fff200"),
|
||||
Orange = color("#f7941d"),
|
||||
Purple = color("#92278f"),
|
||||
Outline = color("0,0,0,0.675"),
|
||||
Outline = color("0,0,0,0.5"),
|
||||
Invisible = color("1,1,1,0"),
|
||||
Stealth = color("0,0,0,0"),
|
||||
-- Android Design Stencil Colors
|
||||
@@ -47,8 +47,12 @@ setmetatable(Color, { __call = function(self, c) return self[c] end })
|
||||
|
||||
GameColor = {
|
||||
PlayerColors = {
|
||||
PLAYER_1 = color("#ef403d"),
|
||||
PLAYER_2 = color("#0089cf"),
|
||||
PLAYER_1 = color("#ed5565"),
|
||||
PLAYER_2 = color("#5d9cec"),
|
||||
},
|
||||
PlayerDarkColors = {
|
||||
PLAYER_1 = color("#da4453"),
|
||||
PLAYER_2 = color("#4a89dc"),
|
||||
},
|
||||
Difficulty = {
|
||||
--[[ These are for 'Custom' Difficulty Ranks. It can be very useful
|
||||
@@ -126,13 +130,18 @@ function ColorDarkTone(c)
|
||||
end
|
||||
|
||||
function PlayerColor( pn )
|
||||
if pn == PLAYER_1 then return color("#ef403d") end -- pink-red
|
||||
if pn == PLAYER_2 then return color("#0089cf") end -- sea-blue
|
||||
if pn == PLAYER_1 then return GameColor.PlayerColors["PLAYER_1"] end
|
||||
if pn == PLAYER_2 then return GameColor.PlayerColors["PLAYER_2"] end
|
||||
return color("1,1,1,1")
|
||||
end
|
||||
|
||||
function PlayerScoreColor( pn )
|
||||
if pn == PLAYER_1 then return color("#ef403d") end -- pink-red
|
||||
if pn == PLAYER_2 then return color("#0089cf") end -- sea-blue
|
||||
return PlayerColor( pn );
|
||||
end
|
||||
|
||||
function PlayerDarkColor( pn )
|
||||
if pn == PLAYER_1 then return GameColor.PlayerDarkColors["PLAYER_1"] end
|
||||
if pn == PLAYER_2 then return GameColor.PlayerDarkColors["PLAYER_2"] end
|
||||
return color("1,1,1,1")
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,288 @@
|
||||
local function Fooled()
|
||||
local phrases = {
|
||||
"hornswaggled",
|
||||
"bamboozled",
|
||||
"hoodwinked",
|
||||
"swindled",
|
||||
"duped",
|
||||
"hoaxed",
|
||||
"fleeced",
|
||||
"shafted",
|
||||
"caboodled",
|
||||
"beguiled",
|
||||
"finagled",
|
||||
"two-timed",
|
||||
"suckered",
|
||||
"flimflammed",
|
||||
"generous"
|
||||
}
|
||||
return phrases[math.random(#phrases)]
|
||||
end
|
||||
|
||||
local line_height= 30 -- so that actor logos can use it.
|
||||
|
||||
local stepmania_credits= {
|
||||
{
|
||||
name= "the spinal shark collective (project lead)",
|
||||
"AJ Kelly as freem",
|
||||
"Jonathan Payne (Midiman)",
|
||||
"Colby Klein (shakesoda)",
|
||||
},
|
||||
{
|
||||
name= "sm-ssc Team",
|
||||
"Jason Felds (wolfman2000)", -- Timing Segments, Split Timing, optimization
|
||||
"Thai Pangsakulyanont (theDtTvB)", -- BMS, Split Timing, optimization
|
||||
"Alberto Ramos (Daisuke Master)",
|
||||
"Jack Walstrom (FSX)",
|
||||
},
|
||||
{
|
||||
name= "StepMania Team",
|
||||
"Chris Danford",
|
||||
"Glenn Maynard",
|
||||
"Steve Checkoway",
|
||||
-- and various other contributors
|
||||
},
|
||||
{
|
||||
name= "OpenITG Team",
|
||||
"infamouspat",
|
||||
"Mark Cannon (vyhd)",
|
||||
},
|
||||
{
|
||||
name= "Translators",
|
||||
"John Reactor (Polish)",
|
||||
"DHalens (Spanish)",
|
||||
"@Niler_jp (Japanese)",
|
||||
"Deamon007 (Dutch)"
|
||||
},
|
||||
{
|
||||
name= "Other Contributors",
|
||||
"Aldo Fregoso (Aldo_MX)", -- delays and much more. StepMania AMX creator
|
||||
"A.C/@waiei", -- custom scoring fixes + Hybrid scoring
|
||||
"cerbo", -- lua bindings and other fun stuff
|
||||
"cesarmades", -- pump/cmd* noteskins
|
||||
"Chris Eldridge (kurisu)", -- dance-threepanel stepstype support
|
||||
"Christophe Goulet-LeBlanc (Kommisar)", -- songs
|
||||
"corec", -- various fixes
|
||||
"cybik", -- Android port
|
||||
"dbk2", -- mac builds, a couple actor behavior fixes, new lua bindings
|
||||
"djpohly", -- piuio kernel module, XML compatibility, other useful stuff
|
||||
"galopin", -- piu PlayStation2 usb mat support
|
||||
"gholms", -- automake 1.11 support
|
||||
"juanelote", -- SongManager:GetSongGroupByIndex, JumpToNext/PrevGroup logic mods
|
||||
"Kaox", -- pump/default noteskin
|
||||
-- Add Graphics/CreditsLogo name.png and change your entry to a table like this to look super pro.
|
||||
{logo= "kyzentun", name= "Kyzentun"}, -- new lua bindings, theme documentation
|
||||
"Mad Matt", -- new lua bindings
|
||||
"NitroX72", -- pump/frame noteskin
|
||||
"Petriform", -- default theme music
|
||||
"桜為小鳩/Sakurana-Kobato (@sakuraponila)", -- custom scoring fixes
|
||||
"Samuel Kim (1a2a3a2a1a)", -- various beat mode fixes
|
||||
"hanubeki (@803832)", -- beginner helper fix, among various other things
|
||||
"v1toko", -- x-mode from StepNXA
|
||||
"Alfred Sorenson", -- new lua bindings
|
||||
},
|
||||
{
|
||||
name= "Special Thanks",
|
||||
"A Pseudonymous Coder", -- support
|
||||
"Bill Shillito (DM Ashura)", -- Music (not yet though)
|
||||
"cpubasic13", -- testing (a lot)
|
||||
"Dreamwoods",
|
||||
"Jason Bolt (LightningXCE)",
|
||||
"Jousway", -- Noteskins
|
||||
"Luizsan", -- creator of Delta theme
|
||||
"Matt1360", -- Automake magic + oitg bro
|
||||
"Renard",
|
||||
"Ryan McKanna (Plaguefox)",
|
||||
"Sta Kousin", --help with Japanese bug reports
|
||||
},
|
||||
{
|
||||
name= "Shoutouts",
|
||||
"The Lua team", -- lua project lead or some shit. super nerdy but oh hell.
|
||||
{logo= "mojang", name= "Mojang AB"}, -- minecraft forever -freem
|
||||
"Wolfire Games", -- piles of inspiration
|
||||
"NAKET Coder",
|
||||
"Ciera Boyd", -- you bet your ass I'm putting my girlfriend in the credits -shakesoda
|
||||
"#KBO",
|
||||
"Celestia Radio", -- LOVE AND TOLERANCE
|
||||
"You showed us... your ultimate dance",
|
||||
},
|
||||
}
|
||||
|
||||
local kyzentuns_fancy_value= 16
|
||||
|
||||
local special_logos= {
|
||||
kyzentun= Def.ActorMultiVertex{
|
||||
Name= "logo",
|
||||
Texture= THEME:GetPathG("CreditsLogo", "kyzentun"),
|
||||
OnCommand= function(self)
|
||||
self:SetDrawState{Mode= "DrawMode_Quads"}
|
||||
kyzentuns_fancy_value= math.random(2, 32)
|
||||
self:playcommand("fancy", {state= 0})
|
||||
self:queuecommand("normal_state")
|
||||
end,
|
||||
fancyCommand= function(self, params)
|
||||
local verts= {}
|
||||
local rlh= line_height - 2
|
||||
local sx= rlh * -1
|
||||
local sy= rlh * -.5
|
||||
local sp= rlh / kyzentuns_fancy_value
|
||||
local spt= 1 / kyzentuns_fancy_value
|
||||
local c= color("#ffffff")
|
||||
for x= 1, kyzentuns_fancy_value do
|
||||
local lx= sx + (sp * (x-1))
|
||||
local rx= sx + (sp * x)
|
||||
local ltx= spt * (x-1)
|
||||
local rtx= spt * x
|
||||
for y= 1, kyzentuns_fancy_value do
|
||||
local ty= sy + (sp * (y-1))
|
||||
local by= sy + (sp * y)
|
||||
local tty= spt * (y-1)
|
||||
local bty= spt * y
|
||||
if params.state == 1 then
|
||||
ltx= 0
|
||||
rtx= 1
|
||||
tty= 0
|
||||
bty= 1
|
||||
end
|
||||
verts[#verts+1]= {{lx, ty, 0}, {ltx, tty}, c}
|
||||
verts[#verts+1]= {{rx, ty, 0}, {rtx, tty}, c}
|
||||
verts[#verts+1]= {{rx, by, 0}, {rtx, bty}, c}
|
||||
verts[#verts+1]= {{lx, by, 0}, {ltx, bty}, c}
|
||||
end
|
||||
end
|
||||
self:SetVertices(verts)
|
||||
end,
|
||||
normal_stateCommand= function(self)
|
||||
self:linear(1)
|
||||
self:playcommand("fancy", {state= 0})
|
||||
self:queuecommand("split_state")
|
||||
end,
|
||||
split_stateCommand= function(self)
|
||||
self:linear(1)
|
||||
self:playcommand("fancy", {state= 1})
|
||||
self:queuecommand("normal_state")
|
||||
end,
|
||||
},
|
||||
mojang= Def.Actor{
|
||||
Name= "logo",
|
||||
OnCommand= function(self)
|
||||
self:GetParent():GetChild("name"):distort(.25) -- minecraft is broken, -kyz
|
||||
end
|
||||
}
|
||||
}
|
||||
|
||||
-- Go through the credits and swap in the special logos.
|
||||
for section in ivalues(stepmania_credits) do
|
||||
for entry in ivalues(section) do
|
||||
if type(entry) == "table" and special_logos[entry.logo] then
|
||||
entry.logo= special_logos[entry.logo]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function position_logo(self)
|
||||
local name= self:GetParent():GetChild("name")
|
||||
local name_width= name:GetZoomedWidth()
|
||||
local logo_width= self:GetZoomedWidth()
|
||||
self:x(0 - (name_width / 2) - 4 - (logo_width / 2))
|
||||
end
|
||||
|
||||
StepManiaCredits= {
|
||||
AddSection= function(section, pos, insert_before)
|
||||
if not section.name then
|
||||
lua.ReportScriptError("A section being added to the credits must have a name field.")
|
||||
return
|
||||
end
|
||||
if #section < 1 then
|
||||
lua.ReportScriptError("Adding a blank section to the credits doesn't make sense.")
|
||||
return
|
||||
end
|
||||
if type(pos) == "string" then
|
||||
for i, section in ipairs(stepmania_credits) do
|
||||
if section.name == pos then
|
||||
pos= i -- insert_after is default behavior
|
||||
end
|
||||
end
|
||||
end
|
||||
if pos and type(pos) ~= "number" then
|
||||
lua.ReportScriptError("Credits section '" .. tostring(pos) .. " not found, cannot use position to add new section.")
|
||||
return
|
||||
end
|
||||
pos= pos or #stepmania_credits
|
||||
if insert_before then
|
||||
pos= pos - 1
|
||||
end
|
||||
-- table.insert does funny things if you pass an index <= 0
|
||||
if pos < 1 then
|
||||
lua.ReportScriptError("Cannot add credits section at position " .. tostring(pos) .. ".")
|
||||
return
|
||||
end
|
||||
table.insert(stepmania_credits, pos, section)
|
||||
end,
|
||||
AddLineToScroller= function(scroller, text, command)
|
||||
if type(scroller) ~= "table" then
|
||||
lua.ReportScriptError("scroller passed to AddLineToScroller must be an actor table.")
|
||||
return
|
||||
end
|
||||
local actor_to_insert
|
||||
if type(text) == "string" or not text then
|
||||
actor_to_insert= Def.ActorFrame{
|
||||
Def.BitmapText{
|
||||
Font= "Common Normal",
|
||||
Text = text or "";
|
||||
OnCommand = command or lineOn;
|
||||
}
|
||||
}
|
||||
elseif type(text) == "table" then
|
||||
actor_to_insert= Def.ActorFrame{
|
||||
Def.BitmapText{
|
||||
Name= "name", Font= "Common Normal",
|
||||
Text = text.name or "",
|
||||
InitCommand = command or lineOn,
|
||||
},
|
||||
}
|
||||
if text.logo then
|
||||
if type(text.logo) == "string" then
|
||||
actor_to_insert[#actor_to_insert+1]= Def.Sprite{
|
||||
Name= "logo",
|
||||
InitCommand= function(self)
|
||||
-- Use LoadBanner to disable the odd dimension warning.
|
||||
self:LoadBanner(THEME:GetPathG("CreditsLogo", text.logo))
|
||||
-- Scale to slightly less than the line height for padding.
|
||||
local yscale= (line_height-2) / self:GetHeight()
|
||||
self:zoom(yscale)
|
||||
-- Position logo to the left of the name.
|
||||
position_logo(self)
|
||||
end
|
||||
}
|
||||
else -- assume logo is an actor
|
||||
-- Insert positioning InitCommand.
|
||||
text.logo.InitCommand= position_logo
|
||||
actor_to_insert[#actor_to_insert+1]= text.logo
|
||||
end
|
||||
end
|
||||
end
|
||||
table.insert(scroller, actor_to_insert)
|
||||
end,
|
||||
Get= function()
|
||||
-- Copy the base credits and add the copyright message at the end.
|
||||
local ret= DeepCopy(stepmania_credits)
|
||||
ret[#ret+1]= StepManiaCredits.RandomCopyrightMessage()
|
||||
return ret
|
||||
end,
|
||||
RandomCopyrightMessage= function()
|
||||
return {
|
||||
name= "Copyright",
|
||||
"StepMania is released under the terms of the MIT license.",
|
||||
"If you paid for the program you've been " .. Fooled() .. ".",
|
||||
"All content is the sole property of their respectful owners."
|
||||
}
|
||||
end,
|
||||
SetLineHeight= function(height)
|
||||
if type(height) ~= "number" then
|
||||
lua.ReportScriptError("height passed to StepManiaCredits.SetLineHeight must be a number.")
|
||||
return
|
||||
end
|
||||
line_height= height
|
||||
end
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
# This probably is hard to understand from the way it was made in the first
|
||||
# This probably is hard to understand from the way it was made in the first
|
||||
# place, so instead just pay attention to each group, which has tons of notes.
|
||||
|
||||
# 01 # Global
|
||||
@@ -68,7 +68,7 @@ PercentScoreDecimalPlaces=2
|
||||
# 02 #
|
||||
|
||||
[LightsManager]
|
||||
# Mostly useless since it doesn't work, as well as that barely anyone has
|
||||
# Mostly useless since it doesn't work, as well as that barely anyone has
|
||||
# lights to play around with.
|
||||
GameButtonsToShow=""
|
||||
# these metrics don't exist yet, but are planned:
|
||||
@@ -83,9 +83,9 @@ NumFixedProfiles=1
|
||||
|
||||
[SongManager]
|
||||
# SSC: Determine what the ES/OMES Modifiers are
|
||||
ExtraStagePlayerModifiers="default,1.5x,reverse"
|
||||
ExtraStagePlayerModifiers="default,2x,reverse"
|
||||
ExtraStageStageModifiers="failimmediatecontinue,norecover"
|
||||
OMESPlayerModifiers="default,1.5x,reverse"
|
||||
OMESPlayerModifiers="default,2x,reverse"
|
||||
OMESStageModifiers="failimmediate,suddendeath"
|
||||
|
||||
# How many different colors you can have in the MusicWheel
|
||||
@@ -175,10 +175,10 @@ UnlockNames=""
|
||||
# to use to store the unlock.
|
||||
# Unlock2Command=song,"ABC";code,"59183751";roulette
|
||||
|
||||
# 03 #
|
||||
# 03 #
|
||||
|
||||
[ArrowEffects]
|
||||
# Complicated stuff you probably shouldn't ever mess with or else you'll
|
||||
# Complicated stuff you probably shouldn't ever mess with or else you'll
|
||||
# destroy mods completely! It's unknown why these were made into metrics.
|
||||
FrameWidthEffectsPixelsPerSecond=400
|
||||
FrameWidthEffectsMinMultiplier=0.5
|
||||
@@ -475,7 +475,7 @@ SortLevel4Color=color("1,1,0,1")
|
||||
SortLevel5Color=color("0,1,0,1")
|
||||
|
||||
[CustomDifficulty]
|
||||
# Custom system that lets you rename certain classes of difficulties to
|
||||
# Custom system that lets you rename certain classes of difficulties to
|
||||
# something else. Mostly for custom games and game emulation, PIU for example.
|
||||
|
||||
#Names="PumpHard,PumpFreestyle,PumpNightmare"
|
||||
@@ -858,7 +858,7 @@ RightY=12
|
||||
[MenuTimer]
|
||||
WarningStart=10
|
||||
WarningBeepStart=10
|
||||
# I don't like it
|
||||
# I don't like it
|
||||
# -- Midiman
|
||||
# MaxStallSeconds=7.5
|
||||
MaxStallSeconds=0
|
||||
@@ -1897,7 +1897,9 @@ Fallback="ScreenSplash"
|
||||
PrepareScreen=""
|
||||
NextScreen=Branch.StartGame()
|
||||
PrevScreen=Branch.TitleMenu()
|
||||
TimerSeconds=3
|
||||
TimerSeconds=10
|
||||
TimerStealth=true
|
||||
ForceTimer=true
|
||||
AllowStartToSkip=true
|
||||
|
||||
[ScreenProfileLoad]
|
||||
@@ -2855,43 +2857,82 @@ Fallback="ScreenOptionsServiceChild"
|
||||
NextScreen="ScreenOptionsService"
|
||||
HelpText=Screen.String("HelpTextMapControllers")
|
||||
#
|
||||
ScreenOnCommand=%function(self) MESSAGEMAN:Broadcast("KeyConfigRequestStall"); self:lockinput(5); end;
|
||||
# This locks the input when the screen starts.
|
||||
LockInputSecs=2.5
|
||||
# The warning cannot be dismissed until this time expires.
|
||||
# This is additional time after LockInputSecs expires before the warning
|
||||
# will be sent the TweenOff command.
|
||||
AutoDismissWarningSecs=2.5
|
||||
# This is the number of lines that are visible on screen. Set this if you
|
||||
# have a footer that covers up the bottom area of the screen. The purpose
|
||||
# is to have the settings visible on screen even when the player's cursor is
|
||||
# on the exit choice.
|
||||
LinesVisible=16
|
||||
# This sets how long the NoSetListPrompt will show before being sent TweenOff.
|
||||
AutoDismissNoSetListPromptSecs=5
|
||||
#
|
||||
# The position of the Devices list and its On/Off commands.
|
||||
DevicesX=SCREEN_CENTER_X
|
||||
DevicesY=SCREEN_TOP+24
|
||||
DevicesOnCommand=zoom,0.75;draworder,5;strokecolor,color("0,0,0,1")
|
||||
DevicesOffCommand=
|
||||
#
|
||||
# The ListHeader parts are the row that the player's cursor starts on with
|
||||
# the names of the columns.
|
||||
ListHeaderP1S1Command=x,SCREEN_CENTER_X-270
|
||||
ListHeaderP1S2Command=x,SCREEN_CENTER_X-195
|
||||
ListHeaderP1S3Command=x,SCREEN_CENTER_X-120
|
||||
ListHeaderP2S1Command=x,SCREEN_CENTER_X+120
|
||||
ListHeaderP2S2Command=x,SCREEN_CENTER_X+195
|
||||
ListHeaderP2S3Command=x,SCREEN_CENTER_X+270
|
||||
# ListHeaderCenterOnCommand is for the center element of the ListHeader.
|
||||
ListHeaderCenterOnCommand=x,SCREEN_CENTER_X;y,-6;zoom,0.7;shadowlength,1;ztest,true
|
||||
# These commands are shared by all the ListHeader parts.
|
||||
ListHeaderOnCommand=diffuse,color("#808080");shadowlength,0;max_dimension_use_zoom,true;zoom,0.75;maxwidth,130;
|
||||
ListHeaderGainFocusCommand=diffuse,color("#808080");diffuseshift;effectcolor2,color("#808080");effectcolor1,color("#FFFFFF")
|
||||
ListHeaderLoseFocusCommand=diffuse,color("#808080");stopeffect
|
||||
#
|
||||
# You want to leave the list of buttons to map so that all buttons for the
|
||||
# current game type will be mappable.
|
||||
ButtonsToMap=""
|
||||
#
|
||||
# The positions of the elements showing what is mapped.
|
||||
MappedToP1S1Command=x,SCREEN_CENTER_X-270
|
||||
MappedToP1S2Command=x,SCREEN_CENTER_X-195
|
||||
MappedToP1S3Command=x,SCREEN_CENTER_X-120
|
||||
MappedToP2S1Command=x,SCREEN_CENTER_X+120
|
||||
MappedToP2S2Command=x,SCREEN_CENTER_X+195
|
||||
MappedToP2S3Command=x,SCREEN_CENTER_X+270
|
||||
#
|
||||
MappedToOnCommand=diffuse,color("#808080");shadowlength,0;maxwidth,150;zoom,0.75
|
||||
# These commands are shared between all the elements.
|
||||
MappedToOnCommand=diffuse,color("#808080");shadowlength,0;zoom,0.75;max_dimension_use_zoom,true;maxwidth,130
|
||||
# WaitingCommand is executed when the player hits enter to set a key.
|
||||
MappedToWaitingCommand=diffuse,color("#FF8080");pulse;effectperiod,0.5;effectmagnitude,0.8,1.3,0
|
||||
# MappedInputCommand is executed after the player maps the key.
|
||||
MappedToMappedInputCommand=diffuse,color("#808080");diffuseshift;effectcolor2,color("#808080");effectcolor1,color("#FFFFFF")
|
||||
MappedToGainFocusCommand=diffuse,color("#808080");diffuseshift;effectcolor2,color("#808080");effectcolor1,color("#FFFFFF")
|
||||
MappedToLoseFocusCommand=diffuse,color("#808080");stopeffect
|
||||
# GainMarkCommand is executed when the player adds the element to the set list.
|
||||
MappedToGainMarkCommand=textglowmode,'TextGlowMode_Inner';glow,color("#FF00007f")
|
||||
# LoseMarkCommand is executed when the player removes the element from the set list.
|
||||
MappedToLoseMarkCommand=textglowmode,'TextGlowMode_Inner';glow,color("#FF000000")
|
||||
#
|
||||
# The LineScroller is an ActorScroller that controls the positioning of the
|
||||
# rows.
|
||||
LineScrollerOnCommand=%function(self) self:draworder(-1); self:y(64) self:setsecondsperitem(0.1) self:SetTransformFromHeight(24) end
|
||||
LineScrollerOffCommand=
|
||||
LineHideCommand=visible,false
|
||||
LineOnCommand=%function(self) self:y(0); self:visible(true); local LeftToRight = math.mod(self.ItemIndex, 2) == 0 and 1 or -1; self:addx(-SCREEN_WIDTH * LeftToRight); end
|
||||
LineOffCommand=%function(self) local LeftToRight = math.mod(self.ItemIndex, 2) == 0 and 1 or -1; self:stoptweening() self:accelerate(0.3); self:addx(SCREEN_WIDTH * LeftToRight); self:queuecommand('Hide') end
|
||||
#
|
||||
ErrorX=SCREEN_CENTER_X
|
||||
ErrorY=SCREEN_CENTER_Y
|
||||
ErrorOnCommand=diffuse,color("#00FF00");zoom,0.8
|
||||
# The "P1 slots" and "P2 slots" labels. Use the entries in en.ini to change text.
|
||||
LabelP1OnCommand=x,SCREEN_CENTER_X*0.4;zoom,0.7;shadowlength,1
|
||||
LabelP1OffCommand=linear,0.5;diffusealpha,0
|
||||
LabelP2OnCommand=x,SCREEN_CENTER_X*1.6;zoom,0.7;shadowlength,1
|
||||
LabelP2OffCommand=linear,0.5;diffusealpha,0
|
||||
# The primary effect of keys on this row.
|
||||
PrimaryOnCommand=x,SCREEN_CENTER_X;y,-6;zoom,0.7;shadowlength,1;ztest,true
|
||||
# The secondary effect of keys on this row.
|
||||
SecondaryOnCommand=x,SCREEN_CENTER_X;y,6;zoom,0.5;shadowlength,1;ztest,true
|
||||
ShowExitRow=true
|
||||
|
||||
[ScreenTestInput]
|
||||
Class="ScreenTestInput"
|
||||
@@ -3759,11 +3800,11 @@ Fallback="ScreenOptionsSimpleService"
|
||||
NextScreen=Branch.TitleMenu()
|
||||
PrevScreen=Branch.TitleMenu()
|
||||
|
||||
LineNames="1,2,3,4"
|
||||
LineNames="1,2,3"
|
||||
Line1="gamecommand;screen,ScreenEditMenu;name,Edit Songs/Steps"
|
||||
Line2="gamecommand;screen,ScreenPracticeMenu;name,Practice Songs/Steps"
|
||||
Line3="gamecommand;screen,ScreenEditCourseModsMenu;name,Edit Courses/Mods"
|
||||
Line4="gamecommand;screen,ScreenOptionsExportPackage;name,Export Packages"
|
||||
#Line4="gamecommand;screen,ScreenOptionsExportPackage;name,Export Packages"
|
||||
|
||||
# broken:
|
||||
# Line4="gamecommand;screen,ScreenOptionsManageCourses;name,Edit Courses"
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
local t = Def.ActorFrame {};
|
||||
|
||||
t[#t+1] = Def.ActorFrame {
|
||||
InitCommand=cmd(Center);
|
||||
Def.Sprite {
|
||||
OnCommand=function(self)
|
||||
if GAMESTATE:GetCurrentSong() then
|
||||
@@ -20,7 +19,7 @@ t[#t+1] = Def.ActorFrame {
|
||||
end;
|
||||
};
|
||||
Def.Quad {
|
||||
InitCommand=cmd(scaletoclipped,SCREEN_WIDTH+1,SCREEN_HEIGHT);
|
||||
InitCommand=cmd(Center;scaletoclipped,SCREEN_WIDTH+1,SCREEN_HEIGHT);
|
||||
OnCommand=cmd(diffuse,color("#FFCB05");diffusebottomedge,color("#F0BA00");diffusealpha,0.45);
|
||||
};
|
||||
};
|
||||
|
||||
@@ -70,13 +70,13 @@ local t = LoadFallbackB();
|
||||
|
||||
t[#t+1] = StandardDecorationFromFileOptional("StageDisplay","StageDisplay");
|
||||
|
||||
if ShowStandardDecoration("GraphDisplay") then
|
||||
if ShowStandardDecoration("GraphDisplay") and not GAMESTATE:GetPlayMode() == "PlayMode_Rave" then
|
||||
for pn in ivalues(GAMESTATE:GetHumanPlayers()) do
|
||||
t[#t+1] = StandardDecorationFromTable( "GraphDisplay" .. ToEnumShortString(pn), GraphDisplay(pn) );
|
||||
end
|
||||
end
|
||||
|
||||
if ShowStandardDecoration("ComboGraph") then
|
||||
if ShowStandardDecoration("ComboGraph") and not GAMESTATE:GetPlayMode() == "PlayMode_Rave" then
|
||||
for pn in ivalues(GAMESTATE:GetHumanPlayers()) do
|
||||
t[#t+1] = StandardDecorationFromTable( "ComboGraph" .. ToEnumShortString(pn), ComboGraph(pn) );
|
||||
end
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
return LoadFont("Common Normal") .. {
|
||||
Text=ScreenString("Feet");
|
||||
BeginCommand=function(self)
|
||||
self:AddAttribute(5, {Length= 4, Diffuse=Color.Red})
|
||||
end;
|
||||
};
|
||||
@@ -0,0 +1,18 @@
|
||||
return Def.ActorFrame {
|
||||
LoadActor(THEME:GetPathB("_frame","3x3"),"rounded black",380,80);
|
||||
Def.Quad {
|
||||
Name="Underline";
|
||||
InitCommand=cmd(y,-12);
|
||||
OnCommand=cmd(diffuse,color("#ffd400");shadowlength,1;zoomtowidth,192;fadeleft,0.25;faderight,0.25);
|
||||
};
|
||||
LoadFont("Common Bold") .. {
|
||||
Text=ScreenString("Information");
|
||||
InitCommand=cmd(y,-26);
|
||||
OnCommand=cmd(skewx,-0.125;diffuse,color("#ffd400");shadowlength,2;shadowcolor,BoostColor(color("#ffd40077"),0.25))
|
||||
};
|
||||
LoadFont("Common Normal") .. {
|
||||
Text=ScreenString("Jump");
|
||||
InitCommand=cmd(y,18;wrapwidthpixels,480;vertspacing,-12;shadowlength,1);
|
||||
OnCommand=cmd(zoom,0.875);
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,18 @@
|
||||
return Def.ActorFrame {
|
||||
LoadActor(THEME:GetPathB("_frame","3x3"),"rounded black",380,80);
|
||||
Def.Quad {
|
||||
Name="Underline";
|
||||
InitCommand=cmd(y,-12);
|
||||
OnCommand=cmd(diffuse,color("#ffd400");shadowlength,1;zoomtowidth,192;fadeleft,0.25;faderight,0.25);
|
||||
};
|
||||
LoadFont("Common Bold") .. {
|
||||
Text=ScreenString("Information");
|
||||
InitCommand=cmd(y,-26);
|
||||
OnCommand=cmd(skewx,-0.125;diffuse,color("#ffd400");shadowlength,2;shadowcolor,BoostColor(color("#ffd40077"),0.25))
|
||||
};
|
||||
LoadFont("Common Normal") .. {
|
||||
Text=ScreenString("Miss");
|
||||
InitCommand=cmd(y,18;wrapwidthpixels,480;vertspacing,-12;shadowlength,1);
|
||||
OnCommand=cmd(zoom,0.75);
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,18 @@
|
||||
return Def.ActorFrame {
|
||||
LoadActor(THEME:GetPathB("_frame","3x3"),"rounded black",380,80);
|
||||
Def.Quad {
|
||||
Name="Underline";
|
||||
InitCommand=cmd(y,-12);
|
||||
OnCommand=cmd(diffuse,color("#ffd400");shadowlength,1;zoomtowidth,192;fadeleft,0.25;faderight,0.25);
|
||||
};
|
||||
LoadFont("Common Bold") .. {
|
||||
Text=ScreenString("Information");
|
||||
InitCommand=cmd(y,-26);
|
||||
OnCommand=cmd(skewx,-0.125;diffuse,color("#ffd400");shadowlength,2;shadowcolor,BoostColor(color("#ffd40077"),0.25))
|
||||
};
|
||||
LoadFont("Common Normal") .. {
|
||||
Text=ScreenString("Tap");
|
||||
InitCommand=cmd(y,18;wrapwidthpixels,480;vertspacing,-12;shadowlength,1);
|
||||
OnCommand=cmd(zoom,0.875);
|
||||
};
|
||||
};
|
||||
@@ -1,6 +0,0 @@
|
||||
return Def.ActorFrame{
|
||||
LoadActor("jumpmessage") .. {
|
||||
InitCommand=cmd(x,SCREEN_CENTER_X+160;y,SCREEN_CENTER_Y+40;diffusealpha,0;);
|
||||
ShowCommand=cmd(linear,0;diffusealpha,1;sleep,1.7;linear,0;diffusealpha,0);
|
||||
};
|
||||
};
|
||||
@@ -1,6 +0,0 @@
|
||||
return Def.ActorFrame{
|
||||
LoadActor("missmessage") .. {
|
||||
InitCommand=cmd(x,SCREEN_CENTER_X+160;y,SCREEN_CENTER_Y+40;diffusealpha,0;);
|
||||
ShowCommand=cmd(linear,0;diffusealpha,1;sleep,22.7;linear,0;diffusealpha,0);
|
||||
};
|
||||
};
|
||||
@@ -1,6 +0,0 @@
|
||||
return Def.ActorFrame{
|
||||
LoadActor("tapmessage") .. {
|
||||
InitCommand=cmd(x,SCREEN_CENTER_X+160;y,SCREEN_CENTER_Y+40;diffusealpha,0;);
|
||||
ShowCommand=cmd(linear,0;diffusealpha,1;sleep,2;linear,0;diffusealpha,0);
|
||||
};
|
||||
};
|
||||
@@ -45,31 +45,50 @@ return Def.ActorFrame {
|
||||
};
|
||||
|
||||
-- messages
|
||||
LoadFont("Common Normal") .. {
|
||||
LoadFont("Common Bold") .. {
|
||||
Text=ScreenString("How To Play StepMania"),
|
||||
InitCommand=cmd(zbuffer,1;z,20;x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;shadowlength,1;strokecolor,Color("Outline"));
|
||||
OnCommand=cmd(diffusealpha,0;zoom,4;sleep,0.0;linear,0.3;diffusealpha,1;zoom,1;sleep,1.8;linear,0.3;zoom,0.75;x,170;y,60);
|
||||
BeginCommand=function(self)
|
||||
self:AddAttribute(12, {Length=9, Diffuse=Color.White});
|
||||
end;
|
||||
OnCommand=cmd(skewx,-0.125;diffuse,color("#ffd400");shadowlength,2;shadowcolor,BoostColor(color("#ffd40077"),0.25);diffusealpha,0;zoom,4;sleep,0.0;linear,0.3;diffusealpha,1;zoom,1;sleep,1.8;linear,0.3;zoom,0.75;x,170;y,60);
|
||||
};
|
||||
LoadActor("feet") .. {
|
||||
OnCommand=cmd(z,20;x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;addx,-SCREEN_WIDTH;sleep,2.4;decelerate,0.3;addx,SCREEN_WIDTH;sleep,2;linear,0.3;zoomy,0);
|
||||
LoadActor("_howtoplay feet") .. {
|
||||
InitCommand=cmd(shadowlength,1;strokecolor,Color.Outline);
|
||||
OnCommand=cmd(z,20;x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;addx,-SCREEN_WIDTH;sleep,2.4;decelerate,0.3;addx,SCREEN_WIDTH;sleep,2;linear,0.3;zoomy,0);
|
||||
};
|
||||
|
||||
LoadActor("_message tap")..{
|
||||
OnCommand=cmd(sleep,6;queuecommand,"Show");
|
||||
};
|
||||
LoadActor("_message tap")..{
|
||||
OnCommand=cmd(sleep,9.7;queuecommand,"Show");
|
||||
};
|
||||
LoadActor("_message tap")..{
|
||||
OnCommand=cmd(sleep,12.7;queuecommand,"Show");
|
||||
};
|
||||
LoadActor("_message tap")..{
|
||||
OnCommand=cmd(sleep,15.7;queuecommand,"Show");
|
||||
};
|
||||
LoadActor("_message jump")..{
|
||||
OnCommand=cmd(sleep,18.7;queuecommand,"Show");
|
||||
};
|
||||
LoadActor("_message miss")..{
|
||||
OnCommand=cmd(sleep,22.7;queuecommand,"Show");
|
||||
Def.ActorFrame {
|
||||
InitCommand=cmd(x,SCREEN_CENTER_X+120;y,SCREEN_CENTER_Y+40);
|
||||
|
||||
LoadActor("_howtoplay tap")..{
|
||||
InitCommand=cmd(diffusealpha,0);
|
||||
ShowCommand=cmd(linear,0;diffusealpha,1;sleep,2;linear,0;diffusealpha,0);
|
||||
OnCommand=cmd(sleep,6;queuecommand,"Show");
|
||||
};
|
||||
LoadActor("_howtoplay tap")..{
|
||||
InitCommand=cmd(diffusealpha,0);
|
||||
ShowCommand=cmd(linear,0;diffusealpha,1;sleep,2;linear,0;diffusealpha,0);
|
||||
OnCommand=cmd(sleep,9.7;queuecommand,"Show");
|
||||
};
|
||||
LoadActor("_howtoplay tap")..{
|
||||
InitCommand=cmd(diffusealpha,0);
|
||||
ShowCommand=cmd(linear,0;diffusealpha,1;sleep,2;linear,0;diffusealpha,0);
|
||||
OnCommand=cmd(sleep,12.7;queuecommand,"Show");
|
||||
};
|
||||
LoadActor("_howtoplay tap")..{
|
||||
InitCommand=cmd(diffusealpha,0);
|
||||
ShowCommand=cmd(linear,0;diffusealpha,1;sleep,2;linear,0;diffusealpha,0);
|
||||
OnCommand=cmd(sleep,15.7;queuecommand,"Show");
|
||||
};
|
||||
LoadActor("_howtoplay jump")..{
|
||||
InitCommand=cmd(diffusealpha,0);
|
||||
ShowCommand=cmd(linear,0;diffusealpha,1;sleep,2;linear,0;diffusealpha,0);
|
||||
OnCommand=cmd(sleep,18.7;queuecommand,"Show");
|
||||
};
|
||||
LoadActor("_howtoplay miss")..{
|
||||
InitCommand=cmd(diffusealpha,0);
|
||||
ShowCommand=cmd(linear,0;diffusealpha,1;sleep,2;linear,0;diffusealpha,0);
|
||||
OnCommand=cmd(sleep,22.7;queuecommand,"Show");
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
local num_players = GAMESTATE:GetHumanPlayers();
|
||||
local function PositionItem(i,max)
|
||||
local x_spacing = 128;
|
||||
return x_spacing * (i-(max-1)/2);
|
||||
end
|
||||
|
||||
|
||||
local t = Def.ActorFrame {
|
||||
FOV=90;
|
||||
--
|
||||
@@ -5,22 +12,59 @@ local t = Def.ActorFrame {
|
||||
InitCommand=cmd(zoomto,SCREEN_CENTER_X+80,SCREEN_HEIGHT);
|
||||
OnCommand=cmd(diffuse,Color.Black;diffusealpha,0.75;fadeleft,32/SCREEN_CENTER_X;faderight,32/SCREEN_CENTER_X);
|
||||
};
|
||||
LoadActor( NOTESKIN:GetPathForNoteSkin("Center","Tap","cmd") ) .. {
|
||||
InitCommand=cmd(y,20);
|
||||
};
|
||||
LoadFont("Common Bold") .. {
|
||||
Text="PRESS";
|
||||
InitCommand=cmd(y,-20);
|
||||
OnCommand=cmd(shadowlength,1;pulse;effectmagnitude,1,1.125,1;effectperiod,0.5);
|
||||
};
|
||||
LoadFont("Common Bold") .. {
|
||||
Text="TO START";
|
||||
InitCommand=cmd(y,58);
|
||||
OnCommand=cmd(shadowlength,1;zoom,0.875);
|
||||
};
|
||||
--
|
||||
for i=1,#num_players do
|
||||
local f = Def.ActorFrame {
|
||||
InitCommand=cmd(x,-128+PositionItem(i,#num_players));
|
||||
UnchosenCommand=cmd(finishtweening;bounceend,0.25;zoom,1);
|
||||
ChosenCommand=cmd(stoptweening;bouncebegin,0.3;zoom,0);
|
||||
--
|
||||
StepsChosenMessageCommand=function( self, param )
|
||||
if param.Player ~= num_players[i] then return end;
|
||||
self:playcommand("Chosen");
|
||||
end;
|
||||
StepsUnchosenMessageCommand=function( self, param )
|
||||
if param.Player ~= num_players[i] then return end;
|
||||
self:playcommand("Unchosen");
|
||||
end;
|
||||
Def.Quad {
|
||||
InitCommand=cmd(y,-35);
|
||||
OnCommand=cmd(diffuse,PlayerColor(num_players[i]);shadowlength,1;linear,0.25;zoomtowidth,80;fadeleft,0.5;faderight,0.5);
|
||||
};
|
||||
LoadFont("Common Bold") .. {
|
||||
Text=ToEnumShortString(num_players[i]);
|
||||
InitCommand=cmd(y,-48);
|
||||
OnCommand=cmd(shadowlength,1;diffuse,PlayerColor(num_players[i]));
|
||||
};
|
||||
LoadFont("Common Bold") .. {
|
||||
Text="PRESS";
|
||||
InitCommand=cmd(y,-20);
|
||||
OnCommand=cmd(shadowlength,1;pulse;effectmagnitude,1,1.125,1;effectperiod,0.5);
|
||||
};
|
||||
LoadFont("Common Normal") .. {
|
||||
Text="TO START";
|
||||
InitCommand=cmd(y,58);
|
||||
OnCommand=cmd(shadowlength,1;zoom,0.75);
|
||||
};
|
||||
};
|
||||
if GAMESTATE:GetCurrentGame():GetName() == "pump" then
|
||||
local ns = num_players[i] == PLAYER_1 and RoutineSkinP1() or RoutineSkinP2()
|
||||
f[#f+1] = LoadActor( NOTESKIN:GetPathForNoteSkin("Center","Tap",ns) ) .. {
|
||||
InitCommand=cmd(y,20);
|
||||
}
|
||||
end
|
||||
t[#t+1] = f;
|
||||
end
|
||||
-- Lock input for half a second so that players don't accidentally start a song
|
||||
t[#t+1] = Def.Actor {
|
||||
StartSelectingStepsMessageCommand=function() SCREENMAN:GetTopScreen():lockinput(0.5); end;
|
||||
};
|
||||
|
||||
t.InitCommand=cmd(Center;x,SCREEN_CENTER_X*1.5;visible,false;diffusealpha,0);
|
||||
t.StartSelectingStepsMessageCommand=cmd(linear,0.2;visible,true;diffusealpha,1);
|
||||
t.StartSelectingSongMessageCommand=cmd(linear,0.2;visible,true;diffusealpha,0);
|
||||
--
|
||||
t.InitCommand=cmd(Center;x,SCREEN_CENTER_X*1.5;diffusealpha,0);
|
||||
t.StartSelectingStepsMessageCommand=cmd(linear,0.2;diffusealpha,1);
|
||||
t.SongUnchosenMessageCommand=cmd(linear,0.2;diffusealpha,0);
|
||||
|
||||
|
||||
return t;
|
||||
|
||||
@@ -3,6 +3,7 @@ local t = Def.ActorFrame {
|
||||
InitCommand=cmd(zoomto,SCREEN_WIDTH,SCREEN_HEIGHT);
|
||||
OnCommand=cmd(diffuse,Color.Black;diffusealpha,0);
|
||||
StartSelectingStepsMessageCommand=cmd(stoptweening;linear,0.2;diffusealpha,0.75);
|
||||
SongUnchosenMessageCommand=cmd(stoptweening;linear,0.2;diffusealpha,0);
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
local t = Def.ActorFrame {};
|
||||
|
||||
t[#t+1] = Def.Quad {
|
||||
InitCommand=cmd(vertalign,bottom;zoomto,SCREEN_WIDTH+1,34;diffuse,color("#161616"));
|
||||
InitCommand=cmd(vertalign,bottom;zoomto,SCREEN_WIDTH,34;diffuse,color("#161616"));
|
||||
};
|
||||
|
||||
t[#t+1] = LoadActor(THEME:GetPathG("ScreenWithMenuElements","header/Header")) .. {
|
||||
InitCommand=cmd(y,-48;vertalign,bottom;zoomtowidth,SCREEN_WIDTH);
|
||||
OnCommand=cmd(zoomy,-1;diffuse,color("#ffd400"));
|
||||
};
|
||||
|
||||
return t;
|
||||
|
||||
@@ -26,6 +26,9 @@ JointPremiumSecondary=Two players can play with one credit!
|
||||
DoublesPremiumMain=Doubles Premium
|
||||
DoublesPremiumSecondary=Play doubles for one credit!
|
||||
|
||||
[ScreenCaution]
|
||||
HelpText=&START; Continue
|
||||
|
||||
[ScreenDemonstration]
|
||||
Demonstration=Demonstration
|
||||
%s - %s [from %s]=%s - %s\n[from %s]
|
||||
@@ -91,6 +94,9 @@ PersonalRecord=Personal Record #%i!
|
||||
ITG DP:=ITG DP:
|
||||
MIGS DP:=MIGS DP:
|
||||
|
||||
[ScreenContinue]
|
||||
HelpText=&START; Advance Timer
|
||||
|
||||
[OptionTitles]
|
||||
AutoSetStyle=Auto Set Style
|
||||
NotePosition=Note Positions
|
||||
@@ -230,6 +236,13 @@ Play again soon!=Play again soon!
|
||||
|
||||
[ScreenHowToPlay]
|
||||
How To Play StepMania=How To Play StepMania
|
||||
Information=Information
|
||||
|
||||
Feet=Your feet will be used to play!
|
||||
Tap=When the arrows rise to this point,\nstep on the matching panels.
|
||||
Jump=Step on both panels if two different\narrows appear at the same time!
|
||||
Miss=If you misstep repeatedly, your dance\nguage will decrease until the game is\nis over!
|
||||
|
||||
|
||||
[Protiming]
|
||||
MS=MS
|
||||
MS=MS
|
||||
|
||||
+18
-10
@@ -370,12 +370,14 @@ FrameOnCommand=visible,false;spin
|
||||
TimeRemainingY=80
|
||||
TimeRemainingOnCommand=zoom,1;shadowlength,1;
|
||||
#
|
||||
DeltaSecondsOnCommand=y,80;spin;
|
||||
DeltaSecondsOnCommand=y,80;
|
||||
DeltaSecondsGainLifeCommand=zoom,0.5;
|
||||
|
||||
[ScoreDisplayPercentage Percent]
|
||||
PercentP1OnCommand=shadowlength,1;diffuse,PlayerColor(PLAYER_1);strokecolor,ColorDarkTone(PlayerColor(PLAYER_1))
|
||||
PercentP2OnCommand=shadowlength,1;diffuse,PlayerColor(PLAYER_2);strokecolor,ColorDarkTone(PlayerColor(PLAYER_2))
|
||||
PercentP1OnCommand=shadowlength,1;strokecolor,Color.Outline
|
||||
PercentP2OnCommand=shadowlength,1;strokecolor,Color.Outline
|
||||
DancePointsP1OnCommand=shadowlength,1;strokecolor,Color.Outline
|
||||
DancePointsP2OnCommand=shadowlength,1;strokecolor,Color.Outline
|
||||
|
||||
[ScoreDisplayRave]
|
||||
MeterP1OnCommand=draworder,-1;texcoordvelocity,1,0
|
||||
@@ -530,9 +532,9 @@ PillTransformFunction=function(self,offsetFromCenter,itemIndex,numItems) \
|
||||
self:diffuseramp(); \
|
||||
self:effectcolor2(color("1,1,1,1")); \
|
||||
self:effectcolor1(color("0.5,0.5,0.5,1")); \
|
||||
self:effectperiod(rate); \
|
||||
self:effectclock('beat'); \
|
||||
self:effecttiming(rate*0.75,rate*0.125,rate*0.125,0); \
|
||||
self:effectoffset(1.25-offset); \
|
||||
self:effectoffset(1-offset); \
|
||||
end;
|
||||
# PillTransformFunction=function(self,offsetFromCenter,itemIndex,numItems) \
|
||||
# local fItemWidth = ( 256 / numItems ) \
|
||||
@@ -562,9 +564,10 @@ Fallback="TextBanner"
|
||||
|
||||
[ScreenSystemLayer]
|
||||
ShowClock=true
|
||||
CreditsP1OnCommand=horizalign,left;vertalign,bottom;zoom,0.675;shadowlength,1;
|
||||
CreditsP1OnCommand=horizalign,left;vertalign,bottom;zoom,0.675;shadowlength,1;diffuse,PlayerColor(PLAYER_1);diffusetopedge,ColorLightTone(PlayerColor(PLAYER_1));
|
||||
#
|
||||
CreditsP2OnCommand=horizalign,right;vertalign,bottom;zoom,0.675;shadowlength,1;diffuse,PlayerColor(PLAYER_2);diffusetopedge,ColorLightTone(PlayerColor(PLAYER_2));
|
||||
#
|
||||
CreditsP2OnCommand=horizalign,right;vertalign,bottom;zoom,0.675;shadowlength,1;
|
||||
|
||||
[ScreenConsoleOverlay]
|
||||
|
||||
@@ -589,8 +592,8 @@ HeaderOffCommand=
|
||||
|
||||
ShowFooter=true
|
||||
FooterX=SCREEN_CENTER_X
|
||||
FooterY=SCREEN_BOTTOM+2
|
||||
FooterOnCommand=draworder,1;vertalign,bottom;zoomtowidth,SCREEN_WIDTH+1;
|
||||
FooterY=SCREEN_BOTTOM+4
|
||||
FooterOnCommand=draworder,1;
|
||||
FooterOffCommand=
|
||||
|
||||
ShowHelp=true
|
||||
@@ -698,6 +701,8 @@ ShowVersionInfo=true
|
||||
VersionInfoX=SCREEN_RIGHT-16
|
||||
VersionInfoY=SCREEN_TOP+24
|
||||
VersionInfoOnCommand=
|
||||
|
||||
|
||||
VersionInfoOffCommand=
|
||||
#
|
||||
ShowNetworkStatus=true
|
||||
@@ -916,6 +921,7 @@ SongTimeX=SCREEN_CENTER_X-160
|
||||
SongTimeY=SCREEN_TOP+160+(36/2)+8
|
||||
SongTimeOnCommand=zoom,0.75;strokecolor,Color("Outline");shadowlength,1
|
||||
|
||||
|
||||
SongTimeOffCommand=bouncebegin,0.15;zoom,0;diffusealpha,0;
|
||||
SongTimeResetCommand=diffuse,Color("White");
|
||||
SongTimeAutogenCommand=diffuse,Color("Green");
|
||||
@@ -983,7 +989,7 @@ ShowDifficultyList=not GAMESTATE:IsCourseMode();
|
||||
DifficultyListX=SCREEN_CENTER_X-160
|
||||
DifficultyListY=SCREEN_TOP+216
|
||||
DifficultyListOnCommand=addx,-SCREEN_CENTER_X;decelerate,0.1;addx,SCREEN_CENTER_X;
|
||||
DifficultyListStartSelectingStepsMessageCommand=finishtweening;glowshift;effectcolor1,color("1,1,1,0.25");effectcolor2,color("1,1,1,0");effectperiod,2;
|
||||
DifficultyListStartSelectingStepsMessageCommand=finishtweening;accelerate,0.2;zoom,1.1;decelerate,0.2;zoom,1;
|
||||
DifficultyListOffCommand=bouncebegin,0.05;zoomx,0;
|
||||
#
|
||||
DifficultyListTweenOnCommand=stoptweening;bounceend,0.1;zoomx,1
|
||||
@@ -1333,6 +1339,7 @@ ItemsLongRowSharedX=SCREEN_CENTER_X
|
||||
[OptionRowMiniMenuContext]
|
||||
|
||||
[ScreenMapControllers]
|
||||
LinesVisible=15
|
||||
|
||||
[ScreenTestInput]
|
||||
|
||||
@@ -1870,6 +1877,7 @@ MachineRecordP2X=SCREEN_CENTER_X+220
|
||||
#MachineRecordP2Y=SCREEN_BOTTOM-156
|
||||
MachineRecordP2Y=SCREEN_TOP+146
|
||||
MachineRecordP2OnCommand=
|
||||
|
||||
MachineRecordP2OffCommand=
|
||||
#
|
||||
PersonalRecordP1X=SCREEN_CENTER_X-160
|
||||
|
||||
@@ -645,6 +645,19 @@ public:
|
||||
p->SetTexture( Texture );
|
||||
return 0;
|
||||
}
|
||||
static int GetTexture(T* p, lua_State *L)
|
||||
{
|
||||
RageTexture *texture = p->GetTexture();
|
||||
if(texture != NULL)
|
||||
{
|
||||
texture->PushSelf(L);
|
||||
}
|
||||
else
|
||||
{
|
||||
lua_pushnil(L);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
LunaActorMultiVertex()
|
||||
{
|
||||
@@ -668,6 +681,7 @@ public:
|
||||
|
||||
// Copy from RageTexture
|
||||
ADD_METHOD( SetTexture );
|
||||
ADD_METHOD( GetTexture );
|
||||
// Load from file path
|
||||
ADD_METHOD( LoadTexture );
|
||||
}
|
||||
|
||||
@@ -75,6 +75,7 @@ public:
|
||||
void FinishTweening();
|
||||
|
||||
void SetTexture( RageTexture *Texture );
|
||||
RageTexture* GetTexture() { return _Texture; };
|
||||
void LoadFromTexture( RageTextureID ID );
|
||||
|
||||
void UnloadTexture();
|
||||
|
||||
+1
-1
@@ -221,7 +221,7 @@ Actor *ActorUtil::LoadFromNode( const XNode* _pNode, Actor *pParentActor )
|
||||
// sClass is invalid
|
||||
RString sError = ssprintf( "%s: invalid Class \"%s\"",
|
||||
ActorUtil::GetWhere(&node).c_str(), sClass.c_str() );
|
||||
Dialog::OK( sError );
|
||||
LuaHelpers::ReportScriptError(sError);
|
||||
return new Actor; // Return a dummy object so that we don't crash in AutoActor later.
|
||||
}
|
||||
|
||||
|
||||
+4
-1
@@ -6,7 +6,10 @@
|
||||
|
||||
void AutoActor::Unload()
|
||||
{
|
||||
delete m_pActor;
|
||||
if(m_pActor != NULL)
|
||||
{
|
||||
delete m_pActor;
|
||||
}
|
||||
m_pActor=NULL;
|
||||
}
|
||||
|
||||
|
||||
+41
-29
@@ -54,6 +54,7 @@ BitmapText::BitmapText()
|
||||
m_fMaxWidth = 0;
|
||||
m_fMaxHeight = 0;
|
||||
m_iVertSpacing = 0;
|
||||
m_MaxDimensionUsesZoom= false;
|
||||
m_bHasGlowAttribute = false;
|
||||
// We'd be better off not adding strokes to things we can't control
|
||||
// themewise (ScreenDebugOverlay for example). -Midiman
|
||||
@@ -492,6 +493,11 @@ void BitmapText::SetMaxHeight( float fMaxHeight )
|
||||
UpdateBaseZoom();
|
||||
}
|
||||
|
||||
void BitmapText::SetMaxDimUseZoom(bool use)
|
||||
{
|
||||
m_MaxDimensionUsesZoom= use;
|
||||
}
|
||||
|
||||
void BitmapText::SetUppercase( bool b )
|
||||
{
|
||||
m_bUppercase = b;
|
||||
@@ -513,35 +519,32 @@ void BitmapText::UnSetDistortion()
|
||||
|
||||
void BitmapText::UpdateBaseZoom()
|
||||
{
|
||||
if( m_fMaxWidth == 0 )
|
||||
{
|
||||
this->SetBaseZoomX( 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
const float fWidth = GetUnzoomedWidth();
|
||||
if( fWidth != 0 ) // don't divide by 0
|
||||
{
|
||||
// Never decrease the zoom.
|
||||
const float fZoom = min( 1, m_fMaxWidth/fWidth );
|
||||
this->SetBaseZoomX( fZoom );
|
||||
}
|
||||
// don't divide by 0
|
||||
// Never apply a zoom greater than 1.
|
||||
// Factor in the non-base zoom so that maxwidth will be in terms of theme
|
||||
// pixels when zoom is used.
|
||||
#define APPLY_DIMENSION_ZOOM(dimension_max, dimension_get, dimension_zoom_get, base_zoom_set) \
|
||||
if(dimension_max == 0) \
|
||||
{ \
|
||||
base_zoom_set(1); \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
float dimension= dimension_get(); \
|
||||
if(m_MaxDimensionUsesZoom) \
|
||||
{ \
|
||||
dimension/= dimension_zoom_get(); \
|
||||
} \
|
||||
if(dimension != 0) \
|
||||
{ \
|
||||
const float zoom= min(1, dimension_max / dimension); \
|
||||
base_zoom_set(zoom); \
|
||||
} \
|
||||
}
|
||||
|
||||
if( m_fMaxHeight == 0 )
|
||||
{
|
||||
this->SetBaseZoomY( 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
const float fHeight = GetUnzoomedHeight();
|
||||
if( fHeight != 0 ) // don't divide by 0
|
||||
{
|
||||
// Never decrease the zoom.
|
||||
const float fZoom = min( 1, m_fMaxHeight/fHeight );
|
||||
this->SetBaseZoomY( fZoom );
|
||||
}
|
||||
}
|
||||
APPLY_DIMENSION_ZOOM(m_fMaxWidth, GetUnzoomedWidth, GetZoomX, SetBaseZoomX);
|
||||
APPLY_DIMENSION_ZOOM(m_fMaxHeight, GetUnzoomedHeight, GetZoomY, SetBaseZoomY);
|
||||
#undef APPLY_DIMENSION_ZOOM
|
||||
}
|
||||
|
||||
bool BitmapText::StringWillUseAlternate( const RString& sText, const RString& sAlternateText ) const
|
||||
@@ -860,8 +863,16 @@ class LunaBitmapText: public Luna<BitmapText>
|
||||
{
|
||||
public:
|
||||
static int wrapwidthpixels( T* p, lua_State *L ) { p->SetWrapWidthPixels( IArg(1) ); return 0; }
|
||||
static int maxwidth( T* p, lua_State *L ) { p->SetMaxWidth( FArg(1) ); return 0; }
|
||||
static int maxheight( T* p, lua_State *L ) { p->SetMaxHeight( FArg(1) ); return 0; }
|
||||
#define MAX_DIMENSION(maxdimension, SetMaxDimension) \
|
||||
static int maxdimension( T* p, lua_State *L ) \
|
||||
{ p->SetMaxDimension(FArg(1)); return 0; }
|
||||
MAX_DIMENSION(maxwidth, SetMaxWidth);
|
||||
MAX_DIMENSION(maxheight, SetMaxHeight);
|
||||
#undef MAX_DIMENSION
|
||||
static int max_dimension_use_zoom(T* p, lua_State* L)
|
||||
{
|
||||
p->SetMaxDimUseZoom(lua_toboolean(L, 1));
|
||||
}
|
||||
static int vertspacing( T* p, lua_State *L ) { p->SetVertSpacing( IArg(1) ); return 0; }
|
||||
static int settext( T* p, lua_State *L )
|
||||
{
|
||||
@@ -909,6 +920,7 @@ public:
|
||||
ADD_METHOD( wrapwidthpixels );
|
||||
ADD_METHOD( maxwidth );
|
||||
ADD_METHOD( maxheight );
|
||||
ADD_METHOD( max_dimension_use_zoom );
|
||||
ADD_METHOD( vertspacing );
|
||||
ADD_METHOD( settext );
|
||||
ADD_METHOD( rainbowscroll );
|
||||
|
||||
@@ -25,6 +25,7 @@ public:
|
||||
void SetVertSpacing( int iSpacing );
|
||||
void SetMaxWidth( float fMaxWidth );
|
||||
void SetMaxHeight( float fMaxHeight );
|
||||
void SetMaxDimUseZoom(bool use);
|
||||
void SetWrapWidthPixels( int iWrapWidthPixels );
|
||||
void CropToWidth( int iWidthInSourcePixels );
|
||||
|
||||
@@ -77,6 +78,7 @@ protected:
|
||||
int m_iWrapWidthPixels; // -1 = no wrap
|
||||
float m_fMaxWidth; // 0 = no max
|
||||
float m_fMaxHeight; // 0 = no max
|
||||
bool m_MaxDimensionUsesZoom;
|
||||
bool m_bRainbowScroll;
|
||||
bool m_bJitter;
|
||||
bool m_bUsingDistortion;
|
||||
|
||||
+33
-13
@@ -32,6 +32,7 @@
|
||||
#include "SongManager.h"
|
||||
#include "SongUtil.h"
|
||||
#include "StatsManager.h"
|
||||
#include "StepMania.h"
|
||||
#include "Steps.h"
|
||||
#include "Style.h"
|
||||
#include "ThemeManager.h"
|
||||
@@ -396,7 +397,7 @@ void GameState::JoinPlayer( PlayerNumber pn )
|
||||
// dance-threepanel, popn-nine). -aj
|
||||
// XXX?: still shows joined player as "Insert Card". May not be an issue? -aj
|
||||
if( m_pCurStyle->m_StyleType == StyleType_OnePlayerTwoSides ||
|
||||
m_pCurStyle->m_StepsType == StepsType_dance_solo ||
|
||||
m_pCurStyle->m_StepsType == StepsType_dance_solo ||
|
||||
m_pCurStyle->m_StepsType == StepsType_dance_threepanel ||
|
||||
m_pCurStyle->m_StepsType == StepsType_popn_nine )
|
||||
pStyle = GAMEMAN->GetFirstCompatibleStyle( m_pCurGame, 1, m_pCurStyle->m_StepsType );
|
||||
@@ -2221,7 +2222,7 @@ MultiPlayer GetNextEnabledMultiPlayer( MultiPlayer mp )
|
||||
#include "LuaBinding.h"
|
||||
#include "Game.h"
|
||||
|
||||
/** @brief Allow Lua to have access to the GameState. */
|
||||
/** @brief Allow Lua to have access to the GameState. */
|
||||
class LunaGameState: public Luna<GameState>
|
||||
{
|
||||
public:
|
||||
@@ -2531,7 +2532,7 @@ public:
|
||||
vEP.push_back( pn );
|
||||
LuaHelpers::CreateTableFromArray( vEP, L );
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
static int GetCurrentStyle( T* p, lua_State *L )
|
||||
{
|
||||
Style *pStyle = const_cast<Style *> (p->GetCurrentStyle());
|
||||
@@ -2550,9 +2551,9 @@ public:
|
||||
return 1;
|
||||
}
|
||||
static int GetNumStagesForCurrentSongAndStepsOrCourse( T* , lua_State *L )
|
||||
{
|
||||
{
|
||||
lua_pushnumber(L, GAMESTATE->GetNumStagesForCurrentSongAndStepsOrCourse() );
|
||||
return 1;
|
||||
return 1;
|
||||
}
|
||||
static int GetNumStagesLeft( T* p, lua_State *L )
|
||||
{
|
||||
@@ -2589,20 +2590,37 @@ public:
|
||||
}
|
||||
static int GetExpandedSectionName( T* p, lua_State *L ) { lua_pushstring(L, p->sExpandedSectionName); return 1; }
|
||||
static int AddStageToPlayer( T* p, lua_State *L ) { p->AddStageToPlayer(Enum::Check<PlayerNumber>(L, 1)); return 0; }
|
||||
static int InsertCoin( T* p, lua_State *L )
|
||||
{
|
||||
int numCoins = IArg(1);
|
||||
if (GAMESTATE->m_iCoins + numCoins >= 0)
|
||||
{
|
||||
StepMania::InsertCoin(numCoins, false);
|
||||
} else {
|
||||
// Warn themers if they attempt to set credits to a negative value.
|
||||
luaL_error( L, "Credits may not be negative." );
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
static int InsertCredit( T* p, lua_State *L )
|
||||
{
|
||||
StepMania::InsertCredit();
|
||||
return 0;
|
||||
}
|
||||
static int CurrentOptionsDisqualifyPlayer( T* p, lua_State *L ) { lua_pushboolean(L, p->CurrentOptionsDisqualifyPlayer(Enum::Check<PlayerNumber>(L, 1))); return 1; }
|
||||
|
||||
|
||||
static int ResetPlayerOptions( T* p, lua_State *L )
|
||||
{
|
||||
p->ResetPlayerOptions(Enum::Check<PlayerNumber>(L, 1));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int RefreshNoteSkinData( T* p, lua_State *L )
|
||||
{
|
||||
NOTESKIN->RefreshNoteSkinData(p->m_pCurGame);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int Dopefish( T* p, lua_State *L )
|
||||
{
|
||||
lua_pushboolean(L, p->m_bDopefish);
|
||||
@@ -2620,7 +2638,7 @@ public:
|
||||
SCREENMAN->ZeroNextUpdate();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int SaveProfiles( T* p, lua_State *L )
|
||||
{
|
||||
p->SavePlayerProfiles();
|
||||
@@ -2702,22 +2720,22 @@ public:
|
||||
}
|
||||
|
||||
StyleType st = pStyle->m_StyleType;
|
||||
if( p->GetNumSidesJoined() == 2 &&
|
||||
if( p->GetNumSidesJoined() == 2 &&
|
||||
( st == StyleType_OnePlayerOneSide || st == StyleType_OnePlayerTwoSides ) )
|
||||
{
|
||||
luaL_error( L, "Too many sides joined for style %s", pStyle->m_szName );
|
||||
}
|
||||
else if( p->GetNumSidesJoined() == 1 &&
|
||||
else if( p->GetNumSidesJoined() == 1 &&
|
||||
( st == StyleType_TwoPlayersTwoSides || st == StyleType_TwoPlayersSharedSides ) )
|
||||
{
|
||||
luaL_error( L, "Too few sides joined for style %s", pStyle->m_szName );
|
||||
}
|
||||
|
||||
if( !AreStyleAndPlayModeCompatible( p, L, pStyle, p->m_PlayMode ) )
|
||||
{
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
p->SetCurrentStyle( pStyle );
|
||||
ClearIncompatibleStepsAndTrails( p, L );
|
||||
|
||||
@@ -2841,6 +2859,8 @@ public:
|
||||
ADD_METHOD( SetCharacter );
|
||||
ADD_METHOD( GetExpandedSectionName );
|
||||
ADD_METHOD( AddStageToPlayer );
|
||||
ADD_METHOD( InsertCoin );
|
||||
ADD_METHOD( InsertCredit );
|
||||
ADD_METHOD( CurrentOptionsDisqualifyPlayer );
|
||||
ADD_METHOD( ResetPlayerOptions );
|
||||
ADD_METHOD( RefreshNoteSkinData );
|
||||
|
||||
@@ -654,6 +654,13 @@ void InputMapper::SaveMappingsToDisk()
|
||||
m_mappings.WriteMappings( m_pInputScheme, SpecialFiles::KEYMAPS_PATH );
|
||||
}
|
||||
|
||||
void InputMapper::ResetMappingsToDefault()
|
||||
{
|
||||
m_mappings.Clear();
|
||||
UpdateTempDItoGI();
|
||||
AddDefaultMappingsForCurrentGameIfUnmapped();
|
||||
}
|
||||
|
||||
static LocalizedString CONNECTED ( "InputMapper", "Connected" );
|
||||
static LocalizedString DISCONNECTED ( "InputMapper", "Disconnected" );
|
||||
static LocalizedString AUTOMAPPING_ALL_JOYSTICKS ( "InputMapper", "Auto-mapping all joysticks." );
|
||||
|
||||
@@ -150,6 +150,7 @@ public:
|
||||
|
||||
void ReadMappingsFromDisk();
|
||||
void SaveMappingsToDisk();
|
||||
void ResetMappingsToDefault();
|
||||
|
||||
void ClearAllMappings();
|
||||
|
||||
|
||||
@@ -65,7 +65,15 @@ void RageBitmapTexture::Create()
|
||||
|
||||
/* Load the image into a RageSurface. */
|
||||
RString error;
|
||||
RageSurface *pImg = RageSurfaceUtils::LoadFile( actualID.filename, error );
|
||||
RageSurface *pImg= NULL;
|
||||
if(actualID.filename == TEXTUREMAN->GetScreenTextureID().filename)
|
||||
{
|
||||
pImg= TEXTUREMAN->GetScreenSurface();
|
||||
}
|
||||
else
|
||||
{
|
||||
pImg= RageSurfaceUtils::LoadFile(actualID.filename, error);
|
||||
}
|
||||
|
||||
/* Tolerate corrupt/unknown images. */
|
||||
if( pImg == NULL )
|
||||
@@ -122,7 +130,7 @@ void RageBitmapTexture::Create()
|
||||
m_iSourceWidth = pImg->w;
|
||||
m_iSourceHeight = pImg->h;
|
||||
|
||||
/* in-game imsage dimensions are the same as the source graphic */
|
||||
/* in-game image dimensions are the same as the source graphic */
|
||||
m_iImageWidth = m_iSourceWidth;
|
||||
m_iImageHeight = m_iSourceHeight;
|
||||
|
||||
|
||||
@@ -84,6 +84,11 @@ public:
|
||||
lua_pushnumber(L, p->GetNumFrames());
|
||||
return 1;
|
||||
}
|
||||
static int Reload(T* p, lua_State* L)
|
||||
{
|
||||
p->Reload();
|
||||
return 0;
|
||||
}
|
||||
|
||||
LunaRageTexture()
|
||||
{
|
||||
@@ -92,6 +97,7 @@ public:
|
||||
ADD_METHOD( rate );
|
||||
ADD_METHOD( GetTextureCoordRect );
|
||||
ADD_METHOD( GetNumFrames );
|
||||
ADD_METHOD( Reload );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -100,6 +100,17 @@ RageTextureID RageTextureManager::GetDefaultTextureID()
|
||||
return RageTextureID( g_sDefaultTextureName );
|
||||
}
|
||||
|
||||
static const RString g_ScreenTextureName = "__screen__";
|
||||
RageTextureID RageTextureManager::GetScreenTextureID()
|
||||
{
|
||||
return RageTextureID(g_ScreenTextureName);
|
||||
}
|
||||
|
||||
RageSurface* RageTextureManager::GetScreenSurface()
|
||||
{
|
||||
return DISPLAY->CreateScreenshot();
|
||||
}
|
||||
|
||||
class RageTexture_Default: public RageTexture
|
||||
{
|
||||
public:
|
||||
@@ -141,11 +152,19 @@ RageTexture* RageTextureManager::LoadTextureInternal( RageTextureID ID )
|
||||
|
||||
RageTexture* pTexture;
|
||||
if( ID.filename == g_sDefaultTextureName )
|
||||
{
|
||||
pTexture = new RageTexture_Default;
|
||||
else if( sExt == "ogv" || sExt == "avi" || sExt == "mpg" || sExt == "mpeg" || sExt == "mp4" || sExt == "mkv" || sExt == "mov" || sExt == "flv" || sExt == "f4v")
|
||||
}
|
||||
else if(sExt == "ogv" || sExt == "avi" || sExt == "mpg" ||
|
||||
sExt == "mpeg" || sExt == "mp4" || sExt == "mkv" || sExt == "mov" ||
|
||||
sExt == "flv" || sExt == "f4v")
|
||||
{
|
||||
pTexture = RageMovieTexture::Create( ID );
|
||||
}
|
||||
else
|
||||
{
|
||||
pTexture = new RageBitmapTexture( ID );
|
||||
}
|
||||
|
||||
m_mapPathToTexture[ID] = pTexture;
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#define RAGE_TEXTURE_MANAGER_H
|
||||
|
||||
#include "RageTexture.h"
|
||||
#include "RageSurface.h"
|
||||
|
||||
struct RageTextureManagerPrefs
|
||||
{
|
||||
@@ -81,6 +82,8 @@ public:
|
||||
bool GetOddDimensionWarning() const { return m_iNoWarnAboutOddDimensions == 0; }
|
||||
|
||||
RageTextureID GetDefaultTextureID();
|
||||
RageTextureID GetScreenTextureID();
|
||||
RageSurface* GetScreenSurface();
|
||||
|
||||
private:
|
||||
void DeleteTexture( RageTexture *t );
|
||||
|
||||
+2
-2
@@ -1753,12 +1753,12 @@ void MakeLower( wchar_t *p, size_t iLen )
|
||||
|
||||
bool operator>>(const RString& lhs, int& rhs)
|
||||
{
|
||||
return istringstream(lhs) >> rhs;
|
||||
return !!(istringstream(lhs) >> rhs);
|
||||
}
|
||||
|
||||
bool operator>>(const RString& lhs, float& rhs)
|
||||
{
|
||||
return istringstream(lhs) >> rhs;
|
||||
return !!(istringstream(lhs) >> rhs);
|
||||
}
|
||||
|
||||
int StringToInt( const RString &sString )
|
||||
|
||||
@@ -268,6 +268,11 @@ RString Screen::GetNextScreenName() const
|
||||
return NEXT_SCREEN;
|
||||
}
|
||||
|
||||
void Screen::SetNextScreenName(RString const& name)
|
||||
{
|
||||
m_sNextScreen= name;
|
||||
}
|
||||
|
||||
RString Screen::GetPrevScreen() const
|
||||
{
|
||||
if( !m_sPrevScreen.empty() )
|
||||
@@ -403,6 +408,7 @@ class LunaScreen: public Luna<Screen>
|
||||
{
|
||||
public:
|
||||
static int GetNextScreenName( T* p, lua_State *L ) { lua_pushstring(L, p->GetNextScreenName() ); return 1; }
|
||||
static int SetNextScreenName( T* p, lua_State *L ) { p->SetNextScreenName(SArg(1)); return 0; }
|
||||
static int GetPrevScreenName( T* p, lua_State *L ) { lua_pushstring(L, p->GetPrevScreen() ); return 1; }
|
||||
static int lockinput( T* p, lua_State *L ) { p->SetLockInputSecs(FArg(1)); return 0; }
|
||||
DEFINE_METHOD( GetScreenType, GetScreenType() )
|
||||
@@ -438,6 +444,7 @@ public:
|
||||
LunaScreen()
|
||||
{
|
||||
ADD_METHOD( GetNextScreenName );
|
||||
ADD_METHOD( SetNextScreenName );
|
||||
ADD_METHOD( GetPrevScreenName );
|
||||
ADD_METHOD( PostScreenMessage );
|
||||
ADD_METHOD( lockinput );
|
||||
|
||||
@@ -123,6 +123,7 @@ protected:
|
||||
public:
|
||||
RString GetNextScreenName() const;
|
||||
RString GetPrevScreen() const;
|
||||
void SetNextScreenName(RString const& name);
|
||||
|
||||
bool PassInputToLua(const InputEventPlus& input);
|
||||
void AddInputCallbackFromStack(lua_State* L);
|
||||
|
||||
+407
-97
@@ -1,6 +1,7 @@
|
||||
#include "global.h"
|
||||
#include "ScreenMapControllers.h"
|
||||
#include "ScreenManager.h"
|
||||
#include "ScreenPrompt.h"
|
||||
#include "RageLog.h"
|
||||
#include "RageInput.h"
|
||||
#include "InputMapper.h"
|
||||
@@ -9,8 +10,10 @@
|
||||
#include "InputEventPlus.h"
|
||||
#include "LocalizedString.h"
|
||||
|
||||
AutoScreenMessage(SM_DoSaveAndExit);
|
||||
#define BUTTONS_TO_MAP THEME->GetMetric ( m_sName, "ButtonsToMap" )
|
||||
static LocalizedString INVALID_BUTTON ( "ScreenMapControllers", "InvalidButton" );
|
||||
static LocalizedString SAVE_PROMPT("ScreenMapControllers", "SavePrompt");
|
||||
#define MAPPED_TO_COMMAND(gc,slot) THEME->GetMetricA( m_sName, ssprintf("MappedToP%iS%iCommand", gc+1, slot+1) )
|
||||
|
||||
static const float g_fSecondsToWaitForInput = 0.05f;
|
||||
@@ -22,10 +25,26 @@ REGISTER_SCREEN_CLASS( ScreenMapControllers );
|
||||
|
||||
ScreenMapControllers::ScreenMapControllers()
|
||||
{
|
||||
m_InSetListMode= false;
|
||||
m_ChangeOccurred= false;
|
||||
this->SubscribeToMessage( Message_AutoJoyMappingApplied );
|
||||
}
|
||||
|
||||
ScreenMapControllers::~ScreenMapControllers()
|
||||
{
|
||||
for(size_t i= 0; i < m_Line.size(); ++i)
|
||||
{
|
||||
SAFE_DELETE(m_Line[i]);
|
||||
}
|
||||
}
|
||||
|
||||
static LocalizedString PLAYER_SLOTS( "ScreenMapControllers", "%s slots" );
|
||||
static LocalizedString SLOT_NAMES[3]= {
|
||||
LocalizedString("ScreenMapControllers", "Primary"),
|
||||
LocalizedString("ScreenMapControllers", "Secondary"),
|
||||
LocalizedString("ScreenMapControllers", "Default")
|
||||
};
|
||||
static LocalizedString KEYNAME("ScreenMapControllers", "KeyName");
|
||||
void ScreenMapControllers::Init()
|
||||
{
|
||||
ScreenWithMenuElements::Init();
|
||||
@@ -64,12 +83,11 @@ void ScreenMapControllers::Init()
|
||||
}
|
||||
}
|
||||
|
||||
int iRow = 0;
|
||||
|
||||
// header row
|
||||
// slot names row
|
||||
{
|
||||
m_Line.push_back(new ActorFrame);
|
||||
FOREACH_ENUM( GameController, c )
|
||||
{
|
||||
{
|
||||
BitmapText &text = m_textLabel[c];
|
||||
text.LoadFromFont( THEME->GetPathF(m_sName,"title") );
|
||||
PlayerNumber pn = (PlayerNumber)c;
|
||||
@@ -77,16 +95,39 @@ void ScreenMapControllers::Init()
|
||||
RString sText = ssprintf(PLAYER_SLOTS.GetValue(), PlayerNumberToLocalizedString(pn).c_str());
|
||||
text.SetText( sText );
|
||||
ActorUtil::LoadAllCommands( text, m_sName );
|
||||
m_Line[iRow].AddChild( &m_textLabel[c] );
|
||||
m_Line.back()->AddChild( &m_textLabel[c] );
|
||||
}
|
||||
m_LineScroller.AddChild( &m_Line[iRow] );
|
||||
|
||||
iRow++;
|
||||
m_LineScroller.AddChild(m_Line.back());
|
||||
}
|
||||
// header row
|
||||
{
|
||||
m_Line.push_back(new ActorFrame);
|
||||
m_ListHeaderCenter.LoadFromFont(THEME->GetPathF(m_sName, "title"));
|
||||
m_ListHeaderCenter.SetName("ListHeaderCenter");
|
||||
m_ListHeaderCenter.SetText(KEYNAME);
|
||||
ActorUtil::LoadAllCommands(m_ListHeaderCenter, m_sName);
|
||||
m_Line.back()->AddChild(&m_ListHeaderCenter);
|
||||
FOREACH_ENUM(GameController, c)
|
||||
{
|
||||
for(int s= 0; s < NUM_SHOWN_GAME_TO_DEVICE_SLOTS; ++s)
|
||||
{
|
||||
BitmapText& text= m_ListHeaderLabels[c][s];
|
||||
text.LoadFromFont(THEME->GetPathF(m_sName, "title"));
|
||||
text.SetName("ListHeader");
|
||||
text.SetText(SLOT_NAMES[s]);
|
||||
text.RunCommands(THEME->GetMetricA(
|
||||
m_sName, ssprintf("ListHeaderP%iS%iCommand", c+1, s+1)));
|
||||
ActorUtil::LoadAllCommands(text, m_sName);
|
||||
m_Line.back()->AddChild(&text);
|
||||
}
|
||||
}
|
||||
m_LineScroller.AddChild(m_Line.back());
|
||||
}
|
||||
|
||||
// normal rows
|
||||
for( unsigned b=0; b<m_KeysToMap.size(); b++ )
|
||||
{
|
||||
m_Line.push_back(new ActorFrame);
|
||||
KeyToMap *pKey = &m_KeysToMap[b];
|
||||
|
||||
{
|
||||
@@ -96,7 +137,7 @@ void ScreenMapControllers::Init()
|
||||
RString sText = GameButtonToLocalizedString( INPUTMAPPER->GetInputScheme(), pKey->m_GameButton );
|
||||
pName->SetText( sText );
|
||||
ActorUtil::LoadAllCommands( *pName, m_sName );
|
||||
m_Line[iRow].AddChild( pName );
|
||||
m_Line.back()->AddChild( pName );
|
||||
}
|
||||
{
|
||||
BitmapText *pSecondary = new BitmapText;
|
||||
@@ -108,11 +149,11 @@ void ScreenMapControllers::Init()
|
||||
sText = GameButtonToLocalizedString( INPUTMAPPER->GetInputScheme(), mb );
|
||||
ActorUtil::LoadAllCommands( *pSecondary, m_sName );
|
||||
pSecondary->SetText( sText );
|
||||
m_Line[iRow].AddChild( pSecondary );
|
||||
m_Line.back()->AddChild( pSecondary );
|
||||
}
|
||||
|
||||
FOREACH_ENUM( GameController, c )
|
||||
{
|
||||
{
|
||||
for( int s=0; s<NUM_SHOWN_GAME_TO_DEVICE_SLOTS; s++ )
|
||||
{
|
||||
pKey->m_textMappedTo[c][s] = new BitmapText;
|
||||
@@ -120,41 +161,57 @@ void ScreenMapControllers::Init()
|
||||
pKey->m_textMappedTo[c][s]->LoadFromFont( THEME->GetPathF(m_sName,"entry") );
|
||||
pKey->m_textMappedTo[c][s]->RunCommands( MAPPED_TO_COMMAND(c,s) );
|
||||
ActorUtil::LoadAllCommands( *pKey->m_textMappedTo[c][s], m_sName );
|
||||
m_Line[iRow].AddChild( pKey->m_textMappedTo[c][s] );
|
||||
m_Line.back()->AddChild( pKey->m_textMappedTo[c][s] );
|
||||
}
|
||||
}
|
||||
m_Line[iRow].DeleteChildrenWhenDone();
|
||||
m_Line[iRow].SetName( "Line" );
|
||||
ActorUtil::LoadAllCommands( m_Line[iRow], m_sName );
|
||||
m_LineScroller.AddChild( &m_Line[iRow] );
|
||||
|
||||
iRow++;
|
||||
}
|
||||
|
||||
// exit row
|
||||
{
|
||||
m_sprExit.Load( THEME->GetPathG(m_sName,"exit") );
|
||||
m_sprExit->SetName( "Exit" );
|
||||
ActorUtil::LoadAllCommands( *m_sprExit, m_sName );
|
||||
|
||||
m_Line[iRow].AddChild( m_sprExit );
|
||||
m_LineScroller.AddChild( &m_Line[iRow] );
|
||||
|
||||
iRow++;
|
||||
m_Line.back()->DeleteChildrenWhenDone();
|
||||
m_Line.back()->SetName( "Line" );
|
||||
ActorUtil::LoadAllCommands(m_Line.back(), m_sName);
|
||||
m_LineScroller.AddChild(m_Line.back());
|
||||
}
|
||||
|
||||
#define ADD_ACTION(index, a, b, c, d, e) \
|
||||
m_Line.push_back(new ActorFrame); \
|
||||
m_Actions[index].Load(a, b, c, d, e);
|
||||
|
||||
m_Actions.resize(5);
|
||||
ADD_ACTION(0, m_sName, "Clear", &ScreenMapControllers::ClearToDefault,
|
||||
m_Line.back(), &m_LineScroller);
|
||||
ADD_ACTION(1, m_sName, "Reload", &ScreenMapControllers::ReloadFromDisk,
|
||||
m_Line.back(), &m_LineScroller);
|
||||
ADD_ACTION(2, m_sName, "Save", &ScreenMapControllers::SaveToDisk,
|
||||
m_Line.back(), &m_LineScroller);
|
||||
ADD_ACTION(3, m_sName, "SetList", &ScreenMapControllers::SetListMode,
|
||||
m_Line.back(), &m_LineScroller);
|
||||
ADD_ACTION(4, m_sName, "Exit", &ScreenMapControllers::ExitAction,
|
||||
m_Line.back(), &m_LineScroller);
|
||||
#undef ADD_ACTION
|
||||
|
||||
m_MaxDestItem= (1 + m_KeysToMap.size() + m_Actions.size()) -
|
||||
THEME->GetMetricI("ScreenMapControllers", "LinesVisible");
|
||||
|
||||
m_LineScroller.SetName( "LineScroller" );
|
||||
ActorUtil::LoadAllCommands( m_LineScroller, m_sName );
|
||||
m_LineScroller.SetNumItemsToDraw( (float) m_LineScroller.GetNumChildren()*2 );
|
||||
m_LineScroller.Load2();
|
||||
this->AddChild( &m_LineScroller );
|
||||
|
||||
m_NoSetListPrompt.Load(THEME->GetPathG(m_sName, "nosetlistprompt"));
|
||||
m_NoSetListPrompt->SetName("NoSetListPrompt");
|
||||
this->AddChild(m_NoSetListPrompt);
|
||||
|
||||
m_Warning.Load(THEME->GetPathG(m_sName, "warning"));
|
||||
m_Warning->SetName("Warning");
|
||||
m_Warning->SetDrawOrder(DRAW_ORDER_TRANSITIONS);
|
||||
this->AddChild(m_Warning);
|
||||
LOAD_ALL_COMMANDS(m_Warning);
|
||||
}
|
||||
|
||||
void ScreenMapControllers::BeginScreen()
|
||||
{
|
||||
m_iCurController = 0;
|
||||
m_iCurButton = 0;
|
||||
m_iCurSlot = 0;
|
||||
m_CurController = 0;
|
||||
m_CurButton = 0;
|
||||
m_CurSlot = 0;
|
||||
|
||||
ScreenWithMenuElements::BeginScreen();
|
||||
|
||||
@@ -162,6 +219,10 @@ void ScreenMapControllers::BeginScreen()
|
||||
|
||||
Refresh();
|
||||
AfterChangeFocus();
|
||||
m_fLockInputSecs= THEME->GetMetricF(m_sName, "LockInputSecs");
|
||||
m_AutoDismissWarningSecs= THEME->GetMetricF(m_sName, "AutoDismissWarningSecs");
|
||||
m_AutoDismissNoSetListPromptSecs= 0.0f;
|
||||
m_Warning->PlayCommand("TweenOn");
|
||||
}
|
||||
|
||||
|
||||
@@ -169,34 +230,64 @@ void ScreenMapControllers::Update( float fDeltaTime )
|
||||
{
|
||||
ScreenWithMenuElements::Update( fDeltaTime );
|
||||
|
||||
if(m_fLockInputSecs <= 0.0f)
|
||||
{
|
||||
bool was_above= m_AutoDismissWarningSecs > 0.0f;
|
||||
m_AutoDismissWarningSecs-= fDeltaTime;
|
||||
if(was_above && m_AutoDismissWarningSecs <= 0.0f)
|
||||
{
|
||||
DismissWarning();
|
||||
}
|
||||
}
|
||||
if(m_AutoDismissNoSetListPromptSecs > 0.0f)
|
||||
{
|
||||
m_AutoDismissNoSetListPromptSecs-= fDeltaTime;
|
||||
if(m_AutoDismissNoSetListPromptSecs <= 0.0f)
|
||||
{
|
||||
m_NoSetListPrompt->PlayCommand("TweenOff");
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Update devices text
|
||||
//
|
||||
m_textDevices.SetText( INPUTMAN->GetDisplayDevicesString() );
|
||||
|
||||
|
||||
if( !m_WaitingForPress.IsZero() && m_DeviceIToMap.IsValid() ) // we're going to map an input
|
||||
{
|
||||
if( m_WaitingForPress.PeekDeltaTime() < g_fSecondsToWaitForInput )
|
||||
return; /* keep waiting */
|
||||
m_WaitingForPress.SetZero();
|
||||
|
||||
ASSERT( m_iCurButton < (int) m_KeysToMap.size() );
|
||||
const KeyToMap *pKey = &m_KeysToMap[m_iCurButton];
|
||||
ASSERT(CursorOnKey());
|
||||
const KeyToMap *pKey = &m_KeysToMap[CurKeyIndex()];
|
||||
|
||||
GameInput curGameI( (GameController)m_iCurController, pKey->m_GameButton );
|
||||
GameInput curGameI( (GameController)m_CurController, pKey->m_GameButton );
|
||||
|
||||
INPUTMAPPER->SetInputMap( m_DeviceIToMap, curGameI, m_iCurSlot );
|
||||
INPUTMAPPER->SetInputMap( m_DeviceIToMap, curGameI, m_CurSlot );
|
||||
INPUTMAPPER->AddDefaultMappingsForCurrentGameIfUnmapped();
|
||||
m_ChangeOccurred= true;
|
||||
|
||||
// commit to disk after each change
|
||||
INPUTMAPPER->SaveMappingsToDisk();
|
||||
|
||||
BitmapText *pText = pKey->m_textMappedTo[m_CurController][m_CurSlot];
|
||||
pText->PlayCommand("MappedInput");
|
||||
if(m_InSetListMode)
|
||||
{
|
||||
pText->PlayCommand("LoseMark");
|
||||
++m_SetListCurrent;
|
||||
if(m_SetListCurrent == m_SetList.end())
|
||||
{
|
||||
m_InSetListMode= false;
|
||||
m_SetList.clear();
|
||||
}
|
||||
else
|
||||
{
|
||||
BeforeChangeFocus();
|
||||
SetCursorFromSetListCurrent();
|
||||
AfterChangeFocus();
|
||||
StartWaitingForPress();
|
||||
}
|
||||
}
|
||||
Refresh();
|
||||
|
||||
BitmapText *pText = pKey->m_textMappedTo[m_iCurController][m_iCurSlot];
|
||||
pText->PlayCommand( "MappedInput" );
|
||||
SCREENMAN->PlayStartSound();
|
||||
}
|
||||
}
|
||||
@@ -230,16 +321,47 @@ static bool IsAxis( const DeviceInput& DeviceI )
|
||||
|
||||
bool ScreenMapControllers::Input( const InputEventPlus &input )
|
||||
{
|
||||
if( m_fLockInputSecs > 0 )
|
||||
if(m_fLockInputSecs > 0.0f)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(m_AutoDismissWarningSecs > 0.0f)
|
||||
{
|
||||
if(input.type == IET_FIRST_PRESS &&
|
||||
input.DeviceI.device == DEVICE_KEYBOARD &&
|
||||
input.DeviceI.button == KEY_ENTER)
|
||||
{
|
||||
m_AutoDismissWarningSecs = 0.0f;
|
||||
DismissWarning();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if(m_AutoDismissNoSetListPromptSecs > 0.0f)
|
||||
{
|
||||
if(input.type == IET_FIRST_PRESS &&
|
||||
input.DeviceI.device == DEVICE_KEYBOARD &&
|
||||
input.DeviceI.button == KEY_ENTER)
|
||||
{
|
||||
m_AutoDismissNoSetListPromptSecs = 0.0f;
|
||||
m_NoSetListPrompt->PlayCommand("TweenOff");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if( input.type != IET_FIRST_PRESS && input.type != IET_REPEAT )
|
||||
{
|
||||
return false; // ignore
|
||||
}
|
||||
if( IsTransitioning() )
|
||||
{
|
||||
return false; // ignore
|
||||
}
|
||||
|
||||
LOG->Trace( "ScreenMapControllers::Input(): device: %d, button: %d",
|
||||
input.DeviceI.device, input.DeviceI.button );
|
||||
// Whoever wants it can uncomment this log spew, I don't think it's necessary. -Kyz
|
||||
// LOG->Trace( "ScreenMapControllers::Input(): device: %d, button: %d",
|
||||
// input.DeviceI.device, input.DeviceI.button );
|
||||
|
||||
int button = input.DeviceI.button;
|
||||
bool bHandled = false;
|
||||
@@ -290,104 +412,129 @@ bool ScreenMapControllers::Input( const InputEventPlus &input )
|
||||
case KEY_DEL:
|
||||
case KEY_SPACE:
|
||||
case KEY_BACK: // Clear the selected input mapping.
|
||||
if( m_iCurButton == (int) m_KeysToMap.size() )
|
||||
break; // on exit
|
||||
|
||||
if(!CursorOnKey())
|
||||
{
|
||||
const KeyToMap *pKey = &m_KeysToMap[m_iCurButton];
|
||||
GameInput curGameI( (GameController)m_iCurController, pKey->m_GameButton );
|
||||
if( !INPUTMAPPER->ClearFromInputMap(curGameI, m_iCurSlot) )
|
||||
break;
|
||||
}
|
||||
{
|
||||
const KeyToMap *pKey = &m_KeysToMap[CurKeyIndex()];
|
||||
GameInput curGameI( (GameController)m_CurController, pKey->m_GameButton );
|
||||
if( !INPUTMAPPER->ClearFromInputMap(curGameI, m_CurSlot) )
|
||||
break;
|
||||
|
||||
INPUTMAPPER->AddDefaultMappingsForCurrentGameIfUnmapped();
|
||||
|
||||
m_soundDelete.Play();
|
||||
|
||||
// commit to disk after each change
|
||||
INPUTMAPPER->SaveMappingsToDisk();
|
||||
bHandled = true;
|
||||
}
|
||||
break;
|
||||
case KEY_LEFT: // Move the selection left, wrapping up.
|
||||
if( m_iCurButton == (int) m_KeysToMap.size() )
|
||||
break; // on exit
|
||||
if( m_iCurSlot == 0 && m_iCurController == 0 )
|
||||
break; // can't go left any more
|
||||
BeforeChangeFocus();
|
||||
m_iCurSlot--;
|
||||
if( m_iCurSlot < 0 )
|
||||
if(CursorOnAction())
|
||||
{
|
||||
m_iCurSlot = NUM_CHANGABLE_SLOTS-1;
|
||||
m_iCurController--;
|
||||
break;
|
||||
}
|
||||
if( m_CurSlot == 0 && m_CurController == 0 )
|
||||
{
|
||||
break; // can't go left any more
|
||||
}
|
||||
BeforeChangeFocus();
|
||||
m_CurSlot--;
|
||||
if( m_CurSlot < 0 )
|
||||
{
|
||||
m_CurSlot = NUM_CHANGABLE_SLOTS-1;
|
||||
m_CurController--;
|
||||
}
|
||||
AfterChangeFocus();
|
||||
m_soundChange.Play();
|
||||
bHandled = true;
|
||||
break;
|
||||
case KEY_RIGHT: // Move the selection right, wrapping down.
|
||||
if( m_iCurButton == (int) m_KeysToMap.size() )
|
||||
break; // on exit
|
||||
if( m_iCurSlot == NUM_CHANGABLE_SLOTS-1 && m_iCurController == NUM_GameController-1 )
|
||||
break; // can't go right any more
|
||||
BeforeChangeFocus();
|
||||
m_iCurSlot++;
|
||||
if( m_iCurSlot > NUM_CHANGABLE_SLOTS-1 )
|
||||
if(CursorOnAction())
|
||||
{
|
||||
m_iCurSlot = 0;
|
||||
m_iCurController++;
|
||||
break;
|
||||
}
|
||||
if( m_CurSlot == NUM_CHANGABLE_SLOTS-1 && m_CurController == NUM_GameController-1 )
|
||||
{
|
||||
break; // can't go right any more
|
||||
}
|
||||
BeforeChangeFocus();
|
||||
m_CurSlot++;
|
||||
if( m_CurSlot > NUM_CHANGABLE_SLOTS-1 )
|
||||
{
|
||||
m_CurSlot = 0;
|
||||
m_CurController++;
|
||||
}
|
||||
AfterChangeFocus();
|
||||
m_soundChange.Play();
|
||||
bHandled = true;
|
||||
break;
|
||||
case KEY_UP: // Move the selection up.
|
||||
if( m_iCurButton == 0 )
|
||||
break; // can't go up any more
|
||||
if(!CursorCanGoUp())
|
||||
{
|
||||
break;
|
||||
}
|
||||
BeforeChangeFocus();
|
||||
m_iCurButton--;
|
||||
m_CurButton--;
|
||||
AfterChangeFocus();
|
||||
m_soundChange.Play();
|
||||
bHandled = true;
|
||||
break;
|
||||
case KEY_DOWN: // Move the selection down.
|
||||
if( m_iCurButton == (int) m_KeysToMap.size() )
|
||||
break; // can't go down any more
|
||||
if(!CursorCanGoDown())
|
||||
{
|
||||
break;
|
||||
}
|
||||
BeforeChangeFocus();
|
||||
m_iCurButton++;
|
||||
m_CurButton++;
|
||||
AfterChangeFocus();
|
||||
m_soundChange.Play();
|
||||
bHandled = true;
|
||||
break;
|
||||
case KEY_ESC: // Quit the screen.
|
||||
SCREENMAN->PlayStartSound();
|
||||
StartTransitioningScreen( SM_GoToNextScreen );
|
||||
ExitAction();
|
||||
bHandled = true;
|
||||
break;
|
||||
case KEY_Cm:
|
||||
if(CursorOnKey())
|
||||
{
|
||||
SetListEntry to_add(SetListEntry(CurKeyIndex(), m_CurController, m_CurSlot));
|
||||
set<SetListEntry>::iterator found= m_SetList.find(to_add);
|
||||
if(found == m_SetList.end())
|
||||
{
|
||||
m_SetList.insert(to_add);
|
||||
GetActorWithFocus()->PlayCommand("GainMark");
|
||||
}
|
||||
else
|
||||
{
|
||||
m_SetList.erase(found);
|
||||
GetActorWithFocus()->PlayCommand("LoseMark");
|
||||
}
|
||||
}
|
||||
break;
|
||||
case KEY_ENTER: // Change the selection.
|
||||
case KEY_KP_ENTER:
|
||||
if( m_iCurButton == (int) m_KeysToMap.size() )
|
||||
bHandled = true;
|
||||
if(CursorOnAction())
|
||||
{
|
||||
(this->*m_Actions[CurActionIndex()].m_action)();
|
||||
SCREENMAN->PlayStartSound();
|
||||
StartTransitioningScreen( SM_GoToNextScreen );
|
||||
break;
|
||||
}
|
||||
|
||||
if(CursorOnHeader())
|
||||
{
|
||||
const KeyToMap *pKey = &m_KeysToMap[m_iCurButton];
|
||||
BitmapText *pText = pKey->m_textMappedTo[m_iCurController][m_iCurSlot];
|
||||
pText->PlayCommand( "Waiting" );
|
||||
break;
|
||||
}
|
||||
m_WaitingForPress.Touch();
|
||||
m_DeviceIToMap.MakeInvalid();
|
||||
StartWaitingForPress();
|
||||
SCREENMAN->PlayStartSound();
|
||||
bHandled = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// ScreenWithMenuElements::Input( input ); // default handler
|
||||
|
||||
LOG->Trace( "m_iCurSlot: %d m_iCurController: %d m_iCurButton: %d", m_iCurSlot, m_iCurController, m_iCurButton );
|
||||
// This trace is also useless log spew. Create a preference or something
|
||||
// configurable if you disagree. -Kyz
|
||||
// LOG->Trace( "m_CurSlot: %d m_CurController: %d m_CurButton: %d", m_CurSlot, m_CurController, m_CurButton );
|
||||
|
||||
Refresh();
|
||||
return bHandled;
|
||||
@@ -395,11 +542,17 @@ bool ScreenMapControllers::Input( const InputEventPlus &input )
|
||||
|
||||
Actor *ScreenMapControllers::GetActorWithFocus()
|
||||
{
|
||||
if( m_iCurButton == (int) m_KeysToMap.size() )
|
||||
return m_sprExit;
|
||||
if(CursorOnAction())
|
||||
{
|
||||
return m_Actions[CurActionIndex()].m_actor;
|
||||
}
|
||||
if(CursorOnHeader())
|
||||
{
|
||||
return &(m_ListHeaderLabels[m_CurController][m_CurSlot]);
|
||||
}
|
||||
|
||||
const KeyToMap *pKey = &m_KeysToMap[m_iCurButton];
|
||||
return pKey->m_textMappedTo[m_iCurController][m_iCurSlot];
|
||||
const KeyToMap *pKey = &m_KeysToMap[CurKeyIndex()];
|
||||
return pKey->m_textMappedTo[m_CurController][m_CurSlot];
|
||||
}
|
||||
|
||||
void ScreenMapControllers::BeforeChangeFocus()
|
||||
@@ -434,7 +587,95 @@ void ScreenMapControllers::Refresh()
|
||||
}
|
||||
}
|
||||
|
||||
m_LineScroller.SetDestinationItem( (float) m_iCurButton );
|
||||
m_LineScroller.SetDestinationItem(
|
||||
static_cast<float>(min(m_CurButton, m_MaxDestItem)));
|
||||
}
|
||||
|
||||
void ScreenMapControllers::DismissWarning()
|
||||
{
|
||||
m_Warning->PlayCommand("TweenOff");
|
||||
}
|
||||
|
||||
bool ScreenMapControllers::CursorOnAction()
|
||||
{
|
||||
// We have a header row, the rows for the keys, and the action rows.
|
||||
// So every row after m_KeysToMap.size is an action row.
|
||||
return m_CurButton >= m_KeysToMap.size()+1;
|
||||
}
|
||||
|
||||
bool ScreenMapControllers::CursorOnHeader()
|
||||
{
|
||||
// We have a header row before all others.
|
||||
// So the header is at 0.
|
||||
return m_CurButton == 0;
|
||||
}
|
||||
|
||||
bool ScreenMapControllers::CursorOnKey()
|
||||
{
|
||||
return !(CursorOnHeader() || CursorOnAction());
|
||||
}
|
||||
|
||||
bool ScreenMapControllers::CursorCanGoUp()
|
||||
{
|
||||
return m_CurButton > 0;
|
||||
}
|
||||
|
||||
bool ScreenMapControllers::CursorCanGoDown()
|
||||
{
|
||||
return m_CurButton < m_KeysToMap.size() + m_Actions.size();
|
||||
}
|
||||
|
||||
int ScreenMapControllers::CurKeyIndex()
|
||||
{
|
||||
// The header row is at 0, so subtract 1 from m_CurButton.
|
||||
return m_CurButton - 1;
|
||||
}
|
||||
|
||||
int ScreenMapControllers::CurActionIndex()
|
||||
{
|
||||
// Subtract the header row and the keys.
|
||||
return m_CurButton - 1 - m_KeysToMap.size();
|
||||
}
|
||||
|
||||
void ScreenMapControllers::SetCursorFromSetListCurrent()
|
||||
{
|
||||
m_CurButton= m_SetListCurrent->m_button + 1;
|
||||
m_CurController= m_SetListCurrent->m_controller;
|
||||
m_CurSlot= m_SetListCurrent->m_slot;
|
||||
}
|
||||
|
||||
void ScreenMapControllers::StartWaitingForPress()
|
||||
{
|
||||
const KeyToMap *pKey = &m_KeysToMap[CurKeyIndex()];
|
||||
BitmapText *pText = pKey->m_textMappedTo[m_CurController][m_CurSlot];
|
||||
pText->PlayCommand( "Waiting" );
|
||||
m_WaitingForPress.Touch();
|
||||
m_DeviceIToMap.MakeInvalid();
|
||||
}
|
||||
|
||||
void ScreenMapControllers::HandleScreenMessage(const ScreenMessage SM)
|
||||
{
|
||||
if(SM == SM_DoSaveAndExit)
|
||||
{
|
||||
switch(ScreenPrompt::s_LastAnswer)
|
||||
{
|
||||
DEFAULT_FAIL(ScreenPrompt::s_LastAnswer);
|
||||
case ANSWER_YES:
|
||||
SaveToDisk();
|
||||
StartTransitioningScreen(SM_GoToNextScreen);
|
||||
break;
|
||||
case ANSWER_NO:
|
||||
ReloadFromDisk();
|
||||
StartTransitioningScreen(SM_GoToNextScreen);
|
||||
break;
|
||||
case ANSWER_CANCEL:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ScreenWithMenuElements::HandleScreenMessage(SM);
|
||||
}
|
||||
}
|
||||
|
||||
void ScreenMapControllers::HandleMessage( const Message &msg )
|
||||
@@ -447,9 +688,78 @@ void ScreenMapControllers::HandleMessage( const Message &msg )
|
||||
ScreenWithMenuElements::HandleMessage( msg );
|
||||
}
|
||||
|
||||
void ScreenMapControllers::ClearToDefault()
|
||||
{
|
||||
INPUTMAPPER->ResetMappingsToDefault();
|
||||
}
|
||||
|
||||
void ScreenMapControllers::ReloadFromDisk()
|
||||
{
|
||||
INPUTMAPPER->ReadMappingsFromDisk();
|
||||
}
|
||||
|
||||
void ScreenMapControllers::SaveToDisk()
|
||||
{
|
||||
INPUTMAPPER->SaveMappingsToDisk();
|
||||
m_ChangeOccurred= false;
|
||||
}
|
||||
|
||||
void ScreenMapControllers::SetListMode()
|
||||
{
|
||||
if(m_SetList.size() < 1)
|
||||
{
|
||||
m_NoSetListPrompt->PlayCommand("TweenOn");
|
||||
m_AutoDismissNoSetListPromptSecs= THEME->GetMetricF(m_sName, "AutoDismissNoSetListPromptSecs");
|
||||
}
|
||||
else
|
||||
{
|
||||
m_SetListCurrent= m_SetList.begin();
|
||||
m_InSetListMode= true;
|
||||
BeforeChangeFocus();
|
||||
SetCursorFromSetListCurrent();
|
||||
AfterChangeFocus();
|
||||
StartWaitingForPress();
|
||||
}
|
||||
}
|
||||
|
||||
void ScreenMapControllers::ExitAction()
|
||||
{
|
||||
if(m_ChangeOccurred)
|
||||
{
|
||||
ScreenPrompt::Prompt(SM_DoSaveAndExit, SAVE_PROMPT, PROMPT_YES_NO_CANCEL,
|
||||
ANSWER_YES);
|
||||
}
|
||||
else
|
||||
{
|
||||
SCREENMAN->PlayStartSound();
|
||||
StartTransitioningScreen(SM_GoToNextScreen);
|
||||
}
|
||||
}
|
||||
|
||||
void ScreenMapControllers::ActionRow::Load(RString const& scr_name,
|
||||
RString const& name, ScreenMapControllers::action_fun_t action,
|
||||
ActorFrame* line, ActorScroller* scroller)
|
||||
{
|
||||
m_action= action;
|
||||
RString lower_name= name;
|
||||
lower_name.MakeLower();
|
||||
// Make the specific actor optional, use a fallback if it doesn't exist.
|
||||
RString path= THEME->GetPathG(scr_name, lower_name, true);
|
||||
if(path.empty())
|
||||
{
|
||||
path= THEME->GetPathG(scr_name, "action");
|
||||
}
|
||||
m_actor.Load(path);
|
||||
m_actor->SetName(name);
|
||||
ActorUtil::LoadAllCommands(*m_actor, scr_name);
|
||||
line->AddChild(m_actor);
|
||||
scroller->AddChild(line);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* (c) 2001-2005 Chris Danford, Glenn Maynard
|
||||
* 2014 Eric Reese
|
||||
* All rights reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
|
||||
@@ -13,23 +13,38 @@ class ScreenMapControllers : public ScreenWithMenuElements
|
||||
{
|
||||
public:
|
||||
ScreenMapControllers();
|
||||
~ScreenMapControllers();
|
||||
virtual void Init();
|
||||
virtual void BeginScreen();
|
||||
|
||||
virtual void Update( float fDeltaTime );
|
||||
virtual bool Input( const InputEventPlus &input );
|
||||
virtual void HandleMessage( const Message &msg );
|
||||
virtual void HandleScreenMessage( const ScreenMessage SM );
|
||||
|
||||
private:
|
||||
virtual void HandleMessage( const Message &msg );
|
||||
|
||||
Actor *GetActorWithFocus();
|
||||
void BeforeChangeFocus();
|
||||
void AfterChangeFocus();
|
||||
void Refresh();
|
||||
void DismissWarning();
|
||||
bool CursorOnAction();
|
||||
bool CursorOnHeader();
|
||||
bool CursorOnKey();
|
||||
bool CursorCanGoUp();
|
||||
bool CursorCanGoDown();
|
||||
int CurKeyIndex();
|
||||
int CurActionIndex();
|
||||
void SetCursorFromSetListCurrent();
|
||||
void StartWaitingForPress();
|
||||
|
||||
int m_iCurController;
|
||||
int m_iCurButton;
|
||||
int m_iCurSlot;
|
||||
unsigned int m_CurController;
|
||||
unsigned int m_CurButton;
|
||||
unsigned int m_CurSlot;
|
||||
unsigned int m_MaxDestItem;
|
||||
|
||||
bool m_ChangeOccurred;
|
||||
|
||||
RageTimer m_WaitingForPress;
|
||||
DeviceInput m_DeviceIToMap;
|
||||
@@ -46,10 +61,58 @@ private:
|
||||
BitmapText m_textDevices;
|
||||
|
||||
BitmapText m_textLabel[NUM_GameController];
|
||||
BitmapText m_ListHeaderCenter;
|
||||
BitmapText m_ListHeaderLabels[NUM_GameController][NUM_SHOWN_GAME_TO_DEVICE_SLOTS];
|
||||
|
||||
AutoActor m_sprExit;
|
||||
float m_AutoDismissWarningSecs;
|
||||
AutoActor m_Warning;
|
||||
|
||||
ActorFrame m_Line[NUM_GameButton+2]; // label, normal lines, exit
|
||||
float m_AutoDismissNoSetListPromptSecs;
|
||||
AutoActor m_NoSetListPrompt;
|
||||
|
||||
struct SetListEntry
|
||||
{
|
||||
int m_button;
|
||||
int m_controller;
|
||||
int m_slot;
|
||||
SetListEntry(int b, int c, int s)
|
||||
:m_button(b), m_controller(c), m_slot(s) {}
|
||||
bool operator<(SetListEntry const& rhs) const
|
||||
{
|
||||
if(m_controller != rhs.m_controller)
|
||||
{
|
||||
return m_controller < rhs.m_controller;
|
||||
}
|
||||
if(m_button != rhs.m_button)
|
||||
{
|
||||
return m_button < rhs.m_button;
|
||||
}
|
||||
return m_slot < rhs.m_slot;
|
||||
}
|
||||
};
|
||||
set<SetListEntry> m_SetList;
|
||||
set<SetListEntry>::iterator m_SetListCurrent;
|
||||
bool m_InSetListMode;
|
||||
|
||||
typedef void (ScreenMapControllers::* action_fun_t)();
|
||||
struct ActionRow
|
||||
{
|
||||
RString m_name;
|
||||
AutoActor m_actor;
|
||||
action_fun_t m_action;
|
||||
void Load(RString const& scr_name, RString const& name,
|
||||
ScreenMapControllers::action_fun_t action, ActorFrame* line,
|
||||
ActorScroller* scroller);
|
||||
};
|
||||
void ClearToDefault();
|
||||
void ReloadFromDisk();
|
||||
void SaveToDisk();
|
||||
void SetListMode();
|
||||
void ExitAction();
|
||||
|
||||
vector<ActionRow> m_Actions;
|
||||
|
||||
vector<ActorFrame*> m_Line;
|
||||
ActorScroller m_LineScroller;
|
||||
|
||||
RageSound m_soundChange;
|
||||
@@ -60,6 +123,7 @@ private:
|
||||
|
||||
/*
|
||||
* (c) 2001-2004 Chris Danford
|
||||
* 2014 Eric Reese
|
||||
* All rights reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
|
||||
@@ -1,532 +0,0 @@
|
||||
#include "global.h"
|
||||
#include "ScreenMapControllers2.h"
|
||||
#include "ScreenManager.h"
|
||||
#include "RageLog.h"
|
||||
#include "GameState.h"
|
||||
#include "RageInput.h"
|
||||
#include "InputMapper.h"
|
||||
#include "ThemeManager.h"
|
||||
#include "ScreenDimensions.h"
|
||||
#include "InputEventPlus.h"
|
||||
#include "LocalizedString.h"
|
||||
#include "Foreach.h"
|
||||
#include "LuaBinding.h"
|
||||
|
||||
static const float g_fSecondsToWaitForInput = 0.05f;
|
||||
|
||||
static const char *MapControlsStateNames[] = {
|
||||
"SelectingButton",
|
||||
"EditingMappings"
|
||||
};
|
||||
XToString( MapControlsState );
|
||||
LuaXType( MapControlsState );
|
||||
|
||||
REGISTER_SCREEN_CLASS( ScreenMapControllers2 );
|
||||
|
||||
ScreenMapControllers2::ScreenMapControllers2()
|
||||
{
|
||||
this->SubscribeToMessage( Message_AutoJoyMappingApplied );
|
||||
m_MapControlsState = MCS_Button;
|
||||
m_EditingButton = GAME_BUTTON_MENULEFT;
|
||||
ZERO( m_iMappingChoice );
|
||||
ZERO( m_iNumMappingRows );
|
||||
}
|
||||
|
||||
static LocalizedString ADD_MAPPING( "ScreenMapControllers2", "Add Mapping" );
|
||||
void ScreenMapControllers2::Init()
|
||||
{
|
||||
ScreenWithMenuElements::Init();
|
||||
|
||||
// load sounds
|
||||
m_soundChange.Load( THEME->GetPathS(m_sName,"change"), true );
|
||||
m_soundDelete.Load( THEME->GetPathS(m_sName,"delete"), true );
|
||||
|
||||
// set devices text
|
||||
m_textDevices.LoadFromFont( THEME->GetPathF(m_sName,"devices") );
|
||||
m_textDevices.SetName( "Devices" );
|
||||
LOAD_ALL_COMMANDS_AND_SET_XY( m_textDevices );
|
||||
this->AddChild( &m_textDevices );
|
||||
|
||||
// button input scroller
|
||||
WRAP_INPUT_SCROLLER.Load( m_sName, "WrapInputScroller" );
|
||||
LOOP_INPUT_SCROLLER.Load( m_sName, "LoopInputScroller" );
|
||||
INPUT_SCROLLER_SECONDS_PER_ITEM.Load( m_sName, "InputScrollerSecondsPerItem" );
|
||||
INPUT_SCROLLER_NUM_ITEMS_TO_DRAW.Load( m_sName, "InputScrollerNumItemsToDraw" );
|
||||
INPUT_SCROLLER_TRANSFORM.Load( m_sName, "InputScrollerTransform" );
|
||||
INPUT_SCROLLER_SUBDIVISIONS.Load( m_sName, "InputScrollerSubdivisions" );
|
||||
|
||||
// map all buttons for this game. (todo: re-add BUTTONS_TO_MAP support?)
|
||||
FOREACH_GameButtonInScheme( INPUTMAPPER->GetInputScheme(), gb )
|
||||
{
|
||||
KeyToMap k;
|
||||
k.m_GameButton = gb;
|
||||
m_KeysToMap.push_back( k );
|
||||
}
|
||||
|
||||
// input button names
|
||||
int iRow = 0;
|
||||
for( unsigned b=0; b<m_KeysToMap.size(); b++ )
|
||||
{
|
||||
KeyToMap *pKey = &m_KeysToMap[b];
|
||||
{
|
||||
BitmapText *pName = new BitmapText;
|
||||
pName->SetName( "ButtonName" );
|
||||
pName->LoadFromFont( THEME->GetPathF(m_sName,"ButtonName") );
|
||||
RString sText = GameButtonToLocalizedString( INPUTMAPPER->GetInputScheme(), pKey->m_GameButton );
|
||||
pName->SetText( sText );
|
||||
ActorUtil::LoadAllCommands( *pName, m_sName );
|
||||
pName->PlayCommand( b == (unsigned)m_iInputChoice ? "GainFocus" : "LoseFocus" );
|
||||
m_InputLine[iRow].AddChild( pName );
|
||||
}
|
||||
|
||||
m_InputLine[iRow].DeleteChildrenWhenDone();
|
||||
m_InputLine[iRow].SetName( "InputLine" );
|
||||
ActorUtil::LoadAllCommands( m_InputLine[iRow], m_sName );
|
||||
m_InputScroller.AddChild( &m_InputLine[iRow] );
|
||||
|
||||
iRow++;
|
||||
}
|
||||
|
||||
m_InputScroller.SetName( "InputScroller" );
|
||||
LOAD_ALL_COMMANDS_AND_SET_XY( m_InputScroller );
|
||||
m_InputScroller.SetLoop( LOOP_INPUT_SCROLLER );
|
||||
m_InputScroller.SetNumItemsToDraw( INPUT_SCROLLER_NUM_ITEMS_TO_DRAW );
|
||||
m_InputScroller.Load2();
|
||||
m_InputScroller.SetTransformFromReference( INPUT_SCROLLER_TRANSFORM );
|
||||
m_InputScroller.SetSecondsPerItem( INPUT_SCROLLER_SECONDS_PER_ITEM );
|
||||
m_InputScroller.SetNumSubdivisions( INPUT_SCROLLER_SUBDIVISIONS );
|
||||
this->AddChild( &m_InputScroller );
|
||||
|
||||
// set player scrollers:
|
||||
vector<PlayerNumber> vpns;
|
||||
FOREACH_PlayerNumber( p )
|
||||
vpns.push_back( p );
|
||||
|
||||
// per-player mappings
|
||||
WRAP_MAPPING_SCROLLER.Load( m_sName, "WrapMappingScroller" );
|
||||
LOOP_MAPPING_SCROLLER.Load( m_sName, "LoopMappingScroller" );
|
||||
MAPPING_SCROLLER_SECONDS_PER_ITEM.Load( m_sName, "MappingScrollerSecondsPerItem" );
|
||||
MAPPING_SCROLLER_NUM_ITEMS_TO_DRAW.Load( m_sName, "MappingScrollerNumItemsToDraw" );
|
||||
MAPPING_SCROLLER_TRANSFORM.Load( m_sName, "MappingScrollerTransform" );
|
||||
MAPPING_SCROLLER_SUBDIVISIONS.Load( m_sName, "MappingScrollerSubdivisions" );
|
||||
|
||||
FOREACH( PlayerNumber, vpns, p )
|
||||
{
|
||||
// mapping scroller
|
||||
m_MappingScroller[*p].SetLoop( LOOP_MAPPING_SCROLLER );
|
||||
m_MappingScroller[*p].SetNumItemsToDraw( MAPPING_SCROLLER_NUM_ITEMS_TO_DRAW );
|
||||
m_MappingScroller[*p].Load2();
|
||||
m_MappingScroller[*p].SetTransformFromReference( MAPPING_SCROLLER_TRANSFORM );
|
||||
m_MappingScroller[*p].SetSecondsPerItem( MAPPING_SCROLLER_SECONDS_PER_ITEM );
|
||||
m_MappingScroller[*p].SetNumSubdivisions( MAPPING_SCROLLER_SUBDIVISIONS );
|
||||
m_MappingScroller[*p].SetName( "MappingScroller"+ssprintf("P%d",(*p)+1) );
|
||||
LOAD_ALL_COMMANDS_AND_SET_XY( m_MappingScroller[*p] );
|
||||
this->AddChild( &m_MappingScroller[*p] );
|
||||
}
|
||||
}
|
||||
|
||||
void ScreenMapControllers2::BeginScreen()
|
||||
{
|
||||
m_iInputChoice = 0;
|
||||
m_ActivePlayerMapping = PLAYER_1;
|
||||
|
||||
ScreenWithMenuElements::BeginScreen();
|
||||
|
||||
m_WaitingForPress.SetZero();
|
||||
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void ScreenMapControllers2::Update( float fDeltaTime )
|
||||
{
|
||||
ScreenWithMenuElements::Update( fDeltaTime );
|
||||
|
||||
// Update devices text
|
||||
m_textDevices.SetText( INPUTMAN->GetDisplayDevicesString() );
|
||||
|
||||
if( !m_WaitingForPress.IsZero() && m_DeviceIToMap.IsValid() )
|
||||
{
|
||||
// we're going to map an input
|
||||
if( m_WaitingForPress.PeekDeltaTime() < g_fSecondsToWaitForInput )
|
||||
return; // keep waiting
|
||||
m_WaitingForPress.SetZero();
|
||||
|
||||
/* do stuff here */
|
||||
//ASSERT( m_iCurButton < (int) m_KeysToMap.size() );
|
||||
//const KeyToMap *pKey = &m_KeysToMap[m_iCurButton];
|
||||
//GameInput curGameI( (GameController)m_iCurController, pKey->m_GameButton );
|
||||
//INPUTMAPPER->SetInputMap( m_DeviceIToMap, curGameI, m_iCurSlot );
|
||||
//INPUTMAPPER->AddDefaultMappingsForCurrentGameIfUnmapped();
|
||||
|
||||
// commit to disk after each change
|
||||
//INPUTMAPPER->SaveMappingsToDisk();
|
||||
|
||||
Refresh();
|
||||
|
||||
/*
|
||||
BitmapText *pText = pKey->m_textMappedTo[m_iCurController][m_iCurSlot];
|
||||
pText->PlayCommand( "MappedInput" );
|
||||
*/
|
||||
SCREENMAN->PlayStartSound();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Note that this isn't necessarily correct. For example, JOY_LEFT might
|
||||
* actually be a D-pad and not an axis. All this is actually doing is giving
|
||||
* priority to some inputs over others; this function is unsuitable for other use. */
|
||||
static bool IsAxis( const DeviceInput& DeviceI )
|
||||
{
|
||||
if( !DeviceI.IsJoystick() )
|
||||
return false;
|
||||
|
||||
static int axes[] =
|
||||
{
|
||||
JOY_LEFT, JOY_RIGHT, JOY_UP, JOY_DOWN,
|
||||
JOY_LEFT_2, JOY_RIGHT_2, JOY_UP_2, JOY_DOWN_2,
|
||||
JOY_Z_UP, JOY_Z_DOWN,
|
||||
JOY_ROT_UP, JOY_ROT_DOWN, JOY_ROT_LEFT, JOY_ROT_RIGHT, JOY_ROT_Z_UP, JOY_ROT_Z_DOWN,
|
||||
JOY_HAT_LEFT, JOY_HAT_RIGHT, JOY_HAT_UP, JOY_HAT_DOWN,
|
||||
JOY_AUX_1, JOY_AUX_2, JOY_AUX_3, JOY_AUX_4,
|
||||
-1
|
||||
};
|
||||
|
||||
for( int ax = 0; axes[ax] != -1; ++ax )
|
||||
if( DeviceI.button == axes[ax] )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void ScreenMapControllers2::ChangeActivePlayer()
|
||||
{
|
||||
m_ActivePlayerMapping = (m_ActivePlayerMapping == PLAYER_1) ? PLAYER_2 : PLAYER_1;
|
||||
Message msg("ActivePlayerChanged");
|
||||
msg.SetParam("NewActivePlayer",m_ActivePlayerMapping);
|
||||
MESSAGEMAN->Broadcast(msg);
|
||||
}
|
||||
|
||||
void ScreenMapControllers2::Input( const InputEventPlus &input )
|
||||
{
|
||||
if( input.type != IET_FIRST_PRESS && input.type != IET_REPEAT )
|
||||
return; // ignore
|
||||
if( IsTransitioning() )
|
||||
return; // ignore
|
||||
|
||||
LOG->Trace( "ScreenMapControllers2::Input(): device: %d, button: %d",
|
||||
input.DeviceI.device, input.DeviceI.button );
|
||||
|
||||
int button = input.DeviceI.button;
|
||||
|
||||
/* TRICKY: Some adapters map the PlayStation digital d-pad to both axes and
|
||||
* buttons. We want buttons to be used for any mappings where possible
|
||||
* because presses of buttons aren't mutually exclusive and presses of axes
|
||||
* are (e.g. can't read presses of both Left and Right simultaneously). So,
|
||||
* when the user presses a button, we'll wait until the next Update before
|
||||
* adding a mapping so that we get a chance to see all input events the
|
||||
* user's press of a panel. Prefer non-axis events over axis events. */
|
||||
if( !m_WaitingForPress.IsZero() )
|
||||
{
|
||||
if( input.type != IET_FIRST_PRESS )
|
||||
return;
|
||||
|
||||
// Don't allow function keys to be mapped.
|
||||
if( input.DeviceI.device == DEVICE_KEYBOARD && (input.DeviceI.button >= KEY_F1 && input.DeviceI.button <= KEY_F12) )
|
||||
{
|
||||
SCREENMAN->SystemMessage( "INVALID_BUTTON" );
|
||||
SCREENMAN->PlayInvalidSound();
|
||||
}
|
||||
else
|
||||
{
|
||||
if( m_DeviceIToMap.IsValid() &&
|
||||
!IsAxis(m_DeviceIToMap) &&
|
||||
IsAxis(input.DeviceI) )
|
||||
{
|
||||
LOG->Trace("Ignored input; non-axis event already received");
|
||||
return; // ignore this press
|
||||
}
|
||||
|
||||
m_DeviceIToMap = input.DeviceI;
|
||||
}
|
||||
}
|
||||
else if( input.DeviceI.device == DEVICE_KEYBOARD )
|
||||
{
|
||||
switch( button )
|
||||
{
|
||||
// todo: m_MapControlsState checks
|
||||
case KEY_UP: // mapping list up
|
||||
{
|
||||
if( m_MapControlsState == MCS_EditMappings )
|
||||
{
|
||||
if( m_iMappingChoice[m_ActivePlayerMapping] == 0 )
|
||||
break;
|
||||
m_iMappingChoice[m_ActivePlayerMapping]--;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case KEY_DOWN: // mapping list down
|
||||
{
|
||||
if( m_MapControlsState == MCS_EditMappings )
|
||||
{
|
||||
if( m_iMappingChoice[m_ActivePlayerMapping] == m_iNumMappingRows[m_ActivePlayerMapping] )
|
||||
break;
|
||||
m_iMappingChoice[m_ActivePlayerMapping]++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case KEY_LEFT: // on P2, changing to P1
|
||||
{
|
||||
if( m_MapControlsState == MCS_EditMappings )
|
||||
{
|
||||
if(m_ActivePlayerMapping == PLAYER_2)
|
||||
ChangeActivePlayer();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case KEY_RIGHT: // on P1, changing to P2
|
||||
{
|
||||
if( m_MapControlsState == MCS_EditMappings )
|
||||
{
|
||||
if(m_ActivePlayerMapping == PLAYER_1)
|
||||
ChangeActivePlayer();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case KEY_DEL:
|
||||
case KEY_BACK:
|
||||
if( m_MapControlsState == MCS_EditMappings )
|
||||
{
|
||||
// clear mapping
|
||||
/*
|
||||
if( m_iMappingChoice[m_ActivePlayerMapping] == m_iNumMappingRows[m_ActivePlayerMapping] )
|
||||
break; // on "add"
|
||||
|
||||
{
|
||||
// stuff
|
||||
|
||||
m_soundDelete.Play();
|
||||
|
||||
// commit to disk after each change
|
||||
INPUTMAPPER->SaveMappingsToDisk();
|
||||
}
|
||||
*/
|
||||
}
|
||||
break;
|
||||
case KEY_ESC:
|
||||
{
|
||||
if(m_MapControlsState == MCS_EditMappings)
|
||||
{
|
||||
// xxx: make sure it's not getting a button.
|
||||
m_MapControlsState = MCS_Button;
|
||||
SCREENMAN->PlayCancelSound();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Quit the screen.
|
||||
SCREENMAN->PlayStartSound();
|
||||
StartTransitioningScreen( SM_GoToNextScreen );
|
||||
}
|
||||
}
|
||||
break;
|
||||
case KEY_ENTER:
|
||||
case KEY_KP_ENTER:
|
||||
{
|
||||
if( m_MapControlsState == MCS_EditMappings )
|
||||
{
|
||||
// map button
|
||||
LOG->Trace("got an enter press...");
|
||||
LOG->Trace( ssprintf("current choice: %i",m_iMappingChoice[m_ActivePlayerMapping]) );
|
||||
if( m_iMappingChoice[m_ActivePlayerMapping] == m_iNumMappingRows[m_ActivePlayerMapping] )
|
||||
{
|
||||
// add
|
||||
LOG->Trace("Adding a new mapping");
|
||||
}
|
||||
else
|
||||
{
|
||||
// replace
|
||||
LOG->Trace("Replacing an existing mapping");
|
||||
}
|
||||
/*
|
||||
m_WaitingForPress.Touch();
|
||||
m_DeviceIToMap.MakeInvalid();
|
||||
SCREENMAN->PlayStartSound();
|
||||
*/
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ScreenWithMenuElements::Input( input ); // default handler
|
||||
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void ScreenMapControllers2::Refresh()
|
||||
{
|
||||
// update mapping scrollers
|
||||
UpdateMappingScrollers();
|
||||
}
|
||||
|
||||
void ScreenMapControllers2::HandleMessage( const Message &msg )
|
||||
{
|
||||
if( msg == Message_AutoJoyMappingApplied )
|
||||
{
|
||||
Refresh();
|
||||
}
|
||||
|
||||
ScreenWithMenuElements::HandleMessage( msg );
|
||||
}
|
||||
|
||||
void ScreenMapControllers2::MenuStart( const InputEventPlus &input )
|
||||
{
|
||||
// MCS_EditMappings is handled in Input() above.
|
||||
if( m_MapControlsState == MCS_Button )
|
||||
{
|
||||
m_MapControlsState = MCS_EditMappings;
|
||||
}
|
||||
}
|
||||
|
||||
void ScreenMapControllers2::UpdateMappingScrollers()
|
||||
{
|
||||
FOREACH_ENUM( GameController, c )
|
||||
{
|
||||
PlayerNumber pn = (PlayerNumber)c;
|
||||
m_MappingScroller[pn].RemoveAllChildren();
|
||||
|
||||
int iLast = 0;
|
||||
for(unsigned s = 0; s < NUM_SHOWN_GAME_TO_DEVICE_SLOTS; s++)
|
||||
{
|
||||
GameInput cur_gi( c, m_EditingButton );
|
||||
DeviceInput di;
|
||||
RString sInput = "";
|
||||
if( INPUTMAPPER->GameToDevice( cur_gi, s, di ) )
|
||||
sInput = INPUTMAN->GetDeviceSpecificInputString(di);
|
||||
|
||||
if( sInput != "" )
|
||||
{
|
||||
m_MappingLine[iLast].RemoveAllChildren();
|
||||
// we have an input, add to the scroller
|
||||
BitmapText *pText = new BitmapText;
|
||||
pText->SetName( "MappedTo"+PlayerNumberToString(pn) );
|
||||
pText->LoadFromFont( THEME->GetPathF(m_sName,"Mapping") );
|
||||
ActorUtil::LoadAllCommands(pText,m_sName);
|
||||
pText->PlayCommand( ((unsigned)m_iMappingChoice[pn] == s) ? "GainFocus" : "LoseFocus" );
|
||||
pText->SetText( sInput );
|
||||
|
||||
m_MappingLine[iLast].AddChild( pText );
|
||||
m_MappingLine[iLast].DeleteChildrenWhenDone();
|
||||
m_MappingLine[iLast].SetName("MappingLine");
|
||||
ActorUtil::LoadAllCommands(m_MappingLine[iLast],m_sName);
|
||||
m_MappingScroller[pn].AddChild( &m_MappingLine[iLast] );
|
||||
iLast++;
|
||||
}
|
||||
}
|
||||
|
||||
BitmapText &text = m_textAddMapping[pn];
|
||||
text.LoadFromFont( THEME->GetPathF(m_sName,"AddMapping") );
|
||||
text.SetName( "AddMapping"+PlayerNumberToString(pn) );
|
||||
ActorUtil::LoadAllCommands( text, m_sName );
|
||||
text.PlayCommand( (m_iMappingChoice[pn] == m_iNumMappingRows[pn]) ? "GainFocus" : "LoseFocus" );
|
||||
text.SetText( ADD_MAPPING );
|
||||
m_MappingScroller[pn].AddChild( &m_textAddMapping[c] );
|
||||
iLast++;
|
||||
|
||||
m_iNumMappingRows[pn] = iLast;
|
||||
|
||||
m_MappingScroller[pn].Load2();
|
||||
m_MappingScroller[pn].SetTransformFromReference( MAPPING_SCROLLER_TRANSFORM );
|
||||
m_MappingScroller[pn].SetCurrentAndDestinationItem( (float)m_iMappingChoice[pn] );
|
||||
}
|
||||
}
|
||||
|
||||
// change game/system button scroller selection
|
||||
void ScreenMapControllers2::ChangeInputSelection(int iDir)
|
||||
{
|
||||
m_InputLine[m_iInputChoice].PlayCommand("LoseFocus");
|
||||
m_iInputChoice += iDir;
|
||||
m_soundChange.Play();
|
||||
m_InputLine[m_iInputChoice].PlayCommand("GainFocus");
|
||||
|
||||
// set scroller
|
||||
m_InputScroller.SetCurrentAndDestinationItem( (float)m_iInputChoice );
|
||||
|
||||
// set current game button
|
||||
KeyToMap *pKey = &m_KeysToMap[m_iInputChoice];
|
||||
m_EditingButton = pKey->m_GameButton;
|
||||
}
|
||||
|
||||
void ScreenMapControllers2::MenuUp( const InputEventPlus &input )
|
||||
{
|
||||
if( m_MapControlsState == MCS_Button )
|
||||
{
|
||||
if( m_iInputChoice == 0 ) // limit
|
||||
return;
|
||||
ChangeInputSelection(-1);
|
||||
}
|
||||
}
|
||||
|
||||
void ScreenMapControllers2::MenuDown( const InputEventPlus &input )
|
||||
{
|
||||
if( m_MapControlsState == MCS_Button )
|
||||
{
|
||||
if( m_iInputChoice == (int)m_KeysToMap.size()-1 ) // limit
|
||||
return;
|
||||
ChangeInputSelection(1);
|
||||
}
|
||||
}
|
||||
|
||||
void ScreenMapControllers2::TweenOnScreen()
|
||||
{
|
||||
ScreenWithMenuElements::TweenOnScreen();
|
||||
|
||||
m_InputScroller.SetCurrentAndDestinationItem( (float)m_iInputChoice );
|
||||
}
|
||||
|
||||
// lua start
|
||||
#include "LuaBinding.h"
|
||||
|
||||
/** @brief Allow Lua to have access to ScreenMapControllers2. */
|
||||
class LunaScreenMapControllers2: public Luna<ScreenMapControllers2>
|
||||
{
|
||||
public:
|
||||
//static int MapControlsState( T* p, lua_State *L ) //
|
||||
//static int GetEditingGameButton( T* p, lua_State *L ) // GetEditingGameButton()
|
||||
DEFINE_METHOD( GetInputIndex, GetInputIndex() );
|
||||
DEFINE_METHOD( GetNumInputs, GetNumInputs() );
|
||||
LunaScreenMapControllers2()
|
||||
{
|
||||
//ADD_METHOD( GetEditingGameButton );
|
||||
ADD_METHOD( GetInputIndex );
|
||||
ADD_METHOD( GetNumInputs );
|
||||
//ADD_METHOD( MapControlsState );
|
||||
}
|
||||
};
|
||||
|
||||
LUA_REGISTER_DERIVED_CLASS( ScreenMapControllers2, ScreenWithMenuElements )
|
||||
|
||||
|
||||
/*
|
||||
* (c) 2011 AJ Kelly
|
||||
* 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.
|
||||
*/
|
||||
@@ -1,136 +0,0 @@
|
||||
/* ScreenMapControllers2 - Maps device input to game buttons. */
|
||||
|
||||
#ifndef SCREEN_MAP_CONTROLLERS2_H
|
||||
#define SCREEN_MAP_CONTROLLERS2_H
|
||||
|
||||
#include "ScreenWithMenuElements.h"
|
||||
#include "BitmapText.h"
|
||||
#include "InputMapper.h"
|
||||
#include "ActorScroller.h"
|
||||
#include "RageSound.h"
|
||||
#include "EnumHelper.h"
|
||||
#include "ThemeMetric.h"
|
||||
|
||||
/* old inputmapper consts:
|
||||
const int NUM_GAME_TO_DEVICE_SLOTS = 5; // five device inputs may map to one game input
|
||||
const int NUM_SHOWN_GAME_TO_DEVICE_SLOTS = 3;
|
||||
const int NUM_USER_GAME_TO_DEVICE_SLOTS = 2;
|
||||
*/
|
||||
const int MAPPING_LINE = NUM_SHOWN_GAME_TO_DEVICE_SLOTS+1; // +1 for "Add Mapping"
|
||||
|
||||
enum MapControlsState
|
||||
{
|
||||
MCS_Button, // which button to edit mappings for
|
||||
MCS_EditMappings, // player is editing mappings
|
||||
NUM_MapControlsState,
|
||||
MapControlsState_Invalid
|
||||
};
|
||||
const RString& MapControlsStateToString( MapControlsState mct );
|
||||
LuaDeclareType( MapControlsState );
|
||||
|
||||
class ScreenMapControllers2 : public ScreenWithMenuElements
|
||||
{
|
||||
public:
|
||||
ScreenMapControllers2();
|
||||
virtual void Init();
|
||||
virtual void BeginScreen();
|
||||
//virtual void EndScreen();
|
||||
|
||||
virtual void Update( float fDeltaTime );
|
||||
virtual bool Input( const InputEventPlus &input );
|
||||
|
||||
virtual bool MenuUp( const InputEventPlus &input );
|
||||
virtual bool MenuDown( const InputEventPlus &input );
|
||||
virtual bool MenuStart( const InputEventPlus &input );
|
||||
virtual void TweenOnScreen();
|
||||
|
||||
MapControlsState GetMapControlsState(){ return m_MapControlsState; }
|
||||
GameButton GetEditingGameButton() { return m_EditingButton; }
|
||||
int GetInputIndex(){ return m_iInputChoice; }
|
||||
int GetNumInputs(){ return m_KeysToMap.size(); }
|
||||
int GetMappingIndex(PlayerNumber pn){ return m_iMappingChoice[pn]; }
|
||||
|
||||
// Lua
|
||||
virtual void PushSelf( lua_State *L );
|
||||
|
||||
protected:
|
||||
virtual void HandleMessage( const Message &msg );
|
||||
|
||||
void ChangeActivePlayer();
|
||||
void ChangeInputSelection(int iDir);
|
||||
void UpdateMappingScrollers();
|
||||
void Refresh();
|
||||
|
||||
MapControlsState m_MapControlsState;
|
||||
RageTimer m_WaitingForPress;
|
||||
DeviceInput m_DeviceIToMap;
|
||||
|
||||
struct KeyToMap
|
||||
{
|
||||
GameButton m_GameButton;
|
||||
BitmapText* m_textLabel;
|
||||
};
|
||||
vector<KeyToMap> m_KeysToMap;
|
||||
|
||||
BitmapText m_textDevices;
|
||||
//vector<BitmapText> m_textMappingLabels[NUM_PLAYERS];
|
||||
BitmapText m_textAddMapping[NUM_PLAYERS];
|
||||
|
||||
// possible inputs
|
||||
int m_iInputChoice;
|
||||
ActorScroller m_InputScroller;
|
||||
ActorFrame m_InputLine[NUM_GameButton];
|
||||
ThemeMetric<bool> WRAP_INPUT_SCROLLER;
|
||||
ThemeMetric<bool> LOOP_INPUT_SCROLLER;
|
||||
ThemeMetric<float> INPUT_SCROLLER_SECONDS_PER_ITEM;
|
||||
ThemeMetric<float> INPUT_SCROLLER_NUM_ITEMS_TO_DRAW;
|
||||
ThemeMetric<LuaReference> INPUT_SCROLLER_TRANSFORM;
|
||||
ThemeMetric<int> INPUT_SCROLLER_SUBDIVISIONS;
|
||||
|
||||
// per-player button mappings.
|
||||
GameButton m_EditingButton;
|
||||
PlayerNumber m_ActivePlayerMapping;
|
||||
int m_iMappingChoice[NUM_PLAYERS];
|
||||
int m_iNumMappingRows[NUM_PLAYERS];
|
||||
ActorScroller m_MappingScroller[NUM_PLAYERS];
|
||||
ActorFrame m_MappingLine[MAPPING_LINE];
|
||||
ThemeMetric<bool> WRAP_MAPPING_SCROLLER;
|
||||
ThemeMetric<bool> LOOP_MAPPING_SCROLLER;
|
||||
ThemeMetric<float> MAPPING_SCROLLER_SECONDS_PER_ITEM;
|
||||
ThemeMetric<float> MAPPING_SCROLLER_NUM_ITEMS_TO_DRAW;
|
||||
ThemeMetric<LuaReference> MAPPING_SCROLLER_TRANSFORM;
|
||||
ThemeMetric<int> MAPPING_SCROLLER_SUBDIVISIONS;
|
||||
|
||||
// should be handled in lua
|
||||
//BitmapText m_textLabel[NUM_GameController];
|
||||
|
||||
RageSound m_soundChange;
|
||||
RageSound m_soundDelete;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* (c) 2011 AJ Kelly
|
||||
* 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.
|
||||
*/
|
||||
+55
-41
@@ -124,10 +124,10 @@ static RString GetActualGraphicOptionsString()
|
||||
RString sLog = ssprintf( sFormat,
|
||||
DISPLAY->GetApiDescription().c_str(),
|
||||
(params.windowed? WINDOWED : FULLSCREEN).GetValue().c_str(),
|
||||
(int)params.width,
|
||||
(int)params.height,
|
||||
(int)params.bpp,
|
||||
(int)PREFSMAN->m_iTextureColorDepth,
|
||||
(int)params.width,
|
||||
(int)params.height,
|
||||
(int)params.bpp,
|
||||
(int)PREFSMAN->m_iTextureColorDepth,
|
||||
(int)params.rate,
|
||||
(params.vsync? VSYNC : NO_VSYNC).GetValue().c_str(),
|
||||
(PREFSMAN->m_bSmoothLines? SMOOTH_LINES : NO_SMOOTH_LINES).GetValue().c_str() );
|
||||
@@ -142,7 +142,7 @@ static void StoreActualGraphicOptions()
|
||||
const VideoModeParams ¶ms = DISPLAY->GetActualVideoModeParams();
|
||||
PREFSMAN->m_bWindowed.Set( params.windowed );
|
||||
|
||||
/* If we're windowed, we may have tweaked the width based on the aspect ratio.
|
||||
/* If we're windowed, we may have tweaked the width based on the aspect ratio.
|
||||
* Don't save this new value over the preferred value. */
|
||||
if( !PREFSMAN->m_bWindowed )
|
||||
{
|
||||
@@ -184,17 +184,17 @@ static void StartDisplay()
|
||||
DISPLAY = CreateDisplay();
|
||||
|
||||
DISPLAY->ChangeCentering(
|
||||
PREFSMAN->m_iCenterImageTranslateX,
|
||||
PREFSMAN->m_iCenterImageTranslateX,
|
||||
PREFSMAN->m_iCenterImageTranslateY,
|
||||
PREFSMAN->m_fCenterImageAddWidth,
|
||||
PREFSMAN->m_fCenterImageAddHeight );
|
||||
|
||||
TEXTUREMAN = new RageTextureManager;
|
||||
TEXTUREMAN->SetPrefs(
|
||||
RageTextureManagerPrefs(
|
||||
PREFSMAN->m_iTextureColorDepth,
|
||||
TEXTUREMAN->SetPrefs(
|
||||
RageTextureManagerPrefs(
|
||||
PREFSMAN->m_iTextureColorDepth,
|
||||
PREFSMAN->m_iMovieColorDepth,
|
||||
PREFSMAN->m_bDelayedTextureDelete,
|
||||
PREFSMAN->m_bDelayedTextureDelete,
|
||||
PREFSMAN->m_iMaxTextureResolution,
|
||||
StepMania::GetHighResolutionTextures(),
|
||||
PREFSMAN->m_bForceMipMaps
|
||||
@@ -202,15 +202,15 @@ static void StartDisplay()
|
||||
);
|
||||
|
||||
MODELMAN = new ModelManager;
|
||||
MODELMAN->SetPrefs(
|
||||
MODELMAN->SetPrefs(
|
||||
ModelManagerPrefs(
|
||||
PREFSMAN->m_bDelayedModelDelete
|
||||
PREFSMAN->m_bDelayedModelDelete
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
void StepMania::ApplyGraphicOptions()
|
||||
{
|
||||
{
|
||||
bool bNeedReload = false;
|
||||
|
||||
VideoModeParams params;
|
||||
@@ -220,25 +220,25 @@ void StepMania::ApplyGraphicOptions()
|
||||
RageException::Throw( "%s", sError.c_str() );
|
||||
|
||||
DISPLAY->ChangeCentering(
|
||||
PREFSMAN->m_iCenterImageTranslateX,
|
||||
PREFSMAN->m_iCenterImageTranslateX,
|
||||
PREFSMAN->m_iCenterImageTranslateY,
|
||||
PREFSMAN->m_fCenterImageAddWidth,
|
||||
PREFSMAN->m_fCenterImageAddHeight );
|
||||
|
||||
bNeedReload |= TEXTUREMAN->SetPrefs(
|
||||
RageTextureManagerPrefs(
|
||||
PREFSMAN->m_iTextureColorDepth,
|
||||
bNeedReload |= TEXTUREMAN->SetPrefs(
|
||||
RageTextureManagerPrefs(
|
||||
PREFSMAN->m_iTextureColorDepth,
|
||||
PREFSMAN->m_iMovieColorDepth,
|
||||
PREFSMAN->m_bDelayedTextureDelete,
|
||||
PREFSMAN->m_bDelayedTextureDelete,
|
||||
PREFSMAN->m_iMaxTextureResolution,
|
||||
StepMania::GetHighResolutionTextures(),
|
||||
PREFSMAN->m_bForceMipMaps
|
||||
)
|
||||
);
|
||||
|
||||
bNeedReload |= MODELMAN->SetPrefs(
|
||||
bNeedReload |= MODELMAN->SetPrefs(
|
||||
ModelManagerPrefs(
|
||||
PREFSMAN->m_bDelayedModelDelete
|
||||
PREFSMAN->m_bDelayedModelDelete
|
||||
)
|
||||
);
|
||||
|
||||
@@ -371,14 +371,14 @@ static void AdjustForChangedSystemCapabilities()
|
||||
|
||||
if( g_iLastSeenMemory == Memory )
|
||||
return;
|
||||
|
||||
|
||||
LOG->Trace( "Memory changed from %i to %i; settings changed", g_iLastSeenMemory.Get(), Memory );
|
||||
g_iLastSeenMemory.Set( Memory );
|
||||
|
||||
// is this assumption outdated? -aj
|
||||
/* Let's consider 128-meg systems low-memory, and 256-meg systems high-memory.
|
||||
* Cut off at 192. This is pretty conservative; many 128-meg systems can
|
||||
* deal with higher memory profile settings, but some can't.
|
||||
* deal with higher memory profile settings, but some can't.
|
||||
*
|
||||
* Actually, Windows lops off a meg or two; cut off a little lower to treat
|
||||
* 192-meg systems as high-memory. */
|
||||
@@ -452,7 +452,7 @@ struct VideoCardDefaults
|
||||
iTextureSize = iTextureSize_;
|
||||
bSmoothLines = bSmoothLines_;
|
||||
}
|
||||
} const g_VideoCardDefaults[] =
|
||||
} const g_VideoCardDefaults[] =
|
||||
{
|
||||
VideoCardDefaults(
|
||||
"Voodoo *5",
|
||||
@@ -505,7 +505,7 @@ struct VideoCardDefaults
|
||||
VideoCardDefaults(
|
||||
"Savage",
|
||||
"d3d",
|
||||
// OpenGL is unusable on my Savage IV with even the latest drivers.
|
||||
// OpenGL is unusable on my Savage IV with even the latest drivers.
|
||||
// It draws 30 frames of gibberish then crashes. This happens even with
|
||||
// simple NeHe demos. -Chris
|
||||
640,480,
|
||||
@@ -516,8 +516,8 @@ struct VideoCardDefaults
|
||||
VideoCardDefaults(
|
||||
"XPERT@PLAY|IIC|RAGE PRO|RAGE LT PRO", // Rage Pro chip, Rage IIC chip
|
||||
"d3d",
|
||||
// OpenGL is not hardware accelerated, despite the fact that the
|
||||
// drivers come with an ICD. Also, the WinXP driver performance
|
||||
// OpenGL is not hardware accelerated, despite the fact that the
|
||||
// drivers come with an ICD. Also, the WinXP driver performance
|
||||
// is terrible and supports only 640. The ATI driver is usable.
|
||||
// -Chris
|
||||
320,240, // lower resolution for 60fps. In-box WinXP driver doesn't support 400x300.
|
||||
@@ -651,7 +651,7 @@ bool CheckVideoDefaultSettings()
|
||||
bSetDefaultVideoParams = true;
|
||||
LOG->Trace( "Applying defaults for %s.", sVideoDriver.c_str() );
|
||||
}
|
||||
else if( PREFSMAN->m_sLastSeenVideoDriver.Get() != sVideoDriver )
|
||||
else if( PREFSMAN->m_sLastSeenVideoDriver.Get() != sVideoDriver )
|
||||
{
|
||||
bSetDefaultVideoParams = true;
|
||||
LOG->Trace( "Video card has changed from %s to %s. Applying new defaults.", PREFSMAN->m_sLastSeenVideoDriver.Get().c_str(), sVideoDriver.c_str() );
|
||||
@@ -723,7 +723,7 @@ RageDisplay *CreateDisplay()
|
||||
VideoModeParams params;
|
||||
StepMania::GetPreferredVideoModeParams( params );
|
||||
|
||||
RString error = ERROR_INITIALIZING_CARD.GetValue()+"\n\n"+
|
||||
RString error = ERROR_INITIALIZING_CARD.GetValue()+"\n\n"+
|
||||
ERROR_DONT_FILE_BUG.GetValue()+"\n\n"
|
||||
VIDEO_TROUBLESHOOTING_URL "\n\n"+
|
||||
ssprintf(ERROR_VIDEO_DRIVER.GetValue(), GetVideoDriverName().c_str())+"\n\n";
|
||||
@@ -954,11 +954,11 @@ int main(int argc, char* argv[])
|
||||
// Almost everything uses this to read and write files. Load this early.
|
||||
FILEMAN = new RageFileManager( argv[0] );
|
||||
FILEMAN->MountInitialFilesystems();
|
||||
|
||||
|
||||
bool bPortable = DoesFileExist("Portable.ini");
|
||||
if( !bPortable )
|
||||
FILEMAN->MountUserFilesystems();
|
||||
|
||||
|
||||
// Set this up next. Do this early, since it's needed for RageException::Throw.
|
||||
LOG = new RageLog;
|
||||
|
||||
@@ -1240,18 +1240,32 @@ void StepMania::InsertCoin( int iNum, bool bCountInBookkeeping )
|
||||
BOOKKEEPER->CoinInserted();
|
||||
}
|
||||
int iNumCoinsOld = GAMESTATE->m_iCoins;
|
||||
GAMESTATE->m_iCoins.Set( GAMESTATE->m_iCoins + iNum );
|
||||
|
||||
// Don't allow GAMESTATE's coin count to become negative.
|
||||
if (GAMESTATE->m_iCoins + iNum >= 0)
|
||||
{
|
||||
GAMESTATE->m_iCoins.Set( GAMESTATE->m_iCoins + iNum );
|
||||
}
|
||||
|
||||
int iCredits = GAMESTATE->m_iCoins / PREFSMAN->m_iCoinsPerCredit;
|
||||
bool bMaxCredits = iCredits >= MAX_NUM_CREDITS;
|
||||
if( bMaxCredits )
|
||||
{
|
||||
GAMESTATE->m_iCoins.Set( MAX_NUM_CREDITS * PREFSMAN->m_iCoinsPerCredit );
|
||||
|
||||
}
|
||||
|
||||
LOG->Trace("%i coins inserted, %i needed to play", GAMESTATE->m_iCoins.Get(), PREFSMAN->m_iCoinsPerCredit.Get() );
|
||||
if( iNumCoinsOld != GAMESTATE->m_iCoins )
|
||||
SCREENMAN->PlayCoinSound();
|
||||
else
|
||||
SCREENMAN->PlayInvalidSound();
|
||||
|
||||
// If inserting coins, play an appropriate sound; if deducting coins, don't play anything.
|
||||
if (iNum > 0)
|
||||
{
|
||||
if( iNumCoinsOld != GAMESTATE->m_iCoins )
|
||||
{
|
||||
SCREENMAN->PlayCoinSound();
|
||||
} else {
|
||||
SCREENMAN->PlayInvalidSound();
|
||||
}
|
||||
}
|
||||
|
||||
/* If AutoJoin and a player is already joined, then try to join a player.
|
||||
* (If no players are joined, they'll join on the first JoinInput.) */
|
||||
@@ -1299,7 +1313,7 @@ static LocalizedString RELOADED_OVERLAY_SCREENS( "ThemeManager", "Reloaded overl
|
||||
bool HandleGlobalInputs( const InputEventPlus &input )
|
||||
{
|
||||
// None of the globals keys act on types other than FIRST_PRESS
|
||||
if( input.type != IET_FIRST_PRESS )
|
||||
if( input.type != IET_FIRST_PRESS )
|
||||
return false;
|
||||
|
||||
switch( input.MenuI )
|
||||
@@ -1403,21 +1417,21 @@ bool HandleGlobalInputs( const InputEventPlus &input )
|
||||
}
|
||||
#endif
|
||||
|
||||
bool bDoScreenshot =
|
||||
bool bDoScreenshot =
|
||||
#if defined(MACOSX)
|
||||
// Notebooks don't have F13. Use cmd-F12 as well.
|
||||
input.DeviceI == DeviceInput( DEVICE_KEYBOARD, KEY_PRTSC ) ||
|
||||
input.DeviceI == DeviceInput( DEVICE_KEYBOARD, KEY_F13 ) ||
|
||||
( input.DeviceI == DeviceInput(DEVICE_KEYBOARD, KEY_F12) &&
|
||||
( input.DeviceI == DeviceInput(DEVICE_KEYBOARD, KEY_F12) &&
|
||||
(INPUTFILTER->IsBeingPressed(DeviceInput(DEVICE_KEYBOARD, KEY_LMETA), &input.InputList) ||
|
||||
INPUTFILTER->IsBeingPressed(DeviceInput(DEVICE_KEYBOARD, KEY_RMETA), &input.InputList)) );
|
||||
#else
|
||||
/* The default Windows message handler will capture the desktop window upon
|
||||
* pressing PrntScrn, or will capture the foreground with focus upon pressing
|
||||
* Alt+PrntScrn. Windows will do this whether or not we save a screenshot
|
||||
* Alt+PrntScrn. Windows will do this whether or not we save a screenshot
|
||||
* ourself by dumping the frame buffer. */
|
||||
// "if pressing PrintScreen and not pressing Alt"
|
||||
input.DeviceI == DeviceInput(DEVICE_KEYBOARD, KEY_PRTSC) &&
|
||||
input.DeviceI == DeviceInput(DEVICE_KEYBOARD, KEY_PRTSC) &&
|
||||
!INPUTFILTER->IsBeingPressed(DeviceInput(DEVICE_KEYBOARD, KEY_LALT), &input.InputList) &&
|
||||
!INPUTFILTER->IsBeingPressed(DeviceInput(DEVICE_KEYBOARD, KEY_RALT), &input.InputList);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user