Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions media/MPQEditor/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@
<span slot="start" class="codicon codicon-add"></span>
</vscode-button>
</div>
<div class="rightbtns">
<vscode-checkbox id="circle-graph">Show Graph</vscode-checkbox>
</div>
</div>
<div>
<vscode-data-grid id="LayersTable" class="layers" generate-header="default" aria-label="Default Header" grid-template-columns="1fr 110px 120px 40px">
Expand Down
19 changes: 19 additions & 0 deletions media/MPQEditor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,27 @@ function main() {
case "modelNodesChanged":
handleModelNodesChanged(message.names);
break;
case "modelGraphIsShown":
handleModelGraphIsShown(message.shown);
break;
default:
break;
}
});

vscode.postMessage({ type: "requestDisplayMPQ" });
vscode.postMessage({ type: "requestModelNodes" });
vscode.postMessage({ type: "showModelNodes" });
Comment on lines 44 to +46
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q) this will post in serial at once and the response may not guarantee in this order. Is this OK?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q) this will post in serial at once and the response may not guarantee in this order. Is this OK?

Yes. It is ok. They are independent.
showModelNodes just opens another panel for selection of layers to edit.

}

function register() {
registerMainControls();
}

function handleModelGraphIsShown(shown) {
document.getElementById("circle-graph").checked = shown;
}

function handleModelNodesChanged(names) {
document.getElementById("AddSpecificLayer").disabled = names.length < 1;
}
Expand All @@ -65,6 +73,17 @@ function registerMainControls() {
applyUpdates();
});

// show model graph on openening by default
document.getElementById("circle-graph").checked = true;
document
.getElementById("circle-graph")
.addEventListener("click", function () {
vscode.postMessage({
type: "toggleCircleGraphIsShown",
show: document.getElementById("circle-graph").checked,
});
});

document
.getElementById("AddSpecificLayer")
.addEventListener("click", function () {
Expand Down
4 changes: 4 additions & 0 deletions media/MPQEditor/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ width: auto !important;
.leftbtns {
float: left;
}

.rightbtns {
float: right;
}