mirror of
https://github.com/OpenFusionProject/Client.git
synced 2024-11-22 13:40:06 +00:00
"Final" changes
* Remove placeholder option for version and let the first available one get selected instead * Remove git hash in favor of just release version (this should probably be set dynamically at some point) * Clarify comments
This commit is contained in:
parent
1d70e9e3f6
commit
6adf72c608
@ -65,7 +65,7 @@ function loadServerList() {
|
|||||||
serverarray = serverjson['servers'];
|
serverarray = serverjson['servers'];
|
||||||
|
|
||||||
$(".server-listing-entry").remove(); // Clear out old stuff, if any
|
$(".server-listing-entry").remove(); // Clear out old stuff, if any
|
||||||
disableServerListButtons(); // Disable buttons until another is selected
|
disableServerListButtons(); // Disable buttons until another server is selected
|
||||||
|
|
||||||
if (serverarray.length > 0) {
|
if (serverarray.length > 0) {
|
||||||
// Servers were found in the JSON
|
// Servers were found in the JSON
|
||||||
@ -95,7 +95,7 @@ function loadServerList() {
|
|||||||
function setGameInfo(serverUUID) {
|
function setGameInfo(serverUUID) {
|
||||||
var result = serverarray.filter(function(obj) {return (obj.uuid === serverUUID);})[0];
|
var result = serverarray.filter(function(obj) {return (obj.uuid === serverUUID);})[0];
|
||||||
var gameversion = versionarray.filter(function(obj) {return (obj.name === result.version);})[0];
|
var gameversion = versionarray.filter(function(obj) {return (obj.name === result.version);})[0];
|
||||||
window.asseturl = gameversion.url
|
window.asseturl = gameversion.url // gameclient.js needs to access this
|
||||||
|
|
||||||
remotefs.writeFileSync(__dirname+"\\assetInfo.php", asseturl);
|
remotefs.writeFileSync(__dirname+"\\assetInfo.php", asseturl);
|
||||||
remotefs.writeFileSync(__dirname+"\\loginInfo.php", result.ip);
|
remotefs.writeFileSync(__dirname+"\\loginInfo.php", result.ip);
|
||||||
@ -107,8 +107,8 @@ function setGameInfo(serverUUID) {
|
|||||||
remotefs.writeFileSync(__dirname+"\\sponsor.php", httpendpoint+"upsell/sponsor.png");
|
remotefs.writeFileSync(__dirname+"\\sponsor.php", httpendpoint+"upsell/sponsor.png");
|
||||||
remotefs.writeFileSync(__dirname+"\\images.php", httpendpoint+"upsell/");
|
remotefs.writeFileSync(__dirname+"\\images.php", httpendpoint+"upsell/");
|
||||||
} else {
|
} else {
|
||||||
|
// Remove/default the endpoint related stuff, this server won't be using it
|
||||||
if (remotefs.existsSync(__dirname+"\\rankurl.txt")) {
|
if (remotefs.existsSync(__dirname+"\\rankurl.txt")) {
|
||||||
// delete the file, this server won't be using it
|
|
||||||
remotefs.unlinkSync(__dirname+"\\rankurl.txt");
|
remotefs.unlinkSync(__dirname+"\\rankurl.txt");
|
||||||
remotefs.writeFileSync(__dirname+"\\sponsor.php", "assets/img/welcome.png");
|
remotefs.writeFileSync(__dirname+"\\sponsor.php", "assets/img/welcome.png");
|
||||||
remotefs.writeFileSync(__dirname+"\\images.php", "assets/img/");
|
remotefs.writeFileSync(__dirname+"\\images.php", "assets/img/");
|
||||||
@ -143,6 +143,7 @@ $('#server-table').on('click', '.server-listing-entry', function(event) {
|
|||||||
$(this).addClass('bg-primary').siblings().removeClass('bg-primary');
|
$(this).addClass('bg-primary').siblings().removeClass('bg-primary');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// QoL feature: if you double click on a server it will connect
|
||||||
$('#server-table').on('dblclick', '.server-listing-entry', function(event) {
|
$('#server-table').on('dblclick', '.server-listing-entry', function(event) {
|
||||||
$(this).addClass('bg-primary').siblings().removeClass('bg-primary');
|
$(this).addClass('bg-primary').siblings().removeClass('bg-primary');
|
||||||
connectToServer();
|
connectToServer();
|
||||||
|
@ -50,7 +50,7 @@
|
|||||||
<h4 class="modal-title">About OpenFusionClient</h4><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
<h4 class="modal-title">About OpenFusionClient</h4><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<p class="text-monospace">Version 1.3-GIT_HASH</p>
|
<p class="text-monospace">Version 1.3</p>
|
||||||
<p>©2020 OpenFusion Contributors<br>OpenFusion is licensed under MIT.<br></p>
|
<p>©2020 OpenFusion Contributors<br>OpenFusion is licensed under MIT.<br></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
@ -69,9 +69,7 @@
|
|||||||
<h4 class="modal-title">Add Server</h4><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
<h4 class="modal-title">Add Server</h4><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<form id="addserver-form" class="needs-validation"><label for="addserver-descinput">Server Description</label><input class="form-control form-row w-75" type="text" id="addserver-descinput" placeholder="My OpenFusion Server" required="" minlength="1" maxlength="70"><label for="addserver-ipinput">Server IP</label><input class="form-control form-row w-75" type="text" id="addserver-ipinput" placeholder="127.0.0.1:23000" required="" pattern="^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]):[0-9]+$"><label for="addserver-versionselect">Game Version: </label><select class="form-control w-50" id="addserver-versionselect" required="" style="margin-left: -5px;">
|
<form id="addserver-form" class="needs-validation"><label for="addserver-descinput">Server Description</label><input class="form-control form-row w-75" type="text" id="addserver-descinput" placeholder="My OpenFusion Server" required="" minlength="1" maxlength="70"><label for="addserver-ipinput">Server IP</label><input class="form-control form-row w-75" type="text" id="addserver-ipinput" placeholder="127.0.0.1:23000" required="" pattern="^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]):[0-9]+$"><label for="addserver-versionselect">Game Version: </label><select class="form-control w-50" id="addserver-versionselect" required="" style="margin-left: -5px;"></select></form>
|
||||||
<option value="" selected="" id="addserver-versionlist-placeholder" disabled="">Please select a verison...</option>
|
|
||||||
</select></form>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer"><button class="btn btn-primary border rounded border-primary btn-danger border-danger" id="addserver-cancel" type="button" data-dismiss="modal">Cancel</button><button class="btn btn-primary border rounded border-primary btn-success border-success" id="addserver-savebutton" type="submit" data-dismiss="modal" form="addserver-form" onclick="addServer();">Save</button></div>
|
<div class="modal-footer"><button class="btn btn-primary border rounded border-primary btn-danger border-danger" id="addserver-cancel" type="button" data-dismiss="modal">Cancel</button><button class="btn btn-primary border rounded border-primary btn-success border-success" id="addserver-savebutton" type="submit" data-dismiss="modal" form="addserver-form" onclick="addServer();">Save</button></div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -94,5 +94,5 @@ function showMainWindow() {
|
|||||||
mainWindow.webContents.executeJavaScript("loadServerList();");
|
mainWindow.webContents.executeJavaScript("loadServerList();");
|
||||||
});
|
});
|
||||||
|
|
||||||
mainWindow.webContents.openDevTools()
|
//mainWindow.webContents.openDevTools()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user