Skip to content

Commit

Permalink
v406
Browse files Browse the repository at this point in the history
[tip_flag_reset] 追加。
  • Loading branch information
amuhororo authored Apr 30, 2022
1 parent 8d8b85e commit cb06cb5
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 20 deletions.
17 changes: 13 additions & 4 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
【TIPプラグイン ver4.05
【TIPプラグイン ver4.06
http://hororo.wp.xdomain.jp/22/

2021/09/30更新 v510h対応版
2022/04/30更新 v513c確認版

-------------------------------------------------------------------------------------------------
■ 概要
Expand Down Expand Up @@ -217,7 +217,7 @@ http://hororo.wp.xdomain.jp/22/
id 数値 △*1 - csv表記順。
data_name 文字列      × csvデータ名(※拡張子は無し)
flag_name 文字列      × flag フラグの名前
flag_val true/false   × true フラグの値
flag_val true/false   × true フラグの値

*1 key または id のどちらかは必須。両方記述がある場合は key が優先になります。

Expand All @@ -228,6 +228,14 @@ http://hororo.wp.xdomain.jp/22/
pos 文字列 × rt 未読数の表示位置。lt(左上)、rt(右上)、ct(中上)、lb(左下)、rb(右下)、cb(中下)
※left、right、center、top、bottom の頭文字です。


◆ [tip_flag_reset] タグ用パラメーター
パラメータ名 値 必須 初期値 説明
data_name 文字列      × - csvデータ名(※拡張子は無し)
tip_btn true/false × false リスト表示用ボタンに未読バッジを使う場合は true
clear true/false × false フラグ値を削除する場合は true


◆ csvファイル作成の注意
・ファイル名を変更する場合は、ファイル名を指定してください。
[plugin name=tip file=***.txt]
Expand Down Expand Up @@ -283,7 +291,7 @@ http://hororo.wp.xdomain.jp/22/
-------------------------------------------------------------------------------------------------
■ 動作確認
-------------------------------------------------------------------------------------------------
ティラノスクリプトv510h
ティラノスクリプトv513c

-------------------------------------------------------------------------------------------------
■ 注意点
Expand Down Expand Up @@ -324,6 +332,7 @@ http://hororo.wp.xdomain.jp/22/
-------------------------------------------------------------------------------------------------
■ 更新履歴
-------------------------------------------------------------------------------------------------
2022/04/29 ver4.06 [tip_flag_reset]タグ追加。[tip_flag]タグ使用時に未読バッジが反映してなかった不具合修正。
2021/09/30 ver4.05 [tip_show]タグ・idパラメータ追加。テンプレートでゲーム変数を使えるように。
他、CSS整理など微調整。ティラノv510hで動作確認。
2021/08/15 ver4.04a コード整理、動作など微調整。ティラノv510eで動作確認。
Expand Down
36 changes: 30 additions & 6 deletions tip/init.ks
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
;【TIPプラグイン ver4.05
; 2021/09/30更新 v510h対応版
;【TIPプラグイン ver4.06
; 2022/04/30更新 v513c確認版
; by hororo http://hororo.wp.xdomain.jp/22/
;
[iscript]
Expand All @@ -9,8 +9,6 @@
mp.all_enterse = mp.all_enterse || "none"; //共通のマウスカーソルが乗った時の音
mp.all_leavese = mp.all_leavese || "none"; //共通のマウスカーソルが外れた時の音

//if(tf.system.tip_conf===undefined){
// const file_name = (mp.file) ? mp.file.split('.',1) : "tip_data";
tf.system.tip_conf = {

file : mp.file || "tip_data.csv", //csvファイル。
Expand Down Expand Up @@ -49,7 +47,7 @@
tiplog_key : "",
tiplog_obj : ""
};
//};

//フラグ保存用変数を定義
if(sf.tip_flag===undefined) sf.tip_flag = {};
if(f.tip_flag===undefined) f.tip_flag = {};
Expand Down Expand Up @@ -115,7 +113,6 @@ if(mp.color) tf.system.tip_conf.color_conf = "true";


;///◆[tip_btn]タグ ボタン用の未読数をカウント表示するマクロです。///////////////
;
[macro name="tip_btn"]
[wait time=100]
[iscript]
Expand All @@ -124,7 +121,34 @@ if(mp.color) tf.system.tip_conf.color_conf = "true";
[endmacro]


;///◆[tip_flag_reset]タグ フラグ値をリセットするマクロです。/////////////////////
;/// ※ clear=true とするとsf変数もクリアするのでご注意ください。
[macro name="tip_flag_reset"]
[iscript]
mp.data_name = mp.data_name || "tip_data";
const data = tf.system.tip_conf['data_'+mp.data_name];
const vn = (data[0]['flag_var'] == "f") ? TYRANO.kag.stat.f : TYRANO.kag.variable.sf;
//削除
if(mp.clear){
vn.tip_flag = {};
vn.tip_flag[mp.data_name] = [];
for (let i = 0; i < data.length; i++) {
vn.tip_flag[mp.data_name][i]={};
vn.tip_flag[mp.data_name][i]['flag'] = -1;
}
}
//入れ替え
tip_flag = vn.tip_flag[mp.data_name];
for (let i = 0; i < data.length; i++) {
for (let key in tip_flag[i]) {
data[i][key] = tip_flag[i][key];
}
};
if(mp.tip_btn=='true') tipBtn(mp);
[endscript]
[endmacro]

;tip_data.csv読み込み
[tip_loadcsv]

[return]
26 changes: 17 additions & 9 deletions tip/js/tip.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 【TIPプラグイン ver4.05】 2021/09/30
// 【TIPプラグイン ver4.06】 2022/04/30
// by hororo http://hororo.wp.xdomain.jp/22/


Expand Down Expand Up @@ -181,11 +181,13 @@ function displayTiplist(pm) {
layer_menu.fadeOut(speed, function(){
tipBtn(pm);
$(this).empty();
//layer_menu.empty();
});
if(TYRANO.kag.stat.visible_menu_button == true) $(".button_menu").show();
//TYRANO.kag.ftag.startTag("awakegame");
if(TYRANO.kag.tmp.sleep_game != null) TYRANO.kag.ftag.startTag("awakegame");
skip_save(false); //skip・autoを戻す
setTimeout(function(){
if(TYRANO.kag.stat.visible_menu_button == true) $(".button_menu").show();
if(TYRANO.kag.tmp.sleep_game != null) TYRANO.kag.ftag.startTag("awakegame");
skip_save(false); //skip・autoを戻す
}, speed);
}
e.preventDefault();
});
Expand Down Expand Up @@ -713,10 +715,16 @@ function close_ev(pm){
const speed = tip_conf.is_skip ? 0 : parseInt(tip_conf.fade_speed);
const layer_menu = TYRANO.kag.layer.getMenuLayer();
if($("#tip_list_wrap").length){
displayTiplist(pm);
$("#tip_wrap").fadeOut(speed, function(){
$(this).remove();
});
if($("#tip_wrap").length){
displayTiplist(pm);
$("#tip_wrap").fadeOut(speed, function(){
$(this).remove();
});
}else{
$("#tip_list_wrap").fadeOut(speed, function(){
$(this).remove();
});
}
}else if($(".log_body").length){
$("#tip_wrap").fadeOut(speed, function(){
$(this).remove();
Expand Down
2 changes: 1 addition & 1 deletion tip/js/tip_click.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 【TIPプラグイン ver4.05】 2021/09/30
// 【TIPプラグイン ver4.06】 2022/04/30
// by hororo http://hororo.wp.xdomain.jp/22/


Expand Down

0 comments on commit cb06cb5

Please sign in to comment.