Skip to content

Commit

Permalink
v1.4.3 - story player bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DantSu committed Jul 26, 2024
1 parent 352b813 commit 5d44f54
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
###########################################################

TARGET=TelmiOS
VERSION=1.4.2
VERSION=1.4.3

###########################################################

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)

<p align="center"><img src="https://dantsu.com/files/Telmi_1280.png" alt="Telmi OS splash screen" /></p>

Expand All @@ -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!)

Expand Down Expand Up @@ -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

Expand Down
20 changes: 13 additions & 7 deletions src/storyTeller/stories_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand All @@ -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;
}

Expand All @@ -597,7 +605,7 @@ void stories_loadAction(void) {
storyActionOptionIndex = rand() % storyActionOptionsCount;
}

stories_readAction();
stories_readAction(0);
}

void stories_load(void) {
Expand Down Expand Up @@ -812,8 +820,7 @@ void stories_next(void) {
if (storyActionKey[0] == '\0') {
stories_changeTitle(1);
} else {
storyActionOptionIndex += 1;
stories_readAction();
stories_readAction(1);
}
}
}
Expand All @@ -829,8 +836,7 @@ void stories_previous(void) {
if (storyActionKey[0] == '\0') {
stories_changeTitle(-1);
} else {
storyActionOptionIndex -= 1;
stories_readAction();
stories_readAction(-1);
}
}
}
Expand Down

0 comments on commit 5d44f54

Please sign in to comment.