Skip to content

Commit

Permalink
Replaced the fullscreen functionality with a new solution involving m…
Browse files Browse the repository at this point in the history
…aking external calls to the embedding page's JavaScript to dynamically resize the Flash container.

Rebased the wrapper from v6.5 to v6.4 of the game to fix a couple issues present in v6.5, mainly incorrect fonts.
Changed the Flash documents to target Flash Player 10.2 (highest version in Flash CS5.5).
  • Loading branch information
leveleditor committed Jun 7, 2017
1 parent aa6821a commit 009bdee
Show file tree
Hide file tree
Showing 10 changed files with 124 additions and 72 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,6 @@ RECOVER_*/
*.swd

# Project specific
v6_4_game.swf
v6_5_game.swf
loader_v0_5_1_unofficial.swf
52 changes: 35 additions & 17 deletions cac_wrapper/DOMDocument.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2740,8 +2740,8 @@
<script><![CDATA[import utils.*;
// CAC Settings
var asseturl:String = "v6_5_";
var xmlurl:String = "dialogue_v6_5.xml";
var asseturl:String = "v6_4_";
var xmlurl:String = "dialogue_wrapper.xml";
var gamename:String = "CrystalAlienConflict";
// Mod related
Expand Down Expand Up @@ -2794,14 +2794,32 @@ function _getVersion() {
return getVersion();
}
function goFullScreen() {
Stage["displayState"] = "fullScreen";
Log("goFullScreen() requested, displayState = " + Stage["displayState"]);
Stage["displayState"] = "fullScreenInteractive";
Log("fullScreenInteractive requested, displayState = " + Stage["displayState"]);
if (Stage["displayState"] != "fullScreenInteractive") {
Stage["displayState"] = "fullScreen";
Log("fullScreenInteractive failed, falling back to fullScreen, displayState = " + Stage["displayState"]);
function enterFullscreen() {
Log("enterFullscreen() requested");
if (ExternalInterface.available) {
try {
ExternalInterface.call("enterFullscreen");
Stage.scaleMode = "showAll";
Log("Wrapper called enterFullscreen();");
} catch (e:Error) {
Log("ExternalInterface error: " + e.toString());
}
} else {
Log("enterFullscreen() : ExternalInterface not available.");
}
}
function exitFullscreen() {
Log("exitFullscreen() requested");
if (ExternalInterface.available) {
try {
ExternalInterface.call("exitFullscreen");
Stage.scaleMode = "noScale";
Log("Wrapper called exitFullscreen();");
} catch (e:Error) {
Log("ExternalInterface error: " + e.toString());
}
} else {
Log("exitFullscreen() : ExternalInterface not available.");
}
}
Expand Down Expand Up @@ -3688,6 +3706,13 @@ on (release) {
</persistentData>
<PrinterSettings/>
<publishHistory>
<PublishItem publishSize="73933" publishTime="1496789438"/>
<PublishItem publishSize="73934" publishTime="1496789171"/>
<PublishItem publishSize="73903" publishTime="1496365333"/>
<PublishItem publishSize="73901" publishTime="1496365251"/>
<PublishItem publishSize="73918" publishTime="1496358323"/>
<PublishItem publishSize="73917" publishTime="1496358014"/>
<PublishItem publishSize="73918" publishTime="1496357929"/>
<PublishItem publishSize="73759" publishTime="1478222520"/>
<PublishItem publishSize="73771" publishTime="1466550086"/>
<PublishItem publishSize="73766" publishTime="1466549855"/>
Expand All @@ -3701,12 +3726,5 @@ on (release) {
<PublishItem publishSize="73764" publishTime="1466549167"/>
<PublishItem publishSize="73764" publishTime="1466548837"/>
<PublishItem publishSize="73703" publishTime="1460520917"/>
<PublishItem publishSize="73687" publishTime="1460520811"/>
<PublishItem publishSize="73679" publishTime="1460520559"/>
<PublishItem publishSize="73678" publishTime="1460520512"/>
<PublishItem publishSize="73678" publishTime="1460520497"/>
<PublishItem publishSize="73681" publishTime="1460520483"/>
<PublishItem publishSize="73678" publishTime="1460520435"/>
<PublishItem publishSize="73679" publishTime="1460520420"/>
</publishHistory>
</DOMDocument>
4 changes: 2 additions & 2 deletions cac_wrapper/PublishSettings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@
<EventFormat>0</EventFormat>
<EventCompress>7</EventCompress>
<OverrideSounds>0</OverrideSounds>
<Version>8</Version>
<ExternalPlayer></ExternalPlayer>
<Version>11</Version>
<ExternalPlayer>FlashPlayer10.2</ExternalPlayer>
<ActionScriptVersion>2</ActionScriptVersion>
<PackageExportFrame>1</PackageExportFrame>
<PackagePaths></PackagePaths>
Expand Down
74 changes: 49 additions & 25 deletions cac_wrapper_light/DOMDocument.xml
Original file line number Diff line number Diff line change
Expand Up @@ -593,8 +593,8 @@
<script><![CDATA[import utils.*;
// CAC Settings
var asseturl:String = "v6_5_";
var xmlurl:String = "dialogue_v6_5_light.xml";
var asseturl:String = "v6_4_";
var xmlurl:String = "dialogue_wrapper_light.xml";
var gamename:String = "CrystalAlienConflict";
// Mod related
Expand Down Expand Up @@ -657,9 +657,33 @@ function _getVersion() {
return getVersion();
}
function goFullScreen() {
Stage["displayState"] = "fullScreen";
trace("goFullScreen() requested, displayState = " + Stage["displayState"]);
function enterFullscreen() {
Log("enterFullscreen() requested");
if (ExternalInterface.available) {
try {
ExternalInterface.call("enterFullscreen");
Stage.scaleMode = "showAll";
Log("Wrapper called enterFullscreen();");
} catch (e:Error) {
Log("ExternalInterface error: " + e.toString());
}
} else {
Log("enterFullscreen() : ExternalInterface not available.");
}
}
function exitFullscreen() {
Log("exitFullscreen() requested");
if (ExternalInterface.available) {
try {
ExternalInterface.call("exitFullscreen");
Stage.scaleMode = "noScale";
Log("Wrapper called exitFullscreen();");
} catch (e:Error) {
Log("ExternalInterface error: " + e.toString());
}
} else {
Log("exitFullscreen() : ExternalInterface not available.");
}
}
function deleteFromArray(arr:Array, key:Object, value:Object):Void {
Expand Down Expand Up @@ -1328,25 +1352,25 @@ stop();]]></script>
</persistentData>
<PrinterSettings/>
<publishHistory>
<PublishItem publishSize="34142" publishTime="1478830668"/>
<PublishItem publishSize="34143" publishTime="1478830649"/>
<PublishItem publishSize="33541" publishTime="1478830633"/>
<PublishItem publishSize="33541" publishTime="1478830606"/>
<PublishItem publishSize="34144" publishTime="1478830534"/>
<PublishItem publishSize="34141" publishTime="1478830507"/>
<PublishItem publishSize="34142" publishTime="1478830477"/>
<PublishItem publishSize="34141" publishTime="1478830455"/>
<PublishItem publishSize="34141" publishTime="1478830440"/>
<PublishItem publishSize="34140" publishTime="1478830288"/>
<PublishItem publishSize="34141" publishTime="1478830239"/>
<PublishItem publishSize="34158" publishTime="1478830155"/>
<PublishItem publishSize="34142" publishTime="1478830141"/>
<PublishItem publishSize="34157" publishTime="1478830123"/>
<PublishItem publishSize="34141" publishTime="1478829656"/>
<PublishItem publishSize="34143" publishTime="1478829646"/>
<PublishItem publishSize="34136" publishTime="1478826786"/>
<PublishItem publishSize="34133" publishTime="1478826219"/>
<PublishItem publishSize="34134" publishTime="1478826163"/>
<PublishItem publishSize="34136" publishTime="1478825831"/>
<PublishItem publishSize="34211" publishTime="1496789590"/>
<PublishItem publishSize="34209" publishTime="1496789562"/>
<PublishItem publishSize="34203" publishTime="1496789430"/>
<PublishItem publishSize="34198" publishTime="1496789168"/>
<PublishItem publishSize="34207" publishTime="1495940707"/>
<PublishItem publishSize="34206" publishTime="1495940573"/>
<PublishItem publishSize="34202" publishTime="1495937143"/>
<PublishItem publishSize="34200" publishTime="1495932279"/>
<PublishItem publishSize="34181" publishTime="1495932103"/>
<PublishItem publishSize="34189" publishTime="1495931961"/>
<PublishItem publishSize="34188" publishTime="1495602761"/>
<PublishItem publishSize="34149" publishTime="1495602512"/>
<PublishItem publishSize="34151" publishTime="1495602389"/>
<PublishItem publishSize="34136" publishTime="1495601087"/>
<PublishItem publishSize="34137" publishTime="1495600885"/>
<PublishItem publishSize="34138" publishTime="1495598282"/>
<PublishItem publishSize="34140" publishTime="1495597510"/>
<PublishItem publishSize="34138" publishTime="1495597418"/>
<PublishItem publishSize="34127" publishTime="1495597350"/>
<PublishItem publishSize="34127" publishTime="1495597264"/>
</publishHistory>
</DOMDocument>
4 changes: 2 additions & 2 deletions cac_wrapper_light/PublishSettings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@
<EventFormat>4</EventFormat>
<EventCompress>10</EventCompress>
<OverrideSounds>1</OverrideSounds>
<Version>8</Version>
<ExternalPlayer></ExternalPlayer>
<Version>11</Version>
<ExternalPlayer>FlashPlayer10.2</ExternalPlayer>
<ActionScriptVersion>2</ActionScriptVersion>
<PackageExportFrame>1</PackageExportFrame>
<PackagePaths></PackagePaths>
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions mods/lost_levels/lost_levels/PublishSettings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@
<EventFormat>0</EventFormat>
<EventCompress>7</EventCompress>
<OverrideSounds>0</OverrideSounds>
<Version>8</Version>
<ExternalPlayer></ExternalPlayer>
<Version>11</Version>
<ExternalPlayer>FlashPlayer10.2</ExternalPlayer>
<ActionScriptVersion>2</ActionScriptVersion>
<PackageExportFrame>1</PackageExportFrame>
<PackagePaths></PackagePaths>
Expand Down
53 changes: 31 additions & 22 deletions mods/redux/redux/DOMDocument.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2782,8 +2782,10 @@ function registerCheat(id:String, code:String, linked:Array) {
this.enterCode = function(code) {
var level = false;
if (code == "fullscreen") {
Stage["displayState"] = "fullScreen";
_level0.goFullScreen();
// Previously this cheat just used Flash's native fullscreen feature:
// Stage["displayState"] = "fullScreen";
// but now we instead call on the wrapper to handle going fullscreen.
_level0.enterFullscreen();
level = "cheatFullscreen";
}
if (code == "fatwallet") {
Expand Down Expand Up @@ -2901,6 +2903,7 @@ function registerCheat(id:String, code:String, linked:Array) {
for (var i in this.customCheats) {
this.customCheats[i].isEnabled = false;
}
_level0.exitFullscreen();
};
this.cheatsEnabled = function() {
var yesCheating = false;
Expand Down Expand Up @@ -2963,6 +2966,12 @@ function CACMod_OnGameMenu():Void {
// Make a nicer reference to the game's root.
game = _level1;
// So long story short, this is basically what made v6.5 do anything resembling antialiasing.
// Now that we've gone back to using v6.4, we can just copy this line of code here.
// Although we technically don't need it anymore, it's good to keep it for reference
// and in case another mod decides to restore the old fullscreen method or such.
Stage.fullScreenSourceRect = new flash.geom.Rectangle(0, 0, 600, 400);
// No more high scores related functions!
game.sendScore = DisabledFunction;
game.saveScore = DisabledFunction;
Expand Down Expand Up @@ -3055,25 +3064,25 @@ function CACMod_OnGameMenu():Void {
</persistentData>
<PrinterSettings/>
<publishHistory>
<PublishItem publishSize="17742" publishTime="1494136748"/>
<PublishItem publishSize="17742" publishTime="1494136740"/>
<PublishItem publishSize="17687" publishTime="1494135653"/>
<PublishItem publishSize="17687" publishTime="1494134166"/>
<PublishItem publishSize="17665" publishTime="1494133937"/>
<PublishItem publishSize="17664" publishTime="1494132687"/>
<PublishItem publishSize="17657" publishTime="1494132634"/>
<PublishItem publishSize="17658" publishTime="1494132468"/>
<PublishItem publishSize="17338" publishTime="1494131730"/>
<PublishItem publishSize="17888" publishTime="1494131319"/>
<PublishItem publishSize="17888" publishTime="1494131267"/>
<PublishItem publishSize="17883" publishTime="1494131081"/>
<PublishItem publishSize="17938" publishTime="1494130972"/>
<PublishItem publishSize="17947" publishTime="1494130887"/>
<PublishItem publishSize="17945" publishTime="1494130838"/>
<PublishItem publishSize="17932" publishTime="1494130781"/>
<PublishItem publishSize="17931" publishTime="1494130737"/>
<PublishItem publishSize="17909" publishTime="1494130576"/>
<PublishItem publishSize="17912" publishTime="1494130488"/>
<PublishItem publishSize="17907" publishTime="1494130320"/>
<PublishItem publishSize="17785" publishTime="1496799312"/>
<PublishItem publishSize="17785" publishTime="1496799283"/>
<PublishItem publishSize="17785" publishTime="1496637228"/>
<PublishItem publishSize="17080" publishTime="1496211687"/>
<PublishItem publishSize="17080" publishTime="1496211660"/>
<PublishItem publishSize="17799" publishTime="1495942027"/>
<PublishItem publishSize="17793" publishTime="1495941802"/>
<PublishItem publishSize="17786" publishTime="1495941690"/>
<PublishItem publishSize="17721" publishTime="1495932243"/>
<PublishItem publishSize="17745" publishTime="1495931957"/>
<PublishItem publishSize="17745" publishTime="1495931910"/>
<PublishItem publishSize="17739" publishTime="1495602542"/>
<PublishItem publishSize="17739" publishTime="1495602274"/>
<PublishItem publishSize="17763" publishTime="1495601093"/>
<PublishItem publishSize="17763" publishTime="1495600913"/>
<PublishItem publishSize="17763" publishTime="1495600573"/>
<PublishItem publishSize="17742" publishTime="1495600489"/>
<PublishItem publishSize="17782" publishTime="1495600062"/>
<PublishItem publishSize="17799" publishTime="1495599937"/>
<PublishItem publishSize="17801" publishTime="1495599597"/>
</publishHistory>
</DOMDocument>
4 changes: 2 additions & 2 deletions mods/redux/redux/PublishSettings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@
<EventFormat>0</EventFormat>
<EventCompress>7</EventCompress>
<OverrideSounds>0</OverrideSounds>
<Version>8</Version>
<ExternalPlayer></ExternalPlayer>
<Version>11</Version>
<ExternalPlayer>FlashPlayer10.2</ExternalPlayer>
<ActionScriptVersion>2</ActionScriptVersion>
<PackageExportFrame>1</PackageExportFrame>
<PackagePaths></PackagePaths>
Expand Down

0 comments on commit 009bdee

Please sign in to comment.