[update] start frame buttons state

This commit is contained in:
2020-02-17 23:09:40 +03:00
parent e77259c6df
commit 6550975a4e
2 changed files with 11 additions and 2 deletions

View File

@@ -34,9 +34,17 @@ import ru.m.puzzlez.storage.ImageStorage;
sources.data = data;
}
private function refresh():Void {
var startedCount = gameStorage.list(STARTED).length;
var completeCount = gameStorage.list(COMPLETE).length;
loadButton.text = 'Resume (${startedCount})';
completeButton.text = 'Complete (${completeCount})';
loadButton.disabled = startedCount == 0;
completeButton.disabled = completeCount == 0;
}
override public function onShow(data:Dynamic):Void {
loadButton.text = 'Resume (${gameStorage.list(STARTED).length})';
completeButton.text = 'Complete (${gameStorage.list(COMPLETE).length})';
refresh();
}
private function sourceViewFactory(index:Int, source:ImageListSource<Dynamic>):ButtonView {

View File

@@ -37,6 +37,7 @@ views:
style: button.red
text: Clean
+onPress: ~clean()
visible: false
- $type: haxework.view.form.LabelView
text: $r:text:version
geometry.position: absolute