-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1.剧情加载器改用ajax方法,同步获取剧情文本和剧情脚本,注意不要在单个剧情文本写太多文字,否则可能阻塞线程。具体要多少文字会卡,还没测试过
2.Logic只将人物变量设置为全局变量,以便在func1.js.txt中调用 3.剧情播放和js脚本执行初步测试成功 4.js脚本一次写一行,一句话对于一个脚本 如果对于的一行不需要执行脚本,请留空并回车 5.剧情加载器现移动至PlotLoader,之后给遗留测试代码删除,移动位置ChapterLoader 6.添加src文件夹,用于单独存放框架的所有源码 7.新增nginx启动代码,用于启动本地http服务器环境,需要安装nginx 8.之前的加载代码,移动至暂存2
- Loading branch information
1 parent
32886ef
commit 7544b1a
Showing
13 changed files
with
140 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
##第一章开始## | ||
1 | ||
2 | ||
3 | ||
切换图片成千夜 | ||
换回来 :D | ||
##下面是图片效果测试## | ||
切换背景效果为反色 | ||
多留几句话 | ||
多留几句话 | ||
多留几句话 | ||
多留几句话 | ||
> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
##第二章开始## | ||
1 | ||
2 | ||
3 | ||
2_1 | ||
2_2 | ||
2_3 | ||
<end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
alert('第一章开始') | ||
alert(1) | ||
alert(2) | ||
alert(3) | ||
alert('第一章开始,下面是切换图片测试') | ||
koyomi.attr("src","../img/c03.png") | ||
koyomi.attr("src","../img/k18.png") | ||
|
||
ImageEffect.setImageEffect(bg,"invert","100%"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
alert('第二章开始') | ||
alert(2) | ||
alert(3) | ||
alert(4) | ||
console.log("2_1") | ||
console.log("2_2") | ||
console.log("2_3") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,24 @@ | ||
//整合一下 | ||
function TxtLoader() | ||
//整合一下 这个将会是新的剧情加载器 | ||
function IPlotLoader() | ||
{ // NOTE: 剧情加载器和脚本加载器应该由Dialog的clicks 驱动,只要返回数据到Dialog | ||
//根据click来设置和运行下一段文字和脚本 | ||
var 剧情分词 | ||
var 函数分词 | ||
var t | ||
// var obj={"plot_array":plot_array,"func_array":func_array} | ||
this.load=function(str_url,func_url) | ||
{ | ||
//把剧情分词和函数分词存储一个数组 此时为二维数组,一次性return | ||
var current_result=[]//剧情数组元素在前,函数数组元素在后 | ||
$.get(str_url,function(data,status) | ||
var final_obj={"plot_array":[],"func_array":[]}//剧情数组元素在前,函数数组元素在后 | ||
//改用ajax同步方法 //async:false为同步 获取文本 | ||
$.ajax({url:str_url,async:false,success:function(result) | ||
{ | ||
// alert(result) | ||
final_obj.plot_array=result.split("\n") | ||
}}) | ||
$.ajax({url:func_url,async:false,success:function(result) | ||
{ | ||
if(data) | ||
{ | ||
剧情分词=data.split("\n") | ||
current_result.push(剧情分词) | ||
} | ||
}) | ||
//脚本 | ||
$.get(func_url,function(data,status) | ||
{ | ||
if(data) | ||
{ | ||
函数分词=data.split("\n") | ||
current_result.push(函数分词) | ||
} | ||
}) | ||
final_obj.func_array=result.split("\n") | ||
}}) | ||
//最后返回数据数组 | ||
console.log("type_"+typeof(current_result)); | ||
localStorage.setItem("剧情") | ||
return Array(current_result) | ||
return final_obj | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
单独存放框架代码 |
Oops, something went wrong.