diff options
| -rw-r--r-- | webAO/client.html | 5 | ||||
| -rw-r--r-- | webAO/client.js | 12 |
2 files changed, 8 insertions, 9 deletions
diff --git a/webAO/client.html b/webAO/client.html index 928f303..5375648 100644 --- a/webAO/client.html +++ b/webAO/client.html @@ -140,6 +140,7 @@ <div id="character_options"> <label for="role_select">Role:</label> <select id="role_select" name="role_select" onchange="changeRoleOOC()"> + <option value="">Default</option> <option value="def">Defense</option> <option value="pro">Prosecution</option> <option value="jud">Judge</option> @@ -435,10 +436,6 @@ <input id="bg_command" name="bg_command" type="text" value="bg $1"> <br> <br> - <label for="role_command">Change role command:</label> - <input id="role_command" name="role_command" type="text" value="pos $1"> - <br> - <br> <label for="randomchar_command">Random character command:</label> <input id="randomchar_command" name="randomchar_command" type="text" value="randomchar"> <br> diff --git a/webAO/client.js b/webAO/client.js index b4932a6..8d59ec5 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -2053,6 +2053,8 @@ export function onEnter(event) { const text = document.getElementById("client_inputbox").value; const pairchar = document.getElementById("pair_select").value; const pairoffset = document.getElementById("pair_offset").value; + const myrole = document.getElementById("role_select").value ? document.getElementById("role_select").value : mychar.side; + let sfxname = "0"; let sfxdelay = 0; let preanim = "-"; @@ -2066,7 +2068,7 @@ export function onEnter(event) { } client.sendIC("chat", preanim, mychar.name, myemo.emote, - text, mychar.side, + text, myrole, sfxname, myemo.zoom, sfxdelay, selectedShout, evi, flip, flash, color, showname, pairchar, pairoffset, noninterrupting_preanim, looping_sfx, screenshake); } @@ -2736,11 +2738,11 @@ window.changeBackgroundOOC = changeBackgroundOOC; * Change role via OOC. */ export function changeRoleOOC() { - const role_select = document.getElementById("role_select"); - const role_command = document.getElementById("role_command").value; + const new_role = document.getElementById("role_select").value; - client.sendOOC("/" + role_command.replace("$1", role_select.value)); - updateActionCommands(role_select.value); + client.sendOOC("/pos " + new_role); + client.sendServer("SP#" + new_role + "#%"); + updateActionCommands(new_role); } window.changeRoleOOC = changeRoleOOC; |
