feature/list-object-counter (#60)
Co-authored-by: VAILLANT Jeremy <vaillant.jeremy@dev-crea.com> Reviewed-on: Athena/game-source#60 Co-authored-by: darknight <vaillant.jeremy@dev-crea.com> Co-committed-by: darknight <vaillant.jeremy@dev-crea.com>
This commit is contained in:
+15
-6
@@ -3,15 +3,15 @@ extends "res://db/MBase.gd"
|
||||
var m_name = null
|
||||
var m_thumb = null
|
||||
var m_level = null
|
||||
var mscene = load("res://db/MScene.gd")
|
||||
|
||||
func _init(row_idx):
|
||||
m_level = row_idx
|
||||
table = Global.database.get_table_by_name("levels")
|
||||
|
||||
var datas = table.get_data_at_row_idx(m_level)
|
||||
if true:
|
||||
m_name = _get_name(datas)
|
||||
m_thumb = _get_thumb(datas)
|
||||
m_name = _get_name(datas)
|
||||
m_thumb = _get_thumb(datas)
|
||||
|
||||
func object_to_find():
|
||||
var count = 0
|
||||
@@ -22,15 +22,24 @@ func object_to_find():
|
||||
|
||||
return count as String
|
||||
|
||||
func reset():
|
||||
var scene_detail = null
|
||||
var t = Global.database.get_table_by_name("scenes")
|
||||
|
||||
for row_index in range(0, t.m_rows_count):
|
||||
scene_detail = mscene.new(row_index)
|
||||
if scene_detail.label() != null:
|
||||
scene_detail.set_lock(int(false))
|
||||
|
||||
func _scenes():
|
||||
return Global.database.get_table_by_name("scenes")
|
||||
|
||||
func object_finding():
|
||||
var count = 0
|
||||
var datas = _scenes().get_data_by_prop_name_and_data("lock", String(m_level))
|
||||
|
||||
if datas.size() != 0:
|
||||
count = datas.count(true)
|
||||
for datas in _scenes().get_dictionary_by_prop_name_and_data("level", String(m_level)):
|
||||
if int(datas['lock']) == 1:
|
||||
count = count + 1
|
||||
|
||||
return count as String
|
||||
|
||||
|
||||
Reference in New Issue
Block a user