From 474d151041beca7e93a26c8cdf30d8a014687c31 Mon Sep 17 00:00:00 2001 From: Kyzentun Date: Tue, 2 Dec 2014 11:48:43 -0700 Subject: [PATCH] Changed TimingData GetReturnsNumbers metric to optional boolean arg to the functions. --- Docs/Luadoc/LuaDocumentation.xml | 6 +++--- Themes/_fallback/metrics.ini | 3 --- src/TimingData.cpp | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Docs/Luadoc/LuaDocumentation.xml b/Docs/Luadoc/LuaDocumentation.xml index 2308132dd1..24a1dacae9 100644 --- a/Docs/Luadoc/LuaDocumentation.xml +++ b/Docs/Luadoc/LuaDocumentation.xml @@ -4830,8 +4830,8 @@ save yourself some time, copy this for undocumented things: GetBPMsAndTimes, GetStops, GetDelays, GetLabels, GetWarps, GetCombos, GetTimeSignatures, GetTickcounts, GetFakes, GetScrolls, and GetSpeeds all have two different modes.
- If the metric TimingData:GetReturnsNumbers is false (the default), they return tables of strings. The strings are numbers separated by '='.
- If the metric TimingData:GetReturnsNumbers is true, they return tables of tables, and the inner tables contain numbers as described for each function.
+ If false (or nothing) is the argument to these functions, they return tables of strings. The strings are numbers separated by '='.
+ If the argument is true, they return tables of tables, and the inner tables contain numbers as described for each function.
The first form is kept around and is the default for compatibility with older themes. The advantage of the second form is that you no longer need to have a bit of code in your theme to transform the string into a table of numbers before you can use it.
Example:
local bpmsand= timing_data:GetBPMsAndTimes()
@@ -4841,7 +4841,7 @@ save yourself some time, copy this for undocumented things: end
-- do something that looks at all the bpms and times.
Becomes:
- local bpmsand= timing_data:GetBPMsAndTimes()
+ local bpmsand= timing_data:GetBPMsAndTimes(true)
-- do something that looks at all the bpms and times.
diff --git a/Themes/_fallback/metrics.ini b/Themes/_fallback/metrics.ini index d4b36914c0..f7e32424ab 100644 --- a/Themes/_fallback/metrics.ini +++ b/Themes/_fallback/metrics.ini @@ -4714,9 +4714,6 @@ TimerOnCommand=visible,false [PaneDisplay] NullCountString="" -[TimingData] -GetReturnsNumbers=false - # Apparently these are still used. Let it be known that they're severely deprecated. [DancingCharacters] 2DCharacterXP1=SCREEN_WIDTH*0.25 diff --git a/src/TimingData.cpp b/src/TimingData.cpp index 17b00f30a3..9ffc1de876 100644 --- a/src/TimingData.cpp +++ b/src/TimingData.cpp @@ -1045,7 +1045,7 @@ public: #define GET_FUNCTION(get_name, segment_name) \ static int get_name(T* p, lua_State* L) \ { \ - if(TIMING_DATA_RETURNS_NUMBERS) \ + if(lua_toboolean(L, 1)) \ { \ TimingSegmentSetToLuaTable(p, segment_name, L); \ } \