mirror of
https://github.com/mon/BemaniPatcher.git
synced 2026-08-01 14:10:40 -07:00
Show successful match, fix text/button reset
Shows patches matched for full matches to help identify which version was uploaded (with accompanying green style). Also, fixes force load text and buttons not hiding/clearing when uploading a matching file after a non-matching file without reloading the page.
This commit is contained in:
@@ -209,6 +209,12 @@ button:hover:enabled, .fileLabel > strong:hover {
|
|||||||
color: red;
|
color: red;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.matchSuccess {
|
||||||
|
font-size: 15px;
|
||||||
|
font-style: italic;
|
||||||
|
color: green;
|
||||||
|
}
|
||||||
|
|
||||||
li > button {
|
li > button {
|
||||||
height: 24px;
|
height: 24px;
|
||||||
padding: 0 7px;
|
padding: 0 7px;
|
||||||
|
|||||||
@@ -211,6 +211,7 @@ class PatchContainer {
|
|||||||
var supportedDlls = $("<ul>");
|
var supportedDlls = $("<ul>");
|
||||||
this.forceLoadTexts = [];
|
this.forceLoadTexts = [];
|
||||||
this.forceLoadButtons = [];
|
this.forceLoadButtons = [];
|
||||||
|
this.matchSuccessText = [];
|
||||||
for (var i = 0; i < this.patchers.length; i++) {
|
for (var i = 0; i < this.patchers.length; i++) {
|
||||||
var checkboxId = createID();
|
var checkboxId = createID();
|
||||||
|
|
||||||
@@ -223,6 +224,9 @@ class PatchContainer {
|
|||||||
var matchPercent = $('<span>').addClass('matchPercent');
|
var matchPercent = $('<span>').addClass('matchPercent');
|
||||||
this.forceLoadTexts.push(matchPercent);
|
this.forceLoadTexts.push(matchPercent);
|
||||||
matchPercent.appendTo(listItem);
|
matchPercent.appendTo(listItem);
|
||||||
|
var matchSuccess = $('<span>').addClass('matchSuccess');
|
||||||
|
this.matchSuccessText.push(matchSuccess);
|
||||||
|
matchSuccess.appendTo(listItem);
|
||||||
var forceButton = $('<button>').text('Force load?').hide();
|
var forceButton = $('<button>').text('Force load?').hide();
|
||||||
this.forceLoadButtons.push(forceButton);
|
this.forceLoadButtons.push(forceButton);
|
||||||
forceButton.appendTo(listItem);
|
forceButton.appendTo(listItem);
|
||||||
@@ -300,6 +304,10 @@ class PatchContainer {
|
|||||||
self.errorDiv.empty();
|
self.errorDiv.empty();
|
||||||
self.successDiv.empty();
|
self.successDiv.empty();
|
||||||
for (var i = 0; i < self.patchers.length; i++) {
|
for (var i = 0; i < self.patchers.length; i++) {
|
||||||
|
// reset text and buttons
|
||||||
|
self.forceLoadButtons[i].hide();
|
||||||
|
self.forceLoadTexts[i].text('');
|
||||||
|
self.matchSuccessText[i].text('');
|
||||||
var patcher = self.patchers[i];
|
var patcher = self.patchers[i];
|
||||||
// remove the previous UI to clear the page
|
// remove the previous UI to clear the page
|
||||||
patcher.destroyUI();
|
patcher.destroyUI();
|
||||||
@@ -310,6 +318,10 @@ class PatchContainer {
|
|||||||
if (patcher.validatePatches()) {
|
if (patcher.validatePatches()) {
|
||||||
found = true;
|
found = true;
|
||||||
loadPatch(this, self, patcher);
|
loadPatch(this, self, patcher);
|
||||||
|
// show patches matched for 100% - helps identify which version is loaded
|
||||||
|
var valid = patcher.validPatches;
|
||||||
|
var percent = (valid / patcher.totalPatches * 100).toFixed(1);
|
||||||
|
self.matchSuccessText[i].text(' ' + valid + ' of ' + patcher.totalPatches + ' patches matched (' + percent + '%) ');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user