Skip to content

Commit

Permalink
チャットノベル形式対応
Browse files Browse the repository at this point in the history
  • Loading branch information
ShikemokuMK committed Mar 15, 2020
1 parent 58ee482 commit 03c8c51
Show file tree
Hide file tree
Showing 6 changed files with 153 additions and 34 deletions.
20 changes: 5 additions & 15 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,6 @@
<div id="tyrano_base" class="tyrano_base" style="overflow:hidden" unselectable="on" ondragstart="return false" ></div>
<div id="vchat_base" class="vchat_base" style="overflow:hidden" unselectable="on" ondragstart="return false" >

<!--
<div style="right: 0px; margin-right: 20px;" class="vchat やまと vchat_talked">
<figure class="v_chat_face vchat-img-right" style="width: 100px; height: 100px;">
<img class="face_img" src="./data/fgimage/chat/yamato/normal.png" alt="">
<figcaption class=" vchat_name_text="" vchat-img-description"="">
<div class="v_chat_name" style="justify-content: center; display: flex; width: 100px; color: rgb(0, 0, 0); font-family: メイリオ, sans-serif;"><p>やまと</p>
</div>
</figure>
<div class="v_chat_text vchat-text-left" style="margin-top: 25px; margin-right: 120px; margin-left: 100px; background-color: rgb(255, 255, 255);"> <div class="text_f-before vchat-text-left-f-before"></div> <p class="vchat-text-inner" style="color: rgb(36, 36, 36); font-size: 26px; font-family: メイリオ, sans-serif; display: block;">おーい。きゃああああああああああ</p>
<div class="text_f-after vchat-text-left-f-after" style="border-left: 10px solid rgb(255, 255, 255);"></div> </div>
</div>
-->


</div> <!-- end vchat_base -->

Expand All @@ -115,8 +102,11 @@
<input type="hidden" id="first_scenario_file" value="http://test.com/tyrano/data/scenario/first.ks">
-->

<!-- vchatモード -->
<input type="hidden" id="vchat_mode" value="false">
<!-- コンフィグ調整をindex.htmlでもできる -->
<!--
<input type="hidden" tyrano="config" key="vchat" value="true" />
<input type="hidden" tyrano="config" key="vchatMenuVisible" value="true" />
-->

<!-- モーダル用 -->
<div class="remodal-bg" ></div>
Expand Down
7 changes: 5 additions & 2 deletions release/master_tyrano/data/system/Config.tjs
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,13 @@
;scWidth = 960;
;scHeight = 640;

// ◆ ビジュアルチャット形式
// V5より。trueにするとビジュアルチャット形式でゲームがプレイできます
// ◆ チャットノベル形式
// V5より。trueにするとチャットストーリー形式でゲームがプレイできます
;vchat = false;

// ◆ チャットノベル形式のメニュー
// チャットノベルで便利なセーブやロードなどを備えたメニューを表示するか否か。
;vchatMenuVisible = false;

// ◆ 文字表示スピード
// delay で指定した場合はその値が優先されます。resetdelayで元に戻ります
Expand Down
112 changes: 108 additions & 4 deletions tyrano/plugins/kag/kag.js
Original file line number Diff line number Diff line change
Expand Up @@ -813,14 +813,20 @@ tyrano.plugin.kag ={
this.tmp.ready_audio = true;
}

//index.htmlでのvchat定義を確認
if($("#vchat_mode").length>0 && $("#vchat_mode").val()=="true"){
this.kag.config["vchat"]="true";
}

//index.htmlでのvchat定義を確認。index.htmlでコンフィグを調整したい。
$("[tyrano='config']").each(function(){

var key = $(this).attr("key");
var val = $(this).val();
that.kag.config[key]= ""+ val;

});


//ビジュアルチャット形式/////////////////
if(this.kag.config["vchat"] && this.kag.config["vchat"]=="true"){

this.kag.config["ScreenCentering"] = "false";
this.kag.config["ScreenRatio"] = "fix";

Expand Down Expand Up @@ -853,6 +859,104 @@ tyrano.plugin.kag ={
});

}

//vchat形式で便利なメニューの表示。
if(this.kag.config["vchatMenuVisible"] && this.kag.config["vchatMenuVisible"]=="true"){

//コンフィグを表示する。
setTimeout(function(){

(function() {

var player_back_cnt = 0;
var j_menu_button = $("<div id='player_menu_button' class='player_menu_area' style='display:none;opacity:0.6;border-radius:5px;padding:10px;margin:10px;cursor:pointer;position:absolute;left:0px;top:0px;background-color:white'><span style='color:#6495ED'>メニュー</span></div>");
var j_end_button = $("<div class='player_menu_area' id='player_end_button' style='display:none;opacity:0.6;border-radius:5px;padding:10px;margin:10px 10px 10px 10px;cursor:pointer;position:absolute;left:0px;top:0px;background-color:white'><span style='color:#6495ED'>タイトルへ</span></div>");
var j_auto_button = $("<div class='player_menu_area' id='player_auto_button' style='display:none;opacity:0.6;border-radius:5px;padding:10px;margin:60px 10px 10px 10px;cursor:pointer;position:absolute;left:0px;top:0px;background-color:white'><span style='color:#6495ED'>オート</span></div>");
var j_skip_button = $("<div class='player_menu_area' id='player_skip_button' style='display:none;opacity:0.6;border-radius:5px;padding:10px;margin:110px 10px 10px 10px;cursor:pointer;position:absolute;left:0px;top:0px;background-color:white'><span style='color:#6495ED'>スキップ</span></div>");

function hide_menu(){
j_end_button.hide();
j_auto_button.hide();
j_skip_button.hide();
j_menu_button.hide();
player_back_cnt = 0;
}

j_menu_button.click(function(e) {
j_menu_button.hide();
j_end_button.show();
j_auto_button.show();
j_skip_button.show();

});

j_end_button.click(function(e) {

//アンドロイドとiOSで処理分け
hide_menu();
location.reload();
e.stopPropagation();

});

j_auto_button.click(function(e) {

hide_menu();
TYRANO.kag.ftag.startTag("autostart", {});
e.stopPropagation();

});

j_skip_button.click(function(e) {

hide_menu();
TYRANO.kag.ftag.startTag("skipstart", {});
e.stopPropagation();

});

$("body").append(j_menu_button);

$("body").append(j_end_button);
$("body").append(j_auto_button);
$("body").append(j_skip_button);

$("#tyrano_base").on("click.player", function() {

if(player_back_cnt > 8){
hide_menu();
}

player_back_cnt = 0;

});

//10秒操作がなかったら、ボタンを表示する。
setInterval(function() {
if (player_back_cnt == 9) {
j_menu_button.show();
} else if (player_back_cnt > 3) {

}

player_back_cnt++;

}, 1000);

})();


$("#tyrano_base").on("click.player", function() {
player_back_cnt = 0;
});


},1000);


}


/////////////////////////////

var first_scenario_file = "first.ks";
Expand Down
39 changes: 29 additions & 10 deletions tyrano/plugins/kag/kag.key_mouse.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,7 @@ tyrano.plugin.kag.key_mouse = {

$(document).on("mousedown", function(e) {

//スキップ中にクリックされたら元に戻す
if(that.kag.stat.is_skip == true && that.kag.stat.is_strong_stop == false){
that.kag.stat.is_skip = false;
return false;
}
that.clearSkip();

var target = null;

Expand Down Expand Up @@ -193,11 +189,9 @@ tyrano.plugin.kag.key_mouse = {

layer_obj_click.on("touchstart", function() {

if(that.kag.stat.is_skip == true){
that.kag.stat.is_skip = false;
return false;
}

//スキップ中にクリックされたら元に戻す
that.clearSkip();


that.timeoutId = setTimeout(function(){
if(that[that.map_ges["hold"]["action"]]){
Expand Down Expand Up @@ -465,6 +459,31 @@ tyrano.plugin.kag.key_mouse = {

return false;
},

//スキップやオートをクリアする
clearSkip:function(){

var that = this;

//スキップ中にクリックされたら元に戻す
if(that.kag.stat.is_skip == true && that.kag.stat.is_strong_stop == false){
that.kag.stat.is_skip = false;
return false;
}

//オート中でクリックされた場合。オート停止
if(that.kag.stat.is_auto == true){
if(that.kag.config.autoClickStop == "true"){
that.kag.ftag.startTag("autostop", {next:"false"});
}
}

//オート待ち状態なら、、解除する
if(that.kag.stat.is_wait_auto == true){
that.kag.stat.is_wait_auto = false;
}

},

canShowMenu : function() {

Expand Down
4 changes: 2 additions & 2 deletions tyrano/plugins/kag/kag.tag_vchat.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ tyrano.plugin.kag.tag.vchat_in = {
"font-size": "2em",
"margin":"1em",
"line-height":"1.5em",
"font-family": that.kag.stat.font.face,
/* "font-family": that.kag.stat.font.face,*/
};

j_vchat_text.css(font_style);
Expand All @@ -95,7 +95,7 @@ tyrano.plugin.kag.tag.vchat_in = {

j_vchat.find(".vchat_chara_name").css({
"font-size":"1.8em",
"font-family":that.kag.stat.font.face,
/* "font-family":that.kag.stat.font.face,*/
});


Expand Down
5 changes: 4 additions & 1 deletion tyrano/tyrano.css
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,7 @@ body{
/*名前欄*/
.vchat-name {
margin-top:20px;
font-family: Quicksand, 游ゴシック体, "Yu Gothic", YuGothic, "ヒラギノ角ゴシック Pro", "Hiragino Kaku Gothic Pro", メイリオ, Meiryo, Osaka, "MS Pゴシック", "MS PGothic", sans-serif;
}

/*吹き出しテキスト */
Expand All @@ -530,7 +531,9 @@ body{
line-break: strict;
word-wrap: break-word;
overflow-wrap: break-word;

-webkit-touch-callout:none;
-webkit-user-select: none;
font-family: Quicksand, 游ゴシック体, "Yu Gothic", YuGothic, "ヒラギノ角ゴシック Pro", "Hiragino Kaku Gothic Pro", メイリオ, Meiryo, Osaka, "MS Pゴシック", "MS PGothic", sans-serif;
/*float: left;*/
}

Expand Down

0 comments on commit 03c8c51

Please sign in to comment.