Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
phpdts
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nemo Ma
phpdts
Commits
27799937
Commit
27799937
authored
Apr 13, 2025
by
Nemo Ma
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ADD: Branched Dialogue
parent
7d488cb3
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
930 additions
and
71 deletions
+930
-71
command.php
command.php
+109
-1
doc/etc/20250419_dialogue_choice_system.txt
doc/etc/20250419_dialogue_choice_system.txt
+420
-0
game.php
game.php
+13
-6
gamedata/cache/dialogue_1.php
gamedata/cache/dialogue_1.php
+15
-0
include/dialogue.js
include/dialogue.js
+208
-0
include/game.js
include/game.js
+146
-54
include/game/item.test.php
include/game/item.test.php
+8
-4
templates/default/dialogue.htm
templates/default/dialogue.htm
+11
-6
No files found.
command.php
View file @
27799937
...
@@ -423,6 +423,108 @@ if($hp > 0){
...
@@ -423,6 +423,108 @@ if($hp > 0){
else
{
else
{
$mode
=
'command'
;
$mode
=
'command'
;
}
}
}
elseif
(
strpos
(
$command
,
'dialogue_choice'
)
===
0
)
{
// 处理对话选择
$choice_parts
=
explode
(
' '
,
$command
);
if
(
count
(
$choice_parts
)
>=
3
)
{
$dialogue_id
=
$choice_parts
[
1
];
$choice_index
=
$choice_parts
[
2
];
// 检查对话 ID 和选择索引是否有效
if
(
isset
(
$dialogue_branch
[
$dialogue_id
])
&&
isset
(
$dialogue_branch
[
$dialogue_id
][
$choice_index
]))
{
// 记录玩家的选择
$clbpara
[
'dialogue_choice'
]
=
array
(
'dialogue_id'
=>
$dialogue_id
,
'choice_index'
=>
$choice_index
,
'choice_text'
=>
$dialogue_branch
[
$dialogue_id
][
$choice_index
]
);
// 输出选择的结果
$log
.=
"你选择了:<span class=
\"
yellow
\"
>
{
$dialogue_branch
[
$dialogue_id
][
$choice_index
]
}
</span><br>"
;
// 添加非常明显的错误信息
$log
.=
"<div style='background-color: red; color: white; padding: 10px; margin: 10px; border: 2px solid black;'>对话选择调试信息: 对话 ID =
{
$dialogue_id
}
, 选择索引 =
{
$choice_index
}
</div>"
;
// 如果有对应的选择结果日志,显示它
$choice_log_key
=
$dialogue_id
.
'_choice_'
.
$choice_index
;
// 调试信息,显示对话日志的键值
$log
.=
"<!-- DEBUG: 对话 ID:
{
$dialogue_id
}
, 选择索引:
{
$choice_index
}
, 选择日志键:
{
$choice_log_key
}
-->"
;
// 显示所有可用的对话日志键
$log
.=
"<!-- DEBUG: 可用的对话日志键: "
;
foreach
(
$dialogue_log
as
$key
=>
$value
)
{
$log
.=
"
{
$key
}
, "
;
}
$log
.=
" -->"
;
if
(
isset
(
$dialogue_log
[
$choice_log_key
])
&&
!
empty
(
$dialogue_log
[
$choice_log_key
]))
{
$log
.=
"<!-- DEBUG: 使用选择特定日志 -->"
;
$log
.=
$dialogue_log
[
$choice_log_key
];
}
elseif
(
isset
(
$dialogue_log
[
$dialogue_id
])
&&
!
empty
(
$dialogue_log
[
$dialogue_id
]))
{
// 如果没有特定选择的日志,显示通用日志
$log
.=
"<!-- DEBUG: 使用通用日志 -->"
;
$log
.=
$dialogue_log
[
$dialogue_id
];
}
else
{
$log
.=
"<!-- DEBUG: 没有找到对应的对话日志 -->"
;
}
// 清除对话状态
unset
(
$clbpara
[
'dialogue'
]);
unset
(
$clbpara
[
'noskip_dialogue'
]);
// 确保对话框不会重新打开
$dialogue_id
=
null
;
$opendialog
=
null
;
// 保存玩家数据,确保选择被记录
$serialized_clbpara
=
serialize
(
$clbpara
);
$encoded_clbpara
=
base64_encode
(
$serialized_clbpara
);
$log
.=
"<!-- DEBUG: 序列化后的 clbpara 长度: "
.
strlen
(
$serialized_clbpara
)
.
" -->"
;
$log
.=
"<!-- DEBUG: 编码后的 clbpara 长度: "
.
strlen
(
$encoded_clbpara
)
.
" -->"
;
$update_query
=
"UPDATE
{
$tablepre
}
players SET clbpara='"
.
$encoded_clbpara
.
"' WHERE pid='
$pid
'"
;
$update_result
=
$db
->
query
(
$update_query
);
if
(
$update_result
)
{
$log
.=
"<!-- DEBUG: 数据库更新成功 -->"
;
// 验证数据库中的值是否正确
$verify_query
=
"SELECT clbpara FROM
{
$tablepre
}
players WHERE pid='
$pid
'"
;
$verify_result
=
$db
->
query
(
$verify_query
);
if
(
$verify_result
&&
$db
->
num_rows
(
$verify_result
)
>
0
)
{
$verify_data
=
$db
->
fetch_array
(
$verify_result
);
$db_clbpara
=
$verify_data
[
'clbpara'
];
$log
.=
"<!-- DEBUG: 数据库中的 clbpara 长度: "
.
strlen
(
$db_clbpara
)
.
" -->"
;
// 尝试解码和反序列化
try
{
$decoded_clbpara
=
base64_decode
(
$db_clbpara
);
$unserialized_clbpara
=
unserialize
(
$decoded_clbpara
);
if
(
is_array
(
$unserialized_clbpara
)
&&
isset
(
$unserialized_clbpara
[
'dialogue_choice'
]))
{
$log
.=
"<!-- DEBUG: 数据库中的 dialogue_choice 存在 -->"
;
}
else
{
$log
.=
"<!-- DEBUG: 数据库中的 dialogue_choice 不存在 -->"
;
}
}
catch
(
Exception
$e
)
{
$log
.=
"<!-- DEBUG: 反序列化失败: "
.
$e
->
getMessage
()
.
" -->"
;
}
}
else
{
$log
.=
"<!-- DEBUG: 无法验证数据库中的值 -->"
;
}
}
else
{
$log
.=
"<!-- DEBUG: 数据库更新失败: "
.
$db
->
error
()
.
" -->"
;
}
// 设置命令模式为命令模式,确保页面能够正确显示选择结果
$mode
=
'command'
;
}
else
{
$log
.=
"<span class=
\"
red
\"
>无效的对话选择!</span><br>"
;
}
}
else
{
$log
.=
"<span class=
\"
red
\"
>对话选择格式错误!</span><br>"
;
}
}
elseif
(
strpos
(
$command
,
'end_dialogue'
)
===
0
)
{
}
elseif
(
strpos
(
$command
,
'end_dialogue'
)
===
0
)
{
//$log.="【DEBUG】关闭了对话框。";
//$log.="【DEBUG】关闭了对话框。";
if
(
!
empty
(
$dialogue_log
[
$clbpara
[
'dialogue'
]]))
$log
.=
$dialogue_log
[
$clbpara
[
'dialogue'
]];
if
(
!
empty
(
$dialogue_log
[
$clbpara
[
'dialogue'
]]))
$log
.=
$dialogue_log
[
$clbpara
[
'dialogue'
]];
...
@@ -785,7 +887,10 @@ if($hp > 0){
...
@@ -785,7 +887,10 @@ if($hp > 0){
$gamedata
[
'innerHTML'
][
'ingamebgm'
]
=
$bgm_player
;
$gamedata
[
'innerHTML'
][
'ingamebgm'
]
=
$bgm_player
;
}
}
//检查执行动作后是否有对话框产生
//检查执行动作后是否有对话框产生
if
(
!
empty
(
$clbpara
[
'dialogue'
]))
//如果刚刚处理了对话选择,则不显示对话框
$just_made_choice
=
strpos
(
$command
,
'dialogue_choice'
)
===
0
;
if
(
!
$just_made_choice
&&
!
empty
(
$clbpara
[
'dialogue'
]))
{
{
$opendialog
=
'dialogue'
;
$opendialog
=
'dialogue'
;
$dialogue_id
=
$clbpara
[
'dialogue'
];
$dialogue_id
=
$clbpara
[
'dialogue'
];
...
@@ -853,6 +958,9 @@ $gamedata['innerHTML']['anum'] = $alivenum;
...
@@ -853,6 +958,9 @@ $gamedata['innerHTML']['anum'] = $alivenum;
ob_clean
();
ob_clean
();
$main
?
include
template
(
$main
)
:
include
template
(
'profile'
);
$main
?
include
template
(
$main
)
:
include
template
(
'profile'
);
$gamedata
[
'innerHTML'
][
'main'
]
=
ob_get_contents
();
$gamedata
[
'innerHTML'
][
'main'
]
=
ob_get_contents
();
// 添加调试信息,显示最终的 log 变量状态
$log
.=
"<!-- DEBUG: 最终的 log 变量长度: "
.
strlen
(
$log
)
.
" -->"
;
$gamedata
[
'innerHTML'
][
'log'
]
=
$log
;
$gamedata
[
'innerHTML'
][
'log'
]
=
$log
;
if
(
isset
(
$error
)){
$gamedata
[
'innerHTML'
][
'error'
]
=
$error
;}
if
(
isset
(
$error
)){
$gamedata
[
'innerHTML'
][
'error'
]
=
$error
;}
$gamedata
[
'value'
][
'teamID'
]
=
$teamID
;
$gamedata
[
'value'
][
'teamID'
]
=
$teamID
;
...
...
doc/etc/20250419_dialogue_choice_system.txt
0 → 100644
View file @
27799937
This diff is collapsed.
Click to expand it.
game.php
View file @
27799937
...
@@ -5,7 +5,7 @@ require './include/common.inc.php';
...
@@ -5,7 +5,7 @@ require './include/common.inc.php';
require
GAME_ROOT
.
'./include/game.func.php'
;
require
GAME_ROOT
.
'./include/game.func.php'
;
if
(
!
$cuser
||!
$cpass
)
{
gexit
(
$_ERROR
[
'no_login'
],
__file__
,
__line__
);
}
if
(
!
$cuser
||!
$cpass
)
{
gexit
(
$_ERROR
[
'no_login'
],
__file__
,
__line__
);
}
if
(
isset
(
$mode
)
&&
$mode
==
'quit'
)
{
if
(
isset
(
$mode
)
&&
$mode
==
'quit'
)
{
gsetcookie
(
'user'
,
''
);
gsetcookie
(
'user'
,
''
);
...
@@ -128,7 +128,7 @@ if($action == 'corpse' || $action == 'pacorpse' && $gamestate<40){
...
@@ -128,7 +128,7 @@ if($action == 'corpse' || $action == 'pacorpse' && $gamestate<40){
init_battle_rev
(
$pdata
,
$edata
,
1
);
init_battle_rev
(
$pdata
,
$edata
,
1
);
$main
=
'battle_rev'
;
$main
=
'battle_rev'
;
}
}
}
}
}
}
elseif
(
$action
==
'chase'
||
$action
==
'pchase'
||
$action
==
'dfight'
){
elseif
(
$action
==
'chase'
||
$action
==
'pchase'
||
$action
==
'dfight'
){
$enemyid
=
$bid
;
$enemyid
=
$bid
;
...
@@ -152,7 +152,7 @@ elseif($action == 'neut'){
...
@@ -152,7 +152,7 @@ elseif($action == 'neut'){
init_battle_rev
(
$pdata
,
$edata
,
1
);
init_battle_rev
(
$pdata
,
$edata
,
1
);
$main
=
'battle_rev'
;
$main
=
'battle_rev'
;
}
}
}
}
}
}
if
(
$hp
>
0
&&
$coldtimeon
&&
$showcoldtimer
&&
$rmcdtime
){
$log
.=
"行动冷却时间:<span id=
\"
timer
\"
class=
\"
yellow
\"
>0.0</span>秒<script type=
\"
text/javascript
\"
>demiSecTimerStarter(
$rmcdtime
);</script><br>"
;}
if
(
$hp
>
0
&&
$coldtimeon
&&
$showcoldtimer
&&
$rmcdtime
){
$log
.=
"行动冷却时间:<span id=
\"
timer
\"
class=
\"
yellow
\"
>0.0</span>秒<script type=
\"
text/javascript
\"
>demiSecTimerStarter(
$rmcdtime
);</script><br>"
;}
//如果身上存在时效性技能,检查技能是否超时
//如果身上存在时效性技能,检查技能是否超时
...
@@ -180,7 +180,11 @@ if ($club==0)
...
@@ -180,7 +180,11 @@ if ($club==0)
getclub
(
$name
,
$c1
,
$c2
,
$c3
);
getclub
(
$name
,
$c1
,
$c2
,
$c3
);
$clubavl
[
0
]
=
0
;
$clubavl
[
1
]
=
$c1
;
$clubavl
[
2
]
=
$c2
;
$clubavl
[
3
]
=
$c3
;
$clubavl
[
0
]
=
0
;
$clubavl
[
1
]
=
$c1
;
$clubavl
[
2
]
=
$c2
;
$clubavl
[
3
]
=
$c3
;
}
}
if
(
!
empty
(
$clbpara
[
'dialogue'
])
||
!
empty
(
$clbpara
[
'noskip_dialogue'
]))
// 检查是否有对话需要显示,但如果刚刚处理了对话选择,则不显示
// 通过检查 $_POST['command'] 是否包含 'dialogue_choice' 来判断
$just_made_choice
=
isset
(
$_POST
[
'command'
])
&&
strpos
(
$_POST
[
'command'
],
'dialogue_choice'
)
===
0
;
if
(
!
$just_made_choice
&&
(
!
empty
(
$clbpara
[
'dialogue'
])
||
!
empty
(
$clbpara
[
'noskip_dialogue'
])))
{
{
$opendialog
=
$clbpara
[
'noskip_dialogue'
];
$opendialog
=
$clbpara
[
'noskip_dialogue'
];
if
(
!
empty
(
$clbpara
[
'dialogue'
]))
$dialogue_id
=
$clbpara
[
'dialogue'
];
if
(
!
empty
(
$clbpara
[
'dialogue'
]))
$dialogue_id
=
$clbpara
[
'dialogue'
];
...
@@ -188,10 +192,13 @@ if(!empty($clbpara['dialogue']) || !empty($clbpara['noskip_dialogue']))
...
@@ -188,10 +192,13 @@ if(!empty($clbpara['dialogue']) || !empty($clbpara['noskip_dialogue']))
if
(
isset
(
$opendialog
))
if
(
isset
(
$opendialog
))
{
{
$log
.=
"<script>
$log
.=
"<script>
$('
{
$opendialog
}
').showModal();
var dialogElement = document.getElementById('
{
$opendialog
}
');
if(dialogElement && dialogElement.showModal) {
dialogElement.showModal();
}
</script>"
;
</script>"
;
}
}
//if (!strstr($_SERVER['HTTP_REFERER'], 'php') && $_SERVER['HTTP_REFERER'] != '') {
//if (!strstr($_SERVER['HTTP_REFERER'], 'php') && $_SERVER['HTTP_REFERER'] != '') {
if
(
isset
(
$_GET
[
'is_new'
]))
{
if
(
isset
(
$_GET
[
'is_new'
]))
{
include
'./api.php'
;
include
'./api.php'
;
...
...
gamedata/cache/dialogue_1.php
View file @
27799937
...
@@ -58,6 +58,14 @@ $dialogues = Array
...
@@ -58,6 +58,14 @@ $dialogues = Array
1
=>
'这是测试对话第二页'
,
1
=>
'这是测试对话第二页'
,
2
=>
'现在给出选择支'
,
2
=>
'现在给出选择支'
,
),
),
// 带选择的测试对话
'choiceTestingDialog'
=>
Array
(
0
=>
'这是带选择的测试对话第一页'
,
1
=>
'这是带选择的测试对话第二页'
,
2
=>
'请选择下面的选项:'
,
),
);
);
# 单组对白中哪一页对话会显示头像:
# 单组对白中哪一页对话会显示头像:
...
@@ -76,6 +84,10 @@ $dialogue_log = Array
...
@@ -76,6 +84,10 @@ $dialogue_log = Array
'thiphase'
=>
"<span class='lime'>※ 权限重载完成,控制模块已解锁。</span><br>……这又是什么时候的事?<br><br>"
,
'thiphase'
=>
"<span class='lime'>※ 权限重载完成,控制模块已解锁。</span><br>……这又是什么时候的事?<br><br>"
,
'club21entry'
=>
"<span class='yellow'>虽然打开了蛋,但你被其中的<span class='glitchb'>数据风暴</span>狂暴吸入,受到了大量的伤害!</span><br>你屁滚尿流地重新站了起来。<br><br>"
,
'club21entry'
=>
"<span class='yellow'>虽然打开了蛋,但你被其中的<span class='glitchb'>数据风暴</span>狂暴吸入,受到了大量的伤害!</span><br>你屁滚尿流地重新站了起来。<br><br>"
,
'testingDialog'
=>
"<span class='yellow'>测试已结束!</span><br><br>"
,
'testingDialog'
=>
"<span class='yellow'>测试已结束!</span><br><br>"
,
'choiceTestingDialog'
=>
"<span class='yellow'>选择测试已结束!</span><br><br>"
,
'choiceTestingDialog_choice_0'
=>
"<span class='yellow'>你选择了选项A!</span><br>这是选项A的结果。<br><br>"
,
'choiceTestingDialog_choice_1'
=>
"<span class='yellow'>你选择了选项B!</span><br>这是选项B的结果。<br><br>"
,
'choiceTestingDialog_choice_2'
=>
"<span class='yellow'>你选择了选项C!</span><br>这是选项C的结果。<br><br>"
,
);
);
# 单组对白结束时提供选择肢:
# 单组对白结束时提供选择肢:
...
@@ -90,6 +102,9 @@ $dialogue_branch = Array
...
@@ -90,6 +102,9 @@ $dialogue_branch = Array
//5 => '选项C',
//5 => '选项C',
'选项A'
,
'选项B'
,
'选项C'
,
'选项A'
,
'选项B'
,
'选项C'
,
),
),
'choiceTestingDialog'
=>
Array
(
'选项A'
,
'选项B'
,
'选项C'
,
),
);
);
# 单组对白结束提供特殊结束按钮(非必须、仅在结束对白会触发特殊事件时调用):
# 单组对白结束提供特殊结束按钮(非必须、仅在结束对白会触发特殊事件时调用):
...
...
include/dialogue.js
0 → 100644
View file @
27799937
// 对话系统的JavaScript扩展
// 扩展changePages函数,处理对话选择页面
function
dialogueChangePages
(
mode
,
cPages
)
{
console
.
log
(
'
dialogueChangePages called with mode=
'
+
mode
+
'
, cPages=
'
+
cPages
);
var
nowpage
=
Number
(
document
.
getElementById
(
mode
+
'
markpage
'
).
innerHTML
);
var
endpage
=
Number
(
document
.
getElementById
(
mode
+
'
endpage
'
).
innerHTML
);
var
maxdkey
=
endpage
+
1
;
// 选择页面的ID
console
.
log
(
'
Current page:
'
+
nowpage
+
'
, End page:
'
+
endpage
+
'
, Choice page ID:
'
+
maxdkey
);
if
(
nowpage
<
0
||
nowpage
>
endpage
)
{
nowpage
=
0
;
console
.
log
(
'
Reset nowpage to 0
'
);
}
var
nextpage
=
nowpage
+
cPages
;
console
.
log
(
'
Next page:
'
+
nextpage
);
document
.
getElementById
(
mode
+
'
markpage
'
).
innerHTML
=
nextpage
;
// 隐藏当前页面
var
currentPage
=
document
.
getElementById
(
mode
+
nowpage
);
if
(
currentPage
)
{
currentPage
.
style
.
display
=
"
none
"
;
console
.
log
(
'
Hiding current page:
'
+
mode
+
nowpage
);
}
else
{
console
.
error
(
'
Current page not found:
'
+
mode
+
nowpage
);
}
// 如果下一页是选择页面
if
(
nextpage
>
endpage
)
{
console
.
log
(
'
Next page is choice page
'
);
// 显示选择页面
var
choicePage
=
document
.
getElementById
(
mode
+
maxdkey
);
console
.
log
(
'
Looking for choice page with ID:
'
+
mode
+
maxdkey
);
// 列出所有可用的元素ID
console
.
log
(
'
Available elements:
'
);
var
allElements
=
document
.
getElementsByTagName
(
'
*
'
);
for
(
var
i
=
0
;
i
<
allElements
.
length
;
i
++
)
{
if
(
allElements
[
i
].
id
&&
allElements
[
i
].
id
.
startsWith
(
mode
))
{
console
.
log
(
'
-
'
+
allElements
[
i
].
id
);
}
}
if
(
choicePage
)
{
choicePage
.
style
.
display
=
"
block
"
;
console
.
log
(
"
Showing choice page:
"
+
mode
+
maxdkey
);
}
else
{
console
.
error
(
"
Choice page not found:
"
+
mode
+
maxdkey
);
}
}
else
{
console
.
log
(
'
Next page is dialogue page
'
);
// 显示普通对话页面
var
dialoguePage
=
document
.
getElementById
(
mode
+
nextpage
);
if
(
dialoguePage
)
{
dialoguePage
.
style
.
display
=
"
block
"
;
console
.
log
(
"
Showing dialogue page:
"
+
mode
+
nextpage
);
}
else
{
console
.
error
(
"
Dialogue page not found:
"
+
mode
+
nextpage
);
}
}
}
// 覆盖原有的changePages函数
function
changePages
(
mode
,
cPages
)
{
// 如果是对话系统,使用dialogueChangePages
if
(
mode
===
'
d
'
)
{
dialogueChangePages
(
mode
,
cPages
);
}
else
{
// 否则使用原有的逻辑
var
nowpage
=
Number
(
document
.
getElementById
(
mode
+
'
markpage
'
).
innerHTML
);
var
endpage
=
Number
(
document
.
getElementById
(
mode
+
'
endpage
'
).
innerHTML
);
if
(
nowpage
<
0
||
nowpage
>
endpage
)
{
nowpage
=
0
;
}
var
nextpage
=
nowpage
+
cPages
;
document
.
getElementById
(
mode
+
'
markpage
'
).
innerHTML
=
nowpage
+
cPages
;
var
currentPage
=
document
.
getElementById
(
mode
+
nowpage
);
if
(
currentPage
)
{
currentPage
.
style
.
display
=
"
none
"
;
}
var
nextPageElement
=
document
.
getElementById
(
mode
+
nextpage
);
if
(
nextPageElement
)
{
nextPageElement
.
style
.
display
=
"
inline-block
"
;
}
var
prevButton
=
document
.
getElementById
(
'
shooting_previous
'
);
if
(
prevButton
)
{
prevButton
.
style
.
display
=
nextpage
>
0
?
'
inline-block
'
:
'
none
'
;
}
var
nextButton
=
document
.
getElementById
(
'
shooting_next
'
);
if
(
nextButton
)
{
nextButton
.
style
.
display
=
(
nextpage
>=
endpage
)
?
'
none
'
:
'
inline-block
'
;
}
var
endingButton
=
document
.
getElementById
(
'
shooting_ending
'
);
if
(
endingButton
)
{
endingButton
.
style
.
display
=
(
nextpage
==
endpage
)
?
'
inline-block
'
:
'
none
'
;
}
}
}
// 处理对话选择
function
handleDialogueChoice
(
dialogueId
,
choiceIndex
)
{
// 添加非常明显的控制台日志
console
.
log
(
'
%c对话选择调试信息
'
,
'
background: red; color: white; font-size: 20px;
'
);
console
.
log
(
'
%c对话 ID =
'
+
dialogueId
+
'
, 选择索引 =
'
+
choiceIndex
,
'
background: red; color: white; font-size: 20px;
'
);
console
.
log
(
'
handleDialogueChoice called with dialogueId=
'
+
dialogueId
+
'
, choiceIndex=
'
+
choiceIndex
);
try
{
// 禁用所有选择按钮,防止重复点击
var
choiceButtons
=
document
.
querySelectorAll
(
'
#dialogue input.cmdbutton
'
);
if
(
choiceButtons
&&
choiceButtons
.
length
>
0
)
{
for
(
var
i
=
0
;
i
<
choiceButtons
.
length
;
i
++
)
{
choiceButtons
[
i
].
disabled
=
true
;
}
console
.
log
(
'
All choice buttons disabled
'
);
}
else
{
console
.
warn
(
'
No choice buttons found to disable
'
);
}
// 设置命令值
var
commandInput
=
document
.
getElementById
(
'
command
'
);
if
(
commandInput
)
{
commandInput
.
value
=
'
dialogue_choice
'
+
dialogueId
+
'
'
+
choiceIndex
;
console
.
log
(
'
Command set to:
'
+
commandInput
.
value
);
}
else
{
console
.
error
(
'
Command input not found!
'
);
return
false
;
}
// 关闭对话框
var
dialogueElement
=
document
.
getElementById
(
'
dialogue
'
);
if
(
dialogueElement
)
{
try
{
// 在关闭对话框前添加一个“处理中”的提示
var
processingDiv
=
document
.
createElement
(
'
div
'
);
processingDiv
.
innerHTML
=
'
<span style="color: yellow; font-weight: bold;">正在处理选择...</span>
'
;
processingDiv
.
style
.
textAlign
=
'
center
'
;
processingDiv
.
style
.
padding
=
'
10px
'
;
dialogueElement
.
appendChild
(
processingDiv
);
// 延迟关闭对话框,给用户一个反馈
setTimeout
(
function
()
{
try
{
dialogueElement
.
close
();
console
.
log
(
'
Dialogue closed
'
);
}
catch
(
closeError
)
{
console
.
error
(
'
Error closing dialogue:
'
,
closeError
);
}
// 在关闭对话框后再提交命令
setTimeout
(
function
()
{
console
.
log
(
'
Submitting command...
'
);
try
{
postCmd
(
'
gamecmd
'
,
'
command.php
'
);
console
.
log
(
'
Command submitted
'
);
}
catch
(
postError
)
{
console
.
error
(
'
Error posting command:
'
,
postError
);
// 如果提交命令出错,尝试直接提交表单
try
{
document
.
getElementById
(
'
gamecmd
'
).
submit
();
console
.
log
(
'
Form submitted directly
'
);
}
catch
(
submitError
)
{
console
.
error
(
'
Error submitting form:
'
,
submitError
);
}
}
},
100
);
},
500
);
}
catch
(
processError
)
{
console
.
error
(
'
Error processing dialogue:
'
,
processError
);
// 如果处理对话框出错,直接提交命令
postCmd
(
'
gamecmd
'
,
'
command.php
'
);
}
}
else
{
console
.
error
(
'
Dialogue element not found!
'
);
// 如果没有找到对话框,也要提交命令
setTimeout
(
function
()
{
console
.
log
(
'
Submitting command anyway...
'
);
postCmd
(
'
gamecmd
'
,
'
command.php
'
);
},
100
);
}
}
catch
(
error
)
{
console
.
error
(
'
Error in handleDialogueChoice:
'
,
error
);
// 如果出现任何错误,尝试直接提交命令
try
{
var
commandInput
=
document
.
getElementById
(
'
command
'
);
if
(
commandInput
)
{
commandInput
.
value
=
'
dialogue_choice
'
+
dialogueId
+
'
'
+
choiceIndex
;
}
postCmd
(
'
gamecmd
'
,
'
command.php
'
);
}
catch
(
finalError
)
{
console
.
error
(
'
Final error attempt failed:
'
,
finalError
);
}
}
console
.
log
(
'
Dialogue choice submitted: dialogue_choice
'
+
dialogueId
+
'
'
+
choiceIndex
);
return
false
;
}
include/game.js
View file @
27799937
function
hotkey
(
evt
)
function
hotkey
(
evt
)
{
{
if
(
document
.
activeElement
.
tagName
!=
'
INPUT
'
){
if
(
document
.
activeElement
.
tagName
!=
'
INPUT
'
){
evt
=
(
evt
)
?
evt
:
((
window
.
event
)
?
window
.
event
:
''
);
evt
=
(
evt
)
?
evt
:
((
window
.
event
)
?
window
.
event
:
''
);
var
ky
=
evt
.
keyCode
?
evt
.
keyCode
:
evt
.
which
;
var
ky
=
evt
.
keyCode
?
evt
.
keyCode
:
evt
.
which
;
...
@@ -8,7 +8,7 @@ function hotkey(evt)
...
@@ -8,7 +8,7 @@ function hotkey(evt)
$
(
'
submit
'
).
click
();
$
(
'
submit
'
).
click
();
}
}
}
}
}
}
}
}
//update time
//update time
...
@@ -29,7 +29,7 @@ function updateTime(timing,mode)
...
@@ -29,7 +29,7 @@ function updateTime(timing,mode)
setTimeout
(
"
updateTime(t,tm)
"
,
1000
);
setTimeout
(
"
updateTime(t,tm)
"
,
1000
);
}
}
else
{
else
{
window
.
location
.
reload
();
window
.
location
.
reload
();
}
}
}
}
...
@@ -128,7 +128,7 @@ function sl(id) {
...
@@ -128,7 +128,7 @@ function sl(id) {
// } else{
// } else{
// $(id).innerHTML = '';
// $(id).innerHTML = '';
// }
// }
//
//
// }
// }
// if(gamedata['timer'] && typeof(timerid)=='undefined'){
// if(gamedata['timer'] && typeof(timerid)=='undefined'){
// demiSecTimerStarter(gamedata['timer']);
// demiSecTimerStarter(gamedata['timer']);
...
@@ -165,7 +165,7 @@ function sl(id) {
...
@@ -165,7 +165,7 @@ function sl(id) {
// $(id).innerHTML = regdata[id];
// $(id).innerHTML = regdata[id];
// } else{
// } else{
// $(id).innerHTML = '';
// $(id).innerHTML = '';
// }
// }
// }
// }
//}
//}
...
@@ -202,9 +202,9 @@ function sl(id) {
...
@@ -202,9 +202,9 @@ function sl(id) {
//function showAlive(mode){
//function showAlive(mode){
// //window.location.href = 'alive.php?alivemode=' + mode;
// //window.location.href = 'alive.php?alivemode=' + mode;
//
//
// var oXmlHttp = zXmlHttp.createRequest();
// var oXmlHttp = zXmlHttp.createRequest();
//
//
// oXmlHttp.open("post", "alive.php", true);
// oXmlHttp.open("post", "alive.php", true);
// oXmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
// oXmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
// oXmlHttp.onreadystatechange = function () {
// oXmlHttp.onreadystatechange = function () {
...
@@ -224,60 +224,152 @@ function sl(id) {
...
@@ -224,60 +224,152 @@ function sl(id) {
//}
//}
function
postCmd
(
formName
,
sendto
){
function
postCmd
(
formName
,
sendto
){
var
oXmlHttp
=
zXmlHttp
.
createRequest
();
console
.
log
(
'
%c正在提交命令
'
,
'
background: blue; color: white; font-size: 16px;
'
);
var
sBody
=
getRequestBody
(
document
.
forms
[
formName
]);
console
.
log
(
'
表单名称:
'
+
formName
+
'
, 发送到:
'
+
sendto
);
oXmlHttp
.
open
(
"
post
"
,
sendto
,
true
);
oXmlHttp
.
setRequestHeader
(
"
Content-Type
"
,
"
application/x-www-form-urlencoded
"
);
try
{
oXmlHttp
.
onreadystatechange
=
function
()
{
var
oXmlHttp
=
zXmlHttp
.
createRequest
();
if
(
oXmlHttp
.
readyState
==
4
)
{
var
formElement
=
document
.
forms
[
formName
];
if
(
oXmlHttp
.
status
==
200
)
{
showData
(
oXmlHttp
.
responseText
);
if
(
!
formElement
)
{
}
else
{
console
.
error
(
'
找不到表单:
'
+
formName
);
showNotice
(
oXmlHttp
.
statusText
);
alert
(
'
找不到表单:
'
+
formName
);
return
;
}
var
sBody
=
getRequestBody
(
formElement
);
console
.
log
(
'
请求体:
'
+
sBody
);
oXmlHttp
.
open
(
"
post
"
,
sendto
,
true
);
oXmlHttp
.
setRequestHeader
(
"
Content-Type
"
,
"
application/x-www-form-urlencoded
"
);
oXmlHttp
.
onreadystatechange
=
function
()
{
console
.
log
(
'
请求状态变化:
'
+
oXmlHttp
.
readyState
);
if
(
oXmlHttp
.
readyState
==
4
)
{
console
.
log
(
'
请求完成,状态码:
'
+
oXmlHttp
.
status
);
if
(
oXmlHttp
.
status
==
200
)
{
console
.
log
(
'
请求成功,响应长度:
'
+
oXmlHttp
.
responseText
.
length
);
try
{
showData
(
oXmlHttp
.
responseText
);
}
catch
(
e
)
{
console
.
error
(
'
处理响应时出错:
'
+
e
.
message
);
alert
(
'
处理响应时出错:
'
+
e
.
message
);
}
}
else
{
console
.
error
(
'
请求失败:
'
+
oXmlHttp
.
statusText
);
showNotice
(
oXmlHttp
.
statusText
);
}
}
}
}
}
console
.
log
(
'
发送请求...
'
);
oXmlHttp
.
send
(
sBody
);
console
.
log
(
'
请求已发送
'
);
}
catch
(
e
)
{
console
.
error
(
'
发送请求时出错:
'
+
e
.
message
);
alert
(
'
发送请求时出错:
'
+
e
.
message
);
}
}
oXmlHttp
.
send
(
sBody
);
}
}
function
showData
(
sdata
){
function
showData
(
sdata
){
shwData
=
sdata
.
parseJSON
();
console
.
log
(
'
%c正在处理响应数据
'
,
'
background: green; color: white; font-size: 16px;
'
);
if
(
shwData
[
'
url
'
])
{
window
.
location
.
href
=
shwData
[
'
url
'
];
try
{
}
else
if
(
!
shwData
[
'
innerHTML
'
])
{
// 尝试解析 JSON
$
(
'
error
'
).
innerHTML
=
sdata
;
console
.
log
(
'
响应数据片段:
'
+
sdata
.
substring
(
0
,
100
)
+
'
...
'
);
//window.location.href = 'index.php';
shwData
=
sdata
.
parseJSON
();
}
else
{
console
.
log
(
'
解析后的数据类型:
'
+
typeof
(
shwData
));
sDv
=
shwData
[
'
value
'
];
for
(
var
id
in
sDv
){
// 检查是否需要重定向
if
(
$
(
id
)
!=
null
){
if
(
shwData
[
'
url
'
])
{
$
(
id
).
value
=
sDv
[
id
];
console
.
log
(
'
需要重定向到:
'
+
shwData
[
'
url
'
]);
window
.
location
.
href
=
shwData
[
'
url
'
];
}
else
if
(
!
shwData
[
'
innerHTML
'
])
{
console
.
log
(
'
没有 innerHTML 属性,显示原始数据
'
);
if
(
$
(
'
error
'
))
{
$
(
'
error
'
).
innerHTML
=
sdata
;
}
else
{
console
.
error
(
'
error 元素不存在
'
);
alert
(
'
错误:
'
+
sdata
);
}
}
}
}
else
{
sDi
=
shwData
[
'
innerHTML
'
];
console
.
log
(
'
处理 innerHTML 和其他属性
'
);
for
(
var
id
in
sDi
){
if
(
$
(
id
)
!=
null
){
// 处理 value 属性
if
(
sDi
[
'
id
'
]
!==
''
){
if
(
shwData
[
'
value
'
])
{
$
(
id
).
innerHTML
=
sDi
[
id
];
sDv
=
shwData
[
'
value
'
];
}
else
{
console
.
log
(
'
value 属性的键数量:
'
+
Object
.
keys
(
sDv
).
length
);
$
(
id
).
innerHTML
=
''
;
for
(
var
id
in
sDv
){
if
(
$
(
id
)
!=
null
){
console
.
log
(
'
设置
'
+
id
+
'
的 value 为:
'
+
sDv
[
id
]);
$
(
id
).
value
=
sDv
[
id
];
}
else
{
console
.
warn
(
'
元素
'
+
id
+
'
不存在,无法设置 value
'
);
}
}
}
}
}
}
sDd
=
shwData
[
'
display
'
];
// 处理 innerHTML 属性
for
(
var
id
in
sDd
){
if
(
shwData
[
'
innerHTML
'
])
{
if
(
$
(
id
)
!=
null
){
sDi
=
shwData
[
'
innerHTML
'
];
console
.
log
(
'
innerHTML 属性的键数量:
'
+
Object
.
keys
(
sDi
).
length
);
$
(
id
).
style
.
display
=
sDd
[
id
];
for
(
var
id
in
sDi
){
if
(
$
(
id
)
!=
null
){
if
(
sDi
[
id
]
!==
''
){
console
.
log
(
'
设置
'
+
id
+
'
的 innerHTML,长度:
'
+
sDi
[
id
].
length
);
$
(
id
).
innerHTML
=
sDi
[
id
];
}
else
{
console
.
log
(
'
清空
'
+
id
+
'
的 innerHTML
'
);
$
(
id
).
innerHTML
=
''
;
}
}
else
{
console
.
warn
(
'
元素
'
+
id
+
'
不存在,无法设置 innerHTML
'
);
}
}
}
// 处理 display 属性
if
(
shwData
[
'
display
'
])
{
sDd
=
shwData
[
'
display
'
];
console
.
log
(
'
display 属性的键数量:
'
+
Object
.
keys
(
sDd
).
length
);
for
(
var
id
in
sDd
){
if
(
$
(
id
)
!=
null
){
console
.
log
(
'
设置
'
+
id
+
'
的 display 为:
'
+
sDd
[
id
]);
$
(
id
).
style
.
display
=
sDd
[
id
];
}
else
{
console
.
warn
(
'
元素
'
+
id
+
'
不存在,无法设置 display
'
);
}
}
}
}
}
}
}
if
(
shwData
[
'
timer
'
]
&&
typeof
(
timerid
)
==
'
undefined
'
){
// 处理计时器
demiSecTimerStarter
(
shwData
[
'
timer
'
]);
if
(
shwData
[
'
timer
'
]
&&
typeof
(
timerid
)
==
'
undefined
'
){
}
console
.
log
(
'
启动计时器:
'
+
shwData
[
'
timer
'
]);
if
(
$
(
'
HsUipfcGhU
'
))
//ˢ��ҳ����
demiSecTimerStarter
(
shwData
[
'
timer
'
]);
{
}
window
.
location
.
reload
();
// 处理页面刷新
if
(
$
(
'
HsUipfcGhU
'
))
{
console
.
log
(
'
检测到页面刷新标记,即将刷新页面
'
);
window
.
location
.
reload
();
}
console
.
log
(
'
响应数据处理完成
'
);
}
catch
(
e
)
{
console
.
error
(
'
处理响应数据时出错:
'
+
e
.
message
);
console
.
error
(
'
原始数据:
'
+
sdata
);
alert
(
'
处理响应数据时出错:
'
+
e
.
message
);
// 尝试显示原始数据
if
(
$
(
'
error
'
))
{
$
(
'
error
'
).
innerHTML
=
'
<div style="color: red; background-color: yellow; padding: 10px; border: 2px solid black;">错误:
'
+
e
.
message
+
'
<br>原始数据:
'
+
sdata
+
'
</div>
'
;
}
}
}
}
}
...
@@ -315,7 +407,7 @@ function showChatdata(jsonchat) {
...
@@ -315,7 +407,7 @@ function showChatdata(jsonchat) {
newchat
+=
chatdata
[
'
msg
'
][
cid
];
newchat
+=
chatdata
[
'
msg
'
][
cid
];
}
}
$
(
'
chatlist
'
).
innerHTML
=
newchat
+
$
(
'
chatlist
'
).
innerHTML
;
$
(
'
chatlist
'
).
innerHTML
=
newchat
+
$
(
'
chatlist
'
).
innerHTML
;
}
}
}
}
function
openShutManager
(
oSourceObj
,
oTargetObj
,
shutAble
,
oOpenTip
,
oShutTip
){
function
openShutManager
(
oSourceObj
,
oTargetObj
,
shutAble
,
oOpenTip
,
oShutTip
){
...
@@ -327,12 +419,12 @@ function openShutManager(oSourceObj,oTargetObj,shutAble,oOpenTip,oShutTip){
...
@@ -327,12 +419,12 @@ function openShutManager(oSourceObj,oTargetObj,shutAble,oOpenTip,oShutTip){
if
(
shutAble
)
return
;
if
(
shutAble
)
return
;
targetObj
.
style
.
display
=
"
none
"
;
targetObj
.
style
.
display
=
"
none
"
;
if
(
openTip
&&
shutTip
){
if
(
openTip
&&
shutTip
){
sourceObj
.
innerHTML
=
shutTip
;
sourceObj
.
innerHTML
=
shutTip
;
}
}
}
else
{
}
else
{
targetObj
.
style
.
display
=
"
block
"
;
targetObj
.
style
.
display
=
"
block
"
;
if
(
openTip
&&
shutTip
){
if
(
openTip
&&
shutTip
){
sourceObj
.
innerHTML
=
openTip
;
sourceObj
.
innerHTML
=
openTip
;
}
}
}
}
}
}
...
...
include/game/item.test.php
View file @
27799937
...
@@ -7,20 +7,20 @@ if (! defined('IN_GAME')) {
...
@@ -7,20 +7,20 @@ if (! defined('IN_GAME')) {
/**
/**
* 处理测试物品
* 处理测试物品
* 这些物品主要用于测试游戏功能
* 这些物品主要用于测试游戏功能
*
*
* @param int $itmn 物品在物品栏中的位置
* @param int $itmn 物品在物品栏中的位置
* @param array &$data 玩家数据
* @param array &$data 玩家数据
*/
*/
function
item_test
(
$itmn
,
&
$data
)
{
function
item_test
(
$itmn
,
&
$data
)
{
global
$log
,
$db
,
$tablepre
,
$now
,
$pid
,
$event_bgm
,
$cmd
;
global
$log
,
$db
,
$tablepre
,
$now
,
$pid
,
$event_bgm
,
$cmd
;
extract
(
$data
,
EXTR_REFS
);
extract
(
$data
,
EXTR_REFS
);
$itm
=
&
$
{
'itm'
.
$itmn
};
$itm
=
&
$
{
'itm'
.
$itmn
};
$itmk
=
&
$
{
'itmk'
.
$itmn
};
$itmk
=
&
$
{
'itmk'
.
$itmn
};
$itme
=
&
$
{
'itme'
.
$itmn
};
$itme
=
&
$
{
'itme'
.
$itmn
};
$itms
=
&
$
{
'itms'
.
$itmn
};
$itms
=
&
$
{
'itms'
.
$itmn
};
$itmsk
=
&
$
{
'itmsk'
.
$itmn
};
$itmsk
=
&
$
{
'itmsk'
.
$itmn
};
if
(
$itm
==
'NPC战斗测试仪'
)
{
if
(
$itm
==
'NPC战斗测试仪'
)
{
include_once
GAME_ROOT
.
'./include/game/revcombat.func.php'
;
include_once
GAME_ROOT
.
'./include/game/revcombat.func.php'
;
$pa
=
fetch_playerdata_by_pid
(
1
);
$pa
=
fetch_playerdata_by_pid
(
1
);
...
@@ -42,6 +42,10 @@ function item_test($itmn, &$data) {
...
@@ -42,6 +42,10 @@ function item_test($itmn, &$data) {
//???
//???
$clbpara
[
'dialogue'
]
=
'testingDialog'
;
$clbpara
[
'dialogue'
]
=
'testingDialog'
;
//$clbpara['noskip_dialogue'] = 1;
//$clbpara['noskip_dialogue'] = 1;
}
elseif
(
$itm
==
'对话选择测试器'
)
{
// 带选择的对话测试
$clbpara
[
'dialogue'
]
=
'choiceTestingDialog'
;
$clbpara
[
'noskip_dialogue'
]
=
1
;
// 设置为不可跳过的对话
}
elseif
(
$itm
==
'事件BGM替换器'
)
{
}
elseif
(
$itm
==
'事件BGM替换器'
)
{
// 这是一个触发事件BGM的案例,只要输入$clbpara['event_bgmbook'] = Array('事件曲集名'); 即可将当前曲集替换为特殊事件BGM
// 这是一个触发事件BGM的案例,只要输入$clbpara['event_bgmbook'] = Array('事件曲集名'); 即可将当前曲集替换为特殊事件BGM
// 特殊事件曲集'event_bgmbook'的优先级高于地图曲集'pls_bgmbook',前者存在时后者不会生效
// 特殊事件曲集'event_bgmbook'的优先级高于地图曲集'pls_bgmbook',前者存在时后者不会生效
...
@@ -219,7 +223,7 @@ function item_test($itmn, &$data) {
...
@@ -219,7 +223,7 @@ function item_test($itmn, &$data) {
}
}
$itms
--
;
$itms
--
;
}
}
else
else
{
{
$log
.=
'这件长得很像猫的东西该怎么用呢?<br>'
;
$log
.=
'这件长得很像猫的东西该怎么用呢?<br>'
;
}
}
...
...
templates/default/dialogue.htm
View file @
27799937
<dialog
id=
"dialogue"
style=
"width: 460px; max-width: 90%;max-height: 80%;"
>
<dialog
id=
"dialogue"
style=
"width: 460px; max-width: 90%;max-height: 80%;"
>
<script
src=
"include/dialogue.js?v=<!--{eval time();}-->"
></script>
<p><center>
<p><center>
<!-- 当前阅读页面 -->
<!-- 当前阅读页面 -->
<div
id=
"dmarkpage"
style=
"display: none;"
>
0
</div>
<div
id=
"dmarkpage"
style=
"display: none;"
>
0
</div>
<!-- 对话框尾页 -->
<!-- 对话框尾页 -->
<!--{eval $endpage = count($dialogues[$dialogue_id])-1;}-->
<!--{eval $endpage = count($dialogues[$dialogue_id])-1;}-->
<!--{eval $maxdkey = $endpage + 1;}-->
<div
id=
"dendpage"
style=
"display: none;"
>
$endpage
</div>
<div
id=
"dendpage"
style=
"display: none;"
>
$endpage
</div>
<!-- 对白分段显示 -->
<!-- 对白分段显示 -->
...
@@ -13,7 +15,7 @@
...
@@ -13,7 +15,7 @@
<table>
<table>
<tr>
<tr>
<!-- 带头像对白 -->
<!-- 带头像对白 -->
<!--{if isset($dialogue_icon[$dialogue_id][$dkey])}-->
<!--{if isset($dialogue_icon[$dialogue_id][$dkey])}-->
<td>
<td>
<img
style=
"width:140px;height:80px;"
src=
"$dialogue_icon[$dialogue_id][$dkey]"
>
<img
style=
"width:140px;height:80px;"
src=
"$dialogue_icon[$dialogue_id][$dkey]"
>
</td>
</td>
...
@@ -25,7 +27,7 @@
...
@@ -25,7 +27,7 @@
<td
class=
"ach-cont"
style=
"width:320px;height:80px;text-align: center; padding: 3% 6%;"
>
<td
class=
"ach-cont"
style=
"width:320px;height:80px;text-align: center; padding: 3% 6%;"
>
$dinfo
$dinfo
</td>
</td>
<!--{/if}-->
<!--{/if}-->
</tr>
</tr>
</table>
</table>
<br>
<br>
...
@@ -35,22 +37,25 @@
...
@@ -35,22 +37,25 @@
<!--{if (($dkey <= ($endpage-1)) || (isset($dialogue_branch[$dialogue_id])))}-->
<!--{if (($dkey <= ($endpage-1)) || (isset($dialogue_branch[$dialogue_id])))}-->
<input
type=
"button"
class=
"cmdbutton"
id=
"p"
value=
"[P]下一页"
onclick=
"changePages('d',1);"
>
<input
type=
"button"
class=
"cmdbutton"
id=
"p"
value=
"[P]下一页"
onclick=
"changePages('d',1);"
>
<!--{elseif isset($dialogue_end[$dialogue_id])}-->
<!--{elseif isset($dialogue_end[$dialogue_id])}-->
$dialogue_end[$dialogue_id]
$dialogue_end[$dialogue_id]
<!--{/if}-->
<!--{/if}-->
</div>
</div>
<!--{/loop}-->
<!--{/loop}-->
<!-- 选择肢显示 -->
<!-- 选择肢显示 -->
<!--{if isset($dialogue_branch[$dialogue_id])}-->
<!--{if isset($dialogue_branch[$dialogue_id])}-->
<div
id=
"d{$maxdkey}"
style=
"display: none;"
>
<div
id=
"d{$maxdkey}"
style=
"display: none;"
class=
"ach_box"
>
<table
border=
"0"
style=
"text-align: center;"
><tr><td
style=
"width:280px;height:80px; text-align: center; padding: 3% 6%;"
>
<table
border=
"0"
style=
"text-align: center;"
><tr><td
style=
"width:320px;height:80px; text-align: center; padding: 3% 6%;"
>
<div
style=
"margin-bottom: 10px;"
>
请选择:
</div>
<!--{loop $dialogue_branch[$dialogue_id] $bkey $binfo}-->
<!--{loop $dialogue_branch[$dialogue_id] $bkey $binfo}-->
$binfo
<input
type=
"button"
class=
"cmdbutton"
style=
"margin: 5px; display: block; width: 200px;"
value=
"$binfo"
onclick=
"handleDialogueChoice('{$dialogue_id}', '{$bkey}'); return false;"
>
<!--{/loop}-->
<!--{/loop}-->
</td></tr></table>
</td></tr></table>
</div>
</div>
<!--{/if}-->
<!--{/if}-->
<!-- 调试信息已移除 -->
</center></p>
</center></p>
<!--{if (isset($dialogue_branch[$dialogue_id]) || isset($dialogue_end[$dialogue_id]))}-->
<!--{if (isset($dialogue_branch[$dialogue_id]) || isset($dialogue_end[$dialogue_id]))}-->
<img
class=
"dialog-background"
src=
"img/profile.gif"
onclick=
""
>
<img
class=
"dialog-background"
src=
"img/profile.gif"
onclick=
""
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment