[update] start frame buttons state
This commit is contained in:
@@ -34,9 +34,17 @@ import ru.m.puzzlez.storage.ImageStorage;
|
|||||||
sources.data = data;
|
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 {
|
override public function onShow(data:Dynamic):Void {
|
||||||
loadButton.text = 'Resume (${gameStorage.list(STARTED).length})';
|
refresh();
|
||||||
completeButton.text = 'Complete (${gameStorage.list(COMPLETE).length})';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function sourceViewFactory(index:Int, source:ImageListSource<Dynamic>):ButtonView {
|
private function sourceViewFactory(index:Int, source:ImageListSource<Dynamic>):ButtonView {
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ views:
|
|||||||
style: button.red
|
style: button.red
|
||||||
text: Clean
|
text: Clean
|
||||||
+onPress: ~clean()
|
+onPress: ~clean()
|
||||||
|
visible: false
|
||||||
- $type: haxework.view.form.LabelView
|
- $type: haxework.view.form.LabelView
|
||||||
text: $r:text:version
|
text: $r:text:version
|
||||||
geometry.position: absolute
|
geometry.position: absolute
|
||||||
|
|||||||
Reference in New Issue
Block a user