Skip to content

Commit

Permalink
add: about menu text
Browse files Browse the repository at this point in the history
This commit adds support for showing additional text in the About menu.
  • Loading branch information
ThePedroo committed Aug 4, 2023
1 parent 05c0cf5 commit 3dd2335
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 15 deletions.
12 changes: 9 additions & 3 deletions OS_SUPPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ The speech is the text that the characters say, and it adds more expression to t

<= `v1.1.2-alpha`: Supported but with bugs (speech texts containing `"`, `'` or `\` are not supported)

<= `v1.16.2-b.0 & v1.14.6-b.0`: Supported
<= `v1.16.2-b.0 & v1.14.6-b.0`: Supported without author animation:

<= `v1.16.2-b.0 & v1.15.8-b.0`: Supported

#### Sound effect

Expand Down Expand Up @@ -82,15 +84,19 @@ The start button is the button that starts the VN.

<= `v1.0.0-alpha`: Supported

<= `v1.1.2-alpha`: Supported with design changes

#### About

The About menu is the place where the player can see the information about the VN, like the name, the version, etc.

##### Version support

<= `v1.0.2-alpha`: About without hyperlink support
<= `v1.0.2-alpha`: Supported without hyperlink support & additional text support

<= `v1.1.2-alpha`: Supported without additional text support

<= `v1.1.2-alpha`: About with hyperlink support
<= `v1.16.2-b.0 & v1.15.8-b.0`: Supported

#### Settings

Expand Down
3 changes: 2 additions & 1 deletion android/app/src/main/java/com/perforvnm/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,8 @@ class MainActivity : ComponentActivity() {
startActivity(android.content.Intent(android.content.Intent.ACTION_VIEW, android.net.Uri.parse("https://github.com/PerformanC/PerforVNMaker")))
}
}, length - "PerforVNM".length, length, 0)
append(" 1.16.2-b.0 (code generator), 1.15.8-b.0 (generated code).")
append("1.16.2-b.0 (code generator), 1.15.8-b.0 (generated code).")
append("\n\n This is our example visual novel, made by @ThePedroo")
}
textView.textSize = 15f
textView.setTextColor(0xFFFFFFFF.toInt())
Expand Down
12 changes: 8 additions & 4 deletions docs/menu/make.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ OBS: The background image and music must be in the `res/raw` folder.

```js
menu.make({
textSpeed: 50,
textColor: 'FFFFFF',
backTextColor: 'FFFFFF',
aboutText: 'This is the about, welcome.',
background: {
image: 'menu',
music: 'menu_music' // https://www.youtube.com/watch?v=DEhBqcbDHh4
},
textColor: 'FFFFFF',
backTextColor: 'FFFFFF',
footer: {
color: '000000',
textColor: 'FFFFFFF',
Expand All @@ -26,11 +28,13 @@ menu.make({

## Parameters

- `textSpeed`: The default speed of the scene's speeches.
- `textColor`: The color of the text in the menu.
- `backTextColor`: The color of the text in the back button.
- `aboutText`: The text that will be shown in the About menu.
- `background`: The background of the menu. An object with the following properties:
- `image`: The background image file name.
- `music`: The background music file name.
- `textColor`: The color of the text in the menu.
- `backTextColor`: The color of the text in the back button.
- `footer`: The footer of the menu. An object with the following properties:
- `color`: The color of the footer.
- `textColor`: The color of the text in the footer.
Expand Down
3 changes: 2 additions & 1 deletion src/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,8 @@ function make(options) {
' startActivity(android.content.Intent(android.content.Intent.ACTION_VIEW, android.net.Uri.parse("' + PerforVNM.repository + '")))' + '\n' +
' }' + '\n' +
' }, length - "PerforVNM".length, length, 0)' + '\n' +
' append(" ' + PerforVNM.codeGeneratorVersion + ' (code generator), ' + PerforVNM.generatedCodeVersion + ' (generated code).")' + '\n' +
' append("' + PerforVNM.codeGeneratorVersion + ' (code generator), ' + PerforVNM.generatedCodeVersion + ' (generated code).")' + '\n' +
(options.aboutText ? ' append("\\n\\n' + JSON.stringify(options.aboutText).slice(1, -1) + '")' + '\n' : '') +
' }' + '\n' +
' textView.textSize = 15f' + '\n' +
' textView.setTextColor(0xFF' + options.textColor + '.toInt())' + '\n\n' +
Expand Down
1 change: 1 addition & 0 deletions src/perforvnm.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ menu.make({
textSpeed: 50,
textColor: 'FFFFFF',
backTextColor: 'FFFFFF',
aboutText: 'This is our example visual novel, made by @ThePedroo',
seekBar: {
backgroundColor: 'F00000',
progressColor: 'FFFFFF',
Expand Down
6 changes: 0 additions & 6 deletions src/scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,6 @@ function addScenario(scene, options) {
}

function addSpeech(scene, options) {
// if (!options?.author?.name) {
// console.error(`ERROR: Speech author name not provided.\n- Scene name: ${scene.name}`)

// process.exit(1)
// }

if (options.author?.name && !options.author.textColor) {
console.error(`ERROR: Speech author text color not provided.\n- Scene name: ${scene.name}`)

Expand Down

0 comments on commit 3dd2335

Please sign in to comment.