-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d4b582f
commit d38bd71
Showing
10 changed files
with
226 additions
and
226 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,34 @@ | ||
hook.Remove("Initialize", "emojichat_init") | ||
hook.Add("Initialize", "emojichat_init", function() | ||
-- TODO: Can this get called too early? | ||
eChat.AddServerMessage("EmojiChat by Badger") | ||
eChat.AddServerMessage("EmojiChat by Badger") | ||
eChat.buildBox() | ||
end) | ||
|
||
hook.Remove("ChatText", "emojichat_joinleave") | ||
hook.Add("ChatText", "emojichat_joinleave", function( index, name, text, type ) | ||
if type != "chat" then | ||
eChat.AddServerMessage(text) | ||
return true | ||
end | ||
if type != "chat" then | ||
eChat.AddServerMessage(text) | ||
return true | ||
end | ||
end) | ||
|
||
hook.Remove("PlayerBindPress", "emojichat_hijackbind") | ||
hook.Add("PlayerBindPress", "emojichat_hijackbind", function(ply, bind, pressed) | ||
if string.sub( bind, 1, 11 ) == "messagemode" then | ||
local chatMode = CHATMODE_GLOBAL | ||
if bind == "messagemode2" then | ||
chatMode = CHATMODE_TEAM | ||
end | ||
if string.sub( bind, 1, 11 ) == "messagemode" then | ||
local chatMode = CHATMODE_GLOBAL | ||
if bind == "messagemode2" then | ||
chatMode = CHATMODE_TEAM | ||
end | ||
|
||
eChat.showBox(chatMode) | ||
return true | ||
end | ||
eChat.showBox(chatMode) | ||
return true | ||
end | ||
end) | ||
|
||
hook.Remove("HUDShouldDraw", "emojichat_hidedefault") | ||
hook.Add("HUDShouldDraw", "emojichat_hidedefault", function( name ) | ||
if name == "CHudChat" then | ||
return false | ||
end | ||
if name == "CHudChat" then | ||
return false | ||
end | ||
end) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,42 @@ | ||
HTMLChatCallbacks = {} | ||
|
||
function HTMLChatCallbacks.SendMessage(message, destination) | ||
if string.Trim( message ) != "" then | ||
if string.Trim( message ) != "" then | ||
|
||
if destination == DESTINATION_TEAM then | ||
LocalPlayer():ConCommand("say_team \"" .. (message or "") .. "\"") | ||
if destination == DESTINATION_TEAM then | ||
LocalPlayer():ConCommand("say_team \"" .. (message or "") .. "\"") | ||
|
||
elseif destination == DESTINATION_CONSOLE then | ||
LocalPlayer():ConCommand(message or "") | ||
elseif destination == DESTINATION_CONSOLE then | ||
LocalPlayer():ConCommand(message or "") | ||
|
||
else | ||
LocalPlayer():ConCommand("say \"" .. message .. "\"") | ||
else | ||
LocalPlayer():ConCommand("say \"" .. message .. "\"") | ||
|
||
end | ||
end | ||
end | ||
end | ||
|
||
eChat.hideBox() | ||
HTMLChatCallbacks.InputChange("") | ||
eChat.hideBox() | ||
HTMLChatCallbacks.InputChange("") | ||
end | ||
|
||
function HTMLChatCallbacks.InputChange(newValue) | ||
hook.Run("ChatTextChanged", newValue) | ||
hook.Run("ChatTextChanged", newValue) | ||
end | ||
|
||
function HTMLChatCallbacks.CloseChat() | ||
eChat.hideBox() | ||
gui.HideGameUI() | ||
gui.HideGameUI() | ||
end | ||
|
||
function HTMLChatCallbacks.PlayWarningSound() | ||
surface.PlaySound("resource/warning.wav") | ||
surface.PlaySound("resource/warning.wav") | ||
end | ||
|
||
function HTMLChatCallbacks.HideMenu() | ||
gui.HideGameUI() | ||
end | ||
|
||
function HTMLChatCallbacks.OpenURL(url) | ||
gui.OpenURL(url) | ||
HTMLChatCallbacks.CloseChat() | ||
gui.OpenURL(url) | ||
HTMLChatCallbacks.CloseChat() | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.