Skip to content

Commit 3aeee09

Browse files
authored
Merge pull request #21 from TheOtterlord/fix-combowidget
Fix combowidget
2 parents 6987ffa + 2f0854e commit 3aeee09

File tree

5 files changed

+63
-44
lines changed

5 files changed

+63
-44
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88

9+
## 0.8.1 Alpha
10+
11+
The combo widget hover/preview has been removed as it is incompatible with the new card preview.
12+
I plan to reimplement this when I revisit the combo system.
13+
14+
### Removed
15+
16+
- Combo Widget Preview
17+
918
## 0.8.0 Alpha
1019

1120
### Added

index.html

Lines changed: 37 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,8 @@ <h2 style="padding: 4px;">Filter</h2>
321321
<br><br>
322322
</div>
323323
</div>
324-
<button class="ir-button ir-maxwidth" style="background: var(--background);" onclick="toggleFilter(`close`)">Close</button>
324+
<button class="ir-button ir-maxwidth" style="background: var(--background);"
325+
onclick="toggleFilter(`close`)">Close</button>
325326
</div>
326327
</div>
327328

@@ -343,7 +344,8 @@ <h2 class="collapse-btn" onclick="toggleCollapse(this)">Arrays</h2>
343344
<div class="collapse" style="padding:0;">
344345
<div id="arrays"></div>
345346
<div class="ir-margin">
346-
<input class="ir-input ir-maxwidth" id="array-name" placeholder="Name of array" onkeypress="if (event.which == 13) combo_editor.addArray();" spellcheck="false">
347+
<input class="ir-input ir-maxwidth" id="array-name" placeholder="Name of array"
348+
onkeypress="if (event.which == 13) combo_editor.addArray();" spellcheck="false">
347349
<button class="ir-button ir-maxwidth" onclick="combo_editor.addArray()">+ Add array</button>
348350
</div>
349351
</div>
@@ -361,7 +363,8 @@ <h2 class="collapse-btn" onclick="toggleCollapse(this)">Combos</h2>
361363
<div class="ir-margin">
362364
<h6 style="margin:0;color:#f44;">
363365
This feature is experimental.
364-
Please report any bugs and send your feedback to <a style="color:#68f" href="https://github.com/TheOtterlord/deckmaster/issues">GitHub</a>.
366+
Please report any bugs and send your feedback to <a style="color:#68f"
367+
href="https://github.com/TheOtterlord/deckmaster/issues">GitHub</a>.
365368
</h6>
366369
</div>
367370
</div>
@@ -370,8 +373,12 @@ <h6 style="margin:0;color:#f44;">
370373
<div class="col" style="width: 25%;">
371374
<div class="ir-margin">
372375
<h6 style="margin:0;color:#888;">Changes will be reflected on save</h6>
373-
<input class="ir-input ir-maxwidth" id="combo-name" placeholder="Combo Name" oninput="combo_editor.data.combos[combo_editor.currentCombo].name = this.value" spellcheck="false">
374-
<textarea style="font-family: sans-serif;resize: vertical;height: 200px;" class="ir-input ir-maxwidth" id="combo-desc" placeholder="Combo Description" oninput="combo_editor.data.combos[combo_editor.currentCombo].desc = this.value" spellcheck="false"></textarea>
376+
<input class="ir-input ir-maxwidth" id="combo-name" placeholder="Combo Name"
377+
oninput="combo_editor.data.combos[combo_editor.currentCombo].name = this.value" spellcheck="false">
378+
<textarea style="font-family: sans-serif;resize: vertical;height: 200px;" class="ir-input ir-maxwidth"
379+
id="combo-desc" placeholder="Combo Description"
380+
oninput="combo_editor.data.combos[combo_editor.currentCombo].desc = this.value"
381+
spellcheck="false"></textarea>
375382
<select id="combo-turn" onchange="combo_editor.data.combos[combo_editor.currentCombo].turn = this.value;">
376383
<option value="first">First</option>
377384
<option value="second">Second</option>
@@ -387,12 +394,16 @@ <h6 style="margin:0;color:#888;">Changes will be reflected on save</h6>
387394
<div id="variant-tests" class="array-list"></div>
388395
<div style="position: relative;">
389396
<div class="suggestions"></div>
390-
<input class="ir-input ir-maxwidth" id="variant-query" oninput="suggest(this);combo_editor.validateTestQuery();inputPreview(this)" placeholder="YCB Query" spellcheck="false">
397+
<input class="ir-input ir-maxwidth" id="variant-query"
398+
oninput="suggest(this);combo_editor.validateTestQuery();inputPreview(this)" placeholder="YCB Query"
399+
spellcheck="false">
391400
</div>
392401
<h6 class="ir-hint-text" style="margin-bottom:6px;"></h6>
393402
<div class="ir-flex-row">
394-
<input class="ir-flex ir-input" style="margin:2px;float:left;width:50%" id="variant-min" onkeyup="" placeholder="Min" type="number" min="0">
395-
<input class="ir-flex ir-input" style="margin:2px;float:left;width:50%" id="variant-max" onkeyup="" placeholder="Max" type="number" min="0">
403+
<input class="ir-flex ir-input" style="margin:2px;float:left;width:50%" id="variant-min" onkeyup=""
404+
placeholder="Min" type="number" min="0">
405+
<input class="ir-flex ir-input" style="margin:2px;float:left;width:50%" id="variant-max" onkeyup=""
406+
placeholder="Max" type="number" min="0">
396407
</div>
397408
<br>
398409
<select id="variant-target">
@@ -417,7 +428,9 @@ <h2 style="color:#666">arrays.<span style="color:#fff" id="display-array-name"><
417428
<br>
418429
<div style="position:relative;">
419430
<div class="suggestions"></div>
420-
<input class="ir-input ir-maxwidth" id="array-itemname" oninput="suggest(this)" onkeyup="if (event.which == 13) combo_editor.addArrayItem();else {combo_editor.validateArrayItem();inputPreview(this)}" placeholder="YCB Query" spellcheck="false">
431+
<input class="ir-input ir-maxwidth" id="array-itemname" oninput="suggest(this)"
432+
onkeyup="if (event.which == 13) combo_editor.addArrayItem();else {combo_editor.validateArrayItem();inputPreview(this)}"
433+
placeholder="YCB Query" spellcheck="false">
421434
</div>
422435
<h6 class="ir-hint-text"></h6>
423436
<button class="ir-button ir-maxwidth" onclick="combo_editor.addArrayItem()">Add Item</button>
@@ -447,7 +460,8 @@ <h6 class="ir-hint-text"></h6>
447460
</select>
448461
</div>
449462
<div class="ir-flex-row">
450-
<textarea class="ir-input ir-maxwidth user_css" style="font-family: sans-serif;resize: vertical;height: 200px;" placeholder="Add custom CSS..." spellcheck="false" oninput="setCSS(this.value)"></textarea>
463+
<textarea class="ir-input ir-maxwidth user_css" style="font-family: sans-serif;resize: vertical;height: 200px;"
464+
placeholder="Add custom CSS..." spellcheck="false" oninput="setCSS(this.value)"></textarea>
451465
</div>
452466
</div>
453467
<div class="tab" id="Keybindings">
@@ -487,7 +501,7 @@ <h6 class="ir-hint-text"></h6>
487501
</div>
488502
<div class="tab" id="About">
489503
<h2>About</h2>
490-
<p>Version: 0.8.0</p>
504+
<p>Version: 0.8.1</p>
491505
<p>Author: Reuben Tier (AKA TheOtterlord)</p>
492506
<p>Website: <a href="https://theotterlord.github.io/deckmaster"
493507
target="_blank">https://theotterlord.github.io/deckmaster</a></p>
@@ -521,21 +535,14 @@ <h2>Welcome</h2>
521535
<div class="changelog" style="padding: 16px;">
522536
<h2>What's new in <span class="version"></span></h2>
523537
<div>
524-
<p>This update improves the overall UI adding themes &amp; custom css while also adding autocomplete for YCB card ids.</p>
525-
<h3 id="added">Added</h3>
538+
<p>The combo widget hover/preview has been removed as it is incompatible with the new card preview.
539+
I plan to reimplement this when I revisit the combo system.</p>
540+
<h3 id="removed">Removed</h3>
526541
<ul>
527-
<li>A theme system with a few different themes</li>
528-
<li>Custom css that can be changed in settings</li>
529-
<li>Autocomplete for YCB card ids</li>
530-
<li>Discord connect &amp; disconnect notifications</li>
531-
<li>New notifications API with better animations</li>
542+
<li>Combo Widget Preview</li>
532543
</ul>
533-
<h3 id="changed">Changed</h3>
534-
<ul>
535-
<li>Upgraded electron to 11.2.1 minimum</li>
536-
<li>Updated the start screen UI (now only displays the name of the file, not the path)</li>
537-
</ul>
538-
<p><a href="https://github.com/TheOtterlord/deckmaster/blob/main/CHANGELOG.md" target="_blank">Full Changelog</a></p>
544+
<p><a href="https://github.com/TheOtterlord/deckmaster/blob/main/CHANGELOG.md" target="_blank">Full Changelog</a>
545+
</p>
539546
</div>
540547
<div class="ir-flex-row">
541548
<button class="ir-flex ir-button" onclick="closeChangelog()">Close Changelog</button>
@@ -546,13 +553,16 @@ <h3 id="changed">Changed</h3>
546553

547554
<div class="logs">
548555
<pre class="ir-code">Error Logs - DeckMaster Render Process</pre>
549-
<button onclick="clipboard.writeText(this.previousElementSibling.innerHTML);notify('Copied to clipboard',2000)">Copy logs</button>
550-
<button onclick="deckmaster.link('https://github.com/TheOtterlord/deckmaster/issues/new?body=**Explain problem below**%0A%0A```%0A'+this.previousElementSibling.previousElementSibling.innerHTML.replaceAll('\n', '%0A')+'%0A```')">Report on GitHub</button>
556+
<button onclick="clipboard.writeText(this.previousElementSibling.innerHTML);notify('Copied to clipboard',2000)">Copy
557+
logs</button>
558+
<button
559+
onclick="deckmaster.link('https://github.com/TheOtterlord/deckmaster/issues/new?body=**Explain problem below**%0A%0A```%0A'+this.previousElementSibling.previousElementSibling.innerHTML.replaceAll('\n', '%0A')+'%0A```')">Report
560+
on GitHub</button>
551561
<button onclick="deckmaster.link('https://discord.gg/7kq56nhx9P')">Report on Discord</button>
552562
<button onclick="this.parentElement.style.display = 'none'">Close</button>
553563
</div>
554564

555565
<div class="fade-bg hide" onclick="close_settings();closeChangelog()"></div>
556566
</body>
557567

558-
</html>
568+
</html>

js/api.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const { dialog } = require('electron').remote;
22
const paths = require('path');
33

44
const deckmaster = {
5-
version: "v0.8.0",
5+
version: "v0.8.1",
66
notification: (title, text, onclick) => {
77
const notification = new Notification(title, {
88
body: text

js/combowidget.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,21 @@ function displayComboMod(i) {
1818
}
1919

2020
function displayCombo(i, i2) {
21-
var combo = combos[i].combos[i2];
22-
var img = document.querySelector(".preview .img img");
23-
img.src = DEFAULT_IMG;
24-
var text = document.querySelector(".preview .cardtext");
25-
text.innerHTML = "";
26-
text.innerHTML += `<h4>${combo.name}</h4>`;
27-
text.innerHTML += `<p>${combo.desc}</p>`;
28-
text.innerHTML += "<b>Raw Values</b>";
29-
text.innerHTML += "<ul>";
30-
for (let i = 0; i < combo.variants.length; i++) {
31-
var variant = combo.variants[i];
32-
text.innerHTML += `<li>Test ${i + 1}: ${variant.exact.toFixed(3)}%</li>`;
33-
}
34-
text.innerHTML += "</ul>";
35-
text.innerHTML += `<p>Total Chance: ${combo.exact.toFixed(3)}%</p>`;
21+
// var combo = combos[i].combos[i2];
22+
// var img = document.querySelector(".preview .img img");
23+
// img.src = DEFAULT_IMG;
24+
// var text = document.querySelector(".preview .cardtext");
25+
// text.innerHTML = "";
26+
// text.innerHTML += `<h4>${combo.name}</h4>`;
27+
// text.innerHTML += `<p>${combo.desc}</p>`;
28+
// text.innerHTML += "<b>Raw Values</b>";
29+
// text.innerHTML += "<ul>";
30+
// for (let i = 0; i < combo.variants.length; i++) {
31+
// var variant = combo.variants[i];
32+
// text.innerHTML += `<li>Test ${i + 1}: ${variant.exact.toFixed(3)}%</li>`;
33+
// }
34+
// text.innerHTML += "</ul>";
35+
// text.innerHTML += `<p>Total Chance: ${combo.exact.toFixed(3)}%</p>`;
3636
}
3737

3838
function addComboMod() {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "deckmaster",
3-
"version": "0.8.0",
3+
"version": "0.8.1",
44
"description": "A Yu-Gi-Oh! TCG deck editor",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)