AndBM / helichrysum

http://abmichelsen.com/helichrysum/
GNU General Public License v3.0
0 stars 1 forks source link

Automate game state #9

Closed alexrutar closed 2 years ago

alexrutar commented 2 years ago

This WIP is to automate the creation of all the game state files.

alexrutar commented 2 years ago

TODO:

Basically, the required data should be something like a dict with keys that are the house colors, e.g.

"yellow": {
  "player": "Andreas",
  "name": "House of Dawn"
}
alexrutar commented 2 years ago

Also, it would be nice if the table of player images were responsive: i.e. display the images in a single column if the page is sufficiently narrow, and in 2 columns otherwise.

alexrutar commented 2 years ago

The suit order can now be changed. Is there a "canonical order"? Perhaps alphabetical, or perhaps the order presented on the board itself.

AndBM commented 2 years ago

The suit order can now be changed. Is there a "canonical order"? Perhaps alphabetical, or perhaps the order presented on the board itself.

There is a canonical order in the LUA files, but it doesn't really mean anything. I would actually prefer to change the order to the order on the board: Discord, Arcane, Order, Hearth, Beast, Nomad.

alexrutar commented 2 years ago

Also, what does the save.name variable mean? In the parser output.

AndBM commented 2 years ago

The save.name string is the chronicle name, in this case "The Helichrysum Chronicle"

alexrutar commented 2 years ago

Cool, I can render this into the state as well automatically.

AndBM commented 2 years ago

It already is, in default.html, the element with id "name".

alexrutar commented 2 years ago

That element no longer seems to exist? I must have deleted it somewhere, and I cannot remember when. It's missing already in the main branch.

Anyway I added it back now. Also, I realized it's possible to access site variables directly from the JS at render-time! This means all the configuration files don't need to be in game_state.js and can instead be put directly into _config.yml. This is really convenient from a packaging / organizational perspective.

Edit: I've realized this is a bad idea - see #11 for the proper way to do this.

alexrutar commented 2 years ago

Alright all done now! The code is fully running - just the calls to render the player table is hard-coded. I'll leave it to you to edit this to get the correct calls out of the savestring.