Browse Source

Add QEZC for diagonal walking as well as broadcast/red talk for gamemasters

Konrad 6 years ago
parent
commit
bf30fc0dc3
1 changed files with 30 additions and 3 deletions
  1. 30
    3
      modules/game_console/console.lua

+ 30
- 3
modules/game_console/console.lua View File

@@ -3,7 +3,7 @@ SpeakTypesSettings = {
3 3
   say = { speakType = MessageModes.Say, color = '#FFFF00' },
4 4
   whisper = { speakType = MessageModes.Whisper, color = '#FFFF00' },
5 5
   yell = { speakType = MessageModes.Yell, color = '#FFFF00' },
6
-  broadcast = { speakType = MessageModes.GamemasterPrivateFrom, color = '#F55E5E' },
6
+  broadcast = { speakType = MessageModes.GamemasterBroadcast, color = '#F55E5E' },
7 7
   private = { speakType = MessageModes.PrivateTo, color = '#5FF7F7', private = true },
8 8
   privateRed = { speakType = MessageModes.GamemasterTo, color = '#F55E5E', private = true },
9 9
   privatePlayerToPlayer = { speakType = MessageModes.PrivateTo, color = '#9F9DFD', private = true },
@@ -164,11 +164,17 @@ function enableChat()
164 164
 
165 165
   g_keyboard.unbindKeyUp("Space")
166 166
   g_keyboard.unbindKeyUp("Enter")
167
+  g_keyboard.unbindKeyUp("Escape")
167 168
 
168 169
   gameInterface.unbindWalkKey("W")
169 170
   gameInterface.unbindWalkKey("D")
170 171
   gameInterface.unbindWalkKey("S")
171 172
   gameInterface.unbindWalkKey("A")
173
+  
174
+  gameInterface.unbindWalkKey("E")
175
+  gameInterface.unbindWalkKey("Q")
176
+  gameInterface.unbindWalkKey("C")
177
+  gameInterface.unbindWalkKey("Z")
172 178
 
173 179
   consoleToggleChat:setTooltip(tr("Disable chat mode, allow to walk using ASDW"))
174 180
 end
@@ -187,11 +193,17 @@ function disableChat()
187 193
   end
188 194
   g_keyboard.bindKeyUp("Space", quickFunc)
189 195
   g_keyboard.bindKeyUp("Enter", quickFunc)
196
+  g_keyboard.bindKeyUp("Escape", quickFunc)
190 197
 
191 198
   gameInterface.bindWalkKey("W", North)
192 199
   gameInterface.bindWalkKey("D", East)
193 200
   gameInterface.bindWalkKey("S", South)
194 201
   gameInterface.bindWalkKey("A", West)
202
+  
203
+  gameInterface.bindWalkKey("E", NorthEast)
204
+  gameInterface.bindWalkKey("Q", NorthWest)
205
+  gameInterface.bindWalkKey("C", SouthEast)
206
+  gameInterface.bindWalkKey("Z", SouthWest)
195 207
 
196 208
   consoleToggleChat:setTooltip(tr("Enable chat mode"))
197 209
 end
@@ -687,7 +699,7 @@ function sendMessage(message, tab)
687 699
   end
688 700
 
689 701
    -- player used whisper
690
-  local chatCommandMessage = message:match("^%#[w|W] (.*)")
702
+  chatCommandMessage = message:match("^%#[w|W] (.*)")
691 703
   if chatCommandMessage ~= nil then
692 704
     chatCommandSayMode = 'whisper'
693 705
     message = chatCommandMessage
@@ -695,12 +707,27 @@ function sendMessage(message, tab)
695 707
   end
696 708
 
697 709
   -- player say
698
-  local chatCommandMessage = message:match("^%#[s|S] (.*)")
710
+  chatCommandMessage = message:match("^%#[s|S] (.*)")
699 711
   if chatCommandMessage ~= nil then
700 712
     chatCommandSayMode = 'say'
701 713
     message = chatCommandMessage
702 714
     channel = 0
703 715
   end
716
+  
717
+  -- player red talk on channel
718
+  chatCommandMessage = message:match("^%#[c|C] (.*)")
719
+  if chatCommandMessage ~= nil then
720
+    chatCommandSayMode = 'channelRed'
721
+    message = chatCommandMessage
722
+  end
723
+  
724
+  -- player broadcast
725
+  chatCommandMessage = message:match("^%#[b|B] (.*)")
726
+  if chatCommandMessage ~= nil then
727
+    chatCommandSayMode = 'broadcast'
728
+    message = chatCommandMessage
729
+    channel = 0
730
+  end
704 731
 
705 732
   local findIni, findEnd, chatCommandInitial, chatCommandPrivate, chatCommandEnd, chatCommandMessage = message:find("([%*%@])(.+)([%*%@])(.*)")
706 733
   if findIni ~= nil and findIni == 1 then -- player used private chat command

Loading…
Cancel
Save