Une version rudimentaire de Slay The Spire dans le terminal - retour accueil
git clone git://bebou.netlib.re/sts-term
Log | Files | Refs | README |
commit 03d5578e136c3bbb5e1e7a0882e109c6c493ccdc parent f135c08227d335ad1d05b3abe1c2c85e05560d3b Auterice: Arthur Pons <arthur.pons@unistra.fr> Date: Wed, 19 Jun 2024 21:18:23 +0200 Rafraichissement UI inutiles, meilleures perfs Diffstat:
M | utils | | | 8 | +++----- |
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/utils b/utils @@ -11,6 +11,9 @@ grayed="\x1b[90m" norm="\x1b[0m" _makeui() { + # Pour savoir combien de fois l'ui est rafraichie + # Clairement pas optimal mais drĂ´le + # ffplay -nodisp -autoexit -loglevel panic -f lavfi -i "sine=440:d=0.1" [ ! -e "player" ] && printf "No current game\n" currentenergy=$(grep energy fight/player | cut -f2) @@ -99,7 +102,6 @@ _setstat() { else sed -i --follow-symlinks -E "/$stat/ s/ .*/ $value/" "$target" fi - _refreshUI } _gameover() { @@ -187,7 +189,6 @@ _draw() { chmod +x "$card" mv "$card" fight/hand _updatecardexecutability - _refreshUI done } @@ -203,7 +204,6 @@ _discard() { card="$1" chmod -x "$card" mv "$card" fight/discard - _refreshUI } #playcard() { @@ -232,10 +232,8 @@ _nextmove() { <<-. cat > $tmpdir/executablenextmove . ./utils $(< $tmpdir/nextmove sed -E '/attack/ s/$/ fight\/player/;/defend/ s,$, fight/ennemies/*,') - _refreshUI . chmod +x $tmpdir/executablenextmove - _refreshUI } _execnextmove() {