Sub full minute Skip amounts (1 Viewer)

ralphmason

New Member
November 17, 2008
1
0
Home Country
New Zealand New Zealand
Moved to the Sourceforge Patches section.

Hi,

I want to be able to skip amounts that are not full minutes, (in my case I want entries for 3:30 and 3:45 being the length of commercials).

It looks like the reason you can't do this is b/c the formatting for display isn't there.

Here is a possible update that allows this.

In g_player.cs replace GetSingleStep with

/// <summary>
/// This function returns the localized time units for "Step" (seconds) in human readable format.
/// </summary>
/// <param name="Step"></param>
/// <returns></returns>
public static string GetSingleStep(int Step) {

//Work with the abs value
char sign = Step >= 0 ? '+' : '-';
int abs = Math.Abs(Step);
int hours = abs / 3600;
int mins = abs % 3600 / 60;
int seconds = abs % 60;

if (hours > 0) {
string fmt = mins > 0 ? "{0}{2}{3}{4:00} {1}" : "{0}{2} {1}";
return string.Format(fmt, sign, GUILocalizeStrings.Get(2997)/* "hrs" */, hours, ':', mins);
}

if (mins > 0) {
string fmt = seconds > 0 ? "{0}{2}{3}{4:00} {1}" : "{0}{2} {1}";
return string.Format(fmt, sign, GUILocalizeStrings.Get(2998)/* "min"*/, mins, ':', seconds);
}

return string.Format("{0}{2} {1}", sign, GUILocalizeStrings.Get(2999)/*"sec"*/, seconds);

}


and in GuiSettingSkipSteps.cs needs lines 342-349 would need to be removed

//Remove.

else
{
// Check that whole minutes are entered
if (step > 60 && (step % 60) != 0)
{
return "Enter whole minutes only!";
}
}


Thanks
Ralph
 

Users who are viewing this thread

Top Bottom