Re-arrange some parameters and add math.round
Co-Authored-By: xLuigiGamerx <88401287+xLuigiGamerx@users.noreply.github.com>
This commit is contained in:
parent
69e129805e
commit
1f2e09da6e
@ -176,7 +176,7 @@ end
|
||||
--- Note: These functions don't exist in the Lua math library,
|
||||
--- and are useful enough to not have to redefine them in every mod
|
||||
|
||||
local __math_min, __math_max, __math_sqrt = math.min, math.max, math.sqrt
|
||||
local __math_min, __math_max, __math_sqrt, __math_floor, __math_ceil = math.min, math.max, math.sqrt, math.floor, math.ceil
|
||||
|
||||
--- @param x number
|
||||
--- @return number
|
||||
@ -216,38 +216,37 @@ function math.sign0(x)
|
||||
return x ~= 0 and (x > 0 and 1 or -1) or 0
|
||||
end
|
||||
|
||||
--- @param t number
|
||||
--- @param a number
|
||||
--- @param b number
|
||||
--- @param t number
|
||||
--- @return number
|
||||
--- Linearly interpolates `t` between `a` and `b`
|
||||
function math.lerp(t, a, b)
|
||||
--- Linearly interpolates between `a` and `b` using delta `t`
|
||||
function math.lerp(a, b, t)
|
||||
return a + (b - a) * t
|
||||
end
|
||||
|
||||
--- @param x number
|
||||
--- @param a number
|
||||
--- @param b number
|
||||
--- @param x number
|
||||
--- @return number
|
||||
--- Determines where `x` linearly lies between `a` and `b`. It's the inverse of `math.lerp`
|
||||
function math.invlerp(x, a, b)
|
||||
function math.invlerp(a, b, x)
|
||||
return (x - a) / (b - a)
|
||||
end
|
||||
|
||||
--- @param x number
|
||||
--- @param a number
|
||||
--- @param b number
|
||||
--- @param c number
|
||||
--- @param d number
|
||||
--- @param x number
|
||||
--- @return number
|
||||
--- Linearly remaps `x` from the source range `[a, b]` to the destination range `[c, d]`
|
||||
function math.remap(x, a, b, c, d)
|
||||
function math.remap(a, b, c, d, x)
|
||||
return c + (d - c) * ((x - a) / (b - a))
|
||||
end
|
||||
|
||||
-----------------
|
||||
-- legacy font --
|
||||
-----------------
|
||||
|
||||
--- @type integer
|
||||
FONT_TINY = -1
|
||||
--- @param x number
|
||||
--- Rounds `x` to the nearest integer value
|
||||
function math.round(x)
|
||||
return x > 0 and math.floor(x + 0.5) or math.ceil(x - 0.5)
|
||||
end
|
@ -1,3 +1,6 @@
|
||||
--- @type integer
|
||||
FONT_TINY = -1
|
||||
|
||||
--- @type integer
|
||||
ANIM_FLAG_FORWARD = (1 << 1)
|
||||
|
||||
@ -16,4 +19,4 @@ sqr = math.sqr
|
||||
sqrf = math.sqr
|
||||
clamp = math.clamp
|
||||
clampf = math.clamp
|
||||
hypotf = math.hypot
|
||||
hypotf = math.hypot
|
@ -178,7 +178,7 @@ end
|
||||
--- Note: These functions don't exist in the Lua math library,
|
||||
--- and are useful enough to not have to redefine them in every mod
|
||||
|
||||
local __math_min, __math_max, __math_sqrt = math.min, math.max, math.sqrt
|
||||
local __math_min, __math_max, __math_sqrt, __math_floor, __math_ceil = math.min, math.max, math.sqrt, math.floor, math.ceil
|
||||
|
||||
--- @param x number
|
||||
--- @return number
|
||||
@ -218,41 +218,40 @@ function math.sign0(x)
|
||||
return x ~= 0 and (x > 0 and 1 or -1) or 0
|
||||
end
|
||||
|
||||
--- @param t number
|
||||
--- @param a number
|
||||
--- @param b number
|
||||
--- @param t number
|
||||
--- @return number
|
||||
--- Linearly interpolates `t` between `a` and `b`
|
||||
function math.lerp(t, a, b)
|
||||
--- Linearly interpolates between `a` and `b` using delta `t`
|
||||
function math.lerp(a, b, t)
|
||||
return a + (b - a) * t
|
||||
end
|
||||
|
||||
--- @param x number
|
||||
--- @param a number
|
||||
--- @param b number
|
||||
--- @param x number
|
||||
--- @return number
|
||||
--- Determines where `x` linearly lies between `a` and `b`. It's the inverse of `math.lerp`
|
||||
function math.invlerp(x, a, b)
|
||||
function math.invlerp(a, b, x)
|
||||
return (x - a) / (b - a)
|
||||
end
|
||||
|
||||
--- @param x number
|
||||
--- @param a number
|
||||
--- @param b number
|
||||
--- @param c number
|
||||
--- @param d number
|
||||
--- @param x number
|
||||
--- @return number
|
||||
--- Linearly remaps `x` from the source range `[a, b]` to the destination range `[c, d]`
|
||||
function math.remap(x, a, b, c, d)
|
||||
function math.remap(a, b, c, d, x)
|
||||
return c + (d - c) * ((x - a) / (b - a))
|
||||
end
|
||||
|
||||
-----------------
|
||||
-- legacy font --
|
||||
-----------------
|
||||
|
||||
--- @type integer
|
||||
FONT_TINY = -1
|
||||
--- @param x number
|
||||
--- Rounds `x` to the nearest integer value
|
||||
function math.round(x)
|
||||
return x > 0 and math.floor(x + 0.5) or math.ceil(x - 0.5)
|
||||
end
|
||||
|
||||
|
||||
-------------------------
|
||||
|
@ -1,5 +1,5 @@
|
||||
-- localize functions to improve performance
|
||||
local mod_storage_load,string_format,table_insert,type,math_floor,math_ceil,level_is_vanilla_level,djui_hud_get_color,djui_hud_set_color,djui_hud_print_text,obj_get_first_with_behavior_id = mod_storage_load,string.format,table.insert,type,math.floor,math.ceil,level_is_vanilla_level,djui_hud_get_color,djui_hud_set_color,djui_hud_print_text,obj_get_first_with_behavior_id
|
||||
local mod_storage_load,string_format,table_insert,type,math_ceil,math_lerp,math_round,level_is_vanilla_level,djui_hud_get_color,djui_hud_set_color,djui_hud_print_text,obj_get_first_with_behavior_id = mod_storage_load,string.format,table.insert,type,math.ceil,math.lerp,math.round,level_is_vanilla_level,djui_hud_get_color,djui_hud_set_color,djui_hud_print_text,obj_get_first_with_behavior_id
|
||||
|
||||
--- @param key string
|
||||
--- `mod_storage_load_bool` except it returns true by default
|
||||
@ -47,27 +47,12 @@ function on_or_off(value)
|
||||
return "\\#ff0000\\OFF"
|
||||
end
|
||||
|
||||
--- @param x number
|
||||
--- @return integer
|
||||
--- Rounds up or down depending on the decimal position of `x`
|
||||
function math_round(x)
|
||||
return math_floor(x + 0.5)
|
||||
end
|
||||
|
||||
--- @param a number
|
||||
--- @param b number
|
||||
--- @param t number
|
||||
--- Linearly interpolates between two points using a delta
|
||||
function lerp(a, b, t)
|
||||
return a * (1 - t) + b * t
|
||||
end
|
||||
|
||||
--- @param a number
|
||||
--- @param b number
|
||||
--- @param t number
|
||||
--- Linearly interpolates between two points using a delta but ceils the final value
|
||||
function lerp_ceil(a, b, t)
|
||||
return math_ceil(lerp(a, b, t))
|
||||
return math_ceil(math_lerp(a, b, t))
|
||||
end
|
||||
|
||||
--- @param a number
|
||||
@ -75,7 +60,7 @@ end
|
||||
--- @param t number
|
||||
--- Linearly interpolates between two points using a delta but rounds the final value
|
||||
function lerp_round(a, b, t)
|
||||
return math_round(lerp(a, b, t))
|
||||
return math_round(math_lerp(a, b, t))
|
||||
end
|
||||
|
||||
--- @param a Color
|
||||
|
@ -1,5 +1,5 @@
|
||||
-- localize functions to improve performance
|
||||
local mod_storage_remove,mod_storage_load_bool,math_floor,mod_storage_save_number,mod_storage_load_number,type,error,string_format,smlua_audio_utils_replace_sequence,fade_volume_scale,set_background_music,obj_mark_for_deletion = mod_storage_remove,mod_storage_load_bool,math.floor,mod_storage_save_number,mod_storage_load_number,type,error,string.format,smlua_audio_utils_replace_sequence,fade_volume_scale,set_background_music,obj_mark_for_deletion
|
||||
local mod_storage_remove,mod_storage_load_bool,math_floor,mod_storage_save_number,print,mod_storage_load_number,type,error,string_format,smlua_audio_utils_replace_sequence,fade_volume_scale,set_background_music,obj_mark_for_deletion = mod_storage_remove,mod_storage_load_bool,math.floor,mod_storage_save_number,print,mod_storage_load_number,type,error,string.format,smlua_audio_utils_replace_sequence,fade_volume_scale,set_background_music,obj_mark_for_deletion
|
||||
|
||||
local sNightSequences = {}
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
-- description: Day Night Cycle DX v2.5.1\nBy \\#ec7731\\Agent X\n\n\\#dcdcdc\\This mod adds a fully featured day & night cycle system with night, sunrise, day and sunset to sm64coopdx. It includes an API and hook system for interfacing with several components of the mod externally. This mod was originally made for sm64ex-coop but has been practically rewritten for sm64coopdx.\n\nDays last 24 minutes and with the /time command, you can get/set the time or change your settings.\n\nThere is also now a new menu in the pause menu for Day Night Cycle DX!\n\nSpecial thanks to \\#e06de4\\MaiskX3\\#dcdcdc\\ for the night time music.\nSpecial thanks to \\#00ffff\\AngelicMiracles\\#dcdcdc\\ for the sunset, sunrise and night time skyboxes.\nSpecial thanks to \\#344ee1\\eros71\\#dcdcdc\\ for salvaging\nthe mod files.
|
||||
|
||||
-- localize functions to improve performance
|
||||
local network_is_server,mod_storage_load,tonumber,type,math_floor,error,table_insert,get_skybox,set_lighting_dir,set_lighting_color,set_vertex_color,set_fog_color,set_fog_intensity,network_check_singleplayer_pause,network_player_connected_count,obj_get_first_with_behavior_id,spawn_non_sync_object,obj_scale,clampf,set_lighting_color_ambient,le_set_ambient_color,djui_hud_set_resolution,djui_hud_set_font,hud_is_hidden,hud_get_value,djui_hud_get_screen_width,djui_hud_measure_text,djui_hud_get_screen_height,djui_hud_set_color,play_sound,djui_chat_message_create,string_format,mod_storage_save_number,mod_storage_save_bool,get_date_and_time = network_is_server,mod_storage_load,tonumber,type,math.floor,error,table.insert,get_skybox,set_lighting_dir,set_lighting_color,set_vertex_color,set_fog_color,set_fog_intensity,network_check_singleplayer_pause,network_player_connected_count,obj_get_first_with_behavior_id,spawn_non_sync_object,obj_scale,clampf,set_lighting_color_ambient,le_set_ambient_color,djui_hud_set_resolution,djui_hud_set_font,hud_is_hidden,hud_get_value,djui_hud_get_screen_width,djui_hud_measure_text,djui_hud_get_screen_height,djui_hud_set_color,play_sound,djui_chat_message_create,string.format,mod_storage_save_number,mod_storage_save_bool,get_date_and_time
|
||||
local network_is_server,mod_storage_load,tonumber,math_floor,type,error,table_insert,get_skybox,set_lighting_dir,set_lighting_color,set_vertex_color,set_fog_color,set_fog_intensity,network_check_singleplayer_pause,network_player_connected_count,obj_get_first_with_behavior_id,spawn_non_sync_object,obj_scale,math_lerp,set_lighting_color_ambient,le_set_ambient_color,djui_hud_set_resolution,djui_hud_set_font,hud_is_hidden,hud_get_value,djui_hud_get_screen_width,djui_hud_measure_text,djui_hud_get_screen_height,djui_hud_set_color,play_sound,djui_chat_message_create,string_format,mod_storage_save_number,mod_storage_save_bool,get_date_and_time = network_is_server,mod_storage_load,tonumber,math.floor,type,error,table.insert,get_skybox,set_lighting_dir,set_lighting_color,set_vertex_color,set_fog_color,set_fog_intensity,network_check_singleplayer_pause,network_player_connected_count,obj_get_first_with_behavior_id,spawn_non_sync_object,obj_scale,math.lerp,set_lighting_color_ambient,le_set_ambient_color,djui_hud_set_resolution,djui_hud_set_font,hud_is_hidden,hud_get_value,djui_hud_get_screen_width,djui_hud_measure_text,djui_hud_get_screen_height,djui_hud_set_color,play_sound,djui_chat_message_create,string.format,mod_storage_save_number,mod_storage_save_bool,get_date_and_time
|
||||
|
||||
local init = false
|
||||
local timeModifier = 0
|
||||
@ -110,7 +110,7 @@ local function update()
|
||||
-- spawn skyboxes
|
||||
local skybox = get_skybox()
|
||||
if skybox >= BACKGROUND_CUSTOM then skybox = BACKGROUND_OCEAN_SKY end
|
||||
if not _G.dayNightCycleApi.dddCeiling and in_vanilla_level(LEVEL_DDD) then skybox = BACKGROUND_OCEAN_SKY end
|
||||
if not dayNightCycleApi.dddCeiling and in_vanilla_level(LEVEL_DDD) then skybox = BACKGROUND_OCEAN_SKY end
|
||||
if obj_get_first_with_behavior_id(bhvDNCSkybox) == nil and skybox ~= -1 and obj_get_first_with_behavior_id(bhvDNCNoSkybox) == nil then
|
||||
if show_day_night_cycle() and not is_static_skybox(skybox) then
|
||||
-- spawn day, sunset and night skyboxes
|
||||
@ -176,9 +176,9 @@ local function update()
|
||||
local t = (minutes - HOUR_SUNRISE_START) / HOUR_SUNRISE_DURATION
|
||||
color = color_lerp(COLOR_NIGHT, COLOR_SUNRISE, t)
|
||||
ambientColor = color_lerp(COLOR_AMBIENT_NIGHT, COLOR_AMBIENT_SUNRISE, t)
|
||||
dir = lerp(DIR_DARK, DIR_BRIGHT, t)
|
||||
dir = math_lerp(DIR_DARK, DIR_BRIGHT, t)
|
||||
fogColor = color_lerp(FOG_COLOR_NIGHT, COLOR_SUNRISE, t)
|
||||
fogIntensity = lerp(FOG_INTENSITY_DENSE, FOG_INTENSITY_NORMAL, t)
|
||||
fogIntensity = math_lerp(FOG_INTENSITY_DENSE, FOG_INTENSITY_NORMAL, t)
|
||||
elseif minutes >= HOUR_SUNRISE_END and minutes <= HOUR_DAY_START then
|
||||
local t = (minutes - HOUR_SUNRISE_END) / HOUR_SUNRISE_DURATION
|
||||
color = color_lerp(COLOR_SUNRISE, COLOR_DAY, t)
|
||||
@ -190,7 +190,7 @@ local function update()
|
||||
local t = (minutes - HOUR_SUNSET_START) / HOUR_SUNSET_DURATION
|
||||
color = color_lerp(COLOR_DAY, COLOR_SUNSET, t)
|
||||
ambientColor = color_lerp(COLOR_AMBIENT_DAY, COLOR_AMBIENT_SUNSET, t)
|
||||
dir = lerp(DIR_BRIGHT, DIR_DARK, t)
|
||||
dir = math_lerp(DIR_BRIGHT, DIR_DARK, t)
|
||||
fogColor = color
|
||||
fogIntensity = FOG_INTENSITY_NORMAL
|
||||
elseif minutes >= HOUR_SUNSET_END and minutes <= HOUR_NIGHT_START then
|
||||
@ -199,7 +199,7 @@ local function update()
|
||||
ambientColor = color_lerp(COLOR_AMBIENT_SUNSET, COLOR_AMBIENT_NIGHT, t)
|
||||
dir = DIR_DARK
|
||||
fogColor = color_lerp(COLOR_SUNSET, FOG_COLOR_NIGHT, t)
|
||||
fogIntensity = lerp(FOG_INTENSITY_NORMAL, FOG_INTENSITY_DENSE, t)
|
||||
fogIntensity = math_lerp(FOG_INTENSITY_NORMAL, FOG_INTENSITY_DENSE, t)
|
||||
elseif minutes > HOUR_NIGHT_START or minutes < HOUR_SUNRISE_START then
|
||||
color = COLOR_NIGHT
|
||||
ambientColor = COLOR_AMBIENT_NIGHT
|
||||
@ -331,7 +331,7 @@ end
|
||||
|
||||
--- @param msg string
|
||||
local function on_set_command(msg)
|
||||
if _G.dayNightCycleApi.lockTime then
|
||||
if dayNightCycleApi.lockTime then
|
||||
play_sound(SOUND_MENU_CAMERA_BUZZ, gGlobalSoundSource)
|
||||
djui_chat_message_create("\\#ffa0a0\\[Day Night Cycle] The Day Night Cycle settings have been locked by another mod.")
|
||||
return
|
||||
@ -371,7 +371,7 @@ end
|
||||
|
||||
--- @param msg string
|
||||
local function on_add_command(msg)
|
||||
if _G.dayNightCycleApi.lockTime then
|
||||
if dayNightCycleApi.lockTime then
|
||||
play_sound(SOUND_MENU_CAMERA_BUZZ, gGlobalSoundSource)
|
||||
djui_chat_message_create("\\#ffa0a0\\[Day Night Cycle] The Day Night Cycle settings have been locked by another mod.")
|
||||
return
|
||||
@ -395,7 +395,7 @@ end
|
||||
|
||||
--- @param msg string
|
||||
local function on_scale_command(msg)
|
||||
if _G.dayNightCycleApi.lockTime then
|
||||
if dayNightCycleApi.lockTime then
|
||||
play_sound(SOUND_MENU_CAMERA_BUZZ, gGlobalSoundSource)
|
||||
djui_chat_message_create("\\#ffa0a0\\[Day Night Cycle] The Day Night Cycle settings have been locked by another mod.")
|
||||
return
|
||||
@ -428,7 +428,7 @@ local function on_24h_command()
|
||||
end
|
||||
|
||||
local function on_sync_command()
|
||||
if _G.dayNightCycleApi.lockTime then
|
||||
if dayNightCycleApi.lockTime then
|
||||
play_sound(SOUND_MENU_CAMERA_BUZZ, gGlobalSoundSource)
|
||||
djui_chat_message_create("\\#ffa0a0\\[Day Night Cycle] The Day Night Cycle settings have been locked by another mod.")
|
||||
return
|
||||
@ -444,13 +444,13 @@ local function on_sync_command()
|
||||
end
|
||||
|
||||
local function on_sync_sun_command()
|
||||
if _G.dayNightCycleApi.lockTime then
|
||||
if dayNightCycleApi.lockTime then
|
||||
play_sound(SOUND_MENU_CAMERA_BUZZ, gGlobalSoundSource)
|
||||
djui_chat_message_create("\\#ffa0a0\\[Day Night Cycle] The Day Night Cycle settings have been locked by another mod.")
|
||||
return
|
||||
end
|
||||
|
||||
if _G.dayNightCycleApi.lockSunHours then
|
||||
if dayNightCycleApi.lockSunHours then
|
||||
play_sound(SOUND_MENU_CAMERA_BUZZ, gGlobalSoundSource)
|
||||
djui_chat_message_create("\\#ffa0a0\\[Day Night Cycle] Changing sun hours has been locked by another mod.")
|
||||
return
|
||||
@ -473,7 +473,7 @@ local function on_sync_sun_command()
|
||||
end
|
||||
|
||||
local function on_music_command()
|
||||
if _G.dayNightCycleApi.lockTime then
|
||||
if dayNightCycleApi.lockTime then
|
||||
play_sound(SOUND_MENU_CAMERA_BUZZ, gGlobalSoundSource)
|
||||
djui_chat_message_create("\\#ffa0a0\\[Day Night Cycle] The Day Night Cycle settings have been locked by another mod.")
|
||||
return
|
||||
@ -487,7 +487,7 @@ local function on_music_command()
|
||||
end
|
||||
|
||||
local function on_display_time_command()
|
||||
if _G.dayNightCycleApi.lockTime then
|
||||
if dayNightCycleApi.lockTime then
|
||||
play_sound(SOUND_MENU_CAMERA_BUZZ, gGlobalSoundSource)
|
||||
djui_chat_message_create("\\#ffa0a0\\[Day Night Cycle] The Day Night Cycle settings have been locked by another mod.")
|
||||
return
|
||||
@ -560,9 +560,9 @@ local function on_sunrise_changed(_, _, newVal)
|
||||
|
||||
HOUR_DAY_START = HOUR_SUNRISE_END + HOUR_SUNRISE_DURATION
|
||||
|
||||
_G.dayNightCycleApi.constants.HOUR_SUNRISE_START = HOUR_SUNRISE_START
|
||||
_G.dayNightCycleApi.constants.HOUR_SUNRISE_END = HOUR_SUNRISE_END
|
||||
_G.dayNightCycleApi.constants.HOUR_DAY_START = HOUR_DAY_START
|
||||
dayNightCycleApi.constants.HOUR_SUNRISE_START = HOUR_SUNRISE_START
|
||||
dayNightCycleApi.constants.HOUR_SUNRISE_END = HOUR_SUNRISE_END
|
||||
dayNightCycleApi.constants.HOUR_DAY_START = HOUR_DAY_START
|
||||
|
||||
dnc_call_hook(DNC_HOOK_SUN_TIMES_CHANGED)
|
||||
end
|
||||
@ -574,9 +574,9 @@ local function on_sunset_changed(_, _, newVal)
|
||||
|
||||
HOUR_NIGHT_START = HOUR_SUNSET_END + HOUR_SUNSET_DURATION
|
||||
|
||||
_G.dayNightCycleApi.constants.HOUR_SUNSET_START = HOUR_SUNSET_START
|
||||
_G.dayNightCycleApi.constants.HOUR_SUNSET_END = HOUR_SUNSET_END
|
||||
_G.dayNightCycleApi.constants.HOUR_NIGHT_START = HOUR_NIGHT_START
|
||||
dayNightCycleApi.constants.HOUR_SUNSET_START = HOUR_SUNSET_START
|
||||
dayNightCycleApi.constants.HOUR_SUNSET_END = HOUR_SUNSET_END
|
||||
dayNightCycleApi.constants.HOUR_NIGHT_START = HOUR_NIGHT_START
|
||||
|
||||
dnc_call_hook(DNC_HOOK_SUN_TIMES_CHANGED)
|
||||
end
|
||||
@ -584,7 +584,7 @@ end
|
||||
|
||||
--- @param value boolean
|
||||
local function on_set_dnc_enabled(_, value)
|
||||
if _G.dayNightCycleApi.lockTime then
|
||||
if dayNightCycleApi.lockTime then
|
||||
play_sound(SOUND_MENU_CAMERA_BUZZ, gGlobalSoundSource)
|
||||
djui_chat_message_create("\\#ffa0a0\\[Day Night Cycle] The Day Night Cycle settings have been locked by another mod.")
|
||||
return
|
||||
@ -595,7 +595,7 @@ end
|
||||
|
||||
--- @param value integer
|
||||
local function on_set_time_scale(index, value)
|
||||
if _G.dayNightCycleApi.lockTime then
|
||||
if dayNightCycleApi.lockTime then
|
||||
play_sound(SOUND_MENU_CAMERA_BUZZ, gGlobalSoundSource)
|
||||
djui_chat_message_create("\\#ffa0a0\\[Day Night Cycle] The Day Night Cycle settings have been locked by another mod.")
|
||||
return
|
||||
@ -608,7 +608,7 @@ end
|
||||
|
||||
--- @param value string
|
||||
local function on_set_time_modifier(_, value)
|
||||
if _G.dayNightCycleApi.lockTime then
|
||||
if dayNightCycleApi.lockTime then
|
||||
play_sound(SOUND_MENU_CAMERA_BUZZ, gGlobalSoundSource)
|
||||
djui_chat_message_create("\\#ffa0a0\\[Day Night Cycle] The Day Night Cycle settings have been locked by another mod.")
|
||||
return
|
||||
@ -619,7 +619,7 @@ local function on_set_time_modifier(_, value)
|
||||
end
|
||||
|
||||
local function on_add_hour()
|
||||
if _G.dayNightCycleApi.lockTime then
|
||||
if dayNightCycleApi.lockTime then
|
||||
play_sound(SOUND_MENU_CAMERA_BUZZ, gGlobalSoundSource)
|
||||
djui_chat_message_create("\\#ffa0a0\\[Day Night Cycle] The Day Night Cycle settings have been locked by another mod.")
|
||||
return
|
||||
|
@ -1 +0,0 @@
|
||||
4ac5721683d0e0b6bbb561b58a71740845dceea9 build/eu/sm64.eu.z64
|
@ -1 +0,0 @@
|
||||
8a20a5c83d6ceb0f0506cfc9fa20d8f438cafe51 build/jp/sm64.jp.z64
|
@ -1 +0,0 @@
|
||||
3f319ae697533a255a1003d09202379d78d5a2e0 build/sh/sm64.sh.z64
|
@ -1 +0,0 @@
|
||||
9bef1128717f958171a4afac3ed78ee2bb4e86ce build/us/sm64.us.z64
|
@ -159,7 +159,7 @@ char gSmluaConstants[] = ""
|
||||
"--------------------\n"
|
||||
"--- Note: These functions don't exist in the Lua math library,\n"
|
||||
"--- and are useful enough to not have to redefine them in every mod\n"
|
||||
"local __math_min, __math_max, __math_sqrt = math.min, math.max, math.sqrt\n"
|
||||
"local __math_min, __math_max, __math_sqrt, __math_floor, __math_ceil = math.min, math.max, math.sqrt, math.floor, math.ceil\n"
|
||||
"--- @param x number\n"
|
||||
"--- @return number\n"
|
||||
"--- Computes the square of the number `x`\n"
|
||||
@ -193,35 +193,37 @@ char gSmluaConstants[] = ""
|
||||
"function math.sign0(x)\n"
|
||||
"return x ~= 0 and (x > 0 and 1 or -1) or 0\n"
|
||||
"end\n"
|
||||
"--- @param t number\n"
|
||||
"--- @param a number\n"
|
||||
"--- @param b number\n"
|
||||
"--- @param t number\n"
|
||||
"--- @return number\n"
|
||||
"--- Linearly interpolates `t` between `a` and `b`\n"
|
||||
"function math.lerp(t, a, b)\n"
|
||||
"--- Linearly interpolates between `a` and `b` using delta `t`\n"
|
||||
"function math.lerp(a, b, t)\n"
|
||||
"return a + (b - a) * t\n"
|
||||
"end\n"
|
||||
"--- @param x number\n"
|
||||
"--- @param a number\n"
|
||||
"--- @param b number\n"
|
||||
"--- @param x number\n"
|
||||
"--- @return number\n"
|
||||
"--- Determines where `x` linearly lies between `a` and `b`. It's the inverse of `math.lerp`\n"
|
||||
"function math.invlerp(x, a, b)\n"
|
||||
"function math.invlerp(a, b, x)\n"
|
||||
"return (x - a) / (b - a)\n"
|
||||
"end\n"
|
||||
"--- @param x number\n"
|
||||
"--- @param a number\n"
|
||||
"--- @param b number\n"
|
||||
"--- @param c number\n"
|
||||
"--- @param d number\n"
|
||||
"--- @param x number\n"
|
||||
"--- @return number\n"
|
||||
"--- Linearly remaps `x` from the source range `[a, b]` to the destination range `[c, d]`\n"
|
||||
"function math.remap(x, a, b, c, d)\n"
|
||||
"function math.remap(a, b, c, d, x)\n"
|
||||
"return c + (d - c) * ((x - a) / (b - a))\n"
|
||||
"end\n"
|
||||
"-----------------\n"
|
||||
"-- legacy font --\n"
|
||||
"-----------------\n"
|
||||
"--- @param x number\n"
|
||||
"--- Rounds `x` to the nearest integer value\n"
|
||||
"function math.round(x)\n"
|
||||
"return x > 0 and math.floor(x + 0.5) or math.ceil(x - 0.5)\n"
|
||||
"end\n"
|
||||
"--- @type integer\n"
|
||||
"FONT_TINY = -1\n"
|
||||
"--- @type integer\n"
|
||||
@ -4388,4 +4390,4 @@ char gSmluaConstants[] = ""
|
||||
"VERSION_NUMBER=40\n"
|
||||
"MINOR_VERSION_NUMBER=2\n"
|
||||
"MAX_VERSION_LENGTH=128\n"
|
||||
;
|
||||
;
|
Loading…
x
Reference in New Issue
Block a user