package_1 alternativa.osgi.service.console.variables

This commit is contained in:
Pyogenics
2025-01-26 10:28:25 +00:00
parent 6ba701b0a9
commit 98d9fbb377
14 changed files with 111 additions and 109 deletions

View File

@@ -11,10 +11,10 @@ package
import flash.events.FullScreenEvent;
import flash.events.KeyboardEvent;
import flash.ui.Keyboard;
import package_1.name_1;
import package_1.name_12;
import package_1.name_13;
import package_1.name_22;
import alternativa.osgi.service.console.variables.ConsoleVarFloat;
import alternativa.osgi.service.console.variables.ConsoleVarInt;
import alternativa.osgi.service.console.variables.ConsoleVarString;
import alternativa.osgi.service.console.variables.ConsoleVar;
import package_10.name_17;
import package_11.name_16;
import package_12.name_15;
@@ -65,49 +65,50 @@ package
super();
mouseEnabled = false;
mouseChildren = false;
this.method_7();
this.method_16();
this.method_6();
this.method_11();
this.initStage();
this.initClient();
this.initConsole();
this.initOptionsSupport();
name_2.fadeRadius = 7000;
name_2.spotAngle = 140 * Math.PI / 180;
name_2.fallofAngle = 170 * Math.PI / 180;
this.stage3D = stage.stage3Ds[0];
this.stage3D.addEventListener(Event.CONTEXT3D_CREATE,this.method_10);
this.stage3D.addEventListener(Event.CONTEXT3D_CREATE,this.onContextCreate);
this.stage3D.requestContext3D();
}
private function method_10(param1:Event) : void
private function onContextCreate(param1:Event) : void
{
switch(name_28.name_35(this.stage3D.context3D))
{
case name_6.DXT1:
this.method_3("cfg.dxt1.xml");
this.loadConfig("cfg.dxt1.xml");
break;
case name_6.ETC1:
this.method_3("cfg.etc1.xml");
this.loadConfig("cfg.etc1.xml");
break;
case name_6.PVRTC:
this.method_3("cfg.pvrtc.xml");
}
this.loadConfig("cfg.pvrtc.xml");
} }
}
private function method_11() : void
private function initOptionsSupport() : void
{
new name_12("fog_mode",0,0,3,this.method_1);
new name_1("fog_near",0,0,1000000,this.method_1);
new name_1("fog_far",5000,0,1000000,this.method_1);
new name_1("fog_density",1,0,1,this.method_1);
new name_1("horizon_offset",0,-1000000,1000000,this.method_1);
new name_1("horizon_size",5000,0,1000000,this.method_1);
new name_13("fog_color","0x0",this.method_1);
new ConsoleVarInt("fog_mode",0,0,3,this.onFogSettingsChange);
new ConsoleVarFloat("fog_near",0,0,1000000,this.onFogSettingsChange);
new ConsoleVarFloat("fog_far",5000,0,1000000,this.onFogSettingsChange);
new ConsoleVarFloat("fog_density",1,0,1,this.onFogSettingsChange);
new ConsoleVarFloat("horizon_offset",0,-1000000,1000000,this.onFogSettingsChange);
new ConsoleVarFloat("horizon_size",5000,0,1000000,this.onFogSettingsChange);
new ConsoleVarString("fog_color","0x0",this.onFogSettingsChange);
var _loc1_:name_4 = name_4(name_3.name_8().name_30(name_4));
_loc1_.name_45("fog_texture",this.method_18);
new name_1("beam_distance",7000,0,1000000,this.method_2);
new name_1("beam_spot",140,0,180,this.method_2);
new name_1("beam_fallof",170,0,180,this.method_2);
new name_1("beam_fallof",170,0,180,this.method_2);
new name_1("camera_smoothing",20,0,200,this.method_17);
_loc1_.name_45("fog_texture",this.onFogTextureChange);
new ConsoleVarFloat("beam_distance",7000,0,1000000,this.onLightSettingsChange);
new ConsoleVarFloat("beam_spot",140,0,180,this.onLightSettingsChange);
new ConsoleVarFloat("beam_fallof",170,0,180,this.onLightSettingsChange);
new ConsoleVarFloat("beam_fallof",170,0,180,this.onLightSettingsChange);
new ConsoleVarFloat("camera_smoothing",20,0,200,this.onControllerSettingsChange);
name_9.fogMode = name_9.DISABLED;
name_10.fogMode = name_10.DISABLED;
name_7.fogMode = name_7.DISABLED;
@@ -116,27 +117,27 @@ package
name_33.fogMode = name_11.DISABLED;
}
private function method_17(param1:name_1) : void
private function onControllerSettingsChange(param1:ConsoleVarFloat) : void
{
name_20.smoothing = param1.value;
}
private function method_2(param1:name_22) : void
private function onLightSettingsChange(param1:ConsoleVar) : void
{
switch(param1.name_32())
{
case "beam_distance":
name_2.fadeRadius = name_1(param1).value;
name_2.fadeRadius = ConsoleVarFloat(param1).value;
break;
case "beam_spot":
name_2.spotAngle = name_1(param1).value * Math.PI / 180;
name_2.spotAngle = ConsoleVarFloat(param1).value * Math.PI / 180;
break;
case "beam_fallof":
name_2.fallofAngle = name_1(param1).value * Math.PI / 180;
name_2.fallofAngle = ConsoleVarFloat(param1).value * Math.PI / 180;
}
}
private function method_1(param1:name_22) : void
private function onFogSettingsChange(param1:ConsoleVar) : void
{
var _loc3_:Number = NaN;
var _loc4_:Number = NaN;
@@ -145,41 +146,41 @@ package
switch(param1.name_32())
{
case "fog_mode":
_loc6_.name_41(name_12(param1).value);
_loc6_.name_41(ConsoleVarInt(param1).value);
break;
case "fog_near":
_loc6_.name_47(name_1(param1).value);
_loc6_.name_47(ConsoleVarFloat(param1).value);
break;
case "fog_far":
_loc6_.name_48(name_1(param1).value);
_loc6_.name_48(ConsoleVarFloat(param1).value);
break;
case "fog_density":
_loc6_.name_49(name_1(param1).value);
_loc6_.name_49(ConsoleVarFloat(param1).value);
break;
case "horizon_size":
_loc6_.name_38(name_1(param1).value);
_loc6_.name_38(ConsoleVarFloat(param1).value);
break;
case "horizon_offset":
_loc6_.name_34(name_1(param1).value);
_loc6_.name_34(ConsoleVarFloat(param1).value);
break;
case "fog_color":
_loc6_.name_40(parseInt(name_13(param1).value,16));
_loc6_.name_40(parseInt(ConsoleVarString(param1).value,16));
}
}
private function method_18(param1:name_4, param2:Array) : void
private function onFogTextureChange(param1:name_4, param2:Array) : void
{
this.gameKernel.name_5().name_36(param2.join(" "));
}
private function method_7() : void
private function initStage() : void
{
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.quality = StageQuality.LOW;
}
private function method_16() : void
private function initClient() : void
{
new name_3();
this.var_2 = new name_16();
@@ -189,7 +190,7 @@ package
new package_14.name_21().start(name_3.name_8());
}
private function method_6() : void
private function initConsole() : void
{
var _loc1_:name_4 = name_4(name_3.name_8().name_30(name_4));
_loc1_.width = 100;
@@ -197,36 +198,36 @@ package
_loc1_.height = 30;
}
private function method_3(param1:String) : void
private function loadConfig(param1:String) : void
{
addChild(this.preloader);
this.config = new name_18();
this.config.addEventListener(Event.COMPLETE,this.method_14);
this.config.addEventListener(Event.COMPLETE,this.onConfigLoadingComplete);
this.config.load(param1,this.preloader);
}
private function method_14(param1:Event) : void
private function onConfigLoadingComplete(param1:Event) : void
{
this.method_8();
this.method_13();
this.initGame();
this.initHUD();
}
private function method_13() : void
private function initHUD() : void
{
this.var_1 = new name_15();
stage.addChild(this.var_1);
this.var_1.mouseChildren = true;
this.var_1.mouseEnabled = true;
this.var_1.addEventListener("CLICK_FULL_SCREEN_BUTTON",this.method_19);
this.var_1.addEventListener("CLICK_NEXT_TANK_BUTTON",this.method_9);
this.var_1.addEventListener("CLICK_FULL_SCREEN_BUTTON",this.onClickFullScreenButton);
this.var_1.addEventListener("CLICK_NEXT_TANK_BUTTON",this.onClickNextTankButton);
stage.addChild(this.preloader);
stage.addEventListener(KeyboardEvent.KEY_DOWN,this.method_15);
stage.addEventListener(KeyboardEvent.KEY_DOWN,this.onKeyDown);
this.gameKernel.name_5().name_27().diagramVerticalMargin = 85;
this.gameKernel.name_5().name_27().diagramHorizontalMargin = 12;
this.method_4(null);
this.onResize(null);
}
private function method_15(param1:KeyboardEvent) : void
private function onKeyDown(param1:KeyboardEvent) : void
{
var _loc2_:DisplayObject = null;
if(param1.keyCode == Keyboard.G)
@@ -243,19 +244,19 @@ package
}
}
private function method_19(param1:Event) : void
private function onClickFullScreenButton(param1:Event) : void
{
stage.displayState = this.var_1.name_31 ? StageDisplayState.FULL_SCREEN : StageDisplayState.NORMAL;
stage.addEventListener(FullScreenEvent.FULL_SCREEN,this.method_5);
stage.addEventListener(FullScreenEvent.FULL_SCREEN,this.onFullScreenChange);
}
private function method_5(param1:Event) : void
private function onFullScreenChange(param1:Event) : void
{
stage.removeEventListener(FullScreenEvent.FULL_SCREEN,this.method_5);
stage.removeEventListener(FullScreenEvent.FULL_SCREEN,this.onFullScreenChange);
this.var_1.name_31 = stage.displayState != StageDisplayState.NORMAL;
}
private function method_9(param1:Event) : void
private function onClickNextTankButton(param1:Event) : void
{
if(testTask != null)
{
@@ -263,23 +264,23 @@ package
}
}
private function method_8() : void
private function initGame() : void
{
this.gameKernel = new name_17(stage,this.config.options);
this.gameKernel.name_5().name_37(this.stage3D);
var _loc1_:name_14 = new name_14(this.gameKernel,this.config,this,this.preloader);
this.gameKernel.addTask(_loc1_);
stage.addEventListener(Event.RESIZE,this.method_4);
this.method_4(null);
stage.addEventListener(Event.ENTER_FRAME,this.method_12);
stage.addEventListener(Event.RESIZE,this.onResize);
this.onResize(null);
stage.addEventListener(Event.ENTER_FRAME,this.onEnterFrame);
}
private function method_12(param1:Event) : void
private function onEnterFrame(param1:Event) : void
{
this.gameKernel.name_51();
}
private function method_4(param1:Event) : void
private function onResize(param1:Event) : void
{
var _loc2_:name_23 = null;
if(this.gameKernel != null)