Skip to content

Commit

Permalink
bump version to 0.3.4 and update @drincs/pixi-vn-json dependency to v…
Browse files Browse the repository at this point in the history
…ersion 1.1.6; add default value handling in HashtagScriptManager and update tests accordingly
  • Loading branch information
BlackRam-oss committed Nov 23, 2024
1 parent 745b543 commit 456bdef
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@drincs/pixi-vn-ink",
"version": "0.3.3",
"version": "0.3.4",
"type": "module",
"description": "Pixi'VN gives you the ability to write your own narrative using Ink",
"main": "./dist/index.cjs",
Expand All @@ -25,7 +25,7 @@
"homepage": "https://pixi-vn.web.app/ink/ink.html",
"funding": "https://github.com/DRincs-Productions/pixi-vn?sponsor=1",
"devDependencies": {
"@drincs/pixi-vn-json": "^1.1.5",
"@drincs/pixi-vn-json": "^1.1.6",
"inkjs": "^2.3.1",
"jsdom": "^25.0.1",
"ts-node": "^10.9.2",
Expand Down
10 changes: 10 additions & 0 deletions src/managers/HashtagScriptManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,16 @@ export default class HashtagScriptManager {
if (list.length > 2) {
op.valueType = HashtagScriptManager.removeExtraDoubleQuotes(list[2]);
}
if (list.length > 4) {
try {
let propList = list.slice(3);
let props = HashtagScriptManager.convertListStringToObj(propList);
if ("default" in props) {
op.defaultValue = props.default;
}
}
catch (_) { }
}
return op;
}
default:
Expand Down
5 changes: 3 additions & 2 deletions tests/pixivn-features.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,7 @@ test('input', async () => {
{
type: "operationtoconvert",
values: [
"request input number",
"request input number default 0",
],
},
],
Expand Down Expand Up @@ -1011,6 +1011,7 @@ test('input', async () => {
type: "input",
operationType: "request",
valueType: "number",
defaultValue: 0,
},
],
goNextStep: true,
Expand Down Expand Up @@ -1042,7 +1043,7 @@ test('input', async () => {
let res = convertInkText(`
=== start
# request input
# request input number
# request input number default 0
# pause
# request input 'array of string'
Hello
Expand Down

0 comments on commit 456bdef

Please sign in to comment.