Add QEZC for diagonal walking as well as broadcast/red talk for gamemasters
This commit is contained in:
parent
4b7770361d
commit
bf30fc0dc3
|
@ -3,7 +3,7 @@ SpeakTypesSettings = {
|
||||||
say = { speakType = MessageModes.Say, color = '#FFFF00' },
|
say = { speakType = MessageModes.Say, color = '#FFFF00' },
|
||||||
whisper = { speakType = MessageModes.Whisper, color = '#FFFF00' },
|
whisper = { speakType = MessageModes.Whisper, color = '#FFFF00' },
|
||||||
yell = { speakType = MessageModes.Yell, color = '#FFFF00' },
|
yell = { speakType = MessageModes.Yell, color = '#FFFF00' },
|
||||||
broadcast = { speakType = MessageModes.GamemasterPrivateFrom, color = '#F55E5E' },
|
broadcast = { speakType = MessageModes.GamemasterBroadcast, color = '#F55E5E' },
|
||||||
private = { speakType = MessageModes.PrivateTo, color = '#5FF7F7', private = true },
|
private = { speakType = MessageModes.PrivateTo, color = '#5FF7F7', private = true },
|
||||||
privateRed = { speakType = MessageModes.GamemasterTo, color = '#F55E5E', private = true },
|
privateRed = { speakType = MessageModes.GamemasterTo, color = '#F55E5E', private = true },
|
||||||
privatePlayerToPlayer = { speakType = MessageModes.PrivateTo, color = '#9F9DFD', private = true },
|
privatePlayerToPlayer = { speakType = MessageModes.PrivateTo, color = '#9F9DFD', private = true },
|
||||||
|
@ -164,12 +164,18 @@ function enableChat()
|
||||||
|
|
||||||
g_keyboard.unbindKeyUp("Space")
|
g_keyboard.unbindKeyUp("Space")
|
||||||
g_keyboard.unbindKeyUp("Enter")
|
g_keyboard.unbindKeyUp("Enter")
|
||||||
|
g_keyboard.unbindKeyUp("Escape")
|
||||||
|
|
||||||
gameInterface.unbindWalkKey("W")
|
gameInterface.unbindWalkKey("W")
|
||||||
gameInterface.unbindWalkKey("D")
|
gameInterface.unbindWalkKey("D")
|
||||||
gameInterface.unbindWalkKey("S")
|
gameInterface.unbindWalkKey("S")
|
||||||
gameInterface.unbindWalkKey("A")
|
gameInterface.unbindWalkKey("A")
|
||||||
|
|
||||||
|
gameInterface.unbindWalkKey("E")
|
||||||
|
gameInterface.unbindWalkKey("Q")
|
||||||
|
gameInterface.unbindWalkKey("C")
|
||||||
|
gameInterface.unbindWalkKey("Z")
|
||||||
|
|
||||||
consoleToggleChat:setTooltip(tr("Disable chat mode, allow to walk using ASDW"))
|
consoleToggleChat:setTooltip(tr("Disable chat mode, allow to walk using ASDW"))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -187,12 +193,18 @@ function disableChat()
|
||||||
end
|
end
|
||||||
g_keyboard.bindKeyUp("Space", quickFunc)
|
g_keyboard.bindKeyUp("Space", quickFunc)
|
||||||
g_keyboard.bindKeyUp("Enter", quickFunc)
|
g_keyboard.bindKeyUp("Enter", quickFunc)
|
||||||
|
g_keyboard.bindKeyUp("Escape", quickFunc)
|
||||||
|
|
||||||
gameInterface.bindWalkKey("W", North)
|
gameInterface.bindWalkKey("W", North)
|
||||||
gameInterface.bindWalkKey("D", East)
|
gameInterface.bindWalkKey("D", East)
|
||||||
gameInterface.bindWalkKey("S", South)
|
gameInterface.bindWalkKey("S", South)
|
||||||
gameInterface.bindWalkKey("A", West)
|
gameInterface.bindWalkKey("A", West)
|
||||||
|
|
||||||
|
gameInterface.bindWalkKey("E", NorthEast)
|
||||||
|
gameInterface.bindWalkKey("Q", NorthWest)
|
||||||
|
gameInterface.bindWalkKey("C", SouthEast)
|
||||||
|
gameInterface.bindWalkKey("Z", SouthWest)
|
||||||
|
|
||||||
consoleToggleChat:setTooltip(tr("Enable chat mode"))
|
consoleToggleChat:setTooltip(tr("Enable chat mode"))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -687,7 +699,7 @@ function sendMessage(message, tab)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- player used whisper
|
-- player used whisper
|
||||||
local chatCommandMessage = message:match("^%#[w|W] (.*)")
|
chatCommandMessage = message:match("^%#[w|W] (.*)")
|
||||||
if chatCommandMessage ~= nil then
|
if chatCommandMessage ~= nil then
|
||||||
chatCommandSayMode = 'whisper'
|
chatCommandSayMode = 'whisper'
|
||||||
message = chatCommandMessage
|
message = chatCommandMessage
|
||||||
|
@ -695,13 +707,28 @@ function sendMessage(message, tab)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- player say
|
-- player say
|
||||||
local chatCommandMessage = message:match("^%#[s|S] (.*)")
|
chatCommandMessage = message:match("^%#[s|S] (.*)")
|
||||||
if chatCommandMessage ~= nil then
|
if chatCommandMessage ~= nil then
|
||||||
chatCommandSayMode = 'say'
|
chatCommandSayMode = 'say'
|
||||||
message = chatCommandMessage
|
message = chatCommandMessage
|
||||||
channel = 0
|
channel = 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- player red talk on channel
|
||||||
|
chatCommandMessage = message:match("^%#[c|C] (.*)")
|
||||||
|
if chatCommandMessage ~= nil then
|
||||||
|
chatCommandSayMode = 'channelRed'
|
||||||
|
message = chatCommandMessage
|
||||||
|
end
|
||||||
|
|
||||||
|
-- player broadcast
|
||||||
|
chatCommandMessage = message:match("^%#[b|B] (.*)")
|
||||||
|
if chatCommandMessage ~= nil then
|
||||||
|
chatCommandSayMode = 'broadcast'
|
||||||
|
message = chatCommandMessage
|
||||||
|
channel = 0
|
||||||
|
end
|
||||||
|
|
||||||
local findIni, findEnd, chatCommandInitial, chatCommandPrivate, chatCommandEnd, chatCommandMessage = message:find("([%*%@])(.+)([%*%@])(.*)")
|
local findIni, findEnd, chatCommandInitial, chatCommandPrivate, chatCommandEnd, chatCommandMessage = message:find("([%*%@])(.+)([%*%@])(.*)")
|
||||||
if findIni ~= nil and findIni == 1 then -- player used private chat command
|
if findIni ~= nil and findIni == 1 then -- player used private chat command
|
||||||
if chatCommandInitial == chatCommandEnd then
|
if chatCommandInitial == chatCommandEnd then
|
||||||
|
|
Loading…
Reference in New Issue