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, },
},
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 = [

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

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)

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

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, ...)

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

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,

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)

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,58 +56,58 @@ 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
-- #####################################################################################################################

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