From 5d44f5404ced40a3dc7c7ec6a184fd9d37c76035 Mon Sep 17 00:00:00 2001 From: Franck Alary Date: Fri, 26 Jul 2024 12:05:06 +0200 Subject: [PATCH] v1.4.3 - story player bug fix --- Makefile | 2 +- README.md | 8 ++++---- src/storyTeller/stories_reader.h | 20 +++++++++++++------- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index f7e87d9cf..0aba28e5e 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ ########################################################### TARGET=TelmiOS -VERSION=1.4.2 +VERSION=1.4.3 ########################################################### diff --git a/README.md b/README.md index 0cd7a5b9c..6ced06111 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![Total Download](https://img.shields.io/github/downloads/DantSu/Telmi-story-teller/total.svg) [![v1.4.2 download](https://img.shields.io/github/downloads/DantSu/Telmi-story-teller/1.4.2/total.svg)](https://github.com/DantSu/Telmi-story-teller/releases/tag/1.4.2) +![Total Download](https://img.shields.io/github/downloads/DantSu/Telmi-story-teller/total.svg) [![v1.4.3 download](https://img.shields.io/github/downloads/DantSu/Telmi-story-teller/1.4.3/total.svg)](https://github.com/DantSu/Telmi-story-teller/releases/tag/1.4.3)

Telmi OS splash screen

@@ -13,7 +13,7 @@ The story teller is compatible with stories exported from [STUdio](https://githu ### Download the installation files -- [Download the latest version of Telmi](https://github.com/DantSu/Telmi-story-teller/releases/download/1.4.2/TelmiOS_v1.4.2.zip) +- [Download the latest version of Telmi](https://github.com/DantSu/Telmi-story-teller/releases/download/1.4.3/TelmiOS_v1.4.3.zip) ### Format your SD card as FAT32 (not exFAT!) @@ -48,9 +48,9 @@ Make sure you choose: `For use with all systems and devices (FAT)` Chrome already has a tool to format an SD card. Insert the card into your Chromebook, right-click it and click **Format Device**, make sure `FAT32` is selected under **Format** and click or tap **Erase & Format**. -### Unzip TelmiOS_v1.4.2.zip +### Unzip TelmiOS_v1.4.3.zip -Put the content of `TelmiOS_v1.4.2.zip` at the root of the SD card. +Put the content of `TelmiOS_v1.4.3.zip` at the root of the SD card. ### Power on your Miyoo diff --git a/src/storyTeller/stories_reader.h b/src/storyTeller/stories_reader.h index 85a82f06d..901c92c60 100644 --- a/src/storyTeller/stories_reader.h +++ b/src/storyTeller/stories_reader.h @@ -481,6 +481,8 @@ void stories_readStage(void) { bool isAudioDefined = audioJson != NULL && cJSON_IsString(audioJson); if (!isAudioDefined && storyAutoplay) { + storyOkAction = false; + storyScreenEnabled = false; callback_stories_autoplay(); return; } @@ -540,11 +542,17 @@ void stories_readStage(void) { } } -void stories_readAction(void) { +void stories_readAction(int direction) { if (storiesCount == 0) { return; } + storyActionOptionIndex += direction; + + if(direction == 0) { + direction = 1; + } + cJSON *nodeAction = stories_getAction(); if (nodeAction == NULL) { return; @@ -570,7 +578,7 @@ void stories_readAction(void) { cJSON *option = cJSON_GetArrayItem(nodeAction, storyActionOptionIndex); if (option == NULL || (hasInventory && !stories_inventory_testNode(option))) { - ++storyActionOptionIndex; + storyActionOptionIndex += direction; continue; } @@ -597,7 +605,7 @@ void stories_loadAction(void) { storyActionOptionIndex = rand() % storyActionOptionsCount; } - stories_readAction(); + stories_readAction(0); } void stories_load(void) { @@ -812,8 +820,7 @@ void stories_next(void) { if (storyActionKey[0] == '\0') { stories_changeTitle(1); } else { - storyActionOptionIndex += 1; - stories_readAction(); + stories_readAction(1); } } } @@ -829,8 +836,7 @@ void stories_previous(void) { if (storyActionKey[0] == '\0') { stories_changeTitle(-1); } else { - storyActionOptionIndex -= 1; - stories_readAction(); + stories_readAction(-1); } } }