diff --git a/src/decomp/type-searcher/type-searcher.ts b/src/decomp/type-searcher/type-searcher.ts index 9b41d83..c2593c4 100644 --- a/src/decomp/type-searcher/type-searcher.ts +++ b/src/decomp/type-searcher/type-searcher.ts @@ -60,7 +60,7 @@ function getWebviewContent() { function search(evt) { let parentName = document.getElementById("parent-name").value; - let typeSize = parseInt(document.getElementById("type-size").value); + let typeSize = document.getElementById("type-size").value; let methodId = parseInt(document.getElementById("method-id").value); let gameName = document.getElementById("game-name").value; @@ -94,12 +94,14 @@ function getWebviewContent() { const nameColumn = document.createElement("div"); nameColumn.className = "column column-25"; const nameField = document.createElement("sl-input"); + nameField.className = "field-name"; nameField.label = "Field Type Name?"; nameColumn.appendChild(nameField); const offsetColumn = document.createElement("div"); offsetColumn.className = "column column-25"; const offsetField = document.createElement("sl-input"); + offsetField.className = "field-offset"; offsetField.label = "Offset?"; offsetField.type = "number"; offsetColumn.appendChild(offsetField); @@ -121,18 +123,25 @@ function getWebviewContent() { window.addEventListener('message', event => { document.getElementById("results").innerHTML = ""; const message = event.data; + document.getElementById("command").innerHTML = JSON.stringify(message.args); if (message.command === "search") { if (message.data instanceof Array && message.data.length <= 0) { const column = document.createElement("div"); - column.className = "column column-20"; + column.className = "column"; const content = document.createTextNode("No Results"); column.appendChild(content); document.getElementById("results").appendChild(column); + } else if (message.data.length === 1) { + const column = document.createElement("div"); + column.className = "column"; + const content = document.createTextNode(message.data[0]); + column.appendChild(content); + document.getElementById("results").appendChild(column); } else { - for (const name of message.data) { + for (const val of message.data) { const column = document.createElement("div"); column.className = "column column-20"; - const content = document.createTextNode(name); + const content = document.createTextNode(val); column.appendChild(content); document.getElementById("results").appendChild(column); } @@ -141,50 +150,63 @@ function getWebviewContent() { });