diff --git a/onefile/data/shisen/shisen.desktop b/onefile/data/shisen/shisen.desktop new file mode 100644 index 0000000..6a7e9dd --- /dev/null +++ b/onefile/data/shisen/shisen.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Version=1.0 +Name=Shisen-Sho Armenian +GenericName=Shisen-Sho Armenian Alphabet +Path=/some/path +Exec=/some/path/shisen +Icon=/some/path/data/shisen/shisen.png +Terminal=false +Type=Application +Categories=Game;BoardGame; diff --git a/onefile/data/shisen/shisen.png b/onefile/data/shisen/shisen.png new file mode 100644 index 0000000..cb9a17f Binary files /dev/null and b/onefile/data/shisen/shisen.png differ diff --git a/onefile/shisen.c b/onefile/shisen.c index a784f44..fa7fb55 100644 --- a/onefile/shisen.c +++ b/onefile/shisen.c @@ -57,6 +57,7 @@ int tracksCount; Animation bgtex; int glyphsMask = 0; int mode; +int mute; double exitTm; @@ -408,6 +409,8 @@ void draw() { text(-0.2*cellWidth, -0.2*cellHeight, "back"); textAlign(HALIGN_LEFT, VALIGN_TOP); text((COLS + 0.2)*cellWidth, (ROWS + 0.2)*cellHeight, "hint"); + textAlign(HALIGN_LEFT, VALIGN_BOTTOM); + text((COLS + 0.2)*cellWidth, -0.2*cellHeight, mute ? "silence" : "sound"); restoreState(); double mx = mouseTransformedX(); @@ -423,7 +426,7 @@ void draw() { if (mouseWentDown("left")) { Letter *l = get(hover); - if (l && l->soundsCount) + if (l && l->soundsCount && !mute) soundPlay( l->sounds[ randomNumber(0, l->soundsCount-1) ], FALSE ); Track t = findTrack(selected, hover); @@ -439,9 +442,12 @@ void draw() { if (hover.r == selected.r && hover.c == selected.c) selected.r = selected.c = -1; else - if ( !(hover.r < 0 && hover.c < 0) // ignore hint or exit pressing - && !(hover.r >= ROWS && hover.c >= COLS) ) + if ( !(hover.r < 0 && hover.c < 0) // ignore hint, sound or exit pressing + && !(hover.r >= ROWS && hover.c >= COLS) + && !(hover.r < 0 && hover.c >= COLS) ) selected = hover; + + if (hover.r < 0 && hover.c >= COLS) mute = !mute; } Letter *hl = mouseDown("right") ? get(hover) : NULL;