Skip to content

Commit

Permalink
theming
Browse files Browse the repository at this point in the history
  • Loading branch information
Pomax committed Jun 25, 2021
1 parent 1a5e526 commit 4dac95c
Show file tree
Hide file tree
Showing 10 changed files with 375 additions and 61 deletions.
32 changes: 20 additions & 12 deletions ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
Hi, and thank you for caring about the game enough to click the "new issue" button because you wanted to report a bug, or have some feedback!
# A note before you write your issue

If you have some feedback, then just start typing away and we can start a conversation (long or short, depending on what's necessary, of couse), but if you think you found a bug, there are some extra steps required, because in order to track down your bug I'll need to try to recreate the game as it was when you into the bug so:
Hello and thank you for caring about the game enough to click the "new issue" button because you wanted to report a bug, or have some feedback!

If you have some feedback, then just start typing away and we can start a conversation (long or short, depending on what's necessary, of couse), but if you think you found a bug, there are some extra steps required, because in order to track down your bug I'll need to try to recreate the game as it was when you into the bug

## Describing "Steps to Reproduce"

Try to describe your bug in steps:

1. what was the game situation,
2. what did you want to do,
3. what thing, or sequence of things, did you do in order to achieve that
4. what happened instead?
1. what was the game situation (text or screenshots, as long as there's enough details),
2. what did you want to do (because I may have made different assmumptions about interaction, and I might not have thought to associated what you did with what you _wanted_ to do =),
3. what thing, or sequence of things, did you do in order to achieve that, and
4. what did you observe happened instead? (again, text and/or screenshots, and there is no such thing as being "too detailed" when describing this)

Of course, sometimes a bug can be because the computer players did something unexpected:

Of course, sometimes a bug can be because the computer did something unexpected:
1. what was the game situation,
2. what happened that was perfectly normal,
3. what then happened that seemed strange, or even wrong?
4. what would you have expected to have happen instead? (and "nothing special" is a perfectly valid expectation!)

## Making sure there's enough detail for me to hunt down the problem

1. what was the game situation
2. what happened that was perfectly normal
3. what then happened that was strange, or even wrong?
4. what would you have expected to have happen insead? (and "nothing special" is a perfectly valid expectation!)

If you have screenshots, those help a lot, and if you're a bit of a developer yourself, or you know what "the dev console" is and you've used it before, you might even consider playing with the `debug` flag turned on in the game settings, which will allow you to paste gameplay information in your bug reports.

## And thank you for filing an issue

Thank you for your interest in the game, and hopefully together we can make it even better!
Binary file added img/tiles/tileset.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
97 changes: 48 additions & 49 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,53 @@
<link rel="stylesheet" href="src/css/players.css" />
<link rel="stylesheet" href="src/css/tracking.css" />
<link rel="stylesheet" href="src/css/animations.css" />

<script src="src/js/core/utils/math.js" defer></script>
<script src="src/js/core/utils/prng.js" defer></script>
<script src="src/js/core/utils/logger.js" defer></script>
<script src="src/config.js" defer></script>
<script src="src/js/core/game/game-tile.js" defer></script>
<script src="src/js/page/virtual-keys.js" defer></script>
<script src="src/js/core/utils/task-timer.js" defer></script>
<script src="src/js/core/utils/utils.js" defer></script>

<script src="src/js/page/audio.js" defer></script>
<script src="src/js/page/modal/options-dialog.js" defer></script>
<script src="src/js/page/modal/settings.js" defer></script>
<script src="src/js/page/modal/theming.js" defer></script>
<script src="src/js/page/modal/scores.js" defer></script>
<script src="src/js/page/modal/modal.js" defer></script>

<script src="src/js/core/game/wall/wall.js" defer></script>
<script src="src/js/core/game/wall/wall-hack.js" defer></script>

<script src="src/js/core/players/tracking/tile-tracker.js" defer></script>
<script src="src/js/core/players/ui/client-ui-master.js" defer></script>
<script src="src/js/core/players/ui/client-ui.js" defer></script>
<script src="src/js/core/players/ui/windicator.js" defer></script>
<script src="src/js/core/players/player-master.js" defer></script>
<script src="src/js/core/players/player.js" defer></script>
<script src="src/js/core/players/personality/stats.js" defer></script>
<script src="src/js/core/players/personality/personality.js" defer></script>
<script src="src/js/core/players/bot.js" defer></script>
<script src="src/js/core/players/human.js" defer></script>

<script src="src/js/core/algorithm/hash-printing.js" defer></script>
<script src="src/js/core/algorithm/pattern-set.js" defer></script>
<script src="src/js/core/algorithm/pattern.js" defer></script>
<script src="src/js/core/algorithm/tiles-needed.js" defer></script>

<script src="src/js/core/scoring/limit-hands.js" defer></script>
<script src="src/js/core/scoring/faan-laak-table.js" defer></script>
<script src="src/js/core/scoring/ruleset.js" defer></script>
<script src="src/js/core/scoring/cantonese.js" defer></script>
<script src="src/js/core/scoring/chinese-classical.js" defer></script>

<script src="src/js/core/game/game.js" defer></script>
<script src="src/js/core/game/game-manager.js" defer></script>

<!-- twitter the sparrows! -->
<script src="src/js/page/play-or-watch.js" defer></script>
</head>

<body>
Expand All @@ -35,6 +82,7 @@

<div class="corner wall data"></div>
<div class="corner settings">settings...</div>
<div class="corner theming">theme</div>
<div class="discards"></div>
<div class="sidebar">
<div class="knowledge"></div>
Expand Down Expand Up @@ -650,54 +698,5 @@ <h3>Keyboard controls</h3>
</ul>

</section>

<section id="scripts" class="hidden">
<script src="src/js/core/utils/math.js"></script>
<script src="src/js/core/utils/prng.js"></script>
<script src="src/js/core/utils/logger.js"></script>
<script src="src/config.js"></script>
<script src="src/js/core/game/game-tile.js"></script>
<script src="src/js/page/virtual-keys.js"></script>
<script src="src/js/core/utils/task-timer.js"></script>
<script src="src/js/core/utils/utils.js"></script>

<script src="src/js/page/audio.js"></script>
<script src="src/js/page/modal/options-dialog.js"></script>
<script src="src/js/page/modal/settings.js"></script>
<script src="src/js/page/modal/scores.js"></script>
<script src="src/js/page/modal/modal.js"></script>

<script src="src/js/core/game/wall/wall.js"></script>
<script src="src/js/core/game/wall/wall-hack.js"></script>

<script src="src/js/core/players/tracking/tile-tracker.js"></script>
<script src="src/js/core/players/ui/client-ui-master.js"></script>
<script src="src/js/core/players/ui/client-ui.js"></script>
<script src="src/js/core/players/ui/windicator.js"></script>
<script src="src/js/core/players/player-master.js"></script>
<script src="src/js/core/players/player.js"></script>
<script src="src/js/core/players/personality/stats.js"></script>
<script src="src/js/core/players/personality/personality.js"></script>
<script src="src/js/core/players/bot.js"></script>
<script src="src/js/core/players/human.js"></script>

<script src="src/js/core/algorithm/hash-printing.js"></script>
<script src="src/js/core/algorithm/pattern-set.js"></script>
<script src="src/js/core/algorithm/pattern.js"></script>
<script src="src/js/core/algorithm/tiles-needed.js"></script>

<script src="src/js/core/scoring/limit-hands.js"></script>
<script src="src/js/core/scoring/faan-laak-table.js"></script>
<script src="src/js/core/scoring/ruleset.js"></script>
<script src="src/js/core/scoring/cantonese.js"></script>
<script src="src/js/core/scoring/chinese-classical.js"></script>

<script src="src/js/core/game/game.js"></script>
<script src="src/js/core/game/game-manager.js"></script>

<!-- twitter the sparrows! -->
<script src="src/js/page/play-or-watch.js"></script>
</section>

</body>
</html>
13 changes: 13 additions & 0 deletions src/css/board.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
width: 7.5rem;
z-index: 10;
color: gold;
--sc: var(--prp);
text-shadow:
-1px -1px 0 var(--sc),
1px -1px 0 var(--sc),
-1px 1px 0 var(--sc),
1px 1px 0 var(--sc);
font-family: verdana;
font-weight: bold;
font-size: 0.8rem;
Expand All @@ -37,4 +43,11 @@
color: silver;
left: 2rem;
bottom: calc(var(--ph) * 1.5);
}

.board .corner.theming {
cursor: pointer;
color: silver;
right: 5rem;
bottom: calc(var(--ph) * 1.5);
}
8 changes: 8 additions & 0 deletions src/css/modal.css
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@
height: 2em;
}

.modal .settings input[type=button] {
border: 1px solid gray;
border-radius: 5px;
font-size: 0.8rem;
width: 100%;
background: #E9E9ED;
}

.modal .panel table {
width: 95%;
margin: auto;
Expand Down
6 changes: 6 additions & 0 deletions src/css/windicator.css
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@
.windicator .hand-counter {
height: 1em;
color: gold;
--sc: var(--prp);
text-shadow:
-1px -1px 0 var(--sc),
1px -1px 0 var(--sc),
-1px 1px 0 var(--sc),
1px 1px 0 var(--sc);
position: absolute;
z-index: 100;
top: calc(calc(var(--wotr-dim) / 2) - 1.9em);
Expand Down
2 changes: 2 additions & 0 deletions src/js/core/players/ui/client-ui-master.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class ClientUIMaster {
this.playerbanks = document.querySelectorAll(`.player`);
this.knowledge = document.querySelector(`.knowledge`);
this.settings = document.querySelector(`.settings`);
this.theming = document.querySelector(`.theming`);

this.gameBoard = document.querySelector(`.board`);
if (config.PAUSE_ON_BLUR) {
Expand All @@ -37,6 +38,7 @@ class ClientUIMaster {
}

this.settings.addEventListener(`click`, () => modal.pickPlaySettings());
this.theming.addEventListener(`click`, () => modal.pickTheming());

this.el = this.playerbanks[this.id];
this.reset(0,0);
Expand Down
9 changes: 9 additions & 0 deletions src/js/page/modal/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class Modal {
this.panels = [];
this.choice = new OptionsDialog(this);
this.settings = new SettingsModal(this);
this.theming = new ThemeModal(this);
this.scores = new ScoreModal(this);
}

Expand Down Expand Up @@ -133,6 +134,14 @@ class Modal {
this.reveal()
this.settings.show();
}

/**
* Show theming options for the game
*/
pickTheming() {
this.reveal();
this.theming.show();
}
}

let modal = new Modal();
Expand Down
Loading

0 comments on commit 4dac95c

Please sign in to comment.