Added doc explaining what a theme needs to support heart rate calorie calculation.
This commit is contained in:
@@ -1202,6 +1202,7 @@
|
|||||||
<Function name='IsCodeUnlocked'/>
|
<Function name='IsCodeUnlocked'/>
|
||||||
<Function name='SetBirthYear'/>
|
<Function name='SetBirthYear'/>
|
||||||
<Function name='SetCharacter'/>
|
<Function name='SetCharacter'/>
|
||||||
|
<Function name='SetDisplayName'/>
|
||||||
<Function name='SetGoalCalories'/>
|
<Function name='SetGoalCalories'/>
|
||||||
<Function name='SetGoalSeconds'/>
|
<Function name='SetGoalSeconds'/>
|
||||||
<Function name='SetGoalType'/>
|
<Function name='SetGoalType'/>
|
||||||
|
|||||||
@@ -3441,6 +3441,9 @@ save yourself some time, copy this for undocumented things:
|
|||||||
<Function name='SetCharacter' return='void' arguments='string sCharID'>
|
<Function name='SetCharacter' return='void' arguments='string sCharID'>
|
||||||
Sets the current <Link class='Character' /> for the Profile.
|
Sets the current <Link class='Character' /> for the Profile.
|
||||||
</Function>
|
</Function>
|
||||||
|
<Function name='SetDisplayName' return='void' arguments='string name'>
|
||||||
|
Sets the display name of the profile to name.
|
||||||
|
</Function>
|
||||||
<Function name='SetGoalCalories' return='void' arguments='int iCals'>
|
<Function name='SetGoalCalories' return='void' arguments='int iCals'>
|
||||||
Sets the goal to <code>iCals</code> calories.
|
Sets the goal to <code>iCals</code> calories.
|
||||||
</Function>
|
</Function>
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
SM5 has two systems for calculating the number of calories burned during a song.
|
||||||
|
|
||||||
|
The first system simply uses the weight of the player and adds a small amount for every step. This does not require any specific support from the theme and is the default for new profiles.
|
||||||
|
|
||||||
|
|
||||||
|
The second system uses age, gender, weight, heart rate, and song duration to calculate the amount used during a song. This requires a theme to support it, and the relevant parts of Editable.ini to be set for the profile.
|
||||||
|
|
||||||
|
Editable.ini fields:
|
||||||
|
BirthYear, -- defaults to 1995
|
||||||
|
IgnoreStepCountCalories, -- Must be set to 1 to use the second system.
|
||||||
|
IsMale, -- Defaults to 1. Set to 0 for females.
|
||||||
|
Voomax, -- VO2max. Optional. Calorie calculation is more accurate if it is set, but it is not necessary. 0 means unset. http://www.shapesense.com/fitness-exercise/calculators/vo2max-calculator.aspx is a site for estimating V02max, and the source of the equations used.
|
||||||
|
WeightPounds -- Weight in pounds.
|
||||||
|
|
||||||
|
Lua API functions: (names only, details are in Docs/Luadoc/Lua.xml)
|
||||||
|
GetWeightPounds()
|
||||||
|
SetWeightPounds()
|
||||||
|
GetVoomax()
|
||||||
|
SetVoomax()
|
||||||
|
GetAge()
|
||||||
|
GetBirthYear()
|
||||||
|
SetBirthYear()
|
||||||
|
GetIgnoreStepCountCalories()
|
||||||
|
SetIgnoreStepCountCalories()
|
||||||
|
GetIsMale()
|
||||||
|
SetIsMale()
|
||||||
|
AddCaloriesToDailyTotal()
|
||||||
|
CalculateCaloriesFromHeartRate()
|
||||||
|
|
||||||
|
Intended usage:
|
||||||
|
A theme that supports heart rate calorie calculation should take the following steps:
|
||||||
|
1. Create a new screen that the player will be able to use to enter their heart rate. It shall be called "ScreenHeartEntry" in this list, though a theme can name it anything.
|
||||||
|
2. During ScreenGameplay, track the amount of time that the player is hitting steps for. This duration must be in seconds.
|
||||||
|
3. When proceeding from ScreenGameplay:
|
||||||
|
3a. Check whether GetIgnoreStepCountCalories returns true for either player's profile.
|
||||||
|
3b. If it returns true for either player, go to ScreenHeartEntry instead of ScreenEvaluationNormal.
|
||||||
|
3c. This means changing the NextScreen metric for ScreenGameplay to use a function that checks the profiles and returns the correct screen.
|
||||||
|
4. On ScreenHeartEntry:
|
||||||
|
4a. Provide a timer that the players can watch while measuring their pulse.
|
||||||
|
4b. Provide a way for the players to enter their heart rate in beats per minute.
|
||||||
|
4c. When a player enters their heart rate, use Profile:CalculateCaloriesFromHeartRate().
|
||||||
|
4d. Do not add calories to a profile if Profile:IgnoreStepCountCalories() returns false for that profile.
|
||||||
|
4e. Pass the heart rate and the duration from ScreenGameplay to Profile:CalculateCaloriesFromHeartRate() and store its return value.
|
||||||
|
4f. Pass the return value of Profile:CalculateCaloriesFromHeartRate() to Profile:AddCaloriesToDailyTotal() to add them to the total for that player's profile.
|
||||||
|
4g. When all active players have finished entering their heart rate, proceed to ScreenEvaluationNormal.
|
||||||
|
5. This concludes the special steps required for theme support of heart rate calorie calculation.
|
||||||
|
|
||||||
|
Side notes:
|
||||||
|
CalculateCaloriesFromHeartRate and AddCaloriesToDailyTotal are separate functions so that a theme can display or use the calorie amount in other ways easily.
|
||||||
|
If IgnoreStepCountCalories is true for a profile, but the theme in use does not provide support using the steps listed above, that profile will not accumulate calories.
|
||||||
@@ -2374,6 +2374,7 @@ public:
|
|||||||
{
|
{
|
||||||
ADD_METHOD( AddScreenshot );
|
ADD_METHOD( AddScreenshot );
|
||||||
ADD_METHOD( GetDisplayName );
|
ADD_METHOD( GetDisplayName );
|
||||||
|
ADD_METHOD( SetDisplayName );
|
||||||
ADD_METHOD( GetLastUsedHighScoreName );
|
ADD_METHOD( GetLastUsedHighScoreName );
|
||||||
ADD_METHOD( SetLastUsedHighScoreName );
|
ADD_METHOD( SetLastUsedHighScoreName );
|
||||||
ADD_METHOD( GetAllUsedHighScoreNames );
|
ADD_METHOD( GetAllUsedHighScoreNames );
|
||||||
|
|||||||
Reference in New Issue
Block a user