//////////////////////////////////////////////////
// 
// 2015/01/23
// s_e_beat
// 操作説明1枚画面
// 
//////////////////////////////////////////////////
///////////////////////////////////////////////////////////////
// lydialogからソースを間借りして、ボタン動作などをとめているので、
// 操作説明画面中はlydialogを使えません
///////////////////////////////////////////////////////////////
*operation_allbtndisable
[lua]
function operationAllButtonDisable(e)
	-- ダイアログ表示中のレイヤーイベントプロセスを制御
	e:tag{ "var", name = "t.cl_li", system = "get_layer_info"}

	for i = 0, tonumber(e:var("t.cl_li.size")) - 1 do
		e:tag{"lyevent", id = e:var("t.cl_li.".. i ..".id"), type = "click", mode = "disable"}
		e:tag{"lyevent", id = e:var("t.cl_li.".. i ..".id"), type = "rollover", mode = "disable"}
		e:tag{"lyevent", id = e:var("t.cl_li.".. i ..".id"), type = "rollout", mode = "disable"}
		i = i + 1
	end
end
[/lua]
[calllua function = "operationAllButtonDisable"]
[return]
///////////////////////////////////////////////////////////////
*operation_allbtnenable
[lua]
function operationAllButtonEnable(e)
	-- ダイアログ表示中のレイヤーイベントプロセスを制御
	e:tag{ "var", name = "t.cl_li", system = "get_layer_info"}

	for i = 0, tonumber(e:var("t.cl_li.size")) - 1 do
		e:tag{"lyevent", id = e:var("t.cl_li.".. i ..".id"), type = "click", mode = "enable"}
		e:tag{"lyevent", id = e:var("t.cl_li.".. i ..".id"), type = "rollover", mode = "enable"}
		e:tag{"lyevent", id = e:var("t.cl_li.".. i ..".id"), type = "rollout", mode = "enable"}
		i = i + 1
	end
end
[/lua]
[calllua function = "operationAllButtonEnable"]
[return]
///////////////////////////////////////////////////////////////
*operation_se
// seが必要であれば
[se_play id="0" file="$os_snd_path + 'se/se0000'" loop="0"]

*operation

// id
[var name = "t.id" data = "1000"]

// pass
[var name = "t.path" data = "image/menu/config/"]


// OSの決定
[var name = "t.os" system = "os"]

// 全ボタンdisable
[call label = "operation_allbtndisable"]

// キーイベントハンドラを隠す
[hide_setonpush]


// フラグ管理 レイヤーダイアログのフラグを間借りする
// 注意：操作説明画面中でlydialogは出せない
[var name = "t.lydialog.flag" data = "1"]

// 処理の開始
// マスクする（必要であれば）
[lycolor id = "$t.id - 1" color = "black"]
[lyprop id = "$t.id - 1" alpha = "0x888888"]

// base画像
[if estimate = "$t.os == 'windows'"]
	[lyc2 id = "$t.id + '.0'" file = "$t.path + 'msg_operation'"]
[else]
	[lyc2 id = "$t.id + '.0'" file = "$t.path + 'msg_operation_ios'"]
[/if]

// Cancelボタン設置
[btn id = "$t.id + '.1'" file = "$t.path + 'btn_operation_back'"]
[btn_on id = "$t.id + '.1'" call = "0" file = "system/operate.iet" label = "operation_cancel" effect = "on"]

// アンカー打ち込み
[var name = "t.li" system = "get_layer_info" id = "$t.id + '.0'"]
[lyprop id = "$t.id" anchorx = "$t.li.width / 2" anchory = "$t.li.height / 2"]

// 描画アニメーション
[lytween id = "$t.id" param = "xscale" ease = "easeout_cubic" from = "130" to = "100" time = "800"]
[lytween id = "$t.id" param = "yscale" ease = "easeout_cubic" from = "130" to = "100" time = "800"]

// 描画の開始
[trans type = "1" time = "800" input = "0"]

// キーを設定
[setonpush key = "2" label = "operation_cancel" call = "0"]
[setonpush key = "139" label = "operation_cancel" call = "0"]
[setonpush key = "8" label = "operation_cancel" call = "0"]
[setonpush key = "27" label = "operation_cancel" call = "0"]
// ファンクションキーもセットしておく
[if estimate = "$g.function.help != 0"]
	[setonpush key = "$g.function.help" call = "0" label = "operation_cancel"]
[/if]
[stop]
//////////////////////////////////////////////////
// ボタン押下後
*operation_cancel
// SE再生(必要であれば)
[se_play id="0" file="$os_snd_path + 'se/se0001'" loop="0"]

[jump label = "operation_leave"]
//////////////////////////////////////////////////
*operation_leave

// キーを削除
[delonpush key = "2"]
[delonpush key = "139"]
[delonpush key = "8"]
[delonpush key = "27"]
// ファンクションキーも削除
[if estimate = "$g.function.help != 0"]
	[delonpush key = "$g.function.help" call = "1"]

// 描画の消去
[lydel id = "$t.id - 1"]
[lydel id = "$t.id"]

[trans type = "1" time = "800" input = "0"]


// フラグ管理
[var name = "t.lydialog.flag" data = "0"]

// キーイベントハンドラを戻す
[hideon_setonpush]

// 全ボタンenable
[call label = "operation_allbtnenable"]
[return]
//////////////////////////////////////////////////
*last
[return]
