Skip to content
This repository was archived by the owner on Mar 19, 2024. It is now read-only.

Commit 3a6a824

Browse files
committed
Update UI & fix bugs
1 parent e21e46f commit 3a6a824

File tree

3 files changed

+43
-22
lines changed

3 files changed

+43
-22
lines changed

assets/css/reqwey.min.css

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ svg {
297297
height: 100px;
298298
}
299299
.reqmessageboard .ui.segment {
300-
z-index: 101;
300+
z-index: 102;
301301
min-width: 250px;
302302
height: 100px;
303303
overflow-y: auto;
@@ -307,7 +307,7 @@ svg {
307307
font-family: fwzc;
308308
position: absolute;
309309
bottom: 0;
310-
z-index: 102;
310+
z-index: 103;
311311
font-size: 1em;
312312
width: 100%;
313313
margin: 0;
@@ -590,12 +590,7 @@ blockquote {
590590
table-layout: fixed;
591591
}
592592

593-
#game-map tr {
594-
z-index: 10;
595-
}
596-
597593
#game-map td {
598-
z-index: 11;
599594
position: relative;
600595
border: 1px solid black;
601596
width: 30px;
@@ -610,7 +605,6 @@ blockquote {
610605
text-shadow: 0 0 2px black;
611606
opacity: 1;
612607
padding: 0;
613-
overflow: hidden;
614608
text-overflow: ellipsis;
615609
white-space: nowrap;
616610
font-size: 8px;
@@ -619,33 +613,40 @@ blockquote {
619613

620614
#game-map td.selected {
621615
position: relative;
622-
z-index: 20;
623616
border: 1px solid white;
624617
}
625618

626619
#game-map td.queue_up::before {
627620
z-index: 30;
628621
position: absolute;
629-
top: -10px;
622+
top: -18px;
623+
left: 6px;
630624
content: '↑';
625+
font-size: 1.2rem;
631626
}
632627
#game-map td.queue_right::before {
633628
z-index: 30;
634629
position: absolute;
635-
right: -10px;
630+
top: -1.5px;
631+
right: -9px;
636632
content: '→';
633+
font-size: 1.2rem;
637634
}
638635
#game-map td.queue_down::before {
639636
z-index: 30;
640637
position: absolute;
641-
bottom: -10px;
638+
bottom: -20px;
639+
left: 6px;
642640
content: '↓';
641+
font-size: 1.2rem;
643642
}
644643
#game-map td.queue_left::before {
645644
z-index: 30;
646645
position: absolute;
647-
left: -10px;
646+
left: -9px;
647+
top: -1.5px;
648648
content: '←';
649+
font-size: 1.2rem;
649650
}
650651

651652
#game-map td.selected:hover {
@@ -654,7 +655,6 @@ blockquote {
654655

655656
#game-map td.attackable {
656657
position: relative;
657-
z-index: 20;
658658
opacity: .4;
659659
}
660660

main.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,9 @@ async function createWindow() {
230230
},
231231
{
232232
label: 'Force Reflush',
233-
role: 'forceReload'
233+
click: () => {
234+
mainWindow.loadFile('index.html')
235+
}
234236
},
235237
{
236238
label: 'Toggle DevTools',

renderer.js

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ function gameJoin(username) {
214214
Swal.fire({
215215
title: title,
216216
text: message,
217-
icon: error,
217+
icon: 'error',
218218
showDenyButton: false,
219219
showCancelButton: false,
220220
allowOutsideClick: false,
@@ -386,8 +386,16 @@ function gameJoin(username) {
386386
socket.emit('player_message', message)
387387
$(this).val('')
388388
}
389-
else
390-
$.toast({ class: 'error', message: `Invalid input!` });
389+
else {
390+
Swal.fire({
391+
icon: 'error',
392+
title: 'Error',
393+
text: 'Invalid input!',
394+
toast: true,
395+
position: 'bottom-start',
396+
timer: 3000
397+
})
398+
}
391399
}
392400
})
393401
$('.reqforcestartemitor').bind('click', function () {
@@ -452,11 +460,13 @@ function gameJoin(username) {
452460
})
453461

454462
socket.on('error', (title, message) => {
455-
$.toast({
456-
position: 'bottom attached',
457-
class: 'error',
463+
Swal.fire({
464+
icon: 'error',
458465
title: title,
459-
message: message
466+
text: message,
467+
toast: true,
468+
position: 'bottom-start',
469+
timer: 3000
460470
})
461471
socket.emit('get_game_settings')
462472
})
@@ -562,13 +572,16 @@ function gameJoin(username) {
562572
</div>`)
563573
window.turn = 1
564574
window.queue = new Queue()
575+
// let appContainer = document.getElementById('reqAppContainer')
565576
$(document).bind('keydown', (event) => {
577+
// var leftDist = appContainer.offsetLeft, topDist = appContainer.offsetTop
566578
if (!window.selectedTd) return
567579
if (event.which === 69) {
568580
window.queue.pop_back()
569581
} else if (event.which === 81) {
570582
window.queue.clear()
571583
} else if (event.which === 65 || event.which === 37) { // Left
584+
// leftDist += 7;
572585
let newPoint = { x: window.selectedTd.x, y: window.selectedTd.y - 1 }
573586
console.log('keydown LEFT', newPoint)
574587
if (withinMap(newPoint)) {
@@ -579,6 +592,7 @@ function gameJoin(username) {
579592
window.selectedTd = newPoint
580593
}
581594
} else if (event.which === 87 || event.which === 38) { // Up
595+
// topDist += 7;
582596
let newPoint = { x: window.selectedTd.x - 1, y: window.selectedTd.y }
583597
console.log('keydown UP', newPoint)
584598
if (withinMap(newPoint)) {
@@ -589,6 +603,7 @@ function gameJoin(username) {
589603
window.selectedTd = newPoint
590604
}
591605
} else if (event.which === 68 || event.which === 39) { // Right
606+
// leftDist -= 7;
592607
let newPoint = { x: window.selectedTd.x, y: window.selectedTd.y + 1 }
593608
console.log('keydown RIGHT', newPoint)
594609
if (withinMap(newPoint)) {
@@ -599,6 +614,7 @@ function gameJoin(username) {
599614
window.selectedTd = newPoint
600615
}
601616
} else if (event.which === 83 || event.which === 40) { // Down
617+
// topDist -= 7;
602618
let newPoint = { x: window.selectedTd.x + 1, y: window.selectedTd.y }
603619
console.log('keydown DOWN', newPoint)
604620
if (withinMap(newPoint)) {
@@ -609,6 +625,9 @@ function gameJoin(username) {
609625
window.selectedTd = newPoint
610626
}
611627
}
628+
629+
// appContainer.style.left = leftDist + 'px';
630+
// appContainer.style.top = topDist + 'px';
612631
})
613632
})
614633

0 commit comments

Comments
 (0)