diff --git a/TODO.md b/TODO.md index e36a01a..39db9de 100644 --- a/TODO.md +++ b/TODO.md @@ -1,6 +1,6 @@ # List TODO for Cruese Engine ## v1.1 (Small Updated) -- [ ] Add a card display game onto `GameSelectionState` (it likely display cartridge) +- [X] Add a card display game onto `GameSelectionState` (it likely display cartridge) - [X] Add a crash handler - [X] Add a `About` class diff --git a/assets/images/gameUI/cardGameMissing.png b/assets/images/gameUI/cardGameMissing.png index a5b5b19..f16b444 100644 Binary files a/assets/images/gameUI/cardGameMissing.png and b/assets/images/gameUI/cardGameMissing.png differ diff --git a/source/GameSelectionState.hx b/source/GameSelectionState.hx index fe0c2dc..f59e4d1 100644 --- a/source/GameSelectionState.hx +++ b/source/GameSelectionState.hx @@ -14,6 +14,7 @@ import flixel.text.FlxText; import flixel.util.FlxColor; import haxe.io.Bytes; import openfl.Lib; +import openfl.display.Bitmap; import openfl.display.BitmapData; // thought, i wanna make this like a game console @@ -155,7 +156,12 @@ class GameSelectionState extends FlxState } try { - cardGame.loadGraphic(PolyHandler.trackedMods[curSelected].modPath + "/cardGame.png"); + var data = BitmapData.fromFile(PolyHandler.trackedMods[curSelected].modPath + "/cardGame.png"); + // trace(data); + if (data == null) + cardGame.loadGraphic(Paths.image('gameUI/cardGameMissing')); + else + cardGame.loadGraphic(data); } catch (e:Dynamic) {