2011-03-17 01:47:30 -04:00
|
|
|
#include "global.h"
|
|
|
|
|
#include "GameConstantsAndTypes.h"
|
|
|
|
|
#include "GameState.h"
|
|
|
|
|
#include "RageUtil.h"
|
|
|
|
|
#include "ThemeMetric.h"
|
|
|
|
|
#include "EnumHelper.h"
|
2019-06-22 12:35:38 -07:00
|
|
|
|
2011-03-17 01:47:30 -04:00
|
|
|
#include "LuaManager.h"
|
|
|
|
|
#include "GameManager.h"
|
|
|
|
|
#include "LocalizedString.h"
|
|
|
|
|
#include "PlayerNumber.h"
|
2023-04-19 14:22:59 +02:00
|
|
|
|
|
|
|
|
#include <cfloat>
|
|
|
|
|
#include <cmath>
|
2023-04-20 19:02:13 +02:00
|
|
|
#include <vector>
|
|
|
|
|
|
2011-03-17 01:47:30 -04:00
|
|
|
|
2022-07-10 18:28:56 +03:00
|
|
|
static std::vector<RString> GenerateRankingToFillInMarker()
|
2011-03-17 01:47:30 -04:00
|
|
|
{
|
2022-07-10 18:28:56 +03:00
|
|
|
std::vector<RString> vRankings;
|
2011-03-17 01:47:30 -04:00
|
|
|
FOREACH_ENUM( PlayerNumber, pn )
|
|
|
|
|
vRankings.push_back( ssprintf("#P%d#", pn+1) );
|
|
|
|
|
return vRankings;
|
|
|
|
|
}
|
2022-07-10 18:28:56 +03:00
|
|
|
extern const std::vector<RString> RANKING_TO_FILL_IN_MARKER( GenerateRankingToFillInMarker() );
|
2011-03-17 01:47:30 -04:00
|
|
|
|
|
|
|
|
extern const RString GROUP_ALL = "---Group All---";
|
|
|
|
|
|
|
|
|
|
static const char *RadarCategoryNames[] = {
|
|
|
|
|
"Stream",
|
|
|
|
|
"Voltage",
|
|
|
|
|
"Air",
|
|
|
|
|
"Freeze",
|
|
|
|
|
"Chaos",
|
2015-04-06 18:45:23 -06:00
|
|
|
"Notes",
|
2011-03-17 01:47:30 -04:00
|
|
|
"TapsAndHolds",
|
|
|
|
|
"Jumps",
|
|
|
|
|
"Holds",
|
|
|
|
|
"Mines",
|
|
|
|
|
"Hands",
|
|
|
|
|
"Rolls",
|
|
|
|
|
"Lifts",
|
|
|
|
|
"Fakes",
|
|
|
|
|
};
|
|
|
|
|
XToString( RadarCategory );
|
|
|
|
|
XToLocalizedString( RadarCategory );
|
|
|
|
|
LuaFunction( RadarCategoryToLocalizedString, RadarCategoryToLocalizedString(Enum::Check<RadarCategory>(L, 1)) );
|
|
|
|
|
LuaXType( RadarCategory );
|
|
|
|
|
|
|
|
|
|
RString StepsTypeToString( StepsType st )
|
|
|
|
|
{
|
|
|
|
|
RString s = GAMEMAN->GetStepsTypeInfo( st ).szName; // "dance-single"
|
|
|
|
|
/* foo-bar -> Foo_Bar */
|
2025-06-22 23:03:14 -07:00
|
|
|
s.Replace('-','_');
|
2011-03-17 01:47:30 -04:00
|
|
|
|
|
|
|
|
bool bCapitalizeNextLetter = true;
|
|
|
|
|
for( int i=0; i<(int)s.length(); i++ )
|
|
|
|
|
{
|
|
|
|
|
if( bCapitalizeNextLetter )
|
|
|
|
|
{
|
|
|
|
|
s[i] = toupper(s[i]);
|
|
|
|
|
bCapitalizeNextLetter = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( s[i] == '_' )
|
|
|
|
|
bCapitalizeNextLetter = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return s;
|
|
|
|
|
}
|
|
|
|
|
namespace StringConversion { template<> RString ToString<StepsType>( const StepsType &value ) { return StepsTypeToString(value); } }
|
|
|
|
|
|
|
|
|
|
LuaXType( StepsType );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static const char *PlayModeNames[] = {
|
|
|
|
|
"Regular",
|
|
|
|
|
"Nonstop",
|
|
|
|
|
"Oni",
|
|
|
|
|
"Endless",
|
|
|
|
|
"Battle",
|
|
|
|
|
"Rave",
|
|
|
|
|
};
|
|
|
|
|
XToString( PlayMode );
|
|
|
|
|
XToLocalizedString( PlayMode );
|
|
|
|
|
StringToX( PlayMode );
|
|
|
|
|
LuaFunction( PlayModeToLocalizedString, PlayModeToLocalizedString(Enum::Check<PlayMode>(L, 1)) );
|
|
|
|
|
LuaXType( PlayMode );
|
|
|
|
|
|
|
|
|
|
RankingCategory AverageMeterToRankingCategory( int iAverageMeter )
|
|
|
|
|
{
|
|
|
|
|
if( iAverageMeter <= 3 ) return RANKING_A;
|
|
|
|
|
else if( iAverageMeter <= 6 ) return RANKING_B;
|
|
|
|
|
else if( iAverageMeter <= 9 ) return RANKING_C;
|
|
|
|
|
else return RANKING_D;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static const char *RankingCategoryNames[] = {
|
|
|
|
|
"a",
|
|
|
|
|
"b",
|
|
|
|
|
"c",
|
|
|
|
|
"d",
|
|
|
|
|
};
|
|
|
|
|
XToString( RankingCategory );
|
|
|
|
|
StringToX( RankingCategory );
|
2013-10-04 07:43:41 -05:00
|
|
|
LuaXType( RankingCategory );
|
2011-03-17 01:47:30 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
static const char *PlayerControllerNames[] = {
|
|
|
|
|
"Human",
|
|
|
|
|
"Autoplay",
|
|
|
|
|
"Cpu",
|
|
|
|
|
//"Replay",
|
|
|
|
|
};
|
|
|
|
|
XToString( PlayerController );
|
|
|
|
|
StringToX( PlayerController );
|
|
|
|
|
XToLocalizedString( PlayerController );
|
|
|
|
|
LuaXType( PlayerController );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static const char *HealthStateNames[] = {
|
|
|
|
|
"Hot",
|
|
|
|
|
"Alive",
|
|
|
|
|
"Danger",
|
|
|
|
|
"Dead",
|
|
|
|
|
};
|
|
|
|
|
XToString( HealthState );
|
|
|
|
|
LuaXType( HealthState );
|
|
|
|
|
|
2012-03-28 18:55:06 -05:00
|
|
|
static const char *StageResultNames[] = {
|
|
|
|
|
"Win",
|
|
|
|
|
"Lose",
|
|
|
|
|
"Draw",
|
|
|
|
|
};
|
|
|
|
|
XToString( StageResult );
|
|
|
|
|
LuaXType( StageResult );
|
2011-03-17 01:47:30 -04:00
|
|
|
|
|
|
|
|
static const char *CoinModeNames[] = {
|
|
|
|
|
"Home",
|
2013-06-04 23:47:49 -04:00
|
|
|
"Pay",
|
2011-03-17 01:47:30 -04:00
|
|
|
"Free",
|
|
|
|
|
};
|
|
|
|
|
XToString( CoinMode );
|
|
|
|
|
StringToX( CoinMode );
|
|
|
|
|
LuaXType( CoinMode );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static const char *PremiumNames[] = {
|
|
|
|
|
"Off",
|
|
|
|
|
"DoubleFor1Credit",
|
|
|
|
|
"2PlayersFor1Credit",
|
|
|
|
|
};
|
|
|
|
|
XToString( Premium );
|
|
|
|
|
StringToX( Premium );
|
|
|
|
|
XToLocalizedString( Premium );
|
|
|
|
|
LuaXType( Premium );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static const char *SortOrderNames[] = {
|
|
|
|
|
"Preferred",
|
|
|
|
|
"Group",
|
|
|
|
|
"Title",
|
|
|
|
|
"BPM",
|
|
|
|
|
"Popularity",
|
2025-02-24 18:36:21 -05:00
|
|
|
"PopularityP1",
|
|
|
|
|
"PopularityP2",
|
2011-03-17 01:47:30 -04:00
|
|
|
"TopGrades",
|
2023-02-02 18:14:18 -05:00
|
|
|
"TopP1Grades",
|
|
|
|
|
"TopP2Grades",
|
2011-03-17 01:47:30 -04:00
|
|
|
"Artist",
|
|
|
|
|
"Genre",
|
2023-12-12 17:56:44 -05:00
|
|
|
"Meter",
|
2011-03-17 01:47:30 -04:00
|
|
|
"BeginnerMeter",
|
|
|
|
|
"EasyMeter",
|
|
|
|
|
"MediumMeter",
|
|
|
|
|
"HardMeter",
|
|
|
|
|
"ChallengeMeter",
|
|
|
|
|
"DoubleEasyMeter",
|
|
|
|
|
"DoubleMediumMeter",
|
|
|
|
|
"DoubleHardMeter",
|
|
|
|
|
"DoubleChallengeMeter",
|
|
|
|
|
"ModeMenu",
|
|
|
|
|
"AllCourses",
|
|
|
|
|
"Nonstop",
|
|
|
|
|
"Oni",
|
|
|
|
|
"Endless",
|
|
|
|
|
"Length",
|
|
|
|
|
"Roulette",
|
|
|
|
|
"Recent",
|
2025-02-24 18:36:21 -05:00
|
|
|
"RecentP1",
|
|
|
|
|
"RecentP2",
|
2011-03-17 01:47:30 -04:00
|
|
|
};
|
|
|
|
|
XToString( SortOrder );
|
|
|
|
|
StringToX( SortOrder );
|
|
|
|
|
LuaXType( SortOrder );
|
|
|
|
|
XToLocalizedString( SortOrder );
|
|
|
|
|
LuaFunction( SortOrderToLocalizedString, SortOrderToLocalizedString(Enum::Check<SortOrder>(L, 1)) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static const char *TapNoteScoreNames[] = {
|
|
|
|
|
"None",
|
|
|
|
|
"HitMine",
|
|
|
|
|
"AvoidMine",
|
|
|
|
|
"CheckpointMiss",
|
|
|
|
|
"Miss",
|
|
|
|
|
"W5",
|
|
|
|
|
"W4",
|
|
|
|
|
"W3",
|
|
|
|
|
"W2",
|
|
|
|
|
"W1",
|
|
|
|
|
"CheckpointHit",
|
|
|
|
|
};
|
2015-03-09 20:42:33 -06:00
|
|
|
struct tns_conversion_helper
|
|
|
|
|
{
|
|
|
|
|
std::map<RString, TapNoteScore> conversion_map;
|
|
|
|
|
tns_conversion_helper()
|
|
|
|
|
{
|
|
|
|
|
FOREACH_ENUM(TapNoteScore, tns)
|
|
|
|
|
{
|
|
|
|
|
conversion_map[TapNoteScoreNames[tns]]= tns;
|
|
|
|
|
}
|
|
|
|
|
// for backward compatibility
|
|
|
|
|
conversion_map["Boo"]= TNS_W5;
|
|
|
|
|
conversion_map["Good"]= TNS_W4;
|
|
|
|
|
conversion_map["Great"]= TNS_W3;
|
|
|
|
|
conversion_map["Perfect"]= TNS_W2;
|
|
|
|
|
conversion_map["Marvelous"]= TNS_W1;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
tns_conversion_helper tns_converter;
|
2011-03-17 01:47:30 -04:00
|
|
|
XToString( TapNoteScore );
|
|
|
|
|
LuaXType( TapNoteScore );
|
|
|
|
|
TapNoteScore StringToTapNoteScore( const RString &s )
|
|
|
|
|
{
|
2015-03-09 20:42:33 -06:00
|
|
|
std::map<RString, TapNoteScore>::iterator tns=
|
|
|
|
|
tns_converter.conversion_map.find(s);
|
|
|
|
|
if(tns != tns_converter.conversion_map.end())
|
|
|
|
|
{
|
|
|
|
|
return tns->second;
|
|
|
|
|
}
|
2011-03-17 01:47:30 -04:00
|
|
|
return TapNoteScore_Invalid;
|
|
|
|
|
}
|
2014-11-19 15:59:21 -07:00
|
|
|
// This is necessary because the StringToX macro wasn't used, and Preference
|
|
|
|
|
// relies on there being a StringConversion entry for enums used in prefs. -Kyz
|
|
|
|
|
namespace StringConversion
|
|
|
|
|
{
|
|
|
|
|
template<> bool FromString<TapNoteScore>(const RString& value, TapNoteScore& out)
|
|
|
|
|
{
|
|
|
|
|
out= StringToTapNoteScore(value);
|
|
|
|
|
return out != TapNoteScore_Invalid;
|
|
|
|
|
}
|
|
|
|
|
}
|
2011-03-17 01:47:30 -04:00
|
|
|
XToLocalizedString( TapNoteScore );
|
|
|
|
|
LuaFunction( TapNoteScoreToLocalizedString, TapNoteScoreToLocalizedString(Enum::Check<TapNoteScore>(L, 1)) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static const char *HoldNoteScoreNames[] = {
|
|
|
|
|
"None",
|
|
|
|
|
"LetGo",
|
|
|
|
|
"Held",
|
2014-03-16 11:36:40 -05:00
|
|
|
"MissedHold",
|
2011-03-17 01:47:30 -04:00
|
|
|
};
|
|
|
|
|
XToString( HoldNoteScore );
|
|
|
|
|
LuaXType( HoldNoteScore );
|
|
|
|
|
HoldNoteScore StringToHoldNoteScore( const RString &s )
|
|
|
|
|
{
|
|
|
|
|
// for backward compatibility
|
2014-03-16 11:36:40 -05:00
|
|
|
if ( s == "NG" ) return HNS_LetGo;
|
|
|
|
|
else if( s == "OK" ) return HNS_Held;
|
2011-03-17 01:47:30 -04:00
|
|
|
|
|
|
|
|
// new style
|
2014-03-16 11:36:40 -05:00
|
|
|
else if( s == "None" ) return HNS_None;
|
|
|
|
|
else if( s == "LetGo" ) return HNS_LetGo;
|
|
|
|
|
else if( s == "Held" ) return HNS_Held;
|
|
|
|
|
else if( s == "MissedHold" ) return HNS_Missed;
|
2011-03-17 01:47:30 -04:00
|
|
|
|
|
|
|
|
return HoldNoteScore_Invalid;
|
|
|
|
|
}
|
|
|
|
|
XToLocalizedString( HoldNoteScore );
|
|
|
|
|
|
|
|
|
|
static const char *TimingWindowNames[] = {
|
|
|
|
|
"W1",
|
|
|
|
|
"W2",
|
|
|
|
|
"W3",
|
|
|
|
|
"W4",
|
|
|
|
|
"W5",
|
|
|
|
|
"Mine",
|
|
|
|
|
"Attack",
|
|
|
|
|
"Hold",
|
|
|
|
|
"Roll",
|
2015-07-19 16:08:50 -04:00
|
|
|
"Checkpoint"
|
2011-03-17 01:47:30 -04:00
|
|
|
};
|
|
|
|
|
XToString( TimingWindow );
|
2021-12-10 00:27:21 -08:00
|
|
|
LuaXType( TimingWindow );
|
2021-12-21 23:44:37 -08:00
|
|
|
StringToX( TimingWindow );
|
2011-03-17 01:47:30 -04:00
|
|
|
|
|
|
|
|
static const char *ScoreEventNames[] = {
|
|
|
|
|
"CheckpointHit",
|
|
|
|
|
"W1",
|
|
|
|
|
"W2",
|
|
|
|
|
"W3",
|
|
|
|
|
"W4",
|
|
|
|
|
"W5",
|
|
|
|
|
"Miss",
|
|
|
|
|
"HitMine",
|
|
|
|
|
"CheckpointMiss",
|
|
|
|
|
"Held",
|
|
|
|
|
"LetGo",
|
2014-03-16 11:36:40 -05:00
|
|
|
"MissedHold",
|
2011-03-17 01:47:30 -04:00
|
|
|
};
|
|
|
|
|
XToString( ScoreEvent );
|
|
|
|
|
|
|
|
|
|
static const char *TapNoteScoreJudgeTypeNames[] = {
|
|
|
|
|
"MinimumScore",
|
|
|
|
|
"LastScore",
|
|
|
|
|
};
|
|
|
|
|
XToString( TapNoteScoreJudgeType );
|
|
|
|
|
LuaXType( TapNoteScoreJudgeType );
|
|
|
|
|
|
|
|
|
|
static const char *ProfileSlotNames[] = {
|
|
|
|
|
"Player1",
|
|
|
|
|
"Player2",
|
|
|
|
|
"Machine",
|
|
|
|
|
};
|
|
|
|
|
XToString( ProfileSlot );
|
|
|
|
|
LuaXType( ProfileSlot );
|
|
|
|
|
|
|
|
|
|
static const char *MemoryCardStateNames[] = {
|
|
|
|
|
"ready",
|
|
|
|
|
"checking",
|
|
|
|
|
"late",
|
|
|
|
|
"error",
|
|
|
|
|
"removed",
|
|
|
|
|
"none",
|
|
|
|
|
};
|
|
|
|
|
XToString( MemoryCardState );
|
|
|
|
|
LuaXType( MemoryCardState );
|
|
|
|
|
|
|
|
|
|
static const char *StageAwardNames[] = {
|
|
|
|
|
"FullComboW3",
|
|
|
|
|
"SingleDigitW3",
|
|
|
|
|
"OneW3",
|
|
|
|
|
"FullComboW2",
|
|
|
|
|
"SingleDigitW2",
|
|
|
|
|
"OneW2",
|
|
|
|
|
"FullComboW1",
|
|
|
|
|
"80PercentW3",
|
|
|
|
|
"90PercentW3",
|
|
|
|
|
"100PercentW3",
|
|
|
|
|
};
|
|
|
|
|
XToString( StageAward );
|
|
|
|
|
XToLocalizedString( StageAward );
|
|
|
|
|
StringToX( StageAward );
|
|
|
|
|
LuaFunction( StageAwardToLocalizedString, StageAwardToLocalizedString(Enum::Check<StageAward>(L, 1)) );
|
|
|
|
|
LuaXType( StageAward );
|
|
|
|
|
|
2023-04-19 14:22:59 +02:00
|
|
|
// Numbers are intentionally not at the front of these strings so that the
|
2011-03-17 01:47:30 -04:00
|
|
|
// strings can be used as XML entity names.
|
2023-04-19 14:22:59 +02:00
|
|
|
// Numbers are intentionally not at the back so that "1000" and "10000" don't
|
2011-03-17 01:47:30 -04:00
|
|
|
// conflict when searching for theme elements.
|
|
|
|
|
static const char *PeakComboAwardNames[] = {
|
|
|
|
|
"1000",
|
|
|
|
|
"2000",
|
|
|
|
|
"3000",
|
|
|
|
|
"4000",
|
|
|
|
|
"5000",
|
|
|
|
|
"6000",
|
|
|
|
|
"7000",
|
|
|
|
|
"8000",
|
|
|
|
|
"9000",
|
|
|
|
|
"10000",
|
|
|
|
|
};
|
|
|
|
|
XToString( PeakComboAward );
|
|
|
|
|
XToLocalizedString( PeakComboAward );
|
|
|
|
|
StringToX( PeakComboAward );
|
|
|
|
|
LuaFunction( PeakComboAwardToLocalizedString, PeakComboAwardToLocalizedString(Enum::Check<PeakComboAward>(L, 1)) );
|
|
|
|
|
LuaXType( PeakComboAward );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void DisplayBpms::Add( float f )
|
|
|
|
|
{
|
|
|
|
|
vfBpms.push_back( f );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
float DisplayBpms::GetMin() const
|
|
|
|
|
{
|
|
|
|
|
float fMin = FLT_MAX;
|
2019-06-22 12:35:38 -07:00
|
|
|
for (float const &f : vfBpms)
|
2011-03-17 01:47:30 -04:00
|
|
|
{
|
2019-06-22 12:35:38 -07:00
|
|
|
if( f != -1 )
|
2022-07-10 18:28:56 +03:00
|
|
|
fMin = std::min( fMin, f );
|
2011-03-17 01:47:30 -04:00
|
|
|
}
|
|
|
|
|
if( fMin == FLT_MAX )
|
|
|
|
|
return 0;
|
|
|
|
|
else
|
|
|
|
|
return fMin;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
float DisplayBpms::GetMax() const
|
2011-07-03 13:35:00 -04:00
|
|
|
{
|
|
|
|
|
return this->GetMaxWithin();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
float DisplayBpms::GetMaxWithin(float highest) const
|
2011-03-17 01:47:30 -04:00
|
|
|
{
|
|
|
|
|
float fMax = 0;
|
2019-06-22 12:35:38 -07:00
|
|
|
for (float const &f : vfBpms)
|
2011-03-17 01:47:30 -04:00
|
|
|
{
|
2019-06-22 12:35:38 -07:00
|
|
|
if( f != -1 )
|
2024-09-03 04:52:20 -07:00
|
|
|
fMax = std::clamp(std::max( fMax, f ), 0.0f, highest);
|
2011-03-17 01:47:30 -04:00
|
|
|
}
|
|
|
|
|
return fMax;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool DisplayBpms::BpmIsConstant() const
|
|
|
|
|
{
|
2023-04-19 14:22:59 +02:00
|
|
|
return std::abs( GetMin() - GetMax() ) < 0.001f;
|
2011-03-17 01:47:30 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool DisplayBpms::IsSecret() const
|
|
|
|
|
{
|
2019-06-22 12:35:38 -07:00
|
|
|
return std::any_of(vfBpms.begin(), vfBpms.end(), [](float const &f) { return f == -1; });
|
2011-03-17 01:47:30 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static const char *StyleTypeNames[] = {
|
|
|
|
|
"OnePlayerOneSide",
|
|
|
|
|
"TwoPlayersTwoSides",
|
|
|
|
|
"OnePlayerTwoSides",
|
|
|
|
|
"TwoPlayersSharedSides",
|
|
|
|
|
};
|
|
|
|
|
XToString( StyleType );
|
|
|
|
|
StringToX( StyleType );
|
|
|
|
|
LuaXType( StyleType );
|
|
|
|
|
|
|
|
|
|
static const char *GoalTypeNames[] = {
|
|
|
|
|
"Calories",
|
|
|
|
|
"Time",
|
|
|
|
|
"None",
|
|
|
|
|
};
|
|
|
|
|
XToString( GoalType );
|
|
|
|
|
StringToX( GoalType );
|
|
|
|
|
LuaXType( GoalType );
|
|
|
|
|
|
|
|
|
|
static const char *EditModeNames[] = {
|
|
|
|
|
"Practice",
|
|
|
|
|
"CourseMods",
|
|
|
|
|
"Home",
|
|
|
|
|
"Full"
|
|
|
|
|
};
|
|
|
|
|
XToString( EditMode );
|
|
|
|
|
StringToX( EditMode );
|
|
|
|
|
LuaXType( EditMode );
|
|
|
|
|
|
|
|
|
|
static const char *SampleMusicPreviewModeNames[] = {
|
|
|
|
|
"Normal",
|
|
|
|
|
"StartToPreview",
|
|
|
|
|
"ScreenMusic",
|
|
|
|
|
"LastSong"
|
|
|
|
|
};
|
|
|
|
|
XToString( SampleMusicPreviewMode );
|
|
|
|
|
StringToX( SampleMusicPreviewMode );
|
|
|
|
|
LuaXType( SampleMusicPreviewMode );
|
|
|
|
|
|
|
|
|
|
static const char *StageNames[] = {
|
|
|
|
|
"1st",
|
|
|
|
|
"2nd",
|
|
|
|
|
"3rd",
|
|
|
|
|
"4th",
|
|
|
|
|
"5th",
|
|
|
|
|
"6th",
|
|
|
|
|
"Next",
|
|
|
|
|
"Final",
|
|
|
|
|
"Extra1",
|
|
|
|
|
"Extra2",
|
|
|
|
|
"Nonstop",
|
|
|
|
|
"Oni",
|
|
|
|
|
"Endless",
|
|
|
|
|
"Event",
|
|
|
|
|
"Demo",
|
|
|
|
|
};
|
|
|
|
|
XToString( Stage );
|
|
|
|
|
LuaXType( Stage );
|
|
|
|
|
XToLocalizedString( Stage );
|
|
|
|
|
LuaFunction( StageToLocalizedString, StageToLocalizedString(Enum::Check<Stage>(L, 1)) );
|
|
|
|
|
|
|
|
|
|
static const char *EarnedExtraStageNames[] = {
|
|
|
|
|
"No",
|
|
|
|
|
"Extra1",
|
|
|
|
|
"Extra2",
|
|
|
|
|
};
|
|
|
|
|
XToString( EarnedExtraStage );
|
|
|
|
|
LuaXType( EarnedExtraStage );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static const char *MultiPlayerStatusNames[] = {
|
|
|
|
|
"Joined",
|
|
|
|
|
"NotJoined",
|
|
|
|
|
"Unplugged",
|
|
|
|
|
"MissingMultitap",
|
|
|
|
|
};
|
|
|
|
|
XToString( MultiPlayerStatus );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static const char *CourseTypeNames[] = {
|
|
|
|
|
"Nonstop",
|
|
|
|
|
"Oni",
|
|
|
|
|
"Endless",
|
|
|
|
|
"Survival",
|
|
|
|
|
};
|
|
|
|
|
XToString( CourseType );
|
|
|
|
|
XToLocalizedString( CourseType );
|
|
|
|
|
LuaXType( CourseType );
|
|
|
|
|
LuaFunction( CourseTypeToLocalizedString, CourseTypeToLocalizedString( Enum::Check<CourseType>( L, 1 ) ) );
|
|
|
|
|
|
2014-05-01 23:23:20 -06:00
|
|
|
static const char *FailTypeNames[] = {
|
|
|
|
|
"Immediate",
|
|
|
|
|
"ImmediateContinue",
|
|
|
|
|
"EndOfSong",
|
|
|
|
|
"Off",
|
|
|
|
|
};
|
|
|
|
|
XToString( FailType );
|
|
|
|
|
XToLocalizedString( FailType );
|
2014-09-15 00:04:41 -06:00
|
|
|
StringToX( FailType );
|
2014-05-01 23:23:20 -06:00
|
|
|
LuaXType( FailType );
|
2011-03-17 01:47:30 -04:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* (c) 2001-2004 Chris Danford
|
|
|
|
|
* All rights reserved.
|
2023-04-19 14:22:59 +02:00
|
|
|
*
|
2011-03-17 01:47:30 -04:00
|
|
|
* 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.
|
2023-04-19 14:22:59 +02:00
|
|
|
*
|
2011-03-17 01:47:30 -04:00
|
|
|
* 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.
|
|
|
|
|
*/
|