Skip to content

Commit

Permalink
docs fixes again
Browse files Browse the repository at this point in the history
  • Loading branch information
Joalor64GH authored Nov 18, 2024
1 parent 0565b00 commit e862326
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 9 deletions.
4 changes: 2 additions & 2 deletions docs/Adding-a-New-Achievement.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ import('backend.Achievements');
var condition:Bool = false;
function update(elapsed:Float) {
if (PlayState.instance.score > 9000)
if (PlayState.instance.score >= 1000000)
condition = true;
}
function endSong() {
if (condition) {
Achievements.unlock('over_nine_thousand', {
Achievements.unlock('road_to_a_million', {
date: Date.now(),
song: PlayState.song.song
}, {
Expand Down
31 changes: 26 additions & 5 deletions docs/Adding-a-New-Language.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
## Language Data
Firstly, you need to edit these two main text files:
## Creating the JSON File
First, you need to create a file in `assets/languages/` called `[language-code].json`. <br>
The name doesn't really matter, so you can call it whatever you want.

For its data, copy [this](https://raw.githubusercontent.com/Joalor64GH/Rhythmo-SC/main/assets/languages/en.json), and edit it with your translations.

## Loading your Language
Now, you need to edit these two main text files:
* `assets/languages/languagesList.txt` - Your list of languages. (e.g., `de`, `en`, `es`, `fr`)
* `assets/languages/languagesData.txt` - This is so that your language can be pushed into `LanguagesState.hx`.

Expand All @@ -13,6 +19,21 @@ So, for example, if you wanted to add German, it would look like:
Deutsch (Deutschland):de
```

Now, you need your `.json` file, which should be located in `assets/languages/[language-code].json`. <br>
Of course, this contains the data for your language. <br>
To add your data, just copy [this](https://raw.githubusercontent.com/Joalor64GH/Rhythmo-SC/main/assets/languages/en.json), and edit it with your translations.
## Localization Functions
Like most functions, these can be accessed through [scripting](https://github.com/Joalor64GH/Rhythmo-SC/wiki/Scripting).

### Switching to Another Language
```hx
Localization.switchLanguage('language-code');
```

If that language is already selected, the change will not happen.

## Retrieving a Key
```hx
Localization.get('key', 'language-code');
```

If the second parameter is empty, defaults to currnt language.

For further documentation, check out [`SimpleLocalization`](https://github.com/Joalor64GH/SimpleLocalization).
2 changes: 1 addition & 1 deletion docs/Adding-a-New-Song.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ For your chart, copy this empty template:
It should be called `chart.json` and should be located in `assets/songs/[song-name]/chart.json`.

### Charting
To chart your song, go to `PlayState.hx` and then press "7" to go to ChartingState. <br>
To chart your song, go to `PlayState.hx` and then press "`7`" to go to ChartingState. <br>
Or you can go to your song in `SongSelectState.hx`, and use `SHIFT + ENTER`.

When you're done, simply save the chart by using `Save Chart` or `Save Chart As`. <br>
Expand Down
2 changes: 1 addition & 1 deletion docs/Creating-a-Mod.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Creating the Folder
Create a folder in the `mods` folder and rename it to whatever you want. <br>
Create a folder in the `mods/` folder and rename it to whatever you want. <br>
Doing this manually isn't a problem, but it would be better and faster if you copy-and-pasted the `template` folder.

![](https://github.com/user-attachments/assets/85d6cc54-72e0-406f-b5a0-131b65e32b62?raw=true)
Expand Down

0 comments on commit e862326

Please sign in to comment.