diff options
| author | sD <stoned@derpymail.org> | 2020-02-13 13:52:42 +0100 |
|---|---|---|
| committer | sD <stoned@derpymail.org> | 2020-02-13 13:52:42 +0100 |
| commit | 500216d501cb093f9b8bb5970eb90bd4871aa322 (patch) | |
| tree | 6ff09d93eaf5e2d95557aaebb9c48d6c6be29b84 /webAO | |
| parent | 16534dca669494efdf657f15d7d4a39373629b7d (diff) | |
| parent | b7e2fb43787129761706d1cf6376e335039e7ab7 (diff) | |
Merge branch 'master' of https://github.com/AttorneyOnline/webAO
Diffstat (limited to 'webAO')
| -rw-r--r-- | webAO/client.html | 6 | ||||
| -rw-r--r-- | webAO/client.js | 15 |
2 files changed, 19 insertions, 2 deletions
diff --git a/webAO/client.html b/webAO/client.html index aa61139..51418b3 100644 --- a/webAO/client.html +++ b/webAO/client.html @@ -300,6 +300,12 @@ </select> <br> <br> + <p>Ini editing (experimental)</p> + <label for="client_ininame">Iniedit Character:</label> + <input type="text" id="client_ininame" name="client_ininame"> + <button id="client_inichange" onclick="iniedit()">Change</button> + <br> + <br> <span style="color:red">↓ Only touch these settings if you know what you are doing. ↓</span> <br> <br> diff --git a/webAO/client.js b/webAO/client.js index 03a72cf..3e30e03 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -1100,19 +1100,19 @@ class Client extends EventEmitter { /** * Handles the server's assignment of a character for the player to use. + * PV # playerID (unused) # CID # character ID * @param {Array} args packet arguments */ async handlePV(args) { this.charID = Number(args[3]); - document.getElementById("client_charselect").style.display = "none"; const me = this.character; this.selectedEmote = -1; const emotes = this.emotes; const emotesList = document.getElementById("client_emo"); - emotesList.innerHTML = ""; // Clear emote box emotesList.style.display = ""; + emotesList.innerHTML = ""; // Clear emote box const ini = me.inifile; me.side = ini.options.side; updateActionCommands(me.side); @@ -1870,6 +1870,17 @@ export function reloadTheme() { window.reloadTheme = reloadTheme; /** + * Triggered by the ini button. + */ +export async function iniedit() { + const ininame = document.getElementById("client_ininame").value; + const inicharID = client.charID; + await client.handleCharacterInfo(ininame.split("&"),inicharID); + client.handlePV(("PV#0#CID#" + inicharID).split("#")); +} +window.iniedit = iniedit; + +/** * Triggered when a character icon is clicked in the character selection menu. * @param {MouseEvent} event */ |
