Unify indentation style

Except for hooks module.
This commit is contained in:
Azumgi 2018-12-14 20:18:07 +03:00
parent 7e2faac683
commit 2879193731
38 changed files with 251 additions and 251 deletions

View file

@ -1,18 +1,18 @@
common = {
input = {
filename = "gui/vmf/vmf_atlas"
}
output = {
apply_processing = true
correct_gamma = true
cut_alpha_threshold = 0.5
enable_cut_alpha_threshold = false
format = "A8R8G8B8"
mipmap_filter = "kaiser"
mipmap_filter_wrap_mode = "mirror"
mipmap_keep_original = false
mipmap_num_largest_steps_to_discard = 0
mipmap_num_smallest_steps_to_discard = 0
input = {
filename = "gui/vmf/vmf_atlas"
}
output = {
apply_processing = true
correct_gamma = true
cut_alpha_threshold = 0.5
enable_cut_alpha_threshold = false
format = "A8R8G8B8"
mipmap_filter = "kaiser"
mipmap_filter_wrap_mode = "mirror"
mipmap_keep_original = false
mipmap_num_largest_steps_to_discard = 0
mipmap_num_smallest_steps_to_discard = 0
srgb = true
}
}
}
}

View file

@ -1,38 +1,38 @@
-- Image Source:
return {
header_fav_arrow = {
size = { 48, 48, },
uv00 = { 0.181641, 0.880859, },
uv11 = { 0.228516, 0.974609, },
},
header_fav_icon = {
size = { 48, 48, },
uv00 = { 0.130859, 0.880859, },
uv11 = { 0.177734, 0.974609, },
},
header_fav_icon_lit = {
size = { 48, 48, },
uv00 = { 0.052734, 0.880859, },
uv11 = { 0.099609, 0.974609, },
},
search_bar_icon = {
size = { 48, 48, },
uv00 = { 0.001953, 0.880859, },
uv11 = { 0.048828, 0.974609, },
},
map_view_party_button = {
size = { 128, 128, },
uv00 = { 0.130859, 0.623047, },
uv11 = { 0.255859, 0.873047, },
},
map_view_party_button_lit = {
size = { 128, 128, },
uv00 = { 0.001953, 0.623047, },
uv11 = { 0.126953, 0.873047, },
},
map_view_mutators_area = {
size = { 547, 313, },
uv00 = { 0.001953, 0.003906, },
uv11 = { 0.536133, 0.615234, },
},
-- Image Source:
return {
header_fav_arrow = {
size = { 48, 48, },
uv00 = { 0.181641, 0.880859, },
uv11 = { 0.228516, 0.974609, },
},
header_fav_icon = {
size = { 48, 48, },
uv00 = { 0.130859, 0.880859, },
uv11 = { 0.177734, 0.974609, },
},
header_fav_icon_lit = {
size = { 48, 48, },
uv00 = { 0.052734, 0.880859, },
uv11 = { 0.099609, 0.974609, },
},
search_bar_icon = {
size = { 48, 48, },
uv00 = { 0.001953, 0.880859, },
uv11 = { 0.048828, 0.974609, },
},
map_view_party_button = {
size = { 128, 128, },
uv00 = { 0.130859, 0.623047, },
uv11 = { 0.255859, 0.873047, },
},
map_view_party_button_lit = {
size = { 128, 128, },
uv00 = { 0.001953, 0.623047, },
uv11 = { 0.126953, 0.873047, },
},
map_view_mutators_area = {
size = { 547, 313, },
uv00 = { 0.001953, 0.003906, },
uv11 = { 0.536133, 0.615234, },
},
}

View file

@ -1,26 +1,26 @@
vmf_atlas = {
material_contexts = {
surface_material = ""
}
material_contexts = {
surface_material = ""
}
shader = "gui:DIFFUSE_MAP"
shader = "gui:DIFFUSE_MAP"
textures = {
diffuse_map = "gui/vmf/vmf_atlas"
}
textures = {
diffuse_map = "gui/vmf/vmf_atlas"
}
variables = {
}
variables = {
}
}
vmf_atlas_masked = {
material_contexts = {
surface_material = ""
}
shader = "gui_gradient:DIFFUSE_MAP:MASKED"
textures = {
diffuse_map = "gui/vmf/vmf_atlas"
}
variables = {
}
material_contexts = {
surface_material = ""
}
shader = "gui_gradient:DIFFUSE_MAP:MASKED"
textures = {
diffuse_map = "gui/vmf/vmf_atlas"
}
variables = {
}
}

View file

@ -1,13 +1,13 @@
mod = [
"vmf"
"vmf"
]
package = [
"resource_packages/vmf"
"resource_packages/vmf"
]
material = [
"materials/vmf/*"
"materials/vmf/*"
]
lua = [
@ -25,4 +25,4 @@ lua = [
"scripts/mods/vmf/modules/ui/mutators/*"
"materials/vmf/vmf_atlas"
]
]

View file

@ -74,4 +74,4 @@ function VMFMod:chat_whisper(peer_id, message)
if chat and chat:has_channel(1) and chat.is_server and peer_id ~= chat.host_peer_id then
send_system_message(peer_id, message)
end
end
end

View file

@ -158,4 +158,4 @@ function vmf.run_command(command_name, ...)
else
vmf:error("(commands): command '%s' wasn't found.", command_name) -- Should never see this
end
end
end

View file

@ -157,4 +157,4 @@ function vmf.all_mods_loaded_event()
local mod = _mods[mod_name]
run_event(mod, event_name)
end
end
end

View file

@ -426,8 +426,8 @@ end
vmf.apply_delayed_hooks = function(status, state)
if status == "enter" and state == "StateIngame" then
_delaying_enabled = false
end
_delaying_enabled = false
end
if #_delayed > 0 then
vmf:info("Attempt to hook %s delayed hooks", #_delayed)
-- Go through the table in reverse so we don't get any issues removing entries inside the loop
@ -436,4 +436,4 @@ vmf.apply_delayed_hooks = function(status, state)
table.remove(_delayed, i)
end
end
end
end

View file

@ -379,4 +379,4 @@ end
-- #####################################################################################################################
-- In case mods reloading was performed right at the moment of entering 'StateInGame'.
vmf.create_keybinds_input_service()
vmf.create_keybinds_input_service()

View file

@ -101,4 +101,4 @@ end
-- ####################################################################################################################
local localization_table = vmf:dofile("localization/vmf")
vmf.load_mod_localization(vmf, localization_table)
vmf.load_mod_localization(vmf, localization_table)

View file

@ -10,13 +10,13 @@ local _logging_settings
local function add_chat_message(message)
local chat_manager = Managers.chat
local new_message = {
channel_id = 1,
message_sender = "System",
message = message,
channel_id = 1,
message_sender = "System",
message = message,
is_system_message = VT1 and true,
type = not VT1 and Irc.SYSTEM_MSG, -- luacheck: ignore Irc
pop_chat = true,
is_dev = false
pop_chat = true,
is_dev = false
}
table.insert(chat_manager.chat_messages, new_message)
@ -155,4 +155,4 @@ end
-- ##### Script ########################################################################################################
-- #####################################################################################################################
vmf.load_logging_settings()
vmf.load_logging_settings()

View file

@ -26,4 +26,4 @@ function vmf.check_old_vmf()
error("Unfortunately, workshop mods and old-fashioned mods (VMF-pack or QoL) are incompatible. " ..
"Either remove old mods or disable workshop mods.")
end
end
end

View file

@ -104,4 +104,4 @@ end)
-- ##### Return ########################################################################################################
-- #####################################################################################################################
return set_lobby_data
return set_lobby_data

View file

@ -502,4 +502,4 @@ end)
-- #####################################################################################################################
-- Testing
--vmf:dofile("scripts/mods/vmf/modules/core/mutators/test/mutators_test")
--vmf:dofile("scripts/mods/vmf/modules/core/mutators/test/mutators_test")

View file

@ -12,10 +12,10 @@ mod_data.name = "Legendary"
mod_data.description = "Legendary description"
mod_data.is_mutator = true
mod_data.mutator_settings = {
incompatible_with_all = true,
compatible_with = {
"test_something"
}
incompatible_with_all = true,
compatible_with = {
"test_something"
}
}
vmf.initialize_mod_data(mod, mod_data)
mod.on_enabled = function(init_call) mod:echo("Legendary on_enabled(" .. (init_call and "init)" or ")")) end
@ -30,10 +30,10 @@ mod_data = {}
mod_data.name = "Something"
mod_data.is_mutator = true
mod_data.mutator_settings = {
incompatible_with = {
"test_true_solo",
"test_slayer"
}
incompatible_with = {
"test_true_solo",
"test_slayer"
}
}
vmf.initialize_mod_data(mod, mod_data)
mod.on_enabled = function(init_call) mod:echo("Something on_enabled(" .. (init_call and "init)" or ")")) end
@ -48,11 +48,11 @@ mod_data = {}
mod_data.name = "?Deathwish"
mod_data.is_mutator = true
mod_data.mutator_settings = {
difficulty_levels = {
"hardest",
"survival_hardest"
},
title_placement = "after"
difficulty_levels = {
"hardest",
"survival_hardest"
},
title_placement = "after"
}
vmf.initialize_mod_data(mod, mod_data)
mod.on_enabled = function(init_call) mod:echo("?Deathwish on_enabled(" .. (init_call and "init)" or ")")) end
@ -67,11 +67,11 @@ mod_data = {}
mod_data.name = "Slayer's Oath"
mod_data.is_mutator = true
mod_data.mutator_settings = {
difficulty_levels = {
"survival_hard",
"survival_harder",
"survival_hardest"
}
difficulty_levels = {
"survival_hard",
"survival_harder",
"survival_hardest"
}
}
vmf.initialize_mod_data(mod, mod_data)
mod.on_enabled = function(init_call) mod:echo("Slayer's Oath on_enabled(" .. (init_call and "init)" or ")")) end
@ -86,8 +86,8 @@ mod_data = {}
mod_data.name = "True Solo"
mod_data.is_mutator = true
mod_data.mutator_settings = {
compatible_with_all = true,
title_placement = "before"
compatible_with_all = true,
title_placement = "before"
}
vmf.initialize_mod_data(mod, mod_data)
mod.on_enabled = function(init_call) mod:echo("True Solo on_enabled(" .. (init_call and "init)" or ")")) end
@ -113,12 +113,12 @@ mod = get_mod("test_one_hit_one_kill")
mod_data = {}
mod_data.name = "One Hit One Kill"
mod_data.description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse tincidunt placerat" ..
" nulla eget pharetra. Vivamus consequat tristique vestibulum. Nullam vitae feugiat arcu," ..
" non porta ante. Phasellus consequat facilisis quam quis dignissim"
" nulla eget pharetra. Vivamus consequat tristique vestibulum. Nullam vitae feugiat arcu," ..
" non porta ante. Phasellus consequat facilisis quam quis dignissim"
mod_data.is_mutator = true
mod_data.mutator_settings = {
difficulty_levels = {"hardest"},
enable_after_these = {"test_more_rats_weapons"}
difficulty_levels = {"hardest"},
enable_after_these = {"test_more_rats_weapons"}
}
vmf.initialize_mod_data(mod, mod_data)
mod.on_enabled = function(init_call) mod:echo("One Hit One Kill on_enabled(" .. (init_call and "init)" or ")")) end
@ -144,11 +144,11 @@ mod_data = {}
mod_data.name = "lmao"
mod_data.is_mutator = true
mod_data.mutator_settings = {
difficulty_levels = {"hardest"},
enable_after_these = {"ayyyy"},
dice = {
bonus = 2
}
difficulty_levels = {"hardest"},
enable_after_these = {"ayyyy"},
dice = {
bonus = 2
}
}
vmf.initialize_mod_data(mod, mod_data)
mod.on_enabled = function(init_call) mod:echo("lmao on_enabled(" .. (init_call and "init)" or ")")) end
@ -163,8 +163,8 @@ mod_data = {}
mod_data.name = "More Rat Weapons"
mod_data.is_mutator = true
mod_data.mutator_settings = {
compatible_with_all = true,
difficulty_levels = {"hardest"}
compatible_with_all = true,
difficulty_levels = {"hardest"}
}
vmf.initialize_mod_data(mod, mod_data)
mod.on_enabled = function(init_call) mod:echo("More Rat Weapons on_enabled(" .. (init_call and "init)" or ")")) end
@ -258,4 +258,4 @@ vmf.initialize_mod_data(mod, mod_data)
mod.on_enabled = function(init_call) mod:echo("888 on_enabled(" .. (init_call and "init)" or ")")) end
mod.on_disabled = function(init_call) mod:echo("888 on_disabled(" .. (init_call and "init)" or ")")) end
vmf.initialize_mod_state(mod)
--]]
--]]

View file

@ -314,7 +314,7 @@ vmf:hook("ChatManager", "rpc_chat_message",
)
end
end
end
end
end)
vmf:hook(PlayerManager, "add_remote_player", function (func, self, peer_id, player_controlled, ...)
@ -408,4 +408,4 @@ end
-- ##### Script #######################################################################################################
-- ####################################################################################################################
vmf.load_network_settings()
vmf.load_network_settings()

View file

@ -591,4 +591,4 @@ end
if type(vmf:get("options_menu_collapsed_widgets")) ~= "table" then
vmf:set("options_menu_collapsed_widgets", {})
end
end

View file

@ -32,4 +32,4 @@ function VMFMod:persistent_table(table_name, default_table)
mod_tables[table_name] = mod_tables[table_name] or default_table or {}
return mod_tables[table_name]
end
end

View file

@ -10,11 +10,11 @@ end
local function print_error_callstack(error_message)
if type(error_message) == "table" and error_message.error then
error_message = error_message.error
end
print("Error: " .. tostring(error_message) .. "\n" .. Script.callstack())
return error_message
if type(error_message) == "table" and error_message.error then
error_message = error_message.error
end
print("Error: " .. tostring(error_message) .. "\n" .. Script.callstack())
return error_message
end
@ -40,7 +40,7 @@ end
function VMFMod:dofile(file_path)
local _, return_values = pack_pcall(vmf.safe_call_dofile(self, "(dofile)", file_path))
return unpack(return_values, 1, return_values.n)
return unpack(return_values, 1, return_values.n)
end
-- #####################################################################################################################
@ -52,7 +52,7 @@ function vmf.safe_call(mod, error_prefix_data, func, ...)
local success, return_values = pack_pcall(xpcall(func, print_error_callstack, ...))
if not success then
show_error(mod, error_prefix_data, return_values[1])
return success
return success
end
return success, unpack(return_values, 1, return_values.n)
end
@ -80,10 +80,10 @@ end
-- Safe Call [dofile]
function vmf.safe_call_dofile(mod, error_prefix_data, file_path)
if type(file_path) ~= "string" then
if type(file_path) ~= "string" then
show_error(mod, error_prefix_data, "file path should be a string.")
return false
end
return false
end
return vmf.safe_call(mod, error_prefix_data, dofile, file_path)
end
@ -91,4 +91,4 @@ end
-- Format error message and throw error.
function vmf.throw_error(error_message, ...)
error(string.format(error_message, ...), 0)
end
end

View file

@ -86,4 +86,4 @@ function vmf.mod_has_settings(mod)
if _mods_settings[mod:get_name()] then
return true
end
end
end

View file

@ -59,4 +59,4 @@ vmf.mod_state_changed = function (mod_name, is_enabled)
else
vmf.set_mod_state(mod, is_enabled, false)
end
end
end

View file

@ -98,4 +98,4 @@ end
-- ##### Script #######################################################################################################
-- ####################################################################################################################
vmf.load_dev_console_settings()
vmf.load_dev_console_settings()

View file

@ -355,4 +355,4 @@ end
VMFMod.dtf = VMFMod.dump_to_file
-- Managers.curl._requests crashes the game
-- Managers.curl._requests crashes the game

View file

@ -292,4 +292,4 @@ end
-- ##### Script #######################################################################################################
-- ####################################################################################################################
vmf.load_custom_textures_settings()
vmf.load_custom_textures_settings()

View file

@ -406,4 +406,4 @@ else
end
if ingame_ui_exists then
_ingame_ui = ingame_ui_return
end
end

View file

@ -43,4 +43,4 @@ end
-- ##### Script #######################################################################################################
-- ####################################################################################################################
vmf.load_ui_scaling_settings()
vmf.load_ui_scaling_settings()

View file

@ -168,4 +168,4 @@ vmf.initialize_mod_options_legacy = function (mod, widgets_definition)
end
table.insert(vmf.options_widgets_data, mod_settings_list_widgets_definitions)
end
end

View file

@ -184,10 +184,10 @@ vmf:hook("ChatGui", "_update_input", function(func, self, input_service, menu_in
-- ctrl + v
if Keyboard.pressed(Keyboard.button_index("v")) and Keyboard.button(Keyboard.button_index("left ctrl")) == 1 then
local new_chat_message = self.chat_message
-- remove carriage returns
local clipboard_data = tostring(Clipboard.get()):gsub("\r", "")
-- remove invalid characters
if Utf8.valid(clipboard_data) then
new_chat_message = new_chat_message .. clipboard_data
@ -200,7 +200,7 @@ vmf:hook("ChatGui", "_update_input", function(func, self, input_service, menu_in
end)
new_chat_message = new_chat_message .. valid_data
end
set_chat_message(self, new_chat_message)
end
@ -315,4 +315,4 @@ end
if Managers.world and Managers.world:has_world("top_ingame_view") then
initialize_drawing_function()
end
end

View file

@ -37,16 +37,16 @@ local _WIDTH = 550
-- ####################################################################################################################
local function get_text_width(text, font_material, font_size)
local text_extent_min, text_extent_max = Gui.text_extents(_gui, text, font_material, font_size)
local text_height = text_extent_max[1] - text_extent_min[1]
return text_height
local text_extent_min, text_extent_max = Gui.text_extents(_gui, text, font_material, font_size)
local text_height = text_extent_max[1] - text_extent_min[1]
return text_height
end
local function word_wrap(text, font_material, font_size, max_width)
local whitespace = " "
local soft_dividers = "-+&/*"
local return_dividers = "\n"
local reuse_global_table = true
local whitespace = " "
local soft_dividers = "-+&/*"
local return_dividers = "\n"
local reuse_global_table = true
local scale = RESOLUTION_LOOKUP.scale
return Gui.word_wrap(_gui, text, font_material, font_size, max_width * scale, whitespace,
@ -168,4 +168,4 @@ local function draw(commands_list, selected_command_index)
--end)
end
return draw
return draw

View file

@ -421,4 +421,4 @@ function vmf.reset_map_view()
change_map_view_look(map_view, false)
show_mutator_list(map_view, false)
end
end
end

View file

@ -323,4 +323,4 @@ return {
party_button_widget_defenition = party_button_widget_defenition,
no_mutators_text_widget = no_mutators_text_widget,
create_mutator_widget = create_mutator_widget
}
}

View file

@ -123,4 +123,4 @@ end
vmf.disable_mods_options_button = function ()
_button_injection_data.mod_options_button_disabled = true
end
end

View file

@ -2755,11 +2755,11 @@ local _SCROLL_STEP
-- copypasted 'math.point_is_inside_2d_box' from VT2 source code, since VT1 and VT2 have different implementations
local function is_point_inside_2d_box(pos, lower_left_corner, size)
if lower_left_corner[1] < pos[1] and pos[1] < lower_left_corner[1] + size[1] and lower_left_corner[2] < pos[2] and pos[2] < lower_left_corner[2] + size[2] then
return true
else
return false
end
if lower_left_corner[1] < pos[1] and pos[1] < lower_left_corner[1] + size[1] and lower_left_corner[2] < pos[2] and pos[2] < lower_left_corner[2] + size[2] then
return true
else
return false
end
end
-- ####################################################################################################################
@ -4288,9 +4288,9 @@ return {
ingame = true
},
keybind_transitions = {
open_view_transition = "vmf_options_view",
close_view_transition = "exit_menu",
}
open_view_transition = "vmf_options_view",
close_view_transition = "exit_menu",
}
},
view_transitions = {
vmf_options_view = function (self)
@ -4298,4 +4298,4 @@ return {
self.menu_active = true
end
}
}
}

View file

@ -69,4 +69,4 @@ function VMFMod:get_description()
end
function VMFMod:is_enabled()
return self._data.is_enabled
end
end

View file

@ -243,4 +243,4 @@ if not vmf:get("vmf_initialized") then
--vmf.load_vmf_options_view_settings()
vmf:set("vmf_initialized", true)
end
end

View file

@ -182,4 +182,4 @@ function vmf.unload_all_resource_packages()
_loading_package.mod:unload_package(package_name)
end
end
end
end

View file

@ -11,44 +11,44 @@ local vmf_mod_object = {}
-- #####################################################################################################################
function vmf_mod_object:init()
dofile("scripts/mods/vmf/modules/vmf_mod_data")
dofile("scripts/mods/vmf/modules/vmf_mod_manager")
dofile("scripts/mods/vmf/modules/vmf_package_manager")
dofile("scripts/mods/vmf/modules/core/safe_calls")
dofile("scripts/mods/vmf/modules/core/events")
dofile("scripts/mods/vmf/modules/core/settings")
dofile("scripts/mods/vmf/modules/core/logging")
dofile("scripts/mods/vmf/modules/core/misc")
dofile("scripts/mods/vmf/modules/core/persistent_tables")
dofile("scripts/mods/vmf/modules/debug/dev_console")
dofile("scripts/mods/vmf/modules/debug/table_dump")
dofile("scripts/mods/vmf/modules/core/hooks")
dofile("scripts/mods/vmf/modules/core/toggling")
dofile("scripts/mods/vmf/modules/core/keybindings")
dofile("scripts/mods/vmf/modules/core/chat")
dofile("scripts/mods/vmf/modules/core/localization")
dofile("scripts/mods/vmf/modules/core/options")
dofile("scripts/mods/vmf/modules/legacy/options")
dofile("scripts/mods/vmf/modules/core/network")
dofile("scripts/mods/vmf/modules/core/commands")
dofile("scripts/mods/vmf/modules/gui/custom_textures")
dofile("scripts/mods/vmf/modules/gui/custom_views")
dofile("scripts/mods/vmf/modules/gui/ui_scaling")
dofile("scripts/mods/vmf/modules/ui/chat/chat_actions")
dofile("scripts/mods/vmf/modules/ui/options/mod_options")
dofile("scripts/mods/vmf/modules/vmf_options")
dofile("scripts/mods/vmf/modules/vmf_mod_data")
dofile("scripts/mods/vmf/modules/vmf_mod_manager")
dofile("scripts/mods/vmf/modules/vmf_package_manager")
dofile("scripts/mods/vmf/modules/core/safe_calls")
dofile("scripts/mods/vmf/modules/core/events")
dofile("scripts/mods/vmf/modules/core/settings")
dofile("scripts/mods/vmf/modules/core/logging")
dofile("scripts/mods/vmf/modules/core/misc")
dofile("scripts/mods/vmf/modules/core/persistent_tables")
dofile("scripts/mods/vmf/modules/debug/dev_console")
dofile("scripts/mods/vmf/modules/debug/table_dump")
dofile("scripts/mods/vmf/modules/core/hooks")
dofile("scripts/mods/vmf/modules/core/toggling")
dofile("scripts/mods/vmf/modules/core/keybindings")
dofile("scripts/mods/vmf/modules/core/chat")
dofile("scripts/mods/vmf/modules/core/localization")
dofile("scripts/mods/vmf/modules/core/options")
dofile("scripts/mods/vmf/modules/legacy/options")
dofile("scripts/mods/vmf/modules/core/network")
dofile("scripts/mods/vmf/modules/core/commands")
dofile("scripts/mods/vmf/modules/gui/custom_textures")
dofile("scripts/mods/vmf/modules/gui/custom_views")
dofile("scripts/mods/vmf/modules/gui/ui_scaling")
dofile("scripts/mods/vmf/modules/ui/chat/chat_actions")
dofile("scripts/mods/vmf/modules/ui/options/mod_options")
dofile("scripts/mods/vmf/modules/vmf_options")
if VT1 then
dofile("scripts/mods/vmf/modules/core/mutators/mutators_manager")
dofile("scripts/mods/vmf/modules/ui/mutators/mutators_gui")
end
if VT1 then
dofile("scripts/mods/vmf/modules/core/mutators/mutators_manager")
dofile("scripts/mods/vmf/modules/ui/mutators/mutators_gui")
end
vmf = get_mod("VMF")
vmf.delayed_chat_messages_hook()
vmf:hook(ModManager, "destroy", function(func, ...)
vmf.mods_unload_event(true)
func(...)
end)
vmf = get_mod("VMF")
vmf.delayed_chat_messages_hook()
vmf:hook(ModManager, "destroy", function(func, ...)
vmf.mods_unload_event(true)
func(...)
end)
end
-- #####################################################################################################################
@ -56,62 +56,62 @@ end
-- #####################################################################################################################
function vmf_mod_object:update(dt)
vmf.update_package_manager()
vmf.mods_update_event(dt)
vmf.check_keybinds()
vmf.execute_queued_chat_command()
if VT1 then vmf.check_mutators_state() end
vmf.update_package_manager()
vmf.mods_update_event(dt)
vmf.check_keybinds()
vmf.execute_queued_chat_command()
if VT1 then vmf.check_mutators_state() end
if not vmf.all_mods_were_loaded and Managers.mod._state == "done" then
if not vmf.all_mods_were_loaded and Managers.mod._state == "done" then
vmf.generate_keybinds()
vmf.initialize_vmf_options_view()
vmf.create_network_dictionary()
vmf.ping_vmf_users()
vmf.generate_keybinds()
vmf.initialize_vmf_options_view()
vmf.create_network_dictionary()
vmf.ping_vmf_users()
if VT1 then vmf.modify_map_view() end
if VT1 then vmf.mutators_delete_raw_config() end
if VT1 then vmf.modify_map_view() end
if VT1 then vmf.mutators_delete_raw_config() end
vmf.all_mods_loaded_event()
vmf.all_mods_loaded_event()
vmf.all_mods_were_loaded = true
end
vmf.all_mods_were_loaded = true
end
end
function vmf_mod_object:on_unload()
print("VMF:ON_UNLOAD()")
vmf.save_chat_history()
vmf.save_unsaved_settings_to_file()
print("VMF:ON_UNLOAD()")
vmf.save_chat_history()
vmf.save_unsaved_settings_to_file()
end
function vmf_mod_object:on_reload()
print("VMF:ON_RELOAD()")
vmf.disable_mods_options_button()
if VT1 then vmf.reset_map_view() end
vmf.mods_unload_event(false)
vmf.remove_custom_views()
vmf.unload_all_resource_packages()
vmf.hooks_unload()
vmf.reset_guis()
print("VMF:ON_RELOAD()")
vmf.disable_mods_options_button()
if VT1 then vmf.reset_map_view() end
vmf.mods_unload_event(false)
vmf.remove_custom_views()
vmf.unload_all_resource_packages()
vmf.hooks_unload()
vmf.reset_guis()
end
function vmf_mod_object:on_game_state_changed(status, state)
print("VMF:ON_GAME_STATE_CHANGED(), status: " .. tostring(status) .. ", state: " .. tostring(state))
if VT1 then vmf.check_old_vmf() end
vmf.mods_game_state_changed_event(status, state)
vmf.save_unsaved_settings_to_file()
vmf.apply_delayed_hooks(status, state)
print("VMF:ON_GAME_STATE_CHANGED(), status: " .. tostring(status) .. ", state: " .. tostring(state))
if VT1 then vmf.check_old_vmf() end
vmf.mods_game_state_changed_event(status, state)
vmf.save_unsaved_settings_to_file()
vmf.apply_delayed_hooks(status, state)
if status == "enter" and state == "StateIngame" then
vmf.create_keybinds_input_service()
end
if status == "enter" and state == "StateIngame" then
vmf.create_keybinds_input_service()
end
end
-- #####################################################################################################################
-- ##### Return ########################################################################################################
-- #####################################################################################################################
return vmf_mod_object
return vmf_mod_object

View file

@ -1,9 +1,9 @@
local ret = {
run = function()
return dofile("scripts/mods/vmf/vmf_loader")
end,
packages = {
"resource_packages/vmf"
}
run = function()
return dofile("scripts/mods/vmf/vmf_loader")
end,
packages = {
"resource_packages/vmf"
}
}
return ret