Исправлен мод heroturrets
Добавлен мод blueprint-sandboxes Добавляет метку версии в zzzparanoidal (#72)
This commit is contained in:
22
blueprint-sandboxes/scripts/chat.lua
Normal file
22
blueprint-sandboxes/scripts/chat.lua
Normal file
@@ -0,0 +1,22 @@
|
||||
-- Chat helpers to proxy messages between Sandboxes and the normal Surfaces
|
||||
local Chat = {}
|
||||
|
||||
-- Proxy Chats between Sandbox Force <-> Original Force
|
||||
function Chat.OnChat(event)
|
||||
if event.player_index == nil then
|
||||
return
|
||||
end
|
||||
local player = game.players[event.player_index]
|
||||
local playerData = global.players[event.player_index]
|
||||
|
||||
if Sandbox.IsPlayerInsideSandbox(player) then
|
||||
game.forces[playerData.forceName].print(player.name .. ": " .. event.message, player.chat_color)
|
||||
else
|
||||
local sandboxForce = game.forces[playerData.sandboxForceName]
|
||||
if sandboxForce ~= nil then
|
||||
sandboxForce.print(player.name .. ": " .. event.message, player.chat_color)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return Chat
|
||||
Reference in New Issue
Block a user