Skip to content

Commit

Permalink
Bump version to 0.8.12 and enhance requestInput method to include def…
Browse files Browse the repository at this point in the history
…ault value handling
  • Loading branch information
BlackRam-oss committed Nov 23, 2024
1 parent 5b5f49b commit be2eecc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@drincs/pixi-vn",
"version": "0.8.11",
"version": "0.8.12",
"type": "module",
"description": "Pixi'VN is a npm package that provides various features for creating visual novels.",
"main": "./dist/index.cjs",
Expand Down
16 changes: 11 additions & 5 deletions src/managers/NarrationManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -870,12 +870,18 @@ export default class NarrationManager {
}
/**
* Request input from the player.
* @param value The input value to be inserted by the player.
* @param info The input value to be inserted by the player.
* @param defaultValue The default value to be inserted.
*/
public requestInput(value: Omit<InputInfo, "isRequired">) {
(value as InputInfo).isRequired = true
storage.setVariable(storage.keysSystem.CURRENT_INPUT_INFO_MEMORY_KEY, value)
storage.removeVariable(storage.keysSystem.CURRENT_INPUT_VALUE_MEMORY_KEY)
public requestInput(info: Omit<InputInfo, "isRequired">, defaultValue?: StorageElementType) {
(info as InputInfo).isRequired = true
storage.setVariable(storage.keysSystem.CURRENT_INPUT_INFO_MEMORY_KEY, info)
if (defaultValue !== undefined) {
this.inputValue = defaultValue
}
else {
storage.removeVariable(storage.keysSystem.CURRENT_INPUT_VALUE_MEMORY_KEY)
}
}
/**
* Remove the input request.
Expand Down

0 comments on commit be2eecc

Please sign in to comment.