diff options
| author | stonedDiscord <stoned@derpymail.org> | 2020-02-13 13:51:26 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-13 13:51:26 +0100 |
| commit | b7e2fb43787129761706d1cf6376e335039e7ab7 (patch) | |
| tree | 7393fa4fadb7064a2e7241b8da982753c57bc1d2 | |
| parent | 02df4d38a588b1f3447a6264f04746489dc718e5 (diff) | |
| parent | 60431a062e262bfc92d61c933d54e5492d6b7c25 (diff) | |
Merge pull request #45 from AttorneyOnline/iniedit
the cursed update
| -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 7002f9b..1e2adcc 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 */ |
