diff --git a/res/modules/internal/math.lua b/res/modules/internal/math.lua deleted file mode 100644 index 6637a5cc..00000000 --- a/res/modules/internal/math.lua +++ /dev/null @@ -1,11 +0,0 @@ -function math.Rand( low, high ) - return low + (high - low) * math.random() -end - -function math.Clamp( _in, low, high ) - return math.min(math.max( _in, low ), high) -end - -function math.Lerp(frac, from, to) - return from + (to - from) * frac -end \ No newline at end of file diff --git a/res/modules/internal/string.lua b/res/modules/internal/string.lua deleted file mode 100644 index 944ce0a0..00000000 --- a/res/modules/internal/string.lua +++ /dev/null @@ -1,65 +0,0 @@ -function string.FormattedTime(seconds, format ) -- from gmod - if not seconds then seconds = 0 end - - local hours = math.floor(seconds / 3600) - local minutes = math.floor((seconds / 60) % 60) - local millisecs = (seconds - math.floor(seconds)) * 100 - seconds = math.floor(seconds % 60) - - if format then - return string.format(format, minutes, seconds, millisecs) - else - return {h = hours, m = minutes, s = seconds, ms = millisecs} - end -end - -function string.Left(str, num) return string.sub(str, 1, num) end -function string.Right(str, num) return string.sub(str, -num) end - -function string.Replace(str, tofind, toreplace) - local tbl = string.Explode(tofind, str) - if (tbl[1]) then return table.concat(tbl, toreplace) end - return str -end - -local totable = string.ToTable -local string_sub = string.sub -local string_find = string.find -local string_len = string.len -function string.Explode(separator, str, withpattern) - if (separator == "") then return totable(str) end - if (withpattern == nil) then withpattern = false end - - local ret = {} - local current_pos = 1 - - for i = 1, string_len(str) do - local start_pos, end_pos = string_find(str, separator, current_pos, not withpattern) - if (not start_pos) then break end - ret[i] = string_sub(str, current_pos, start_pos - 1) - current_pos = end_pos + 1 - end - - ret[#ret + 1] = string_sub(str, current_pos) - - return ret -end - -function string.Split( str, delimiter ) - return string.Explode( delimiter, str ) -end - -function string.Trim(s, char) - if char then char = string.PatternSafe(char) else char = "%s" end - return string.match(s, "^" .. char .. "*(.-)" .. char .. "*$") or s -end - -function string.TrimRight(s, char) - if char then char = string.PatternSafe(char) else char = "%s" end - return string.match(s, "^(.-)" .. char .. "*$") or s -end - -function string.TrimLeft(s, char) - if char then char = string.PatternSafe(char) else char = "%s" end - return string.match(s, "^" .. char .. "*(.+)$") or s -end \ No newline at end of file diff --git a/res/modules/internal/table.lua b/res/modules/internal/table.lua deleted file mode 100644 index 3dc0ee39..00000000 --- a/res/modules/internal/table.lua +++ /dev/null @@ -1,17 +0,0 @@ -function table.Copy(t) - local newT = {} - for k, v in pairs(t) do - newT[k] = v - end - return newT -end - -function table.Random(t) - local randomT = {} - for k, v in pairs(t) do randomT[#randomT + 1] = {k, v} end - - local var = randomT[math.random(1, #randomT)] - local key, value = var[1], var[2] - - return value, key -end \ No newline at end of file