From b63d75033c27861443c0a539eab9cb4fbbe2d67b Mon Sep 17 00:00:00 2001 From: Dan Reeves Date: Fri, 19 Apr 2024 22:15:35 +0100 Subject: [PATCH] delete old mods --- MoveViewmodel/MoveViewmodel.mod | 12 -- .../mods/MoveViewmodel/MoveViewmodel.lua | 152 ------------------ .../mods/MoveViewmodel/MoveViewmodel_data.lua | 19 --- .../MoveViewmodel_localization.lua | 5 - MuteInBackground/MuteInBackground.mod | 12 -- .../MuteInBackground/MuteInBackground.lua | 37 ----- .../MuteInBackground_data.lua | 7 - .../MuteInBackground_localization.lua | 12 -- 8 files changed, 256 deletions(-) delete mode 100644 MoveViewmodel/MoveViewmodel.mod delete mode 100644 MoveViewmodel/scripts/mods/MoveViewmodel/MoveViewmodel.lua delete mode 100644 MoveViewmodel/scripts/mods/MoveViewmodel/MoveViewmodel_data.lua delete mode 100644 MoveViewmodel/scripts/mods/MoveViewmodel/MoveViewmodel_localization.lua delete mode 100644 MuteInBackground/MuteInBackground.mod delete mode 100644 MuteInBackground/scripts/mods/MuteInBackground/MuteInBackground.lua delete mode 100644 MuteInBackground/scripts/mods/MuteInBackground/MuteInBackground_data.lua delete mode 100644 MuteInBackground/scripts/mods/MuteInBackground/MuteInBackground_localization.lua diff --git a/MoveViewmodel/MoveViewmodel.mod b/MoveViewmodel/MoveViewmodel.mod deleted file mode 100644 index c8ac3c0..0000000 --- a/MoveViewmodel/MoveViewmodel.mod +++ /dev/null @@ -1,12 +0,0 @@ -return { - run = function() - fassert(rawget(_G, "new_mod"), "`MoveViewmodel` encountered an error loading the Darktide Mod Framework.") - - new_mod("MoveViewmodel", { - mod_script = "MoveViewmodel/scripts/mods/MoveViewmodel/MoveViewmodel", - mod_data = "MoveViewmodel/scripts/mods/MoveViewmodel/MoveViewmodel_data", - mod_localization = "MoveViewmodel/scripts/mods/MoveViewmodel/MoveViewmodel_localization", - }) - end, - packages = {}, -} diff --git a/MoveViewmodel/scripts/mods/MoveViewmodel/MoveViewmodel.lua b/MoveViewmodel/scripts/mods/MoveViewmodel/MoveViewmodel.lua deleted file mode 100644 index e77b7b4..0000000 --- a/MoveViewmodel/scripts/mods/MoveViewmodel/MoveViewmodel.lua +++ /dev/null @@ -1,152 +0,0 @@ -local mod = get_mod("MoveViewmodel") -local FirstPersonAnimationVariables = require("scripts/utilities/first_person_animation_variables") -local WeaponTemplate = require("scripts/utilities/weapon/weapon_template") - -local Editor = class("MoveViewmodelEditor") - -function Editor:init() - self._is_open = false -end - -function Editor:open() - local input_manager = Managers.input - local name = self.__class_name - - if not input_manager:cursor_active() then - input_manager:push_cursor(name) - end - - self._is_open = true - Imgui.open_imgui() -end - -function Editor:close() - local input_manager = Managers.input - local name = self.__class_name - - if input_manager:cursor_active() then - input_manager:pop_cursor(name) - end - - self._is_open = false - Imgui.close_imgui() -end - -local function _weapon_name() - local player = Managers.player:local_player(1) - local unit_data_extension = ScriptUnit.has_extension(player.player_unit, "unit_data_system") - local weapon_action_component = unit_data_extension:read_component("weapon_action") - local weapon_template = WeaponTemplate.current_weapon_template(weapon_action_component) - local weapon_name = weapon_template.name - return weapon_name -end - -local function _get(key) - local weapon_name = _weapon_name() - local setting_key = weapon_name .. "_" .. key - return mod:get(setting_key) -end - -local function _set(key, val) - local weapon_name = _weapon_name() - local setting_key = weapon_name .. "_" .. key - return mod:set(setting_key, val) -end - -function Editor:slider(key) - local val = _get(key) - local new_val = Imgui.slider_float(string.upper(key), val, -1, 1) - if val ~= new_val then - _set(key, new_val) - end -end - -function Editor:checkbox(label, key) - local val = _get(key) - local new_val = Imgui.checkbox(label, val) - if val ~= new_val then - _set(key, new_val) - end -end - -function Editor:update() - if not self._is_open then - return - end - - -- Imgui.set_next_window_size(500, 500) - local _, closed = Imgui.begin_window("Move Viewmodel", "always_auto_resize") - - if closed then - self:close() - end - - self:checkbox("Reset on ADS", "reset_on_ads") - self:slider("x") - self:slider("y") - self:slider("z") - if Imgui.button("Reset to defaults") then - _set("x", 0) - _set("y", 0) - _set("z", 0) - _set("reset_on_ads", true) - end - - Imgui.end_window() -end - -local editor = Editor:new() - -function mod.update() - editor:update() -end - -function mod.toggle_editor() - if editor._is_open then - editor:close() - else - editor:open() - end -end - -mod:hook("UIManager", "using_input", function(func, ...) - return editor._is_open or func(...) -end) - -mod:hook("PlayerUnitFirstPersonExtension", "update_unit_position", function(func, self, unit, dt, t) - func(self, unit, dt, t) - - local player = self._player - - if self._is_local_unit and player:is_human_controlled() then - local first_person_unit = self._first_person_unit - local unit_data_extension = self._unit_data_extension - local state_machine_lerp_values = self._state_machine_lerp_values - local alternate_fire_component = unit_data_extension:read_component("alternate_fire") - local input_extension = ScriptUnit.extension(unit, "input_system") - local position = Unit.local_position(first_person_unit, 1) - local is_aiming_down_sights = alternate_fire_component and alternate_fire_component.is_active - - if is_aiming_down_sights and _get("reset_on_ads") then - return - end - - local yaw, pitch, roll = input_extension:get_orientation() - local look_rotation = Quaternion.from_yaw_pitch_roll(yaw, pitch, roll) - - local rotated_vector = Quaternion.rotate(look_rotation, Vector3(_get("x"), _get("y"), _get("z"))) - - local offset_position = position + rotated_vector - - Unit.set_local_position(first_person_unit, 1, offset_position) - FirstPersonAnimationVariables.update( - dt, - t, - first_person_unit, - unit_data_extension, - self._weapon_extension, - state_machine_lerp_values - ) - World.update_unit_and_children(self._world, first_person_unit) - end -end) diff --git a/MoveViewmodel/scripts/mods/MoveViewmodel/MoveViewmodel_data.lua b/MoveViewmodel/scripts/mods/MoveViewmodel/MoveViewmodel_data.lua deleted file mode 100644 index 6ea60b6..0000000 --- a/MoveViewmodel/scripts/mods/MoveViewmodel/MoveViewmodel_data.lua +++ /dev/null @@ -1,19 +0,0 @@ -local mod = get_mod("MoveViewmodel") - -return { - name = "MoveViewmodel", - description = mod:localize("mod_description"), - is_togglable = true, - options = { - widgets = { - { - setting_id = "open_editor", - type = "keybind", - default_value = {}, - keybind_trigger = "pressed", - keybind_type = "function_call", - function_name = "toggle_editor", - }, - }, - }, -} diff --git a/MoveViewmodel/scripts/mods/MoveViewmodel/MoveViewmodel_localization.lua b/MoveViewmodel/scripts/mods/MoveViewmodel/MoveViewmodel_localization.lua deleted file mode 100644 index c704178..0000000 --- a/MoveViewmodel/scripts/mods/MoveViewmodel/MoveViewmodel_localization.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - mod_description = { - en = "MoveViewmodel description", - }, -} diff --git a/MuteInBackground/MuteInBackground.mod b/MuteInBackground/MuteInBackground.mod deleted file mode 100644 index 8bf587b..0000000 --- a/MuteInBackground/MuteInBackground.mod +++ /dev/null @@ -1,12 +0,0 @@ -return { - run = function() - fassert(rawget(_G, "new_mod"), "`MuteInBackground` encountered an error loading the Darktide Mod Framework.") - - new_mod("MuteInBackground", { - mod_script = "MuteInBackground/scripts/mods/MuteInBackground/MuteInBackground", - mod_data = "MuteInBackground/scripts/mods/MuteInBackground/MuteInBackground_data", - mod_localization = "MuteInBackground/scripts/mods/MuteInBackground/MuteInBackground_localization", - }) - end, - packages = {}, -} diff --git a/MuteInBackground/scripts/mods/MuteInBackground/MuteInBackground.lua b/MuteInBackground/scripts/mods/MuteInBackground/MuteInBackground.lua deleted file mode 100644 index 65fc5c3..0000000 --- a/MuteInBackground/scripts/mods/MuteInBackground/MuteInBackground.lua +++ /dev/null @@ -1,37 +0,0 @@ -local mod = get_mod("MuteInBackground") - -local default_sound_volume = 100 -local master_volume_value_name = "option_master_slider" -local current_master_volume = Application.user_setting("sound_settings", master_volume_value_name) - or default_sound_volume - -local calling_it_ourselves = false -mod:hook(Wwise, "set_parameter", function(func, param_name, value) - if param_name == master_volume_value_name and not calling_it_ourselves then - current_master_volume = value - end - return func(param_name, value) -end) - -local muted = false -mod.update = function() - if mod:is_enabled() then - if IS_WINDOWS and not Window.has_focus() and not muted then - muted = true - calling_it_ourselves = true - Wwise.set_parameter(master_volume_value_name, 0) - calling_it_ourselves = false - end - - if IS_WINDOWS and Window.has_focus() and muted then - muted = false - calling_it_ourselves = true - Wwise.set_parameter(master_volume_value_name, current_master_volume) - calling_it_ourselves = false - end - end -end - -mod.on_disabled = function() - Wwise.set_parameter(master_volume_value_name, current_master_volume) -end diff --git a/MuteInBackground/scripts/mods/MuteInBackground/MuteInBackground_data.lua b/MuteInBackground/scripts/mods/MuteInBackground/MuteInBackground_data.lua deleted file mode 100644 index 362480f..0000000 --- a/MuteInBackground/scripts/mods/MuteInBackground/MuteInBackground_data.lua +++ /dev/null @@ -1,7 +0,0 @@ -local mod = get_mod("MuteInBackground") - -return { - name = mod:localize("mod_name"), - description = mod:localize("mod_description"), - is_togglable = true, -} diff --git a/MuteInBackground/scripts/mods/MuteInBackground/MuteInBackground_localization.lua b/MuteInBackground/scripts/mods/MuteInBackground/MuteInBackground_localization.lua deleted file mode 100644 index 2bbef2e..0000000 --- a/MuteInBackground/scripts/mods/MuteInBackground/MuteInBackground_localization.lua +++ /dev/null @@ -1,12 +0,0 @@ -return { - mod_name = { - en = "Mute In Background", - ru = "Отключение звука игры в фоне", - ["zh-cn"] = "在后台时静音", - }, - mod_description = { - en = "Mutes the game while it's in the background or not focused", - ru = "Mute In Background - Отключает звук игры, когда она находится в фоновом режиме или не в фокусе.", - ["zh-cn"] = "游戏在后台失去焦点时静音", - }, -}