Last active
July 5, 2016 00:54
-
-
Save amuhororo/b3468a57ed8824f5e89bab3410a5286b to your computer and use it in GitHub Desktop.
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
[iscript] | |
tyrano.plugin.kag.menu.displaySave = function() { | |
//セーブ画面作成 | |
var that = this; | |
this.kag.stat.is_skip = false; | |
var array_save = that.getSaveData(); | |
var array = array_save.data; | |
//セーブデータ配列 | |
var layer_menu = that.kag.layer.getMenuLayer(); | |
for (var i = 0; i < array.length; i++) { | |
array[i].num = i; | |
} | |
this.kag.html("save", { | |
array_save : array, | |
"novel" : $.novel | |
}, function(html_str) { | |
var j_save = $(html_str); | |
//フォントをゲームで指定されているフォントにする。 | |
j_save.find(".save_list").css("font-family", that.kag.config.userFace); | |
j_save.find(".save_display_area").each(function() { | |
$(this).click(function(e) { | |
var num = $(this).attr("data-num"); | |
var save_num = array[num]; | |
//◆ここから変更 | |
if(save_num.protect == "true"){ | |
alertify.alert("このセーブデータは保護されています。", function () { | |
}); | |
}else{ | |
that.snap = null; | |
that.doSave(num); | |
var layer_menu = that.kag.layer.getMenuLayer(); | |
layer_menu.hide(); | |
layer_menu.empty(); | |
if (that.kag.stat.visible_menu_button == true) { | |
$(".button_menu").show(); | |
} | |
} | |
}); | |
}); | |
//◆保護 | |
j_save.find(".save_protect").each(function() { | |
$(this).click(function(e) { | |
var num = $(this).attr("data-num"); | |
that.doSaveProtect(num); | |
}); | |
}); | |
//◆削除 | |
j_save.find(".save_del").each(function() { | |
$(this).click(function(e) { | |
var num = $(this).attr("data-num"); | |
alertify.confirm("セーブデータを削除してもいいですか?", function (e) { | |
if (e) { | |
that.doSaveDelete(num); | |
} else { | |
//after clicking Cancel | |
} | |
}); | |
}); | |
}); | |
var layer_menu = that.kag.layer.getMenuLayer(); | |
that.setMenu(j_save); | |
}); | |
}; | |
tyrano.plugin.kag.menu.doSaveDelete = function(num) { | |
var array_save = this.getSaveData(); | |
var that = this; | |
array_save.data[num] = { | |
save_date : "", | |
title : $.lang("not_saved"), | |
current_order_index : 0, | |
img_data : "", | |
stat : {}, | |
layer : "", | |
protect : "" | |
}; | |
$.setStorage(that.kag.config.projectID + "_tyrano_data", array_save, that.kag.config.configSave); | |
that.displaySave(); | |
}; | |
tyrano.plugin.kag.menu.doSaveProtect = function(num) { | |
var array_save = this.getSaveData(); | |
var save_num = array_save.data[num]; | |
var that = this; | |
if(save_num.protect == null){ | |
save_num.protect = "true"; | |
}else { | |
save_num.protect = null; | |
}; | |
$.setStorage(that.kag.config.projectID + "_tyrano_data", array_save, that.kag.config.configSave); | |
that.displaySave(); | |
}; | |
[endscript] | |
[return] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment