Chat Actions: blocked raycast workaround

This commit is contained in:
bi 2018-05-22 12:40:53 +03:00
parent a54d0528d9
commit 77b7643744
2 changed files with 14 additions and 2 deletions

View file

@ -21,6 +21,8 @@ local _CHAT_HISTORY_REMOVE_DUPS_LAST = false
local _CHAT_HISTORY_REMOVE_DUPS_ALL = false local _CHAT_HISTORY_REMOVE_DUPS_ALL = false
local _CHAT_HISTORY_SAVE_COMMANDS_ONLY = false local _CHAT_HISTORY_SAVE_COMMANDS_ONLY = false
local _QUEUED_COMMAND -- is a workaround for VT2 where raycast is blocked during ui update
-- #################################################################################################################### -- ####################################################################################################################
-- ##### Local functions ############################################################################################## -- ##### Local functions ##############################################################################################
-- #################################################################################################################### -- ####################################################################################################################
@ -99,7 +101,10 @@ vmf:hook("ChatGui._update_input", function(func, self, input_service, menu_input
end end
table.remove(args, 1) table.remove(args, 1)
vmf.run_command(_COMMANDS_LIST[_COMMAND_INDEX].name, unpack(args)) _QUEUED_COMMAND = {
name = _COMMANDS_LIST[_COMMAND_INDEX].name,
args = args
}
_COMMANDS_LIST = {} _COMMANDS_LIST = {}
_COMMAND_INDEX = 0 _COMMAND_INDEX = 0
@ -273,6 +278,13 @@ vmf.save_chat_history = function()
end end
end end
vmf.execute_queued_chat_command = function()
if _QUEUED_COMMAND then
vmf.run_command(_QUEUED_COMMAND.name, unpack(_QUEUED_COMMAND.args))
_QUEUED_COMMAND = nil
end
end
-- #################################################################################################################### -- ####################################################################################################################
-- ##### Script ####################################################################################################### -- ##### Script #######################################################################################################
-- #################################################################################################################### -- ####################################################################################################################

View file

@ -29,7 +29,7 @@ return {
dofile("scripts/mods/vmf/modules/vmf_options") dofile("scripts/mods/vmf/modules/vmf_options")
if VT1 then if VT1 then
dofile("scripts/mods/vmf/modules/ui/mutators/mutator_manager") dofile("scripts/mods/vmf/modules/core/mutators/mutators_manager")
dofile("scripts/mods/vmf/modules/ui/mutators/mutators_gui") dofile("scripts/mods/vmf/modules/ui/mutators/mutators_gui")
end end