Added metric for controlling whether TimingData returns numbers instead of strings.
This commit is contained in:
@@ -4552,3 +4552,6 @@ TimerOnCommand=visible,false
|
|||||||
|
|
||||||
[PaneDisplay]
|
[PaneDisplay]
|
||||||
NullCountString=""
|
NullCountString=""
|
||||||
|
|
||||||
|
[TimingData]
|
||||||
|
GetReturnsNumbers=false
|
||||||
|
|||||||
@@ -30,13 +30,13 @@ local function CreateSegments(Player)
|
|||||||
local firstBeatSecs = song:GetFirstSecond();
|
local firstBeatSecs = song:GetFirstSecond();
|
||||||
local lastBeatSecs = song:GetLastSecond();
|
local lastBeatSecs = song:GetLastSecond();
|
||||||
|
|
||||||
local bpms = timingData:GetBPMsAndTimes();
|
local bpms = timingData:GetBPMsAndTimesAsNumbers();
|
||||||
local stops = timingData:GetStops();
|
local stops = timingData:GetStopsAsNumbers();
|
||||||
local delays = timingData:GetDelays();
|
local delays = timingData:GetDelaysAsNumbers();
|
||||||
local warps = timingData:GetWarps();
|
local warps = timingData:GetWarpsAsNumbers();
|
||||||
local fakes = timingData:GetFakes();
|
local fakes = timingData:GetFakesAsNumbers();
|
||||||
local scrolls = timingData:GetScrolls();
|
local scrolls = timingData:GetScrollsAsNumbers();
|
||||||
local speeds = timingData:GetSpeeds();
|
local speeds = timingData:GetSpeedsAsNumbers();
|
||||||
|
|
||||||
-- we don't want too many segments to be shown.
|
-- we don't want too many segments to be shown.
|
||||||
local sumSegments = #bpms + #stops + #delays + #warps + #fakes + #scrolls + #speeds
|
local sumSegments = #bpms + #stops + #delays + #warps + #fakes + #scrolls + #speeds
|
||||||
|
|||||||
+28
-54
@@ -3,6 +3,7 @@
|
|||||||
#include "PrefsManager.h"
|
#include "PrefsManager.h"
|
||||||
#include "RageUtil.h"
|
#include "RageUtil.h"
|
||||||
#include "RageLog.h"
|
#include "RageLog.h"
|
||||||
|
#include "ThemeManager.h"
|
||||||
#include "NoteTypes.h"
|
#include "NoteTypes.h"
|
||||||
#include "Foreach.h"
|
#include "Foreach.h"
|
||||||
#include <float.h>
|
#include <float.h>
|
||||||
@@ -991,6 +992,8 @@ vector<RString> TimingData::ToVectorString(TimingSegmentType tst, int dec) const
|
|||||||
// lua start
|
// lua start
|
||||||
#include "LuaBinding.h"
|
#include "LuaBinding.h"
|
||||||
|
|
||||||
|
#define TIMING_DATA_RETURNS_NUMBERS THEME->GetMetricB("TimingData", "GetReturnsNumbers")
|
||||||
|
|
||||||
// This breaks encapsulation just as much as TimingData::ToVectorString does.
|
// This breaks encapsulation just as much as TimingData::ToVectorString does.
|
||||||
// But, it exists solely for the purpose of providing lua access, so it's as okay as all the other lua stuff that reaches past the encapsulation.
|
// But, it exists solely for the purpose of providing lua access, so it's as okay as all the other lua stuff that reaches past the encapsulation.
|
||||||
void TimingSegmentSetToLuaTable(TimingData* td, TimingSegmentType tst, lua_State *L);
|
void TimingSegmentSetToLuaTable(TimingData* td, TimingSegmentType tst, lua_State *L);
|
||||||
@@ -1039,51 +1042,32 @@ public:
|
|||||||
static int HasFakes( T* p, lua_State *L ) { lua_pushboolean(L, p->HasFakes()); return 1; }
|
static int HasFakes( T* p, lua_State *L ) { lua_pushboolean(L, p->HasFakes()); return 1; }
|
||||||
static int HasSpeedChanges( T* p, lua_State *L ) { lua_pushboolean(L, p->HasSpeedChanges()); return 1; }
|
static int HasSpeedChanges( T* p, lua_State *L ) { lua_pushboolean(L, p->HasSpeedChanges()); return 1; }
|
||||||
static int HasScrollChanges( T* p, lua_State *L ) { lua_pushboolean(L, p->HasScrollChanges()); return 1; }
|
static int HasScrollChanges( T* p, lua_State *L ) { lua_pushboolean(L, p->HasScrollChanges()); return 1; }
|
||||||
static int GetWarps( T* p, lua_State *L )
|
#define GET_FUNCTION(get_name, segment_name) \
|
||||||
{
|
static int get_name(T* p, lua_State* L) \
|
||||||
TimingSegmentSetToLuaTable(p, SEGMENT_WARP, L);
|
{ \
|
||||||
return 1;
|
if(TIMING_DATA_RETURNS_NUMBERS) \
|
||||||
}
|
{ \
|
||||||
static int GetFakes( T* p, lua_State *L )
|
TimingSegmentSetToLuaTable(p, segment_name, L); \
|
||||||
{
|
} \
|
||||||
TimingSegmentSetToLuaTable(p, SEGMENT_FAKE, L);
|
else \
|
||||||
return 1;
|
{ \
|
||||||
}
|
LuaHelpers::CreateTableFromArray(p->ToVectorString(segment_name), L); \
|
||||||
static int GetScrolls( T* p, lua_State *L )
|
} \
|
||||||
{
|
return 1; \
|
||||||
TimingSegmentSetToLuaTable(p, SEGMENT_SCROLL, L);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
static int GetSpeeds( T* p, lua_State *L )
|
|
||||||
{
|
|
||||||
TimingSegmentSetToLuaTable(p, SEGMENT_SPEED, L);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
static int GetTimeSignatures( T* p, lua_State *L )
|
|
||||||
{
|
|
||||||
TimingSegmentSetToLuaTable(p, SEGMENT_TIME_SIG, L);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
static int GetCombos( T* p, lua_State *L )
|
|
||||||
{
|
|
||||||
TimingSegmentSetToLuaTable(p, SEGMENT_COMBO, L);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
static int GetTickcounts( T* p, lua_State *L )
|
|
||||||
{
|
|
||||||
TimingSegmentSetToLuaTable(p, SEGMENT_TICKCOUNT, L);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
static int GetStops( T* p, lua_State *L )
|
|
||||||
{
|
|
||||||
TimingSegmentSetToLuaTable(p, SEGMENT_STOP, L);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
static int GetDelays( T* p, lua_State *L )
|
|
||||||
{
|
|
||||||
TimingSegmentSetToLuaTable(p, SEGMENT_DELAY, L);
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GET_FUNCTION(GetWarps, SEGMENT_WARP);
|
||||||
|
GET_FUNCTION(GetFakes, SEGMENT_FAKE);
|
||||||
|
GET_FUNCTION(GetScrolls, SEGMENT_SCROLL);
|
||||||
|
GET_FUNCTION(GetSpeeds, SEGMENT_SPEED);
|
||||||
|
GET_FUNCTION(GetTimeSignatures, SEGMENT_TIME_SIG);
|
||||||
|
GET_FUNCTION(GetCombos, SEGMENT_COMBO);
|
||||||
|
GET_FUNCTION(GetTickcounts, SEGMENT_TICKCOUNT);
|
||||||
|
GET_FUNCTION(GetStops, SEGMENT_STOP);
|
||||||
|
GET_FUNCTION(GetDelays, SEGMENT_DELAY);
|
||||||
|
GET_FUNCTION(GetLabels, SEGMENT_LABEL);
|
||||||
|
GET_FUNCTION(GetBPMsAndTimes, SEGMENT_BPM);
|
||||||
|
#undef GET_FUNCTION
|
||||||
static int GetBPMs( T* p, lua_State *L )
|
static int GetBPMs( T* p, lua_State *L )
|
||||||
{
|
{
|
||||||
vector<float> vBPMs;
|
vector<float> vBPMs;
|
||||||
@@ -1095,16 +1079,6 @@ public:
|
|||||||
LuaHelpers::CreateTableFromArray(vBPMs, L);
|
LuaHelpers::CreateTableFromArray(vBPMs, L);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
static int GetLabels( T* p, lua_State *L )
|
|
||||||
{
|
|
||||||
TimingSegmentSetToLuaTable(p, SEGMENT_LABEL, L);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
static int GetBPMsAndTimes( T* p, lua_State *L )
|
|
||||||
{
|
|
||||||
TimingSegmentSetToLuaTable(p, SEGMENT_BPM, L);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
static int GetActualBPM( T* p, lua_State *L )
|
static int GetActualBPM( T* p, lua_State *L )
|
||||||
{
|
{
|
||||||
// certainly there's a better way to do it than this? -aj
|
// certainly there's a better way to do it than this? -aj
|
||||||
|
|||||||
Reference in New Issue
Block a user