Skip to content

Commit

Permalink
Fix images only showing up after reload
Browse files Browse the repository at this point in the history
  • Loading branch information
piepie62 committed Oct 10, 2020
1 parent c5af6f7 commit b232a84
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Foresight.as3proj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<output>
<movie outputType="Application" />
<movie input="" />
<movie path="C:\Program Files (x86)\Steam\steamapps\common\GemCraft Frostborn Wrath\Mods\Foresight-0.0.1-for-1.1.2b.swf" />
<movie path="C:\Program Files (x86)\Steam\steamapps\common\GemCraft Frostborn Wrath\Mods\Foresight-0.0.2-for-1.1.2b.swf" />
<movie fps="30" />
<movie width="800" />
<movie height="600" />
Expand Down
27 changes: 18 additions & 9 deletions src/pie/Foresight/Foresight.as
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ package pie.Foresight
*/
public class Foresight extends MovieClip
{
public const VERSION:String = "0.0.1";
public const VERSION:String = "0.0.2";
public const GAME_VERSION:String = "1.1.2b";
public const BEZEL_VERSION:String = "0.2.1";
public const MOD_NAME:String = "Foresight";
Expand Down Expand Up @@ -191,19 +191,14 @@ package pie.Foresight
var hud:Object = core.cnt.cntRetinaHud;
if (this.currentStage != core.stageData)
{
clearImages();
for (var x:int = 0; x < 60; x++)
{
for (var y:int = 0; y < 38; y++)
{
hud.addChild(this.images[x][y]);
}
}
clearImages();
this.placingType = -1;
this.currentStage = core.stageData;
return;
}

ensureLoadedImages();

if (placingType == -1)
{
hud.removeChild(cursorImage);
Expand Down Expand Up @@ -302,6 +297,20 @@ package pie.Foresight
}
return null;
}

private function ensureLoadedImages(): void
{
if (!core.cnt.cntRetinaHud.contains(this.images[0][0]))
{
for (var x:int = 0; x < 60; x++)
{
for (var y:int = 0; y < 38; y++)
{
core.cnt.cntRetinaHud.addChild(this.images[x][y]);
}
}
}
}
}

}

0 comments on commit b232a84

Please sign in to comment.