Compare commits

...

4 Commits

Author SHA1 Message Date
CakeLancelot
1eee35b230 Add browse button to cache path input and refine validation logic 2024-10-05 20:59:13 -05:00
CakeLancelot
d8363b61a6 Fix copy/paste error on modal title 2024-10-05 17:29:07 -05:00
CakeLancelot
6239f383bc Bump version number 2024-10-05 16:16:02 -05:00
CakeLancelot
19e036ddf9 Change version text to button, move config button to opposing corner 2024-09-23 18:12:42 -05:00
6 changed files with 78 additions and 36 deletions

View File

@ -59,12 +59,18 @@ body {
"Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
} }
#of-versionnumberdiv { #of-about-button-div {
position: fixed; position: fixed;
bottom: 4px; bottom: 4px;
right: 8px; right: 8px;
} }
#of-config-button-div {
position: fixed;
bottom: 4px;
left: 8px;
}
.btn-primary { .btn-primary {
background-image: url("../../assets/img/btn-primary-bg.png"); background-image: url("../../assets/img/btn-primary-bg.png");
background-repeat: repeat; background-repeat: repeat;

View File

@ -11,7 +11,7 @@ var configPath = path.join(userData, "config.json");
var serversPath = path.join(userData, "servers.json"); var serversPath = path.join(userData, "servers.json");
var versionsPath = path.join(userData, "versions.json"); var versionsPath = path.join(userData, "versions.json");
var cacheRoot = path.join(userData, "/../../LocalLow/Unity/Web Player/Cache"); var cacheRoot = path.join(userData, "/../../LocalLow/Unity/Web Player/Cache");
var offlineRootDefault = path.join(cacheRoot, "Offline"); var offlineRootDefault = path.join(cacheRoot, "../OfflineCache");
var offlineRoot = offlineRootDefault; var offlineRoot = offlineRootDefault;
var cdnString = "http://cdn.dexlabs.systems/ff/big"; var cdnString = "http://cdn.dexlabs.systems/ff/big";
@ -78,7 +78,6 @@ function getAppVersion() {
function setAppVersionText() { function setAppVersionText() {
$("#of-aboutversionnumber").text("Version " + getAppVersion()); $("#of-aboutversionnumber").text("Version " + getAppVersion());
$("#of-versionnumber").text("v" + getAppVersion());
} }
function validateServerSave(modalName) { function validateServerSave(modalName) {
@ -329,13 +328,22 @@ function editConfig() {
function validateCacheLocation() { function validateCacheLocation() {
var input = document.getElementById("editconfig-offlinecachelocation"); var input = document.getElementById("editconfig-offlinecachelocation");
var button = document.getElementById("editconfig-savebutton"); var button = document.getElementById("editconfig-savebutton");
var parent = path.join(input.value, "/..");
input.classList.remove("invalidinput"); input.classList.remove("invalidinput");
button.removeAttribute("disabled"); button.removeAttribute("disabled");
// Parent MUST exist and be a directory
// If the target exists, check that is also a directory
// Also, prevent putting the offline cache inside of
// the normal cache folder to prevent shenanigans
if ( if (
!remotefs.existsSync(input.value) || !remotefs.existsSync(parent) ||
!remotefs.statSync(input.value).isDirectory() !remotefs.statSync(parent).isDirectory() ||
(remotefs.existsSync(input.value) &&
!remotefs.statSync(input.value).isDirectory()) ||
path.join(input.value, ".") === path.join(cacheRoot, "/..") ||
path.join(input.value, ".").startsWith(path.join(cacheRoot))
) { ) {
input.classList.add("invalidinput"); input.classList.add("invalidinput");
button.setAttribute("disabled", ""); button.setAttribute("disabled", "");
@ -949,6 +957,17 @@ function prepConnection(address, port) {
launchGame(); launchGame();
} }
function browseOfflineCache() {
var browsePath = dialog.showOpenDialog({ properties: ["openDirectory"] });
var offlineCacheInput = document.getElementById(
"editconfig-offlinecachelocation"
);
if (browsePath && offlineCacheInput) {
offlineCacheInput.value = browsePath;
validateCacheLocation();
}
}
// Returns the UUID of the server with the selected background color. // Returns the UUID of the server with the selected background color.
// Yes, there are probably better ways to go about this, but it works well enough. // Yes, there are probably better ways to go about this, but it works well enough.
function getSelectedServer() { function getSelectedServer() {

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3"> <asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<assemblyIdentity type="win32" name="OpenFusion.Client" version="1.5.2.0" processorArchitecture="x86" /> <assemblyIdentity type="win32" name="OpenFusion.Client" version="1.6.0.0" processorArchitecture="x86" />
<dependency> <dependency>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity type="Win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"> <assemblyIdentity type="Win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*">

View File

@ -1,4 +1,4 @@
<!doctype html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
@ -108,18 +108,6 @@
</button> </button>
</div> </div>
<div class="col-4 d-inline-flex justify-content-end"> <div class="col-4 d-inline-flex justify-content-end">
<button
class="btn btn-primary mr-1"
data-toggle="modal"
data-bs-tooltip=""
data-placement="bottom"
id="of-editconfig-button"
type="button"
title="Edit Configuration"
data-target="#of-editconfigmodal"
>
<i class="fas fa-cog"></i>
</button>
<button <button
class="btn btn-primary mr-1" class="btn btn-primary mr-1"
data-toggle="modal" data-toggle="modal"
@ -183,6 +171,7 @@
data-target="#of-restoreserversmodal" data-target="#of-restoreserversmodal"
>Reset to Default Servers</a >Reset to Default Servers</a
> >
<br />
<a <a
href="#of-restoreversionsmodal" href="#of-restoreversionsmodal"
onclick="$('#of-aboutmodal').modal('toggle')" onclick="$('#of-aboutmodal').modal('toggle')"
@ -535,12 +524,22 @@
/> />
<label for="editconfig-offlinecachelocation" <label for="editconfig-offlinecachelocation"
>Select Offline Cache Location:</label >Select Offline Cache Location:</label
><input >
class="form-control form-row w-75" <div class="form-row">
id="editconfig-offlinecachelocation" <input
type="text" class="form-control w-75"
oninput="validateCacheLocation()" id="editconfig-offlinecachelocation"
/> type="text"
oninput="validateCacheLocation()"
/>
<button
type="button"
class="btn btn-primary mb-2 ml-1"
onclick="browseOfflineCache()"
>
<i class="fas fa-folder"></i>
</button>
</div>
</form> </form>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
@ -668,7 +667,7 @@
<div class="modal-dialog modal-dialog-centered" role="document"> <div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h4 class="modal-title">Add Server</h4> <h4 class="modal-title">Add Version</h4>
<button <button
type="button" type="button"
class="close" class="close"
@ -886,15 +885,33 @@
</div> </div>
</div> </div>
</div> </div>
<div id="of-versionnumberdiv"> <div id="of-config-button-div">
<a <button
id="of-versionnumber" class="btn btn-primary mr-1"
class="text-monospace text-secondary"
href="#of-aboutmodal"
data-toggle="modal" data-toggle="modal"
data-target="#of-aboutmodal" data-bs-tooltip=""
>v0</a data-placement="right"
id="of-editconfig-button"
type="button"
title="Edit Configuration"
data-target="#of-editconfigmodal"
> >
<i class="fas fa-cog"></i>
</button>
</div>
<div id="of-about-button-div">
<button
class="btn btn-primary mr-1"
data-toggle="modal"
data-bs-tooltip=""
data-placement="left"
id="of-about-button"
type="button"
title="About OpenFusionClient"
data-target="#of-aboutmodal"
>
<i class="fas fa-info-circle"></i>
</button>
</div> </div>
</section> </section>
<section> <section>

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "OpenFusionClient", "name": "OpenFusionClient",
"version": "1.5.2", "version": "1.6.0",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "OpenFusionClient", "name": "OpenFusionClient",
"version": "1.5.2", "version": "1.6.0",
"hasInstallScript": true, "hasInstallScript": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {

View File

@ -1,6 +1,6 @@
{ {
"name": "OpenFusionClient", "name": "OpenFusionClient",
"version": "1.5.2", "version": "1.6.0",
"description": "OpenFusionClient", "description": "OpenFusionClient",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {