remove unfinished datetime; moved working functions to Utilities. small edits to customspeedmods
This commit is contained in:
@@ -182,6 +182,18 @@ function StepsOrTrailToCustomDifficulty(stepsOrTrail)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Date = {
|
||||||
|
Today = function()
|
||||||
|
return string.format("%i%02i%02i", Year(), (MonthOfYear()+1), DayOfMonth())
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
Time = {
|
||||||
|
Now = function()
|
||||||
|
return string.format( "%02i:%02i:%02i", Hour(), Minute(), Second() )
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
-- (c) 2005 Glenn Maynard, Chris Danford
|
-- (c) 2005 Glenn Maynard, Chris Danford
|
||||||
-- All rights reserved.
|
-- All rights reserved.
|
||||||
--
|
--
|
||||||
|
|||||||
@@ -19,9 +19,10 @@ This rewrite comes with the following changes/features:
|
|||||||
* Data/SpeedMods.txt is the fallback.
|
* Data/SpeedMods.txt is the fallback.
|
||||||
Previously, all speed mods were stored in {SM4 folder}/Data/SpeedMods.txt.
|
Previously, all speed mods were stored in {SM4 folder}/Data/SpeedMods.txt.
|
||||||
For compatibility reasons, this file is still read by the script.
|
For compatibility reasons, this file is still read by the script.
|
||||||
|
It should be noted that this file may be the cause of problems in modern
|
||||||
|
Windows versions (Vista, 7).
|
||||||
|
|
||||||
This version of Custom Speed Mods will only run on sm-ssc for the time being,
|
This version of Custom Speed Mods will only run on StepMania 5 (due to m-mods).
|
||||||
DO NOT use it in themes for StepMania 4 alpha versions.
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
v1.4
|
v1.4
|
||||||
* Try to auto-set the speed mod to 1.0 if:
|
* Try to auto-set the speed mod to 1.0 if:
|
||||||
@@ -113,16 +114,6 @@ local function MergeTables(parent,child)
|
|||||||
|
|
||||||
local addMe = true
|
local addMe = true
|
||||||
for iC=1,#child do
|
for iC=1,#child do
|
||||||
--[[
|
|
||||||
for iP=1,#parent do
|
|
||||||
if addMe then
|
|
||||||
-- check if that's the case.
|
|
||||||
-- why am I doing this anyways?
|
|
||||||
-- by the time these tables are passed in,
|
|
||||||
-- dupes should be gone.
|
|
||||||
end
|
|
||||||
end
|
|
||||||
]]
|
|
||||||
if addMe then
|
if addMe then
|
||||||
table.insert(parent,child[iC])
|
table.insert(parent,child[iC])
|
||||||
end
|
end
|
||||||
@@ -170,11 +161,9 @@ local function SpeedModSort(tab)
|
|||||||
table.insert(typ,tonumber(val))
|
table.insert(typ,tonumber(val))
|
||||||
end
|
end
|
||||||
|
|
||||||
-- sort xMods
|
-- sort Mods
|
||||||
xMods = AnonSort(xMods)
|
xMods = AnonSort(xMods)
|
||||||
-- sort cMods
|
|
||||||
cMods = AnonSort(cMods)
|
cMods = AnonSort(cMods)
|
||||||
-- sort mMods
|
|
||||||
mMods = AnonSort(mMods)
|
mMods = AnonSort(mMods)
|
||||||
local fin = {}
|
local fin = {}
|
||||||
-- convert it back to a string since that's what it expects
|
-- convert it back to a string since that's what it expects
|
||||||
@@ -196,7 +185,7 @@ local function GetSpeedMods()
|
|||||||
|
|
||||||
local baseFilename = "SpeedMods.txt"
|
local baseFilename = "SpeedMods.txt"
|
||||||
local profileDirs = {
|
local profileDirs = {
|
||||||
Fallback = "Data/",
|
Fallback = "Data/", -- xxx: this seems to cause problems on windows vista/7
|
||||||
Machine = ProfileDir('ProfileSlot_Machine'),
|
Machine = ProfileDir('ProfileSlot_Machine'),
|
||||||
PlayerNumber_P1 = ProfileDir('ProfileSlot_Player1'),
|
PlayerNumber_P1 = ProfileDir('ProfileSlot_Player1'),
|
||||||
PlayerNumber_P2 = ProfileDir('ProfileSlot_Player2')
|
PlayerNumber_P2 = ProfileDir('ProfileSlot_Player2')
|
||||||
@@ -221,7 +210,6 @@ local function GetSpeedMods()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- with all loaded... the merging BEGINS!!
|
|
||||||
finalMods = fallbackMods
|
finalMods = fallbackMods
|
||||||
-- mine for duplicates, first pass (fallback <-> machine)
|
-- mine for duplicates, first pass (fallback <-> machine)
|
||||||
machineMods = MarkDupes(machineMods,finalMods)
|
machineMods = MarkDupes(machineMods,finalMods)
|
||||||
@@ -256,7 +244,6 @@ local function GetSpeedMods()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function SpeedMods()
|
function SpeedMods()
|
||||||
-- here we see the option menu itself.
|
|
||||||
local t = {
|
local t = {
|
||||||
Name = "Speed",
|
Name = "Speed",
|
||||||
LayoutType = "ShowAllInRow",
|
LayoutType = "ShowAllInRow",
|
||||||
|
|||||||
@@ -1,70 +0,0 @@
|
|||||||
-- freem, inc. DateTime for StepMania
|
|
||||||
-- todo: accept format parameters for things
|
|
||||||
|
|
||||||
-- reference: http://us.php.net/manual/en/function.date.php
|
|
||||||
local dateChars = {
|
|
||||||
--[[ day ]]
|
|
||||||
'd', -- Day of the month, 2 digits with leading zeros (01-31)
|
|
||||||
'D', -- A textual representation of a day, three letters ("Mon"-"Sun")
|
|
||||||
'j', -- Day of the month without leading zeros (1-31)
|
|
||||||
'l', -- A full textual representation of the day of the week
|
|
||||||
'N', -- ISO-8601 numeric representation of the day of the week (1=Mon,7=Sun)
|
|
||||||
'S', -- English ordinal suffix for the day of the month, 2 characters
|
|
||||||
'w', -- Numeric representation of the day of the week (0=Sun,6=Sat)
|
|
||||||
'z', -- The day of the year (0-365)
|
|
||||||
--[[ week ]]
|
|
||||||
'W', -- ISO-8601 week number of year, weeks starting on Monday
|
|
||||||
--[[ month ]]
|
|
||||||
'F', -- A full textual representation of a month, such as January or March
|
|
||||||
'm', -- Numeric representation of a month, with leading zeros
|
|
||||||
'M', -- A short textual representation of a month, three letters
|
|
||||||
'n', -- Numeric representation of a month, without leading zeros
|
|
||||||
't', -- Number of days in the given month
|
|
||||||
--[[ year ]]
|
|
||||||
'L', -- Whether it's a leap year (1 or 0)
|
|
||||||
'o', -- (sux) ISO-8601 year number
|
|
||||||
'Y', -- A full numeric representation of a year, 4 digits
|
|
||||||
'y', -- (sux) A two digit representation of a year
|
|
||||||
--[[ time ]]
|
|
||||||
'a', -- Lowercase Ante meridiem and Post meridiem
|
|
||||||
'A', -- Uppercase Ante meridiem and Post meridiem
|
|
||||||
'B', -- Swatch Beats
|
|
||||||
'g', -- 12-hour format of an hour without leading zeros
|
|
||||||
'G', -- 24-hour format of an hour without leading zeros
|
|
||||||
'h', -- 12-hour format of an hour with leading zeros
|
|
||||||
'H', -- 24-hour format of an hour with leading zeros
|
|
||||||
'i', -- Minutes with leading zeros
|
|
||||||
's', -- Seconds, with leading zeros
|
|
||||||
'u', -- Microseconds
|
|
||||||
--[[ timezone ]]
|
|
||||||
'e', -- Timezone identifier
|
|
||||||
'I', -- Whether or not the date is in daylight saving time
|
|
||||||
'O', -- Difference to Greenwich time (GMT) in hours
|
|
||||||
'P', -- Difference to Greenwich time (GMT) with colon between hours and minutes
|
|
||||||
'T', -- Timezone abbreviation
|
|
||||||
'Z', -- Timezone offset in seconds.
|
|
||||||
--[[ full datetime ]]
|
|
||||||
'c', -- ISO 8601 date
|
|
||||||
'r', -- RFC 2822 formatted date
|
|
||||||
'U' -- Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)
|
|
||||||
}
|
|
||||||
|
|
||||||
function date(format,...)
|
|
||||||
if ... then
|
|
||||||
-- convert value
|
|
||||||
else
|
|
||||||
-- convert current time
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
Date = {
|
|
||||||
Today = function()
|
|
||||||
return string.format("%i%02i%02i", Year(), (MonthOfYear()+1), DayOfMonth())
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
Time = {
|
|
||||||
Now = function()
|
|
||||||
return string.format( "%02i:%02i:%02i", Hour(), Minute(), Second() )
|
|
||||||
end
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user