Skip to content

Commit

Permalink
fix: 修复js测试页
Browse files Browse the repository at this point in the history
  • Loading branch information
fy0 committed Nov 1, 2023
1 parent 9658349 commit 59e0e0e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 5 deletions.
12 changes: 7 additions & 5 deletions jsport/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
<script>
const { createApp } = Vue
let ctx = dice.newVM();
ctx.Flags.PrintBytecode = true; // 好像没什么用
ctx.Flags.EnableDiceWoD = true;
ctx.Flags.EnableDiceCoC = true;
ctx.Flags.EnableDiceFate = true;
ctx.Flags.EnableDiceDoubleCross = true;
ctx.Config.PrintBytecode = true; // 好像没什么用
ctx.Config.EnableDiceWoD = true;
ctx.Config.EnableDiceCoC = true;
ctx.Config.EnableDiceFate = true;
ctx.Config.EnableDiceDoubleCross = true;

createApp({
data() {
Expand All @@ -58,6 +58,8 @@
} else {
this.items.push("过程:" + ctx.Detail)
this.items.push("结果:" + ctx.Ret.ToString())
this.items.push(`栈顶: ${ctx.StackTop()} 层数:${ctx.Depth()} 算力: ${ctx.NumOpCount}`)

if (ctx.RestInput) {
this.items.push(`剩余文本: ${ctx.RestInput}`)
}
Expand Down
23 changes: 23 additions & 0 deletions jsport/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "dicescript",
"version": "0.1.0",
"description": "Simple script language for TRPG dice engine.",
"main": "dicescript.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/sealdice/dicescript.git"
},
"keywords": [
"dice",
"trpg"
],
"author": "fy",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/sealdice/dicescript/issues"
},
"homepage": "https://github.com/sealdice/dicescript#readme"
}

0 comments on commit 59e0e0e

Please sign in to comment.