-- chat_push_to_talk - Implements push-to-talk feature for chat system -- (component of Chat System) -- Template attachment: chat_system -- Created by: Patrick Ferland -- Created on: 06/05/2008 -- Revision History -- 06/05/2008 P.Ferland - New script -- 10/08/2008 P.Ferland - OX friendliness pass -- 10/28/2008 P.Ferland - Removed obsolete script attachment commands -- Constants CHAT_PTT_SCRIPT = '11302:26' SLASH_PTT_SCRIPT = '11302:27' ENTER_PTT_SCRIPT = '11302:28' -- Script Properties Define Properties() script_description = "Chat Push-to-talk" script_long_description = "Allow users to press enter to begin chatting" -- 20080605: Slash doesn't seem to work.... chat_system_ptt_slash = 0 -- ExposeProperty('chat_system_ptt_slash', 'Use slash key for push-to-talk? 1=yes, 0=no') -- PersistProperty('chat_system_ptt_slash') chat_system_ptt_enter = 1 ExposeProperty('chat_system_ptt_enter', 'Use enter key for push-to-talk?', 'checkbox') PersistProperty('chat_system_ptt_enter') IncludeScript('11302:12') -- chat_utility end -- Commands -- no commands -- Triggers -- System trigger: Fired when script is attached (in builder or at instantiation) Trigger attach() if (self.chat_system_ptt_slash == 1) then chat_system_register_player_script(self, SLASH_PTT_SCRIPT) end if (self.chat_system_ptt_enter == 1) then chat_system_register_player_script(self, ENTER_PTT_SCRIPT) end end -- Smart Object configuration extension Trigger script_parameter_changed(script_id, name, value) -- For core modules that need to redraw the UI, restart chat if ( script_id == CHAT_PTT_SCRIPT ) then -- set script attachments if (self.chat_system_ptt_slash == 1) then chat_system_register_player_script(self, SLASH_PTT_SCRIPT) end if (self.chat_system_ptt_slash ~= 1) then chat_system_unregister_player_script(self, SLASH_PTT_SCRIPT) end if (self.chat_system_ptt_enter == 1) then chat_system_register_player_script(self, ENTER_PTT_SCRIPT) end if (self.chat_system_ptt_enter ~= 1) then chat_system_unregister_player_script(self, ENTER_PTT_SCRIPT) end end end -- Local functions -- no functions