mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Add reload server scripts button to edit.js
This commit is contained in:
parent
812aaee48c
commit
71e039951c
3 changed files with 20 additions and 5 deletions
|
@ -1569,7 +1569,7 @@ var PropertiesTool = function (opts) {
|
|||
pushCommandForSelections();
|
||||
selectionManager._update();
|
||||
}
|
||||
} else if (data.action === "reloadScript") {
|
||||
} else if (data.action === "reloadClientScripts") {
|
||||
if (selectionManager.hasSelection()) {
|
||||
var timestamp = Date.now();
|
||||
for (i = 0; i < selectionManager.selections.length; i++) {
|
||||
|
@ -1578,6 +1578,12 @@ var PropertiesTool = function (opts) {
|
|||
});
|
||||
}
|
||||
}
|
||||
} else if (data.action === "reloadServerScripts") {
|
||||
if (selectionManager.hasSelection()) {
|
||||
for (i = 0; i < selectionManager.selections.length; i++) {
|
||||
Entities.reloadServerScripts(selectionManager.selections[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -318,9 +318,10 @@
|
|||
<input type="text" id="property-script-url">
|
||||
<input type="button" id="reload-script-button" class="glyph" value="F">
|
||||
</div>
|
||||
<div class="behavior-group property url">
|
||||
<div class="behavior-group property url refresh">
|
||||
<label for="property-server-scripts">Server Script URLs</label>
|
||||
<input type="text" id="property-server-scripts">
|
||||
<input type="button" id="reload-server-scripts-button" class="glyph" value="F">
|
||||
</div>
|
||||
<div class="section-header model-group model-section zone-section">
|
||||
<label>Model</label><span>M</span>
|
||||
|
|
|
@ -590,8 +590,9 @@ function loaded() {
|
|||
var elLifetime = document.getElementById("property-lifetime");
|
||||
var elScriptURL = document.getElementById("property-script-url");
|
||||
var elScriptTimestamp = document.getElementById("property-script-timestamp");
|
||||
var elReloadScriptButton = document.getElementById("reload-script-button");
|
||||
var elReloadScriptsButton = document.getElementById("reload-script-button");
|
||||
var elServerScripts = document.getElementById("property-server-scripts");
|
||||
var elReloadServerScriptsButton = document.getElementById("reload-server-scripts-button");
|
||||
var elUserData = document.getElementById("property-user-data");
|
||||
var elClearUserData = document.getElementById("userdata-clear");
|
||||
var elSaveUserData = document.getElementById("userdata-save");
|
||||
|
@ -1398,12 +1399,19 @@ function loaded() {
|
|||
percentage: parseInt(elRescaleDimensionsPct.value),
|
||||
}));
|
||||
});
|
||||
elReloadScriptButton.addEventListener("click", function() {
|
||||
elReloadScriptsButton.addEventListener("click", function() {
|
||||
EventBridge.emitWebEvent(JSON.stringify({
|
||||
type: "action",
|
||||
action: "reloadScript"
|
||||
action: "reloadClientScripts"
|
||||
}));
|
||||
});
|
||||
elReloadServerScriptsButton.addEventListener("click", function() {
|
||||
EventBridge.emitWebEvent(JSON.stringify({
|
||||
type: "action",
|
||||
action: "reloadServerScripts"
|
||||
}));
|
||||
});
|
||||
|
||||
|
||||
window.onblur = function() {
|
||||
// Fake a change event
|
||||
|
|
Loading…
Reference in a new issue