Angular directive

sra-chat source template

The Chat Widget sends predefined messages with a click of a button. You can also send private messages directly to a specific car. You can also select LEADER, AHEAD, BEHIND, or REPLY to let the system determine the car to send to. Just click the button or car first, then click the text. Here is a list of the predefined messages.
ALL ME
[#[CARNUMBER]] All Me
GOOD LUCK
[#[CARNUMBER]] Good Luck from SIMRacingApps.com
GOOD RACE
[#[CARNUMBER]] Good Race from SIMRacingApps.com
GOOD WIN - Sends to Leader by default.
/LEADER [#[CARNUMBER]] Good Win
HELLO
[#[CARNUMBER]] Hello
LOL
[#[CARNUMBER]] LoL
NO PROBLEM
[#[CARNUMBER]] No Problem
OK
[#[CARNUMBER]] Ok
PASS LEFT - Sends to Car BEHIND by default.
/RL-1 [#[CARNUMBER]] Pass Left
PASS RIGHT - Sends to Car BEHIND by default.
/RL-1 [#[CARNUMBER]] Pass Right
PITTING IN
[#[CARNUMBER]] Pitting In
PITTING OUT
[#[CARNUMBER]] Pitting Out
RACING DEAL
[#[CARNUMBER]] Racing Deal
SORRY
[#[CARNUMBER]] Sorry
SWITCH IN 1
[#[CARNUMBER]] Switch In 1
SWITCH IN 3
[#[CARNUMBER]] Switch In 3
THANKS - Sends to Car BEHIND by default.
/RL-1 [#[CARNUMBER]] Thanks
YOU'RE WELCOME - Sends to the Car AHEAD by default.
/RL1 [#[CARNUMBER]] You're Welcome
@ALLTEAMS
@transmit ALLTEAMS
@DRIVERS
@transmit DRIVERS
@TEAM
@transmit TEAM
@CLUB
@transmit CLUB
@RACE CONTROL
@transmit RACECONTROL
@PRIVATE
@transmit PRIVATE
@ADD CH - adds a radio channel using the selected car number. CHxxx
@add CH[CARORME]
JOIN ME @CH - Invite others to join your channel
[#[CARNUMBER]] Join Me @ADD CH[CARNUMBER]
@CH
@transmit CH[CARORME]
?
[#[CARNUMBER]] ?
The default messages can be changed in the settings.txt file using the following variables. There are 6 rows and 4 columns that you can reference for 24 possible predefined messages. The text is optional, and will use the default text if the button name is one of the predefined ones. The predefined text puts your car number at the beginning of all messages.
   chat-row1-col1-name = Button Name
   chat-row1-col1-text = Text To Send
You can have multiple instances of chat with a different name. See the parameter data-sra-args-chat-instance. Just replace the word "chat" in the variable to your instance name, in this example, "chat2".
   chat2-row1-col1-name = Button Name
   chat2-row1-col1-text = Text To Send
The text can also have variables embedded with it. The following variables are allowed.
  • [CAR] - The car number that the message will be sent to.
  • [CARORME] - The car number selected or ME if no car selected
  • [CARNUMBER] - Your Car Number
  • [DRIVERNAME] - Your Name
You can also embed any SendKeys sequence in the text. See SendKeys. If the text begins with a slash, then the "word" following the slash will be used to send the message to that car identifier. It will also accept "REPLY" as a car identifier to send the message to the last person to send you a private message. If you have already selected a car to send to, then that car will override. Think of '/' as a way to define a default car. As a convention, I also put a slash at the beginning of the name followed with the car number. For Example, Pass Left almost always applies to the car behind you. Why send to all cars?:
   chat-row1-col1-name = /[CAR]
PASS LEFT chat-row1-col1-text = /RL-1 [#[CARNUMBER]] Pass Left

Example:

<sra-chat></sra-chat>
Image goes here

Dependencies:
NameTypeDescription
data-sra-args-chat-instance string The name of this instance for the settings.txt variable prefix. Defaults to "chat".
data-sra-args-interval integer The interval, in milliseconds, that this widget will update from the server. Default is 500.