Skip to content
This repository was archived by the owner on Sep 16, 2025. It is now read-only.

Commit 365039f

Browse files
committed
Coins can now be added to the map as needed
Useful if something goes wrong and the game wasn't saved
1 parent baf80ef commit 365039f

File tree

3 files changed

+46
-22
lines changed

3 files changed

+46
-22
lines changed

VirtualGloomhavenBoard/Elm/src/BoardOverlay.elm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,8 +448,8 @@ getOverlayLabel overlay =
448448
String.fromInt i
449449
++ (case i of
450450
1 ->
451-
"Coin"
451+
" Coin"
452452

453453
_ ->
454-
"Coins"
454+
" Coins"
455455
)

VirtualGloomhavenBoard/Elm/src/Main.elm

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1380,6 +1380,20 @@ getNewPieceHtml gameMode currentDraggable hasDiviner bearSummoned nextSummonsId
13801380
)
13811381
)
13821382
)
1383+
|> Dom.appendChild
1384+
(Dom.element "li"
1385+
|> Dom.appendChild
1386+
(Tuple.second
1387+
(overlayToHtml
1388+
(BoardOverlayModel
1389+
gameMode
1390+
(getLabelForOverlay (BoardOverlay (Treasure (Coin 1)) Default [ ( 0, 0 ) ]) Nothing == currentDraggable)
1391+
Nothing
1392+
(BoardOverlay (Treasure (Coin 1)) Default [ ( 0, 0 ) ])
1393+
)
1394+
)
1395+
)
1396+
)
13831397
|> Dom.appendChild
13841398
(Dom.element "li"
13851399
|> Dom.appendChild
@@ -2582,6 +2596,13 @@ overlayToHtml model =
25822596
Trap _ ->
25832597
makeDraggable (OverlayType model.overlay Nothing) model.coords
25842598

2599+
Treasure (Coin _) ->
2600+
if model.gameMode == AddPiece && model.coords == Nothing then
2601+
makeDraggable (OverlayType model.overlay Nothing) model.coords
2602+
2603+
else
2604+
Dom.addAttribute (attribute "draggable" "false")
2605+
25852606
_ ->
25862607
Dom.addAttribute (attribute "draggable" "false")
25872608

VirtualGloomhavenBoard/wwwroot/scss/_board.scss

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,29 @@ $hexHeight: 90px;
4141
}
4242
}
4343

44+
.treasure
45+
{
46+
&[data-index]:after {
47+
content:attr(data-index);
48+
display:block;
49+
position:absolute;
50+
top: 10px;
51+
left: 0;
52+
width:100%;
53+
}
54+
55+
span {
56+
position: absolute;
57+
top: 24px;
58+
left: 0;
59+
font-size: 33px;
60+
text-shadow: 0px 0px 4px #fff;
61+
color: #353535;
62+
display: block;
63+
width: 100%;
64+
}
65+
}
66+
4467
.monster {
4568
span {
4669
position: absolute;
@@ -383,26 +406,6 @@ $tiles:
383406
left: 0;
384407
top: 0;
385408
}
386-
387-
&[data-index]:after {
388-
content:attr(data-index);
389-
display:block;
390-
position:absolute;
391-
top: 10px;
392-
left: 0;
393-
width:100%;
394-
}
395-
396-
span {
397-
position: absolute;
398-
top: 24px;
399-
left: 0;
400-
font-size: 33px;
401-
text-shadow: 0px 0px 4px #fff;
402-
color: #353535;
403-
display: block;
404-
width: 100%;
405-
}
406409
}
407410

408411
&.corridor + .treasure {

0 commit comments

Comments
 (0)