mirror of
https://github.com/MapMakersAndProgrammers/TankiOnline2.0DemoClient.git
synced 2025-10-26 09:59:07 -07:00
Initial commit
This commit is contained in:
5
src/alternativa/engine3d/alternativa3d.as
Normal file
5
src/alternativa/engine3d/alternativa3d.as
Normal file
@@ -0,0 +1,5 @@
|
||||
package alternativa.engine3d
|
||||
{
|
||||
public namespace alternativa3d = "http://alternativaplatform.com/en/alternativa3d";
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package alternativa.tanks.game.usertitle
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[ExcludeClass]
|
||||
[Embed(source="/_assets/9_alternativa.tanks.game.usertitle.EffectIndicator_iconArmorCls_alternativa.tanks.game.usertitle.EffectIndicator_iconArmorCls.png")]
|
||||
public class EffectIndicator_iconArmorCls extends BitmapAsset
|
||||
{
|
||||
public function EffectIndicator_iconArmorCls()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package alternativa.tanks.game.usertitle
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[ExcludeClass]
|
||||
[Embed(source="/_assets/10_alternativa.tanks.game.usertitle.EffectIndicator_iconHealthCls_alternativa.tanks.game.usertitle.EffectIndicator_iconHealthCls.png")]
|
||||
public class EffectIndicator_iconHealthCls extends BitmapAsset
|
||||
{
|
||||
public function EffectIndicator_iconHealthCls()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package alternativa.tanks.game.usertitle
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[ExcludeClass]
|
||||
[Embed(source="/_assets/11_alternativa.tanks.game.usertitle.EffectIndicator_iconNitroCls_alternativa.tanks.game.usertitle.EffectIndicator_iconNitroCls.png")]
|
||||
public class EffectIndicator_iconNitroCls extends BitmapAsset
|
||||
{
|
||||
public function EffectIndicator_iconNitroCls()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package alternativa.tanks.game.usertitle
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[ExcludeClass]
|
||||
[Embed(source="/_assets/12_alternativa.tanks.game.usertitle.EffectIndicator_iconPowerCls_alternativa.tanks.game.usertitle.EffectIndicator_iconPowerCls.png")]
|
||||
public class EffectIndicator_iconPowerCls extends BitmapAsset
|
||||
{
|
||||
public function EffectIndicator_iconPowerCls()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package alternativa.tanks.game.usertitle
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[ExcludeClass]
|
||||
[Embed(source="/_assets/6_alternativa.tanks.game.usertitle.ProgressBarSkin_hpBlueEmptyCls_alternativa.tanks.game.usertitle.ProgressBarSkin_hpBlueEmptyCls.png")]
|
||||
public class ProgressBarSkin_hpBlueEmptyCls extends BitmapAsset
|
||||
{
|
||||
public function ProgressBarSkin_hpBlueEmptyCls()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package alternativa.tanks.game.usertitle
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[ExcludeClass]
|
||||
[Embed(source="/_assets/8_alternativa.tanks.game.usertitle.ProgressBarSkin_hpBlueFullCls_alternativa.tanks.game.usertitle.ProgressBarSkin_hpBlueFullCls.png")]
|
||||
public class ProgressBarSkin_hpBlueFullCls extends BitmapAsset
|
||||
{
|
||||
public function ProgressBarSkin_hpBlueFullCls()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package alternativa.tanks.game.usertitle
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[ExcludeClass]
|
||||
[Embed(source="/_assets/3_alternativa.tanks.game.usertitle.ProgressBarSkin_hpGreenEmptyCls_alternativa.tanks.game.usertitle.ProgressBarSkin_hpGreenEmptyCls.png")]
|
||||
public class ProgressBarSkin_hpGreenEmptyCls extends BitmapAsset
|
||||
{
|
||||
public function ProgressBarSkin_hpGreenEmptyCls()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package alternativa.tanks.game.usertitle
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[ExcludeClass]
|
||||
[Embed(source="/_assets/1_alternativa.tanks.game.usertitle.ProgressBarSkin_hpGreenFullCls_alternativa.tanks.game.usertitle.ProgressBarSkin_hpGreenFullCls.png")]
|
||||
public class ProgressBarSkin_hpGreenFullCls extends BitmapAsset
|
||||
{
|
||||
public function ProgressBarSkin_hpGreenFullCls()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package alternativa.tanks.game.usertitle
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[ExcludeClass]
|
||||
[Embed(source="/_assets/2_alternativa.tanks.game.usertitle.ProgressBarSkin_hpRedEmptyCls_alternativa.tanks.game.usertitle.ProgressBarSkin_hpRedEmptyCls.png")]
|
||||
public class ProgressBarSkin_hpRedEmptyCls extends BitmapAsset
|
||||
{
|
||||
public function ProgressBarSkin_hpRedEmptyCls()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package alternativa.tanks.game.usertitle
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[ExcludeClass]
|
||||
[Embed(source="/_assets/7_alternativa.tanks.game.usertitle.ProgressBarSkin_hpRedFullCls_alternativa.tanks.game.usertitle.ProgressBarSkin_hpRedFullCls.png")]
|
||||
public class ProgressBarSkin_hpRedFullCls extends BitmapAsset
|
||||
{
|
||||
public function ProgressBarSkin_hpRedFullCls()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package alternativa.tanks.game.usertitle
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[ExcludeClass]
|
||||
[Embed(source="/_assets/5_alternativa.tanks.game.usertitle.ProgressBarSkin_weaponEmptyCls_alternativa.tanks.game.usertitle.ProgressBarSkin_weaponEmptyCls.png")]
|
||||
public class ProgressBarSkin_weaponEmptyCls extends BitmapAsset
|
||||
{
|
||||
public function ProgressBarSkin_weaponEmptyCls()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package alternativa.tanks.game.usertitle
|
||||
{
|
||||
import mx.core.BitmapAsset;
|
||||
|
||||
[ExcludeClass]
|
||||
[Embed(source="/_assets/4_alternativa.tanks.game.usertitle.ProgressBarSkin_weaponFullCls_alternativa.tanks.game.usertitle.ProgressBarSkin_weaponFullCls.png")]
|
||||
public class ProgressBarSkin_weaponFullCls extends BitmapAsset
|
||||
{
|
||||
public function ProgressBarSkin_weaponFullCls()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
24
src/alternativa/tanks/game/usertitle/component/class_40.as
Normal file
24
src/alternativa/tanks/game/usertitle/component/class_40.as
Normal file
@@ -0,0 +1,24 @@
|
||||
package alternativa.tanks.game.usertitle.component
|
||||
{
|
||||
import package_114.class_35;
|
||||
|
||||
public class class_40 implements class_35
|
||||
{
|
||||
protected var component:name_245;
|
||||
|
||||
public function class_40(component:name_245)
|
||||
{
|
||||
super();
|
||||
this.component = component;
|
||||
}
|
||||
|
||||
public function start(data:*) : void
|
||||
{
|
||||
}
|
||||
|
||||
public function stop() : void
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
166
src/alternativa/tanks/game/usertitle/component/name_245.as
Normal file
166
src/alternativa/tanks/game/usertitle/component/name_245.as
Normal file
@@ -0,0 +1,166 @@
|
||||
package alternativa.tanks.game.usertitle.component
|
||||
{
|
||||
import alternativa.tanks.game.usertitle.name_607;
|
||||
import alternativa.tanks.game.usertitle.name_610;
|
||||
import alternativa.tanks.game.usertitle.name_613;
|
||||
import package_10.class_17;
|
||||
import package_10.name_17;
|
||||
import package_114.name_488;
|
||||
import package_18.name_44;
|
||||
import package_18.name_82;
|
||||
import package_45.name_182;
|
||||
import package_46.name_194;
|
||||
import package_71.name_252;
|
||||
import package_74.class_25;
|
||||
import package_75.name_236;
|
||||
|
||||
public class name_245 extends class_17 implements name_82
|
||||
{
|
||||
private static const REMOTE_LABEL_OFFSET_Z:int = 200;
|
||||
|
||||
private static var position:name_194 = new name_194();
|
||||
|
||||
private var var_505:name_607;
|
||||
|
||||
private var chassisComponent:name_236;
|
||||
|
||||
private var var_442:class_25;
|
||||
|
||||
private var localPlayer:Boolean;
|
||||
|
||||
private var var_424:name_488;
|
||||
|
||||
private var gameKernel:name_17;
|
||||
|
||||
private var var_426:Boolean;
|
||||
|
||||
private var var_506:name_609;
|
||||
|
||||
private var titleRenderer:name_610;
|
||||
|
||||
public function name_245(maxHealth:int, rankIcon:name_613, name:String, localPlayer:Boolean, label:name_617, configFlags:int, titleRenderer:name_610)
|
||||
{
|
||||
super();
|
||||
this.var_505 = new name_607(maxHealth,rankIcon,label);
|
||||
this.localPlayer = localPlayer;
|
||||
this.titleRenderer = titleRenderer;
|
||||
this.var_505.name_620(name);
|
||||
this.var_505.name_619(configFlags);
|
||||
}
|
||||
|
||||
public function name_328() : Boolean
|
||||
{
|
||||
return this.var_426;
|
||||
}
|
||||
|
||||
public function method_527() : Boolean
|
||||
{
|
||||
return this.localPlayer;
|
||||
}
|
||||
|
||||
public function method_524(maxHealth:int) : void
|
||||
{
|
||||
this.var_505.method_524(maxHealth);
|
||||
}
|
||||
|
||||
public function name_339(indicatorId:int, duration:int) : void
|
||||
{
|
||||
this.var_505.name_339(indicatorId,duration);
|
||||
}
|
||||
|
||||
public function name_330(indicatorId:int) : void
|
||||
{
|
||||
this.var_505.name_330(indicatorId);
|
||||
}
|
||||
|
||||
override public function initComponent() : void
|
||||
{
|
||||
this.chassisComponent = name_236(entity.getComponentStrict(name_236));
|
||||
this.var_442 = class_25(entity.getComponent(class_25));
|
||||
this.var_424 = new name_488();
|
||||
this.var_506 = new name_609(this);
|
||||
this.var_424.name_486(entity,name_252.SET_ACTIVATING_STATE,this.var_506);
|
||||
this.var_424.name_486(entity,name_252.SET_ACTIVE_STATE,this.var_506);
|
||||
this.var_424.name_486(entity,name_252.SET_DEAD_STATE,new name_492(this));
|
||||
var offSceneState:name_608 = new name_608(this);
|
||||
this.var_424.name_486(entity,name_252.SET_RESPAWN_STATE,offSceneState);
|
||||
this.var_424.name_493 = offSceneState;
|
||||
entity.addEventHandler(name_252.SET_HEALTH,this.method_525);
|
||||
}
|
||||
|
||||
private function method_525(eventType:String, data:*) : void
|
||||
{
|
||||
this.setHealth(Number(data));
|
||||
}
|
||||
|
||||
override public function addToGame(gameKernel:name_17) : void
|
||||
{
|
||||
this.gameKernel = gameKernel;
|
||||
this.var_505.name_612(gameKernel.name_5());
|
||||
}
|
||||
|
||||
override public function removeFromGame(gameKernel:name_17) : void
|
||||
{
|
||||
this.var_424.name_493.stop();
|
||||
this.removeFromScene();
|
||||
}
|
||||
|
||||
public function addToScene() : void
|
||||
{
|
||||
var renderSystem:name_44 = null;
|
||||
if(!this.var_426)
|
||||
{
|
||||
renderSystem = this.gameKernel.name_5();
|
||||
if(this.localPlayer)
|
||||
{
|
||||
this.var_505.name_615();
|
||||
}
|
||||
this.var_505.name_611(renderSystem.method_46());
|
||||
renderSystem.method_63(this);
|
||||
this.var_426 = true;
|
||||
}
|
||||
}
|
||||
|
||||
public function removeFromScene() : void
|
||||
{
|
||||
if(this.var_426)
|
||||
{
|
||||
this.var_505.name_618();
|
||||
this.gameKernel.name_5().method_64(this);
|
||||
this.var_426 = false;
|
||||
}
|
||||
}
|
||||
|
||||
public function setHealth(health:Number) : void
|
||||
{
|
||||
this.var_505.setHealth(health);
|
||||
}
|
||||
|
||||
public function method_526(rankId:int) : void
|
||||
{
|
||||
this.var_505.method_526(rankId);
|
||||
}
|
||||
|
||||
public function render() : void
|
||||
{
|
||||
this.chassisComponent.name_503(position);
|
||||
position.transform4(this.chassisComponent.name_502());
|
||||
if(this.localPlayer && this.var_442 != null)
|
||||
{
|
||||
this.var_505.name_616(this.var_442.method_396() * 100);
|
||||
}
|
||||
else
|
||||
{
|
||||
position.z += REMOTE_LABEL_OFFSET_Z;
|
||||
}
|
||||
this.titleRenderer.name_614(entity,this);
|
||||
this.var_505.update(position,name_182.time,name_182.timeDelta);
|
||||
}
|
||||
|
||||
public function getTitle() : name_607
|
||||
{
|
||||
return this.var_505;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
17
src/alternativa/tanks/game/usertitle/component/name_492.as
Normal file
17
src/alternativa/tanks/game/usertitle/component/name_492.as
Normal file
@@ -0,0 +1,17 @@
|
||||
package alternativa.tanks.game.usertitle.component
|
||||
{
|
||||
public class name_492 extends class_40
|
||||
{
|
||||
public function name_492(component:name_245)
|
||||
{
|
||||
super(component);
|
||||
}
|
||||
|
||||
override public function start(data:*) : void
|
||||
{
|
||||
component.addToScene();
|
||||
component.getTitle().setDeadState();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
16
src/alternativa/tanks/game/usertitle/component/name_608.as
Normal file
16
src/alternativa/tanks/game/usertitle/component/name_608.as
Normal file
@@ -0,0 +1,16 @@
|
||||
package alternativa.tanks.game.usertitle.component
|
||||
{
|
||||
public class name_608 extends class_40
|
||||
{
|
||||
public function name_608(component:name_245)
|
||||
{
|
||||
super(component);
|
||||
}
|
||||
|
||||
override public function start(data:*) : void
|
||||
{
|
||||
component.removeFromScene();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
17
src/alternativa/tanks/game/usertitle/component/name_609.as
Normal file
17
src/alternativa/tanks/game/usertitle/component/name_609.as
Normal file
@@ -0,0 +1,17 @@
|
||||
package alternativa.tanks.game.usertitle.component
|
||||
{
|
||||
public class name_609 extends class_40
|
||||
{
|
||||
public function name_609(component:name_245)
|
||||
{
|
||||
super(component);
|
||||
}
|
||||
|
||||
override public function start(data:*) : void
|
||||
{
|
||||
component.addToScene();
|
||||
component.getTitle().clearDeadState();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
18
src/alternativa/tanks/game/usertitle/component/name_617.as
Normal file
18
src/alternativa/tanks/game/usertitle/component/name_617.as
Normal file
@@ -0,0 +1,18 @@
|
||||
package alternativa.tanks.game.usertitle.component
|
||||
{
|
||||
import flash.display.IBitmapDrawable;
|
||||
|
||||
public interface name_617
|
||||
{
|
||||
function set text(param1:String) : void;
|
||||
|
||||
function get textWidth() : int;
|
||||
|
||||
function get textHeight() : int;
|
||||
|
||||
function set textColor(param1:uint) : void;
|
||||
|
||||
function method_777() : IBitmapDrawable;
|
||||
}
|
||||
}
|
||||
|
||||
624
src/alternativa/tanks/game/usertitle/name_607.as
Normal file
624
src/alternativa/tanks/game/usertitle/name_607.as
Normal file
@@ -0,0 +1,624 @@
|
||||
package alternativa.tanks.game.usertitle
|
||||
{
|
||||
import alternativa.tanks.game.usertitle.component.name_617;
|
||||
import flash.display.BitmapData;
|
||||
import flash.filters.GlowFilter;
|
||||
import flash.geom.Matrix;
|
||||
import flash.geom.Point;
|
||||
import flash.geom.Rectangle;
|
||||
import flash.utils.Dictionary;
|
||||
import package_126.name_723;
|
||||
import package_18.class_3;
|
||||
import package_19.name_494;
|
||||
import package_21.name_78;
|
||||
import package_28.name_93;
|
||||
import package_39.name_160;
|
||||
import package_4.class_5;
|
||||
import package_46.name_194;
|
||||
import package_5.name_3;
|
||||
|
||||
public class name_607
|
||||
{
|
||||
public static const BIT_LABEL:int = 1;
|
||||
|
||||
public static const BIT_HEALTH:int = 2;
|
||||
|
||||
public static const BIT_WEAPON:int = 4;
|
||||
|
||||
public static const BIT_EFFECTS:int = 8;
|
||||
|
||||
private static const CONFIG_FLAGS:int = BIT_LABEL | BIT_HEALTH | BIT_WEAPON | BIT_EFFECTS;
|
||||
|
||||
private static const DIRTY_MASK:int = CONFIG_FLAGS << 8;
|
||||
|
||||
private static const BIT_STATE_HIDDEN:int = 1 << 16;
|
||||
|
||||
private static const BIT_STATE_DEAD:int = 1 << 17;
|
||||
|
||||
private static const HIDDEN_STATE_FLAGS:int = BIT_STATE_HIDDEN | BIT_STATE_DEAD;
|
||||
|
||||
private static const MAX_PROGRESS:int = 100;
|
||||
|
||||
private static const EFFECT_WARNING_TIME:int = 3000;
|
||||
|
||||
private static const RANK_ICON_SIZE:int = 12;
|
||||
|
||||
private static const RANK_ICON_OFFSET_Y:int = 0;
|
||||
|
||||
private static const EFFECTS_ICON_SIZE:int = 16;
|
||||
|
||||
private static const LABEL_HEIGHT:int = 12;
|
||||
|
||||
private static const LABEL_SPACING:int = 0;
|
||||
|
||||
private static const HEALTH_BAR_SPACING_Y:int = 2;
|
||||
|
||||
private static const WEAPON_BAR_SPACING_Y:int = -1;
|
||||
|
||||
private static const EFFECTS_SPACING_Y:int = 4;
|
||||
|
||||
private static const EFFECTS_SPACING_X:int = 4;
|
||||
|
||||
private static const BAR_WIDTH:int = 100;
|
||||
|
||||
private static const BAR_HEIGHT:int = 13;
|
||||
|
||||
private static const TEXTURE_MARGIN:int = 3;
|
||||
|
||||
private static const TEXTURE_MARGIN_2:int = 2 * TEXTURE_MARGIN;
|
||||
|
||||
private static const ALPHA_SPEED:Number = 0.002;
|
||||
|
||||
private static const matrix:Matrix = new Matrix();
|
||||
|
||||
private static const filter:GlowFilter = new GlowFilter(0,0.8,4,4,3);
|
||||
|
||||
private static const indicatorTypes:Vector.<int> = Vector.<int>([name_722.TYPE_HEALTH,name_722.TYPE_ARMOR,name_722.TYPE_POWER,name_722.TYPE_NITRO]);
|
||||
|
||||
private static var teamTypeSkin:Dictionary = new Dictionary();
|
||||
|
||||
teamTypeSkin[name_723.NONE] = name_724.HEALTHBAR_DM;
|
||||
teamTypeSkin[name_723.BLUE] = name_724.HEALTHBAR_BLUE;
|
||||
teamTypeSkin[name_723.RED] = name_724.HEALTHBAR_RED;
|
||||
|
||||
private var flags:int;
|
||||
|
||||
private var sprite:name_494;
|
||||
|
||||
private var var_650:Rectangle;
|
||||
|
||||
private var material:class_5;
|
||||
|
||||
private var textureResource:name_93;
|
||||
|
||||
private var texture:BitmapData;
|
||||
|
||||
private var label:name_617;
|
||||
|
||||
private var labelText:String;
|
||||
|
||||
private var rankIcon:name_613;
|
||||
|
||||
private var rankId:int;
|
||||
|
||||
private var var_652:name_725;
|
||||
|
||||
private var var_654:name_725;
|
||||
|
||||
private var var_649:Vector.<name_722>;
|
||||
|
||||
private var var_651:int;
|
||||
|
||||
private var var_655:int;
|
||||
|
||||
private var var_653:Boolean;
|
||||
|
||||
private var maxHealth:int;
|
||||
|
||||
private var health:Number;
|
||||
|
||||
private var weaponStatus:Number;
|
||||
|
||||
private var teamType:name_723 = name_723.NONE;
|
||||
|
||||
private var resourceManager:class_3;
|
||||
|
||||
public function name_607(maxHealth:int, rankIcon:name_613, label:name_617)
|
||||
{
|
||||
super();
|
||||
this.maxHealth = maxHealth;
|
||||
this.rankIcon = rankIcon;
|
||||
this.label = label;
|
||||
this.resourceManager = this.resourceManager;
|
||||
this.textureResource = new name_93(null);
|
||||
this.material = new class_5(this.textureResource);
|
||||
this.material.var_21 = true;
|
||||
this.sprite = new name_494(100,100,this.material);
|
||||
this.sprite.material = this.material;
|
||||
this.sprite.perspectiveScale = false;
|
||||
this.setDeadState();
|
||||
}
|
||||
|
||||
public function name_612(resourceManager:class_3) : void
|
||||
{
|
||||
this.resourceManager = resourceManager;
|
||||
}
|
||||
|
||||
public function name_615() : void
|
||||
{
|
||||
this.sprite.alwaysOnTop = true;
|
||||
}
|
||||
|
||||
public function method_524(maxHealth:int) : void
|
||||
{
|
||||
this.maxHealth = maxHealth;
|
||||
}
|
||||
|
||||
public function method_798() : void
|
||||
{
|
||||
this.method_782(BIT_STATE_HIDDEN);
|
||||
}
|
||||
|
||||
public function method_796() : void
|
||||
{
|
||||
this.method_781(BIT_STATE_HIDDEN);
|
||||
}
|
||||
|
||||
public function setDeadState() : void
|
||||
{
|
||||
this.method_782(BIT_STATE_DEAD);
|
||||
}
|
||||
|
||||
public function clearDeadState() : void
|
||||
{
|
||||
this.method_781(BIT_STATE_DEAD);
|
||||
}
|
||||
|
||||
public function method_141() : Boolean
|
||||
{
|
||||
return (this.flags & HIDDEN_STATE_FLAGS) == 0;
|
||||
}
|
||||
|
||||
public function name_619(configFlags:int) : void
|
||||
{
|
||||
if(!this.method_778(configFlags))
|
||||
{
|
||||
this.method_782(configFlags);
|
||||
this.method_783();
|
||||
}
|
||||
}
|
||||
|
||||
public function method_795(teamType:name_723) : void
|
||||
{
|
||||
var bit:int = 0;
|
||||
if(this.teamType != teamType)
|
||||
{
|
||||
this.teamType = teamType;
|
||||
for each(bit in [BIT_LABEL,BIT_HEALTH,BIT_WEAPON])
|
||||
{
|
||||
if(this.method_778(bit))
|
||||
{
|
||||
this.method_779(bit);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function method_526(rankId:int) : void
|
||||
{
|
||||
if(this.rankId != rankId)
|
||||
{
|
||||
this.rankId = rankId;
|
||||
if(this.method_778(BIT_LABEL))
|
||||
{
|
||||
this.method_779(BIT_LABEL | BIT_HEALTH | BIT_WEAPON | BIT_EFFECTS);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function name_620(labelText:String) : void
|
||||
{
|
||||
if(this.labelText != labelText)
|
||||
{
|
||||
this.labelText = labelText;
|
||||
if(this.method_778(BIT_LABEL))
|
||||
{
|
||||
this.method_783();
|
||||
this.method_779(BIT_LABEL | BIT_HEALTH | BIT_WEAPON | BIT_EFFECTS);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function setHealth(health:Number) : void
|
||||
{
|
||||
if(this.health != health)
|
||||
{
|
||||
this.health = health;
|
||||
if(this.method_778(BIT_HEALTH))
|
||||
{
|
||||
this.method_779(BIT_HEALTH);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function name_616(weaponStatus:Number) : void
|
||||
{
|
||||
if(this.weaponStatus != weaponStatus)
|
||||
{
|
||||
this.weaponStatus = weaponStatus;
|
||||
if(this.method_778(BIT_WEAPON))
|
||||
{
|
||||
this.method_779(BIT_WEAPON);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function name_339(indicatorId:int, duration:int) : void
|
||||
{
|
||||
var indicator:name_722 = null;
|
||||
if(this.method_778(BIT_EFFECTS))
|
||||
{
|
||||
indicator = this.method_785(indicatorId);
|
||||
if(indicator != null)
|
||||
{
|
||||
if(indicator.name_726())
|
||||
{
|
||||
this.method_787(1);
|
||||
}
|
||||
indicator.show(duration);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function name_330(indicatorId:int) : void
|
||||
{
|
||||
var indicator:name_722 = null;
|
||||
if(this.method_778(BIT_EFFECTS))
|
||||
{
|
||||
indicator = this.method_785(indicatorId);
|
||||
if(indicator != null)
|
||||
{
|
||||
indicator.hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function method_797() : void
|
||||
{
|
||||
var indicatorId:int = 0;
|
||||
if(this.var_649 != null && this.method_778(BIT_EFFECTS))
|
||||
{
|
||||
for each(indicatorId in indicatorTypes)
|
||||
{
|
||||
this.name_330(indicatorId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal function method_794(indicator:name_722) : void
|
||||
{
|
||||
indicator.clear(this.texture);
|
||||
this.method_787(-1);
|
||||
}
|
||||
|
||||
public function update(pos:name_194, time:int, timeDelta:int) : void
|
||||
{
|
||||
var reloadResource:Boolean = false;
|
||||
var effectIndicator:name_722 = null;
|
||||
this.name_201(pos);
|
||||
this.method_791(timeDelta);
|
||||
if(this.method_786(DIRTY_MASK))
|
||||
{
|
||||
reloadResource = true;
|
||||
if(this.method_780(BIT_LABEL))
|
||||
{
|
||||
this.method_789();
|
||||
}
|
||||
if(this.method_780(BIT_HEALTH))
|
||||
{
|
||||
this.var_652.name_727(teamTypeSkin[this.teamType]);
|
||||
this.var_652.progress = MAX_PROGRESS * this.health / this.maxHealth;
|
||||
this.var_652.draw(this.texture);
|
||||
}
|
||||
if(this.method_780(BIT_WEAPON))
|
||||
{
|
||||
this.var_654.progress = this.weaponStatus;
|
||||
this.var_654.draw(this.texture);
|
||||
}
|
||||
if(this.method_780(BIT_EFFECTS))
|
||||
{
|
||||
for each(effectIndicator in this.var_649)
|
||||
{
|
||||
effectIndicator.name_728();
|
||||
}
|
||||
}
|
||||
this.method_781(DIRTY_MASK);
|
||||
}
|
||||
if(this.method_778(BIT_EFFECTS))
|
||||
{
|
||||
reloadResource = this.method_792(time,timeDelta) || reloadResource;
|
||||
}
|
||||
if(reloadResource)
|
||||
{
|
||||
this.resourceManager.method_30(this.textureResource);
|
||||
}
|
||||
}
|
||||
|
||||
private function method_780(bit:int) : Boolean
|
||||
{
|
||||
var mask:int = bit | bit << 8;
|
||||
return (mask & this.flags) == mask;
|
||||
}
|
||||
|
||||
private function method_792(now:int, delta:int) : Boolean
|
||||
{
|
||||
var indicator:name_722 = null;
|
||||
var i:int = 0;
|
||||
var wereUpdated:Boolean = false;
|
||||
var x:int = 0;
|
||||
var num:int = int(this.var_649.length);
|
||||
if(this.var_653)
|
||||
{
|
||||
this.var_653 = false;
|
||||
x = this.var_650.width + TEXTURE_MARGIN_2 - this.var_651 * EFFECTS_ICON_SIZE - (this.var_651 - 1) * EFFECTS_SPACING_X >> 1;
|
||||
for(i = 0; i < num; )
|
||||
{
|
||||
indicator = this.var_649[i];
|
||||
if(indicator.method_141())
|
||||
{
|
||||
indicator.clear(this.texture);
|
||||
}
|
||||
if(!indicator.name_726())
|
||||
{
|
||||
indicator.name_201(x,this.var_655);
|
||||
x += EFFECTS_ICON_SIZE + EFFECTS_SPACING_X;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
wereUpdated = true;
|
||||
}
|
||||
for(i = 0; i < num; )
|
||||
{
|
||||
indicator = this.var_649[i];
|
||||
wereUpdated = indicator.update(now,delta,this.texture) || wereUpdated;
|
||||
i++;
|
||||
}
|
||||
return wereUpdated;
|
||||
}
|
||||
|
||||
private function method_787(increment:int) : void
|
||||
{
|
||||
this.var_651 += increment;
|
||||
this.var_653 = true;
|
||||
}
|
||||
|
||||
private function method_783() : void
|
||||
{
|
||||
if(this.method_786(CONFIG_FLAGS))
|
||||
{
|
||||
this.method_788();
|
||||
this.method_790();
|
||||
}
|
||||
}
|
||||
|
||||
private function method_788() : void
|
||||
{
|
||||
var width:int = 0;
|
||||
var height:int = 0;
|
||||
var numEffects:int = 0;
|
||||
var w:int = 0;
|
||||
if(this.method_778(BIT_LABEL))
|
||||
{
|
||||
this.label.text = this.labelText || "";
|
||||
width = RANK_ICON_SIZE + LABEL_SPACING + this.label.textWidth;
|
||||
height = LABEL_HEIGHT;
|
||||
}
|
||||
if(this.method_778(BIT_HEALTH))
|
||||
{
|
||||
if(width < BAR_WIDTH)
|
||||
{
|
||||
width = BAR_WIDTH;
|
||||
}
|
||||
if(height > 0)
|
||||
{
|
||||
height += HEALTH_BAR_SPACING_Y;
|
||||
}
|
||||
height += BAR_HEIGHT;
|
||||
if(this.method_778(BIT_WEAPON))
|
||||
{
|
||||
height += WEAPON_BAR_SPACING_Y + BAR_HEIGHT;
|
||||
}
|
||||
}
|
||||
if(this.method_778(BIT_EFFECTS))
|
||||
{
|
||||
numEffects = 4;
|
||||
w = numEffects * EFFECTS_ICON_SIZE + (numEffects - 1) * EFFECTS_SPACING_X;
|
||||
if(width < w)
|
||||
{
|
||||
width = w;
|
||||
}
|
||||
if(height > 0)
|
||||
{
|
||||
height += EFFECTS_SPACING_Y;
|
||||
}
|
||||
height += EFFECTS_ICON_SIZE;
|
||||
}
|
||||
width += 2 * TEXTURE_MARGIN;
|
||||
width = this.method_784(width);
|
||||
height += 2 * TEXTURE_MARGIN;
|
||||
height = this.method_784(height);
|
||||
if(this.texture == null || this.texture.width != width || this.texture.height != height)
|
||||
{
|
||||
if(this.texture != null)
|
||||
{
|
||||
this.texture.dispose();
|
||||
}
|
||||
this.texture = new BitmapData(width,height,true,0);
|
||||
this.textureResource.data = this.texture;
|
||||
this.sprite.width = width;
|
||||
this.sprite.height = height;
|
||||
this.var_650 = this.texture.rect;
|
||||
this.method_779(BIT_LABEL | BIT_HEALTH | BIT_WEAPON | BIT_EFFECTS);
|
||||
}
|
||||
}
|
||||
|
||||
private function method_784(value:int) : int
|
||||
{
|
||||
for(var power:int = 2; value > power; )
|
||||
{
|
||||
power <<= 1;
|
||||
}
|
||||
return power;
|
||||
}
|
||||
|
||||
private function method_790() : void
|
||||
{
|
||||
var left:int = 0;
|
||||
var top:int = TEXTURE_MARGIN;
|
||||
if(this.method_778(BIT_LABEL))
|
||||
{
|
||||
top += LABEL_HEIGHT;
|
||||
}
|
||||
if(this.method_778(BIT_HEALTH))
|
||||
{
|
||||
if(this.method_778(BIT_LABEL))
|
||||
{
|
||||
top += HEALTH_BAR_SPACING_Y;
|
||||
}
|
||||
left = this.var_650.width - BAR_WIDTH >> 1;
|
||||
this.var_652 = new name_725(left,top,MAX_PROGRESS,BAR_WIDTH,teamTypeSkin[this.teamType]);
|
||||
top += BAR_HEIGHT;
|
||||
if(this.method_778(BIT_WEAPON))
|
||||
{
|
||||
top += WEAPON_BAR_SPACING_Y;
|
||||
this.var_654 = new name_725(left,top,MAX_PROGRESS,BAR_WIDTH,name_724.WEAPONBAR);
|
||||
top += BAR_HEIGHT;
|
||||
}
|
||||
}
|
||||
if(this.method_778(BIT_EFFECTS))
|
||||
{
|
||||
top += EFFECTS_SPACING_Y;
|
||||
this.var_655 = top;
|
||||
this.method_793();
|
||||
}
|
||||
}
|
||||
|
||||
public function name_611(container:name_78) : void
|
||||
{
|
||||
if(this.sprite.parent == null)
|
||||
{
|
||||
container.addChild(this.sprite);
|
||||
}
|
||||
}
|
||||
|
||||
public function name_618() : void
|
||||
{
|
||||
if(this.sprite.parent != null)
|
||||
{
|
||||
this.sprite.parent.removeChild(this.sprite);
|
||||
}
|
||||
}
|
||||
|
||||
public function name_201(pos:name_194) : void
|
||||
{
|
||||
this.sprite.x = pos.x;
|
||||
this.sprite.y = pos.y;
|
||||
this.sprite.z = pos.z;
|
||||
}
|
||||
|
||||
private function method_779(configBit:int) : void
|
||||
{
|
||||
this.flags |= configBit << 8;
|
||||
}
|
||||
|
||||
private function method_789() : void
|
||||
{
|
||||
var clientLog:name_160 = null;
|
||||
var tmpBitmapData:BitmapData = this.texture.clone();
|
||||
tmpBitmapData.fillRect(this.var_650,0);
|
||||
var labelWidth:int = RANK_ICON_SIZE + LABEL_SPACING + this.label.textWidth;
|
||||
var left:int = tmpBitmapData.width - labelWidth >> 1;
|
||||
matrix.tx = left;
|
||||
matrix.ty = TEXTURE_MARGIN + RANK_ICON_OFFSET_Y;
|
||||
var icon:BitmapData = this.rankIcon.method_776(this.rankId);
|
||||
clientLog = name_160(name_3.name_8().name_30(name_160));
|
||||
clientLog.log("icon","UserTitle::updateLabel() icon size: %1x%2",icon.width,icon.height);
|
||||
clientLog.log("icon","UserTitle::updateLabel() label height: %1",this.label.textHeight);
|
||||
tmpBitmapData.draw(icon,matrix,null,null,null,true);
|
||||
matrix.tx = left + RANK_ICON_SIZE + LABEL_SPACING;
|
||||
matrix.ty = TEXTURE_MARGIN;
|
||||
var skin:name_724 = teamTypeSkin[this.teamType];
|
||||
this.label.textColor = skin.color;
|
||||
tmpBitmapData.draw(this.label.method_777(),matrix,null,null,null,true);
|
||||
this.texture.applyFilter(tmpBitmapData,this.var_650,new Point(),filter);
|
||||
tmpBitmapData.dispose();
|
||||
}
|
||||
|
||||
private function method_793() : void
|
||||
{
|
||||
var indicatorType:int = 0;
|
||||
if(this.var_649 != null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
this.var_649 = new Vector.<name_722>();
|
||||
for each(indicatorType in indicatorTypes)
|
||||
{
|
||||
if(indicatorType == name_722.TYPE_HEALTH)
|
||||
{
|
||||
this.var_649.push(new name_722(indicatorType,100000,this,300,0));
|
||||
}
|
||||
else
|
||||
{
|
||||
this.var_649.push(new name_722(indicatorType,EFFECT_WARNING_TIME,this,300,30));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function method_785(effectId:int) : name_722
|
||||
{
|
||||
var len:int = 0;
|
||||
var i:int = 0;
|
||||
var indicator:name_722 = null;
|
||||
if(this.var_649 != null)
|
||||
{
|
||||
len = int(this.var_649.length);
|
||||
for(i = 0; i < len; )
|
||||
{
|
||||
indicator = this.var_649[i];
|
||||
if(indicator.effectId == effectId)
|
||||
{
|
||||
return indicator;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private function method_791(delta:int) : void
|
||||
{
|
||||
}
|
||||
|
||||
private function method_782(mask:int) : void
|
||||
{
|
||||
this.flags |= mask;
|
||||
}
|
||||
|
||||
private function method_781(mask:int) : void
|
||||
{
|
||||
this.flags &= ~mask;
|
||||
}
|
||||
|
||||
private function method_786(mask:int) : Boolean
|
||||
{
|
||||
return (this.flags & mask) != 0;
|
||||
}
|
||||
|
||||
private function method_778(mask:int) : Boolean
|
||||
{
|
||||
return (this.flags & mask) == mask;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
11
src/alternativa/tanks/game/usertitle/name_610.as
Normal file
11
src/alternativa/tanks/game/usertitle/name_610.as
Normal file
@@ -0,0 +1,11 @@
|
||||
package alternativa.tanks.game.usertitle
|
||||
{
|
||||
import alternativa.tanks.game.usertitle.component.name_245;
|
||||
import package_10.name_54;
|
||||
|
||||
public interface name_610
|
||||
{
|
||||
function name_614(param1:name_54, param2:name_245) : void;
|
||||
}
|
||||
}
|
||||
|
||||
10
src/alternativa/tanks/game/usertitle/name_613.as
Normal file
10
src/alternativa/tanks/game/usertitle/name_613.as
Normal file
@@ -0,0 +1,10 @@
|
||||
package alternativa.tanks.game.usertitle
|
||||
{
|
||||
import flash.display.BitmapData;
|
||||
|
||||
public interface name_613
|
||||
{
|
||||
function method_776(param1:int) : BitmapData;
|
||||
}
|
||||
}
|
||||
|
||||
224
src/alternativa/tanks/game/usertitle/name_722.as
Normal file
224
src/alternativa/tanks/game/usertitle/name_722.as
Normal file
@@ -0,0 +1,224 @@
|
||||
package alternativa.tanks.game.usertitle
|
||||
{
|
||||
import flash.display.Bitmap;
|
||||
import flash.display.BitmapData;
|
||||
import flash.geom.ColorTransform;
|
||||
import flash.geom.Matrix;
|
||||
import flash.geom.Rectangle;
|
||||
import flash.utils.Dictionary;
|
||||
import flash.utils.getTimer;
|
||||
import package_72.name_764;
|
||||
|
||||
public class name_722
|
||||
{
|
||||
public static const TYPE_HEALTH:int = 1;
|
||||
|
||||
public static const TYPE_ARMOR:int = 2;
|
||||
|
||||
public static const TYPE_POWER:int = 3;
|
||||
|
||||
public static const TYPE_NITRO:int = 4;
|
||||
|
||||
private static const STATE_HIDDEN:int = 1;
|
||||
|
||||
private static const STATE_PREPARED:int = 2;
|
||||
|
||||
private static const STATE_VISIBLE:int = 4;
|
||||
|
||||
private static const STATE_HIDING:int = 8;
|
||||
|
||||
private static const iconHealthCls:Class = EffectIndicator_iconHealthCls;
|
||||
|
||||
private static const iconArmorCls:Class = EffectIndicator_iconArmorCls;
|
||||
|
||||
private static const iconPowerCls:Class = EffectIndicator_iconPowerCls;
|
||||
|
||||
private static const iconNitroCls:Class = EffectIndicator_iconNitroCls;
|
||||
|
||||
private static const MIN_ALPHA:Number = 0.2;
|
||||
|
||||
private static var matrix:Matrix = new Matrix();
|
||||
|
||||
private static var icons:Dictionary = new Dictionary();
|
||||
|
||||
icons[TYPE_HEALTH] = Bitmap(new iconHealthCls()).bitmapData;
|
||||
icons[TYPE_ARMOR] = Bitmap(new iconArmorCls()).bitmapData;
|
||||
icons[TYPE_POWER] = Bitmap(new iconPowerCls()).bitmapData;
|
||||
icons[TYPE_NITRO] = Bitmap(new iconNitroCls()).bitmapData;
|
||||
|
||||
private static var iconRect:Rectangle = BitmapData(icons[TYPE_HEALTH]).rect;
|
||||
|
||||
private var var_713:int;
|
||||
|
||||
private var icon:BitmapData;
|
||||
|
||||
private var blinkingTime:int;
|
||||
|
||||
private var colorTransform:ColorTransform = new ColorTransform();
|
||||
|
||||
private var var_712:int;
|
||||
|
||||
private var var_709:name_764;
|
||||
|
||||
private var alpha:Number = 1;
|
||||
|
||||
private var var_710:Boolean;
|
||||
|
||||
private var x:int;
|
||||
|
||||
private var y:int;
|
||||
|
||||
private var userTitle:name_607;
|
||||
|
||||
private var state:int;
|
||||
|
||||
private var var_711:Boolean;
|
||||
|
||||
public function name_722(effectId:int, blinkingTime:int, userTitle:name_607, initialBlinkInterval:int, blinkIntervalDecrement:int)
|
||||
{
|
||||
super();
|
||||
this.var_713 = effectId;
|
||||
this.icon = icons[effectId];
|
||||
this.blinkingTime = blinkingTime;
|
||||
this.userTitle = userTitle;
|
||||
this.var_709 = new name_764(initialBlinkInterval,20,blinkIntervalDecrement,MIN_ALPHA,1,10);
|
||||
this.state = STATE_HIDDEN;
|
||||
}
|
||||
|
||||
public function get effectId() : int
|
||||
{
|
||||
return this.var_713;
|
||||
}
|
||||
|
||||
public function method_141() : Boolean
|
||||
{
|
||||
return (this.state & STATE_VISIBLE) != 0;
|
||||
}
|
||||
|
||||
public function name_726() : Boolean
|
||||
{
|
||||
return this.state == STATE_HIDDEN;
|
||||
}
|
||||
|
||||
public function show(duration:int) : void
|
||||
{
|
||||
this.state &= ~STATE_HIDING;
|
||||
if(this.state != STATE_VISIBLE || this.alpha != 1)
|
||||
{
|
||||
this.var_710 = true;
|
||||
}
|
||||
this.var_712 = getTimer() + duration - this.blinkingTime;
|
||||
this.var_711 = false;
|
||||
this.alpha = 1;
|
||||
if(this.state == STATE_HIDDEN)
|
||||
{
|
||||
this.state = STATE_PREPARED;
|
||||
}
|
||||
}
|
||||
|
||||
public function hide() : void
|
||||
{
|
||||
if(this.state == STATE_PREPARED)
|
||||
{
|
||||
this.userTitle.method_794(this);
|
||||
this.state = STATE_HIDDEN;
|
||||
return;
|
||||
}
|
||||
if((this.state & (STATE_HIDDEN | STATE_HIDING)) != 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
this.state |= STATE_HIDING;
|
||||
this.var_709.name_765(0);
|
||||
if(!this.var_711)
|
||||
{
|
||||
this.var_712 = 0;
|
||||
this.var_709.init(getTimer());
|
||||
this.var_711 = true;
|
||||
}
|
||||
}
|
||||
|
||||
public function clear(texture:BitmapData) : void
|
||||
{
|
||||
if(this.state == STATE_HIDDEN || this.state == STATE_PREPARED)
|
||||
{
|
||||
return;
|
||||
}
|
||||
iconRect.x = this.x;
|
||||
iconRect.y = this.y;
|
||||
texture.fillRect(iconRect,0);
|
||||
}
|
||||
|
||||
public function name_201(x:int, y:int) : void
|
||||
{
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.var_710 = true;
|
||||
}
|
||||
|
||||
public function name_728() : void
|
||||
{
|
||||
this.var_710 = true;
|
||||
}
|
||||
|
||||
public function update(now:int, delta:int, texture:BitmapData) : Boolean
|
||||
{
|
||||
var updated:Boolean = false;
|
||||
if(this.state == STATE_HIDDEN)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(this.var_710)
|
||||
{
|
||||
this.draw(texture);
|
||||
this.var_710 = false;
|
||||
updated = true;
|
||||
}
|
||||
if(now > this.var_712)
|
||||
{
|
||||
this.method_884(now,delta,texture);
|
||||
updated = true;
|
||||
}
|
||||
if(this.state == STATE_PREPARED)
|
||||
{
|
||||
this.state = STATE_VISIBLE;
|
||||
}
|
||||
return updated;
|
||||
}
|
||||
|
||||
private function method_884(now:int, delta:int, texture:BitmapData) : void
|
||||
{
|
||||
var newAlpha:Number = NaN;
|
||||
if(this.var_711)
|
||||
{
|
||||
newAlpha = this.var_709.name_766(now,delta);
|
||||
if(newAlpha != this.alpha)
|
||||
{
|
||||
this.alpha = newAlpha;
|
||||
this.draw(texture);
|
||||
}
|
||||
if((this.state & STATE_HIDING) != 0 && this.alpha == 0)
|
||||
{
|
||||
this.userTitle.method_794(this);
|
||||
this.state = STATE_HIDDEN;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.var_709.name_765(MIN_ALPHA);
|
||||
this.var_709.init(now);
|
||||
this.var_711 = true;
|
||||
}
|
||||
}
|
||||
|
||||
private function draw(texture:BitmapData) : void
|
||||
{
|
||||
this.clear(texture);
|
||||
matrix.tx = this.x;
|
||||
matrix.ty = this.y;
|
||||
this.colorTransform.alphaMultiplier = this.alpha;
|
||||
texture.draw(this.icon,matrix,this.colorTransform,null,null,true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
83
src/alternativa/tanks/game/usertitle/name_724.as
Normal file
83
src/alternativa/tanks/game/usertitle/name_724.as
Normal file
@@ -0,0 +1,83 @@
|
||||
package alternativa.tanks.game.usertitle
|
||||
{
|
||||
import flash.display.Bitmap;
|
||||
import flash.display.BitmapData;
|
||||
|
||||
public class name_724
|
||||
{
|
||||
private static var hpGreenEmptyCls:Class = ProgressBarSkin_hpGreenEmptyCls;
|
||||
|
||||
private static var hpGreenEmpty:BitmapData = Bitmap(new hpGreenEmptyCls()).bitmapData;
|
||||
|
||||
private static var hpGreenFullCls:Class = ProgressBarSkin_hpGreenFullCls;
|
||||
|
||||
private static var hpGreenFull:BitmapData = Bitmap(new hpGreenFullCls()).bitmapData;
|
||||
|
||||
private static var hpRedEmptyCls:Class = ProgressBarSkin_hpRedEmptyCls;
|
||||
|
||||
private static var hpRedEmpty:BitmapData = Bitmap(new hpRedEmptyCls()).bitmapData;
|
||||
|
||||
private static var hpRedFullCls:Class = ProgressBarSkin_hpRedFullCls;
|
||||
|
||||
private static var hpRedFull:BitmapData = Bitmap(new hpRedFullCls()).bitmapData;
|
||||
|
||||
private static var hpBlueEmptyCls:Class = ProgressBarSkin_hpBlueEmptyCls;
|
||||
|
||||
private static var hpBlueEmpty:BitmapData = Bitmap(new hpBlueEmptyCls()).bitmapData;
|
||||
|
||||
private static var hpBlueFullCls:Class = ProgressBarSkin_hpBlueFullCls;
|
||||
|
||||
private static var hpBlueFull:BitmapData = Bitmap(new hpBlueFullCls()).bitmapData;
|
||||
|
||||
private static var weaponEmptyCls:Class = ProgressBarSkin_weaponEmptyCls;
|
||||
|
||||
private static var weaponEmpty:BitmapData = Bitmap(new weaponEmptyCls()).bitmapData;
|
||||
|
||||
private static var weaponFullCls:Class = ProgressBarSkin_weaponFullCls;
|
||||
|
||||
private static var weaponFull:BitmapData = Bitmap(new weaponFullCls()).bitmapData;
|
||||
|
||||
private static const COLOR_DM:uint = 4964125;
|
||||
|
||||
private static const COLOR_TEAM_BLUE:uint = 4691967;
|
||||
|
||||
private static const COLOR_TEAM_RED:uint = 15741974;
|
||||
|
||||
public static const HEALTHBAR_DM:name_724 = new name_724(COLOR_DM,hpGreenEmpty,hpGreenFull,4);
|
||||
|
||||
public static const HEALTHBAR_BLUE:name_724 = new name_724(COLOR_TEAM_BLUE,hpBlueEmpty,hpBlueFull,4);
|
||||
|
||||
public static const HEALTHBAR_RED:name_724 = new name_724(COLOR_TEAM_RED,hpRedEmpty,hpRedFull,4);
|
||||
|
||||
public static const WEAPONBAR:name_724 = new name_724(0,weaponEmpty,weaponFull,4);
|
||||
|
||||
public var var_704:BitmapData;
|
||||
|
||||
public var var_703:BitmapData;
|
||||
|
||||
public var var_701:BitmapData;
|
||||
|
||||
public var var_705:BitmapData;
|
||||
|
||||
public var var_700:BitmapData;
|
||||
|
||||
public var var_702:BitmapData;
|
||||
|
||||
public var color:uint;
|
||||
|
||||
public function name_724(color:uint, emptyBitmap:BitmapData, fullBitmap:BitmapData, tipWidth:int)
|
||||
{
|
||||
super();
|
||||
this.color = color;
|
||||
var parts:name_763 = new name_763(emptyBitmap,tipWidth);
|
||||
this.var_704 = parts.left;
|
||||
this.var_701 = parts.right;
|
||||
this.var_700 = parts.center;
|
||||
parts = new name_763(fullBitmap,tipWidth);
|
||||
this.var_703 = parts.left;
|
||||
this.var_705 = parts.right;
|
||||
this.var_702 = parts.center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
142
src/alternativa/tanks/game/usertitle/name_725.as
Normal file
142
src/alternativa/tanks/game/usertitle/name_725.as
Normal file
@@ -0,0 +1,142 @@
|
||||
package alternativa.tanks.game.usertitle
|
||||
{
|
||||
import flash.display.BitmapData;
|
||||
import flash.display.Graphics;
|
||||
import flash.display.Shape;
|
||||
import flash.geom.Matrix;
|
||||
import flash.geom.Rectangle;
|
||||
|
||||
public class name_725
|
||||
{
|
||||
private static var canvas:Shape = new Shape();
|
||||
|
||||
private static var matrix:Matrix = new Matrix();
|
||||
|
||||
private var maxValue:int;
|
||||
|
||||
private var barWidth:int;
|
||||
|
||||
private var skin:name_724;
|
||||
|
||||
private var var_706:int;
|
||||
|
||||
private var var_707:int;
|
||||
|
||||
private var var_708:int;
|
||||
|
||||
private var x:int;
|
||||
|
||||
private var y:int;
|
||||
|
||||
private var rect:Rectangle;
|
||||
|
||||
public function name_725(x:int, y:int, maxValue:int, barWidth:int, skin:name_724)
|
||||
{
|
||||
super();
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.maxValue = maxValue;
|
||||
this.barWidth = barWidth;
|
||||
this.name_727(skin);
|
||||
this.rect = new Rectangle(x,y,barWidth,this.var_707);
|
||||
}
|
||||
|
||||
public function name_727(skin:name_724) : void
|
||||
{
|
||||
this.skin = skin;
|
||||
this.var_706 = skin.var_704.width;
|
||||
this.var_707 = skin.var_704.height;
|
||||
}
|
||||
|
||||
public function get progress() : int
|
||||
{
|
||||
return this.var_708;
|
||||
}
|
||||
|
||||
public function set progress(value:int) : void
|
||||
{
|
||||
if(value < 0)
|
||||
{
|
||||
value = 0;
|
||||
}
|
||||
else if(value > this.maxValue)
|
||||
{
|
||||
value = this.maxValue;
|
||||
}
|
||||
this.var_708 = value;
|
||||
}
|
||||
|
||||
public function draw(texture:BitmapData) : void
|
||||
{
|
||||
var bgStart:int = 0;
|
||||
var g:Graphics = canvas.graphics;
|
||||
g.clear();
|
||||
matrix.ty = 0;
|
||||
var displayWidth:int = this.barWidth * this.var_708 / this.maxValue;
|
||||
var w:int = this.barWidth - this.var_706;
|
||||
if(displayWidth >= this.var_706)
|
||||
{
|
||||
if(displayWidth == this.barWidth)
|
||||
{
|
||||
this.method_883(g,this.skin.var_703,this.skin.var_705,this.skin.var_702);
|
||||
bgStart = displayWidth;
|
||||
}
|
||||
else
|
||||
{
|
||||
g.beginBitmapFill(this.skin.var_703,null,false);
|
||||
g.drawRect(0,0,this.var_706,this.var_707);
|
||||
if(displayWidth > this.var_706)
|
||||
{
|
||||
if(displayWidth > w)
|
||||
{
|
||||
displayWidth = w;
|
||||
}
|
||||
bgStart = displayWidth;
|
||||
this.method_882(g,this.skin.var_702,this.var_706,displayWidth - this.var_706);
|
||||
}
|
||||
else
|
||||
{
|
||||
bgStart = this.var_706;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(bgStart == 0)
|
||||
{
|
||||
this.method_883(g,this.skin.var_704,this.skin.var_701,this.skin.var_700);
|
||||
}
|
||||
else if(bgStart < this.barWidth)
|
||||
{
|
||||
this.method_882(g,this.skin.var_700,bgStart,w - bgStart);
|
||||
matrix.tx = w;
|
||||
g.beginBitmapFill(this.skin.var_701,matrix,false);
|
||||
g.drawRect(w,0,this.var_706,this.var_707);
|
||||
}
|
||||
g.endFill();
|
||||
texture.fillRect(this.rect,0);
|
||||
matrix.tx = this.x;
|
||||
matrix.ty = this.y;
|
||||
texture.draw(canvas,matrix);
|
||||
}
|
||||
|
||||
private function method_883(g:Graphics, leftTip:BitmapData, rightTip:BitmapData, center:BitmapData) : void
|
||||
{
|
||||
var w:int = this.barWidth - this.var_706;
|
||||
g.beginBitmapFill(leftTip,null,false);
|
||||
g.drawRect(0,0,this.var_706,this.var_707);
|
||||
matrix.tx = this.var_706;
|
||||
g.beginBitmapFill(center,matrix,true);
|
||||
g.drawRect(this.var_706,0,w - this.var_706,this.var_707);
|
||||
matrix.tx = w;
|
||||
g.beginBitmapFill(rightTip,matrix,false);
|
||||
g.drawRect(w,0,this.var_706,this.var_707);
|
||||
}
|
||||
|
||||
private function method_882(g:Graphics, center:BitmapData, x:int, width:int) : void
|
||||
{
|
||||
matrix.tx = x;
|
||||
g.beginBitmapFill(center,matrix,true);
|
||||
g.drawRect(x,0,width,this.var_707);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
29
src/alternativa/tanks/game/usertitle/name_763.as
Normal file
29
src/alternativa/tanks/game/usertitle/name_763.as
Normal file
@@ -0,0 +1,29 @@
|
||||
package alternativa.tanks.game.usertitle
|
||||
{
|
||||
import flash.display.BitmapData;
|
||||
import flash.geom.Point;
|
||||
import flash.geom.Rectangle;
|
||||
|
||||
public class name_763
|
||||
{
|
||||
public var left:BitmapData;
|
||||
|
||||
public var right:BitmapData;
|
||||
|
||||
public var center:BitmapData;
|
||||
|
||||
public function name_763(bar:BitmapData, tipWidth:int)
|
||||
{
|
||||
super();
|
||||
var h:int = int(bar.height);
|
||||
var point:Point = new Point();
|
||||
this.left = new BitmapData(tipWidth,h,true,0);
|
||||
this.left.copyPixels(bar,new Rectangle(0,0,tipWidth,h),point);
|
||||
this.right = new BitmapData(tipWidth,h,true,0);
|
||||
this.right.copyPixels(bar,new Rectangle(bar.width - tipWidth,0,tipWidth,h),point);
|
||||
this.center = new BitmapData(1,h,true,0);
|
||||
this.center.copyPixels(bar,new Rectangle(tipWidth,0,1,h),point);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user