Skip to content

Commit

Permalink
Remove non-useful code detector stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
poco0317 committed Dec 19, 2018
1 parent 7f5bf9b commit 102ddad
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 151 deletions.
20 changes: 0 additions & 20 deletions Themes/Til Death/metrics.ini
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,15 @@ Left=GetCodeForGame("Left")
Right=GetCodeForGame("Right")
Shuffle=GetCodeForGame("Shuffle")
SuperShuffle=GetCodeForGame("SuperShuffle")
NextTransform=GetCodeForGame("NextTransform")
NextScrollSpeed=GetCodeForGame("NextScrollSpeed")
PreviousScrollSpeed=GetCodeForGame("PreviousScrollSpeed")
NextAccel=GetCodeForGame("NextAccel")
NextEffect=GetCodeForGame("NextEffect")
NextAppearance=GetCodeForGame("NextAppearance")
NextTurn=GetCodeForGame("NextTurn")
Reverse=GetCodeForGame("Reverse")
HoldNotes=GetCodeForGame("HoldNotes")
Mines=GetCodeForGame("Mines")
Dark=GetCodeForGame("Dark")
CancelAll=GetCodeForGame("CancelAll")
NextGroup=GetCodeForGame("NextGroup")
PrevGroup=GetCodeForGame("PrevGroup")
CloseCurrentFolder=GetCodeForGame("CloseCurrentFolder")
Hidden=GetCodeForGame("Hidden")
RandomVanish=GetCodeForGame("RandomVanish")
SaveScreenshot1=GetCodeForGame("SaveScreenshot1")
SaveScreenshot2=GetCodeForGame("SaveScreenshot2")

Expand All @@ -64,18 +56,6 @@ CancelAllPlayerOptions=

# unused codes:
Backwards=""
# deprecated codes:
NextTheme=""
NextTheme2=""
NextAnnouncer=""
NextAnnouncer2=""
BackInEventMode=""
# NextTheme="Left,Left,Left,Right,Right,Right,Left,Right"
# NextTheme2="MenuLeft,MenuLeft,MenuLeft,MenuRight,MenuRight,MenuRight,MenuLeft,MenuRight"
# NextAnnouncer="Left,Left,Right,Right,Left,Left,Right,Right"
# NextAnnouncer2="MenuLeft,MenuLeft,MenuRight,MenuRight,MenuLeft,MenuLeft,MenuRight,MenuRight"



[Combo]
# System Direction
Expand Down
30 changes: 0 additions & 30 deletions Themes/_fallback/Scripts/03 Gameplay.lua
Original file line number Diff line number Diff line change
Expand Up @@ -394,28 +394,13 @@ local CodeDetectorCodes = {
dance = "",
pump = "UpLeft,DownLeft,UpRight,DownRight,UpLeft,DownLeft,UpRight,DownRight,DownRight" -- drop
},
HoldNotes = {
default = "",
dance = ""
},
Mines = {
default = ""
},
Dark = {
default = ""
},
Hidden = {
default = "",
pump = "UpLeft,UpRight,DownLeft,DownRight,Center" -- vanish
},
RandomVanish = {
default = ""
},
-- boost (accel), brake (decel), stealth (nonstep)
--- next/prev modifiers
NextTransform = {
default = ""
},
NextScrollSpeed = {
default = "",
dance = "",
Expand All @@ -426,21 +411,6 @@ local CodeDetectorCodes = {
dance = "",
pump = "UpRight,UpLeft,UpRight,UpLeft,Center"
},
NextAccel = {
default = "",
dance = ""
},
NextEffect = {
default = "",
dance = ""
},
NextAppearance = {
default = "",
dance = ""
},
NextTurn = {
default = ""
},
-- cancel all in player options
CancelAllPlayerOptions = {
default = "",
Expand Down
21 changes: 0 additions & 21 deletions Themes/_fallback/metrics.ini
Original file line number Diff line number Diff line change
Expand Up @@ -242,39 +242,22 @@ Left=GetCodeForGame("Left")
Right=GetCodeForGame("Right")
Shuffle=GetCodeForGame("Shuffle")
SuperShuffle=GetCodeForGame("SuperShuffle")
NextTransform=GetCodeForGame("NextTransform")
NextScrollSpeed=GetCodeForGame("NextScrollSpeed")
PreviousScrollSpeed=GetCodeForGame("PreviousScrollSpeed")
NextAccel=GetCodeForGame("NextAccel")
NextEffect=GetCodeForGame("NextEffect")
NextAppearance=GetCodeForGame("NextAppearance")
NextTurn=GetCodeForGame("NextTurn")
Reverse=GetCodeForGame("Reverse")
HoldNotes=GetCodeForGame("HoldNotes")
Mines=GetCodeForGame("Mines")
Dark=GetCodeForGame("Dark")
CancelAll=GetCodeForGame("CancelAll")
NextGroup=GetCodeForGame("NextGroup")
PrevGroup=GetCodeForGame("PrevGroup")
CloseCurrentFolder=GetCodeForGame("CloseCurrentFolder")
Hidden=GetCodeForGame("Hidden")
RandomVanish=GetCodeForGame("RandomVanish")
SaveScreenshot1=GetCodeForGame("SaveScreenshot1")
SaveScreenshot2=GetCodeForGame("SaveScreenshot2")
# on the player options menu.
CancelAllPlayerOptions=GetCodeForGame("CancelAllPlayerOptions")
# unused codes:
Backwards=""
# deprecated codes:
NextTheme=""
NextTheme2=""
NextAnnouncer=""
NextAnnouncer2=""
BackInEventMode=""
# NextTheme="Left,Left,Left,Right,Right,Right,Left,Right"
# NextTheme2="MenuLeft,MenuLeft,MenuLeft,MenuRight,MenuRight,MenuRight,MenuLeft,MenuRight"
# NextAnnouncer="Left,Left,Right,Right,Left,Left,Right,Right"
# NextAnnouncer2="MenuLeft,MenuLeft,MenuRight,MenuRight,MenuLeft,MenuLeft,MenuRight,MenuRight"

[CodeDetectorOnline]
Fallback="CodeDetector"
Expand All @@ -292,11 +275,7 @@ Shuffle=""
SuperShuffle=""
NextScrollSpeed=""
PreviousScrollSpeed=""
NextAccel=""
NextEffect=""
NextAppearance=""
Reverse=""
HoldNotes=""
CancelAll=""

[Combo]
Expand Down
39 changes: 1 addition & 38 deletions src/CodeDetector.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "global.h"
#include "global.h"
#include "CodeDetector.h"
#include "Game.h"
#include "GameState.h"
Expand Down Expand Up @@ -29,27 +29,15 @@ const char* CodeNames[] = {
"NextTransform",
"NextScrollSpeed",
"PreviousScrollSpeed",
"NextAccel",
"NextEffect",
"NextAppearance",
"NextTurn",
"Reverse",
"HoldNotes",
"Mines",
"Dark",
"Hidden",
"RandomVanish",
"CancelAll",
"NextTheme",
"NextTheme2",
"NextAnnouncer",
"NextAnnouncer2",
"NextGroup",
"PrevGroup",
"SaveScreenshot1",
"SaveScreenshot2",
"CancelAllPlayerOptions",
"BackInEventMode",
"CloseCurrentFolder",
};
XToString(Code);
Expand Down Expand Up @@ -279,46 +267,21 @@ CodeDetector::DetectAndAdjustMusicOptions(GameController controller)
case CODE_PREVIOUS_SCROLL_SPEED:
DECREMENT_SCROLL_SPEED(po.m_fScrollSpeed);
break;
case CODE_NEXT_ACCEL:
po.NextAccel();
break;
case CODE_NEXT_EFFECT:
po.NextEffect();
break;
case CODE_NEXT_APPEARANCE:
po.NextAppearance();
break;
case CODE_NEXT_TURN:
po.NextTurn();
break;
case CODE_REVERSE:
po.NextScroll();
break;
case CODE_HOLDS:
TOGGLE(po.m_bTransforms[PlayerOptions::TRANSFORM_NOHOLDS],
true,
false);
break;
case CODE_MINES:
TOGGLE(po.m_bTransforms[PlayerOptions::TRANSFORM_NOMINES],
true,
false);
break;
case CODE_DARK:
FLOAT_TOGGLE(po.m_fDark);
break;
case CODE_CANCEL_ALL:
GAMESTATE->GetDefaultPlayerOptions(po);
break;
case CODE_HIDDEN:
ZERO(po.m_fAppearances);
po.m_fAppearances[PlayerOptions::APPEARANCE_HIDDEN] = 1;
break;
case CODE_RANDOMVANISH:
ZERO(po.m_fAppearances);
po.m_fAppearances[PlayerOptions::APPEARANCE_RANDOMVANISH] =
1;
break;
default:
break;
}
Expand Down
12 changes: 0 additions & 12 deletions src/CodeDetector.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,27 +26,15 @@ enum Code
CODE_NEXT_TRANSFORM,
CODE_NEXT_SCROLL_SPEED,
CODE_PREVIOUS_SCROLL_SPEED,
CODE_NEXT_ACCEL,
CODE_NEXT_EFFECT,
CODE_NEXT_APPEARANCE,
CODE_NEXT_TURN,
CODE_REVERSE,
CODE_HOLDS,
CODE_MINES,
CODE_DARK,
CODE_HIDDEN,
CODE_RANDOMVANISH,
CODE_CANCEL_ALL,
CODE_NEXT_THEME,
CODE_NEXT_THEME2,
CODE_NEXT_ANNOUNCER,
CODE_NEXT_ANNOUNCER2,
CODE_NEXT_GROUP,
CODE_PREV_GROUP,
CODE_SAVE_SCREENSHOT1,
CODE_SAVE_SCREENSHOT2,
CODE_CANCEL_ALL_PLAYER_OPTIONS,
CODE_BACK_IN_EVENT_MODE,
CODE_CLOSE_CURRENT_FOLDER,
NUM_Code // leave this at the end
};
Expand Down
24 changes: 0 additions & 24 deletions src/ScreenTitleMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,30 +54,6 @@ ScreenTitleMenu::Input(const InputEventPlus& input)
return false;

bool bHandled = false;
if (input.type == IET_FIRST_PRESS) {
// detect codes
// Theme changing pad codes are marked as deprecated in _fallback's
// metrics.ini, remove them after SM5? -Kyz
if (CodeDetector::EnteredCode(input.GameI.controller,
CODE_NEXT_THEME) ||
CodeDetector::EnteredCode(input.GameI.controller,
CODE_NEXT_THEME2)) {
GameLoop::ChangeTheme(THEME->GetNextSelectableTheme());
bHandled = true;
}
if (CodeDetector::EnteredCode(input.GameI.controller,
CODE_NEXT_ANNOUNCER) ||
CodeDetector::EnteredCode(input.GameI.controller,
CODE_NEXT_ANNOUNCER2)) {
ANNOUNCER->NextAnnouncer();
RString sName = ANNOUNCER->GetCurAnnouncerName();
if (sName == "")
sName = "(none)";
SCREENMAN->SystemMessage(ANNOUNCER_.GetValue() + ": " + sName);
SCREENMAN->SetNewScreen(m_sName);
bHandled = true;
}
}

return ScreenSelectMaster::Input(input) || bHandled;
}
Expand Down
6 changes: 0 additions & 6 deletions src/StepMania.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1607,12 +1607,6 @@ HandleInputEvents(float fDeltaTime)
if (HandleGlobalInputs(input))
continue; // skip

// check back in event mode
if (GAMESTATE->IsEventMode() &&
CodeDetector::EnteredCode(input.GameI.controller,
CODE_BACK_IN_EVENT_MODE)) {
input.MenuI = GAME_BUTTON_BACK;
}

SCREENMAN->Input(input);
}
Expand Down

0 comments on commit 102ddad

Please sign in to comment.