Section 1
//Console (com.alternativagame.admin.Console)
package com.alternativagame.admin {
import flash.events.*;
import com.alternativagame.type.*;
import flash.display.*;
import flash.text.*;
import com.alternativagame.object.*;
import com.alternativagame.kernel.*;
import flash.net.*;
import flash.utils.*;
import com.alternativagame.model.admin.*;
import com.alternativagame.text.*;
import flash.ui.*;
public final class Console extends Sprite implements IObject, IConsoleModel {
private var log:TextField;
private var timer:uint;
private var send:TextField;
private var hIndex:int;
private var timerData:Array;
private var history:Array;
private var so:SharedObject;
private var tf:TextFormat;
private var _id:Long;
public function Console(){
tf = new TextFormat("Courier", 11, 0xB0B0B0);
log = new TextField();
log.defaultTextFormat = tf;
log.type = TextFieldType.DYNAMIC;
log.selectable = true;
log.multiline = true;
log.wordWrap = true;
log.background = true;
log.backgroundColor = 0xFFFFFF;
addChild(log);
send = new TextField();
send.defaultTextFormat = tf;
send.height = 20;
send.type = TextFieldType.INPUT;
send.background = true;
send.backgroundColor = 0x666666;
send.selectable = true;
send.multiline = false;
addChild(send);
timerData = new Array();
}
public function write(_arg1:String, _arg2:int):void{
if (visible){
log.htmlText = (log.htmlText + (((("<font color='#" + _arg2.toString(16)) + "'>") + _arg1) + "</font>"));
log.scrollV = log.maxScrollV;
};
}
public function hide():void{
send.removeEventListener(KeyboardEvent.KEY_DOWN, onSendKeyDown);
visible = false;
so.data.visible = false;
log.htmlText = "";
so.flush();
}
private function onStageKeyDown(_arg1:KeyboardEvent):void{
if ((((_arg1.keyCode == Keyboard.SPACE)) && (_arg1.ctrlKey))){
if (visible){
hide();
} else {
show();
};
};
}
private function onResize(_arg1:Event=null):void{
log.width = (stage.stageWidth >>> 1);
log.height = (stage.stageHeight - send.height);
send.width = log.width;
send.y = (stage.stageHeight - send.height);
}
private function onSendKeyDown(_arg1:KeyboardEvent):void{
if ((((_arg1.keyCode == Keyboard.ENTER)) && ((send.text.length > 0)))){
timerData = new Array();
clearTimeout(timer);
sendCommand(send.text);
resetSend();
};
if ((((_arg1.keyCode == Keyboard.UP)) && ((hIndex > 0)))){
hIndex--;
send.text = history[hIndex];
};
if ((((_arg1.keyCode == Keyboard.DOWN)) && ((hIndex < (history.length - 1))))){
hIndex++;
send.text = history[hIndex];
};
}
public function get id():Long{
return (_id);
}
private function onLoadError(_arg1:Event):void{
Dispatcher.writeConsole(ConsoleText.CONSOLE_LOAD_ERROR, 0xFF0000);
}
public function dispose():void{
clearTimeout(timer);
hide();
stage.removeEventListener(KeyboardEvent.KEY_DOWN, onStageKeyDown);
stage.removeEventListener(Event.RESIZE, onResize);
}
public function initConsole():void{
so = SharedObject.getLocal("console");
if (so.data["commands"] == null){
history = new Array();
} else {
history = so.data.commands;
};
hIndex = history.length;
if (so.data.visible == null){
hide();
} else {
if (so.data.visible){
show();
} else {
hide();
};
};
stage.addEventListener(KeyboardEvent.KEY_DOWN, onStageKeyDown);
stage.addEventListener(Event.RESIZE, onResize);
onResize();
Dispatcher.writeConsole(ConsoleText.CONSOLE_INITIALIZED);
}
private function sendCommand(_arg1:String):void{
var _local2:URLLoader;
var _local3:Array;
var _local4:Array;
var _local5:Long;
var _local6:Short;
var _local7:Byte;
var _local8:Array;
var _local9:Array;
var _local10:Number;
var _local11:String;
var _local12:String;
var _local13:String;
if (_arg1.indexOf("http://") == 0){
Dispatcher.writeConsole(TextUtils.insertVars(ConsoleText.CONSOLE_LOAD_COMMANDS_FROM_FILE, _arg1));
_local2 = new URLLoader(new URLRequest(_arg1));
_local2.addEventListener(Event.COMPLETE, onLoadComplete);
_local2.addEventListener(IOErrorEvent.IO_ERROR, onLoadError);
} else {
Dispatcher.writeConsole(TextUtils.insertVars(ConsoleText.CONSOLE_SEND_COMMAND, _arg1));
_local3 = _arg1.split("/");
_local4 = _local3[0].split(".");
_local5 = new Long(new int(_local4[0]), new int(_local4[1]));
_local6 = new Short(new int(_local3[1]));
_local7 = new Byte(new int(_local3[2]));
_local8 = _local3[3].split(",");
_local9 = new Array();
_local10 = 0;
while (_local10 < _local8.length) {
_local11 = _local8[_local10];
_local12 = _local11.charAt(0);
_local13 = _local11.substring(1, _local11.length);
switch (_local12){
case "B":
_local9[_local10] = new Byte(new int(_local13));
break;
case "S":
_local9[_local10] = new Short(new int(_local13));
break;
case "I":
_local9[_local10] = new int(_local13);
break;
case "L":
_local9[_local10] = new Long(_local13.split(".")[0], _local13.split(".")[1]);
break;
case "F":
_local9[_local10] = new Number(_local13);
break;
case "M":
_local9[_local10] = _local13;
break;
default:
Dispatcher.writeConsole(TextUtils.insertVars(ConsoleText.CONSOLE_TYPE_NOT_FOUND, _local12), 0xFF0000);
return;
};
_local10++;
};
Dispatcher.sendCustomCommand(_local5, _local6, _local7, _local9);
if (timerData.length > 0){
startCommandTimer();
};
};
}
public function set id(_arg1:Long):void{
_id = _arg1;
}
private function resetSend():void{
if (history[(history.length - 1)] != send.text){
history.push(send.text);
so.data.commands = history;
so.flush();
};
hIndex = history.length;
send.text = "";
send.setSelection(0, 0);
}
private function startCommandTimer():void{
var _local1:Array = timerData.shift().split("|");
timer = setTimeout(sendCommand, _local1[0], _local1[1]);
}
public function show():void{
send.addEventListener(KeyboardEvent.KEY_DOWN, onSendKeyDown);
stage.focus = send;
visible = true;
so.data.visible = true;
so.flush();
}
private function onLoadComplete(_arg1:Event):void{
var _local2:String = _arg1.target.data.split("\r").join("");
Dispatcher.writeConsole(TextUtils.insertVars(ConsoleText.CONSOLE_LOADED_COMMANDS, _local2));
timerData = _local2.split("\n").concat(timerData);
startCommandTimer();
}
}
}//package com.alternativagame.admin
Section 2
//FPS (com.alternativagame.admin.FPS)
package com.alternativagame.admin {
import flash.geom.*;
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.system.*;
public final class FPS extends Sprite {
private var currentY:int;
private var diagramTimer:int;
private var tfTimer:int;
private var downloadedBytes:uint;// = 0
private var socketOutBytes:uint;// = 0
private var socketOutLast:uint;// = 0
private var socketInBytes:uint;// = 0
private var mem:TextField;
private var skn:TextField;
private var diagram:BitmapData;
private var socketOut:TextField;
private var skins:int;// = -1
private var fps:TextField;
private var socketInLast:uint;// = 0
private var tfDelay:int;// = 0
private var socketIn:TextField;
private var dwl:TextField;
private var skinsChanged:int;// = 0
private static const maxMemory:uint = 41943040;
private static const diagramWidth:uint = 60;
private static const tfDelayMax:int = 10;
private static const maxSocket:uint = 4200;
private static const diagramHeight:uint = 40;
private static var instance:FPS;
public function FPS(_arg1:DisplayObjectContainer){
var _local2:Bitmap;
fps = new TextField();
mem = new TextField();
skn = new TextField();
dwl = new TextField();
socketIn = new TextField();
socketOut = new TextField();
super();
if (instance == null){
mouseEnabled = false;
mouseChildren = false;
_arg1.addChild(this);
fps.defaultTextFormat = new TextFormat("Tahoma", 10, 0xCCCCCC);
fps.autoSize = TextFieldAutoSize.LEFT;
fps.text = ("FPS: " + Number(stage.frameRate).toFixed(2));
fps.selectable = false;
fps.x = (-(diagramWidth) - 2);
addChild(fps);
mem.defaultTextFormat = new TextFormat("Tahoma", 10, 0xCCCC00);
mem.autoSize = TextFieldAutoSize.LEFT;
mem.text = ("MEM: " + bytesToString(System.totalMemory));
mem.selectable = false;
mem.x = (-(diagramWidth) - 2);
mem.y = 10;
addChild(mem);
currentY = 20;
skn.defaultTextFormat = new TextFormat("Tahoma", 10, 0xFF6600);
skn.autoSize = TextFieldAutoSize.LEFT;
skn.text = ("MEM: " + bytesToString(System.totalMemory));
skn.selectable = false;
skn.x = (-(diagramWidth) - 2);
dwl.defaultTextFormat = new TextFormat("Tahoma", 10, 0xCC00CC);
dwl.autoSize = TextFieldAutoSize.LEFT;
dwl.selectable = false;
dwl.x = (-(diagramWidth) - 2);
socketIn.defaultTextFormat = new TextFormat("Tahoma", 10, 0xFF00);
socketIn.autoSize = TextFieldAutoSize.LEFT;
socketIn.selectable = false;
socketIn.x = (-(diagramWidth) - 2);
socketOut.defaultTextFormat = new TextFormat("Tahoma", 10, 26367);
socketOut.autoSize = TextFieldAutoSize.LEFT;
socketOut.selectable = false;
socketOut.x = (-(diagramWidth) - 2);
diagram = new BitmapData(diagramWidth, diagramHeight, true, 553648127);
_local2 = new Bitmap(diagram);
_local2.y = (currentY + 4);
_local2.x = -(diagramWidth);
addChildAt(_local2, 0);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
stage.addEventListener(Event.RESIZE, onResize);
onResize();
diagramTimer = getTimer();
tfTimer = getTimer();
} else {
throw (new Error("FPS is a Singleton. Use FPS.init to create FPS instance"));
};
}
private function bytesToString(_arg1:uint):String{
var _local2:String;
if (_arg1 < 0x0400){
_local2 = (String(_arg1) + "b");
} else {
if (_arg1 < 0x2800){
_local2 = (Number((_arg1 / 0x0400)).toFixed(2) + "kb");
} else {
if (_arg1 < 102400){
_local2 = (Number((_arg1 / 0x0400)).toFixed(1) + "kb");
} else {
if (_arg1 < 0x100000){
_local2 = (Math.round((_arg1 / 0x0400)) + "kb");
} else {
if (_arg1 < 0xA00000){
_local2 = (Number((_arg1 / 0x100000)).toFixed(2) + "mb");
} else {
if (_arg1 < 104857600){
_local2 = (Number((_arg1 / 0x100000)).toFixed(1) + "mb");
} else {
_local2 = (Math.round((_arg1 / 0x100000)) + "mb");
};
};
};
};
};
};
return (_local2);
}
private function onEnterFrame(_arg1:Event):void{
tfDelay++;
if (tfDelay >= tfDelayMax){
tfDelay = 0;
fps.text = ("FPS: " + Number(((1000 * tfDelayMax) / (getTimer() - tfTimer))).toFixed(2));
tfTimer = getTimer();
};
var _local2:Number = (1000 / (getTimer() - diagramTimer));
var _local3:Number = ((_local2)>stage.frameRate) ? 1 : (_local2 / stage.frameRate);
diagramTimer = getTimer();
diagram.scroll(1, 0);
diagram.fillRect(new Rectangle(0, 0, 1, diagram.height), 553648127);
diagram.setPixel32(0, (diagramHeight * (1 - _local3)), 4291611852);
mem.text = ("MEM: " + bytesToString(System.totalMemory));
var _local4:Number = ((skins)==0) ? 0 : (skinsChanged / skins);
diagram.setPixel32(0, (diagramHeight * (1 - _local4)), 4294927872);
var _local5:Number = (System.totalMemory / maxMemory);
diagram.setPixel32(0, (diagramHeight * (1 - _local5)), 4291611648);
var _local6:Number = ((socketInBytes - socketInLast) / maxSocket);
socketInLast = socketInBytes;
diagram.setPixel32(0, (diagramHeight * (1 - _local6)), 4278255360);
var _local7:Number = ((socketOutBytes - socketOutLast) / maxSocket);
socketOutLast = socketOutBytes;
diagram.setPixel32(0, (diagramHeight * (1 - _local7)), 4278216447);
}
private function onResize(_arg1:Event=null):void{
var _local2:Point = parent.globalToLocal(new Point((stage.stageWidth - 2), -3));
x = _local2.x;
y = _local2.y;
}
public static function addDownloadBytes(_arg1:uint):void{
if (instance.downloadedBytes == 0){
instance.dwl.y = instance.currentY;
instance.currentY = (instance.currentY + 10);
instance.addChild(instance.dwl);
instance.getChildAt(0).y = (instance.currentY + 4);
};
instance.downloadedBytes = (instance.downloadedBytes + _arg1);
instance.dwl.text = ("DWL: " + instance.bytesToString(instance.downloadedBytes));
}
public static function init(_arg1:DisplayObjectContainer):void{
instance = new FPS(_arg1);
}
public static function addSocketInBytes(_arg1:uint):void{
if (instance.socketInBytes == 0){
instance.socketIn.y = instance.currentY;
instance.currentY = (instance.currentY + 10);
instance.addChild(instance.socketIn);
instance.getChildAt(0).y = (instance.currentY + 4);
};
instance.socketInBytes = (instance.socketInBytes + _arg1);
instance.socketIn.text = ("IN: " + instance.bytesToString(instance.socketInBytes));
}
public static function addSocketOutBytes(_arg1:uint):void{
if (instance.socketOutBytes == 0){
instance.socketOut.y = instance.currentY;
instance.currentY = (instance.currentY + 10);
instance.addChild(instance.socketOut);
instance.getChildAt(0).y = (instance.currentY + 4);
};
instance.socketOutBytes = (instance.socketOutBytes + _arg1);
instance.socketOut.text = ("OUT: " + instance.bytesToString(instance.socketOutBytes));
}
public static function addSkins(_arg1:uint, _arg2:uint):void{
if (instance.skins < 0){
instance.skn.y = instance.currentY;
instance.currentY = (instance.currentY + 10);
instance.addChild(instance.skn);
instance.getChildAt(0).y = (instance.currentY + 4);
};
instance.skins = _arg1;
instance.skinsChanged = _arg2;
instance.skn.text = ("SKN: " + ((_arg2)>0) ? ((_arg1.toString() + "-") + _arg2.toString()) : _arg1.toString());
}
}
}//package com.alternativagame.admin
Section 3
//GaussianShading (com.alternativagame.engine3d.shading.GaussianShading)
package com.alternativagame.engine3d.shading {
public class GaussianShading implements IShading {
private var _specular:Number;// = 1
private var specularOffset:Number;
private var specularPrecalc1:Number;// = -0.5
private var specularPrecalc2:Number;
public function GaussianShading(){
specularPrecalc2 = (1 / Math.sqrt((2 * Math.PI)));
specularOffset = (Math.exp(specularPrecalc1) * specularPrecalc2);
super();
}
public function get specular():Number{
return (_specular);
}
public function set specular(_arg1:Number):void{
var _local2:Number;
if (_specular != _arg1){
_specular = _arg1;
_local2 = (1 / _specular);
specularPrecalc1 = (-1 / ((2 * _local2) * _local2));
specularPrecalc2 = (1 / (_local2 * Math.sqrt((2 * Math.PI))));
specularOffset = (Math.exp(specularPrecalc1) * specularPrecalc2);
};
}
public function shade(_arg1:Number):Number{
return (((Math.exp((((1 - _arg1) * (1 - _arg1)) * specularPrecalc1)) * specularPrecalc2) - specularOffset));
}
}
}//package com.alternativagame.engine3d.shading
Section 4
//IShading (com.alternativagame.engine3d.shading.IShading)
package com.alternativagame.engine3d.shading {
public interface IShading {
function shade(_arg1:Number):Number;
}
}//package com.alternativagame.engine3d.shading
Section 5
//FillSkin (com.alternativagame.engine3d.skin.FillSkin)
package com.alternativagame.engine3d.skin {
import flash.geom.*;
import com.alternativagame.type.*;
import flash.display.*;
public class FillSkin extends Shape {
public function draw(_arg1:Array, _arg2:uint, _arg3:Number, _arg4:String):void{
var length:*;
var i:*;
var points = _arg1;
var color = _arg2;
var alpha = _arg3;
var blendMode = _arg4;
this.blendMode = blendMode;
var _local6 = graphics;
with (_local6) {
clear();
beginFill(color, alpha);
moveTo(points[0].x, points[0].y);
length = points.length;
i = 1;
while (i < length) {
lineTo(points[i].x, points[i].y);
i++;
};
endFill();
};
}
public function light(_arg1:RGB):void{
transform.colorTransform = new ColorTransform(1, 1, 1, 1, ((_arg1.red - 127) << 1), ((_arg1.green - 127) << 1), ((_arg1.blue - 127) << 1));
}
}
}//package com.alternativagame.engine3d.skin
Section 6
//TextureSkin (com.alternativagame.engine3d.skin.TextureSkin)
package com.alternativagame.engine3d.skin {
import flash.geom.*;
import com.alternativagame.type.*;
import flash.display.*;
public class TextureSkin extends Shape {
private var textureMatrix:Matrix;
public function draw(_arg1:Array, _arg2:BitmapData, _arg3:Boolean):void{
var length:*;
var i:*;
var points = _arg1;
var texture = _arg2;
var smoothing = _arg3;
var drawMatrix:Matrix = textureMatrix.clone();
drawMatrix.concat(new Matrix((points[1].x - points[0].x), (points[1].y - points[0].y), (points[2].x - points[0].x), (points[2].y - points[0].y), points[0].x, points[0].y));
var _local5 = graphics;
with (_local5) {
clear();
beginBitmapFill(texture, drawMatrix, true, smoothing);
moveTo(points[0].x, points[0].y);
length = points.length;
i = 1;
while (i < length) {
lineTo(points[i].x, points[i].y);
i++;
};
endFill();
};
}
public function calculateMatrix(_arg1:Array, _arg2:uint):void{
var _local3:Point3D = _arg1[0];
var _local4:Point3D = _arg1[1];
var _local5:Point3D = _arg1[2];
textureMatrix = new Matrix();
textureMatrix.tx = ((_local3.x / _arg2) + 1);
textureMatrix.ty = ((_local3.y / _arg2) + 1);
textureMatrix.a = ((_local4.x - _local3.x) / _arg2);
textureMatrix.b = ((_local4.y - _local3.y) / _arg2);
textureMatrix.c = ((_local5.x - _local3.x) / _arg2);
textureMatrix.d = ((_local5.y - _local3.y) / _arg2);
textureMatrix.invert();
}
}
}//package com.alternativagame.engine3d.skin
Section 7
//UVSkin (com.alternativagame.engine3d.skin.UVSkin)
package com.alternativagame.engine3d.skin {
import flash.display.*;
public class UVSkin extends Shape {
public function drawFaceUV(_arg1:Array, _arg2:Number, _arg3:uint, _arg4:Number):void{
var length:*;
var i:*;
var points = _arg1;
var thickness = _arg2;
var color = _arg3;
var alpha = _arg4;
var _local6 = graphics;
with (_local6) {
lineStyle(thickness, color, alpha);
moveTo(points[0].x, points[0].y);
length = points.length;
i = 1;
while (i < length) {
lineTo(points[i].x, points[i].y);
i++;
};
lineTo(points[0].x, points[0].y);
lineStyle();
};
}
public function clear():void{
graphics.clear();
}
public function drawGizmo(_arg1:Array, _arg2:Number, _arg3:uint, _arg4:uint, _arg5:Number, _arg6:uint):void{
var length:*;
var i:*;
var points = _arg1;
var thickness = _arg2;
var lineColor = _arg3;
var fillColor = _arg4;
var fillAlpha = _arg5;
var beginColor = _arg6;
var _local8 = graphics;
with (_local8) {
beginFill(fillColor, fillAlpha);
lineStyle(thickness, lineColor);
moveTo(points[0].x, points[0].y);
length = points.length;
i = 1;
while (i < length) {
lineTo(points[i].x, points[i].y);
i++;
};
lineStyle(thickness, beginColor);
endFill();
lineStyle();
};
}
}
}//package com.alternativagame.engine3d.skin
Section 8
//WireSkin (com.alternativagame.engine3d.skin.WireSkin)
package com.alternativagame.engine3d.skin {
import flash.display.*;
public class WireSkin extends Shape {
public function draw(_arg1:Number, _arg2:uint, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):void{
var thickness = _arg1;
var color = _arg2;
var alpha = _arg3;
var x1 = _arg4;
var y1 = _arg5;
var x2 = _arg6;
var y2 = _arg7;
var _local9 = graphics;
with (_local9) {
clear();
lineStyle(thickness, color, alpha);
moveTo(x1, y1);
lineTo(x2, y2);
};
}
}
}//package com.alternativagame.engine3d.skin
Section 9
//Ambient (com.alternativagame.engine3d.Ambient)
package com.alternativagame.engine3d {
import com.alternativagame.type.*;
public class Ambient extends Light {
private static var num:uint = 0;
public function Ambient(_arg1:RGB=null){
super(_arg1);
}
override protected function defaultName():String{
num++;
return (("ambient" + num));
}
}
}//package com.alternativagame.engine3d
Section 10
//Directional (com.alternativagame.engine3d.Directional)
package com.alternativagame.engine3d {
import com.alternativagame.type.*;
public class Directional extends Light {
var canvasDirection:Point3D;
private static var num:uint = 0;
public function Directional(_arg1:RGB=null){
super(_arg1);
canvasDirection = new Point3D();
}
override protected function cloneParams(_arg1):void{
var _local2:Directional = Directional(_arg1);
super.cloneParams(_local2);
}
override function getStrengthAtSurface(_arg1:Point3D, _arg2:Point3D):Number{
return ((_enabled) ? -(Point3D.dot(canvasDirection, _arg2)) : NaN);
}
override public function clone():Object3D{
var _local1:Directional = new Directional();
cloneParams(_local1);
cloneRenderers(_local1);
return (_local1);
}
public function set direction(_arg1:Point3D):void{
var _local2:Point3D;
if (_arg1 != null){
_local2 = _arg1.clone();
rotZ = Math.atan2(-(_local2.x), _local2.y);
_local2.transform(Matrix3D.rotationMatrix(0, 0, -(rotZ)));
rotY = Math.atan2(_local2.x, _local2.z);
_local2.transform(Matrix3D.rotationMatrix(0, -(rotY), 0));
rotX = Math.atan2(-(_local2.y), _local2.z);
};
}
override function calculate():void{
super.calculate();
if (((((transformChanged) || (viewChanged))) || (parentChanged))){
canvasDirection.x = transformMatrix.c;
canvasDirection.y = transformMatrix.g;
canvasDirection.z = transformMatrix.k;
canvasDirection.normalize();
};
}
override protected function defaultName():String{
num++;
return (("directional" + num));
}
override function getStrengthAtPoint(_arg1:Point3D):Number{
return ((_enabled) ? ((1 - canvasDirection.z) / 2) : NaN);
}
public function get direction():Point3D{
var _local1:Matrix3D = Matrix3D.rotationMatrix(rotX, rotY, rotZ);
var _local2:Point3D = new Point3D(0, 0, 1);
_local2.transform(_local1);
return (_local2);
}
}
}//package com.alternativagame.engine3d
Section 11
//DisplayObjectRenderer (com.alternativagame.engine3d.DisplayObjectRenderer)
package com.alternativagame.engine3d {
import flash.geom.*;
import com.alternativagame.type.*;
import flash.display.*;
public class DisplayObjectRenderer extends ObjectRenderer {
private var _displayObject:DisplayObject;// = null
var displayObjectChanged:Boolean;// = true
private var bounds:Rectangle;
private static var num:uint = 0;
public function DisplayObjectRenderer(_arg1:DisplayObject=null){
_displayObject = _arg1;
bounds = new Rectangle();
}
public function get displayObject():DisplayObject{
return (_displayObject);
}
public function set displayObject(_arg1:DisplayObject):void{
if (_displayObject != _arg1){
clear();
_displayObject = _arg1;
displayObjectChanged = true;
};
}
override protected function defaultName():String{
num++;
return (("displayObjectRenderer" + num));
}
override public function drop():void{
super.drop();
displayObjectChanged = false;
}
override public function render():void{
var _local1:Boolean;
var _local2:Rectangle;
var _local3:Point3D;
if (_displayObject != null){
if (data == null){
data = new SkinData(this, 4);
data.skin = _displayObject;
};
_local1 = false;
_local2 = _displayObject.getBounds(_displayObject);
if (((displayObjectChanged) || (!(_local2.equals(bounds))))){
bounds = _local2;
_local1 = true;
};
if (((((((_local1) || (_object.coordsChanged))) || (_object.viewChanged))) || (objectChanged))){
_local3 = _object.canvasCoords;
data.points[0] = new Point3D((_local3.x + bounds.left), (_local3.y + bounds.top), _local3.z);
data.points[1] = new Point3D((_local3.x + bounds.left), (_local3.y + bounds.bottom), _local3.z);
data.points[2] = new Point3D((_local3.x + bounds.right), (_local3.y + bounds.bottom), _local3.z);
data.points[3] = new Point3D((_local3.x + bounds.right), (_local3.y + bounds.top), _local3.z);
_object._view.changeSkin(data);
_displayObject.x = _local3.x;
_displayObject.y = _local3.y;
};
};
}
override public function clone():IRenderer{
var _local1:DisplayObject;
if (((!((_displayObject == null))) && (_displayObject.hasOwnProperty("clone")))){
_local1 = _displayObject["clone"].apply(_displayObject);
};
var _local2:DisplayObjectRenderer = new DisplayObjectRenderer(_local1);
return (_local2);
}
}
}//package com.alternativagame.engine3d
Section 12
//Face (com.alternativagame.engine3d.Face)
package com.alternativagame.engine3d {
import com.alternativagame.type.*;
import com.alternativagame.engine3d.shading.*;
import flash.utils.*;
public class Face {
var normalCalculated:Boolean;// = false
var meshChanged:Boolean;// = false
private var lightColorCalculated:Boolean;// = false
var lightColorChanged:Boolean;// = false
var transformChanged:Boolean;// = true
var coordsChanged:Boolean;// = true
var lightChanged:Boolean;// = false
var canvasCenter:Point3D;
var visibleCalculated:Boolean;// = false
public var center:Point3D;
var _vertices:Array;
var canvasNormal:Point3D;
var visibleChanged:Boolean;// = false
var length:uint;
public var normal:Point3D;
var canvasCenterCalculated:Boolean;// = false
var lightColor:RGB;
var visible:Boolean;// = false
var centerCalculated:Boolean;// = false
var mesh:Mesh;
var lightStrength:Dictionary;
var canvasNormalCalculated:Boolean;// = false
public function Face(... _args){
if ((((_args.length == 1)) && ((_args[0] is Array)))){
this._vertices = _args[0];
} else {
this._vertices = _args;
};
length = this._vertices.length;
lightStrength = new Dictionary(true);
lightColor = new RGB();
}
public function get vertices():Array{
return (new Array().concat(_vertices));
}
function calculateLightColor():void{
var _local1:RGB;
var _local2:RGB;
var _local3:Number;
var _local4:*;
if (!lightColorCalculated){
_local1 = new RGB();
for (_local4 in lightStrength) {
_local3 = lightStrength[_local4];
_local2 = Light(_local4)._color;
_local1.red = (_local1.red + (_local2.red * _local3));
_local1.green = (_local1.green + (_local2.green * _local3));
_local1.blue = (_local1.blue + (_local2.blue * _local3));
};
if (((((!(_local1.equals(lightColor))) || (meshChanged))) || (mesh.viewChanged))){
lightColor = _local1;
lightColorChanged = true;
};
lightColorCalculated = true;
};
}
function calculateNormal():void{
var _local1:Point3D;
var _local2:Point3D;
var _local3:Point3D;
var _local4:Point3D;
var _local5:Point3D;
if (!normalCalculated){
_local1 = Vertex(_vertices[0]).coords;
_local2 = Vertex(_vertices[1]).coords;
_local3 = Vertex(_vertices[2]).coords;
_local4 = new Point3D((_local2.x - _local1.x), (_local2.y - _local1.y), (_local2.z - _local1.z));
_local5 = new Point3D((_local3.x - _local1.x), (_local3.y - _local1.y), (_local3.z - _local1.z));
normal = Point3D.cross(_local4, _local5);
normal.normalize();
normalCalculated = true;
};
}
function dropLightColorCalculated():void{
lightColorCalculated = false;
}
public function get vertexJoinedFaces():Set{
var _local2:Vertex;
var _local1:Set = new Set(true);
for each (_local2 in _vertices) {
_local1.concat(_local2.faces);
};
_local1.remove(this);
return (_local1);
}
function calculateVisible():void{
var _local1:Point3D;
var _local2:Point3D;
var _local3:Point3D;
var _local4:Boolean;
if (!visibleCalculated){
_local1 = _vertices[0].canvasCoords;
_local2 = _vertices[1].canvasCoords;
_local3 = _vertices[2].canvasCoords;
_local4 = ((((_local2.x - _local1.x) * (_local3.y - _local1.y)) - ((_local2.y - _local1.y) * (_local3.x - _local1.x))) < 0);
if (_local4 != visible){
visible = _local4;
visibleChanged = true;
};
visibleCalculated = true;
};
}
function calculateLightStrength(_arg1:Light, _arg2:IShading=null):void{
var _local3:Number = _arg1.getStrengthAtSurface(canvasCenter, canvasNormal);
if (((isNaN(_local3)) || ((_local3 < 0)))){
removeLight(_arg1);
} else {
if (((!((_arg1 is Ambient))) && (!((_arg2 == null))))){
_local3 = _arg2.shade(_local3);
};
if ((((((((lightStrength[_arg1] == undefined)) || (!((_local3 == lightStrength[_arg1]))))) || (meshChanged))) || (mesh.viewChanged))){
lightStrength[_arg1] = _local3;
lightChanged = true;
lightColorCalculated = false;
};
};
}
function calculateCanvasCenter():void{
var _local1:uint;
if (!canvasCenterCalculated){
canvasCenter = new Point3D();
_local1 = 0;
while (_local1 < length) {
canvasCenter.add(Vertex(_vertices[_local1]).canvasCoords);
_local1++;
};
canvasCenter.multiply((1 / length));
canvasCenterCalculated = true;
};
}
function calculateCenter():void{
var _local1:uint;
if (!centerCalculated){
center = new Point3D();
_local1 = 0;
while (_local1 < length) {
center.add(Vertex(_vertices[_local1]).coords);
_local1++;
};
center.multiply((1 / length));
centerCalculated = true;
};
}
public function hasVertex(_arg1:Vertex):Boolean{
return ((_vertices.indexOf(_arg1) >= 0));
}
function calculateCanvasNormal():void{
var _local1:Point3D;
var _local2:Point3D;
var _local3:Point3D;
var _local4:Point3D;
var _local5:Point3D;
if (!canvasNormalCalculated){
_local1 = Vertex(_vertices[0]).canvasCoords;
_local2 = Vertex(_vertices[1]).canvasCoords;
_local3 = Vertex(_vertices[2]).canvasCoords;
_local4 = new Point3D((_local3.x - _local1.x), (_local3.y - _local1.y), (_local3.z - _local1.z));
_local5 = new Point3D((_local2.x - _local1.x), (_local2.y - _local1.y), (_local2.z - _local1.z));
canvasNormal = Point3D.cross(_local4, _local5);
canvasNormal.normalize();
canvasNormalCalculated = true;
};
}
function drop():void{
coordsChanged = false;
transformChanged = false;
visibleChanged = false;
meshChanged = false;
lightColorChanged = false;
lightChanged = false;
}
public function get edgeJoinedFaces():Set{
var _local3:Face;
var _local1:Set = new Set(true);
var _local2:uint;
while (_local2 < length) {
for each (_local3 in Vertex(_vertices[_local2]).faces) {
if (((!((_local3 == this))) && ((_local3._vertices.indexOf(_vertices[((_local2)<(length - 1)) ? (_local2 + 1) : 0]) >= 0)))){
_local1.add(_local3);
};
};
_local2++;
};
return (_local1);
}
function setMesh(_arg1:Mesh):void{
mesh = _arg1;
meshChanged = true;
visibleCalculated = false;
centerCalculated = false;
canvasCenterCalculated = false;
normalCalculated = false;
canvasNormalCalculated = false;
}
function removeLight(_arg1:Light):void{
delete lightStrength[_arg1];
lightChanged = true;
lightColorCalculated = false;
}
}
}//package com.alternativagame.engine3d
Section 13
//FillRenderer (com.alternativagame.engine3d.FillRenderer)
package com.alternativagame.engine3d {
import com.alternativagame.type.*;
import com.alternativagame.engine3d.shading.*;
import com.alternativagame.engine3d.skin.*;
public class FillRenderer extends InteractiveSurfaceRenderer {
private var _blendMode:String;
private var _alpha:Number;
private var _color:uint;
private var shading:GaussianShading;
var drawParamsChanged:Boolean;// = true
private var lights:Set;
var alphaChanged:Boolean;// = true
var specularChanged:Boolean;// = true
var lightChanged:Boolean;// = false
private static var num:uint = 0;
public function FillRenderer(_arg1:RGB=null, _arg2:Number=1, _arg3:Number=2, _arg4:String="normal", _arg5:Boolean=false){
_color = ((_arg1)==null) ? 0x7F7F7F : _arg1.toInt();
_alpha = _arg2;
_blendMode = _arg4;
shading = new GaussianShading();
shading.specular = _arg3;
this.interactive = _arg5;
}
public function get specular():Number{
return (shading.specular);
}
private function updateLights():void{
var _local1:Set;
var _local2:Light;
var _local3:Face;
if (((((((_object.viewChanged) || (_object.solidParentChanged))) || (_object.solidParent.solidObjectsChanged))) || (objectChanged))){
_local1 = _object.getSolidObjects(Light);
for each (_local2 in lights) {
if (!_local1.has(_local2)){
for each (_local3 in _faces) {
_local3.removeLight(_local2);
};
};
};
lights = _local1;
};
}
override public function drop():void{
super.drop();
drawParamsChanged = false;
alphaChanged = false;
specularChanged = false;
lightChanged = false;
}
public function set alpha(_arg1:Number):void{
if (_alpha != _arg1){
_alpha = _arg1;
alphaChanged = true;
};
}
override public function clear():void{
super.clear();
lights = null;
}
override public function render():void{
var _local1:Face;
var _local2:SkinData;
updateSkinDatas();
updateLights();
for each (_local1 in _faces) {
_local2 = datas[_local1];
updateFaceVisible(_local1);
if (_local1.visible){
calculateFaceLight(_local1);
if (((((_local1.lightColorChanged) || (_local1.visibleChanged))) || (objectChanged))){
FillSkin(_local2.skin).light(_local1.lightColor);
};
if (((((((((((((((_local1.coordsChanged) || (_local1.transformChanged))) || (_local1.meshChanged))) || (_local1.visibleChanged))) || (_object.viewChanged))) || (alphaChanged))) || (drawParamsChanged))) || (objectChanged))){
_object._view.changeSkin(_local2);
FillSkin(_local2.skin).draw(_local2.points, _color, _alpha, _blendMode);
};
};
};
}
public function get blendMode():String{
return (_blendMode);
}
public function set specular(_arg1:Number):void{
shading.specular = _arg1;
specularChanged = true;
}
override protected function createSkinData(_arg1:Face):SkinData{
var _local2:Array = _arg1._vertices;
var _local3:uint = _local2.length;
var _local4:SkinData = new SkinData(this, _local3);
var _local5:uint;
while (_local5 < _local3) {
_local4.points[_local5] = _local2[_local5].canvasCoords;
_local5++;
};
_local4.skin = new FillSkin();
return (_local4);
}
public function get alpha():Number{
return (_alpha);
}
public function set color(_arg1:RGB):void{
var _local2:uint = _arg1.toInt();
if (_color != _local2){
_color = _local2;
drawParamsChanged = true;
};
}
public function set blendMode(_arg1:String):void{
if (_blendMode != _arg1){
_blendMode = _arg1;
drawParamsChanged = true;
};
}
public function get color():RGB{
return (new RGB(_color));
}
private function calculateFaceLight(_arg1:Face):void{
var _local2:Light;
var _local3:Boolean;
if (((((((_arg1.coordsChanged) || (_arg1.transformChanged))) || (_arg1.meshChanged))) || (_object.viewChanged))){
_arg1.calculateCanvasCenter();
if (((((_arg1.transformChanged) || (_arg1.meshChanged))) || (_object.viewChanged))){
_arg1.calculateCanvasNormal();
};
};
for each (_local2 in lights) {
_local3 = ((((((((((((((((_arg1.meshChanged) || (_arg1.visibleChanged))) || (_object.viewChanged))) || (_object.solidParentChanged))) || (_local2.enabledChanged))) || (_local2.solidParentChanged))) || (_local2.viewChanged))) || (_local2.parentChanged))) || (specularChanged));
if ((_local2 is Omni)){
_local3 = ((_local3) || (((((((_arg1.coordsChanged) || (_arg1.transformChanged))) || (_local2.coordsChanged))) || (Omni(_local2).rangeChanged))));
} else {
if ((_local2 is Directional)){
_local3 = ((_local3) || (((_arg1.transformChanged) || (_local2.transformChanged))));
};
};
if (_local3){
_arg1.calculateLightStrength(_local2, shading);
};
if (_local2.colorChanged){
_arg1.dropLightColorCalculated();
};
};
_arg1.calculateLightColor();
lightChanged = ((lightChanged) || (_arg1.lightColorChanged));
}
override protected function defaultName():String{
num++;
return (("fillRenderer" + num));
}
override public function clone():IRenderer{
var _local1:FillRenderer = new FillRenderer(new RGB(_color), _alpha, shading.specular, _blendMode, _interactive);
return (_local1);
}
}
}//package com.alternativagame.engine3d
Section 14
//Interaction (com.alternativagame.engine3d.Interaction)
package com.alternativagame.engine3d {
public class Interaction {
public static const SKIN_CLICK:uint = 5;
public static const SKIN_OUT:uint = 4;
public static const OBJECT_CLICK:uint = 11;
public static const RENDERER_OVER:uint = 6;
public static const MOVE:uint = 0;
public static const RENDERER_OUT:uint = 7;
public static const OBJECT_OVER:uint = 9;
public static const OBJECT_OUT:uint = 10;
public static const RENDERER_CLICK:uint = 8;
public static const DOWN:uint = 1;
public static const UP:uint = 2;
public static const SKIN_OVER:uint = 3;
}
}//package com.alternativagame.engine3d
Section 15
//InteractiveSurfaceRenderer (com.alternativagame.engine3d.InteractiveSurfaceRenderer)
package com.alternativagame.engine3d {
public class InteractiveSurfaceRenderer extends SurfaceRenderer {
protected var _interactive:Boolean;// = false
var interactiveChanged:Boolean;// = true
private static var num:uint = 0;
public function get interactive():Boolean{
return (_interactive);
}
public function set interactive(_arg1:Boolean):void{
_interactive = _arg1;
interactiveChanged = true;
}
override protected function defaultName():String{
num++;
return (("interactiveSurfaceRenderer" + num));
}
override public function clone():IRenderer{
var _local1:InteractiveSurfaceRenderer = new InteractiveSurfaceRenderer();
_local1.interactive = _interactive;
return (_local1);
}
override public function drop():void{
super.drop();
interactiveChanged = false;
}
}
}//package com.alternativagame.engine3d
Section 16
//IRenderer (com.alternativagame.engine3d.IRenderer)
package com.alternativagame.engine3d {
import com.alternativagame.type.*;
public interface IRenderer {
function setObject(_arg1:Object3D):void;
function interaction(_arg1:uint, _arg2:SkinData, _arg3:Point3D, _arg4:Boolean, _arg5:Boolean, _arg6:Boolean, _arg7:Boolean):void;
function clear():void;
function set name(_arg1:String):void;
function render():void;
function checkInteraction(_arg1:SkinData, _arg2:Point3D):Boolean;
function get name():String;
function clone():IRenderer;
function get object():Object3D;
function drop():void;
}
}//package com.alternativagame.engine3d
Section 17
//ISurfaceRenderer (com.alternativagame.engine3d.ISurfaceRenderer)
package com.alternativagame.engine3d {
import com.alternativagame.type.*;
public interface ISurfaceRenderer extends IRenderer {
function removeFace(_arg1:Face):void;
function set faces(_arg1:Set):void;
function get faces():Set;
function addFace(_arg1:Face):void;
}
}//package com.alternativagame.engine3d
Section 18
//Light (com.alternativagame.engine3d.Light)
package com.alternativagame.engine3d {
import com.alternativagame.type.*;
public class Light extends Object3D {
var _enabled:Boolean;
var _color:RGB;
var colorChanged:Boolean;// = true
var enabledChanged:Boolean;// = true
private static var num:uint = 0;
public function Light(_arg1:RGB=null):void{
_color = ((_arg1)==null) ? new RGB() : _arg1;
_enabled = true;
}
public function get enabled():Boolean{
return (_enabled);
}
function getStrengthAtSurface(_arg1:Point3D, _arg2:Point3D):Number{
return ((_enabled) ? 1 : NaN);
}
public function get color():RGB{
return (_color);
}
override protected function defaultName():String{
num++;
return (("light" + num));
}
function getStrengthAtPoint(_arg1:Point3D):Number{
return ((_enabled) ? 1 : NaN);
}
override function drop():void{
super.drop();
colorChanged = false;
enabledChanged = false;
}
override protected function cloneParams(_arg1):void{
var _local2:Light = Light(_arg1);
_local2.color = _color;
_local2.enabled = _enabled;
super.cloneParams(_local2);
}
public function set color(_arg1:RGB):void{
if (_arg1 == null){
_arg1 = new RGB();
};
if (!_color.equals(_arg1)){
_color = _arg1;
colorChanged = true;
};
}
public function set enabled(_arg1:Boolean):void{
if (_enabled != _arg1){
_enabled = _arg1;
enabledChanged = true;
};
}
override public function clone():Object3D{
var _local1:Light = new Light();
cloneParams(_local1);
cloneRenderers(_local1);
return (_local1);
}
}
}//package com.alternativagame.engine3d
Section 19
//LightTextureObject (com.alternativagame.engine3d.LightTextureObject)
package com.alternativagame.engine3d {
import flash.geom.*;
import com.alternativagame.type.*;
import flash.display.*;
import com.alternativagame.utility.*;
public class LightTextureObject extends TextureObject {
private var _near:Number;
private var _direction:Point3D;
private var _angle:Number;
private var _far:Number;
private var _color:RGB;
private var _close:Number;
public function LightTextureObject(_arg1:RGB=null, _arg2:Point3D=null, _arg3:Number=0, _arg4:Number=0, _arg5:Number=100, _arg6:Number=6.284, _arg7:Point3D=null){
_color = _arg1;
_close = _arg3;
_near = _arg4;
_far = _arg5;
this.angle = _arg6;
if (_arg2 != null){
this.coords = _arg2;
};
if (_arg7 == null){
_direction = new Point3D(0, 1, 0);
} else {
_direction = _arg7;
};
blendMode = BlendMode.ADD;
}
public function set color(_arg1:RGB):void{
if (_color == null){
if (_arg1 != null){
_color = _arg1;
drawParamsChanged = true;
};
} else {
if ((((_arg1 == null)) || (!(_color.equals(_arg1))))){
_color = _arg1;
drawParamsChanged = true;
};
};
}
public function set near(_arg1:Number):void{
if (_near != _arg1){
_near = _arg1;
_near = ((_near)<0) ? 0 : _near;
drawParamsChanged = true;
};
}
public function get angle():Number{
return (_angle);
}
override function render():void{
var uvDirection:Point3D;
var curveRadius:Number;
var delta:Number;
var beginAngle:Number;
var matrix:*;
var color:*;
var near:*;
var close:*;
var alpha:*;
var begin:*;
var i:*;
var ang:*;
var control:*;
var anchor:*;
super.render();
if (((drawParamsChanged) || (_renderer.uvChanged))){
if (_color != null){
uvDirection = _renderer.localDirectionToUV(_direction);
curveRadius = ((_far + _far) - (Math.cos((_angle / 16)) * _far));
delta = (_angle / 8);
beginAngle = ((_angle / 2) - Math.atan2(uvDirection.y, uvDirection.x));
var _local2 = graphics;
with (_local2) {
graphics.clear();
matrix = new Matrix();
matrix.createGradientBox((_far * 2), (_far * 2), 0, -(_far), -(_far));
color = _color.toInt();
near = ((_near)<_far) ? ((_near / _far) * 0xFF) : 0xFF;
close = ((_close / _far) * 0xFF);
close = ((close)<near) ? close : near;
alpha = (1 - (close / near));
beginGradientFill(GradientType.RADIAL, [color, color, color], [alpha, 1, 0], [close, near, 0xFF], matrix);
begin = Point.polar(_far, -(beginAngle));
moveTo(begin.x, begin.y);
i = 1;
while (i <= 8) {
ang = ((delta * i) - beginAngle);
control = Point.polar(curveRadius, (ang - (delta / 2)));
anchor = Point.polar(_far, ang);
curveTo(control.x, control.y, anchor.x, anchor.y);
i++;
};
if (_angle < MathUtility.degree360){
lineTo(0, 0);
};
endFill();
};
};
updateBounds();
};
}
public function get far():Number{
return (_far);
}
override public function clone():TextureObject{
var _local1:LightTextureObject = new LightTextureObject(((_color)!=null) ? _color.clone() : null, coords.clone(), _close, _near, _far, _angle, _direction.clone());
_local1.alpha = alpha;
_local1.blendMode = blendMode;
return (_local1);
}
public function get color():RGB{
return (_color);
}
public function set angle(_arg1:Number):void{
if (_angle != _arg1){
_angle = _arg1;
_angle = ((_angle)>MathUtility.degree360) ? MathUtility.degree360 : ((_angle < 0)) ? 0 : _angle;
drawParamsChanged = true;
};
}
public function get near():Number{
return (_near);
}
public function set far(_arg1:Number):void{
if (_far != _arg1){
_far = _arg1;
_far = ((_far)<0) ? 0 : _far;
drawParamsChanged = true;
};
}
public function set close(_arg1:Number):void{
if (_close != _arg1){
_close = _arg1;
_close = ((_close)<0) ? 0 : _close;
drawParamsChanged = true;
};
}
public function get close():Number{
return (_close);
}
public function set direction(_arg1:Point3D):void{
if (_arg1 != null){
if (!_direction.equals(_arg1)){
_direction.copy(_arg1);
drawParamsChanged = true;
};
};
}
public function get direction():Point3D{
return (_direction);
}
}
}//package com.alternativagame.engine3d
Section 20
//Mesh (com.alternativagame.engine3d.Mesh)
package com.alternativagame.engine3d {
import com.alternativagame.type.*;
import flash.utils.*;
public class Mesh extends Object3D {
private var _vertices:Set;
var geometryChanged:Boolean;// = false
var facesChanged:Boolean;// = false
private var _faces:Set;
var verticesChanged:Boolean;// = false
private static var num:uint = 0;
public function Mesh(){
_vertices = new Set(true);
_faces = new Set(true);
}
public function removeFace(_arg1:Face):void{
var _local2:Vertex;
var _local3:uint;
if (_faces.has(_arg1)){
_faces.remove(_arg1);
_local3 = 0;
while (_local3 < _arg1._vertices.length) {
_local2 = Vertex(_arg1._vertices[_local3]);
_local2.faces.remove(_arg1);
_local2.facesChanged = true;
_local3++;
};
_arg1.setMesh(null);
facesChanged = true;
};
}
override protected function cloneParams(_arg1):void{
var _local2:Mesh = Mesh(_arg1);
super.cloneParams(_local2);
}
public function removeVertex(_arg1:Vertex):void{
var _local2:Face;
if (_vertices.has(_arg1)){
for each (_local2 in _arg1.faces) {
removeFace(_local2);
};
_vertices.remove(_arg1);
_arg1.setMesh(null);
verticesChanged = true;
};
}
override public function addRenderer(_arg1:IRenderer):void{
var _local2:Boolean;
var _local3:Face;
super.addRenderer(_arg1);
if ((((_arg1 is ISurfaceRenderer)) && (_renderers.has(_arg1)))){
_local2 = false;
for each (_local3 in ISurfaceRenderer(_arg1).faces) {
if (_faces.has(_local3)){
_local2 = true;
break;
};
};
if (!_local2){
ISurfaceRenderer(_arg1).faces = _faces;
};
};
}
public function addRendererAuto(_arg1:ISurfaceRenderer, _arg2:Number):void{
var _local4:Face;
var _local5:ISurfaceRenderer;
var _local3:Set = new Set(true);
for each (_local4 in _faces) {
_local4.calculateNormal();
_local3.add(_local4);
};
if (!_local3.isEmpty()){
addFacesToRendererByAngle(_local3, _local3.first(), _arg1, _arg2);
addRenderer(_arg1);
while (!(_local3.isEmpty())) {
_local5 = ISurfaceRenderer(_arg1.clone());
addFacesToRendererByAngle(_local3, _local3.first(), _local5, _arg2);
addRenderer(_local5);
};
};
}
protected function cloneLinkedParams(_arg1:Mesh):void{
var _local3:Vertex;
var _local4:Face;
var _local5:Dictionary;
var _local6:uint;
var _local7:Array;
var _local8:IRenderer;
var _local9:IRenderer;
var _local10:uint;
var _local11:Set;
var _local2:Dictionary = new Dictionary(true);
for each (_local3 in vertices) {
_local2[_local3] = _local3.clone();
_arg1.addVertex(_local2[_local3]);
};
_local5 = new Dictionary(true);
for each (_local4 in faces) {
_local6 = _local4._vertices.length;
_local7 = new Array();
_local10 = 0;
while (_local10 < _local6) {
_local7.push(_local2[_local4._vertices[_local10]]);
_local10++;
};
_local5[_local4] = new Face(_local7);
_arg1.addFace(_local5[_local4]);
};
for each (_local9 in _renderers) {
_local8 = _local9.clone();
_arg1.addRenderer(_local8);
if ((_local9 is ISurfaceRenderer)){
_local11 = new Set(true);
for each (_local4 in ISurfaceRenderer(_local9).faces) {
_local11.add(_local5[_local4]);
};
ISurfaceRenderer(_local8).faces = _local11;
};
};
}
public function removeGeometry():void{
var _local1:Face;
var _local2:Vertex;
if (!_vertices.isEmpty()){
for each (_local1 in _faces) {
_local1.setMesh(null);
};
_faces.clear();
for each (_local2 in _vertices) {
_local2.faces.clear();
_local2.setMesh(null);
};
_vertices.clear();
verticesChanged = true;
facesChanged = true;
};
}
override public function replaceRenderer(_arg1:IRenderer, _arg2:IRenderer):void{
if (!(_arg2 is ISurfaceRenderer)){
super.replaceRenderer(_arg1, _arg2);
} else {
if (_renderers.has(_arg1)){
removeRenderer(_arg1);
addRenderer(_arg2);
if ((_arg1 is ISurfaceRenderer)){
ISurfaceRenderer(_arg2).faces = ISurfaceRenderer(_arg1).faces;
};
};
};
}
override public function clone():Object3D{
var _local1:Mesh = new Mesh();
cloneParams(_local1);
cloneLinkedParams(_local1);
return (_local1);
}
public function addFace(_arg1:Face):void{
var _local2:Vertex;
if (_arg1.mesh != null){
_arg1.mesh.removeFace(_arg1);
};
_faces.add(_arg1);
var _local3:uint;
while (_local3 < _arg1._vertices.length) {
_local2 = Vertex(_arg1._vertices[_local3]);
if (_local2.mesh == this){
_local2.faces.add(_arg1);
_local2.facesChanged = true;
} else {
throw (new Error("Face use vertex from another mesh"));
};
_local3++;
};
_arg1.setMesh(this);
facesChanged = true;
}
public function addVertex(_arg1:Vertex):void{
if (_arg1.mesh != null){
_arg1.mesh.removeVertex(_arg1);
};
_vertices.add(_arg1);
_arg1.setMesh(this);
verticesChanged = true;
}
override function calculate():void{
var _local1:Vertex;
super.calculate();
if (((((((((((transformChanged) || (coordsChanged))) || (geometryChanged))) || (verticesChanged))) || (viewChanged))) || (parentChanged))){
for each (_local1 in _vertices) {
_local1.calculate(transformMatrix);
};
};
}
override function setView(_arg1:View):void{
var _local2:Face;
if (_view != _arg1){
for each (_local2 in _faces) {
_local2.visibleCalculated = false;
_local2.canvasCenterCalculated = false;
_local2.canvasNormalCalculated = false;
};
};
super.setView(_arg1);
}
private function addFacesToRendererByAngle(_arg1:Set, _arg2:Face, _arg3:ISurfaceRenderer, _arg4:Number):void{
var _local6:Face;
_arg3.addFace(_arg2);
_arg1.remove(_arg2);
var _local5:Set = _arg2.edgeJoinedFaces;
for each (_local6 in _local5) {
if (((_arg1.has(_local6)) && ((Point3D.angleFast(_arg2.normal, _local6.normal) < _arg4)))){
addFacesToRendererByAngle(_arg1, _local6, _arg3, _arg4);
};
};
}
override function setTransformChanged():void{
var _local1:Vertex;
var _local2:Face;
if (!transformChanged){
for each (_local1 in _vertices) {
_local1.coordsChanged = true;
};
for each (_local2 in _faces) {
_local2.coordsChanged = true;
_local2.transformChanged = true;
_local2.visibleCalculated = false;
_local2.canvasCenterCalculated = false;
_local2.canvasNormalCalculated = false;
};
};
super.setTransformChanged();
}
override protected function defaultName():String{
num++;
return (("mesh" + num));
}
override function drop():void{
var _local1:Vertex;
var _local2:Face;
super.drop();
geometryChanged = false;
verticesChanged = false;
facesChanged = false;
for each (_local1 in _vertices) {
_local1.drop();
};
for each (_local2 in _faces) {
_local2.drop();
};
}
override function setCoordsChanged():void{
var _local1:Vertex;
var _local2:Face;
if (!coordsChanged){
for each (_local1 in _vertices) {
_local1.coordsChanged = true;
};
for each (_local2 in _faces) {
_local2.coordsChanged = true;
_local2.canvasCenterCalculated = false;
};
};
super.setCoordsChanged();
}
public function get vertices():Set{
return (_vertices);
}
public function get faces():Set{
return (_faces);
}
}
}//package com.alternativagame.engine3d
Section 21
//Object3D (com.alternativagame.engine3d.Object3D)
package com.alternativagame.engine3d {
import com.alternativagame.type.*;
import flash.utils.*;
import com.alternativagame.utility.*;
public class Object3D {
var objectsChanged:Boolean;// = false
public var solidParent:Object3D;
private var _coords:Point3D;
private var _rotX:Number;// = 0
private var _rotY:Number;// = 0
private var _rotZ:Number;// = 0
private var directionTransformCalculated:Boolean;// = false
var transformMatrix:Matrix3D;
var viewChanged:Boolean;// = false
private var _scaleX:Number;// = 1
private var _scaleY:Number;// = 1
private var _scaleZ:Number;// = 1
private var _name:String;
var _view:View;// = null
var solidChanged:Boolean;// = true
var _renderers:Set;
var renderersChanged:Boolean;// = false
var canvasCoords:Point3D;
var solidObjectsChanged:Boolean;// = true
var transformChanged:Boolean;// = true
var nameChanged:Boolean;// = true
var parentChanged:Boolean;// = false
private var _solid:Boolean;// = false
var mobileChanged:Boolean;// = true
var coordsChanged:Boolean;// = true
var solidParentChanged:Boolean;// = true
private var _mobile:Boolean;// = false
var _parent:Object3D;// = null
var directionTransformMatrix:Matrix3D;
var _objects:Set;
private var solidObjects:Dictionary;
private var inverseTransformCalculated:Boolean;// = false
var inverseTransformMatrix:Matrix3D;
private static var num:uint = 0;
public function Object3D(){
_coords = new Point3D();
_objects = new Set(true);
solidParent = this;
solidObjects = new Dictionary(true);
addSolidObject(this);
_renderers = new Set(true);
_name = defaultName();
}
public function get renderers():Set{
return (_renderers);
}
public function get objects():Set{
return (_objects);
}
public function getObjectByName(_arg1:String):Object3D{
var _local3:Object3D;
var _local2:Object3D;
for each (_local3 in _objects) {
if (_local3.name == _arg1){
_local2 = _local3;
break;
};
};
return (_local2);
}
public function getRendererByName(_arg1:String):IRenderer{
var _local3:IRenderer;
var _local2:IRenderer;
for each (_local3 in _renderers) {
if (_local3.name == _arg1){
_local2 = _local3;
break;
};
};
return (_local2);
}
public function set name(_arg1:String):void{
_name = _arg1;
nameChanged = true;
}
public function get coords():Point3D{
return (_coords.clone());
}
function setView(_arg1:View):void{
var _local2:Object3D;
var _local3:IRenderer;
if (_view != _arg1){
if (_arg1 == null){
canvasCoords = null;
transformMatrix = null;
for each (_local3 in _renderers) {
_local3.clear();
};
} else {
canvasCoords = new Point3D();
viewChanged = true;
};
_view = _arg1;
for each (_local2 in _objects) {
_local2.setView(_arg1);
};
};
}
function setTransformChanged():void{
var _local1:Object3D;
if (!transformChanged){
for each (_local1 in _objects) {
_local1.setCoordsChanged();
_local1.setTransformChanged();
};
transformChanged = true;
};
}
public function canvasToLocal(_arg1:Point3D):Point3D{
calculateInverseTransform();
var _local2:Point3D = _arg1.clone();
_local2.transform(inverseTransformMatrix);
return (_local2);
}
protected function cloneRenderers(_arg1):void{
var _local3:IRenderer;
var _local4:IRenderer;
var _local2:Object3D = Object3D(_arg1);
for each (_local3 in _renderers) {
_local4 = _local3.clone();
_local4.name = _local3.name;
_local2.addRenderer(_local4);
};
}
public function set coords(_arg1:Point3D):void{
if (!_coords.equals(_arg1)){
_coords.copy(_arg1);
setCoordsChanged();
};
}
public function localToCanvas(_arg1:Point3D):Point3D{
var _local2:Point3D = _arg1.clone();
_local2.transform(transformMatrix);
return (_local2);
}
protected function cloneParams(_arg1):void{
var _local3:Object3D;
var _local2:Object3D = Object3D(_arg1);
_local2.coords = _coords;
_local2.rotX = _rotX;
_local2.rotY = _rotY;
_local2.rotZ = _rotZ;
_local2.scaleX = _scaleX;
_local2.scaleY = _scaleY;
_local2.scaleZ = _scaleZ;
_local2.solid = _solid;
_local2.name = _name;
_local2.mobile = _mobile;
for each (_local3 in _objects) {
_local2.attach(_local3.clone());
};
}
public function set mobile(_arg1:Boolean):void{
if (_mobile != _arg1){
_mobile = _arg1;
mobileChanged = true;
};
}
public function attach(_arg1:Object3D):void{
if (((!((_arg1 == null))) && (!((_arg1._parent == this))))){
if (_arg1._parent != null){
_arg1._parent._objects.remove(_arg1);
_arg1._parent.objectsChanged = true;
} else {
if (((!((_arg1._view == null))) && ((_arg1._view.object == _arg1)))){
_arg1._view.object = null;
};
};
if (getBranch().indexOf(_arg1) < 0){
_objects.add(_arg1);
_arg1.setParent(this);
_arg1.setView(_view);
objectsChanged = true;
} else {
throw (new Error("Can't attach parent object"));
};
};
}
public function get scaleX():Number{
return (_scaleX);
}
public function get scaleY():Number{
return (_scaleY);
}
public function get scaleZ():Number{
return (_scaleZ);
}
public function set solid(_arg1:Boolean):void{
var _local2:Object3D;
var _local3:Object3D;
if (_solid != _arg1){
_solid = _arg1;
if (_arg1){
_local2 = this;
} else {
_local2 = solidParent;
};
for each (_local3 in _objects) {
_local3.setSolidParent(_local2);
};
solidChanged = true;
};
}
function getSolidObjects(_arg1:Class=null):Set{
if (((solid) || ((_parent == null)))){
_arg1 = ((_arg1)==null) ? Object3D : _arg1;
if (solidObjects[_arg1] != undefined){
return (Set(solidObjects[_arg1]));
};
return (new Set());
//unresolved jump
};
return (solidParent.getSolidObjects(_arg1));
}
public function get rotX():Number{
return (_rotX);
}
public function get rotY():Number{
return (_rotY);
}
public function get rotZ():Number{
return (_rotZ);
}
function calculate():void{
var _local1:Object3D;
var _local2:Matrix3D;
var _local3:Point3D;
if (((((((transformChanged) || (coordsChanged))) || (viewChanged))) || (parentChanged))){
_local2 = ((this)==_view.object) ? _view.transformMatrix : _parent.transformMatrix;
if (((((transformChanged) || (viewChanged))) || (parentChanged))){
transformMatrix = Matrix3D.transformationMatrix(x, y, z, rotX, rotY, rotZ, scaleX, scaleY, scaleZ);
transformMatrix.combine(_local2);
} else {
_local3 = coords.clone();
_local3.transform(_local2);
transformMatrix.d = _local3.x;
transformMatrix.h = _local3.y;
transformMatrix.l = _local3.z;
};
canvasCoords.x = transformMatrix.d;
canvasCoords.y = transformMatrix.h;
canvasCoords.z = transformMatrix.l;
inverseTransformCalculated = false;
directionTransformCalculated = false;
};
for each (_local1 in _objects) {
_local1.calculate();
};
}
public function removeRenderer(_arg1:IRenderer):void{
if (_renderers.has(_arg1)){
_renderers.remove(_arg1);
_arg1.setObject(null);
renderersChanged = true;
};
}
function addSolidObject(_arg1:Object3D):void{
var _local3:Class;
var _local2:Array = ObjectUtility.getClassTree(_arg1, Object3D);
var _local4:uint;
while (_local4 < _local2.length) {
_local3 = _local2[_local4];
if (solidObjects[_local3] == undefined){
solidObjects[_local3] = new Set();
};
solidObjects[_local3].add(_arg1);
_local4++;
};
solidObjectsChanged = true;
}
function setSolidParent(_arg1:Object3D):void{
var _local2:Object3D;
solidParent.removeSolidObject(this);
_arg1.addSolidObject(this);
if (!solid){
for each (_local2 in _objects) {
_local2.setSolidParent(_arg1);
};
};
solidParent = _arg1;
solidParentChanged = true;
}
function setCoordsChanged():void{
var _local1:Object3D;
if (!coordsChanged){
for each (_local1 in _objects) {
_local1.setCoordsChanged();
};
coordsChanged = true;
};
}
public function clone():Object3D{
var _local1:Object3D = new Object3D();
cloneParams(_local1);
cloneRenderers(_local1);
return (_local1);
}
public function get x():Number{
return (_coords.x);
}
public function get y():Number{
return (_coords.y);
}
protected function defaultName():String{
num++;
return (("object" + num));
}
public function get z():Number{
return (_coords.z);
}
public function toString():String{
return ((((("[" + ObjectUtility.getClassName(this)) + " ") + _name) + "]"));
}
public function replaceRenderer(_arg1:IRenderer, _arg2:IRenderer):void{
if (_renderers.has(_arg1)){
removeRenderer(_arg1);
addRenderer(_arg2);
};
}
function getBranch():Array{
var _local1:Array = new Array();
var _local2:Object3D = this;
while (_local2 != null) {
_local1.push(_local2);
_local2 = _local2._parent;
};
return (_local1);
}
public function set scaleZ(_arg1:Number):void{
if (_scaleZ != _arg1){
_scaleZ = _arg1;
setTransformChanged();
};
}
public function detach(_arg1:Object3D):void{
if (((!((_arg1 == null))) && (_objects.has(_arg1)))){
_objects.remove(_arg1);
_arg1.setParent(null);
_arg1.setView(null);
objectsChanged = true;
};
}
function render():void{
var _local1:IRenderer;
var _local2:Object3D;
for each (_local1 in _renderers) {
_local1.render();
};
for each (_local2 in _objects) {
_local2.render();
};
}
function removeSolidObject(_arg1:Object3D):void{
var _local3:Class;
var _local2:Array = ObjectUtility.getClassTree(_arg1, Object3D);
var _local4:uint;
while (_local4 < _local2.length) {
_local3 = _local2[_local4];
Set(solidObjects[_local3]).remove(_arg1);
if (Set(solidObjects[_local3]).isEmpty()){
delete solidObjects[_local3];
};
_local4++;
};
solidObjectsChanged = true;
}
public function set scaleX(_arg1:Number):void{
if (_scaleX != _arg1){
_scaleX = _arg1;
setTransformChanged();
};
}
public function get name():String{
return (_name);
}
public function canvasDirectionToLocal(_arg1:Point3D):Point3D{
calculateDirectionTransform();
var _local2:Point3D = _arg1.clone();
_local2.transform(directionTransformMatrix);
return (_local2);
}
function setParent(_arg1:Object3D):void{
if (_arg1 == null){
setSolidParent(this);
} else {
setSolidParent((_arg1.solid) ? _arg1 : _arg1.solidParent);
};
_parent = _arg1;
parentChanged = true;
}
public function get view():View{
return (_view);
}
public function get parent():Object3D{
return (_parent);
}
public function get solid():Boolean{
return (_solid);
}
public function addRenderer(_arg1:IRenderer):void{
if (!_renderers.has(_arg1)){
if (_arg1.object != null){
_arg1.object.removeRenderer(_arg1);
};
_renderers.add(_arg1);
_arg1.setObject(this);
renderersChanged = true;
};
}
public function set scaleY(_arg1:Number):void{
if (_scaleY != _arg1){
_scaleY = _arg1;
setTransformChanged();
};
}
public function set rotX(_arg1:Number):void{
if (_rotX != _arg1){
_rotX = _arg1;
setTransformChanged();
};
}
public function set rotY(_arg1:Number):void{
if (_rotY != _arg1){
_rotY = _arg1;
setTransformChanged();
};
}
public function set rotZ(_arg1:Number):void{
if (_rotZ != _arg1){
_rotZ = _arg1;
setTransformChanged();
};
}
private function calculateDirectionTransform():void{
var _local1:Matrix3D;
if (!directionTransformCalculated){
_local1 = transformMatrix.clone();
_local1.resetTranslate();
directionTransformMatrix = Matrix3D.inverseMatrix(_local1);
directionTransformCalculated = true;
};
}
public function get mobile():Boolean{
return (_mobile);
}
public function removeRendererByName(_arg1:String):void{
var _local2:IRenderer = getRendererByName(_arg1);
if (_local2 != null){
removeRenderer(_local2);
};
}
function calculateInverseTransform():void{
if (!inverseTransformCalculated){
inverseTransformMatrix = Matrix3D.inverseMatrix(transformMatrix);
inverseTransformCalculated = true;
};
}
public function removeRenderers():void{
var _local1:IRenderer;
for each (_local1 in _renderers) {
_local1.setObject(null);
};
_renderers.clear();
renderersChanged = true;
}
function drop():void{
var _local1:IRenderer;
var _local2:Object3D;
coordsChanged = false;
transformChanged = false;
viewChanged = false;
parentChanged = false;
objectsChanged = false;
renderersChanged = false;
solidChanged = false;
solidParentChanged = false;
solidObjectsChanged = false;
nameChanged = false;
mobileChanged = false;
for each (_local1 in _renderers) {
_local1.drop();
};
for each (_local2 in _objects) {
_local2.drop();
};
}
public function set x(_arg1:Number):void{
if (_coords.x != _arg1){
_coords.x = _arg1;
setCoordsChanged();
};
}
public function set y(_arg1:Number):void{
if (_coords.y != _arg1){
_coords.y = _arg1;
setCoordsChanged();
};
}
public function replaceRendererByName(_arg1:String, _arg2:IRenderer):void{
var _local3:IRenderer = getRendererByName(_arg1);
if (_local3 != null){
replaceRenderer(_local3, _arg2);
};
}
public function set z(_arg1:Number):void{
if (_coords.z != _arg1){
_coords.z = _arg1;
setCoordsChanged();
};
}
}
}//package com.alternativagame.engine3d
Section 22
//ObjectRenderer (com.alternativagame.engine3d.ObjectRenderer)
package com.alternativagame.engine3d {
import com.alternativagame.type.*;
import com.alternativagame.utility.*;
public class ObjectRenderer implements IRenderer {
protected var data:SkinData;
protected var _object:Object3D;
var nameChanged:Boolean;// = true
private var _name:String;
var objectChanged:Boolean;// = false
private static var num:uint = 0;
public function ObjectRenderer(){
_name = defaultName();
}
public function setObject(_arg1:Object3D):void{
if (_object != _arg1){
if (_object != null){
clear();
};
_object = _arg1;
objectChanged = true;
};
}
public function get name():String{
return (_name);
}
public function interaction(_arg1:uint, _arg2:SkinData, _arg3:Point3D, _arg4:Boolean, _arg5:Boolean, _arg6:Boolean, _arg7:Boolean):void{
}
public function clear():void{
if (((((!((_object == null))) && (!((_object._view == null))))) && (!((data == null))))){
_object._view.removeSkin(data);
data = null;
};
}
public function set name(_arg1:String):void{
_name = _arg1;
nameChanged = true;
}
public function render():void{
}
public function clone():IRenderer{
var _local1:ObjectRenderer = new ObjectRenderer();
return (_local1);
}
public function checkInteraction(_arg1:SkinData, _arg2:Point3D):Boolean{
return (false);
}
protected function defaultName():String{
num++;
return (("objectRenderer" + num));
}
public function drop():void{
nameChanged = false;
objectChanged = false;
}
public function toString():String{
return ((((("[" + ObjectUtility.getClassName(this)) + " ") + _name) + "]"));
}
public function get object():Object3D{
return (_object);
}
}
}//package com.alternativagame.engine3d
Section 23
//Omni (com.alternativagame.engine3d.Omni)
package com.alternativagame.engine3d {
import com.alternativagame.type.*;
public class Omni extends Light {
private var _near:Number;
var nearSqr:Number;
var canvasNearSqr:Number;
private var _far:Number;
var canvasFar:Number;
var canvasNear:Number;
var canvasFarNearSqr:Number;
var farNearSqr:Number;
var rangeChanged:Boolean;// = true
var canvasFarSqr:Number;
var farSqr:Number;
private static var num:uint = 0;
public function Omni(_arg1:RGB=null, _arg2:Number=0, _arg3:Number=100){
super(_arg1);
_near = _arg2;
_far = _arg3;
setChangedRange();
}
override function getStrengthAtSurface(_arg1:Point3D, _arg2:Point3D):Number{
var _local3:Point3D;
var _local4:Number;
var _local5:Number;
if (_enabled){
_local3 = new Point3D((_arg1.x - canvasCoords.x), (_arg1.y - canvasCoords.y), (_arg1.z - canvasCoords.z));
_local4 = _local3.lengthSqr;
if (_local4 <= canvasFarSqr){
_local3.normalize();
_local5 = -(Point3D.dot(_local3, _arg2));
if (_local4 > canvasNearSqr){
_local5 = (_local5 * (canvasFarNearSqr * (canvasFarSqr - _local4)));
};
return (_local5);
} else {
return (NaN);
};
//unresolved jump
};
return (NaN);
}
public function set far(_arg1:Number):void{
_far = _arg1;
setChangedRange();
}
override function getStrengthAtPoint(_arg1:Point3D):Number{
var _local2:Point3D;
var _local3:Number;
var _local4:Number;
if (_enabled){
_local2 = new Point3D((_arg1.x - canvasCoords.x), (_arg1.y - canvasCoords.y), (_arg1.z - canvasCoords.z));
_local3 = _local2.lengthSqr;
if (_local3 <= canvasFarSqr){
_local2.normalize();
_local4 = ((1 - _local2.z) / 2);
if (_local3 > canvasNearSqr){
_local4 = (_local4 * (canvasFarNearSqr * (canvasFarSqr - _local3)));
};
return (_local4);
} else {
return (NaN);
};
//unresolved jump
};
return (NaN);
}
public function get near():Number{
return (_near);
}
public function set near(_arg1:Number):void{
_near = _arg1;
setChangedRange();
}
override protected function cloneParams(_arg1):void{
var _local2:Omni = Omni(_arg1);
_local2.far = far;
_local2.near = near;
super.cloneParams(_local2);
}
public function get far():Number{
return (_far);
}
override public function clone():Object3D{
var _local1:Omni = new Omni();
cloneParams(_local1);
cloneRenderers(_local1);
return (_local1);
}
override function calculate():void{
super.calculate();
if (((((((_view.zoomChanged) || (rangeChanged))) || (viewChanged))) || (parentChanged))){
canvasNear = (_near * _view.zoom);
canvasFar = (_far * _view.zoom);
canvasNearSqr = (canvasNear * canvasNear);
canvasFarSqr = (canvasFar * canvasFar);
canvasFarNearSqr = (1 / (canvasFarSqr - canvasNearSqr));
};
}
private function setChangedRange():void{
nearSqr = (_near * _near);
farSqr = (_far * _far);
farNearSqr = (1 / (farSqr - nearSqr));
rangeChanged = true;
}
override protected function defaultName():String{
num++;
return (("omni" + num));
}
override function drop():void{
super.drop();
rangeChanged = false;
}
}
}//package com.alternativagame.engine3d
Section 24
//PathTextureObject (com.alternativagame.engine3d.PathTextureObject)
package com.alternativagame.engine3d {
import flash.geom.*;
import com.alternativagame.type.*;
import flash.display.*;
import com.alternativagame.utility.*;
public class PathTextureObject extends TextureObject {
private var _points:Array;
private var fill:Shape;
private var _texture:TextureData;
private var _edgeMask:TextureData;
private var _color:RGB;
private var _offset:Number;
private static const defaultThickness:Number = 20;
public function PathTextureObject(_arg1:RGB=null, _arg2:TextureData=null, _arg3:TextureData=null, _arg4:Array=null){
_color = _arg1;
_texture = _arg2;
_edgeMask = _arg3;
_points = ((_arg4)!=null) ? new Array().concat(_arg4) : new Array();
_offset = 0;
fill = new Shape();
fill.cacheAsBitmap = true;
addChild(fill);
}
public function get edgeMask():TextureData{
return (_edgeMask);
}
public function setPointCoords(_arg1:uint, _arg2:Point3D):void{
if ((((_arg1 < _points.length)) && (!((_arg2 == null))))){
Point3D(_points[_arg1]).copy(_arg2);
drawParamsChanged = true;
};
}
public function set color(_arg1:RGB):void{
_color = _arg1;
drawParamsChanged = true;
}
public function set edgeMask(_arg1:TextureData):void{
_edgeMask = _arg1;
drawParamsChanged = true;
}
public function get offset():Number{
return (_offset);
}
public function set points(_arg1:Array):void{
_points = ((_arg1)!=null) ? new Array().concat(_arg1) : new Array();
drawParamsChanged = true;
}
override function render():void{
var i:uint;
var len:uint;
var uvCoords:Array;
var matrix:Matrix;
var types:Array;
var corners:Array;
var leftCorners:Array;
var rightCorners:Array;
var half:Number;
var crop:Number;
var halfCroped:Number;
var corner:Point;
var current:Point3D;
var prev:Point3D;
var next:Point3D;
var left:Point;
var right:Point;
var cross:Number;
var leftCorner:Point;
var rightCorner:Point;
var distance:Number;
var point:Point;
var ang:Number;
var xShift:*;
var j:*;
var dx:*;
var dy:*;
var form:Array;
var inc:int;
var dec:int;
super.render();
if (((drawParamsChanged) || (_renderer.uvChanged))){
len = _points.length;
uvCoords = new Array();
i = 0;
while (i < len) {
uvCoords[i] = localToUV(_points[i]);
i = (i + 1);
};
fill.graphics.clear();
if (fill.mask != null){
Shape(fill.mask).graphics.clear();
removeChild(fill.mask);
fill.mask = null;
};
if ((((_points.length > 1)) && (((!((_color == null))) || (!((_texture == null))))))){
matrix = new Matrix();
types = new Array();
corners = new Array();
leftCorners = new Array();
rightCorners = new Array();
half = ((_texture)!=null) ? ((_texture.bitmapData.height * _texture.resolution) / 2) : ((_edgeMask)!=null) ? ((defaultThickness / 2) + (_edgeMask.bitmapData.height * _edgeMask.resolution)) : (defaultThickness / 2);
crop = (((!((_texture == null))) && ((_texture.resolution >= 1)))) ? _texture.resolution : 1;
halfCroped = (half - crop);
i = 0;
while (i < len) {
if ((((i > 0)) && ((i < (len - 1))))){
current = uvCoords[i];
prev = ((i)>0) ? uvCoords[(i - 1)] : uvCoords[(len - 1)];
next = ((i)<(len - 1)) ? uvCoords[(i + 1)] : uvCoords[0];
left = new Point((prev.x - current.x), (prev.y - current.y));
right = new Point((next.x - current.x), (next.y - current.y));
left.normalize(1);
right.normalize(1);
corner = left.add(right);
cross = MathUtility.vectorCross(left, right);
types[i] = (cross <= 0);
if (cross != 0){
distance = (halfCroped / Math.abs(Math.sin(MathUtility.vectorAngle(right, corner))));
corner.normalize(distance);
point = new Point(-(corner.x), -(corner.y));
point.normalize(halfCroped);
leftCorner = new Point(point.y, -(point.x));
leftCorner.normalize(((distance - halfCroped) * Math.tan((MathUtility.vectorAngle(left, right) / 2))));
rightCorner = new Point(-(leftCorner.x), -(leftCorner.y));
leftCorner.x = (leftCorner.x + point.x);
leftCorner.y = (leftCorner.y + point.y);
rightCorner.x = (rightCorner.x + point.x);
rightCorner.y = (rightCorner.y + point.y);
} else {
corner.x = -(right.y);
corner.y = right.x;
distance = (halfCroped / Math.abs(Math.sin(MathUtility.vectorAngle(right, corner))));
corner.normalize(distance);
leftCorner = new Point(-(corner.x), -(corner.y));
rightCorner = leftCorner.clone();
};
leftCorners[i] = leftCorner;
rightCorners[i] = rightCorner;
} else {
ang = ((i)==0) ? Math.atan2((uvCoords[(i + 1)].y - uvCoords[i].y), (uvCoords[(i + 1)].x - uvCoords[i].x)) : Math.atan2((uvCoords[(len - 2)].y - uvCoords[(len - 1)].y), (uvCoords[(len - 2)].x - uvCoords[(len - 1)].x));
corner = Point.polar(((halfCroped * 2) / Math.SQRT2), (ang - ((3 * Math.PI) / 4)));
};
corners[i] = corner;
i = (i + 1);
};
var _local2 = fill.graphics;
with (_local2) {
xShift = -(offset);
i = 0;
while (i < (len - 1)) {
j = (i + 1);
dx = (uvCoords[j].x - uvCoords[i].x);
dy = (uvCoords[j].y - uvCoords[i].y);
if (_texture != null){
matrix.identity();
matrix.a = _texture.resolution;
matrix.d = _texture.resolution;
matrix.tx = -(xShift);
matrix.ty = -(half);
matrix.rotate(Math.atan2(dy, dx));
matrix.translate(uvCoords[i].x, uvCoords[i].y);
beginBitmapFill(_texture.bitmapData, matrix, true, true);
} else {
beginFill(_color.toInt());
};
if (i > 0){
if (types[i]){
moveTo((uvCoords[i].x + corners[i].x), (uvCoords[i].y + corners[i].y));
lineTo(uvCoords[i].x, uvCoords[i].y);
lineTo((uvCoords[i].x + rightCorners[i].x), (uvCoords[i].y + rightCorners[i].y));
} else {
moveTo((uvCoords[i].x + leftCorners[i].x), (uvCoords[i].y + leftCorners[i].y));
lineTo(uvCoords[i].x, uvCoords[i].y);
lineTo((uvCoords[i].x + corners[i].x), (uvCoords[i].y + corners[i].y));
};
} else {
moveTo((uvCoords[i].x + corners[i].y), (uvCoords[i].y - corners[i].x));
lineTo((uvCoords[i].x + corners[i].x), (uvCoords[i].y + corners[i].y));
};
if (j < (len - 1)){
if (types[j]){
lineTo((uvCoords[j].x + leftCorners[j].x), (uvCoords[j].y + leftCorners[j].y));
lineTo(uvCoords[j].x, uvCoords[j].y);
lineTo((uvCoords[j].x + corners[j].x), (uvCoords[j].y + corners[j].y));
} else {
lineTo((uvCoords[j].x + corners[j].x), (uvCoords[j].y + corners[j].y));
lineTo(uvCoords[j].x, uvCoords[j].y);
lineTo((uvCoords[j].x + rightCorners[j].x), (uvCoords[j].y + rightCorners[j].y));
};
} else {
lineTo((uvCoords[j].x + corners[j].y), (uvCoords[j].y - corners[j].x));
lineTo((uvCoords[j].x + corners[j].x), (uvCoords[j].y + corners[j].y));
};
endFill();
xShift = (xShift + Math.sqrt(((dx * dx) + (dy * dy))));
if (j < (len - 1)){
if (_texture != null){
matrix.identity();
matrix.a = _texture.resolution;
matrix.d = _texture.resolution;
matrix.tx = -(xShift);
matrix.ty = -(half);
matrix.rotate((Math.atan2(corners[j].y, corners[j].x) + (types[j]) ? (-(Math.PI) / 2) : (Math.PI / 2)));
matrix.translate(uvCoords[j].x, uvCoords[j].y);
beginBitmapFill(_texture.bitmapData, matrix, true, true);
} else {
beginFill(_color.toInt());
};
moveTo(uvCoords[j].x, uvCoords[j].y);
lineTo((uvCoords[j].x + leftCorners[j].x), (uvCoords[j].y + leftCorners[j].y));
lineTo((uvCoords[j].x + rightCorners[j].x), (uvCoords[j].y + rightCorners[j].y));
endFill();
};
i++;
};
endFill();
};
if (_edgeMask != null){
fill.mask = new Shape();
fill.mask.cacheAsBitmap = true;
addChild(fill.mask);
form = new Array();
inc = -1;
dec = ((len * 3) - 2);
i = 0;
while (i < len) {
if ((((i > 0)) && ((i < (len - 1))))){
if (types[i]){
inc = (inc + 1);
_local2 = (inc + 1);
form[_local2] = new Point3D((uvCoords[i].x + leftCorners[i].x), (uvCoords[i].y + leftCorners[i].y));
inc = (inc + 1);
var _local3:int = (inc + 1);
form[_local3] = new Point3D((uvCoords[i].x + rightCorners[i].x), (uvCoords[i].y + rightCorners[i].y));
dec = (dec - 1);
var _local4:int = (dec - 1);
form[_local4] = new Point3D((uvCoords[i].x + corners[i].x), (uvCoords[i].y + corners[i].y));
} else {
inc = (inc + 1);
_local2 = (inc + 1);
form[_local2] = new Point3D((uvCoords[i].x + corners[i].x), (uvCoords[i].y + corners[i].y));
dec = (dec - 1);
_local3 = (dec - 1);
form[_local3] = new Point3D((uvCoords[i].x + rightCorners[i].x), (uvCoords[i].y + rightCorners[i].y));
dec = (dec - 1);
_local4 = (dec - 1);
form[_local4] = new Point3D((uvCoords[i].x + leftCorners[i].x), (uvCoords[i].y + leftCorners[i].y));
};
} else {
if (i == 0){
inc = (inc + 1);
_local2 = (inc + 1);
form[_local2] = new Point3D((uvCoords[i].x + corners[i].x), (uvCoords[i].y + corners[i].y));
dec = (dec - 1);
_local3 = (dec - 1);
form[_local3] = new Point3D((uvCoords[i].x + corners[i].y), (uvCoords[i].y - corners[i].x));
} else {
inc = (inc + 1);
_local2 = (inc + 1);
form[_local2] = new Point3D((uvCoords[i].x + corners[i].y), (uvCoords[i].y - corners[i].x));
dec = (dec - 1);
_local3 = (dec - 1);
form[_local3] = new Point3D((uvCoords[i].x + corners[i].x), (uvCoords[i].y + corners[i].y));
};
};
i = (i + 1);
};
uvCoords = form;
len = uvCoords.length;
half = (_edgeMask.bitmapData.height * _edgeMask.resolution);
crop = ((_edgeMask.resolution)>=1) ? _edgeMask.resolution : 1;
halfCroped = (half - (crop * 2));
i = 0;
while (i < len) {
current = uvCoords[i];
prev = ((i)>0) ? uvCoords[(i - 1)] : uvCoords[(len - 1)];
next = ((i)<(len - 1)) ? uvCoords[(i + 1)] : uvCoords[0];
left = new Point((prev.x - current.x), (prev.y - current.y));
right = new Point((next.x - current.x), (next.y - current.y));
left.normalize(10);
right.normalize(10);
corner = left.add(right);
cross = MathUtility.vectorCross(left, right);
if (cross != 0){
if (cross > 0){
corner.x = -(corner.x);
corner.y = -(corner.y);
};
distance = (halfCroped / Math.abs(Math.sin(MathUtility.vectorAngle(right, corner))));
corner.normalize(distance);
} else {
corner.x = -(right.y);
corner.y = right.x;
corner.normalize(halfCroped);
};
corners[i] = corner;
i = (i + 1);
};
_local2 = Shape(fill.mask).graphics;
with (_local2) {
beginFill(_edgeMask.bitmapData.getPixel(0, (_edgeMask.bitmapData.height - 1)));
moveTo((uvCoords[0].x + corners[0].x), (uvCoords[0].y + corners[0].y));
i = 1;
while (i < len) {
lineTo((uvCoords[i].x + corners[i].x), (uvCoords[i].y + corners[i].y));
i++;
};
endFill();
xShift = 0;
i = 0;
while (i < len) {
j = ((i)<(len - 1)) ? (i + 1) : 0;
dx = (uvCoords[j].x - uvCoords[i].x);
dy = (uvCoords[j].y - uvCoords[i].y);
matrix.identity();
matrix.a = _edgeMask.resolution;
matrix.d = _edgeMask.resolution;
matrix.tx = -(xShift);
matrix.ty = (-(crop) / 2);
matrix.rotate(Math.atan2(dy, dx));
matrix.translate(uvCoords[i].x, uvCoords[i].y);
beginBitmapFill(_edgeMask.bitmapData, matrix, true, true);
moveTo((uvCoords[i].x + corners[i].x), (uvCoords[i].y + corners[i].y));
lineTo(uvCoords[i].x, uvCoords[i].y);
lineTo(uvCoords[j].x, uvCoords[j].y);
lineTo((uvCoords[j].x + corners[j].x), (uvCoords[j].y + corners[j].y));
endFill();
xShift = (xShift + Math.sqrt(((dx * dx) + (dy * dy))));
i++;
};
};
};
};
updateBounds();
};
}
public function getPointCoords(_arg1:uint):Point3D{
if (_arg1 < _points.length){
return (Point3D(_points[_arg1]).clone());
};
return (null);
}
public function get texture():TextureData{
return (_texture);
}
override public function clone():TextureObject{
var _local1:PathTextureObject = new PathTextureObject(((_color)!=null) ? _color.clone() : null, _texture, _edgeMask);
_local1.alpha = alpha;
_local1.blendMode = blendMode;
_local1.coords = coords.clone();
var _local2:Array = new Array();
var _local3:uint;
while (_local3 < _points.length) {
_local2[_local3] = _points[_local3].clone();
_local3++;
};
_local1.points = _local2;
return (_local1);
}
public function get points():Array{
return (new Array().concat(_points));
}
public function set offset(_arg1:Number):void{
if (_arg1 != _offset){
_offset = _arg1;
drawParamsChanged = true;
};
}
public function get color():RGB{
return (_color);
}
public function addPointCoords(_arg1:uint, _arg2:Point3D):void{
if ((((_arg1 < _points.length)) && (!((_arg2 == null))))){
Point3D(_points[_arg1]).add(_arg2);
drawParamsChanged = true;
};
}
public function get length():uint{
return (_points.length);
}
public function set texture(_arg1:TextureData):void{
_texture = _arg1;
drawParamsChanged = true;
}
}
}//package com.alternativagame.engine3d
Section 25
//PolyTextureObject (com.alternativagame.engine3d.PolyTextureObject)
package com.alternativagame.engine3d {
import flash.geom.*;
import com.alternativagame.type.*;
import flash.display.*;
import com.alternativagame.utility.*;
public class PolyTextureObject extends TextureObject {
private var _direction:Point3D;
private var _points:Array;
private var fill:Shape;
private var _texture:TextureData;
private var _color:RGB;
private var _edgeMask:TextureData;
private var _center:Point3D;
public function PolyTextureObject(_arg1:RGB=null, _arg2:TextureData=null, _arg3:TextureData=null, _arg4:Array=null){
_color = _arg1;
_texture = _arg2;
_edgeMask = _arg3;
_points = ((_arg4)!=null) ? new Array().concat(_arg4) : new Array();
if (_points.length > 2){
_center = _points[0].clone();
_direction = Point3D.difference(_points[(_points.length - 1)], _points[0]);
};
fill = new Shape();
fill.cacheAsBitmap = true;
addChild(fill);
}
public function get edgeMask():TextureData{
return (_edgeMask);
}
public function setPointCoords(_arg1:uint, _arg2:Point3D):void{
if ((((_arg1 < _points.length)) && (!((_arg2 == null))))){
Point3D(_points[_arg1]).copy(_arg2);
drawParamsChanged = true;
};
}
public function set color(_arg1:RGB):void{
if (_color == null){
if (_arg1 != null){
_color = _arg1;
drawParamsChanged = true;
};
} else {
if ((((_arg1 == null)) || (!(_color.equals(_arg1))))){
_color = _arg1;
drawParamsChanged = true;
};
};
}
public function set edgeMask(_arg1:TextureData):void{
_edgeMask = _arg1;
drawParamsChanged = true;
}
public function get center():Point3D{
return (_center);
}
override function render():void{
var i:uint;
var len:uint;
var uvCoords:Array;
var matrix:Matrix;
var sum:Number;
var dir:Boolean;
var cur:Point3D;
var prv:Point3D;
var nxt:Point3D;
var lft:Point;
var rgt:Point;
var types:Array;
var corners:Array;
var leftCorners:Array;
var rightCorners:Array;
var half:Number;
var crop:Number;
var halfCroped:Number;
var current:Point3D;
var prev:Point3D;
var next:Point3D;
var left:Point;
var right:Point;
var corner:Point;
var cross:Number;
var leftCorner:Point;
var rightCorner:Point;
var distance:Number;
var point:Point;
var uvOffset:*;
var uvDirection:*;
var xShift:*;
var j:*;
var dx:*;
var dy:*;
super.render();
if (((drawParamsChanged) || (_renderer.uvChanged))){
len = _points.length;
uvCoords = new Array();
i = 0;
while (i < len) {
uvCoords[i] = localToUV(_points[i]);
i = (i + 1);
};
fill.graphics.clear();
if (fill.mask != null){
Shape(fill.mask).graphics.clear();
removeChild(fill.mask);
fill.mask = null;
};
if ((((_points.length > 2)) && (((!((_color == null))) || (!((_texture == null))))))){
matrix = new Matrix();
sum = 0;
i = 0;
while (i < len) {
cur = uvCoords[i];
prv = ((i)>0) ? uvCoords[(i - 1)] : uvCoords[(len - 1)];
nxt = ((i)<(len - 1)) ? uvCoords[(i + 1)] : uvCoords[0];
lft = new Point((cur.x - prv.x), (cur.y - prv.y));
rgt = new Point((nxt.x - cur.x), (nxt.y - cur.y));
sum = (sum + ((((lft.x * rgt.y) - (lft.y * rgt.x)))>0) ? MathUtility.vectorAngle(lft, rgt) : -(MathUtility.vectorAngle(lft, rgt)));
i = (i + 1);
};
dir = (sum > 0);
if (_edgeMask != null){
types = new Array();
corners = new Array();
leftCorners = new Array();
rightCorners = new Array();
half = ((_edgeMask.bitmapData.height * _edgeMask.resolution) / 2);
crop = ((_edgeMask.resolution)>=1) ? _edgeMask.resolution : 1;
halfCroped = (half - crop);
i = 0;
while (i < len) {
current = uvCoords[i];
prev = ((i)>0) ? uvCoords[(i - 1)] : uvCoords[(len - 1)];
next = ((i)<(len - 1)) ? uvCoords[(i + 1)] : uvCoords[0];
left = new Point((prev.x - current.x), (prev.y - current.y));
right = new Point((next.x - current.x), (next.y - current.y));
left.normalize(1);
right.normalize(1);
corner = left.add(right);
cross = MathUtility.vectorCross(left, right);
types[i] = (cross <= 0);
if (cross != 0){
distance = (halfCroped / Math.abs(Math.sin(MathUtility.vectorAngle(right, corner))));
corner.normalize(distance);
point = new Point(-(corner.x), -(corner.y));
point.normalize(halfCroped);
leftCorner = new Point(point.y, -(point.x));
leftCorner.normalize(((distance - halfCroped) * Math.tan((MathUtility.vectorAngle(left, right) / 2))));
rightCorner = new Point(-(leftCorner.x), -(leftCorner.y));
leftCorner.x = (leftCorner.x + point.x);
leftCorner.y = (leftCorner.y + point.y);
rightCorner.x = (rightCorner.x + point.x);
rightCorner.y = (rightCorner.y + point.y);
} else {
corner.x = -(right.y);
corner.y = right.x;
corner.normalize(halfCroped);
leftCorner = new Point(-(corner.x), -(corner.y));
rightCorner = leftCorner.clone();
};
corners[i] = corner;
leftCorners[i] = leftCorner;
rightCorners[i] = rightCorner;
i = (i + 1);
};
if (!dir){
i = 0;
while (i < len) {
types[i] = !(types[i]);
leftCorner = leftCorners[i];
rightCorner = rightCorners[i];
corner = leftCorner.clone();
leftCorner.x = rightCorner.x;
leftCorner.y = rightCorner.y;
rightCorner.x = corner.x;
rightCorner.y = corner.y;
i = (i + 1);
};
};
var _local2 = fill.graphics;
with (_local2) {
if (_texture != null){
matrix.identity();
uvOffset = localToUV(_center);
uvDirection = _renderer.localDirectionToUV(_direction);
if (!dir){
matrix.a = _texture.resolution;
matrix.d = _texture.resolution;
matrix.rotate(Math.atan2(uvDirection.y, uvDirection.x));
matrix.translate(uvOffset.x, uvOffset.y);
} else {
matrix.a = -(_texture.resolution);
matrix.d = _texture.resolution;
matrix.rotate((Math.atan2(uvDirection.y, uvDirection.x) + Math.PI));
matrix.translate(uvOffset.x, uvOffset.y);
};
beginBitmapFill(_texture.bitmapData, matrix, true, true);
} else {
beginFill(_color.toInt());
};
if (types[0]){
moveTo((uvCoords[0].x + leftCorners[0].x), (uvCoords[0].y + leftCorners[0].y));
lineTo((uvCoords[0].x + rightCorners[0].x), (uvCoords[0].y + rightCorners[0].y));
} else {
moveTo((uvCoords[0].x + corners[0].x), (uvCoords[0].y + corners[0].y));
};
i = 1;
while (i < len) {
if (types[i]){
lineTo((uvCoords[i].x + leftCorners[i].x), (uvCoords[i].y + leftCorners[i].y));
lineTo((uvCoords[i].x + rightCorners[i].x), (uvCoords[i].y + rightCorners[i].y));
} else {
lineTo((uvCoords[i].x + corners[i].x), (uvCoords[i].y + corners[i].y));
};
i++;
};
endFill();
};
fill.mask = new Shape();
fill.mask.cacheAsBitmap = true;
addChild(fill.mask);
_local2 = Shape(fill.mask).graphics;
with (_local2) {
beginFill(_edgeMask.bitmapData.getPixel(0, (_edgeMask.bitmapData.height - 1)));
if (types[0]){
moveTo((uvCoords[0].x + corners[0].x), (uvCoords[0].y + corners[0].y));
} else {
moveTo((uvCoords[0].x + rightCorners[0].x), (uvCoords[0].y + rightCorners[0].y));
lineTo((uvCoords[0].x + leftCorners[0].x), (uvCoords[0].y + leftCorners[0].y));
};
i = 1;
while (i < len) {
if (types[i]){
lineTo((uvCoords[i].x + corners[i].x), (uvCoords[i].y + corners[i].y));
} else {
lineTo((uvCoords[i].x + rightCorners[i].x), (uvCoords[i].y + rightCorners[i].y));
lineTo((uvCoords[i].x + leftCorners[i].x), (uvCoords[i].y + leftCorners[i].y));
};
i++;
};
endFill();
xShift = 0;
i = 0;
while (i < len) {
j = ((i)<(len - 1)) ? (i + 1) : 0;
dx = (uvCoords[j].x - uvCoords[i].x);
dy = (uvCoords[j].y - uvCoords[i].y);
matrix.identity();
matrix.a = _edgeMask.resolution;
matrix.d = _edgeMask.resolution;
matrix.tx = -(xShift);
matrix.ty = -(half);
matrix.rotate((Math.atan2(dy, dx) + (dir) ? 0 : Math.PI));
matrix.translate(uvCoords[i].x, uvCoords[i].y);
beginBitmapFill(_edgeMask.bitmapData, matrix, true, true);
if (types[i]){
moveTo((uvCoords[i].x + corners[i].x), (uvCoords[i].y + corners[i].y));
lineTo(uvCoords[i].x, uvCoords[i].y);
lineTo((uvCoords[i].x + rightCorners[i].x), (uvCoords[i].y + rightCorners[i].y));
} else {
moveTo((uvCoords[i].x + leftCorners[i].x), (uvCoords[i].y + leftCorners[i].y));
lineTo(uvCoords[i].x, uvCoords[i].y);
lineTo((uvCoords[i].x + corners[i].x), (uvCoords[i].y + corners[i].y));
};
if (types[j]){
lineTo((uvCoords[j].x + leftCorners[j].x), (uvCoords[j].y + leftCorners[j].y));
lineTo(uvCoords[j].x, uvCoords[j].y);
lineTo((uvCoords[j].x + corners[j].x), (uvCoords[j].y + corners[j].y));
} else {
lineTo((uvCoords[j].x + corners[j].x), (uvCoords[j].y + corners[j].y));
lineTo(uvCoords[j].x, uvCoords[j].y);
lineTo((uvCoords[j].x + rightCorners[j].x), (uvCoords[j].y + rightCorners[j].y));
};
endFill();
xShift = (xShift + (dir) ? Math.sqrt(((dx * dx) + (dy * dy))) : -(Math.sqrt(((dx * dx) + (dy * dy)))));
matrix.identity();
matrix.a = _edgeMask.resolution;
matrix.d = _edgeMask.resolution;
matrix.tx = -(xShift);
matrix.ty = -(half);
matrix.rotate((Math.atan2(corners[j].y, corners[j].x) + (types[j]) ? (-(Math.PI) / 2) : (Math.PI / 2)));
matrix.translate(uvCoords[j].x, uvCoords[j].y);
beginBitmapFill(_edgeMask.bitmapData, matrix, true, true);
moveTo(uvCoords[j].x, uvCoords[j].y);
lineTo((uvCoords[j].x + leftCorners[j].x), (uvCoords[j].y + leftCorners[j].y));
lineTo((uvCoords[j].x + rightCorners[j].x), (uvCoords[j].y + rightCorners[j].y));
endFill();
i++;
};
};
} else {
_local2 = fill.graphics;
with (_local2) {
if (_texture != null){
matrix.identity();
uvOffset = localToUV(_center);
uvDirection = _renderer.localDirectionToUV(_direction);
if (!dir){
matrix.a = _texture.resolution;
matrix.d = _texture.resolution;
matrix.rotate(Math.atan2(uvDirection.y, uvDirection.x));
matrix.translate(uvOffset.x, uvOffset.y);
} else {
matrix.a = -(_texture.resolution);
matrix.d = _texture.resolution;
matrix.rotate((Math.atan2(uvDirection.y, uvDirection.x) + Math.PI));
matrix.translate(uvOffset.x, uvOffset.y);
};
beginBitmapFill(_texture.bitmapData, matrix, true, true);
} else {
beginFill(_color.toInt());
};
moveTo(uvCoords[0].x, uvCoords[0].y);
i = 1;
while (i < len) {
lineTo(uvCoords[i].x, uvCoords[i].y);
i++;
};
endFill();
};
};
};
updateBounds();
};
}
public function getPointCoords(_arg1:uint):Point3D{
if (_arg1 < _points.length){
return (Point3D(_points[_arg1]).clone());
};
return (null);
}
public function get texture():TextureData{
return (_texture);
}
override public function clone():TextureObject{
var _local1:PolyTextureObject = new PolyTextureObject(((_color)!=null) ? _color.clone() : null, _texture, _edgeMask);
_local1.alpha = alpha;
_local1.blendMode = blendMode;
_local1.coords = coords.clone();
_local1.center = _center;
_local1.direction = _direction;
var _local2:Array = new Array();
var _local3:uint;
while (_local3 < _points.length) {
_local2[_local3] = _points[_local3].clone();
_local3++;
};
_local1.points = _local2;
return (_local1);
}
public function set points(_arg1:Array):void{
_points = ((_arg1)!=null) ? new Array().concat(_arg1) : new Array();
if (_points.length > 2){
if (_center == null){
_center = _points[0].clone();
};
if (_direction == null){
_direction = Point3D.difference(_points[(_points.length - 1)], _points[0]);
};
};
drawParamsChanged = true;
}
public function get color():RGB{
return (_color);
}
public function get length():uint{
return (_points.length);
}
public function set center(_arg1:Point3D):void{
if (_center != null){
if (_arg1 != null){
if (!_center.equals(_arg1)){
_center.copy(_arg1);
drawParamsChanged = true;
};
} else {
if (_points.length > 2){
_center = _points[0].clone();
} else {
_center = null;
};
drawParamsChanged = true;
};
} else {
if (_arg1 != null){
_center = _arg1.clone();
drawParamsChanged = true;
};
};
}
public function addPointCoords(_arg1:uint, _arg2:Point3D):void{
if ((((_arg1 < _points.length)) && (!((_arg2 == null))))){
Point3D(_points[_arg1]).add(_arg2);
drawParamsChanged = true;
};
}
public function get points():Array{
return (new Array().concat(_points));
}
public function set texture(_arg1:TextureData):void{
if (_texture != _arg1){
_texture = _arg1;
drawParamsChanged = true;
};
}
public function set direction(_arg1:Point3D):void{
if (_direction != null){
if (_arg1 != null){
if (!_direction.equals(_arg1)){
_direction.copy(_arg1);
drawParamsChanged = true;
};
} else {
if (_points.length > 2){
_direction = Point3D.difference(_points[(_points.length - 1)], _points[0]);
};
drawParamsChanged = true;
};
} else {
if (_arg1 != null){
_direction = _arg1.clone();
drawParamsChanged = true;
};
};
}
public function get direction():Point3D{
return (_direction);
}
}
}//package com.alternativagame.engine3d
Section 26
//ShadowTextureObject (com.alternativagame.engine3d.ShadowTextureObject)
package com.alternativagame.engine3d {
import flash.geom.*;
import com.alternativagame.type.*;
import flash.display.*;
import flash.utils.*;
import com.alternativagame.utility.*;
public class ShadowTextureObject extends TextureObject {
private const maxDirectionZ:Number = -0.01;
private var uvVertices:Dictionary;
private var uvTransform:Dictionary;
var lightChanged:Boolean;// = true
private var direction:Point3D;
private var shadows:Dictionary;
private var _light:Directional;
var directionChanged:Boolean;// = true
private var canvasToUVTransform:Matrix3D;
var enabledChanged:Boolean;// = true
public function ShadowTextureObject(_arg1:Directional){
_light = _arg1;
uvTransform = new Dictionary(true);
uvVertices = new Dictionary(true);
shadows = new Dictionary(true);
blendMode = BlendMode.SUBTRACT;
}
private function clearShadows():void{
var _local3:Rectangle;
var _local1:uint = numChildren;
var _local2:uint;
while (_local2 < _local1) {
if (!textureChanged){
_local3 = getChildAt(0).getBounds(parent);
if (((((((((!(_local3.isEmpty())) && ((_local3.left <= _renderer.uvWidth)))) && ((_local3.right >= 0)))) && ((_local3.top <= _renderer.uvHeight)))) && ((_local3.bottom >= 0)))){
textureChanged = true;
};
};
removeChildAt(0);
_local2++;
};
shadows = new Dictionary(true);
}
private function updateColor():void{
var _local1:RGB;
var _local2:uint;
var _local3:uint;
var _local4:Rectangle;
if (((((_light.colorChanged) || (directionChanged))) || (_renderer.specularChanged))){
_local1 = _light._color.clone();
_local1.multiply(_renderer.shading.shade(-(direction.z)));
transform.colorTransform = new ColorTransform(0, 0, 0, 1, _local1.red, _local1.green, _local1.blue);
_local2 = numChildren;
_local3 = 0;
while (_local3 < _local2) {
_local4 = getChildAt(_local3).getBounds(parent);
if (((((((((!(_local4.isEmpty())) && ((_local4.left <= _renderer.uvWidth)))) && ((_local4.right >= 0)))) && ((_local4.top <= _renderer.uvHeight)))) && ((_local4.bottom >= 0)))){
textureChanged = true;
break;
};
_local3++;
};
};
}
override function render():void{
var _local1:Object3D;
var _local2:Boolean;
var _local3:Dictionary;
var _local4:Set;
var _local5:Object3D;
var _local6:*;
var _local7:Boolean;
var _local8:Matrix3D;
var _local9:Point3D;
var _local10:IRenderer;
var _local11:Dictionary;
var _local12:Vertex;
var _local13:Boolean;
var _local14:DisplayObject;
var _local15:Rectangle;
if (light._enabled){
updateDirection();
if (direction.z < maxDirectionZ){
_local1 = _renderer.object;
_local2 = false;
if (((((((((((_local1.coordsChanged) || (_local1.transformChanged))) || (_local1.viewChanged))) || (enabledChanged))) || (light.enabledChanged))) || (_renderer.uvChanged))){
_local1.calculateInverseTransform();
canvasToUVTransform = Matrix3D.product(_renderer.inverseUVMatrix, _local1.inverseTransformMatrix);
_local2 = true;
};
_local3 = new Dictionary(true);
_local4 = _local1.getSolidObjects(Object3D);
for each (_local5 in _local4) {
_local7 = false;
if ((((((((((uvTransform[_local5] == undefined)) || (_local2))) || (_local5.coordsChanged))) || (_local5.transformChanged))) || (_local5.viewChanged))){
_local8 = Matrix3D.product(canvasToUVTransform, _local5.transformMatrix);
Matrix3D.product(canvasToUVTransform, _local5.transformMatrix).l = (_local8.l - _renderer.getDepthAtUV(_local8.d, _local8.h));
if ((((uvTransform[_local5] == undefined)) || (!(_local8.equals(uvTransform[_local5], 0.01))))){
uvTransform[_local5] = _local8;
_local7 = true;
};
} else {
_local8 = uvTransform[_local5];
};
if ((((_local5 is Mesh)) && (((((Mesh(_local5).verticesChanged) || (Mesh(_local5).geometryChanged))) || (_local7))))){
_local11 = new Dictionary(true);
for each (_local12 in Mesh(_local5).vertices) {
_local9 = _local12.coords.clone();
_local9.transform(_local8);
_local11[_local12] = _local9;
};
uvVertices[_local5] = _local11;
};
for each (_local10 in _local5._renderers) {
if (_local10 != _renderer){
_local13 = ((_local7) || (directionChanged));
if ((_local10 is SurfaceRenderer)){
_local13 = ((_local13) || (((Mesh(_local5).geometryChanged) || (SurfaceRenderer(_local10).facesChanged))));
if ((((((_local10 is TextureRenderer)) || ((_local10 is FillRenderer)))) || ((_local10 is WireRenderer)))){
if (_local13){
renderMeshShadow(SurfaceRenderer(_local10), (_local10 is WireRenderer));
};
if ((((_local10 is WireRenderer)) && (((_local13) || (WireRenderer(_local10).alphaChanged))))){
Shape(shadows[_local10]).alpha = WireRenderer(_local10).alpha;
};
if ((((_local10 is FillRenderer)) && (((_local13) || (FillRenderer(_local10).alphaChanged))))){
Shape(shadows[_local10]).alpha = FillRenderer(_local10).alpha;
};
_local3[_local10] = shadows[_local10];
delete shadows[_local10];
};
} else {
if ((_local10 is SpriteRenderer)){
if (((((((_local13) || (_local5.mobileChanged))) || (SpriteRenderer(_local10).stateChanged))) || (SpriteRenderer(_local10).spriteDataChanged))){
renderSpriteShadow(SpriteRenderer(_local10));
};
_local3[_local10] = shadows[_local10];
delete shadows[_local10];
};
};
};
};
};
for (_local6 in shadows) {
_local14 = DisplayObject(shadows[_local6]);
if (!textureChanged){
_local15 = _local14.getBounds(parent);
if (((((((((!(_local15.isEmpty())) && ((_local15.left <= _renderer.uvWidth)))) && ((_local15.right >= 0)))) && ((_local15.top <= _renderer.uvHeight)))) && ((_local15.bottom >= 0)))){
textureChanged = true;
};
};
removeChild(shadows[_local6]);
};
shadows = _local3;
updateColor();
} else {
if (enabledChanged){
clearShadows();
};
};
} else {
if (light.enabledChanged){
clearShadows();
};
};
}
private function renderMeshShadow(_arg1:SurfaceRenderer, _arg2:Boolean=false):void{
var shadow:Shape;
var face:Face;
var oldBounds:Rectangle;
var oldInBounds:Boolean;
var started:*;
var length:*;
var p1:*;
var p2:*;
var d:*;
var i:*;
var uv1:*;
var uv2:*;
var bounds:Rectangle;
var inBounds:Boolean;
var renderer = _arg1;
var wire = _arg2;
if (shadows[renderer] == undefined){
shadow = new Shape();
addChild(shadow);
shadows[renderer] = shadow;
} else {
shadow = shadows[renderer];
};
if (!textureChanged){
oldBounds = shadow.getBounds(parent);
oldInBounds = ((((((((!(oldBounds.isEmpty())) && ((oldBounds.left <= _renderer.uvWidth)))) && ((oldBounds.right >= 0)))) && ((oldBounds.top <= _renderer.uvHeight)))) && ((oldBounds.bottom >= 0)));
};
shadow.graphics.clear();
var mesh:Mesh = Mesh(renderer.object);
var rendererVertices:Set = renderer.getVertices();
var vertexUV:Dictionary = uvVertices[mesh];
var localDirection:Point3D = mesh.canvasDirectionToLocal(light.canvasDirection);
localDirection.normalize();
for each (face in renderer._faces) {
face.calculateNormal();
if (Point3D.angleFast(localDirection, face.normal) > MathUtility.degree90){
var _local6 = shadow.graphics;
with (_local6) {
started = false;
length = face._vertices.length;
if (wire){
lineStyle(WireRenderer(renderer).thickness);
} else {
lineStyle();
beginFill(0);
};
i = 0;
while (i < length) {
uv1 = vertexUV[face._vertices[i]];
uv2 = vertexUV[face._vertices[((i)==(length - 1)) ? 0 : (i + 1)]];
if (uv1.z >= 0){
if (uv2.z >= 0){
p2 = new Point((uv2.x - ((uv2.z * direction.x) / direction.z)), (uv2.y - ((uv2.z * direction.y) / direction.z)));
if (started){
lineTo(p2.x, p2.y);
} else {
p1 = new Point((uv1.x - ((uv1.z * direction.x) / direction.z)), (uv1.y - ((uv1.z * direction.y) / direction.z)));
moveTo(p1.x, p1.y);
lineTo(p2.x, p2.y);
started = true;
};
} else {
d = Point3D.difference(uv2, uv1);
p2 = new Point((uv1.x - ((uv1.z * d.x) / d.z)), (uv1.y - ((uv1.z * d.y) / d.z)));
if (started){
lineTo(p2.x, p2.y);
} else {
p1 = new Point((uv1.x - ((uv1.z * direction.x) / direction.z)), (uv1.y - ((uv1.z * direction.y) / direction.z)));
moveTo(p1.x, p1.y);
lineTo(p2.x, p2.y);
started = true;
};
};
} else {
if (uv2.z >= 0){
d = Point3D.difference(uv2, uv1);
p1 = new Point((uv1.x - ((uv1.z * d.x) / d.z)), (uv1.y - ((uv1.z * d.y) / d.z)));
p2 = new Point((uv2.x - ((uv2.z * direction.x) / direction.z)), (uv2.y - ((uv2.z * direction.y) / direction.z)));
if (started){
lineTo(p1.x, p1.y);
lineTo(p2.x, p2.y);
} else {
moveTo(p1.x, p1.y);
lineTo(p2.x, p2.y);
started = true;
};
};
};
i++;
};
};
};
};
if (!textureChanged){
bounds = shadow.getBounds(parent);
inBounds = ((((((((!(bounds.isEmpty())) && ((bounds.left <= _renderer.uvWidth)))) && ((bounds.right >= 0)))) && ((bounds.top <= _renderer.uvHeight)))) && ((bounds.bottom >= 0)));
if (((inBounds) || (!((inBounds == oldInBounds))))){
textureChanged = true;
};
};
}
override public function clone():TextureObject{
var _local1:ShadowTextureObject = new ShadowTextureObject(_light);
return (_local1);
}
public function get light():Directional{
return (_light);
}
public function set light(_arg1:Directional):void{
if (_light != _arg1){
_light = _arg1;
lightChanged = true;
};
}
override function drop():void{
super.drop();
lightChanged = false;
enabledChanged = false;
directionChanged = false;
}
private function updateDirection():void{
var _local2:Point3D;
var _local1:Object3D = _renderer.object;
if ((((((((((((((((((((((direction == null)) || (_renderer.uvChanged))) || (_local1.coordsChanged))) || (_local1.transformChanged))) || (_local1.viewChanged))) || (_local1.solidParentChanged))) || (_light.enabledChanged))) || (_light.transformChanged))) || (_light.solidParentChanged))) || (_light.viewChanged))) || (lightChanged))){
_local2 = localDirectionToUV(_local1.canvasDirectionToLocal(_light.canvasDirection));
_local2.normalize();
if ((((direction == null)) || (!(_local2.equals(direction, 0.01))))){
if ((((((direction == null)) || ((((direction.z < maxDirectionZ)) && ((_local2.z >= maxDirectionZ)))))) || ((((direction.z >= maxDirectionZ)) && ((_local2.z < maxDirectionZ)))))){
enabledChanged = true;
};
direction = _local2;
directionChanged = true;
};
};
}
private function renderSpriteShadow(_arg1:SpriteRenderer):void{
var _local2:Bitmap;
var _local4:Rectangle;
var _local5:Boolean;
var _local6:SpriteData;
var _local7:Point3D;
var _local8:Matrix3D;
var _local9:SpritePhase;
var _local10:BitmapData;
var _local11:Matrix3D;
var _local12:Point3D;
var _local13:Point3D;
var _local14:Point3D;
var _local15:Matrix;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Rectangle;
var _local24:Boolean;
if (shadows[_arg1] == undefined){
_local2 = new Bitmap();
addChild(_local2);
shadows[_arg1] = _local2;
} else {
_local2 = shadows[_arg1];
};
if (!textureChanged){
_local4 = _local2.getBounds(parent);
_local5 = ((((((((!(_local4.isEmpty())) && ((_local4.left <= _renderer.uvWidth)))) && ((_local4.right >= 0)))) && ((_local4.top <= _renderer.uvHeight)))) && ((_local4.bottom >= 0)));
};
var _local3:Object3D = _arg1.object;
if ((((Matrix3D(uvTransform[_local3]).l > -10)) && (!(_local3.mobile)))){
_local6 = _arg1.spriteData;
_local7 = direction.clone();
_local8 = uvTransform[_local3].clone();
_local8.resetTranslate();
_local8.invert();
_local7.transform(_local8);
_local7.normalize();
_local9 = _local6.getPhase(_arg1.state, _local7);
_local10 = _local9.bitmapData;
_local2.bitmapData = _local10;
_local2.smoothing = true;
_local11 = _local9.matrix.clone();
_local11.combine(uvTransform[_local3]);
if (!_local6.rotate){
_local11 = uvTransform[_local3].clone();
_local16 = ((_local11.a * _local11.a) + (_local11.e * _local11.e));
_local17 = ((_local11.b * _local11.b) + (_local11.f * _local11.f));
_local18 = ((_local11.c * _local11.c) + (_local11.g * _local11.g));
if (_local16 < 0.5){
_local11.a = _local11.b;
_local11.e = _local11.f;
_local11.i = _local11.j;
};
if (_local18 < 0.5){
_local19 = Math.sqrt(((direction.x * direction.x) + (direction.y * direction.y)));
_local20 = (direction.x / _local19);
_local21 = (direction.y / _local19);
_local22 = Math.sqrt((((_local11.c * _local11.c) + (_local11.g * _local11.g)) + (_local11.k * _local11.k)));
_local11.a = -(_local21);
_local11.e = _local20;
_local11.i = 0;
_local11.c = ((-(_local20) / direction.z) * _local22);
_local11.g = ((-(_local21) / direction.z) * _local22);
_local11.k = 0;
};
};
_local12 = new Point3D(-(_local9.origin.x), 0, _local9.origin.y);
_local13 = new Point3D((_local10.width - _local9.origin.x), 0, _local9.origin.y);
_local14 = new Point3D(-(_local9.origin.x), 0, (_local9.origin.y - _local10.height));
_local12.transform(_local11);
_local13.transform(_local11);
_local14.transform(_local11);
_local12.x = (_local12.x - ((_local12.z * direction.x) / direction.z));
_local12.y = (_local12.y - ((_local12.z * direction.y) / direction.z));
_local13.x = (_local13.x - ((_local13.z * direction.x) / direction.z));
_local13.y = (_local13.y - ((_local13.z * direction.y) / direction.z));
_local14.x = (_local14.x - ((_local14.z * direction.x) / direction.z));
_local14.y = (_local14.y - ((_local14.z * direction.y) / direction.z));
_local15 = new Matrix();
_local15.a = ((_local13.x - _local12.x) / _local2.bitmapData.width);
_local15.b = ((_local13.y - _local12.y) / _local2.bitmapData.width);
_local15.c = ((_local14.x - _local12.x) / _local2.bitmapData.height);
_local15.d = ((_local14.y - _local12.y) / _local2.bitmapData.height);
_local15.tx = _local12.x;
_local15.ty = _local12.y;
_local2.transform.matrix = _local15;
} else {
_local2.bitmapData = null;
};
if (!textureChanged){
_local23 = _local2.getBounds(parent);
_local24 = ((((((((!(_local23.isEmpty())) && ((_local23.left <= _renderer.uvWidth)))) && ((_local23.right >= 0)))) && ((_local23.top <= _renderer.uvHeight)))) && ((_local23.bottom >= 0)));
if (((_local24) || (!((_local24 == _local5))))){
textureChanged = true;
};
};
}
}
}//package com.alternativagame.engine3d
Section 27
//SkinData (com.alternativagame.engine3d.SkinData)
package com.alternativagame.engine3d {
import flash.geom.*;
import com.alternativagame.type.*;
import flash.display.*;
public class SkinData {
var skin:DisplayObject;
var boundBack:Number;
var num:uint;
var relations:Array;
var newLayer:int;// = -1
var infront:Set;
var boundLeft:Number;
var boundMapLeft:int;
var behind:Set;
var boundMapRight:int;
var renderer:IRenderer;
var boundRight:Number;
var borders:Array;
var boundBottom:Number;
var boundFront:Number;
public var layer:int;// = -1
var boundMapBottom:int;
var points:Array;
var planeA:Number;
var length:uint;
var planeC:Number;
var planeD:Number;
var common:Array;
var planeB:Number;
var boundTop:Number;
var boundMapTop:int;
static const vertexHitRadius:Number = 5;
static const INFRONT:int = 1;
static const NOINTERSECTION:int = 0;
static const edgeHitHalfThickness:Number = 3;
static const BEHIND:int = -1;
static const vertexHitRadiusSquare:Number = 25;
public function SkinData(_arg1:IRenderer, _arg2:uint){
var _local3:uint;
super();
this.renderer = _arg1;
this.length = _arg2;
points = new Array();
common = new Array();
if (_arg2 > 1){
borders = new Array();
relations = new Array();
num = ((_arg2)>2) ? _arg2 : 1;
_local3 = 0;
while (_local3 < num) {
borders.push(new Border());
relations.push(new Array());
_local3++;
};
} else {
num = 0;
};
behind = new Set(true);
infront = new Set(true);
}
private function calculateBorders():void{
var _local1:Border;
var _local2:Point3D;
var _local3:Point3D;
var _local4:uint;
while (_local4 < num) {
_local1 = borders[_local4];
_local1.a = _local4;
_local1.b = (((_local4 + 1))==length) ? 0 : (_local4 + 1);
_local2 = points[_local1.a];
_local3 = points[_local1.b];
_local1.x = (_local3.x - _local2.x);
_local1.y = (_local3.y - _local2.y);
_local1.z = (_local3.z - _local2.z);
_local4++;
};
}
function calculate():void{
calculateBound();
if (length > 1){
calculateBorders();
calculatePlane();
};
}
function breakLinks():void{
var _local1:SkinData;
for each (_local1 in behind) {
_local1.infront.remove(this);
};
for each (_local1 in infront) {
_local1.behind.remove(this);
};
behind = new Set(true);
infront = new Set(true);
}
private function isBehind(_arg1:SkinData):Boolean{
var _local3:SkinData;
var _local2:Boolean;
for each (_local3 in behind) {
if ((((_local3 == _arg1)) || (_local3.isBehind(_arg1)))){
_local2 = true;
break;
};
};
return (_local2);
}
private function intersectionXY(_arg1:Point3D, _arg2:Point3D, _arg3:Point3D, _arg4:Point3D):Point{
var _local5:Number = (_arg2.x - _arg1.x);
var _local6:Number = (_arg3.x - _arg4.x);
var _local7:Number = (_arg3.x - _arg1.x);
var _local8:Number = (_arg2.y - _arg1.y);
var _local9:Number = (_arg3.y - _arg4.y);
var _local10:Number = (_arg3.y - _arg1.y);
var _local11:Number = ((_local5 * _local9) - (_local6 * _local8));
return (new Point((((_local7 * _local9) - (_local10 * _local6)) / _local11), (((_local5 * _local10) - (_local7 * _local8)) / _local11)));
}
private function isInfront(_arg1:SkinData):Boolean{
var _local3:SkinData;
var _local2:Boolean;
for each (_local3 in infront) {
if ((((_local3 == _arg1)) || (_local3.isInfront(_arg1)))){
_local2 = true;
break;
};
};
return (_local2);
}
private function calculatePlane():void{
var _local4:Border;
var _local5:Point3D;
var _local1:Border = borders[0];
var _local2:Point3D = points[0];
var _local3:Point3D = points[1];
if (length > 2){
_local4 = borders[1];
_local5 = points[2];
} else {
_local4 = new Border();
_local4.x = (_local3.y - _local2.y);
_local4.y = (_local2.x - _local3.x);
_local4.z = 0;
_local5 = new Point3D((_local3.x + _local4.x), (_local3.y + _local4.y), (_local3.z + _local4.z));
};
planeA = (((-(_local2.y) * _local4.z) + (_local3.y * (_local5.z - _local2.z))) - (_local5.y * _local1.z));
planeB = (((-(_local2.z) * _local4.x) + (_local3.z * (_local5.x - _local2.x))) - (_local5.z * _local1.x));
planeC = (((-(_local2.x) * _local4.y) + (_local3.x * (_local5.y - _local2.y))) - (_local5.x * _local1.y));
planeD = (((-(_local2.x) * ((_local3.y * _local5.z) - (_local5.y * _local3.z))) - (_local3.x * ((_local5.y * _local2.z) - (_local2.y * _local5.z)))) - (_local5.x * ((_local2.y * _local3.z) - (_local3.y * _local2.z))));
}
function linkInfront(_arg1:SkinData):void{
if (!isBehind(_arg1)){
infront.add(_arg1);
_arg1.behind.add(this);
};
}
function calculateInteractionCoords(_arg1:Point3D):void{
var _local2:Point3D;
var _local3:Border;
var _local4:uint;
var _local5:Number;
var _local6:Number;
if (length > 2){
if (boundContains(_arg1)){
_local4 = 0;
while (_local4 < num) {
_local2 = points[_local4];
_local3 = borders[_local4];
if (((_local3.x * (_arg1.y - _local2.y)) - (_local3.y * (_arg1.x - _local2.x))) > 0){
_arg1.z = NaN;
return;
};
_local4++;
};
_arg1.z = projectionZ(_arg1);
if (!renderer.checkInteraction(this, _arg1)){
_arg1.z = NaN;
};
} else {
_arg1.z = NaN;
};
} else {
if (length > 1){
if (!(((((((_arg1.x > (boundRight + edgeHitHalfThickness))) || ((_arg1.x < (boundLeft - edgeHitHalfThickness))))) || ((_arg1.y > (boundBottom + edgeHitHalfThickness))))) || ((_arg1.y < (boundTop - edgeHitHalfThickness))))){
_local2 = points[0];
_local3 = borders[0];
if ((Math.abs(((_local3.x * (_arg1.y - _local2.y)) - (_local3.y * (_arg1.x - _local2.x)))) / Math.sqrt(((_local3.x * _local3.x) + (_local3.y * _local3.y)))) <= edgeHitHalfThickness){
_arg1.z = projectionZ(_arg1);
if (!renderer.checkInteraction(this, _arg1)){
_arg1.z = NaN;
};
} else {
_arg1.z = NaN;
};
} else {
_arg1.z = NaN;
};
} else {
if (!(((((((_arg1.x > (boundRight + vertexHitRadius))) || ((_arg1.x < (boundLeft - vertexHitRadius))))) || ((_arg1.y > (boundBottom + vertexHitRadius))))) || ((_arg1.y < (boundTop - vertexHitRadius))))){
_local2 = points[0];
_local5 = (_arg1.x - _local2.x);
_local6 = (_arg1.y - _local2.y);
if (((_local5 * _local5) + (_local6 * _local6)) <= vertexHitRadiusSquare){
_arg1.z = _local2.z;
if (!renderer.checkInteraction(this, _arg1)){
_arg1.z = NaN;
};
} else {
_arg1.z = NaN;
};
} else {
_arg1.z = NaN;
};
};
};
}
private function calculateBound():void{
var _local1:Point3D;
boundLeft = Number.MAX_VALUE;
boundRight = -(Number.MAX_VALUE);
boundTop = Number.MAX_VALUE;
boundBottom = -(Number.MAX_VALUE);
boundFront = -(Number.MAX_VALUE);
boundBack = Number.MAX_VALUE;
var _local2:uint;
while (_local2 < length) {
_local1 = points[_local2];
boundLeft = ((_local1.x)<boundLeft) ? _local1.x : boundLeft;
boundRight = ((_local1.x)>boundRight) ? _local1.x : boundRight;
boundTop = ((_local1.y)<boundTop) ? _local1.y : boundTop;
boundBottom = ((_local1.y)>boundBottom) ? _local1.y : boundBottom;
boundBack = ((_local1.z)<boundBack) ? _local1.z : boundBack;
boundFront = ((_local1.z)>boundFront) ? _local1.z : boundFront;
_local2++;
};
var _local3:Number = ((length)<3) ? ((length)==2) ? edgeHitHalfThickness : vertexHitRadius : 0;
boundMapLeft = (((boundLeft - _local3) / View.boundMapSize) + View.boundMapOffset);
boundMapRight = (((boundRight + _local3) / View.boundMapSize) + View.boundMapOffset);
boundMapTop = (((boundTop - _local3) / View.boundMapSize) + View.boundMapOffset);
boundMapBottom = (((boundBottom + _local3) / View.boundMapSize) + View.boundMapOffset);
}
function boundContains(_arg1:Point3D):Boolean{
return (!((((((((_arg1.x > boundRight)) || ((_arg1.x < boundLeft)))) || ((_arg1.y > boundBottom)))) || ((_arg1.y < boundTop)))));
}
function linkBehind(_arg1:SkinData):void{
if (!isInfront(_arg1)){
behind.add(_arg1);
_arg1.infront.add(this);
};
}
function moveFront(_arg1:int):void{
var _local2:SkinData;
if (_arg1 > newLayer){
newLayer = _arg1;
};
for each (_local2 in infront) {
_local2.moveFront((_arg1 + 1));
};
}
function compare(_arg1:SkinData):int{
var _local2:Number;
var _local3:Number;
var _local4:Boolean;
var _local5:uint;
var _local6:uint;
var _local7:Point3D;
var _local8:Point3D;
var _local9:Point3D;
var _local10:Point3D;
var _local11:Border;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:int;
var _local17:Point3D;
var _local18:Boolean;
var _local19:Boolean;
var _local20:Point;
var _local21:int;
var _local22:int;
var _local23:int;
var _local24:int;
var _local25:Boolean;
var _local26:Boolean;
var _local27:Boolean;
if (!(((((((_arg1.boundLeft > boundRight)) || ((_arg1.boundRight < boundLeft)))) || ((_arg1.boundTop > boundBottom)))) || ((_arg1.boundBottom < boundTop)))){
_local2 = 0;
_local3 = 0;
_local4 = false;
_local5 = 0;
while (_local5 < length) {
common[_local5] = false;
_local5++;
};
_local6 = 0;
while (_local6 < _arg1.length) {
_arg1.common[_local6] = false;
_local6++;
};
if (renderer.object == _arg1.renderer.object){
_local21 = -1;
_local22 = -1;
_local23 = -1;
_local24 = -1;
_local25 = false;
_local5 = 0;
while (_local5 < length) {
_local6 = 0;
while (_local6 < _arg1.length) {
if (points[_local5] == _arg1.points[_local6]){
if (_local21 < 0){
_local21 = _local5;
_local23 = _local6;
common[_local5] = true;
_arg1.common[_local6] = true;
break;
} else {
_local22 = _local5;
_local24 = _local6;
if ((((_local21 == 0)) && ((_local22 == (length - 1))))){
_local21 = (length - 1);
_local22 = 0;
};
if ((((_local23 == 0)) && ((_local24 == (_arg1.length - 1))))){
_local23 = (_arg1.length - 1);
_local24 = 0;
};
common[_local5] = true;
_arg1.common[_local6] = true;
_local25 = true;
break;
};
};
_local6++;
};
if (_local25){
break;
};
_local5++;
};
if (_local21 >= 0){
if (_local22 >= 0){
if ((((length == 2)) || ((_arg1.length == 2)))){
if (length == 2){
return (BEHIND);
};
return (INFRONT);
};
_local11 = borders[_local21];
_local7 = points[_local21];
_local9 = points[borders[_local22].b];
_local10 = _arg1.points[_arg1.borders[_local24].b];
_local14 = ((_local11.x * (_local9.y - _local7.y)) - (_local11.y * (_local9.x - _local7.x)));
_local15 = ((_local11.x * (_local10.y - _local7.y)) - (_local11.y * (_local10.x - _local7.x)));
if ((((((_local14 >= 0)) && ((_local15 <= 0)))) || ((((_local14 <= 0)) && ((_local15 >= 0)))))){
return (NOINTERSECTION);
};
} else {
if ((((length == 1)) || ((_arg1.length == 1)))){
if (length == 1){
return (BEHIND);
};
return (INFRONT);
};
if (length == 2){
if (_arg1.length == 2){
return (NOINTERSECTION);
};
_local7 = _arg1.points[_local23];
_local8 = ((_local23)>0) ? _arg1.points[(_local23 - 1)] : _arg1.points[(_arg1.length - 1)];
_local9 = ((_local23)<(_arg1.length - 1)) ? _arg1.points[(_local23 + 1)] : _arg1.points[0];
_local10 = ((_local21)==0) ? points[1] : points[0];
_local13 = (((_local8.x - _local7.x) * (_local10.y - _local7.y)) - ((_local8.y - _local7.y) * (_local10.x - _local7.x)));
_local14 = (((_local9.x - _local7.x) * (_local10.y - _local7.y)) - ((_local9.y - _local7.y) * (_local10.x - _local7.x)));
if ((((_local13 <= 0)) || ((_local14 >= 0)))){
return (NOINTERSECTION);
};
} else {
if (_arg1.length == 2){
_local7 = points[_local21];
_local8 = ((_local21)>0) ? points[(_local21 - 1)] : points[(length - 1)];
_local9 = ((_local21)<(length - 1)) ? points[(_local21 + 1)] : points[0];
_local10 = ((_local23)==0) ? _arg1.points[1] : _arg1.points[0];
_local13 = (((_local8.x - _local7.x) * (_local10.y - _local7.y)) - ((_local8.y - _local7.y) * (_local10.x - _local7.x)));
_local14 = (((_local9.x - _local7.x) * (_local10.y - _local7.y)) - ((_local9.y - _local7.y) * (_local10.x - _local7.x)));
if ((((_local13 <= 0)) || ((_local14 >= 0)))){
return (NOINTERSECTION);
};
} else {
_local26 = false;
_local27 = false;
_local7 = points[_local21];
_local8 = ((_local21)>0) ? points[(_local21 - 1)] : points[(length - 1)];
_local9 = ((_local21)<(length - 1)) ? points[(_local21 + 1)] : points[0];
_local10 = ((_local23)>0) ? _arg1.points[(_local23 - 1)] : _arg1.points[(_arg1.length - 1)];
_local13 = (((_local8.x - _local7.x) * (_local10.y - _local7.y)) - ((_local8.y - _local7.y) * (_local10.x - _local7.x)));
_local14 = (((_local9.x - _local7.x) * (_local10.y - _local7.y)) - ((_local9.y - _local7.y) * (_local10.x - _local7.x)));
if ((((_local13 <= 0)) || ((_local14 >= 0)))){
_local10 = ((_local23)<(_arg1.length - 1)) ? _arg1.points[(_local23 + 1)] : _arg1.points[0];
_local13 = (((_local8.x - _local7.x) * (_local10.y - _local7.y)) - ((_local8.y - _local7.y) * (_local10.x - _local7.x)));
_local14 = (((_local9.x - _local7.x) * (_local10.y - _local7.y)) - ((_local9.y - _local7.y) * (_local10.x - _local7.x)));
if ((((_local13 <= 0)) || ((_local14 >= 0)))){
_local26 = true;
};
};
_local7 = _arg1.points[_local23];
_local8 = ((_local23)>0) ? _arg1.points[(_local23 - 1)] : _arg1.points[(_arg1.length - 1)];
_local9 = ((_local23)<(_arg1.length - 1)) ? _arg1.points[(_local23 + 1)] : _arg1.points[0];
_local10 = ((_local21)>0) ? points[(_local21 - 1)] : points[(length - 1)];
_local13 = (((_local8.x - _local7.x) * (_local10.y - _local7.y)) - ((_local8.y - _local7.y) * (_local10.x - _local7.x)));
_local14 = (((_local9.x - _local7.x) * (_local10.y - _local7.y)) - ((_local9.y - _local7.y) * (_local10.x - _local7.x)));
if ((((_local13 <= 0)) || ((_local14 >= 0)))){
_local10 = ((_local21)<(length - 1)) ? points[(_local21 + 1)] : points[0];
_local13 = (((_local8.x - _local7.x) * (_local10.y - _local7.y)) - ((_local8.y - _local7.y) * (_local10.x - _local7.x)));
_local14 = (((_local9.x - _local7.x) * (_local10.y - _local7.y)) - ((_local9.y - _local7.y) * (_local10.x - _local7.x)));
if ((((_local13 <= 0)) || ((_local14 >= 0)))){
_local27 = true;
};
};
if (((_local26) && (_local27))){
return (NOINTERSECTION);
};
};
};
};
};
};
_local16 = NOINTERSECTION;
if (boundBack >= _arg1.boundFront){
_local16 = BEHIND;
} else {
if (_arg1.boundBack >= boundFront){
_local16 = INFRONT;
};
};
_local5 = 0;
while (_local5 < num) {
_local7 = points[_local5];
_local11 = borders[_local5];
_local6 = 0;
while (_local6 < _arg1.length) {
_local8 = _arg1.points[_local6];
relations[_local5][_local6] = ((_local11.x * (_local8.y - _local7.y)) - (_local11.y * (_local8.x - _local7.x)));
_local6++;
};
if (_arg1.length > 2){
relations[_local5][_arg1.length] = relations[_local5][0];
};
_local5++;
};
_local5 = 0;
while (_local5 < _arg1.num) {
_local7 = _arg1.points[_local5];
_local11 = _arg1.borders[_local5];
_local6 = 0;
while (_local6 < length) {
_local8 = points[_local6];
_arg1.relations[_local5][_local6] = ((_local11.x * (_local8.y - _local7.y)) - (_local11.y * (_local8.x - _local7.x)));
_local6++;
};
if (length > 2){
_arg1.relations[_local5][length] = _arg1.relations[_local5][0];
};
_local5++;
};
_local19 = true;
_local5 = 0;
while (_local5 < length) {
_local17 = points[_local5];
if (_arg1.boundContains(_local17)){
if (!common[_local5]){
_local18 = true;
_local6 = 0;
while (_local6 < _arg1.num) {
if (_arg1.relations[_local6][_local5] > 0){
_local18 = false;
_local19 = false;
break;
} else {
if ((((_arg1.length == 2)) && ((_arg1.relations[_local6][_local5] < 0)))){
_local18 = false;
_local19 = false;
break;
};
};
_local6++;
};
if (_local18){
if (_arg1.length > 1){
_local2 = (_local2 + _local17.z);
_local3 = (_local3 + _arg1.projectionZ(_local17));
_local4 = true;
if (_local16 != NOINTERSECTION){
return (_local16);
};
} else {
return (((_local17.z)>_arg1.points[0].z) ? BEHIND : INFRONT);
};
};
};
} else {
_local19 = false;
};
_local5++;
};
if (_local19){
return (((_local2)>_local3) ? BEHIND : INFRONT);
};
_local19 = true;
_local5 = 0;
while (_local5 < _arg1.length) {
_local17 = _arg1.points[_local5];
if (boundContains(_local17)){
if (!_arg1.common[_local5]){
_local18 = true;
_local6 = 0;
while (_local6 < num) {
if (relations[_local6][_local5] > 0){
_local18 = false;
_local19 = false;
break;
} else {
if ((((length == 2)) && ((relations[_local6][_local5] < 0)))){
_local18 = false;
_local19 = false;
break;
};
};
_local6++;
};
if (_local18){
if (length > 1){
_local2 = (_local2 + projectionZ(_local17));
_local3 = (_local3 + _local17.z);
_local4 = true;
if (_local16 != NOINTERSECTION){
return (_local16);
};
} else {
return (((_local17.z)<points[0].z) ? BEHIND : INFRONT);
};
};
};
} else {
_local19 = false;
};
_local5++;
};
if (_local19){
return (((_local2)>_local3) ? BEHIND : INFRONT);
};
_local5 = 0;
while (_local5 < num) {
_local6 = 0;
while (_local6 < _arg1.num) {
_local12 = relations[_local5][_local6];
_local13 = relations[_local5][(_local6 + 1)];
_local14 = _arg1.relations[_local6][_local5];
_local15 = _arg1.relations[_local6][(_local5 + 1)];
if ((((((((_local12 > 0)) && ((_local13 < 0)))) || ((((_local12 < 0)) && ((_local13 > 0)))))) && ((((((_local14 > 0)) && ((_local15 < 0)))) || ((((_local14 < 0)) && ((_local15 > 0)))))))){
_local7 = points[_local5];
_local8 = points[borders[_local5].b];
_local9 = _arg1.points[_local6];
_local10 = _arg1.points[_arg1.borders[_local6].b];
_local20 = intersectionXY(_local7, _local8, _local9, _local10);
_local2 = (_local2 + (_local7.z + ((_local8.z - _local7.z) * _local20.x)));
_local3 = (_local3 + (_local9.z + ((_local10.z - _local9.z) * _local20.y)));
_local4 = true;
if (_local16 != NOINTERSECTION){
return (_local16);
};
};
_local6++;
};
_local5++;
};
if (_local4){
return (((_local2)>_local3) ? BEHIND : INFRONT);
};
};
return (NOINTERSECTION);
}
private function projectionZ(_arg1:Point3D):Number{
return ((-((((planeA * _arg1.x) + (planeB * _arg1.y)) + planeD)) / planeC));
}
}
}//package com.alternativagame.engine3d
class Border {
public var a:uint;
public var x:Number;
public var b:uint;
public var y:Number;
public var z:Number;
private function Border(){
}
}
Section 28
//SpriteRenderer (com.alternativagame.engine3d.SpriteRenderer)
package com.alternativagame.engine3d {
import flash.geom.*;
import com.alternativagame.type.*;
import flash.display.*;
import com.alternativagame.engine3d.shading.*;
import flash.utils.*;
import com.alternativagame.utility.*;
public class SpriteRenderer extends ObjectRenderer {
var lightColorChanged:Boolean;// = true
private var _state:String;
var stateChanged:Boolean;// = true
var spriteDataChanged:Boolean;// = true
private var shading:GaussianShading;
var lightColor:RGB;
private var inverse:Boolean;
var specularChanged:Boolean;// = true
private var _spriteData:SpriteData;
private var spritePhase:SpritePhase;
var lightStrength:Dictionary;
var lightChanged:Boolean;// = false
private static var num:uint = 0;
static var smoothChanged:Boolean = true;
private static var _smooth:Boolean = true;
public function SpriteRenderer(_arg1:SpriteData=null, _arg2:String="default", _arg3:Number=2){
_spriteData = _arg1;
_state = _arg2;
shading = new GaussianShading();
shading.specular = _arg3;
lightStrength = new Dictionary(true);
lightColor = new RGB();
}
public function get specular():Number{
return (shading.specular);
}
private function updateLights():void{
var _local3:Light;
var _local4:Number;
var _local5:Boolean;
var _local6:Number;
var _local1:Set = _object.getSolidObjects(Light);
var _local2:Dictionary = new Dictionary(true);
for each (_local3 in _local1) {
_local5 = ((((((((((((_object.viewChanged) || (_object.solidParentChanged))) || (_local3.enabledChanged))) || (_local3.solidParentChanged))) || (_local3.viewChanged))) || (_local3.parentChanged))) || (specularChanged));
if ((_local3 is Omni)){
_local5 = ((_local5) || (((((_object.coordsChanged) || (_local3.coordsChanged))) || (Omni(_local3).rangeChanged))));
} else {
if ((_local3 is Directional)){
_local5 = ((_local5) || (((_object.coordsChanged) || (_local3.transformChanged))));
};
};
if (_local5){
_local6 = _local3.getStrengthAtPoint(_object.canvasCoords);
if (!isNaN(_local6)){
if (!(_local3 is Ambient)){
_local6 = shading.shade(_local6);
};
if ((((lightStrength[_local3] == undefined)) || (!((_local6 == lightStrength[_local3]))))){
_local2[_local3] = _local6;
lightChanged = true;
} else {
_local2[_local3] = lightStrength[_local3];
};
delete lightStrength[_local3];
};
} else {
if (lightStrength[_local3] != undefined){
_local2[_local3] = lightStrength[_local3];
delete lightStrength[_local3];
};
};
lightChanged = ((lightChanged) || (_local3.colorChanged));
};
for each (_local4 in lightStrength) {
lightChanged = true;
break;
};
lightStrength = _local2;
}
public function get spriteData():SpriteData{
return (_spriteData);
}
public function get state():String{
return (_state);
}
public function set specular(_arg1:Number):void{
shading.specular = _arg1;
specularChanged = true;
}
override public function render():void{
var _local1:Bitmap;
var _local2:Point3D;
var _local3:SpritePhase;
var _local4:Point;
var _local5:Number;
var _local6:Matrix3D;
var _local7:Point3D;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
if (_spriteData != null){
if (data == null){
data = new SkinData(this, 4);
data.skin = new Bitmap();
};
_local1 = Bitmap(data.skin);
if (((((((((_object.transformChanged) || (spriteDataChanged))) || (stateChanged))) || (_object.viewChanged))) || (objectChanged))){
_local2 = new Point3D(-(_object.transformMatrix.i), -(_object.transformMatrix.j), -(_object.transformMatrix.k));
_local2.normalize();
_local3 = _spriteData.getPhase(_state, _local2);
if (spritePhase != _local3){
spritePhase = _local3;
inverse = (Point3D.angleFast(spritePhase.direction, _local2) >= MathUtility.degree90);
_local1.bitmapData = spritePhase.bitmapData;
_local1.smoothing = _smooth;
};
};
if (smoothChanged){
_local1.smoothing = _smooth;
};
if (((((((((((((_object.coordsChanged) || (_object.transformChanged))) || (spriteDataChanged))) || (stateChanged))) || (_object._view.zoomChanged))) || (_object.viewChanged))) || (objectChanged))){
_local4 = spritePhase.origin;
_local5 = _spriteData.resolution;
_local6 = spritePhase.matrix.clone();
_local6.combine(_object.transformMatrix);
if (!_spriteData.scale){
if (!_spriteData.rotate){
_local6.a = (_local5 * _object._view.zoom);
_local6.e = 0;
_local6.i = 0;
_local6.c = 0;
_local6.g = (-(_local5) * _object._view.zoom);
_local6.k = 0;
} else {
_local16 = Math.sqrt(((_local6.e * _local6.e) + (_local6.g * _local6.g)));
_local17 = (((_local6.e / _local16) * _local5) * _object._view.zoom);
_local18 = (((_local6.g / _local16) * _local5) * _object._view.zoom);
_local6.a = -(_local18);
_local6.e = _local17;
_local6.c = _local17;
_local6.g = _local18;
_local6.i = 0;
_local6.k = 0;
};
} else {
if (!_spriteData.rotate){
_local6.a = (Math.sqrt((((_local6.a * _local6.a) + (_local6.b * _local6.b)) + (_local6.c * _local6.c))) * _local5);
_local6.g = (-(Math.sqrt((((_local6.e * _local6.e) + (_local6.f * _local6.f)) + (_local6.g * _local6.g)))) * _local5);
_local6.e = 0;
_local6.i = 0;
_local6.c = 0;
_local6.k = 0;
};
};
_local7 = new Point3D(-(_local4.x), 0, _local4.y);
_local7.transform(_local6);
_local1.transform.matrix = new Matrix(_local6.a, _local6.e, -(_local6.c), -(_local6.g), _local7.x, _local7.y);
_local8 = _local1.bitmapData.width;
_local9 = _local1.bitmapData.height;
_local10 = (_local6.a * _local8);
_local11 = (_local6.e * _local8);
_local12 = (_local6.i * _local8);
_local13 = (-(_local6.c) * _local9);
_local14 = (-(_local6.g) * _local9);
_local15 = (-(_local6.k) * _local9);
data.points[0] = new Point3D(_local7.x, _local7.y, _local7.z);
data.points[2] = new Point3D(((_local7.x + _local13) + _local10), ((_local7.y + _local14) + _local11), ((_local7.z + _local15) + _local12));
if (((((inverse) && (_spriteData.scale))) && (_spriteData.rotate))){
data.points[3] = new Point3D((_local7.x + _local13), (_local7.y + _local14), (_local7.z + _local15));
data.points[1] = new Point3D((_local7.x + _local10), (_local7.y + _local11), (_local7.z + _local12));
} else {
data.points[1] = new Point3D((_local7.x + _local13), (_local7.y + _local14), (_local7.z + _local15));
data.points[3] = new Point3D((_local7.x + _local10), (_local7.y + _local11), (_local7.z + _local12));
};
_object._view.changeSkin(data);
};
updateLights();
updateLightColor();
if (lightColorChanged){
_local1.transform.colorTransform = new ColorTransform((lightColor.red / 127), (lightColor.green / 127), (lightColor.blue / 127), 1);
};
};
}
public function set spriteData(_arg1:SpriteData):void{
if (_spriteData != _arg1){
clear();
_spriteData = _arg1;
spriteDataChanged = true;
};
}
public function set state(_arg1:String):void{
if (_state != _arg1){
_state = _arg1;
stateChanged = true;
};
}
override public function drop():void{
super.drop();
spriteDataChanged = false;
stateChanged = false;
specularChanged = false;
lightChanged = false;
lightColorChanged = false;
smoothChanged = false;
}
private function updateLightColor():void{
var _local1:RGB;
var _local2:RGB;
var _local3:Number;
var _local4:*;
if (lightChanged){
_local1 = new RGB();
for (_local4 in lightStrength) {
_local3 = lightStrength[_local4];
_local2 = Light(_local4)._color;
_local1.red = (_local1.red + (_local2.red * _local3));
_local1.green = (_local1.green + (_local2.green * _local3));
_local1.blue = (_local1.blue + (_local2.blue * _local3));
};
if (!_local1.equals(lightColor)){
lightColor = _local1;
lightColorChanged = true;
};
};
}
override protected function defaultName():String{
num++;
return (("spriteRenderer" + num));
}
override public function clone():IRenderer{
var _local1:SpriteRenderer = new SpriteRenderer(_spriteData, _state, shading.specular);
return (_local1);
}
public static function set smooth(_arg1:Boolean):void{
_smooth = _arg1;
smoothChanged = true;
}
public static function get smooth():Boolean{
return (_smooth);
}
}
}//package com.alternativagame.engine3d
Section 29
//SpriteTextureObject (com.alternativagame.engine3d.SpriteTextureObject)
package com.alternativagame.engine3d {
import flash.geom.*;
import com.alternativagame.type.*;
import flash.display.*;
public class SpriteTextureObject extends TextureObject {
private var _direction:Point3D;
private var _spriteData:SpriteData;
private var bitmap:Bitmap;
private var _state:String;
public function SpriteTextureObject(_arg1:SpriteData=null, _arg2:Point3D=null, _arg3:Point3D=null, _arg4:String="default"){
_spriteData = _arg1;
_state = _arg4;
if (_arg2 != null){
this.coords = _arg2;
};
if (_arg3 != null){
_direction = _arg3.clone();
};
bitmap = new Bitmap();
addChild(bitmap);
}
public function set state(_arg1:String):void{
if (_state != _arg1){
_state = _arg1;
drawParamsChanged = true;
};
}
public function set spriteData(_arg1:SpriteData):void{
if (_spriteData != _arg1){
_spriteData = _arg1;
drawParamsChanged = true;
};
}
public function set direction(_arg1:Point3D):void{
if (_direction != null){
if (_arg1 != null){
if (!_direction.equals(_arg1)){
_direction.copy(_arg1);
drawParamsChanged = true;
};
} else {
_direction = null;
drawParamsChanged = true;
};
} else {
if (_arg1 != null){
_direction = _arg1.clone();
drawParamsChanged = true;
};
};
}
public function get spriteData():SpriteData{
return (_spriteData);
}
override function render():void{
var _local1:SpritePhase;
var _local2:Point;
var _local3:Number;
var _local4:Matrix;
var _local5:Point3D;
super.render();
if (((drawParamsChanged) || (_renderer.uvChanged))){
if (_spriteData != null){
_local1 = _spriteData.getPhase(_state, new Point3D(0, 1, 0));
if (_local1 != null){
_local2 = ((_local1.origin)!=null) ? _local1.origin : new Point((_local1.bitmapData.width / 2), (_local1.bitmapData.height / 2));
bitmap.bitmapData = _local1.bitmapData;
bitmap.smoothing = true;
if (_direction != null){
_local5 = _renderer.localDirectionToUV(_direction);
_local3 = Math.atan2(_local5.y, _local5.x);
} else {
_local3 = 0;
};
_local4 = new Matrix();
_local4.translate(-(_local2.x), -(_local2.y));
_local4.scale(_spriteData.resolution, _spriteData.resolution);
_local4.rotate(_local3);
bitmap.transform.matrix = _local4;
} else {
bitmap.bitmapData = null;
};
} else {
bitmap.bitmapData = null;
};
updateBounds();
};
}
public function get state():String{
return (_state);
}
override public function clone():TextureObject{
var _local1:SpriteTextureObject = new SpriteTextureObject(_spriteData, coords.clone(), _direction, _state);
_local1.alpha = alpha;
_local1.blendMode = blendMode;
return (_local1);
}
public function get direction():Point3D{
return (_direction);
}
}
}//package com.alternativagame.engine3d
Section 30
//SurfaceRenderer (com.alternativagame.engine3d.SurfaceRenderer)
package com.alternativagame.engine3d {
import com.alternativagame.type.*;
import flash.utils.*;
import com.alternativagame.utility.*;
public class SurfaceRenderer implements ISurfaceRenderer {
protected var datas:Dictionary;
var nameChanged:Boolean;// = true
var facesChanged:Boolean;// = false
var _faces:Set;
protected var _object:Mesh;
var visibleChanged:Boolean;// = false
var objectChanged:Boolean;// = false
protected var _name:String;
private static var num:uint = 0;
public function SurfaceRenderer(){
_faces = new Set(true);
datas = new Dictionary(true);
_name = defaultName();
}
public function removeFace(_arg1:Face):void{
if (_faces.has(_arg1)){
_faces.remove(_arg1);
facesChanged = true;
};
}
public function checkInteraction(_arg1:SkinData, _arg2:Point3D):Boolean{
return (true);
}
public function toString():String{
return ((((("[" + ObjectUtility.getClassName(this)) + " ") + _name) + "]"));
}
public function interaction(_arg1:uint, _arg2:SkinData, _arg3:Point3D, _arg4:Boolean, _arg5:Boolean, _arg6:Boolean, _arg7:Boolean):void{
}
public function get name():String{
return (_name);
}
public function render():void{
}
public function addFace(_arg1:Face):void{
if (!_faces.has(_arg1)){
_faces.add(_arg1);
facesChanged = true;
};
}
public function set name(_arg1:String):void{
_name = _arg1;
nameChanged = true;
}
public function get faces():Set{
return (_faces);
}
public function setObject(_arg1:Object3D):void{
if (_object != _arg1){
if (_object != null){
clear();
};
if ((((_arg1 == null)) || ((_arg1 is Mesh)))){
_object = Mesh(_arg1);
objectChanged = true;
} else {
throw (new Error("Surface renderer must be added to Mesh object only"));
};
};
}
protected function updateSkinDatas():void{
var _local1:Dictionary;
var _local2:Face;
var _local3:SkinData;
if (((((((_object.facesChanged) || (_object.viewChanged))) || (facesChanged))) || (objectChanged))){
updateFaces();
_local1 = new Dictionary(true);
for each (_local2 in _faces) {
if (datas[_local2] == undefined){
_local1[_local2] = createSkinData(_local2);
} else {
_local1[_local2] = datas[_local2];
delete datas[_local2];
};
};
for each (_local3 in datas) {
_object._view.removeSkin(_local3);
};
datas = _local1;
};
}
public function get object():Object3D{
return (_object);
}
protected function updateFaceVisible(_arg1:Face):void{
if (((((((_arg1.transformChanged) || (_arg1.meshChanged))) || (_object.viewChanged))) || (objectChanged))){
_arg1.calculateVisible();
if (_arg1.visibleChanged){
if (!_arg1.visible){
_object._view.removeSkin(datas[_arg1]);
};
visibleChanged = true;
};
};
}
public function clear():void{
var _local1:SkinData;
if (((!((_object == null))) && (!((_object._view == null))))){
for each (_local1 in datas) {
_object._view.removeSkin(_local1);
};
};
datas = new Dictionary(true);
}
protected function getFaceByData(_arg1:SkinData):Face{
var _local2:*;
for (_local2 in datas) {
if (datas[_local2] == _arg1){
return (_local2);
};
};
return (null);
}
public function clone():IRenderer{
var _local1:SurfaceRenderer = new SurfaceRenderer();
return (_local1);
}
protected function createSkinData(_arg1:Face):SkinData{
return (null);
}
protected function updateFaces():void{
var _local1:Face;
if (((!((_object == null))) && (((_object.facesChanged) || (objectChanged))))){
for each (_local1 in _faces.clone()) {
if (!_object.faces.has(_local1)){
removeFace(_local1);
};
};
};
}
public function drop():void{
nameChanged = false;
objectChanged = false;
facesChanged = false;
visibleChanged = false;
}
protected function defaultName():String{
num++;
return (("surfaceRenderer" + num));
}
public function set faces(_arg1:Set):void{
_faces = _arg1.clone();
facesChanged = true;
}
public function getVertices():Set{
var _local2:Face;
var _local3:Vertex;
var _local1:Set = new Set(true);
for each (_local2 in _faces) {
for each (_local3 in _local2._vertices) {
_local1.add(_local3);
};
};
return (_local1);
}
}
}//package com.alternativagame.engine3d
Section 31
//TextureLayer (com.alternativagame.engine3d.TextureLayer)
package com.alternativagame.engine3d {
public final class TextureLayer {
public static const BUMP:uint = 2;
public static const TEXTURE:uint = 0;
public static const LIGHT:uint = 1;
public static const DYNAMIC:uint = 3;
}
}//package com.alternativagame.engine3d
Section 32
//TextureObject (com.alternativagame.engine3d.TextureObject)
package com.alternativagame.engine3d {
import flash.geom.*;
import com.alternativagame.type.*;
import flash.display.*;
public class TextureObject extends Sprite {
private var inBounds:Boolean;// = false
var textureChanged:Boolean;// = true
private var uvCoords:Point3D;
protected var _renderer:TextureRenderer;
var drawParamsChanged:Boolean;// = true
var coordsChanged:Boolean;// = true
private var _coords:Point3D;
public function TextureObject(){
_coords = new Point3D();
super();
}
public function get z():Number{
return (_coords.z);
}
public function set coords(_arg1:Point3D):void{
if (!_coords.equals(_arg1)){
_coords.copy(_arg1);
coordsChanged = true;
};
}
function setRenderer(_arg1:TextureRenderer):void{
_renderer = _arg1;
}
override public function set y(_arg1:Number):void{
if (_coords.y != _arg1){
_coords.y = _arg1;
coordsChanged = true;
};
}
protected function localDirectionToUV(_arg1:Point3D):Point3D{
return (_renderer.localDirectionToUV(_arg1));
}
public function get renderer():TextureRenderer{
return (_renderer);
}
function render():void{
if (((coordsChanged) || (_renderer.uvChanged))){
uvCoords = _renderer.localToUV(_coords);
super.x = uvCoords.x;
super.y = uvCoords.y;
};
if (((((drawParamsChanged) || (coordsChanged))) || (_renderer.uvChanged))){
updateBounds();
};
}
public function clone():TextureObject{
var _local1:TextureObject = new TextureObject();
_local1.alpha = alpha;
_local1.blendMode = blendMode;
_local1.coords = _coords.clone();
return (_local1);
}
public function get coords():Point3D{
return (_coords);
}
protected function updateBounds():void{
var _local1:Rectangle = getBounds(parent);
var _local2:Boolean = ((((((((!(_local1.isEmpty())) && ((_local1.left <= _renderer.uvWidth)))) && ((_local1.right >= 0)))) && ((_local1.top <= _renderer.uvHeight)))) && ((_local1.bottom >= 0)));
if (_local2 != inBounds){
textureChanged = true;
visible = _local2;
};
inBounds = _local2;
textureChanged = ((textureChanged) || (inBounds));
}
protected function localToUV(_arg1:Point3D):Point3D{
return (_renderer.localDirectionToUV(_arg1));
}
override public function set blendMode(_arg1:String):void{
if (super.blendMode != _arg1){
super.blendMode = _arg1;
drawParamsChanged = true;
};
}
function drop():void{
textureChanged = false;
coordsChanged = false;
drawParamsChanged = false;
}
override public function set x(_arg1:Number):void{
if (_coords.x != _arg1){
_coords.x = _arg1;
coordsChanged = true;
};
}
override public function get x():Number{
return (_coords.x);
}
override public function get y():Number{
return (_coords.y);
}
public function set z(_arg1:Number):void{
if (_coords.z != _arg1){
_coords.z = _arg1;
coordsChanged = true;
};
}
override public function set alpha(_arg1:Number):void{
if (super.alpha != _arg1){
super.alpha = _arg1;
drawParamsChanged = true;
};
}
}
}//package com.alternativagame.engine3d
Section 33
//TextureRenderer (com.alternativagame.engine3d.TextureRenderer)
package com.alternativagame.engine3d {
import flash.geom.*;
import com.alternativagame.type.*;
import flash.display.*;
import com.alternativagame.engine3d.shading.*;
import flash.utils.*;
import com.alternativagame.utility.*;
import com.alternativagame.engine3d.skin.*;
import flash.filters.*;
public class TextureRenderer extends UVRenderer {
var transparentChanged:Boolean;// = true
private var lightContainer:Sprite;
var mipmapChanged:Boolean;// = true
private var light:BitmapData;
var textureChanged:Boolean;// = false
private var lightFacesContainer:Sprite;
private var textureBitmap:BitmapData;
private var mipmapBumpResolution:int;// = 2
private var bump:BitmapData;
private var cacheTexture:BitmapData;
private var bumpMap:BitmapData;
private var lightFaces:Dictionary;
private var mergedTexture:BitmapData;
private var dynamicLayer:Sprite;
private var _color:RGB;
var mergedTextureChanged:Boolean;// = false
private var lightGI:Sprite;
private var mipmapTextureResolution:int;// = 1
private var lightEdgesContainer:Sprite;
private var mipmap:uint;// = 1
private var _transparent:Boolean;
var bumpChanged:Boolean;// = false
private var globalLights:Set;
var shading:GaussianShading;
var fillChanged:Boolean;// = true
private var mipmapLightResolution:int;// = 6
private var bumpLayer:Sprite;
var lightChanged:Boolean;// = false
private var pointLights:Set;
private var lightLayer:Sprite;
private var _texture:TextureData;
private var lightEdges:Dictionary;
var specularChanged:Boolean;// = true
private var textureLayer:Sprite;
private static const lightBlur:uint = 25;
private static const highestResolution:int = 1;
private static const lightGISize:uint = 50;
private static const lightGIStrength:Number = 0.8;
private static const lowestResolution:int = 50;
private static var realBumpResolution:int = 2;
private static var num:uint = 0;
static var bumpEnabledChanged:Boolean = true;
static var textureResolutionChanged:Boolean = true;
static var bumpResolutionChanged:Boolean = true;
private static var _smooth:Boolean = true;
private static var _bumpResolution:int = 2;
private static var _lightResolution:int = 6;
private static var realLightResolution:int = 6;
static var smoothChanged:Boolean = true;
private static var _textureResolution:int = 1;
private static var _bumpEnabled:Boolean = false;
static var lightResolutionChanged:Boolean = true;
public function TextureRenderer(_arg1:RGB=null, _arg2:TextureData=null, _arg3:Number=2){
_color = _arg1;
_texture = _arg2;
_transparent = (((_arg1 == null)) && ((_arg2 == null)));
shading = new GaussianShading();
shading.specular = _arg3;
textureLayer = new Sprite();
bumpLayer = new Sprite();
lightContainer = new Sprite();
lightEdgesContainer = new Sprite();
lightFacesContainer = new Sprite();
lightGI = new Sprite();
lightGI.blendMode = BlendMode.MULTIPLY;
lightLayer = new Sprite();
lightContainer.addChild(lightEdgesContainer);
lightContainer.addChild(lightFacesContainer);
lightContainer.addChild(lightGI);
lightContainer.addChild(lightLayer);
lightEdges = new Dictionary(true);
lightFaces = new Dictionary(true);
dynamicLayer = new Sprite();
}
private function updateMergedTexture():void{
var _local1:Number;
if (mergedTextureChanged){
updateTexture();
updateLight();
if (((((((textureChanged) || (lightChanged))) || (bumpChanged))) || (transparentChanged))){
cacheTexture.copyPixels(textureBitmap, textureBitmap.rect, new Point());
_local1 = (mipmapLightResolution / mipmapTextureResolution);
cacheTexture.draw(light, new Matrix(_local1, 0, 0, _local1, (1 - _local1), (1 - _local1)), null, BlendMode.HARDLIGHT, null, true);
if (_bumpEnabled){
_local1 = (mipmapBumpResolution / mipmapTextureResolution);
cacheTexture.draw(bump, new Matrix(_local1, 0, 0, _local1, (1 - _local1), (1 - _local1)), null, BlendMode.ADD, null, true);
};
if (_transparent){
cacheTexture.copyChannel(textureBitmap, textureBitmap.rect, new Point(), BitmapDataChannel.ALPHA, BitmapDataChannel.ALPHA);
};
};
mergedTexture.copyPixels(cacheTexture, cacheTexture.rect, new Point());
if (dynamicLayer.numChildren > 0){
mergedTexture.draw(dynamicLayer, new Matrix((1 / mipmapTextureResolution), 0, 0, (1 / mipmapTextureResolution), 1, 1), null, null, null, true);
};
};
}
private function updateTexture():void{
var _local1:Shape;
if (textureChanged){
if (_transparent){
textureBitmap.fillRect(textureBitmap.rect, 0);
} else {
if (_texture != null){
_local1 = new Shape();
_local1.graphics.beginBitmapFill(_texture.bitmapData, new Matrix((_texture.resolution / mipmapTextureResolution), 0, 0, (_texture.resolution / mipmapTextureResolution), 1, 1), true, true);
_local1.graphics.drawRect(0, 0, textureBitmap.width, textureBitmap.height);
textureBitmap.draw(_local1);
} else {
textureBitmap.fillRect(textureBitmap.rect, _color.toInt());
};
};
textureBitmap.draw(textureLayer, new Matrix((1 / mipmapTextureResolution), 0, 0, (1 / mipmapTextureResolution), 1, 1), null, null, null, true);
};
}
public function get texture():TextureData{
return (_texture);
}
public function addTextureObject(_arg1:TextureObject, _arg2:int=-1, _arg3:uint=0):void{
if (((!((_arg1 == null))) && (((!((_arg1.renderer == this))) || (!(getLayer(_arg3).contains(_arg1))))))){
if (_arg1.renderer != null){
_arg1.renderer.removeTextureObject(_arg1);
};
switch (_arg3){
case TextureLayer.TEXTURE:
if (_arg2 < 0){
textureLayer.addChild(_arg1);
} else {
textureLayer.addChildAt(_arg1, _arg2);
};
textureChanged = true;
break;
case TextureLayer.LIGHT:
if (_arg2 < 0){
lightLayer.addChild(_arg1);
} else {
lightLayer.addChildAt(_arg1, _arg2);
};
lightChanged = true;
break;
case TextureLayer.BUMP:
if (_arg2 < 0){
bumpLayer.addChild(_arg1);
} else {
bumpLayer.addChildAt(_arg1, _arg2);
};
break;
case TextureLayer.DYNAMIC:
if (_arg2 < 0){
dynamicLayer.addChild(_arg1);
} else {
dynamicLayer.addChildAt(_arg1, _arg2);
};
break;
};
mergedTextureChanged = true;
_arg1.setRenderer(this);
};
}
public function removeTextureObject(_arg1:TextureObject):void{
if (((!((_arg1 == null))) && ((_arg1.renderer == this)))){
if (textureLayer.contains(_arg1)){
textureLayer.removeChild(_arg1);
textureChanged = true;
} else {
if (lightLayer.contains(_arg1)){
lightLayer.removeChild(_arg1);
lightChanged = true;
} else {
if (bumpLayer.contains(_arg1)){
bumpLayer.removeChild(_arg1);
bumpChanged = true;
} else {
if (dynamicLayer.contains(_arg1)){
dynamicLayer.removeChild(_arg1);
};
};
};
};
mergedTextureChanged = true;
_arg1.setRenderer(null);
};
}
public function getTextureObjectLayer(_arg1:TextureObject):int{
if (((!((_arg1 == null))) && ((_arg1.renderer == this)))){
if (textureLayer.contains(_arg1)){
return (TextureLayer.TEXTURE);
};
if (lightLayer.contains(_arg1)){
return (TextureLayer.LIGHT);
};
if (bumpLayer.contains(_arg1)){
return (TextureLayer.BUMP);
};
if (dynamicLayer.contains(_arg1)){
return (TextureLayer.DYNAMIC);
};
};
return (-1);
}
private function updateTextureSize():void{
var size:Point;
if (((((((uvChanged) || (mipmapChanged))) || (textureResolutionChanged))) || (transparentChanged))){
var create:Function = function ():void{
mergedTexture = new BitmapData(size.x, size.y, _transparent, 0);
cacheTexture = new BitmapData(size.x, size.y, _transparent, 0);
textureBitmap = new BitmapData(size.x, size.y, _transparent, 0);
mergedTextureChanged = true;
textureChanged = true;
};
size = getBitmapSize(mipmapTextureResolution);
if (mergedTexture != null){
if (((((!((mergedTexture.width == size.x))) || (!((mergedTexture.height == size.y))))) || (transparentChanged))){
mergedTexture.dispose();
cacheTexture.dispose();
textureBitmap.dispose();
create();
};
} else {
create();
};
};
}
private function updateBumpMap():void{
if (bumpChanged){
if (_bumpEnabled){
bumpMap.fillRect(bumpMap.rect, 0);
if (bumpLayer.numChildren > 0){
bumpMap.draw(bumpLayer, new Matrix((1 / mipmapBumpResolution), 0, 0, (1 / mipmapBumpResolution), 1, 1), null, null, null, true);
bumpMap.copyChannel(bumpMap, bumpMap.rect, new Point(), BitmapDataChannel.RED, BitmapDataChannel.ALPHA);
bumpMap.colorTransform(bumpMap.rect, new ColorTransform(0, 0, 0, 1));
};
};
};
}
public function get specular():Number{
return (shading.specular);
}
public function set texture(_arg1:TextureData):void{
if (_texture != _arg1){
_texture = _arg1;
fillChanged = true;
};
}
private function calculateFaceGlobalLight(_arg1:Face):void{
var _local2:Light;
var _local3:Boolean;
if (((((((_arg1.coordsChanged) || (_arg1.transformChanged))) || (_arg1.meshChanged))) || (_object.viewChanged))){
_arg1.calculateCanvasCenter();
if (((((_arg1.transformChanged) || (_arg1.meshChanged))) || (_object.viewChanged))){
_arg1.calculateCanvasNormal();
};
};
for each (_local2 in globalLights) {
_local3 = ((((((((((((((((_arg1.meshChanged) || (_arg1.visibleChanged))) || (_object.viewChanged))) || (_object.solidParentChanged))) || (_local2.enabledChanged))) || (_local2.solidParentChanged))) || (_local2.viewChanged))) || (_local2.parentChanged))) || (specularChanged));
if ((_local2 is Directional)){
_local3 = ((_local3) || (((_arg1.transformChanged) || (_local2.transformChanged))));
};
if (_local3){
_arg1.calculateLightStrength(_local2, shading);
};
if (_local2.colorChanged){
_arg1.dropLightColorCalculated();
};
};
_arg1.calculateLightColor();
}
private function updateLights():void{
var _local1:Set;
var _local2:Set;
var _local3:Light;
var _local4:Face;
if (((((((_object.viewChanged) || (_object.solidParentChanged))) || (_object.solidParent.solidObjectsChanged))) || (objectChanged))){
_local1 = _object.getSolidObjects(Ambient).clone();
_local1.concat(_object.getSolidObjects(Directional));
_local2 = _object.getSolidObjects(Omni);
for each (_local3 in globalLights) {
if (!_local1.has(_local3)){
for each (_local4 in _faces) {
_local4.removeLight(_local3);
};
};
};
globalLights = _local1;
pointLights = _local2;
};
}
private function updateBumpSize():void{
var size:Point;
if (((((((((uvChanged) || (mipmapChanged))) || (textureResolutionChanged))) || (bumpResolutionChanged))) || (bumpEnabledChanged))){
var create:Function = function ():void{
if (_bumpEnabled){
bump = new BitmapData(size.x, size.y, true, 0);
bumpMap = new BitmapData(size.x, size.y, true, 0);
} else {
bump = null;
bumpMap = null;
};
bumpChanged = true;
mergedTextureChanged = true;
};
size = getBitmapSize(mipmapBumpResolution);
if (bump != null){
if (((((!((bump.width == size.x))) || (!((bump.height == size.y))))) || (!(_bumpEnabled)))){
bump.dispose();
bumpMap.dispose();
create();
};
} else {
create();
};
};
}
override public function clear():void{
super.clear();
if (((!((_object == null))) && (!((_object._view == null))))){
mergedTexture.dispose();
cacheTexture.dispose();
textureBitmap.dispose();
light.dispose();
bump.dispose();
mergedTexture = null;
cacheTexture = null;
textureBitmap = null;
light = null;
bump = null;
};
}
override public function clone():IRenderer{
var _local2:uint;
var _local3:TextureObject;
var _local1:TextureRenderer = new TextureRenderer(_color, _texture, shading.specular);
var _local4:uint = textureLayer.numChildren;
_local2 = 0;
while (_local2 < _local4) {
_local3 = TextureObject(textureLayer.getChildAt(_local2));
_local1.addTextureObject(_local3.clone(), -1, TextureLayer.TEXTURE);
_local2++;
};
_local4 = lightLayer.numChildren;
_local2 = 0;
while (_local2 < _local4) {
_local3 = TextureObject(lightLayer.getChildAt(_local2));
_local1.addTextureObject(_local3.clone(), -1, TextureLayer.LIGHT);
_local2++;
};
_local4 = bumpLayer.numChildren;
_local2 = 0;
while (_local2 < _local4) {
_local3 = TextureObject(bumpLayer.getChildAt(_local2));
_local1.addTextureObject(_local3.clone(), -1, TextureLayer.BUMP);
_local2++;
};
_local4 = dynamicLayer.numChildren;
_local2 = 0;
while (_local2 < _local4) {
_local3 = TextureObject(dynamicLayer.getChildAt(_local2));
_local1.addTextureObject(_local3.clone(), -1, TextureLayer.DYNAMIC);
_local2++;
};
return (_local1);
}
public function get color():RGB{
return (_color);
}
private function updateGI():void{
var complete:Set;
var face:Face;
var uvs:Array;
var length:uint;
var i:uint;
var v:Vertex;
var i2:uint;
var joined:Face;
var j:uint;
var j2:uint;
var strength:Number;
var color:uint;
if (((uvChanged) || (objectChanged))){
complete = new Set(true);
lightGI.graphics.clear();
for each (face in _faces) {
uvs = uv[face];
face.calculateCenter();
face.calculateNormal();
complete.add(face);
length = face.length;
i = 0;
while (i < length) {
v = Vertex(face._vertices[i]);
i2 = ((i)<(length - 1)) ? (i + 1) : 0;
for each (joined in v.faces) {
if (!complete.has(joined)){
j = joined._vertices.indexOf(v);
j2 = ((j)>0) ? (j - 1) : (joined.length - 1);
if (face._vertices[i2] == joined._vertices[j2]){
joined.calculateCenter();
joined.calculateNormal();
if (Point3D.dot(face.normal, Point3D.difference(joined.center, face.center)) > 0){
strength = (Point3D.angleFast(face.normal, joined.normal) / Math.PI);
color = ((((1 - strength) * lightGIStrength) * 0xFF) + ((1 - lightGIStrength) * 0xFF));
var _local6 = lightGI.graphics;
with (_local6) {
lineStyle((lightGISize * strength), (((color << 16) + (color << 8)) + color));
moveTo(uvs[i].x, uvs[i].y);
curveTo(uvs[i].x, uvs[i].y, uvs[i2].x, uvs[i2].y);
};
};
break;
};
};
};
i = (i + 1);
};
};
lightChanged = true;
mergedTextureChanged = true;
};
}
private function updateLightSize():void{
var size:Point;
if (((((((uvChanged) || (mipmapChanged))) || (textureResolutionChanged))) || (lightResolutionChanged))){
var create:Function = function ():void{
light = new BitmapData(size.x, size.y, false, 0xFF00FF);
lightChanged = true;
mergedTextureChanged = true;
};
size = getBitmapSize(mipmapLightResolution);
if (light != null){
if (((!((light.width == size.x))) || (!((light.height == size.y))))){
light.dispose();
create();
};
} else {
create();
};
};
}
public function getTextureObjects(_arg1:uint=0):Array{
var _local3:uint;
var _local4:Array;
var _local5:uint;
var _local2:Sprite = getLayer(_arg1);
if (_local2 != null){
_local3 = _local2.numChildren;
if (_local3 > 0){
_local4 = new Array();
_local5 = 0;
while (_local5 < _local3) {
_local4.push(_local2.getChildAt(_local5));
_local5++;
};
return (_local4);
};
};
return (null);
}
override protected function defaultName():String{
num++;
return (("textureRenderer" + num));
}
public function getTextureObject(_arg1:uint, _arg2:uint=0):TextureObject{
var _local3:Sprite = getLayer(_arg2);
if (_local3 != null){
return (TextureObject(_local3.getChildAt(_arg1)));
};
return (null);
}
public function set specular(_arg1:Number):void{
shading.specular = _arg1;
specularChanged = true;
}
override public function render():void{
var face:Face;
var data:SkinData;
var skin:TextureSkin;
var textureMatrixChanged:Boolean;
var geometryChanged:Boolean;
var uvs:Array;
var length:uint;
var i:uint;
var v:*;
var i2:*;
var edge:*;
var joined:*;
var j:*;
var j2:*;
updateSkinDatas();
calculateUVCoords();
updateMipmap();
updateFill();
updateTextureSize();
updateLightSize();
updateLightElements();
updateBumpSize();
updateBumpMap();
updateLights();
for each (face in _faces) {
updateFaceVisible(face);
if (face.visible){
data = datas[face];
skin = TextureSkin(data.skin);
textureMatrixChanged = ((((((((((((face.visibleChanged) || (face.meshChanged))) || (_object.viewChanged))) || (uvChanged))) || (mipmapChanged))) || (textureResolutionChanged))) || (objectChanged));
geometryChanged = ((((((((((face.coordsChanged) || (face.transformChanged))) || (face.visibleChanged))) || (face.meshChanged))) || (_object.viewChanged))) || (objectChanged));
if (textureMatrixChanged){
skin.calculateMatrix(uv[face], mipmapTextureResolution);
};
if (geometryChanged){
_object._view.changeSkin(data);
};
if (((((((geometryChanged) || (textureMatrixChanged))) || (transparentChanged))) || (smoothChanged))){
skin.draw(data.points, mergedTexture, _smooth);
};
};
calculateFaceGlobalLight(face);
if (((((((((mipmapChanged) || (textureResolutionChanged))) || (lightResolutionChanged))) || (uvChanged))) || (objectChanged))){
uvs = uv[face];
length = face.length;
var _local4 = Shape(lightEdges[face]).graphics;
with (_local4) {
clear();
lineStyle((((2 * lightBlur) / mipmapLightResolution) + 2), 0, 1, false, LineScaleMode.NONE);
i = 0;
while (i < length) {
v = Vertex(face._vertices[i]);
i2 = ((i)<(length - 1)) ? (i + 1) : 0;
edge = true;
for each (joined in v.faces) {
if (((!((joined == face))) && (_faces.has(joined)))){
j = joined._vertices.indexOf(v);
j2 = ((j)>0) ? (j - 1) : (joined.length - 1);
if (face._vertices[i2] == joined._vertices[j2]){
edge = false;
break;
};
};
};
if (edge){
moveTo(uvs[i].x, uvs[i].y);
lineTo(uvs[i2].x, uvs[i2].y);
};
i++;
};
};
if (((uvChanged) || (objectChanged))){
_local4 = Shape(lightFaces[face]).graphics;
with (_local4) {
clear();
beginFill(0);
moveTo(uvs[0].x, uvs[0].y);
i = 1;
while (i < length) {
lineTo(uvs[i].x, uvs[i].y);
i++;
};
endFill();
};
};
lightChanged = true;
mergedTextureChanged = true;
};
if (((((face.lightColorChanged) || (uvChanged))) || (objectChanged))){
Shape(lightFaces[face]).transform.colorTransform = new ColorTransform(0, 0, 0, 1, face.lightColor.red, face.lightColor.green, face.lightColor.blue);
Shape(lightEdges[face]).transform.colorTransform = new ColorTransform(0, 0, 0, 1, face.lightColor.red, face.lightColor.green, face.lightColor.blue);
lightChanged = true;
mergedTextureChanged = true;
};
};
updateGI();
updateBump();
updateTextureObjects();
updateMergedTexture();
}
private function getLayer(_arg1:uint):Sprite{
switch (_arg1){
case TextureLayer.TEXTURE:
return (textureLayer);
case TextureLayer.LIGHT:
return (lightLayer);
case TextureLayer.BUMP:
return (bumpLayer);
case TextureLayer.DYNAMIC:
return (dynamicLayer);
default:
return (null);
};
}
private function updateBump():void{
var _local1:Matrix3D;
var _local2:Matrix3D;
var _local3:Point3D;
var _local4:Point3D;
var _local5:Point3D;
var _local6:Point3D;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Light;
if (((((lightChanged) || (bumpChanged))) || (objectChanged))){
if (_bumpEnabled){
_local1 = uvMatrix.clone();
_local1.translateLocal((uvWidth / 2), (uvHeight / 2), 0);
_local1.combine(_object.transformMatrix);
_local2 = Matrix3D.inverseMatrix(_local1);
_local2.resetTranslate();
_local3 = new Point3D(_local1.d, _local1.h, _local1.l);
_local4 = new Point3D(_local1.c, _local1.g, _local1.k);
_local5 = new Point3D(_local1.a, _local1.e, _local1.i);
bump.fillRect(bump.rect, 0);
if (bumpLayer.numChildren > 0){
for each (_local10 in globalLights) {
if ((_local10 is Directional)){
_local7 = _local10.getStrengthAtSurface(_local3, _local4);
if (_local7 > 0){
_local6 = new Point3D(-(_local10.transformMatrix.b), -(_local10.transformMatrix.f), -(_local10.transformMatrix.j));
_local6.transform(_local2);
_local8 = (shading.shade(_local6.z) / 5);
_local9 = (180 + MathUtility.toDegree(Math.atan2(_local6.y, _local6.x)));
bump.applyFilter(bumpMap, bumpMap.rect, new Point(0, 0), new BevelFilter(1, _local9, _local10._color.toInt(), 1, 0, 0, 1, 1, (((1 - _local8) * _local7) * 5), 1));
};
};
};
};
};
};
}
private function updateTextureObjects():void{
var _local1:uint;
var _local2:TextureObject;
var _local3:uint = textureLayer.numChildren;
_local1 = 0;
while (_local1 < _local3) {
_local2 = TextureObject(textureLayer.getChildAt(_local1));
_local2.render();
textureChanged = ((textureChanged) || (_local2.textureChanged));
_local1++;
};
_local3 = lightLayer.numChildren;
_local1 = 0;
while (_local1 < _local3) {
_local2 = TextureObject(lightLayer.getChildAt(_local1));
_local2.render();
lightChanged = ((lightChanged) || (_local2.textureChanged));
_local1++;
};
_local3 = bumpLayer.numChildren;
_local1 = 0;
while (_local1 < _local3) {
_local2 = TextureObject(bumpLayer.getChildAt(_local1));
_local2.render();
bumpChanged = ((bumpChanged) || (_local2.textureChanged));
_local1++;
};
_local3 = dynamicLayer.numChildren;
_local1 = 0;
while (_local1 < _local3) {
_local2 = TextureObject(dynamicLayer.getChildAt(_local1));
_local2.render();
mergedTextureChanged = ((mergedTextureChanged) || (_local2.textureChanged));
_local1++;
};
mergedTextureChanged = ((mergedTextureChanged) || (((((textureChanged) || (lightChanged))) || (bumpChanged))));
}
public function getTextureObjectIndex(_arg1:TextureObject):int{
var _local2:int = getTextureObjectLayer(_arg1);
if (_local2 >= 0){
return (getLayer(_local2).getChildIndex(_arg1));
};
return (-1);
}
public function setTextureObjectIndex(_arg1:TextureObject, _arg2:uint):void{
var _local3:Sprite = getLayer(getTextureObjectLayer(_arg1));
if (_local3 != null){
_local3.setChildIndex(_arg1, _arg2);
};
}
private function getBitmapSize(_arg1:Number):Point{
var _local2:Point = new Point((int((uvWidth / _arg1)) + 3), (int((uvHeight / _arg1)) + 3));
var _local3 = ((_local2.x % 2) == 0);
var _local4 = ((_local2.y % 2) == 0);
if (((_local3) && (_local4))){
if (_local2.x > _local2.y){
_local2.x++;
} else {
_local2.y++;
};
};
return (_local2);
}
private function updateMipmap():void{
var _local1:int;
if (_object._view.zoomChanged){
_local1 = ((_object._view.zoom)>=1) ? 1 : Math.round((1 / _object._view.zoom));
if (mipmap != _local1){
mipmap = _local1;
mipmapChanged = true;
};
};
if (((((((mipmapChanged) || (textureResolutionChanged))) || (lightResolutionChanged))) || (bumpResolutionChanged))){
mipmapTextureResolution = (_textureResolution * mipmap);
mipmapLightResolution = (realLightResolution * mipmap);
mipmapBumpResolution = (realBumpResolution * mipmap);
};
}
function getDepthAtUV(_arg1:Number, _arg2:Number):Number{
var _local4:Face;
var _local3:Shape = lightFacesContainer.getObjectsUnderPoint(new Point(_arg1, _arg2))[0];
if (_local3 != null){
for each (_local4 in _faces) {
if (lightFaces[_local4] == _local3){
return (getWAtFaceUV(_local4, _arg1, _arg2));
};
};
};
return (0);
}
private function updateLight():void{
var _local1:Set;
var _local2:RGB;
var _local3:Ambient;
var _local4:Number;
if (lightChanged){
_local1 = _object.getSolidObjects(Ambient);
_local2 = new RGB();
for each (_local3 in _local1) {
_local2.add(_local3._color);
};
lightContainer.graphics.clear();
lightContainer.graphics.beginFill(_local2.toInt(), 1);
if (mipmapLightResolution < lightBlur){
_local4 = (lightBlur / mipmapLightResolution);
lightContainer.filters = [new BlurFilter(_local4, _local4, 1)];
lightContainer.graphics.drawRect((-(mipmapLightResolution) - lightBlur), (-(mipmapLightResolution) - lightBlur), (((light.width * mipmapLightResolution) + lightBlur) + lightBlur), (((light.height * mipmapLightResolution) + lightBlur) + lightBlur));
} else {
lightContainer.filters = null;
lightContainer.graphics.drawRect(-(mipmapLightResolution), -(mipmapLightResolution), (light.width * mipmapLightResolution), (light.height * mipmapLightResolution));
};
light.draw(lightContainer, new Matrix((1 / mipmapLightResolution), 0, 0, (1 / mipmapLightResolution), 1, 1), null, null, null, true);
};
}
public function set color(_arg1:RGB):void{
if (_color == null){
if (_arg1 != null){
_color = _arg1;
fillChanged = true;
};
} else {
if ((((_arg1 == null)) || (!(_color.equals(_arg1))))){
_color = _arg1;
fillChanged = true;
};
};
}
override protected function createSkinData(_arg1:Face):SkinData{
var _local2:Array = _arg1._vertices;
var _local3:uint = _local2.length;
var _local4:SkinData = new SkinData(this, _local3);
var _local5:uint;
while (_local5 < _local3) {
_local4.points[_local5] = _local2[_local5].canvasCoords;
_local5++;
};
_local4.skin = new TextureSkin();
return (_local4);
}
private function updateLightElements():void{
var _local1:Dictionary;
var _local2:Dictionary;
var _local3:Shape;
var _local4:Face;
if (((((((_object.facesChanged) || (_object.viewChanged))) || (facesChanged))) || (objectChanged))){
_local1 = new Dictionary(true);
_local2 = new Dictionary(true);
for each (_local4 in _faces) {
if ((((lightEdges[_local4] == undefined)) || ((lightFaces[_local4] == undefined)))){
_local3 = new Shape();
lightEdgesContainer.addChild(_local3);
_local1[_local4] = _local3;
_local3 = new Shape();
lightFacesContainer.addChild(_local3);
_local2[_local4] = _local3;
} else {
_local1[_local4] = lightEdges[_local4];
_local2[_local4] = lightFaces[_local4];
delete lightEdges[_local4];
delete lightFaces[_local4];
};
};
for each (_local3 in lightEdges) {
lightEdgesContainer.removeChild(_local3);
};
for each (_local3 in lightFaces) {
lightFacesContainer.removeChild(_local3);
};
lightEdges = _local1;
lightFaces = _local2;
};
}
private function updateFill():void{
var _local1:Boolean;
if (fillChanged){
mergedTextureChanged = true;
textureChanged = true;
_local1 = (((_color == null)) && ((_texture == null)));
if (_transparent != _local1){
_transparent = _local1;
transparentChanged = true;
};
};
}
override public function drop():void{
var _local1:uint;
var _local2:TextureObject;
super.drop();
fillChanged = false;
transparentChanged = false;
specularChanged = false;
smoothChanged = false;
textureResolutionChanged = false;
lightResolutionChanged = false;
bumpResolutionChanged = false;
bumpEnabledChanged = false;
mipmapChanged = false;
mergedTextureChanged = false;
textureChanged = false;
lightChanged = false;
bumpChanged = false;
var _local3:uint = textureLayer.numChildren;
_local1 = 0;
while (_local1 < _local3) {
TextureObject(textureLayer.getChildAt(_local1)).drop();
_local1++;
};
_local3 = lightLayer.numChildren;
_local1 = 0;
while (_local1 < _local3) {
TextureObject(lightLayer.getChildAt(_local1)).drop();
_local1++;
};
_local3 = bumpLayer.numChildren;
_local1 = 0;
while (_local1 < _local3) {
TextureObject(bumpLayer.getChildAt(_local1)).drop();
_local1++;
};
_local3 = dynamicLayer.numChildren;
_local1 = 0;
while (_local1 < _local3) {
TextureObject(dynamicLayer.getChildAt(_local1)).drop();
_local1++;
};
}
public static function get bumpEnabled():Boolean{
return (_bumpEnabled);
}
public static function get lightResolution():int{
return (_lightResolution);
}
public static function set lightResolution(_arg1:int):void{
_arg1 = ((_arg1)>lowestResolution) ? lowestResolution : ((_arg1)<highestResolution) ? highestResolution : _arg1;
if (_lightResolution != _arg1){
_lightResolution = _arg1;
realLightResolution = Math.max(_textureResolution, _lightResolution);
lightResolutionChanged = true;
};
}
public static function set textureResolution(_arg1:int):void{
_arg1 = ((_arg1)>lowestResolution) ? lowestResolution : ((_arg1)<highestResolution) ? highestResolution : _arg1;
if (_textureResolution != _arg1){
_textureResolution = _arg1;
realLightResolution = Math.max(_textureResolution, _lightResolution);
realBumpResolution = Math.max(_textureResolution, _bumpResolution);
textureResolutionChanged = true;
};
}
public static function get bumpResolution():int{
return (_bumpResolution);
}
public static function set bumpEnabled(_arg1:Boolean):void{
if (_bumpEnabled != _arg1){
_bumpEnabled = _arg1;
bumpEnabledChanged = true;
};
}
public static function set smooth(_arg1:Boolean):void{
_smooth = _arg1;
smoothChanged = true;
}
public static function get textureResolution():int{
return (_textureResolution);
}
public static function get smooth():Boolean{
return (_smooth);
}
public static function set bumpResolution(_arg1:int):void{
_arg1 = ((_arg1)>lowestResolution) ? lowestResolution : ((_arg1)<highestResolution) ? highestResolution : _arg1;
if (_bumpResolution != _arg1){
_bumpResolution = _arg1;
realBumpResolution = Math.max(_textureResolution, _bumpResolution);
bumpResolutionChanged = true;
};
}
}
}//package com.alternativagame.engine3d
Section 34
//UVRenderer (com.alternativagame.engine3d.UVRenderer)
package com.alternativagame.engine3d {
import com.alternativagame.type.*;
import flash.utils.*;
import com.alternativagame.engine3d.skin.*;
public class UVRenderer extends InteractiveSurfaceRenderer {
var directionUVMatrix:Matrix3D;
var uvMatrix:Matrix3D;
var uvChanged:Boolean;// = false
var uv:Dictionary;
var uvDepth:uint;
var uvWidth:uint;
var uvHeight:uint;
private var uvData:SkinData;
var inverseUVMatrix:Matrix3D;
private static var num:uint = 0;
protected function calculateUVCoords():void{
var _local1:Dictionary;
var _local2:Point3D;
var _local3:uint;
var _local4:Array;
var _local5:Face;
var _local6:uint;
var _local7:Point3D;
var _local8:Point3D;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Point3D;
var _local16:*;
var _local17:Array;
if (((((((((_object.geometryChanged) || (_object.facesChanged))) || (_object.viewChanged))) || (facesChanged))) || (objectChanged))){
_local1 = new Dictionary(true);
_local2 = new Point3D();
for each (_local5 in _faces) {
_local5.calculateNormal();
_local2.add(_local5.normal);
_local4 = _local5._vertices;
_local3 = _local4.length;
_local6 = 0;
while (_local6 < _local3) {
if (_local1[_local4[_local6]] == undefined){
_local1[_local4[_local6]] = new Point3D();
};
_local6++;
};
};
if (_local2.length < 0.1){
_local2 = new Point3D(0, -1, 0);
} else {
_local2.normalize();
};
_local7 = new Point3D();
_local8 = new Point3D();
if (Math.abs(_local2.z) > 0.9){
_local7.x = _local2.z;
_local7.z = -(_local2.x);
} else {
_local7.x = -(_local2.y);
_local7.y = _local2.x;
};
_local7.normalize();
_local8 = Point3D.cross(_local7, _local2);
uvMatrix = new Matrix3D(_local7.x, _local8.x, _local2.x, 0, _local7.y, _local8.y, _local2.y, 0, _local7.z, _local8.z, _local2.z, 0);
inverseUVMatrix = Matrix3D.inverseMatrix(uvMatrix);
_local9 = Number.MAX_VALUE;
_local10 = -(Number.MAX_VALUE);
_local11 = Number.MAX_VALUE;
_local12 = -(Number.MAX_VALUE);
_local13 = Number.MAX_VALUE;
_local14 = -(Number.MAX_VALUE);
for (_local16 in _local1) {
_local15 = Vertex(_local16).coords.clone();
_local15.transform(inverseUVMatrix);
Point3D(_local1[_local16]).copy(_local15);
_local9 = ((_local15.x)<_local9) ? _local15.x : _local9;
_local10 = ((_local15.x)>_local10) ? _local15.x : _local10;
_local11 = ((_local15.y)<_local11) ? _local15.y : _local11;
_local12 = ((_local15.y)>_local12) ? _local15.y : _local12;
_local13 = ((_local15.z)<_local13) ? _local15.z : _local13;
_local14 = ((_local15.z)>_local14) ? _local15.z : _local14;
};
uvWidth = (_local10 - _local9);
uvHeight = (_local12 - _local11);
uvDepth = (_local14 - _local13);
for (_local16 in _local1) {
_local15 = Point3D(_local1[_local16]);
Point3D(_local1[_local16]).x = (_local15.x - _local9);
_local15.y = (_local15.y - _local11);
_local15.z = (_local15.z - _local13);
};
uv = new Dictionary(true);
for each (_local5 in _faces) {
_local17 = new Array();
_local4 = _local5._vertices;
_local3 = _local4.length;
_local6 = 0;
while (_local6 < _local3) {
_local17.push(_local1[_local4[_local6]]);
_local6++;
};
uv[_local5] = _local17;
};
directionUVMatrix = Matrix3D.inverseMatrix(uvMatrix);
uvMatrix.translateLocal(_local9, _local11, _local13);
inverseUVMatrix = Matrix3D.inverseMatrix(uvMatrix);
uvChanged = true;
};
}
public function uvToLocal(_arg1:Point3D):Point3D{
var _local2:Point3D = _arg1.clone();
_local2.transform(uvMatrix);
return (_local2);
}
public function localDirectionToUV(_arg1:Point3D):Point3D{
var _local2:Point3D = _arg1.clone();
_local2.transform(directionUVMatrix);
return (_local2);
}
public function localToUV(_arg1:Point3D):Point3D{
var _local2:Point3D = _arg1.clone();
_local2.transform(inverseUVMatrix);
return (_local2);
}
override protected function defaultName():String{
num++;
return (("uvRenderer" + num));
}
override public function render():void{
var _local1:Matrix3D;
var _local2:Point3D;
var _local3:Point3D;
var _local4:Point3D;
var _local5:Point3D;
var _local6:Array;
var _local7:Array;
var _local8:uint;
var _local9:Point3D;
var _local10:Face;
var _local11:uint;
if (uvData == null){
uvData = new SkinData(this, 4);
uvData.skin = new UVSkin();
};
calculateUVCoords();
if (((((((((((((((_object.coordsChanged) || (_object.transformChanged))) || (_object.geometryChanged))) || (_object.facesChanged))) || (_object.viewChanged))) || (_object.parentChanged))) || (facesChanged))) || (objectChanged))){
_local1 = uvMatrix.clone();
_local1.translateLocal(0, 0, (uvDepth + 50));
_local1.combine(_object.transformMatrix);
_local2 = new Point3D(_local1.d, _local1.h, _local1.l);
_local3 = new Point3D((_local1.d + (_local1.b * uvHeight)), (_local1.h + (_local1.f * uvHeight)), (_local1.l + (_local1.j * uvWidth)));
_local4 = new Point3D(((_local1.d + (_local1.a * uvWidth)) + (_local1.b * uvHeight)), ((_local1.h + (_local1.e * uvWidth)) + (_local1.f * uvHeight)), ((_local1.l + (_local1.i * uvWidth)) + (_local1.j * uvWidth)));
_local5 = new Point3D((_local1.d + (_local1.a * uvWidth)), (_local1.h + (_local1.e * uvWidth)), (_local1.l + (_local1.i * uvWidth)));
uvData.points[0] = _local2;
uvData.points[1] = _local3;
uvData.points[2] = _local4;
uvData.points[3] = _local5;
if ((((_local3.x - _local2.x) * (_local4.y - _local2.y)) - ((_local3.y - _local2.y) * (_local4.x - _local2.x))) < 0){
_object._view.changeSkin(uvData);
UVSkin(uvData.skin).clear();
UVSkin(uvData.skin).drawGizmo(uvData.points, 1, 0xFF00, 0xFF00, 0.2, 0xFF0000);
for each (_local10 in _faces) {
_local6 = new Array();
_local7 = uv[_local10];
_local8 = _local7.length;
_local11 = 0;
while (_local11 < _local8) {
_local9 = Point3D(_local7[_local11]).clone();
_local9.z = 0;
_local9.transform(_local1);
_local6.push(_local9);
_local11++;
};
UVSkin(uvData.skin).drawFaceUV(_local6, 1, 0xFFFF00, 0.4);
};
} else {
_object._view.removeSkin(uvData);
};
};
}
override public function drop():void{
super.drop();
uvChanged = false;
}
override public function clone():IRenderer{
var _local1:UVRenderer = new UVRenderer();
return (_local1);
}
public function getWAtFaceUV(_arg1:Face, _arg2:Number, _arg3:Number):Number{
var _local4:Array = uv[_arg1];
var _local5:Point3D = _local4[0];
var _local6:Point3D = _local4[1];
var _local7:Point3D = _local4[2];
var _local8:Number = (((-(_local5.y) * (_local7.z - _local6.z)) + (_local6.y * (_local7.z - _local5.z))) - (_local7.y * (_local6.z - _local5.z)));
var _local9:Number = (((-(_local5.z) * (_local7.x - _local6.x)) + (_local6.z * (_local7.x - _local5.x))) - (_local7.z * (_local6.x - _local5.x)));
var _local10:Number = (((-(_local5.x) * (_local7.y - _local6.y)) + (_local6.x * (_local7.y - _local5.y))) - (_local7.x * (_local6.y - _local5.y)));
var _local11:Number = (((-(_local5.x) * ((_local6.y * _local7.z) - (_local7.y * _local6.z))) - (_local6.x * ((_local7.y * _local5.z) - (_local5.y * _local7.z)))) - (_local7.x * ((_local5.y * _local6.z) - (_local6.y * _local5.z))));
return ((-((((_local8 * _arg2) + (_local9 * _arg3)) + _local11)) / _local10));
}
}
}//package com.alternativagame.engine3d
Section 35
//Vertex (com.alternativagame.engine3d.Vertex)
package com.alternativagame.engine3d {
import com.alternativagame.type.*;
public class Vertex {
var faces:Set;
var meshChanged:Boolean;// = false
var canvasCoords:Point3D;
var facesChanged:Boolean;// = false
var mesh:Mesh;
var coordsChanged:Boolean;// = true
private var _coords:Point3D;
public function Vertex(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0){
_coords = new Point3D(_arg1, _arg2, _arg3);
faces = new Set(true);
canvasCoords = new Point3D();
}
public function clone():Vertex{
return (new Vertex(x, y, z));
}
public function get coords():Point3D{
return (_coords);
}
function calculate(_arg1:Matrix3D):void{
if (((((coordsChanged) || (meshChanged))) || (mesh.viewChanged))){
canvasCoords.copy(_coords);
canvasCoords.transform(_arg1);
};
}
function drop():void{
coordsChanged = false;
facesChanged = false;
meshChanged = false;
}
public function set x(_arg1:Number):void{
_coords.x = _arg1;
setChangedCoords();
}
public function set y(_arg1:Number):void{
_coords.y = _arg1;
setChangedCoords();
}
public function set z(_arg1:Number):void{
_coords.z = _arg1;
setChangedCoords();
}
private function setChangedCoords():void{
var _local1:Face;
coordsChanged = true;
for each (_local1 in faces) {
_local1.transformChanged = true;
_local1.visibleCalculated = false;
_local1.centerCalculated = false;
_local1.canvasCenterCalculated = false;
_local1.normalCalculated = false;
_local1.canvasNormalCalculated = false;
};
if (mesh != null){
mesh.geometryChanged = true;
};
}
public function get x():Number{
return (_coords.x);
}
public function get y():Number{
return (_coords.y);
}
public function get z():Number{
return (_coords.z);
}
public function set coords(_arg1:Point3D):void{
_coords.copy(_arg1);
setChangedCoords();
}
function setMesh(_arg1:Mesh):void{
mesh = _arg1;
meshChanged = true;
}
}
}//package com.alternativagame.engine3d
Section 36
//View (com.alternativagame.engine3d.View)
package com.alternativagame.engine3d {
import flash.geom.*;
import flash.events.*;
import com.alternativagame.type.*;
import flash.display.*;
import flash.text.*;
import com.alternativagame.admin.*;
import com.alternativagame.utility.*;
import flash.filters.*;
public class View extends Sprite {
var inverseTransformMatrix:Matrix3D;
private var pressedSkinData:SkinData;
private var inverseTransformCalculated:Boolean;// = false
private var mouseCoords:Point3D;
private var compareSkinDatas:Set;
private var readySkinDatas:Set;
var directionChanged:Boolean;// = true
private var changedSkinDatas:Set;
private var _height:uint;
private var _pitch:Number;// = 0
private var directionTransformCalculated:Boolean;// = false
var transformMatrix:Matrix3D;
public var canvas:Sprite;
private var overedSkinData:SkinData;
private var _roll:Number;// = 0
private var _object:Object3D;// = null
var zoomChanged:Boolean;// = true
private var deletedSkinDatas:Set;
var objectChanged:Boolean;// = false
private var _crop:Boolean;// = false
private var shiftKey:Boolean;// = false
private var layerIndexes:Array;
private var mouseSkinData:SkinData;
private var canvasCoords:Point3D;
private var boundMapGfx:Sprite;
private var _hold:Boolean;// = false
var baseChanged:Boolean;// = true
private var _target:Point3D;
private var _zoom:Number;// = 1
private var _yaw:Number;// = 0
private var _width:uint;
private var _base:Point3D;
var directionTransformMatrix:Matrix3D;
private var mouseBound:Point;
var targetChanged:Boolean;// = true
private var mouseDown:Boolean;// = false
private var helperGfx:Shape;
private var ctrlKey:Boolean;// = false
private var altKey:Boolean;// = false
private var boundMap:Array;
static const boundMapOffset:int = ((1440 / boundMapSize) + 1);
static const boundMapSize:Number = 100;
public function View(_arg1:uint=0, _arg2:uint=0){
var width = _arg1;
var height = _arg2;
super();
readySkinDatas = new Set(true);
changedSkinDatas = new Set(true);
deletedSkinDatas = new Set(true);
compareSkinDatas = new Set(true);
layerIndexes = new Array();
boundMap = new Array();
hitArea = new Sprite();
hitArea.mouseEnabled = false;
hitArea.visible = false;
var _local4 = hitArea.graphics;
with (_local4) {
beginFill(0);
drawRect(0, 0, 100, 100);
};
addChild(hitArea);
canvas = new Sprite();
canvas.mouseEnabled = false;
canvas.mouseChildren = false;
canvas.tabEnabled = false;
canvas.tabChildren = false;
addChild(canvas);
canvasCoords = new Point3D();
_base = new Point3D();
_target = new Point3D();
this.width = width;
this.height = height;
addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
addEventListener(Event.ADDED_TO_STAGE, onMouseAdd);
addEventListener(Event.REMOVED_FROM_STAGE, onMouseRemove);
addEventListener(Event.MOUSE_LEAVE, onMouseRemove);
}
private function onKey(_arg1:KeyboardEvent):void{
ctrlKey = _arg1.ctrlKey;
altKey = _arg1.altKey;
shiftKey = _arg1.shiftKey;
}
public function get targetY():Number{
return (_target.y);
}
public function set yaw(_arg1:Number):void{
if (_yaw != _arg1){
_yaw = _arg1;
setTransformChanged();
directionChanged = true;
};
}
public function set crop(_arg1:Boolean):void{
_crop = _arg1;
if (_arg1){
scrollRect = new Rectangle(0, 0, width, height);
} else {
scrollRect = null;
};
}
function removeSkin(_arg1:SkinData):void{
if (changedSkinDatas.has(_arg1)){
changedSkinDatas.remove(_arg1);
deletedSkinDatas.add(_arg1);
if (_arg1 == mouseSkinData){
onMouseSkinData();
};
} else {
if (readySkinDatas.has(_arg1)){
removeFromBoundMap(_arg1);
_arg1.breakLinks();
readySkinDatas.remove(_arg1);
deletedSkinDatas.add(_arg1);
if (_arg1 == mouseSkinData){
onMouseSkinData();
};
};
};
}
public function set target(_arg1:Point3D):void{
if (!_target.equals(_arg1)){
_target.copy(_arg1);
targetChanged = true;
};
}
private function onMouseRemove(_arg1:Event):void{
mouseCoords = null;
mouseBound = null;
mouseSkinData = null;
}
override public function get height():Number{
return (_height);
}
private function checkLayer(_arg1:int):void{
var _local2:int = (_arg1 - 1);
while ((((layerIndexes[_local2] == undefined)) && ((_local2 >= 0)))) {
_local2--;
};
var _local3:uint = ((_local2)<0) ? 0 : layerIndexes[_local2];
if (_local3 == layerIndexes[_arg1]){
if (_arg1 < (layerIndexes.length - 1)){
layerIndexes[_arg1] = undefined;
} else {
layerIndexes.pop();
_arg1--;
while ((((_arg1 >= 0)) && ((layerIndexes[_arg1] == undefined)))) {
layerIndexes.pop();
_arg1--;
};
};
};
}
private function setTransformChanged():void{
if (((((((!((object == null))) && (!(baseChanged)))) && (!(directionChanged)))) && (!(zoomChanged)))){
object.setCoordsChanged();
object.setTransformChanged();
};
}
public function get object():Object3D{
return (_object);
}
public function get pitch():Number{
return (_pitch);
}
private function onMouseUp(_arg1:MouseEvent):void{
if (mouseSkinData != null){
sendInteraction(Interaction.UP);
if (pressedSkinData != null){
if (mouseSkinData == pressedSkinData){
sendInteraction(Interaction.SKIN_CLICK);
};
if (mouseSkinData.renderer == pressedSkinData.renderer){
sendInteraction(Interaction.RENDERER_CLICK);
};
if (mouseSkinData.renderer.object == pressedSkinData.renderer.object){
sendInteraction(Interaction.OBJECT_CLICK);
};
};
};
pressedSkinData = null;
mouseDown = false;
}
private function arrangeSkins():void{
var _local1:SkinData;
var _local2:int;
var _local3:uint;
calculateSkinDataLayers();
for each (_local1 in readySkinDatas) {
if (_local1.newLayer != _local1.layer){
_local2 = _local1.newLayer;
while ((((layerIndexes[_local2] == undefined)) && ((_local2 >= 0)))) {
_local2--;
};
_local3 = ((_local2)<0) ? 0 : layerIndexes[_local2];
if (_local1.layer < 0){
canvas.addChildAt(_local1.skin, _local3);
layerIndexes[_local1.newLayer] = (_local3 + 1);
_local2 = (_local1.newLayer + 1);
while (_local2 < layerIndexes.length) {
if (layerIndexes[_local2] != undefined){
var _local6 = layerIndexes;
var _local7 = _local2;
var _local8 = (_local6[_local7] + 1);
_local6[_local7] = _local8;
};
_local2++;
};
} else {
if (_local1.newLayer > _local1.layer){
canvas.setChildIndex(_local1.skin, (_local3 - 1));
layerIndexes[_local1.newLayer] = _local3;
_local2 = _local1.layer;
while (_local2 < _local1.newLayer) {
if (layerIndexes[_local2] != undefined){
_local6 = layerIndexes;
_local7 = _local2;
_local8 = (_local6[_local7] - 1);
_local6[_local7] = _local8;
};
_local2++;
};
} else {
canvas.setChildIndex(_local1.skin, _local3);
layerIndexes[_local1.newLayer] = (_local3 + 1);
_local2 = (_local1.newLayer + 1);
while (_local2 < _local1.layer) {
if (layerIndexes[_local2] != undefined){
_local6 = layerIndexes;
_local7 = _local2;
_local8 = (_local6[_local7] + 1);
_local6[_local7] = _local8;
};
_local2++;
};
};
checkLayer(_local1.layer);
};
};
_local1.layer = _local1.newLayer;
_local1.newLayer = -1;
};
}
public function set baseY(_arg1:Number):void{
if (_base.y != _arg1){
_base.y = _arg1;
setTransformChanged();
baseChanged = true;
};
}
function changeSkin(_arg1:SkinData):void{
if (readySkinDatas.has(_arg1)){
removeFromBoundMap(_arg1);
readySkinDatas.remove(_arg1);
};
_arg1.calculate();
_arg1.breakLinks();
changedSkinDatas.add(_arg1);
}
public function set baseZ(_arg1:Number):void{
if (_base.z != _arg1){
_base.z = _arg1;
setTransformChanged();
baseChanged = true;
};
}
public function set baseX(_arg1:Number):void{
if (_base.x != _arg1){
_base.x = _arg1;
setTransformChanged();
baseChanged = true;
};
}
public function panXZ(_arg1:Number, _arg2:Number):void{
var _local3:Point3D;
var _local4:Number;
calculateDirectionTransform();
if (directionTransformMatrix.g != 0){
_local3 = viewDirectionToGlobal(new Point3D(_arg1, _arg2, 0));
_local4 = (_local3.y / directionTransformMatrix.g);
_local3.x = (_local3.x - (directionTransformMatrix.c * _local4));
_local3.z = (_local3.z - (directionTransformMatrix.k * _local4));
_target.x = (_target.x + _local3.x);
_target.z = (_target.z + _local3.z);
targetChanged = true;
};
}
public function drawBoundMap(_arg1:Boolean=false):void{
var _local3:int;
var _local4:TextField;
if (boundMapGfx != null){
removeChild(boundMapGfx);
boundMapGfx = null;
};
boundMapGfx = new Sprite();
boundMapGfx.x = canvas.x;
boundMapGfx.y = canvas.y;
boundMapGfx.mouseEnabled = false;
boundMapGfx.mouseChildren = false;
boundMapGfx.tabEnabled = false;
boundMapGfx.tabChildren = false;
addChildAt(boundMapGfx, 0);
var _local2:int;
while (_local2 <= (boundMapOffset * 2)) {
if (boundMap[_local2] != undefined){
_local3 = 0;
while (_local3 <= (boundMapOffset * 2)) {
if (boundMap[_local2][_local3] != undefined){
if ((((mouseBound.x == _local2)) && ((mouseBound.y == _local3)))){
boundMapGfx.graphics.beginFill(16764108, (Set(boundMap[_local2][_local3]).length / 10));
} else {
boundMapGfx.graphics.beginFill(0xFFFFFF, (Set(boundMap[_local2][_local3]).length / 10));
};
boundMapGfx.graphics.drawRect(((_local2 - boundMapOffset) * boundMapSize), ((_local3 - boundMapOffset) * boundMapSize), boundMapSize, boundMapSize);
boundMapGfx.graphics.lineStyle();
if (_arg1){
_local4 = new TextField();
_local4.width = boundMapSize;
_local4.x = ((_local2 - boundMapOffset) * boundMapSize);
_local4.y = ((((_local3 - boundMapOffset) + 0.5) * boundMapSize) - 8);
_local4.defaultTextFormat = new TextFormat("Tahoma", 10, 0x7F7F7F, null, null, null, null, null, TextFormatAlign.CENTER);
_local4.text = ((_local2 + ", ") + _local3);
boundMapGfx.addChild(_local4);
};
};
_local3++;
};
};
_local2++;
};
}
public function panXY(_arg1:Number, _arg2:Number):void{
var _local3:Point3D;
var _local4:Number;
calculateDirectionTransform();
if (directionTransformMatrix.k != 0){
_local3 = viewDirectionToGlobal(new Point3D(_arg1, _arg2, 0));
_local4 = (_local3.z / directionTransformMatrix.k);
_local3.x = (_local3.x - (directionTransformMatrix.c * _local4));
_local3.y = (_local3.y - (directionTransformMatrix.g * _local4));
_target.x = (_target.x + _local3.x);
_target.y = (_target.y + _local3.y);
targetChanged = true;
};
}
override public function set height(_arg1:Number):void{
if (_arg1 != _height){
_height = _arg1;
hitArea.height = _height;
canvas.y = ((_height / 2) + canvasCoords.y);
if (crop){
scrollRect = new Rectangle(0, 0, width, _height);
};
};
}
private function boundSkinCompares(_arg1:SkinData):void{
var _local2:Set;
var _local3:Set;
var _local5:int;
var _local6:SkinData;
compareSkinDatas = new Set(true);
var _local4:int = _arg1.boundMapLeft;
while (_local4 <= _arg1.boundMapRight) {
if (boundMap[_local4] != undefined){
_local5 = _arg1.boundMapTop;
while (_local5 <= _arg1.boundMapBottom) {
if (boundMap[_local4][_local5] != undefined){
_local3 = boundMap[_local4][_local5];
for each (_local6 in _local3) {
compareSkinDatas.add(_local6);
};
};
_local5++;
};
};
_local4++;
};
}
private function removeFromBoundMap(_arg1:SkinData):void{
var _local2:Set;
var _local4:int;
var _local3:int = _arg1.boundMapLeft;
while (_local3 <= _arg1.boundMapRight) {
if (boundMap[_local3] != undefined){
_local4 = _arg1.boundMapTop;
while (_local4 <= _arg1.boundMapBottom) {
if (boundMap[_local3][_local4] != undefined){
_local2 = boundMap[_local3][_local4];
_local2.remove(_arg1);
if (_local2.isEmpty()){
delete boundMap[_local3][_local4];
if (boundMap[_local3].length == 0){
delete boundMap[_local3];
break;
};
};
};
_local4++;
};
};
_local3++;
};
}
public function set roll(_arg1:Number):void{
if (_roll != _arg1){
_roll = _arg1;
setTransformChanged();
directionChanged = true;
};
}
private function sendInteraction(_arg1:uint, _arg2:SkinData=null):void{
if (_arg2 == null){
mouseSkinData.renderer.interaction(_arg1, mouseSkinData, mouseCoords, mouseDown, ctrlKey, altKey, shiftKey);
} else {
_arg2.renderer.interaction(_arg1, _arg2, mouseCoords, mouseDown, ctrlKey, altKey, shiftKey);
};
}
public function viewDirectionToGlobal(_arg1:Point3D):Point3D{
calculateDirectionTransform();
var _local2:Point3D = _arg1.clone();
_local2.transform(directionTransformMatrix);
return (_local2);
}
public function drawLayersShift():void{
var _local2:DisplayObject;
var _local1:uint = canvas.numChildren;
var _local3:uint;
while (_local3 < _local1) {
_local2 = canvas.getChildAt(_local3);
_local2.filters = [new DropShadowFilter(10, 45, 0, 1, 10, 10, 0.5, 2)];
_local2.x = (_local3 * 20);
_local2.y = (_local3 * 20);
_local3++;
};
}
public function set pitch(_arg1:Number):void{
if (_pitch != _arg1){
_pitch = _arg1;
setTransformChanged();
directionChanged = true;
};
}
public function get roll():Number{
return (_roll);
}
public function set object(_arg1:Object3D):void{
if (_object != _arg1){
if (_object != null){
object.setView(null);
};
if (_arg1 != null){
if (((!((_arg1._view == null))) && ((_arg1 === _arg1._view.object)))){
_arg1._view.object = null;
} else {
if (_arg1._parent != null){
_arg1._parent.detach(_arg1);
};
};
_arg1.setView(this);
};
_object = _arg1;
objectChanged = true;
};
}
public function get yaw():Number{
return (_yaw);
}
public function panYZ(_arg1:Number, _arg2:Number):void{
var _local3:Point3D;
var _local4:Number;
calculateDirectionTransform();
if (directionTransformMatrix.c != 0){
_local3 = viewDirectionToGlobal(new Point3D(_arg1, _arg2, 0));
_local4 = (_local3.x / directionTransformMatrix.c);
_local3.y = (_local3.y - (directionTransformMatrix.g * _local4));
_local3.z = (_local3.z - (directionTransformMatrix.k * _local4));
_target.y = (_target.y + _local3.y);
_target.z = (_target.z + _local3.z);
targetChanged = true;
};
}
public function get crop():Boolean{
return (_crop);
}
public function get target():Point3D{
return (_target.clone());
}
public function set base(_arg1:Point3D):void{
if (!_base.equals(_arg1)){
_base.copy(_arg1);
setTransformChanged();
baseChanged = true;
};
}
override public function set width(_arg1:Number):void{
if (_arg1 != _width){
_width = _arg1;
hitArea.width = _width;
canvas.x = ((_width / 2) + canvasCoords.x);
if (crop){
scrollRect = new Rectangle(0, 0, _width, height);
};
};
}
public function render():void{
var _local1:Matrix3D;
var _local2:uint;
var _local3:uint;
if (object != null){
if (((((baseChanged) || (directionChanged))) || (zoomChanged))){
transformMatrix = Matrix3D.inverseTransformationMatrix(_base.x, _base.y, _base.z, _pitch, _roll, _yaw, _zoom, _zoom, _zoom);
transformMatrix.convertToScreen();
inverseTransformCalculated = false;
directionTransformCalculated = false;
};
if (((((((targetChanged) || (baseChanged))) || (directionChanged))) || (zoomChanged))){
canvasCoords = new Point3D(-(_target.x), -(_target.y), -(_target.z));
_local1 = Matrix3D.inverseTransformationMatrix(-(_base.x), -(_base.y), -(_base.z), _pitch, _roll, _yaw, _zoom, _zoom, _zoom);
_local1.convertToScreen();
canvasCoords.transform(_local1);
canvas.x = ((_width / 2) + canvasCoords.x);
canvas.y = ((_height / 2) + canvasCoords.y);
};
if (!_hold){
object.calculate();
object.render();
object.drop();
_local2 = readySkinDatas.length;
_local3 = changedSkinDatas.length;
FPS.addSkins((_local2 + _local3), _local3);
deleteSkins();
calculateSkins();
};
drop();
} else {
if (objectChanged){
deleteSkins();
FPS.addSkins(0, 0);
};
};
}
public function set zoom(_arg1:Number):void{
var _local2:Number = (1 / _arg1);
if (_zoom != _local2){
_zoom = _local2;
setTransformChanged();
zoomChanged = true;
};
}
public function get baseX():Number{
return (_base.x);
}
public function get baseY():Number{
return (_base.y);
}
public function get baseZ():Number{
return (_base.z);
}
private function deleteSkins():void{
var _local1:SkinData;
var _local2:int;
if (!deletedSkinDatas.isEmpty()){
for each (_local1 in deletedSkinDatas) {
if (_local1.layer >= 0){
canvas.removeChild(_local1.skin);
_local2 = _local1.layer;
while (_local2 < layerIndexes.length) {
if (layerIndexes[_local2] != undefined){
var _local5 = layerIndexes;
var _local6 = _local2;
var _local7 = (_local5[_local6] - 1);
_local5[_local6] = _local7;
};
_local2++;
};
checkLayer(_local1.layer);
_local1.layer = -1;
};
};
deletedSkinDatas = new Set(true);
};
}
public function pan(_arg1:Number, _arg2:Number):void{
var _local3:Point3D = viewDirectionToGlobal(new Point3D(_arg1, _arg2, 0));
_target.add(_local3);
targetChanged = true;
}
public function drawLayers():void{
var _local1:uint = canvas.numChildren;
var _local2:uint;
while (_local2 < _local1) {
canvas.getChildAt(_local2).transform.colorTransform = new ColorTransform(0, 0, 0, 1, ((_local2 * 20) + 50), ((_local2 * 20) + 50), ((_local2 * 20) + 50));
_local2++;
};
}
public function drawSkinDatas(_arg1:Boolean=true, _arg2:Boolean=false, _arg3:Boolean=false):void{
var data:*;
var i:*;
var a:*;
var b:*;
var c:*;
var center:*;
var matrix:*;
var infrontData:*;
var infrontCenter:*;
var length:*;
var drawGeometry = _arg1;
var drawDependencies = _arg2;
var drawBounds = _arg3;
var getSkinDataCenter:Function = function (_arg1:SkinData):Point3D{
var _local2:Point3D = new Point3D();
var _local3:uint;
while (_local3 < _arg1.length) {
_local2.add(_arg1.points[_local3]);
_local3++;
};
_local2.multiply((1 / _arg1.length));
return (_local2);
};
if (helperGfx != null){
removeChild(helperGfx);
helperGfx = null;
};
helperGfx = new Shape();
helperGfx.x = canvas.x;
helperGfx.y = canvas.y;
addChild(helperGfx);
var _local5 = helperGfx.graphics;
with (_local5) {
clear();
for each (data in readySkinDatas) {
if (drawBounds){
lineStyle(1, 0x666666);
drawRect(data.boundLeft, data.boundTop, (data.boundRight - data.boundLeft), (data.boundBottom - data.boundTop));
};
if (drawGeometry){
lineStyle(1, 0xFF);
if (data.length > 2){
i = 0;
while (i < data.length) {
if (!MathUtility.equals(data.points[i].z, (-((((data.planeA * data.points[i].x) + (data.planeB * data.points[i].y)) + data.planeD)) / data.planeC), 0.1)){
lineStyle(1, 0xFFFF00);
break;
};
i++;
};
a = data.points[0];
b = data.points[1];
c = data.points[2];
if ((((b.x - a.x) * (c.y - a.y)) - ((b.y - a.y) * (c.x - a.x))) >= 0){
lineStyle(1, 0xFF0000);
};
};
moveTo(data.points[(data.length - 1)].x, data.points[(data.length - 1)].y);
i = 0;
while (i < data.length) {
lineTo(data.points[i].x, data.points[i].y);
i++;
};
};
if (drawDependencies){
center = getSkinDataCenter(data);
matrix = new Matrix();
for each (infrontData in data.infront) {
infrontCenter = getSkinDataCenter(infrontData);
length = Point.distance(new Point(center.x, center.y), new Point(infrontCenter.x, infrontCenter.y));
matrix.createGradientBox((length + length), (length + length), 0, (center.x - length), (center.y - length));
lineStyle(2);
lineGradientStyle(GradientType.RADIAL, [0xFFFFFF, 0xFFFFFF], [0, 1], [0, 0xFF], matrix);
moveTo(center.x, center.y);
lineTo(infrontCenter.x, infrontCenter.y);
};
};
};
};
}
private function calculateInverseTransform():void{
if (!inverseTransformCalculated){
inverseTransformMatrix = Matrix3D.transformationMatrix(_base.x, _base.y, _base.z, _pitch, _roll, _yaw, _zoom, _zoom, _zoom);
inverseTransformMatrix.inverseConvertToScreen();
inverseTransformCalculated = true;
};
}
private function calculateDirectionTransform():void{
if (!directionTransformCalculated){
directionTransformMatrix = Matrix3D.transformationMatrix(0, 0, 0, _pitch, _roll, _yaw, _zoom, _zoom, _zoom);
directionTransformMatrix.inverseConvertToScreen();
directionTransformCalculated = true;
};
}
private function onMouseAdd(_arg1:Event):void{
calculateMouse();
stage.addEventListener(KeyboardEvent.KEY_DOWN, onKey);
stage.addEventListener(KeyboardEvent.KEY_UP, onKey);
}
private function calculateMouseSkinData():void{
var _local1:SkinData;
var _local2:Array;
var _local3:uint;
var _local4:Object3D;
var _local5:Number;
var _local6:uint;
mouseSkinData = null;
if (((!((boundMap[mouseBound.x] == undefined))) && (!((boundMap[mouseBound.x][mouseBound.y] == undefined))))){
_local2 = new Array();
for each (_local1 in Set(boundMap[mouseBound.x][mouseBound.y])) {
_local2.push(_local1);
};
_local2.sortOn("layer", (Array.NUMERIC | Array.DESCENDING));
_local3 = _local2.length;
_local5 = -(Number.MAX_VALUE);
_local6 = 0;
while (_local6 < _local3) {
_local1 = _local2[_local6];
_local1.calculateInteractionCoords(mouseCoords);
if (((!(isNaN(mouseCoords.z))) && ((mouseCoords.z > _local5)))){
mouseSkinData = _local1;
_local5 = mouseCoords.z;
};
if (((((!((mouseSkinData == null))) && ((_local6 < (_local3 - 1))))) && (!((SkinData(_local2[(_local6 + 1)]).layer == _local1.layer))))){
break;
};
_local6++;
};
if (mouseSkinData != null){
mouseCoords.z = _local5;
};
};
}
private function onMouseDown(_arg1:MouseEvent):void{
if (mouseSkinData != null){
sendInteraction(Interaction.DOWN);
};
pressedSkinData = mouseSkinData;
mouseDown = true;
}
private function calculateSkins():void{
var _local1:int;
var _local2:Boolean;
var _local3:SkinData;
var _local4:SkinData;
var _local5:Set;
var _local6:int;
var _local7:int;
if (!changedSkinDatas.isEmpty()){
_local2 = false;
for each (_local3 in changedSkinDatas) {
boundSkinCompares(_local3);
for each (_local4 in compareSkinDatas) {
_local1 = _local3.compare(_local4);
if (_local1 != SkinData.NOINTERSECTION){
if (_local1 == SkinData.BEHIND){
_local3.linkBehind(_local4);
} else {
_local3.linkInfront(_local4);
};
};
};
_local6 = _local3.boundMapLeft;
while (_local6 <= _local3.boundMapRight) {
if (boundMap[_local6] == undefined){
boundMap[_local6] = new Array();
};
_local7 = _local3.boundMapTop;
while (_local7 <= _local3.boundMapBottom) {
if (boundMap[_local6][_local7] == undefined){
boundMap[_local6][_local7] = new Set(true);
};
_local5 = boundMap[_local6][_local7];
_local5.add(_local3);
if ((((_local6 == mouseBound.x)) && ((_local7 == mouseBound.y)))){
_local2 = true;
};
_local7++;
};
_local6++;
};
if ((((((((mouseBound.x >= _local3.boundMapLeft)) && ((mouseBound.x <= _local3.boundMapRight)))) && ((mouseBound.y >= _local3.boundMapTop)))) && ((mouseBound.y <= _local3.boundMapBottom)))){
_local2 = true;
};
readySkinDatas.add(_local3);
};
changedSkinDatas = new Set(true);
arrangeSkins();
if (_local2){
onMouseSkinData();
};
};
}
public function get base():Point3D{
return (_base.clone());
}
public function set targetZ(_arg1:Number):void{
if (_target.z != _arg1){
_target.z = _arg1;
targetChanged = true;
};
}
public function get zoom():Number{
return ((1 / _zoom));
}
public function hold():void{
_hold = true;
canvas.cacheAsBitmap = true;
}
public function unhold():void{
_hold = false;
canvas.cacheAsBitmap = false;
}
public function set targetX(_arg1:Number):void{
if (_target.x != _arg1){
_target.x = _arg1;
targetChanged = true;
};
}
private function calculateMouse():void{
var _local1:Point = MouseUtility.localCoords(canvas);
mouseCoords = new Point3D(_local1.x, _local1.y, NaN);
mouseBound = new Point(int(((mouseCoords.x / boundMapSize) + boundMapOffset)), int(((mouseCoords.y / boundMapSize) + boundMapOffset)));
calculateMouseSkinData();
}
public function get targetZ():Number{
return (_target.z);
}
private function onMouseSkinData():void{
calculateMouseSkinData();
onMouseOverOut();
}
public function get targetX():Number{
return (_target.x);
}
private function calculateSkinDataLayers():void{
var _local1:SkinData;
var _local4:uint;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local2:Set = new Set(true);
var _local3:Set = new Set(true);
for each (_local1 in readySkinDatas) {
if (_local1.behind.isEmpty()){
_local3.add(_local1);
};
};
_local4 = 0;
do {
_local5 = new Set(true);
for each (_local1 in _local3) {
_local1.newLayer = _local4;
_local2.add(_local1);
for each (_local6 in _local1.infront) {
_local5.add(_local6);
};
};
_local3 = new Set(true);
for each (_local1 in _local5) {
_local7 = true;
for each (_local8 in _local1.behind) {
if (!_local2.has(_local8)){
_local7 = false;
break;
};
};
if (_local7){
_local3.add(_local1);
};
};
_local4++;
} while (!(_local3.isEmpty()));
}
public function set targetY(_arg1:Number):void{
if (_target.y != _arg1){
_target.y = _arg1;
targetChanged = true;
};
}
override public function get width():Number{
return (_width);
}
private function drop():void{
baseChanged = false;
targetChanged = false;
directionChanged = false;
zoomChanged = false;
objectChanged = false;
}
private function onMouseMove(_arg1:MouseEvent):void{
calculateMouse();
onMouseOverOut();
if (mouseSkinData != null){
sendInteraction(Interaction.MOVE);
};
}
private function onMouseOverOut():void{
if (mouseSkinData != overedSkinData){
if (overedSkinData != null){
sendInteraction(Interaction.SKIN_OUT, overedSkinData);
if (mouseSkinData != null){
if (mouseSkinData.renderer != overedSkinData.renderer){
sendInteraction(Interaction.RENDERER_OUT, overedSkinData);
if (mouseSkinData.renderer.object != overedSkinData.renderer.object){
sendInteraction(Interaction.OBJECT_OUT, overedSkinData);
};
};
} else {
sendInteraction(Interaction.RENDERER_OUT, overedSkinData);
sendInteraction(Interaction.OBJECT_OUT, overedSkinData);
};
};
if (mouseSkinData != null){
sendInteraction(Interaction.SKIN_OVER);
if (overedSkinData != null){
if (mouseSkinData.renderer != overedSkinData.renderer){
sendInteraction(Interaction.RENDERER_OVER);
if (mouseSkinData.renderer.object != overedSkinData.renderer.object){
sendInteraction(Interaction.OBJECT_OVER);
};
};
} else {
sendInteraction(Interaction.RENDERER_OVER);
sendInteraction(Interaction.OBJECT_OVER);
};
};
};
overedSkinData = mouseSkinData;
}
}
}//package com.alternativagame.engine3d
Section 37
//WireRenderer (com.alternativagame.engine3d.WireRenderer)
package com.alternativagame.engine3d {
import com.alternativagame.type.*;
import flash.utils.*;
import com.alternativagame.engine3d.skin.*;
public class WireRenderer extends SurfaceRenderer {
var colorChanged:Boolean;// = true
private var _alpha:Number;
var thicknessChanged:Boolean;// = true
private var _color:uint;
private var edges:Set;
private var _thickness:Number;
var alphaChanged:Boolean;// = true
private static var num:uint = 0;
public function WireRenderer(_arg1:Number=1, _arg2:RGB=null, _arg3:Number=1){
_thickness = _arg1;
_color = ((_arg2)==null) ? 0xFFFFFF : _arg2.toInt();
_alpha = _arg3;
edges = new Set(true);
}
public function set color(_arg1:RGB):void{
var _local2:uint = _arg1.toInt();
if (_color != _local2){
_color = _local2;
colorChanged = true;
};
}
override public function clear():void{
super.clear();
if (((!((_object == null))) && (!((_object._view == null))))){
edges = new Set(true);
};
}
override public function render():void{
var _local1:SkinData;
var _local2:WireSkin;
var _local3:Face;
var _local4:Vertex;
var _local5:Vertex;
var _local6:uint;
var _local7:uint;
var _local8:Boolean;
var _local9:Edge;
var _local10:Dictionary;
var _local11:Boolean;
var _local12:Boolean;
var _local13:Boolean;
var _local14:Boolean;
if (((((((_object.facesChanged) || (_object.viewChanged))) || (facesChanged))) || (objectChanged))){
updateFaces();
for each (_local9 in edges.clone()) {
for each (_local3 in _local9.faces.clone()) {
if (!_faces.has(_local3)){
_local9.faces.remove(_local3);
};
};
if (_local9.faces.isEmpty()){
edges.remove(_local9);
};
};
for each (_local3 in _faces) {
_local7 = _local3._vertices.length;
_local6 = 0;
while (_local6 < _local7) {
_local4 = _local3._vertices[((_local6 == 0)) ? (_local7 - 1) : (_local6 - 1)];
_local5 = _local3._vertices[_local6];
_local8 = false;
for each (_local9 in edges) {
if ((((((_local9.a == _local4)) && ((_local9.b == _local5)))) || ((((_local9.a == _local5)) && ((_local9.b == _local4)))))){
_local8 = true;
_local9.faces.add(_local3);
break;
};
};
if (!_local8){
_local9 = new Edge();
_local9.a = _local4;
_local9.b = _local5;
_local9.faces.add(_local3);
edges.add(_local9);
};
_local6++;
};
};
_local10 = new Dictionary(true);
for each (_local9 in edges) {
if (datas[_local9] == undefined){
_local1 = new SkinData(this, 2);
_local1.skin = new WireSkin();
_local10[_local9] = _local1;
} else {
_local10[_local9] = datas[_local9];
delete datas[_local9];
};
};
for each (_local1 in datas) {
_object._view.removeSkin(_local1);
};
datas = _local10;
};
if (((((((((((_object.transformChanged) || (Mesh(_object).geometryChanged))) || (_object.parentChanged))) || (_object.viewChanged))) || (facesChanged))) || (objectChanged))){
for each (_local3 in _faces) {
_local3.calculateVisible();
};
};
for each (_local9 in edges) {
_local1 = datas[_local9];
_local2 = WireSkin(_local1.skin);
_local11 = false;
_local12 = false;
_local13 = true;
_local14 = true;
for each (_local3 in _local9.faces) {
_local12 = ((_local12) || (_local3.visible));
_local11 = ((_local11) || (_local3.visibleChanged));
_local13 = ((_local13) && (_local3.coordsChanged));
_local14 = ((_local14) && (_local3.transformChanged));
};
if (((_local11) && (!(_local12)))){
_object._view.removeSkin(_local1);
};
if (_local12){
if (((((((((_local13) || (_local14))) || (_local11))) || (_object.viewChanged))) || (objectChanged))){
_local1.points[0] = _local9.a.canvasCoords;
_local1.points[1] = _local9.b.canvasCoords;
_object._view.changeSkin(_local1);
};
if (((((((((((((((((_local13) || (_local14))) || (_local11))) || (_object.viewChanged))) || (thicknessChanged))) || (alphaChanged))) || (colorChanged))) || (_object._view.zoomChanged))) || (objectChanged))){
_local2.draw((_thickness * _object._view.zoom), _color, _alpha, _local1.points[0].x, _local1.points[0].y, _local1.points[1].x, _local1.points[1].y);
};
};
};
}
public function get alpha():Number{
return (_alpha);
}
public function get color():RGB{
return (new RGB(_color));
}
public function set thickness(_arg1:Number):void{
if (_thickness != _arg1){
_thickness = _arg1;
thicknessChanged = true;
};
}
override public function drop():void{
super.drop();
thicknessChanged = false;
alphaChanged = false;
colorChanged = false;
}
public function get thickness():Number{
return (_thickness);
}
override public function checkInteraction(_arg1:SkinData, _arg2:Point3D):Boolean{
return (false);
}
override protected function defaultName():String{
num++;
return (("wireRenderer" + num));
}
public function set alpha(_arg1:Number):void{
if (_alpha != _arg1){
_alpha = _arg1;
alphaChanged = true;
};
}
override public function clone():IRenderer{
var _local1:WireRenderer = new WireRenderer(_thickness, new RGB(_color), _alpha);
return (_local1);
}
}
}//package com.alternativagame.engine3d
import com.alternativagame.type.*;
class Edge {
public var a:Vertex;
public var faces:Set;
public var b:Vertex;
private function Edge(){
faces = new Set(true);
}
}
Section 38
//AdminFrameGroupSkin (com.alternativagame.gui.admin.skin.container.group.AdminFrameGroupSkin)
package com.alternativagame.gui.admin.skin.container.group {
import flash.display.*;
import flash.text.*;
import com.alternativagame.gui.skin.container.group.*;
public class AdminFrameGroupSkin extends FrameGroupSkin {
private static const titleTextFormat:TextFormat = new TextFormat("Alternativa", 12, 0x666666);
private static const cornerTL:BitmapData = new bitmapTL().bitmapData;
private static const bitmapML:Class = AdminFrameGroupSkin_bitmapML;
private static const cornerTR:BitmapData = new bitmapTR().bitmapData;
private static const bitmapMR:Class = AdminFrameGroupSkin_bitmapMR;
private static const titleMarginRight:int = 10;
private static const titleThickness:Number = 50;
private static const edgeML:BitmapData = new bitmapML().bitmapData;
private static const borderThickness:int = 2;
private static const edgeMR:BitmapData = new bitmapMR().bitmapData;
private static const bitmapBC:Class = AdminFrameGroupSkin_bitmapBC;
private static const bitmapBL:Class = AdminFrameGroupSkin_bitmapBL;
private static const bitmapTCafter:Class = AdminFrameGroupSkin_bitmapTCafter;
private static const bitmapBR:Class = AdminFrameGroupSkin_bitmapBR;
private static const edgeBC:BitmapData = new bitmapBC().bitmapData;
private static const titleSharpness:Number = 50;
private static const titleMarginLeft:int = 10;
private static const bitmapTCbefore:Class = AdminFrameGroupSkin_bitmapTCbefore;
private static const bitmapTC:Class = AdminFrameGroupSkin_bitmapTC;
private static const cornerBL:BitmapData = new bitmapBL().bitmapData;
private static const cornerBR:BitmapData = new bitmapBR().bitmapData;
private static const bitmapTL:Class = AdminFrameGroupSkin_bitmapTL;
private static const edgeTCbefore:BitmapData = new bitmapTCbefore().bitmapData;
private static const edgeTC:BitmapData = new bitmapTC().bitmapData;
private static const bitmapTR:Class = AdminFrameGroupSkin_bitmapTR;
private static const edgeTCafter:BitmapData = new bitmapTCafter().bitmapData;
public function AdminFrameGroupSkin(){
super(AdminFrameGroupSkin.cornerTL, AdminFrameGroupSkin.cornerTR, AdminFrameGroupSkin.cornerBL, AdminFrameGroupSkin.cornerBR, AdminFrameGroupSkin.edgeTC, AdminFrameGroupSkin.edgeTCbefore, AdminFrameGroupSkin.edgeTCafter, AdminFrameGroupSkin.edgeML, AdminFrameGroupSkin.edgeMR, AdminFrameGroupSkin.edgeBC, AdminFrameGroupSkin.borderThickness, AdminFrameGroupSkin.titleMarginLeft, AdminFrameGroupSkin.titleMarginRight, AdminFrameGroupSkin.titleTextFormat, AdminFrameGroupSkin.titleSharpness, AdminFrameGroupSkin.titleThickness);
}
}
}//package com.alternativagame.gui.admin.skin.container.group
Section 39
//AdminFrameGroupSkin_bitmapBC (com.alternativagame.gui.admin.skin.container.group.AdminFrameGroupSkin_bitmapBC)
package com.alternativagame.gui.admin.skin.container.group {
import mx.core.*;
public class AdminFrameGroupSkin_bitmapBC extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.container.group
Section 40
//AdminFrameGroupSkin_bitmapBL (com.alternativagame.gui.admin.skin.container.group.AdminFrameGroupSkin_bitmapBL)
package com.alternativagame.gui.admin.skin.container.group {
import mx.core.*;
public class AdminFrameGroupSkin_bitmapBL extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.container.group
Section 41
//AdminFrameGroupSkin_bitmapBR (com.alternativagame.gui.admin.skin.container.group.AdminFrameGroupSkin_bitmapBR)
package com.alternativagame.gui.admin.skin.container.group {
import mx.core.*;
public class AdminFrameGroupSkin_bitmapBR extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.container.group
Section 42
//AdminFrameGroupSkin_bitmapML (com.alternativagame.gui.admin.skin.container.group.AdminFrameGroupSkin_bitmapML)
package com.alternativagame.gui.admin.skin.container.group {
import mx.core.*;
public class AdminFrameGroupSkin_bitmapML extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.container.group
Section 43
//AdminFrameGroupSkin_bitmapMR (com.alternativagame.gui.admin.skin.container.group.AdminFrameGroupSkin_bitmapMR)
package com.alternativagame.gui.admin.skin.container.group {
import mx.core.*;
public class AdminFrameGroupSkin_bitmapMR extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.container.group
Section 44
//AdminFrameGroupSkin_bitmapTC (com.alternativagame.gui.admin.skin.container.group.AdminFrameGroupSkin_bitmapTC)
package com.alternativagame.gui.admin.skin.container.group {
import mx.core.*;
public class AdminFrameGroupSkin_bitmapTC extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.container.group
Section 45
//AdminFrameGroupSkin_bitmapTCafter (com.alternativagame.gui.admin.skin.container.group.AdminFrameGroupSkin_bitmapTCafter)
package com.alternativagame.gui.admin.skin.container.group {
import mx.core.*;
public class AdminFrameGroupSkin_bitmapTCafter extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.container.group
Section 46
//AdminFrameGroupSkin_bitmapTCbefore (com.alternativagame.gui.admin.skin.container.group.AdminFrameGroupSkin_bitmapTCbefore)
package com.alternativagame.gui.admin.skin.container.group {
import mx.core.*;
public class AdminFrameGroupSkin_bitmapTCbefore extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.container.group
Section 47
//AdminFrameGroupSkin_bitmapTL (com.alternativagame.gui.admin.skin.container.group.AdminFrameGroupSkin_bitmapTL)
package com.alternativagame.gui.admin.skin.container.group {
import mx.core.*;
public class AdminFrameGroupSkin_bitmapTL extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.container.group
Section 48
//AdminFrameGroupSkin_bitmapTR (com.alternativagame.gui.admin.skin.container.group.AdminFrameGroupSkin_bitmapTR)
package com.alternativagame.gui.admin.skin.container.group {
import mx.core.*;
public class AdminFrameGroupSkin_bitmapTR extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.container.group
Section 49
//AdminGroupSkin (com.alternativagame.gui.admin.skin.container.group.AdminGroupSkin)
package com.alternativagame.gui.admin.skin.container.group {
import flash.display.*;
import com.alternativagame.gui.skin.container.group.*;
public class AdminGroupSkin extends GroupSkin {
private static const yNormal:int = 0;
private static const nr:BitmapData = new bitmapNR().bitmapData;
private static const yPress:int = 2;
private static const titleMarginLeft:int = 6;
private static const contentMarginTop:int = 4;
private static const contentMarginBottom:int = 4;
private static const contentMarginRight:int = 4;
private static const titleMarginTop:int = 0;
private static const titleMarginRight:int = 6;
private static const bitmapNC:Class = AdminGroupSkin_bitmapNC;
private static const bitmapNL:Class = AdminGroupSkin_bitmapNL;
private static const contentMarginLeft:int = 4;
private static const titleMarginBottom:int = 2;
private static const bitmapNR:Class = AdminGroupSkin_bitmapNR;
private static const nc:BitmapData = new bitmapNC().bitmapData;
private static const nl:BitmapData = new bitmapNL().bitmapData;
public function AdminGroupSkin(){
super(AdminGroupSkin.nl, AdminGroupSkin.nc, AdminGroupSkin.nr, AdminGroupSkin.yNormal, AdminGroupSkin.yPress, AdminGroupSkin.titleMarginTop, AdminGroupSkin.titleMarginBottom, AdminGroupSkin.titleMarginLeft, AdminGroupSkin.titleMarginRight, AdminGroupSkin.contentMarginTop, AdminGroupSkin.contentMarginBottom, AdminGroupSkin.contentMarginLeft, AdminGroupSkin.contentMarginRight);
}
}
}//package com.alternativagame.gui.admin.skin.container.group
Section 50
//AdminGroupSkin_bitmapNC (com.alternativagame.gui.admin.skin.container.group.AdminGroupSkin_bitmapNC)
package com.alternativagame.gui.admin.skin.container.group {
import mx.core.*;
public class AdminGroupSkin_bitmapNC extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.container.group
Section 51
//AdminGroupSkin_bitmapNL (com.alternativagame.gui.admin.skin.container.group.AdminGroupSkin_bitmapNL)
package com.alternativagame.gui.admin.skin.container.group {
import mx.core.*;
public class AdminGroupSkin_bitmapNL extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.container.group
Section 52
//AdminGroupSkin_bitmapNR (com.alternativagame.gui.admin.skin.container.group.AdminGroupSkin_bitmapNR)
package com.alternativagame.gui.admin.skin.container.group {
import mx.core.*;
public class AdminGroupSkin_bitmapNR extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.container.group
Section 53
//AdminButtonSkin (com.alternativagame.gui.admin.skin.widget.button.AdminButtonSkin)
package com.alternativagame.gui.admin.skin.widget.button {
import flash.geom.*;
import flash.display.*;
import flash.text.*;
import com.alternativagame.gui.skin.widget.button.*;
public class AdminButtonSkin extends ButtonSkin {
private static const ll:BitmapData = new bitmapNL().bitmapData;
private static const pr:BitmapData = new bitmapPR().bitmapData;
private static const lr:BitmapData = new bitmapNR().bitmapData;
private static const textSharpness:Number = -50;
private static const space:int = 3;
private static const tfLocked:TextFormat = new TextFormat("Alternativa", 12, 0x666666);
private static const bitmapNC:Class = AdminButtonSkin_bitmapNC;
private static const colorNormal:ColorTransform = new ColorTransform();
private static const bitmapNL:Class = AdminButtonSkin_bitmapNL;
private static const bitmapNR:Class = AdminButtonSkin_bitmapNR;
private static const nc:BitmapData = new bitmapNC().bitmapData;
private static const margin:int = 6;
private static const nl:BitmapData = new bitmapNL().bitmapData;
private static const colorPressed:ColorTransform = new ColorTransform();
private static const bitmapOC:Class = AdminButtonSkin_bitmapOC;
private static const textThickness:Number = 50;
private static const nr:BitmapData = new bitmapNR().bitmapData;
private static const bitmapOL:Class = AdminButtonSkin_bitmapOL;
private static const colorLocked:ColorTransform = new ColorTransform(0.5, 0.5, 0.5, 1, 100, 100, 100, 0);
private static const tfPressed:TextFormat = new TextFormat("Alternativa", 12, 26400);
private static const bitmapOR:Class = AdminButtonSkin_bitmapOR;
private static const oc:BitmapData = new bitmapOC().bitmapData;
private static const colorOver:ColorTransform = new ColorTransform();
private static const yPressShift:int = 1;
private static const ol:BitmapData = new bitmapOL().bitmapData;
private static const bitmapPC:Class = AdminButtonSkin_bitmapPC;
private static const or:BitmapData = new bitmapOR().bitmapData;
private static const bitmapPL:Class = AdminButtonSkin_bitmapPL;
private static const bitmapPR:Class = AdminButtonSkin_bitmapPR;
private static const pc:BitmapData = new bitmapPC().bitmapData;
private static const tfOver:TextFormat = new TextFormat("Alternativa", 12, 0);
private static const lc:BitmapData = new bitmapNC().bitmapData;
private static const tfNormal:TextFormat = new TextFormat("Alternativa", 12, 0);
private static const pl:BitmapData = new bitmapPL().bitmapData;
public function AdminButtonSkin(){
super(AdminButtonSkin.nl, AdminButtonSkin.nc, AdminButtonSkin.nr, AdminButtonSkin.ol, AdminButtonSkin.oc, AdminButtonSkin.or, AdminButtonSkin.pl, AdminButtonSkin.pc, AdminButtonSkin.pr, AdminButtonSkin.ll, AdminButtonSkin.lc, AdminButtonSkin.lr, AdminButtonSkin.yPressShift, AdminButtonSkin.textThickness, AdminButtonSkin.textSharpness, AdminButtonSkin.tfNormal, AdminButtonSkin.tfOver, AdminButtonSkin.tfPressed, AdminButtonSkin.tfLocked, AdminButtonSkin.colorNormal, AdminButtonSkin.colorOver, AdminButtonSkin.colorPressed, AdminButtonSkin.colorLocked, AdminButtonSkin.margin, AdminButtonSkin.space);
}
}
}//package com.alternativagame.gui.admin.skin.widget.button
Section 54
//AdminButtonSkin_bitmapNC (com.alternativagame.gui.admin.skin.widget.button.AdminButtonSkin_bitmapNC)
package com.alternativagame.gui.admin.skin.widget.button {
import mx.core.*;
public class AdminButtonSkin_bitmapNC extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.button
Section 55
//AdminButtonSkin_bitmapNL (com.alternativagame.gui.admin.skin.widget.button.AdminButtonSkin_bitmapNL)
package com.alternativagame.gui.admin.skin.widget.button {
import mx.core.*;
public class AdminButtonSkin_bitmapNL extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.button
Section 56
//AdminButtonSkin_bitmapNR (com.alternativagame.gui.admin.skin.widget.button.AdminButtonSkin_bitmapNR)
package com.alternativagame.gui.admin.skin.widget.button {
import mx.core.*;
public class AdminButtonSkin_bitmapNR extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.button
Section 57
//AdminButtonSkin_bitmapOC (com.alternativagame.gui.admin.skin.widget.button.AdminButtonSkin_bitmapOC)
package com.alternativagame.gui.admin.skin.widget.button {
import mx.core.*;
public class AdminButtonSkin_bitmapOC extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.button
Section 58
//AdminButtonSkin_bitmapOL (com.alternativagame.gui.admin.skin.widget.button.AdminButtonSkin_bitmapOL)
package com.alternativagame.gui.admin.skin.widget.button {
import mx.core.*;
public class AdminButtonSkin_bitmapOL extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.button
Section 59
//AdminButtonSkin_bitmapOR (com.alternativagame.gui.admin.skin.widget.button.AdminButtonSkin_bitmapOR)
package com.alternativagame.gui.admin.skin.widget.button {
import mx.core.*;
public class AdminButtonSkin_bitmapOR extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.button
Section 60
//AdminButtonSkin_bitmapPC (com.alternativagame.gui.admin.skin.widget.button.AdminButtonSkin_bitmapPC)
package com.alternativagame.gui.admin.skin.widget.button {
import mx.core.*;
public class AdminButtonSkin_bitmapPC extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.button
Section 61
//AdminButtonSkin_bitmapPL (com.alternativagame.gui.admin.skin.widget.button.AdminButtonSkin_bitmapPL)
package com.alternativagame.gui.admin.skin.widget.button {
import mx.core.*;
public class AdminButtonSkin_bitmapPL extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.button
Section 62
//AdminButtonSkin_bitmapPR (com.alternativagame.gui.admin.skin.widget.button.AdminButtonSkin_bitmapPR)
package com.alternativagame.gui.admin.skin.widget.button {
import mx.core.*;
public class AdminButtonSkin_bitmapPR extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.button
Section 63
//AdminCheckBoxSkin (com.alternativagame.gui.admin.skin.widget.button.AdminCheckBoxSkin)
package com.alternativagame.gui.admin.skin.widget.button {
import flash.display.*;
import com.alternativagame.gui.skin.widget.button.*;
public class AdminCheckBoxSkin extends TriggerButtonSkin {
private static const bitmapUnselected:Class = AdminCheckBoxSkin_bitmapUnselected;
private static const lockedSelected:BitmapData = new bitmapLockedSelected().bitmapData;
private static const bitmapSelected:Class = AdminCheckBoxSkin_bitmapSelected;
private static const unselected:BitmapData = new bitmapUnselected().bitmapData;
private static const bitmapLockedUnselected:Class = AdminCheckBoxSkin_bitmapLockedUnselected;
private static const selected:BitmapData = new bitmapSelected().bitmapData;
private static const bitmapLockedSelected:Class = AdminCheckBoxSkin_bitmapLockedSelected;
private static const lockedUnselected:BitmapData = new bitmapLockedUnselected().bitmapData;
public function AdminCheckBoxSkin(){
super(AdminCheckBoxSkin.unselected, AdminCheckBoxSkin.selected, AdminCheckBoxSkin.lockedUnselected, AdminCheckBoxSkin.lockedSelected);
}
}
}//package com.alternativagame.gui.admin.skin.widget.button
Section 64
//AdminCheckBoxSkin_bitmapLockedSelected (com.alternativagame.gui.admin.skin.widget.button.AdminCheckBoxSkin_bitmapLockedSelected)
package com.alternativagame.gui.admin.skin.widget.button {
import mx.core.*;
public class AdminCheckBoxSkin_bitmapLockedSelected extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.button
Section 65
//AdminCheckBoxSkin_bitmapLockedUnselected (com.alternativagame.gui.admin.skin.widget.button.AdminCheckBoxSkin_bitmapLockedUnselected)
package com.alternativagame.gui.admin.skin.widget.button {
import mx.core.*;
public class AdminCheckBoxSkin_bitmapLockedUnselected extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.button
Section 66
//AdminCheckBoxSkin_bitmapSelected (com.alternativagame.gui.admin.skin.widget.button.AdminCheckBoxSkin_bitmapSelected)
package com.alternativagame.gui.admin.skin.widget.button {
import mx.core.*;
public class AdminCheckBoxSkin_bitmapSelected extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.button
Section 67
//AdminCheckBoxSkin_bitmapUnselected (com.alternativagame.gui.admin.skin.widget.button.AdminCheckBoxSkin_bitmapUnselected)
package com.alternativagame.gui.admin.skin.widget.button {
import mx.core.*;
public class AdminCheckBoxSkin_bitmapUnselected extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.button
Section 68
//AdminImageButtonSkin (com.alternativagame.gui.admin.skin.widget.button.AdminImageButtonSkin)
package com.alternativagame.gui.admin.skin.widget.button {
import flash.geom.*;
import com.alternativagame.gui.skin.widget.button.*;
public class AdminImageButtonSkin extends ImageButtonSkin {
private static const colorPress:ColorTransform = new ColorTransform();
private static const colorLock:ColorTransform = new ColorTransform(0.5, 0.5, 0.5, 1, 50, 50, 50, 0);
private static const colorOver:ColorTransform = new ColorTransform(1, 1, 1, 1, 30, 30, 30, 0);
private static const colorNormal:ColorTransform = new ColorTransform();
public function AdminImageButtonSkin(){
super(AdminImageButtonSkin.colorNormal, AdminImageButtonSkin.colorOver, AdminImageButtonSkin.colorPress, AdminImageButtonSkin.colorLock);
}
}
}//package com.alternativagame.gui.admin.skin.widget.button
Section 69
//AdminRadioButtonSkin (com.alternativagame.gui.admin.skin.widget.button.AdminRadioButtonSkin)
package com.alternativagame.gui.admin.skin.widget.button {
import flash.display.*;
import com.alternativagame.gui.skin.widget.button.*;
public class AdminRadioButtonSkin extends TriggerButtonSkin {
private static const bitmapUnselected:Class = AdminRadioButtonSkin_bitmapUnselected;
private static const lockedSelected:BitmapData = new bitmapLockedSelected().bitmapData;
private static const bitmapSelected:Class = AdminRadioButtonSkin_bitmapSelected;
private static const unselected:BitmapData = new bitmapUnselected().bitmapData;
private static const bitmapLockedUnselected:Class = AdminRadioButtonSkin_bitmapLockedUnselected;
private static const selected:BitmapData = new bitmapSelected().bitmapData;
private static const bitmapLockedSelected:Class = AdminRadioButtonSkin_bitmapLockedSelected;
private static const lockedUnselected:BitmapData = new bitmapLockedUnselected().bitmapData;
public function AdminRadioButtonSkin(){
super(AdminRadioButtonSkin.unselected, AdminRadioButtonSkin.selected, AdminRadioButtonSkin.lockedUnselected, AdminRadioButtonSkin.lockedSelected);
}
}
}//package com.alternativagame.gui.admin.skin.widget.button
Section 70
//AdminRadioButtonSkin_bitmapLockedSelected (com.alternativagame.gui.admin.skin.widget.button.AdminRadioButtonSkin_bitmapLockedSelected)
package com.alternativagame.gui.admin.skin.widget.button {
import mx.core.*;
public class AdminRadioButtonSkin_bitmapLockedSelected extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.button
Section 71
//AdminRadioButtonSkin_bitmapLockedUnselected (com.alternativagame.gui.admin.skin.widget.button.AdminRadioButtonSkin_bitmapLockedUnselected)
package com.alternativagame.gui.admin.skin.widget.button {
import mx.core.*;
public class AdminRadioButtonSkin_bitmapLockedUnselected extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.button
Section 72
//AdminRadioButtonSkin_bitmapSelected (com.alternativagame.gui.admin.skin.widget.button.AdminRadioButtonSkin_bitmapSelected)
package com.alternativagame.gui.admin.skin.widget.button {
import mx.core.*;
public class AdminRadioButtonSkin_bitmapSelected extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.button
Section 73
//AdminRadioButtonSkin_bitmapUnselected (com.alternativagame.gui.admin.skin.widget.button.AdminRadioButtonSkin_bitmapUnselected)
package com.alternativagame.gui.admin.skin.widget.button {
import mx.core.*;
public class AdminRadioButtonSkin_bitmapUnselected extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.button
Section 74
//AdminSliderSkin (com.alternativagame.gui.admin.skin.widget.button.AdminSliderSkin)
package com.alternativagame.gui.admin.skin.widget.button {
import flash.display.*;
import com.alternativagame.gui.skin.widget.button.*;
public class AdminSliderSkin extends SliderSkin {
private static const bitmapTrackRight:Class = AdminSliderSkin_bitmapTrackRight;
private static const bitmapTrackLeft:Class = AdminSliderSkin_bitmapTrackLeft;
private static const borderThickness:int = 2;
private static const tickMargin:int = 2;
private static const bitmapTick:Class = AdminSliderSkin_bitmapTick;
private static const trackCenter:BitmapData = new bitmapTrackCenter().bitmapData;
private static const runner:BitmapData = new bitmapRunner().bitmapData;
private static const bitmapTrackCenter:Class = AdminSliderSkin_bitmapTrackCenter;
private static const trackLeft:BitmapData = new bitmapTrackLeft().bitmapData;
private static const trackRight:BitmapData = new bitmapTrackRight().bitmapData;
private static const tick:BitmapData = new bitmapTick().bitmapData;
private static const bitmapRunner:Class = AdminSliderSkin_bitmapRunner;
public function AdminSliderSkin(){
super(AdminSliderSkin.trackLeft, AdminSliderSkin.trackCenter, AdminSliderSkin.trackRight, AdminSliderSkin.runner, AdminSliderSkin.tick, AdminSliderSkin.borderThickness, AdminSliderSkin.tickMargin);
}
}
}//package com.alternativagame.gui.admin.skin.widget.button
Section 75
//AdminSliderSkin_bitmapRunner (com.alternativagame.gui.admin.skin.widget.button.AdminSliderSkin_bitmapRunner)
package com.alternativagame.gui.admin.skin.widget.button {
import mx.core.*;
public class AdminSliderSkin_bitmapRunner extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.button
Section 76
//AdminSliderSkin_bitmapTick (com.alternativagame.gui.admin.skin.widget.button.AdminSliderSkin_bitmapTick)
package com.alternativagame.gui.admin.skin.widget.button {
import mx.core.*;
public class AdminSliderSkin_bitmapTick extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.button
Section 77
//AdminSliderSkin_bitmapTrackCenter (com.alternativagame.gui.admin.skin.widget.button.AdminSliderSkin_bitmapTrackCenter)
package com.alternativagame.gui.admin.skin.widget.button {
import mx.core.*;
public class AdminSliderSkin_bitmapTrackCenter extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.button
Section 78
//AdminSliderSkin_bitmapTrackLeft (com.alternativagame.gui.admin.skin.widget.button.AdminSliderSkin_bitmapTrackLeft)
package com.alternativagame.gui.admin.skin.widget.button {
import mx.core.*;
public class AdminSliderSkin_bitmapTrackLeft extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.button
Section 79
//AdminSliderSkin_bitmapTrackRight (com.alternativagame.gui.admin.skin.widget.button.AdminSliderSkin_bitmapTrackRight)
package com.alternativagame.gui.admin.skin.widget.button {
import mx.core.*;
public class AdminSliderSkin_bitmapTrackRight extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.button
Section 80
//AdminSwitchSkin (com.alternativagame.gui.admin.skin.widget.button.AdminSwitchSkin)
package com.alternativagame.gui.admin.skin.widget.button {
import flash.display.*;
import com.alternativagame.gui.skin.widget.button.*;
public class AdminSwitchSkin extends SwitchSkin {
private static const bitmapMC:Class = AdminSwitchSkin_bitmapMC;
private static const arrow:BitmapData = new bitmapArrow().bitmapData;
private static const cornerTL:BitmapData = new bitmapTL().bitmapData;
private static const cornerTR:BitmapData = new bitmapTR().bitmapData;
private static const bitmapMR:Class = AdminSwitchSkin_bitmapMR;
private static const bitmapML:Class = AdminSwitchSkin_bitmapML;
private static const bitmapArrow:Class = AdminSwitchSkin_bitmapArrow;
private static const bgMC:BitmapData = new bitmapMC().bitmapData;
private static const bitmapTC:Class = AdminSwitchSkin_bitmapTC;
private static const cornerBL:BitmapData = new bitmapBL().bitmapData;
private static const edgeML:BitmapData = new bitmapML().bitmapData;
private static const cornerBR:BitmapData = new bitmapBR().bitmapData;
private static const bitmapTL:Class = AdminSwitchSkin_bitmapTL;
private static const edgeBC:BitmapData = new bitmapBC().bitmapData;
private static const edgeTC:BitmapData = new bitmapTC().bitmapData;
private static const bitmapTR:Class = AdminSwitchSkin_bitmapTR;
private static const borderThickness:int = 3;
private static const bitmapBC:Class = AdminSwitchSkin_bitmapBC;
private static const edgeMR:BitmapData = new bitmapMR().bitmapData;
private static const bitmapBL:Class = AdminSwitchSkin_bitmapBL;
private static const bitmapBR:Class = AdminSwitchSkin_bitmapBR;
public function AdminSwitchSkin(){
super(AdminSwitchSkin.cornerTL, AdminSwitchSkin.cornerTR, AdminSwitchSkin.cornerBL, AdminSwitchSkin.cornerBR, AdminSwitchSkin.edgeTC, AdminSwitchSkin.edgeML, AdminSwitchSkin.edgeMR, AdminSwitchSkin.edgeBC, AdminSwitchSkin.bgMC, AdminSwitchSkin.arrow, AdminSwitchSkin.borderThickness);
}
}
}//package com.alternativagame.gui.admin.skin.widget.button
Section 81
//AdminSwitchSkin_bitmapArrow (com.alternativagame.gui.admin.skin.widget.button.AdminSwitchSkin_bitmapArrow)
package com.alternativagame.gui.admin.skin.widget.button {
import mx.core.*;
public class AdminSwitchSkin_bitmapArrow extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.button
Section 82
//AdminSwitchSkin_bitmapBC (com.alternativagame.gui.admin.skin.widget.button.AdminSwitchSkin_bitmapBC)
package com.alternativagame.gui.admin.skin.widget.button {
import mx.core.*;
public class AdminSwitchSkin_bitmapBC extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.button
Section 83
//AdminSwitchSkin_bitmapBL (com.alternativagame.gui.admin.skin.widget.button.AdminSwitchSkin_bitmapBL)
package com.alternativagame.gui.admin.skin.widget.button {
import mx.core.*;
public class AdminSwitchSkin_bitmapBL extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.button
Section 84
//AdminSwitchSkin_bitmapBR (com.alternativagame.gui.admin.skin.widget.button.AdminSwitchSkin_bitmapBR)
package com.alternativagame.gui.admin.skin.widget.button {
import mx.core.*;
public class AdminSwitchSkin_bitmapBR extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.button
Section 85
//AdminSwitchSkin_bitmapMC (com.alternativagame.gui.admin.skin.widget.button.AdminSwitchSkin_bitmapMC)
package com.alternativagame.gui.admin.skin.widget.button {
import mx.core.*;
public class AdminSwitchSkin_bitmapMC extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.button
Section 86
//AdminSwitchSkin_bitmapML (com.alternativagame.gui.admin.skin.widget.button.AdminSwitchSkin_bitmapML)
package com.alternativagame.gui.admin.skin.widget.button {
import mx.core.*;
public class AdminSwitchSkin_bitmapML extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.button
Section 87
//AdminSwitchSkin_bitmapMR (com.alternativagame.gui.admin.skin.widget.button.AdminSwitchSkin_bitmapMR)
package com.alternativagame.gui.admin.skin.widget.button {
import mx.core.*;
public class AdminSwitchSkin_bitmapMR extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.button
Section 88
//AdminSwitchSkin_bitmapTC (com.alternativagame.gui.admin.skin.widget.button.AdminSwitchSkin_bitmapTC)
package com.alternativagame.gui.admin.skin.widget.button {
import mx.core.*;
public class AdminSwitchSkin_bitmapTC extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.button
Section 89
//AdminSwitchSkin_bitmapTL (com.alternativagame.gui.admin.skin.widget.button.AdminSwitchSkin_bitmapTL)
package com.alternativagame.gui.admin.skin.widget.button {
import mx.core.*;
public class AdminSwitchSkin_bitmapTL extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.button
Section 90
//AdminSwitchSkin_bitmapTR (com.alternativagame.gui.admin.skin.widget.button.AdminSwitchSkin_bitmapTR)
package com.alternativagame.gui.admin.skin.widget.button {
import mx.core.*;
public class AdminSwitchSkin_bitmapTR extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.button
Section 91
//AdminComboBoxSkin (com.alternativagame.gui.admin.skin.widget.comboBox.AdminComboBoxSkin)
package com.alternativagame.gui.admin.skin.widget.comboBox {
import flash.display.*;
import com.alternativagame.gui.skin.widget.comboBox.*;
public class AdminComboBoxSkin extends ComboBoxSkin {
private static const ll:BitmapData = new bitmapLL().bitmapData;
private static const bitmapButtonPress:Class = AdminComboBoxSkin_bitmapButtonPress;
private static const lr:BitmapData = new bitmapLR().bitmapData;
private static const nr:BitmapData = new bitmapNR().bitmapData;
private static const bitmapLR:Class = AdminComboBoxSkin_bitmapLR;
private static const bitmapButtonNormal:Class = AdminComboBoxSkin_bitmapButtonNormal;
private static const buttonNormal:BitmapData = new bitmapButtonNormal().bitmapData;
private static const bitmapButtonLock:Class = AdminComboBoxSkin_bitmapButtonLock;
private static const bitmapButtonOver:Class = AdminComboBoxSkin_bitmapButtonOver;
private static const buttonOver:BitmapData = new bitmapButtonOver().bitmapData;
private static const bitmapNC:Class = AdminComboBoxSkin_bitmapNC;
private static const bitmapLC:Class = AdminComboBoxSkin_bitmapLC;
private static const borderThickness:int = 2;
private static const bitmapLL:Class = AdminComboBoxSkin_bitmapLL;
private static const bitmapNR:Class = AdminComboBoxSkin_bitmapNR;
private static const bitmapNL:Class = AdminComboBoxSkin_bitmapNL;
private static const nc:BitmapData = new bitmapNC().bitmapData;
private static const lc:BitmapData = new bitmapLC().bitmapData;
private static const buttonPress:BitmapData = new bitmapButtonPress().bitmapData;
private static const buttonLock:BitmapData = new bitmapButtonLock().bitmapData;
private static const nl:BitmapData = new bitmapNL().bitmapData;
public function AdminComboBoxSkin(){
super(AdminComboBoxSkin.nl, AdminComboBoxSkin.nc, AdminComboBoxSkin.nr, AdminComboBoxSkin.ll, AdminComboBoxSkin.lc, AdminComboBoxSkin.lr, AdminComboBoxSkin.buttonNormal, AdminComboBoxSkin.buttonOver, AdminComboBoxSkin.buttonPress, AdminComboBoxSkin.buttonLock, AdminComboBoxSkin.borderThickness);
}
}
}//package com.alternativagame.gui.admin.skin.widget.comboBox
Section 92
//AdminComboBoxSkin_bitmapButtonLock (com.alternativagame.gui.admin.skin.widget.comboBox.AdminComboBoxSkin_bitmapButtonLock)
package com.alternativagame.gui.admin.skin.widget.comboBox {
import mx.core.*;
public class AdminComboBoxSkin_bitmapButtonLock extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.comboBox
Section 93
//AdminComboBoxSkin_bitmapButtonNormal (com.alternativagame.gui.admin.skin.widget.comboBox.AdminComboBoxSkin_bitmapButtonNormal)
package com.alternativagame.gui.admin.skin.widget.comboBox {
import mx.core.*;
public class AdminComboBoxSkin_bitmapButtonNormal extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.comboBox
Section 94
//AdminComboBoxSkin_bitmapButtonOver (com.alternativagame.gui.admin.skin.widget.comboBox.AdminComboBoxSkin_bitmapButtonOver)
package com.alternativagame.gui.admin.skin.widget.comboBox {
import mx.core.*;
public class AdminComboBoxSkin_bitmapButtonOver extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.comboBox
Section 95
//AdminComboBoxSkin_bitmapButtonPress (com.alternativagame.gui.admin.skin.widget.comboBox.AdminComboBoxSkin_bitmapButtonPress)
package com.alternativagame.gui.admin.skin.widget.comboBox {
import mx.core.*;
public class AdminComboBoxSkin_bitmapButtonPress extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.comboBox
Section 96
//AdminComboBoxSkin_bitmapLC (com.alternativagame.gui.admin.skin.widget.comboBox.AdminComboBoxSkin_bitmapLC)
package com.alternativagame.gui.admin.skin.widget.comboBox {
import mx.core.*;
public class AdminComboBoxSkin_bitmapLC extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.comboBox
Section 97
//AdminComboBoxSkin_bitmapLL (com.alternativagame.gui.admin.skin.widget.comboBox.AdminComboBoxSkin_bitmapLL)
package com.alternativagame.gui.admin.skin.widget.comboBox {
import mx.core.*;
public class AdminComboBoxSkin_bitmapLL extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.comboBox
Section 98
//AdminComboBoxSkin_bitmapLR (com.alternativagame.gui.admin.skin.widget.comboBox.AdminComboBoxSkin_bitmapLR)
package com.alternativagame.gui.admin.skin.widget.comboBox {
import mx.core.*;
public class AdminComboBoxSkin_bitmapLR extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.comboBox
Section 99
//AdminComboBoxSkin_bitmapNC (com.alternativagame.gui.admin.skin.widget.comboBox.AdminComboBoxSkin_bitmapNC)
package com.alternativagame.gui.admin.skin.widget.comboBox {
import mx.core.*;
public class AdminComboBoxSkin_bitmapNC extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.comboBox
Section 100
//AdminComboBoxSkin_bitmapNL (com.alternativagame.gui.admin.skin.widget.comboBox.AdminComboBoxSkin_bitmapNL)
package com.alternativagame.gui.admin.skin.widget.comboBox {
import mx.core.*;
public class AdminComboBoxSkin_bitmapNL extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.comboBox
Section 101
//AdminComboBoxSkin_bitmapNR (com.alternativagame.gui.admin.skin.widget.comboBox.AdminComboBoxSkin_bitmapNR)
package com.alternativagame.gui.admin.skin.widget.comboBox {
import mx.core.*;
public class AdminComboBoxSkin_bitmapNR extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.comboBox
Section 102
//AdminListItemSkin (com.alternativagame.gui.admin.skin.widget.list.AdminListItemSkin)
package com.alternativagame.gui.admin.skin.widget.list {
import com.alternativagame.gui.skin.widget.list.*;
public class AdminListItemSkin extends ListItemSkin {
private static const selectionAlphaOverSelected:Number = 0.5;
private static const selectionAlphaOver:Number = 0.2;
private static const selectionColor:uint = 29988;
private static const selectionAlphaSelected:Number = 0.5;
public function AdminListItemSkin(){
super(AdminListItemSkin.selectionColor, AdminListItemSkin.selectionAlphaOver, AdminListItemSkin.selectionAlphaOverSelected, AdminListItemSkin.selectionAlphaSelected);
}
}
}//package com.alternativagame.gui.admin.skin.widget.list
Section 103
//AdminScrollBarSkin (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBarSkin)
package com.alternativagame.gui.admin.skin.widget.scroll {
import flash.display.*;
import com.alternativagame.gui.skin.widget.scroll.*;
public class AdminScrollBarSkin extends ScrollBarSkin {
private static const bitmapDO:Class = AdminScrollBarSkin_bitmapDO;
private static const bitmapDP:Class = AdminScrollBarSkin_bitmapDP;
private static const bitmapR:Class = AdminScrollBarSkin_bitmapR;
private static const bitmapT:Class = AdminScrollBarSkin_bitmapT;
private static const bitmapUL:Class = AdminScrollBarSkin_bitmapUL;
private static const bitmapLL:Class = AdminScrollBarSkin_bitmapLL;
private static const bitmapUN:Class = AdminScrollBarSkin_bitmapUN;
private static const bitmapUO:Class = AdminScrollBarSkin_bitmapUO;
private static const bitmapUP:Class = AdminScrollBarSkin_bitmapUP;
private static const bitmapLP:Class = AdminScrollBarSkin_bitmapLP;
private static const bmpR:BitmapData = new bitmapR().bitmapData;
private static const bmpC:BitmapData = new bitmapC().bitmapData;
private static const repeatInterval:int = 80;
private static const bmpRP:BitmapData = new bitmapRP().bitmapData;
private static const bitmapLO:Class = AdminScrollBarSkin_bitmapLO;
private static const bmpRN:BitmapData = new bitmapRN().bitmapData;
private static const clickInterval:int = 300;
private static const bitmapRN:Class = AdminScrollBarSkin_bitmapRN;
private static const bitmapRO:Class = AdminScrollBarSkin_bitmapRO;
private static const bitmapRP:Class = AdminScrollBarSkin_bitmapRP;
private static const bmpRO:BitmapData = new bitmapRO().bitmapData;
private static const bitmapRL:Class = AdminScrollBarSkin_bitmapRL;
private static const bmpLL:BitmapData = new bitmapLL().bitmapData;
private static const bmpLN:BitmapData = new bitmapLN().bitmapData;
private static const bmpLO:BitmapData = new bitmapLO().bitmapData;
private static const bmpLP:BitmapData = new bitmapLP().bitmapData;
private static const bmpDL:BitmapData = new bitmapDL().bitmapData;
private static const bmpDN:BitmapData = new bitmapDN().bitmapData;
private static const bmpDP:BitmapData = new bitmapDP().bitmapData;
private static const bmpDO:BitmapData = new bitmapDO().bitmapData;
private static const bmpUL:BitmapData = new bitmapUL().bitmapData;
private static const bmpB:BitmapData = new bitmapB().bitmapData;
private static const bmpUO:BitmapData = new bitmapUO().bitmapData;
private static const bmpUP:BitmapData = new bitmapUP().bitmapData;
private static const bmpUN:BitmapData = new bitmapUN().bitmapData;
private static const bmpL:BitmapData = new bitmapL().bitmapData;
private static const bmpM:BitmapData = new bitmapM().bitmapData;
private static const bitmapLN:Class = AdminScrollBarSkin_bitmapLN;
private static const bitmapB:Class = AdminScrollBarSkin_bitmapB;
private static const bitmapC:Class = AdminScrollBarSkin_bitmapC;
private static const bmpT:BitmapData = new bitmapT().bitmapData;
private static const bitmapDL:Class = AdminScrollBarSkin_bitmapDL;
private static const bitmapDN:Class = AdminScrollBarSkin_bitmapDN;
private static const bitmapL:Class = AdminScrollBarSkin_bitmapL;
private static const bitmapM:Class = AdminScrollBarSkin_bitmapM;
private static const bmpRL:BitmapData = new bitmapRL().bitmapData;
public function AdminScrollBarSkin(){
super(AdminScrollBarSkin.bmpT, AdminScrollBarSkin.bmpM, AdminScrollBarSkin.bmpB, AdminScrollBarSkin.bmpUN, AdminScrollBarSkin.bmpUO, AdminScrollBarSkin.bmpUP, AdminScrollBarSkin.bmpUL, AdminScrollBarSkin.bmpDN, AdminScrollBarSkin.bmpDO, AdminScrollBarSkin.bmpDP, AdminScrollBarSkin.bmpDL, AdminScrollBarSkin.bmpL, AdminScrollBarSkin.bmpC, AdminScrollBarSkin.bmpR, AdminScrollBarSkin.bmpLN, AdminScrollBarSkin.bmpLO, AdminScrollBarSkin.bmpLP, AdminScrollBarSkin.bmpLL, AdminScrollBarSkin.bmpRN, AdminScrollBarSkin.bmpRO, AdminScrollBarSkin.bmpRP, AdminScrollBarSkin.bmpRL, AdminScrollBarSkin.clickInterval, AdminScrollBarSkin.repeatInterval);
}
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 104
//AdminScrollBarSkin_bitmapB (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBarSkin_bitmapB)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBarSkin_bitmapB extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 105
//AdminScrollBarSkin_bitmapC (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBarSkin_bitmapC)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBarSkin_bitmapC extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 106
//AdminScrollBarSkin_bitmapDL (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBarSkin_bitmapDL)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBarSkin_bitmapDL extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 107
//AdminScrollBarSkin_bitmapDN (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBarSkin_bitmapDN)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBarSkin_bitmapDN extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 108
//AdminScrollBarSkin_bitmapDO (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBarSkin_bitmapDO)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBarSkin_bitmapDO extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 109
//AdminScrollBarSkin_bitmapDP (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBarSkin_bitmapDP)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBarSkin_bitmapDP extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 110
//AdminScrollBarSkin_bitmapL (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBarSkin_bitmapL)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBarSkin_bitmapL extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 111
//AdminScrollBarSkin_bitmapLL (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBarSkin_bitmapLL)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBarSkin_bitmapLL extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 112
//AdminScrollBarSkin_bitmapLN (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBarSkin_bitmapLN)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBarSkin_bitmapLN extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 113
//AdminScrollBarSkin_bitmapLO (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBarSkin_bitmapLO)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBarSkin_bitmapLO extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 114
//AdminScrollBarSkin_bitmapLP (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBarSkin_bitmapLP)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBarSkin_bitmapLP extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 115
//AdminScrollBarSkin_bitmapM (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBarSkin_bitmapM)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBarSkin_bitmapM extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 116
//AdminScrollBarSkin_bitmapR (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBarSkin_bitmapR)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBarSkin_bitmapR extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 117
//AdminScrollBarSkin_bitmapRL (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBarSkin_bitmapRL)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBarSkin_bitmapRL extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 118
//AdminScrollBarSkin_bitmapRN (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBarSkin_bitmapRN)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBarSkin_bitmapRN extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 119
//AdminScrollBarSkin_bitmapRO (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBarSkin_bitmapRO)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBarSkin_bitmapRO extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 120
//AdminScrollBarSkin_bitmapRP (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBarSkin_bitmapRP)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBarSkin_bitmapRP extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 121
//AdminScrollBarSkin_bitmapT (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBarSkin_bitmapT)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBarSkin_bitmapT extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 122
//AdminScrollBarSkin_bitmapUL (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBarSkin_bitmapUL)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBarSkin_bitmapUL extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 123
//AdminScrollBarSkin_bitmapUN (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBarSkin_bitmapUN)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBarSkin_bitmapUN extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 124
//AdminScrollBarSkin_bitmapUO (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBarSkin_bitmapUO)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBarSkin_bitmapUO extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 125
//AdminScrollBarSkin_bitmapUP (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBarSkin_bitmapUP)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBarSkin_bitmapUP extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 126
//AdminScrollBoxSkin (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBoxSkin)
package com.alternativagame.gui.admin.skin.widget.scroll {
import flash.display.*;
import com.alternativagame.gui.skin.widget.scroll.*;
public class AdminScrollBoxSkin extends ScrollBoxSkin {
private static const bitmapLBL:Class = AdminScrollBoxSkin_bitmapLBL;
private static const bitmapLBR:Class = AdminScrollBoxSkin_bitmapLBR;
private static const bmpLTC:BitmapData = new bitmapLTC().bitmapData;
private static const bmpLTL:BitmapData = new bitmapLTL().bitmapData;
private static const bmpOBC:BitmapData = new bitmapOBC().bitmapData;
private static const bitmapLTC:Class = AdminScrollBoxSkin_bitmapLTC;
private static const bmpOBL:BitmapData = new bitmapOBL().bitmapData;
private static const bitmapLTL:Class = AdminScrollBoxSkin_bitmapLTL;
private static const bmpOBR:BitmapData = new bitmapOBR().bitmapData;
private static const bitmapLTR:Class = AdminScrollBoxSkin_bitmapLTR;
private static const bmpLMC:BitmapData = new bitmapLMC().bitmapData;
private static const bitmapOBC:Class = AdminScrollBoxSkin_bitmapOBC;
private static const bmpLML:BitmapData = new bitmapLML().bitmapData;
private static const bmpLTR:BitmapData = new bitmapLTR().bitmapData;
private static const bmpCorner:BitmapData = new bitmapCorner().bitmapData;
private static const bmpLMR:BitmapData = new bitmapLMR().bitmapData;
private static const bitmapOBR:Class = AdminScrollBoxSkin_bitmapOBR;
private static const bitmapOBL:Class = AdminScrollBoxSkin_bitmapOBL;
private static const bitmapLMC:Class = AdminScrollBoxSkin_bitmapLMC;
private static const bmpOTC:BitmapData = new bitmapOTC().bitmapData;
private static const bitmapLMR:Class = AdminScrollBoxSkin_bitmapLMR;
private static const bitmapLML:Class = AdminScrollBoxSkin_bitmapLML;
private static const bitmapCorner:Class = AdminScrollBoxSkin_bitmapCorner;
private static const bmpOTR:BitmapData = new bitmapOTR().bitmapData;
private static const bmpOTL:BitmapData = new bitmapOTL().bitmapData;
private static const bitmapOTC:Class = AdminScrollBoxSkin_bitmapOTC;
private static const bmpNBC:BitmapData = new bitmapNBC().bitmapData;
private static const bmpNBL:BitmapData = new bitmapNBL().bitmapData;
private static const bitmapOTL:Class = AdminScrollBoxSkin_bitmapOTL;
private static const bmpNBR:BitmapData = new bitmapNBR().bitmapData;
private static const bitmapNBC:Class = AdminScrollBoxSkin_bitmapNBC;
private static const bitmapOTR:Class = AdminScrollBoxSkin_bitmapOTR;
private static const bmpOMC:BitmapData = new bitmapOMC().bitmapData;
private static const bitmapNBL:Class = AdminScrollBoxSkin_bitmapNBL;
private static const bitmapNBR:Class = AdminScrollBoxSkin_bitmapNBR;
private static const bitmapOMC:Class = AdminScrollBoxSkin_bitmapOMC;
private static const bmpNTC:BitmapData = new bitmapNTC().bitmapData;
private static const bmpOMR:BitmapData = new bitmapOMR().bitmapData;
private static const bitmapOML:Class = AdminScrollBoxSkin_bitmapOML;
private static const bmpNTL:BitmapData = new bitmapNTL().bitmapData;
private static const bitmapOMR:Class = AdminScrollBoxSkin_bitmapOMR;
private static const bmpNTR:BitmapData = new bitmapNTR().bitmapData;
private static const borderThickness:int = 1;
private static const bmpOML:BitmapData = new bitmapOML().bitmapData;
private static const bitmapNTC:Class = AdminScrollBoxSkin_bitmapNTC;
private static const bitmapNTL:Class = AdminScrollBoxSkin_bitmapNTL;
private static const bitmapNTR:Class = AdminScrollBoxSkin_bitmapNTR;
private static const bmpNMC:BitmapData = new bitmapNMC().bitmapData;
private static const bmpNMR:BitmapData = new bitmapNMR().bitmapData;
private static const bitmapNMC:Class = AdminScrollBoxSkin_bitmapNMC;
private static const bmpNML:BitmapData = new bitmapNML().bitmapData;
private static const bitmapNMR:Class = AdminScrollBoxSkin_bitmapNMR;
private static const bitmapNML:Class = AdminScrollBoxSkin_bitmapNML;
private static const bmpLBC:BitmapData = new bitmapLBC().bitmapData;
private static const bmpLBL:BitmapData = new bitmapLBL().bitmapData;
private static const bmpLBR:BitmapData = new bitmapLBR().bitmapData;
private static const bitmapLBC:Class = AdminScrollBoxSkin_bitmapLBC;
public function AdminScrollBoxSkin(){
super(AdminScrollBoxSkin.bmpNTL, AdminScrollBoxSkin.bmpNTC, AdminScrollBoxSkin.bmpNTR, AdminScrollBoxSkin.bmpNML, AdminScrollBoxSkin.bmpNMC, AdminScrollBoxSkin.bmpNMR, AdminScrollBoxSkin.bmpNBL, AdminScrollBoxSkin.bmpNBC, AdminScrollBoxSkin.bmpNBR, AdminScrollBoxSkin.bmpOTL, AdminScrollBoxSkin.bmpOTC, AdminScrollBoxSkin.bmpOTR, AdminScrollBoxSkin.bmpOML, AdminScrollBoxSkin.bmpOMC, AdminScrollBoxSkin.bmpOMR, AdminScrollBoxSkin.bmpOBL, AdminScrollBoxSkin.bmpOBC, AdminScrollBoxSkin.bmpOBR, AdminScrollBoxSkin.bmpLTL, AdminScrollBoxSkin.bmpLTC, AdminScrollBoxSkin.bmpLTR, AdminScrollBoxSkin.bmpLML, AdminScrollBoxSkin.bmpLMC, AdminScrollBoxSkin.bmpLMR, AdminScrollBoxSkin.bmpLBL, AdminScrollBoxSkin.bmpLBC, AdminScrollBoxSkin.bmpLBR, AdminScrollBoxSkin.bmpCorner, AdminScrollBoxSkin.borderThickness);
}
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 127
//AdminScrollBoxSkin_bitmapCorner (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBoxSkin_bitmapCorner)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBoxSkin_bitmapCorner extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 128
//AdminScrollBoxSkin_bitmapLBC (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBoxSkin_bitmapLBC)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBoxSkin_bitmapLBC extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 129
//AdminScrollBoxSkin_bitmapLBL (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBoxSkin_bitmapLBL)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBoxSkin_bitmapLBL extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 130
//AdminScrollBoxSkin_bitmapLBR (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBoxSkin_bitmapLBR)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBoxSkin_bitmapLBR extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 131
//AdminScrollBoxSkin_bitmapLMC (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBoxSkin_bitmapLMC)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBoxSkin_bitmapLMC extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 132
//AdminScrollBoxSkin_bitmapLML (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBoxSkin_bitmapLML)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBoxSkin_bitmapLML extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 133
//AdminScrollBoxSkin_bitmapLMR (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBoxSkin_bitmapLMR)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBoxSkin_bitmapLMR extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 134
//AdminScrollBoxSkin_bitmapLTC (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBoxSkin_bitmapLTC)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBoxSkin_bitmapLTC extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 135
//AdminScrollBoxSkin_bitmapLTL (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBoxSkin_bitmapLTL)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBoxSkin_bitmapLTL extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 136
//AdminScrollBoxSkin_bitmapLTR (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBoxSkin_bitmapLTR)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBoxSkin_bitmapLTR extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 137
//AdminScrollBoxSkin_bitmapNBC (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBoxSkin_bitmapNBC)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBoxSkin_bitmapNBC extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 138
//AdminScrollBoxSkin_bitmapNBL (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBoxSkin_bitmapNBL)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBoxSkin_bitmapNBL extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 139
//AdminScrollBoxSkin_bitmapNBR (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBoxSkin_bitmapNBR)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBoxSkin_bitmapNBR extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 140
//AdminScrollBoxSkin_bitmapNMC (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBoxSkin_bitmapNMC)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBoxSkin_bitmapNMC extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 141
//AdminScrollBoxSkin_bitmapNML (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBoxSkin_bitmapNML)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBoxSkin_bitmapNML extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 142
//AdminScrollBoxSkin_bitmapNMR (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBoxSkin_bitmapNMR)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBoxSkin_bitmapNMR extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 143
//AdminScrollBoxSkin_bitmapNTC (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBoxSkin_bitmapNTC)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBoxSkin_bitmapNTC extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 144
//AdminScrollBoxSkin_bitmapNTL (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBoxSkin_bitmapNTL)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBoxSkin_bitmapNTL extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 145
//AdminScrollBoxSkin_bitmapNTR (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBoxSkin_bitmapNTR)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBoxSkin_bitmapNTR extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 146
//AdminScrollBoxSkin_bitmapOBC (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBoxSkin_bitmapOBC)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBoxSkin_bitmapOBC extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 147
//AdminScrollBoxSkin_bitmapOBL (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBoxSkin_bitmapOBL)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBoxSkin_bitmapOBL extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 148
//AdminScrollBoxSkin_bitmapOBR (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBoxSkin_bitmapOBR)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBoxSkin_bitmapOBR extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 149
//AdminScrollBoxSkin_bitmapOMC (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBoxSkin_bitmapOMC)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBoxSkin_bitmapOMC extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 150
//AdminScrollBoxSkin_bitmapOML (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBoxSkin_bitmapOML)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBoxSkin_bitmapOML extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 151
//AdminScrollBoxSkin_bitmapOMR (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBoxSkin_bitmapOMR)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBoxSkin_bitmapOMR extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 152
//AdminScrollBoxSkin_bitmapOTC (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBoxSkin_bitmapOTC)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBoxSkin_bitmapOTC extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 153
//AdminScrollBoxSkin_bitmapOTL (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBoxSkin_bitmapOTL)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBoxSkin_bitmapOTL extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 154
//AdminScrollBoxSkin_bitmapOTR (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollBoxSkin_bitmapOTR)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollBoxSkin_bitmapOTR extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 155
//AdminScrollerSkin (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollerSkin)
package com.alternativagame.gui.admin.skin.widget.scroll {
import flash.display.*;
import com.alternativagame.gui.skin.widget.scroll.*;
public class AdminScrollerSkin extends ScrollerSkin {
private static const pc:BitmapData = new bitmapPC().bitmapData;
private static const pl:BitmapData = new bitmapPL().bitmapData;
private static const pr:BitmapData = new bitmapPR().bitmapData;
private static const pt:BitmapData = new bitmapPT().bitmapData;
private static const bitmapNB:Class = AdminScrollerSkin_bitmapNB;
private static const bitmapNC:Class = AdminScrollerSkin_bitmapNC;
private static const bitmapNL:Class = AdminScrollerSkin_bitmapNL;
private static const bitmapNM:Class = AdminScrollerSkin_bitmapNM;
private static const bitmapNR:Class = AdminScrollerSkin_bitmapNR;
private static const nb:BitmapData = new bitmapNB().bitmapData;
private static const bitmapNT:Class = AdminScrollerSkin_bitmapNT;
private static const nl:BitmapData = new bitmapNL().bitmapData;
private static const nm:BitmapData = new bitmapNM().bitmapData;
private static const bitmapOB:Class = AdminScrollerSkin_bitmapOB;
private static const bitmapOC:Class = AdminScrollerSkin_bitmapOC;
private static const nr:BitmapData = new bitmapNR().bitmapData;
private static const bitmapOL:Class = AdminScrollerSkin_bitmapOL;
private static const bitmapOM:Class = AdminScrollerSkin_bitmapOM;
private static const bitmapOR:Class = AdminScrollerSkin_bitmapOR;
private static const ob:BitmapData = new bitmapOB().bitmapData;
private static const bitmapOT:Class = AdminScrollerSkin_bitmapOT;
private static const nt:BitmapData = new bitmapNT().bitmapData;
private static const nc:BitmapData = new bitmapNC().bitmapData;
private static const oc:BitmapData = new bitmapOC().bitmapData;
private static const ol:BitmapData = new bitmapOL().bitmapData;
private static const om:BitmapData = new bitmapOM().bitmapData;
private static const minLength:int = 4;
private static const bitmapPB:Class = AdminScrollerSkin_bitmapPB;
private static const bitmapPC:Class = AdminScrollerSkin_bitmapPC;
private static const or:BitmapData = new bitmapOR().bitmapData;
private static const ot:BitmapData = new bitmapOT().bitmapData;
private static const bitmapPL:Class = AdminScrollerSkin_bitmapPL;
private static const bitmapPM:Class = AdminScrollerSkin_bitmapPM;
private static const bitmapPR:Class = AdminScrollerSkin_bitmapPR;
private static const pb:BitmapData = new bitmapPB().bitmapData;
private static const bitmapPT:Class = AdminScrollerSkin_bitmapPT;
private static const pm:BitmapData = new bitmapPM().bitmapData;
public function AdminScrollerSkin(){
super(AdminScrollerSkin.nt, AdminScrollerSkin.nm, AdminScrollerSkin.nb, AdminScrollerSkin.ot, AdminScrollerSkin.om, AdminScrollerSkin.ob, AdminScrollerSkin.pt, AdminScrollerSkin.pm, AdminScrollerSkin.pb, AdminScrollerSkin.nl, AdminScrollerSkin.nc, AdminScrollerSkin.nr, AdminScrollerSkin.ol, AdminScrollerSkin.oc, AdminScrollerSkin.or, AdminScrollerSkin.pl, AdminScrollerSkin.pc, AdminScrollerSkin.pr, AdminScrollerSkin.minLength);
}
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 156
//AdminScrollerSkin_bitmapNB (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollerSkin_bitmapNB)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollerSkin_bitmapNB extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 157
//AdminScrollerSkin_bitmapNC (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollerSkin_bitmapNC)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollerSkin_bitmapNC extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 158
//AdminScrollerSkin_bitmapNL (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollerSkin_bitmapNL)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollerSkin_bitmapNL extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 159
//AdminScrollerSkin_bitmapNM (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollerSkin_bitmapNM)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollerSkin_bitmapNM extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 160
//AdminScrollerSkin_bitmapNR (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollerSkin_bitmapNR)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollerSkin_bitmapNR extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 161
//AdminScrollerSkin_bitmapNT (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollerSkin_bitmapNT)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollerSkin_bitmapNT extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 162
//AdminScrollerSkin_bitmapOB (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollerSkin_bitmapOB)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollerSkin_bitmapOB extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 163
//AdminScrollerSkin_bitmapOC (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollerSkin_bitmapOC)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollerSkin_bitmapOC extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 164
//AdminScrollerSkin_bitmapOL (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollerSkin_bitmapOL)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollerSkin_bitmapOL extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 165
//AdminScrollerSkin_bitmapOM (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollerSkin_bitmapOM)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollerSkin_bitmapOM extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 166
//AdminScrollerSkin_bitmapOR (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollerSkin_bitmapOR)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollerSkin_bitmapOR extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 167
//AdminScrollerSkin_bitmapOT (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollerSkin_bitmapOT)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollerSkin_bitmapOT extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 168
//AdminScrollerSkin_bitmapPB (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollerSkin_bitmapPB)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollerSkin_bitmapPB extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 169
//AdminScrollerSkin_bitmapPC (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollerSkin_bitmapPC)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollerSkin_bitmapPC extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 170
//AdminScrollerSkin_bitmapPL (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollerSkin_bitmapPL)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollerSkin_bitmapPL extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 171
//AdminScrollerSkin_bitmapPM (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollerSkin_bitmapPM)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollerSkin_bitmapPM extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 172
//AdminScrollerSkin_bitmapPR (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollerSkin_bitmapPR)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollerSkin_bitmapPR extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 173
//AdminScrollerSkin_bitmapPT (com.alternativagame.gui.admin.skin.widget.scroll.AdminScrollerSkin_bitmapPT)
package com.alternativagame.gui.admin.skin.widget.scroll {
import mx.core.*;
public class AdminScrollerSkin_bitmapPT extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.scroll
Section 174
//AdminTreeGraphicsSkin (com.alternativagame.gui.admin.skin.widget.tree.AdminTreeGraphicsSkin)
package com.alternativagame.gui.admin.skin.widget.tree {
import flash.display.*;
import com.alternativagame.gui.skin.widget.tree.*;
public class AdminTreeGraphicsSkin extends TreeGraphicsSkin {
private static const bitmapConnectTopClass:Class = AdminTreeGraphicsSkin_bitmapConnectTopClass;
private static const bitmapConnectBottom:BitmapData = new bitmapConnectBottomClass().bitmapData;
private static const bitmapConnectTriClass:Class = AdminTreeGraphicsSkin_bitmapConnectTriClass;
private static const bitmapConnectLineClass:Class = AdminTreeGraphicsSkin_bitmapConnectLineClass;
private static const bitmapConnectLine:BitmapData = new bitmapConnectLineClass().bitmapData;
private static const bitmapConnectTri:BitmapData = new bitmapConnectTriClass().bitmapData;
private static const bitmapConnectBottomClass:Class = AdminTreeGraphicsSkin_bitmapConnectBottomClass;
private static const bitmapConnectTop:BitmapData = new bitmapConnectTopClass().bitmapData;
public function AdminTreeGraphicsSkin(){
super(AdminTreeGraphicsSkin.bitmapConnectLine, AdminTreeGraphicsSkin.bitmapConnectTri, AdminTreeGraphicsSkin.bitmapConnectTop, AdminTreeGraphicsSkin.bitmapConnectBottom);
}
}
}//package com.alternativagame.gui.admin.skin.widget.tree
Section 175
//AdminTreeGraphicsSkin_bitmapConnectBottomClass (com.alternativagame.gui.admin.skin.widget.tree.AdminTreeGraphicsSkin_bitmapConnectBottomClass)
package com.alternativagame.gui.admin.skin.widget.tree {
import mx.core.*;
public class AdminTreeGraphicsSkin_bitmapConnectBottomClass extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.tree
Section 176
//AdminTreeGraphicsSkin_bitmapConnectLineClass (com.alternativagame.gui.admin.skin.widget.tree.AdminTreeGraphicsSkin_bitmapConnectLineClass)
package com.alternativagame.gui.admin.skin.widget.tree {
import mx.core.*;
public class AdminTreeGraphicsSkin_bitmapConnectLineClass extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.tree
Section 177
//AdminTreeGraphicsSkin_bitmapConnectTopClass (com.alternativagame.gui.admin.skin.widget.tree.AdminTreeGraphicsSkin_bitmapConnectTopClass)
package com.alternativagame.gui.admin.skin.widget.tree {
import mx.core.*;
public class AdminTreeGraphicsSkin_bitmapConnectTopClass extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.tree
Section 178
//AdminTreeGraphicsSkin_bitmapConnectTriClass (com.alternativagame.gui.admin.skin.widget.tree.AdminTreeGraphicsSkin_bitmapConnectTriClass)
package com.alternativagame.gui.admin.skin.widget.tree {
import mx.core.*;
public class AdminTreeGraphicsSkin_bitmapConnectTriClass extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.tree
Section 179
//AdminTreeItemSkin (com.alternativagame.gui.admin.skin.widget.tree.AdminTreeItemSkin)
package com.alternativagame.gui.admin.skin.widget.tree {
import flash.display.*;
import com.alternativagame.gui.skin.widget.tree.*;
public class AdminTreeItemSkin extends TreeItemSkin {
private static const bitmapSubOpened:BitmapData = new bitmapSubOpenedClass().bitmapData;
private static const bitmapSubClosedClass:Class = AdminTreeItemSkin_bitmapSubClosedClass;
private static const bitmapSubClosed:BitmapData = new bitmapSubClosedClass().bitmapData;
private static const bitmapSubOpenedClass:Class = AdminTreeItemSkin_bitmapSubOpenedClass;
public function AdminTreeItemSkin(){
super(AdminTreeItemSkin.bitmapSubOpened, AdminTreeItemSkin.bitmapSubClosed);
}
}
}//package com.alternativagame.gui.admin.skin.widget.tree
Section 180
//AdminTreeItemSkin_bitmapSubClosedClass (com.alternativagame.gui.admin.skin.widget.tree.AdminTreeItemSkin_bitmapSubClosedClass)
package com.alternativagame.gui.admin.skin.widget.tree {
import mx.core.*;
public class AdminTreeItemSkin_bitmapSubClosedClass extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.tree
Section 181
//AdminTreeItemSkin_bitmapSubOpenedClass (com.alternativagame.gui.admin.skin.widget.tree.AdminTreeItemSkin_bitmapSubOpenedClass)
package com.alternativagame.gui.admin.skin.widget.tree {
import mx.core.*;
public class AdminTreeItemSkin_bitmapSubOpenedClass extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget.tree
Section 182
//AdminImageSkin (com.alternativagame.gui.admin.skin.widget.AdminImageSkin)
package com.alternativagame.gui.admin.skin.widget {
import flash.geom.*;
import com.alternativagame.gui.skin.widget.*;
public class AdminImageSkin extends ImageSkin {
private static const colorNormal:ColorTransform = new ColorTransform();
private static const colorLocked:ColorTransform = new ColorTransform(0.5, 0.5, 0.5, 1, 50, 50, 50, 0);
public function AdminImageSkin(){
super(AdminImageSkin.colorNormal, AdminImageSkin.colorLocked);
}
}
}//package com.alternativagame.gui.admin.skin.widget
Section 183
//AdminInputSkin (com.alternativagame.gui.admin.skin.widget.AdminInputSkin)
package com.alternativagame.gui.admin.skin.widget {
import flash.display.*;
import flash.text.*;
import com.alternativagame.gui.skin.widget.*;
public class AdminInputSkin extends InputSkin {
private static const aaSharpness:Number = -50;
private static const bitmapOC:Class = AdminInputSkin_bitmapOC;
private static const bmpLL:BitmapData = new bitmapLL().bitmapData;
private static const bmpNR:BitmapData = new bitmapNR().bitmapData;
private static const bmpNL:BitmapData = new bitmapNL().bitmapData;
private static const bmpLC:BitmapData = new bitmapLC().bitmapData;
private static const bitmapOL:Class = AdminInputSkin_bitmapOL;
private static const bitmapOR:Class = AdminInputSkin_bitmapOR;
private static const leftMargin:int = 2;
private static const bmpOC:BitmapData = new bitmapOC().bitmapData;
private static const aaThickness:Number = 50;
private static const bmpLR:BitmapData = new bitmapLR().bitmapData;
private static const bitmapNC:Class = AdminInputSkin_bitmapNC;
private static const bmpOR:BitmapData = new bitmapOR().bitmapData;
private static const bmpOL:BitmapData = new bitmapOL().bitmapData;
private static const bitmapNL:Class = AdminInputSkin_bitmapNL;
private static const bitmapLL:Class = AdminInputSkin_bitmapLL;
private static const bitmapNR:Class = AdminInputSkin_bitmapNR;
private static const bitmapLC:Class = AdminInputSkin_bitmapLC;
private static const rightMargin:int = 2;
private static const bmpNC:BitmapData = new bitmapNC().bitmapData;
private static const topMargin:int = 0;
private static const bitmapLR:Class = AdminInputSkin_bitmapLR;
public function AdminInputSkin(){
super(AdminInputSkin.bmpNL, AdminInputSkin.bmpNC, AdminInputSkin.bmpNR, AdminInputSkin.bmpOL, AdminInputSkin.bmpOC, AdminInputSkin.bmpOR, AdminInputSkin.bmpLL, AdminInputSkin.bmpLC, AdminInputSkin.bmpLR, AdminInputSkin.topMargin, AdminInputSkin.leftMargin, AdminInputSkin.rightMargin, AdminInputSkin.aaThickness, AdminInputSkin.aaSharpness, new TextFormat("Alternativa", 12, 0), new TextFormat("Alternativa", 12, 0x666666));
}
}
}//package com.alternativagame.gui.admin.skin.widget
Section 184
//AdminInputSkin_bitmapLC (com.alternativagame.gui.admin.skin.widget.AdminInputSkin_bitmapLC)
package com.alternativagame.gui.admin.skin.widget {
import mx.core.*;
public class AdminInputSkin_bitmapLC extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget
Section 185
//AdminInputSkin_bitmapLL (com.alternativagame.gui.admin.skin.widget.AdminInputSkin_bitmapLL)
package com.alternativagame.gui.admin.skin.widget {
import mx.core.*;
public class AdminInputSkin_bitmapLL extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget
Section 186
//AdminInputSkin_bitmapLR (com.alternativagame.gui.admin.skin.widget.AdminInputSkin_bitmapLR)
package com.alternativagame.gui.admin.skin.widget {
import mx.core.*;
public class AdminInputSkin_bitmapLR extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget
Section 187
//AdminInputSkin_bitmapNC (com.alternativagame.gui.admin.skin.widget.AdminInputSkin_bitmapNC)
package com.alternativagame.gui.admin.skin.widget {
import mx.core.*;
public class AdminInputSkin_bitmapNC extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget
Section 188
//AdminInputSkin_bitmapNL (com.alternativagame.gui.admin.skin.widget.AdminInputSkin_bitmapNL)
package com.alternativagame.gui.admin.skin.widget {
import mx.core.*;
public class AdminInputSkin_bitmapNL extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget
Section 189
//AdminInputSkin_bitmapNR (com.alternativagame.gui.admin.skin.widget.AdminInputSkin_bitmapNR)
package com.alternativagame.gui.admin.skin.widget {
import mx.core.*;
public class AdminInputSkin_bitmapNR extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget
Section 190
//AdminInputSkin_bitmapOC (com.alternativagame.gui.admin.skin.widget.AdminInputSkin_bitmapOC)
package com.alternativagame.gui.admin.skin.widget {
import mx.core.*;
public class AdminInputSkin_bitmapOC extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget
Section 191
//AdminInputSkin_bitmapOL (com.alternativagame.gui.admin.skin.widget.AdminInputSkin_bitmapOL)
package com.alternativagame.gui.admin.skin.widget {
import mx.core.*;
public class AdminInputSkin_bitmapOL extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget
Section 192
//AdminInputSkin_bitmapOR (com.alternativagame.gui.admin.skin.widget.AdminInputSkin_bitmapOR)
package com.alternativagame.gui.admin.skin.widget {
import mx.core.*;
public class AdminInputSkin_bitmapOR extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget
Section 193
//AdminLabelSkin (com.alternativagame.gui.admin.skin.widget.AdminLabelSkin)
package com.alternativagame.gui.admin.skin.widget {
import flash.text.*;
import com.alternativagame.gui.skin.widget.*;
public class AdminLabelSkin extends LabelSkin {
private static const aaSharpness:Number = -50;
private static const aaThickness:Number = 50;
private static const tfNormal:TextFormat = new TextFormat("Alternativa", 12, 0);
private static const tfLocked:TextFormat = new TextFormat("Alternativa", 12, 0x666666);
public function AdminLabelSkin(){
super(AdminLabelSkin.tfNormal, AdminLabelSkin.tfLocked, AdminLabelSkin.aaThickness, AdminLabelSkin.aaSharpness);
}
}
}//package com.alternativagame.gui.admin.skin.widget
Section 194
//AdminLineSkin (com.alternativagame.gui.admin.skin.widget.AdminLineSkin)
package com.alternativagame.gui.admin.skin.widget {
import flash.display.*;
import com.alternativagame.gui.skin.widget.*;
public class AdminLineSkin extends LineSkin {
private static const bmpHC:BitmapData = new bitmapHC().bitmapData;
private static const bmpVT:BitmapData = new bitmapVT().bitmapData;
private static const bitmapVM:Class = AdminLineSkin_bitmapVM;
private static const bitmapHC:Class = AdminLineSkin_bitmapHC;
private static const bitmapVT:Class = AdminLineSkin_bitmapVT;
private static const bmpHR:BitmapData = new bitmapHR().bitmapData;
private static const bmpHL:BitmapData = new bitmapHL().bitmapData;
private static const bmpVB:BitmapData = new bitmapVB().bitmapData;
private static const bitmapHL:Class = AdminLineSkin_bitmapHL;
private static const bitmapHR:Class = AdminLineSkin_bitmapHR;
private static const bitmapVB:Class = AdminLineSkin_bitmapVB;
private static const bmpVM:BitmapData = new bitmapVM().bitmapData;
public function AdminLineSkin(){
super(AdminLineSkin.bmpVT, AdminLineSkin.bmpVM, AdminLineSkin.bmpVB, AdminLineSkin.bmpHL, AdminLineSkin.bmpHC, AdminLineSkin.bmpHR);
}
}
}//package com.alternativagame.gui.admin.skin.widget
Section 195
//AdminLineSkin_bitmapHC (com.alternativagame.gui.admin.skin.widget.AdminLineSkin_bitmapHC)
package com.alternativagame.gui.admin.skin.widget {
import mx.core.*;
public class AdminLineSkin_bitmapHC extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget
Section 196
//AdminLineSkin_bitmapHL (com.alternativagame.gui.admin.skin.widget.AdminLineSkin_bitmapHL)
package com.alternativagame.gui.admin.skin.widget {
import mx.core.*;
public class AdminLineSkin_bitmapHL extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget
Section 197
//AdminLineSkin_bitmapHR (com.alternativagame.gui.admin.skin.widget.AdminLineSkin_bitmapHR)
package com.alternativagame.gui.admin.skin.widget {
import mx.core.*;
public class AdminLineSkin_bitmapHR extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget
Section 198
//AdminLineSkin_bitmapVB (com.alternativagame.gui.admin.skin.widget.AdminLineSkin_bitmapVB)
package com.alternativagame.gui.admin.skin.widget {
import mx.core.*;
public class AdminLineSkin_bitmapVB extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget
Section 199
//AdminLineSkin_bitmapVM (com.alternativagame.gui.admin.skin.widget.AdminLineSkin_bitmapVM)
package com.alternativagame.gui.admin.skin.widget {
import mx.core.*;
public class AdminLineSkin_bitmapVM extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget
Section 200
//AdminLineSkin_bitmapVT (com.alternativagame.gui.admin.skin.widget.AdminLineSkin_bitmapVT)
package com.alternativagame.gui.admin.skin.widget {
import mx.core.*;
public class AdminLineSkin_bitmapVT extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget
Section 201
//AdminNumberInputSkin (com.alternativagame.gui.admin.skin.widget.AdminNumberInputSkin)
package com.alternativagame.gui.admin.skin.widget {
import flash.display.*;
import com.alternativagame.gui.skin.widget.*;
public class AdminNumberInputSkin extends NumberInputSkin {
private static const decButtonLock:BitmapData = new bitmapDecButtonLock().bitmapData;
private static const bitmapIncButtonPress:Class = AdminNumberInputSkin_bitmapIncButtonPress;
private static const bitmapIncButtonNormal:Class = AdminNumberInputSkin_bitmapIncButtonNormal;
private static const bitmapIncButtonLock:Class = AdminNumberInputSkin_bitmapIncButtonLock;
private static const decButtonPress:BitmapData = new bitmapDecButtonPress().bitmapData;
private static const decButtonOver:BitmapData = new bitmapDecButtonOver().bitmapData;
private static const bitmapDecButtonOver:Class = AdminNumberInputSkin_bitmapDecButtonOver;
private static const decButtonNormal:BitmapData = new bitmapDecButtonNormal().bitmapData;
private static const bitmapDecButtonPress:Class = AdminNumberInputSkin_bitmapDecButtonPress;
private static const incButtonOver:BitmapData = new bitmapIncButtonOver().bitmapData;
private static const bitmapDecButtonNormal:Class = AdminNumberInputSkin_bitmapDecButtonNormal;
private static const bitmapDecButtonLock:Class = AdminNumberInputSkin_bitmapDecButtonLock;
private static const incButtonPress:BitmapData = new bitmapIncButtonPress().bitmapData;
private static const bitmapIncButtonOver:Class = AdminNumberInputSkin_bitmapIncButtonOver;
private static const incButtonNormal:BitmapData = new bitmapIncButtonNormal().bitmapData;
private static const incButtonLock:BitmapData = new bitmapIncButtonLock().bitmapData;
public function AdminNumberInputSkin(){
super(AdminNumberInputSkin.incButtonNormal, AdminNumberInputSkin.incButtonOver, AdminNumberInputSkin.incButtonPress, AdminNumberInputSkin.incButtonLock, AdminNumberInputSkin.decButtonNormal, AdminNumberInputSkin.decButtonOver, AdminNumberInputSkin.decButtonPress, AdminNumberInputSkin.decButtonLock);
}
}
}//package com.alternativagame.gui.admin.skin.widget
Section 202
//AdminNumberInputSkin_bitmapDecButtonLock (com.alternativagame.gui.admin.skin.widget.AdminNumberInputSkin_bitmapDecButtonLock)
package com.alternativagame.gui.admin.skin.widget {
import mx.core.*;
public class AdminNumberInputSkin_bitmapDecButtonLock extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget
Section 203
//AdminNumberInputSkin_bitmapDecButtonNormal (com.alternativagame.gui.admin.skin.widget.AdminNumberInputSkin_bitmapDecButtonNormal)
package com.alternativagame.gui.admin.skin.widget {
import mx.core.*;
public class AdminNumberInputSkin_bitmapDecButtonNormal extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget
Section 204
//AdminNumberInputSkin_bitmapDecButtonOver (com.alternativagame.gui.admin.skin.widget.AdminNumberInputSkin_bitmapDecButtonOver)
package com.alternativagame.gui.admin.skin.widget {
import mx.core.*;
public class AdminNumberInputSkin_bitmapDecButtonOver extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget
Section 205
//AdminNumberInputSkin_bitmapDecButtonPress (com.alternativagame.gui.admin.skin.widget.AdminNumberInputSkin_bitmapDecButtonPress)
package com.alternativagame.gui.admin.skin.widget {
import mx.core.*;
public class AdminNumberInputSkin_bitmapDecButtonPress extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget
Section 206
//AdminNumberInputSkin_bitmapIncButtonLock (com.alternativagame.gui.admin.skin.widget.AdminNumberInputSkin_bitmapIncButtonLock)
package com.alternativagame.gui.admin.skin.widget {
import mx.core.*;
public class AdminNumberInputSkin_bitmapIncButtonLock extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget
Section 207
//AdminNumberInputSkin_bitmapIncButtonNormal (com.alternativagame.gui.admin.skin.widget.AdminNumberInputSkin_bitmapIncButtonNormal)
package com.alternativagame.gui.admin.skin.widget {
import mx.core.*;
public class AdminNumberInputSkin_bitmapIncButtonNormal extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget
Section 208
//AdminNumberInputSkin_bitmapIncButtonOver (com.alternativagame.gui.admin.skin.widget.AdminNumberInputSkin_bitmapIncButtonOver)
package com.alternativagame.gui.admin.skin.widget {
import mx.core.*;
public class AdminNumberInputSkin_bitmapIncButtonOver extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget
Section 209
//AdminNumberInputSkin_bitmapIncButtonPress (com.alternativagame.gui.admin.skin.widget.AdminNumberInputSkin_bitmapIncButtonPress)
package com.alternativagame.gui.admin.skin.widget {
import mx.core.*;
public class AdminNumberInputSkin_bitmapIncButtonPress extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.widget
Section 210
//AdminTextSkin (com.alternativagame.gui.admin.skin.widget.AdminTextSkin)
package com.alternativagame.gui.admin.skin.widget {
import flash.text.*;
import com.alternativagame.gui.skin.widget.*;
public class AdminTextSkin extends TextSkin {
private static const aaSharpness:Number = -50;
private static const aaThickness:Number = 50;
private static const tfNormal:TextFormat = new TextFormat("Alternativa", 12, 0);
private static const tfLocked:TextFormat = new TextFormat("Alternativa", 12, 0x666666);
public function AdminTextSkin(){
super(AdminTextSkin.tfNormal, AdminTextSkin.tfLocked, AdminTextSkin.aaThickness, AdminTextSkin.aaSharpness);
}
}
}//package com.alternativagame.gui.admin.skin.widget
Section 211
//AdminPanelTitleSkin (com.alternativagame.gui.admin.skin.window.panel.AdminPanelTitleSkin)
package com.alternativagame.gui.admin.skin.window.panel {
import flash.display.*;
import flash.text.*;
import com.alternativagame.gui.skin.window.panel.*;
public class AdminPanelTitleSkin extends PanelTitleSkin {
private static const tfNormalOver:TextFormat = new TextFormat("Alternativa", 12, 0xFFFFFF);
private static const space:int = 10;
private static const tfActiveOver:TextFormat = new TextFormat("Alternativa", 12, 0xFFFFFF);
private static const marginRight:int = 10;
private static const bitmapMaximize:Class = AdminPanelTitleSkin_bitmapMaximize;
private static const tfActiveNormal:TextFormat = new TextFormat("Alternativa", 12, 0xFFFFFF);
private static const minimizeNormal:BitmapData = new bitmapMinimizeNormal().bitmapData;
private static const borderThickness:int = 1;
private static const bitmapNormalNC:Class = AdminPanelTitleSkin_bitmapNormalNC;
private static const bitmapNormalNL:Class = AdminPanelTitleSkin_bitmapNormalNL;
private static const iconMinimize:BitmapData = new bitmapMinimize().bitmapData;
private static const bitmapNormalNR:Class = AdminPanelTitleSkin_bitmapNormalNR;
private static const bitmapMinimizeNormal:Class = AdminPanelTitleSkin_bitmapMinimizeNormal;
private static const tfNormalNormal:TextFormat = new TextFormat("Alternativa", 12, 0xFFFFFF);
private static const titleSharpness:Number = -50;
private static const bitmapCloseNormal:Class = AdminPanelTitleSkin_bitmapCloseNormal;
private static const marginLeft:int = 10;
private static const controlButtonSpace:int = 2;
private static const normalNC:BitmapData = new bitmapNormalNC().bitmapData;
private static const normalNL:BitmapData = new bitmapNormalNL().bitmapData;
private static const tfNormalPressed:TextFormat = new TextFormat("Alternativa", 12, 0xFFFFFF);
private static const tfActivePressed:TextFormat = new TextFormat("Alternativa", 12, 0xFFFFFF);
private static const normalNR:BitmapData = new bitmapNormalNR().bitmapData;
private static const iconMaximize:BitmapData = new bitmapMaximize().bitmapData;
private static const bitmapMinimize:Class = AdminPanelTitleSkin_bitmapMinimize;
private static const titleThickness:Number = 50;
private static const closeNormal:BitmapData = new bitmapCloseNormal().bitmapData;
public function AdminPanelTitleSkin(){
super(AdminPanelTitleSkin.normalNL, AdminPanelTitleSkin.normalNC, AdminPanelTitleSkin.normalNR, AdminPanelTitleSkin.normalNL, AdminPanelTitleSkin.normalNC, AdminPanelTitleSkin.normalNR, AdminPanelTitleSkin.normalNL, AdminPanelTitleSkin.normalNC, AdminPanelTitleSkin.normalNR, AdminPanelTitleSkin.normalNL, AdminPanelTitleSkin.normalNC, AdminPanelTitleSkin.normalNR, AdminPanelTitleSkin.normalNL, AdminPanelTitleSkin.normalNC, AdminPanelTitleSkin.normalNR, AdminPanelTitleSkin.normalNL, AdminPanelTitleSkin.normalNC, AdminPanelTitleSkin.normalNR, AdminPanelTitleSkin.closeNormal, AdminPanelTitleSkin.closeNormal, AdminPanelTitleSkin.closeNormal, AdminPanelTitleSkin.closeNormal, AdminPanelTitleSkin.minimizeNormal, AdminPanelTitleSkin.minimizeNormal, AdminPanelTitleSkin.minimizeNormal, AdminPanelTitleSkin.minimizeNormal, AdminPanelTitleSkin.iconMinimize, AdminPanelTitleSkin.iconMaximize, AdminPanelTitleSkin.tfNormalNormal, AdminPanelTitleSkin.tfNormalOver, AdminPanelTitleSkin.tfNormalPressed, AdminPanelTitleSkin.tfActiveNormal, AdminPanelTitleSkin.tfActiveOver, AdminPanelTitleSkin.tfActivePressed, AdminPanelTitleSkin.titleSharpness, AdminPanelTitleSkin.titleThickness, AdminPanelTitleSkin.marginLeft, AdminPanelTitleSkin.marginRight, AdminPanelTitleSkin.space, AdminPanelTitleSkin.controlButtonSpace, AdminPanelTitleSkin.borderThickness);
}
}
}//package com.alternativagame.gui.admin.skin.window.panel
Section 212
//AdminPanelTitleSkin_bitmapCloseNormal (com.alternativagame.gui.admin.skin.window.panel.AdminPanelTitleSkin_bitmapCloseNormal)
package com.alternativagame.gui.admin.skin.window.panel {
import mx.core.*;
public class AdminPanelTitleSkin_bitmapCloseNormal extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window.panel
Section 213
//AdminPanelTitleSkin_bitmapMaximize (com.alternativagame.gui.admin.skin.window.panel.AdminPanelTitleSkin_bitmapMaximize)
package com.alternativagame.gui.admin.skin.window.panel {
import mx.core.*;
public class AdminPanelTitleSkin_bitmapMaximize extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window.panel
Section 214
//AdminPanelTitleSkin_bitmapMinimize (com.alternativagame.gui.admin.skin.window.panel.AdminPanelTitleSkin_bitmapMinimize)
package com.alternativagame.gui.admin.skin.window.panel {
import mx.core.*;
public class AdminPanelTitleSkin_bitmapMinimize extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window.panel
Section 215
//AdminPanelTitleSkin_bitmapMinimizeNormal (com.alternativagame.gui.admin.skin.window.panel.AdminPanelTitleSkin_bitmapMinimizeNormal)
package com.alternativagame.gui.admin.skin.window.panel {
import mx.core.*;
public class AdminPanelTitleSkin_bitmapMinimizeNormal extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window.panel
Section 216
//AdminPanelTitleSkin_bitmapNormalNC (com.alternativagame.gui.admin.skin.window.panel.AdminPanelTitleSkin_bitmapNormalNC)
package com.alternativagame.gui.admin.skin.window.panel {
import mx.core.*;
public class AdminPanelTitleSkin_bitmapNormalNC extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window.panel
Section 217
//AdminPanelTitleSkin_bitmapNormalNL (com.alternativagame.gui.admin.skin.window.panel.AdminPanelTitleSkin_bitmapNormalNL)
package com.alternativagame.gui.admin.skin.window.panel {
import mx.core.*;
public class AdminPanelTitleSkin_bitmapNormalNL extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window.panel
Section 218
//AdminPanelTitleSkin_bitmapNormalNR (com.alternativagame.gui.admin.skin.window.panel.AdminPanelTitleSkin_bitmapNormalNR)
package com.alternativagame.gui.admin.skin.window.panel {
import mx.core.*;
public class AdminPanelTitleSkin_bitmapNormalNR extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window.panel
Section 219
//AdminWindowSkin (com.alternativagame.gui.admin.skin.window.AdminWindowSkin)
package com.alternativagame.gui.admin.skin.window {
import flash.display.*;
import com.alternativagame.gui.skin.window.*;
public class AdminWindowSkin extends WindowSkin {
private static const cornerTRmargin:BitmapData = new bitmapTRmargin().bitmapData;
private static const bitmapMC:Class = AdminWindowSkin_bitmapMC;
private static const cornerTL:BitmapData = new bitmapTL().bitmapData;
private static const bitmapML:Class = AdminWindowSkin_bitmapML;
private static const containerMargin:int = 15;
private static const cornerTR:BitmapData = new bitmapTR().bitmapData;
private static const bitmapMR:Class = AdminWindowSkin_bitmapMR;
private static const titleSpace:int = 1;
private static const controlButtonMarginTop:int = 4;
private static const bgMC:BitmapData = new bitmapMC().bitmapData;
private static const closeActive:BitmapData = new bitmapCloseActive().bitmapData;
private static const controlButtonMarginRight:int = 4;
private static const edgeML:BitmapData = new bitmapML().bitmapData;
private static const controlButtonMarginLeft:int = 4;
private static const minimizeNormal:BitmapData = new bitmapMinimizeNormal().bitmapData;
private static const edgeMR:BitmapData = new bitmapMR().bitmapData;
private static const borderThickness:int = 0;
private static const bitmapBC:Class = AdminWindowSkin_bitmapBC;
private static const bitmapTRactive:Class = AdminWindowSkin_bitmapTRactive;
private static const bitmapTLactive:Class = AdminWindowSkin_bitmapTLactive;
private static const bitmapBL:Class = AdminWindowSkin_bitmapBL;
private static const bitmapMinimizeNormal:Class = AdminWindowSkin_bitmapMinimizeNormal;
private static const bitmapBR:Class = AdminWindowSkin_bitmapBR;
private static const edgeBC:BitmapData = new bitmapBC().bitmapData;
private static const minimizeActive:BitmapData = new bitmapMinimizeActive().bitmapData;
private static const bitmapCloseNormal:Class = AdminWindowSkin_bitmapCloseNormal;
private static const bitmapMinimizeActive:Class = AdminWindowSkin_bitmapMinimizeActive;
private static const bitmapTLmargin:Class = AdminWindowSkin_bitmapTLmargin;
private static const controlButtonSpace:int = 2;
private static const cornerTRactive:BitmapData = new bitmapTRactive().bitmapData;
private static const bitmapTRmargin:Class = AdminWindowSkin_bitmapTRmargin;
private static const bitmapTC:Class = AdminWindowSkin_bitmapTC;
private static const cornerBL:BitmapData = new bitmapBL().bitmapData;
private static const cornerTLactive:BitmapData = new bitmapTLactive().bitmapData;
private static const bitmapTCactive:Class = AdminWindowSkin_bitmapTCactive;
private static const bitmapTL:Class = AdminWindowSkin_bitmapTL;
private static const cornerBR:BitmapData = new bitmapBR().bitmapData;
private static const bitmapTR:Class = AdminWindowSkin_bitmapTR;
private static const bitmapCloseActive:Class = AdminWindowSkin_bitmapCloseActive;
private static const edgeTC:BitmapData = new bitmapTC().bitmapData;
private static const edgeTCactive:BitmapData = new bitmapTCactive().bitmapData;
private static const titleMargin:int = 0;
private static const cornerTLmargin:BitmapData = new bitmapTLmargin().bitmapData;
private static const closeNormal:BitmapData = new bitmapCloseNormal().bitmapData;
public function AdminWindowSkin(){
super(AdminWindowSkin.cornerTL, AdminWindowSkin.cornerTLactive, AdminWindowSkin.cornerTLmargin, AdminWindowSkin.cornerTR, AdminWindowSkin.cornerTRactive, AdminWindowSkin.cornerTRmargin, AdminWindowSkin.cornerBL, AdminWindowSkin.cornerBR, AdminWindowSkin.edgeTC, AdminWindowSkin.edgeTCactive, AdminWindowSkin.edgeML, AdminWindowSkin.edgeMR, AdminWindowSkin.edgeBC, AdminWindowSkin.bgMC, AdminWindowSkin.closeNormal, AdminWindowSkin.closeNormal, AdminWindowSkin.closeActive, AdminWindowSkin.closeActive, AdminWindowSkin.minimizeNormal, AdminWindowSkin.minimizeNormal, AdminWindowSkin.minimizeActive, AdminWindowSkin.minimizeActive, AdminWindowSkin.containerMargin, AdminWindowSkin.titleMargin, AdminWindowSkin.titleSpace, AdminWindowSkin.controlButtonMarginLeft, AdminWindowSkin.controlButtonMarginTop, AdminWindowSkin.controlButtonMarginRight, AdminWindowSkin.controlButtonSpace, AdminWindowSkin.borderThickness);
}
}
}//package com.alternativagame.gui.admin.skin.window
Section 220
//AdminWindowSkin_bitmapBC (com.alternativagame.gui.admin.skin.window.AdminWindowSkin_bitmapBC)
package com.alternativagame.gui.admin.skin.window {
import mx.core.*;
public class AdminWindowSkin_bitmapBC extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window
Section 221
//AdminWindowSkin_bitmapBL (com.alternativagame.gui.admin.skin.window.AdminWindowSkin_bitmapBL)
package com.alternativagame.gui.admin.skin.window {
import mx.core.*;
public class AdminWindowSkin_bitmapBL extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window
Section 222
//AdminWindowSkin_bitmapBR (com.alternativagame.gui.admin.skin.window.AdminWindowSkin_bitmapBR)
package com.alternativagame.gui.admin.skin.window {
import mx.core.*;
public class AdminWindowSkin_bitmapBR extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window
Section 223
//AdminWindowSkin_bitmapCloseActive (com.alternativagame.gui.admin.skin.window.AdminWindowSkin_bitmapCloseActive)
package com.alternativagame.gui.admin.skin.window {
import mx.core.*;
public class AdminWindowSkin_bitmapCloseActive extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window
Section 224
//AdminWindowSkin_bitmapCloseNormal (com.alternativagame.gui.admin.skin.window.AdminWindowSkin_bitmapCloseNormal)
package com.alternativagame.gui.admin.skin.window {
import mx.core.*;
public class AdminWindowSkin_bitmapCloseNormal extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window
Section 225
//AdminWindowSkin_bitmapMC (com.alternativagame.gui.admin.skin.window.AdminWindowSkin_bitmapMC)
package com.alternativagame.gui.admin.skin.window {
import mx.core.*;
public class AdminWindowSkin_bitmapMC extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window
Section 226
//AdminWindowSkin_bitmapMinimizeActive (com.alternativagame.gui.admin.skin.window.AdminWindowSkin_bitmapMinimizeActive)
package com.alternativagame.gui.admin.skin.window {
import mx.core.*;
public class AdminWindowSkin_bitmapMinimizeActive extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window
Section 227
//AdminWindowSkin_bitmapMinimizeNormal (com.alternativagame.gui.admin.skin.window.AdminWindowSkin_bitmapMinimizeNormal)
package com.alternativagame.gui.admin.skin.window {
import mx.core.*;
public class AdminWindowSkin_bitmapMinimizeNormal extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window
Section 228
//AdminWindowSkin_bitmapML (com.alternativagame.gui.admin.skin.window.AdminWindowSkin_bitmapML)
package com.alternativagame.gui.admin.skin.window {
import mx.core.*;
public class AdminWindowSkin_bitmapML extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window
Section 229
//AdminWindowSkin_bitmapMR (com.alternativagame.gui.admin.skin.window.AdminWindowSkin_bitmapMR)
package com.alternativagame.gui.admin.skin.window {
import mx.core.*;
public class AdminWindowSkin_bitmapMR extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window
Section 230
//AdminWindowSkin_bitmapTC (com.alternativagame.gui.admin.skin.window.AdminWindowSkin_bitmapTC)
package com.alternativagame.gui.admin.skin.window {
import mx.core.*;
public class AdminWindowSkin_bitmapTC extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window
Section 231
//AdminWindowSkin_bitmapTCactive (com.alternativagame.gui.admin.skin.window.AdminWindowSkin_bitmapTCactive)
package com.alternativagame.gui.admin.skin.window {
import mx.core.*;
public class AdminWindowSkin_bitmapTCactive extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window
Section 232
//AdminWindowSkin_bitmapTL (com.alternativagame.gui.admin.skin.window.AdminWindowSkin_bitmapTL)
package com.alternativagame.gui.admin.skin.window {
import mx.core.*;
public class AdminWindowSkin_bitmapTL extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window
Section 233
//AdminWindowSkin_bitmapTLactive (com.alternativagame.gui.admin.skin.window.AdminWindowSkin_bitmapTLactive)
package com.alternativagame.gui.admin.skin.window {
import mx.core.*;
public class AdminWindowSkin_bitmapTLactive extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window
Section 234
//AdminWindowSkin_bitmapTLmargin (com.alternativagame.gui.admin.skin.window.AdminWindowSkin_bitmapTLmargin)
package com.alternativagame.gui.admin.skin.window {
import mx.core.*;
public class AdminWindowSkin_bitmapTLmargin extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window
Section 235
//AdminWindowSkin_bitmapTR (com.alternativagame.gui.admin.skin.window.AdminWindowSkin_bitmapTR)
package com.alternativagame.gui.admin.skin.window {
import mx.core.*;
public class AdminWindowSkin_bitmapTR extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window
Section 236
//AdminWindowSkin_bitmapTRactive (com.alternativagame.gui.admin.skin.window.AdminWindowSkin_bitmapTRactive)
package com.alternativagame.gui.admin.skin.window {
import mx.core.*;
public class AdminWindowSkin_bitmapTRactive extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window
Section 237
//AdminWindowSkin_bitmapTRmargin (com.alternativagame.gui.admin.skin.window.AdminWindowSkin_bitmapTRmargin)
package com.alternativagame.gui.admin.skin.window {
import mx.core.*;
public class AdminWindowSkin_bitmapTRmargin extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window
Section 238
//AdminWindowTitleSkin (com.alternativagame.gui.admin.skin.window.AdminWindowTitleSkin)
package com.alternativagame.gui.admin.skin.window {
import flash.display.*;
import flash.text.*;
import com.alternativagame.gui.skin.window.*;
public class AdminWindowTitleSkin extends WindowTitleSkin {
private static const normalOL:BitmapData = new bitmapNormalOL().bitmapData;
private static const space:int = 10;
private static const normalOR:BitmapData = new bitmapNormalOR().bitmapData;
private static const tfActiveOver:TextFormat = new TextFormat("Alternativa", 12, 0xFFFFFF);
private static const marginRight:int = 8;
private static const normalPC:BitmapData = new bitmapNormalPC().bitmapData;
private static const closeActive:BitmapData = new bitmapCloseActive().bitmapData;
private static const tfActiveNormal:TextFormat = new TextFormat("Alternativa", 12, 0xFFFFFF);
private static const normalPL:BitmapData = new bitmapNormalPL().bitmapData;
private static const minimizeNormal:BitmapData = new bitmapMinimizeNormal().bitmapData;
private static const normalPR:BitmapData = new bitmapNormalPR().bitmapData;
private static const bitmapNormalNC:Class = AdminWindowTitleSkin_bitmapNormalNC;
private static const bitmapMinimizeNormal:Class = AdminWindowTitleSkin_bitmapMinimizeNormal;
private static const bitmapNormalNR:Class = AdminWindowTitleSkin_bitmapNormalNR;
private static const bitmapNormalNL:Class = AdminWindowTitleSkin_bitmapNormalNL;
private static const tfNormalNormal:TextFormat = new TextFormat("Alternativa", 12, 0x666666);
private static const activeNC:BitmapData = new bitmapActiveNC().bitmapData;
private static const activeNL:BitmapData = new bitmapActiveNL().bitmapData;
private static const minimizeActive:BitmapData = new bitmapMinimizeActive().bitmapData;
private static const bitmapCloseNormal:Class = AdminWindowTitleSkin_bitmapCloseNormal;
private static const bitmapNormalOC:Class = AdminWindowTitleSkin_bitmapNormalOC;
private static const bitmapNormalOL:Class = AdminWindowTitleSkin_bitmapNormalOL;
private static const controlButtonSpace:int = 0;
private static const bitmapNormalOR:Class = AdminWindowTitleSkin_bitmapNormalOR;
private static const bitmapMinimizeActive:Class = AdminWindowTitleSkin_bitmapMinimizeActive;
private static const activeNR:BitmapData = new bitmapActiveNR().bitmapData;
private static const activeOL:BitmapData = new bitmapActiveOL().bitmapData;
private static const activeOR:BitmapData = new bitmapActiveOR().bitmapData;
private static const tfNormalOver:TextFormat = new TextFormat("Alternativa", 12, 0);
private static const bitmapNormalPC:Class = AdminWindowTitleSkin_bitmapNormalPC;
private static const bitmapNormalPL:Class = AdminWindowTitleSkin_bitmapNormalPL;
private static const bitmapNormalPR:Class = AdminWindowTitleSkin_bitmapNormalPR;
private static const activePC:BitmapData = new bitmapActivePC().bitmapData;
private static const activeOC:BitmapData = new bitmapActiveOC().bitmapData;
private static const bitmapCloseActive:Class = AdminWindowTitleSkin_bitmapCloseActive;
private static const activePL:BitmapData = new bitmapActivePL().bitmapData;
private static const bitmapActiveNC:Class = AdminWindowTitleSkin_bitmapActiveNC;
private static const activePR:BitmapData = new bitmapActivePR().bitmapData;
private static const bitmapActiveNL:Class = AdminWindowTitleSkin_bitmapActiveNL;
private static const bitmapActiveNR:Class = AdminWindowTitleSkin_bitmapActiveNR;
private static const borderThickness:int = 0;
private static const bitmapActiveOC:Class = AdminWindowTitleSkin_bitmapActiveOC;
private static const bitmapActiveOL:Class = AdminWindowTitleSkin_bitmapActiveOL;
private static const bitmapActiveOR:Class = AdminWindowTitleSkin_bitmapActiveOR;
private static const bitmapActivePC:Class = AdminWindowTitleSkin_bitmapActivePC;
private static const titleSharpness:Number = -50;
private static const bitmapActivePL:Class = AdminWindowTitleSkin_bitmapActivePL;
private static const marginLeft:int = 10;
private static const bitmapActivePR:Class = AdminWindowTitleSkin_bitmapActivePR;
private static const normalNC:BitmapData = new bitmapNormalNC().bitmapData;
private static const normalNL:BitmapData = new bitmapNormalNL().bitmapData;
private static const tfNormalPressed:TextFormat = new TextFormat("Alternativa", 12, 0);
private static const tfActivePressed:TextFormat = new TextFormat("Alternativa", 12, 0xFFFFFF);
private static const normalNR:BitmapData = new bitmapNormalNR().bitmapData;
private static const normalOC:BitmapData = new bitmapNormalOC().bitmapData;
private static const titleThickness:Number = 50;
private static const closeNormal:BitmapData = new bitmapCloseNormal().bitmapData;
public function AdminWindowTitleSkin(){
super(AdminWindowTitleSkin.normalNL, AdminWindowTitleSkin.normalNC, AdminWindowTitleSkin.normalNR, AdminWindowTitleSkin.normalOL, AdminWindowTitleSkin.normalOC, AdminWindowTitleSkin.normalOR, AdminWindowTitleSkin.normalPL, AdminWindowTitleSkin.normalPC, AdminWindowTitleSkin.normalPR, AdminWindowTitleSkin.activeNL, AdminWindowTitleSkin.activeNC, AdminWindowTitleSkin.activeNR, AdminWindowTitleSkin.activeOL, AdminWindowTitleSkin.activeOC, AdminWindowTitleSkin.activeOR, AdminWindowTitleSkin.activePL, AdminWindowTitleSkin.activePC, AdminWindowTitleSkin.activePR, AdminWindowTitleSkin.closeNormal, AdminWindowTitleSkin.closeNormal, AdminWindowTitleSkin.closeActive, AdminWindowTitleSkin.closeActive, AdminWindowTitleSkin.minimizeNormal, AdminWindowTitleSkin.minimizeNormal, AdminWindowTitleSkin.minimizeActive, AdminWindowTitleSkin.minimizeActive, AdminWindowTitleSkin.tfNormalNormal, AdminWindowTitleSkin.tfNormalOver, AdminWindowTitleSkin.tfNormalPressed, AdminWindowTitleSkin.tfActiveNormal, AdminWindowTitleSkin.tfActiveOver, AdminWindowTitleSkin.tfActivePressed, AdminWindowTitleSkin.titleSharpness, AdminWindowTitleSkin.titleThickness, AdminWindowTitleSkin.marginLeft, AdminWindowTitleSkin.marginRight, AdminWindowTitleSkin.space, AdminWindowTitleSkin.controlButtonSpace, AdminWindowTitleSkin.borderThickness);
}
}
}//package com.alternativagame.gui.admin.skin.window
Section 239
//AdminWindowTitleSkin_bitmapActiveNC (com.alternativagame.gui.admin.skin.window.AdminWindowTitleSkin_bitmapActiveNC)
package com.alternativagame.gui.admin.skin.window {
import mx.core.*;
public class AdminWindowTitleSkin_bitmapActiveNC extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window
Section 240
//AdminWindowTitleSkin_bitmapActiveNL (com.alternativagame.gui.admin.skin.window.AdminWindowTitleSkin_bitmapActiveNL)
package com.alternativagame.gui.admin.skin.window {
import mx.core.*;
public class AdminWindowTitleSkin_bitmapActiveNL extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window
Section 241
//AdminWindowTitleSkin_bitmapActiveNR (com.alternativagame.gui.admin.skin.window.AdminWindowTitleSkin_bitmapActiveNR)
package com.alternativagame.gui.admin.skin.window {
import mx.core.*;
public class AdminWindowTitleSkin_bitmapActiveNR extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window
Section 242
//AdminWindowTitleSkin_bitmapActiveOC (com.alternativagame.gui.admin.skin.window.AdminWindowTitleSkin_bitmapActiveOC)
package com.alternativagame.gui.admin.skin.window {
import mx.core.*;
public class AdminWindowTitleSkin_bitmapActiveOC extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window
Section 243
//AdminWindowTitleSkin_bitmapActiveOL (com.alternativagame.gui.admin.skin.window.AdminWindowTitleSkin_bitmapActiveOL)
package com.alternativagame.gui.admin.skin.window {
import mx.core.*;
public class AdminWindowTitleSkin_bitmapActiveOL extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window
Section 244
//AdminWindowTitleSkin_bitmapActiveOR (com.alternativagame.gui.admin.skin.window.AdminWindowTitleSkin_bitmapActiveOR)
package com.alternativagame.gui.admin.skin.window {
import mx.core.*;
public class AdminWindowTitleSkin_bitmapActiveOR extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window
Section 245
//AdminWindowTitleSkin_bitmapActivePC (com.alternativagame.gui.admin.skin.window.AdminWindowTitleSkin_bitmapActivePC)
package com.alternativagame.gui.admin.skin.window {
import mx.core.*;
public class AdminWindowTitleSkin_bitmapActivePC extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window
Section 246
//AdminWindowTitleSkin_bitmapActivePL (com.alternativagame.gui.admin.skin.window.AdminWindowTitleSkin_bitmapActivePL)
package com.alternativagame.gui.admin.skin.window {
import mx.core.*;
public class AdminWindowTitleSkin_bitmapActivePL extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window
Section 247
//AdminWindowTitleSkin_bitmapActivePR (com.alternativagame.gui.admin.skin.window.AdminWindowTitleSkin_bitmapActivePR)
package com.alternativagame.gui.admin.skin.window {
import mx.core.*;
public class AdminWindowTitleSkin_bitmapActivePR extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window
Section 248
//AdminWindowTitleSkin_bitmapCloseActive (com.alternativagame.gui.admin.skin.window.AdminWindowTitleSkin_bitmapCloseActive)
package com.alternativagame.gui.admin.skin.window {
import mx.core.*;
public class AdminWindowTitleSkin_bitmapCloseActive extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window
Section 249
//AdminWindowTitleSkin_bitmapCloseNormal (com.alternativagame.gui.admin.skin.window.AdminWindowTitleSkin_bitmapCloseNormal)
package com.alternativagame.gui.admin.skin.window {
import mx.core.*;
public class AdminWindowTitleSkin_bitmapCloseNormal extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window
Section 250
//AdminWindowTitleSkin_bitmapMinimizeActive (com.alternativagame.gui.admin.skin.window.AdminWindowTitleSkin_bitmapMinimizeActive)
package com.alternativagame.gui.admin.skin.window {
import mx.core.*;
public class AdminWindowTitleSkin_bitmapMinimizeActive extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window
Section 251
//AdminWindowTitleSkin_bitmapMinimizeNormal (com.alternativagame.gui.admin.skin.window.AdminWindowTitleSkin_bitmapMinimizeNormal)
package com.alternativagame.gui.admin.skin.window {
import mx.core.*;
public class AdminWindowTitleSkin_bitmapMinimizeNormal extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window
Section 252
//AdminWindowTitleSkin_bitmapNormalNC (com.alternativagame.gui.admin.skin.window.AdminWindowTitleSkin_bitmapNormalNC)
package com.alternativagame.gui.admin.skin.window {
import mx.core.*;
public class AdminWindowTitleSkin_bitmapNormalNC extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window
Section 253
//AdminWindowTitleSkin_bitmapNormalNL (com.alternativagame.gui.admin.skin.window.AdminWindowTitleSkin_bitmapNormalNL)
package com.alternativagame.gui.admin.skin.window {
import mx.core.*;
public class AdminWindowTitleSkin_bitmapNormalNL extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window
Section 254
//AdminWindowTitleSkin_bitmapNormalNR (com.alternativagame.gui.admin.skin.window.AdminWindowTitleSkin_bitmapNormalNR)
package com.alternativagame.gui.admin.skin.window {
import mx.core.*;
public class AdminWindowTitleSkin_bitmapNormalNR extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window
Section 255
//AdminWindowTitleSkin_bitmapNormalOC (com.alternativagame.gui.admin.skin.window.AdminWindowTitleSkin_bitmapNormalOC)
package com.alternativagame.gui.admin.skin.window {
import mx.core.*;
public class AdminWindowTitleSkin_bitmapNormalOC extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window
Section 256
//AdminWindowTitleSkin_bitmapNormalOL (com.alternativagame.gui.admin.skin.window.AdminWindowTitleSkin_bitmapNormalOL)
package com.alternativagame.gui.admin.skin.window {
import mx.core.*;
public class AdminWindowTitleSkin_bitmapNormalOL extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window
Section 257
//AdminWindowTitleSkin_bitmapNormalOR (com.alternativagame.gui.admin.skin.window.AdminWindowTitleSkin_bitmapNormalOR)
package com.alternativagame.gui.admin.skin.window {
import mx.core.*;
public class AdminWindowTitleSkin_bitmapNormalOR extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window
Section 258
//AdminWindowTitleSkin_bitmapNormalPC (com.alternativagame.gui.admin.skin.window.AdminWindowTitleSkin_bitmapNormalPC)
package com.alternativagame.gui.admin.skin.window {
import mx.core.*;
public class AdminWindowTitleSkin_bitmapNormalPC extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window
Section 259
//AdminWindowTitleSkin_bitmapNormalPL (com.alternativagame.gui.admin.skin.window.AdminWindowTitleSkin_bitmapNormalPL)
package com.alternativagame.gui.admin.skin.window {
import mx.core.*;
public class AdminWindowTitleSkin_bitmapNormalPL extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window
Section 260
//AdminWindowTitleSkin_bitmapNormalPR (com.alternativagame.gui.admin.skin.window.AdminWindowTitleSkin_bitmapNormalPR)
package com.alternativagame.gui.admin.skin.window {
import mx.core.*;
public class AdminWindowTitleSkin_bitmapNormalPR extends BitmapAsset {
}
}//package com.alternativagame.gui.admin.skin.window
Section 261
//DialogWindow (com.alternativagame.gui.admin.window.DialogWindow)
package com.alternativagame.gui.admin.window {
import com.alternativagame.gui.window.*;
import com.alternativagame.gui.container.*;
public class DialogWindow extends DialogWindowBase {
private var titleMinimizeable:Boolean;
private var titleCloseable:Boolean;
public function DialogWindow(_arg1:String=null, _arg2:uint=0, _arg3:uint=0, _arg4:Boolean=true, _arg5:Boolean=true, _arg6:Boolean=false){
titleMinimizeable = _arg6;
titleCloseable = _arg5;
super(_arg2, _arg3, _arg4, true, _arg1, false, false);
}
override protected function createTitle(_arg1:Container, _arg2:String, _arg3:Boolean):WindowTitleBase{
return (new WindowTitle(_arg1, _arg2, titleCloseable, titleMinimizeable, true));
}
}
}//package com.alternativagame.gui.admin.window
Section 262
//WindowTitle (com.alternativagame.gui.admin.window.WindowTitle)
package com.alternativagame.gui.admin.window {
import com.alternativagame.gui.window.*;
import com.alternativagame.gui.container.*;
public class WindowTitle extends WindowTitleBase {
public function WindowTitle(_arg1:Container, _arg2:String=null, _arg3:Boolean=false, _arg4:Boolean=false, _arg5:Boolean=false){
super(_arg1, _arg2, _arg3, _arg4, _arg5);
stretchableH = true;
}
}
}//package com.alternativagame.gui.admin.window
Section 263
//AdminSkinManager (com.alternativagame.gui.admin.AdminSkinManager)
package com.alternativagame.gui.admin {
import com.alternativagame.gui.skin.*;
import com.alternativagame.gui.window.*;
import com.alternativagame.gui.widget.button.*;
import com.alternativagame.gui.widget.list.*;
import com.alternativagame.gui.widget.tree.*;
import com.alternativagame.gui.container.scroller.*;
import com.alternativagame.gui.widget.*;
import com.alternativagame.gui.admin.skin.widget.scroll.*;
import com.alternativagame.gui.admin.skin.widget.tree.*;
import com.alternativagame.gui.admin.skin.widget.*;
import com.alternativagame.gui.window.panel.*;
import com.alternativagame.gui.admin.skin.widget.list.*;
import com.alternativagame.gui.admin.skin.container.group.*;
import com.alternativagame.gui.admin.skin.widget.comboBox.*;
import com.alternativagame.gui.admin.skin.widget.button.*;
import com.alternativagame.gui.admin.skin.window.*;
import com.alternativagame.gui.container.group.*;
import com.alternativagame.gui.admin.skin.window.panel.*;
import com.alternativagame.gui.widget.comboBox.*;
public class AdminSkinManager extends SkinManager {
public function AdminSkinManager(){
addSkin(new AdminImageSkin(), Image);
addSkin(new AdminInputSkin(), Input);
addSkin(new AdminLabelSkin(), Label);
addSkin(new AdminLineSkin(), Line);
addSkin(new AdminTextSkin(), Text);
addSkin(new AdminImageButtonSkin(), ImageButton);
addSkin(new AdminListItemSkin(), ListItem);
addSkin(new AdminTreeGraphicsSkin(), TreeGraphics);
addSkin(new AdminTreeItemSkin(), TreeItem);
addSkin(new AdminCheckBoxSkin(), CheckBox);
addSkin(new AdminRadioButtonSkin(), RadioButton);
addSkin(new AdminFrameGroupSkin(), FrameGroup);
addSkin(new AdminGroupSkin(), GroupBase);
addSkin(new AdminComboBoxSkin(), ComboBox);
addSkin(new AdminNumberInputSkin(), NumberInput);
addSkin(new AdminSwitchSkin(), ButtonSwitch);
addSkin(new AdminWindowSkin(), ResizeablePanelBase);
addSkin(new AdminPanelTitleSkin(), PanelTitleBase);
addSkin(new AdminButtonSkin(), Button);
addSkin(new AdminScrollBarSkin(), ScrollBar);
addSkin(new AdminScrollBoxSkin(), ScrollBox);
addSkin(new AdminScrollerSkin(), Scroller);
addSkin(new AdminWindowSkin(), WindowBase);
addSkin(new AdminWindowTitleSkin(), WindowTitleBase);
addSkin(new AdminSliderSkin(), Slider);
}
}
}//package com.alternativagame.gui.admin
Section 264
//Dummy (com.alternativagame.gui.base.Dummy)
package com.alternativagame.gui.base {
public class Dummy extends GUIObject {
public function Dummy(_arg1:int, _arg2:int, _arg3:Boolean, _arg4:Boolean=false){
minSize.x = _arg1;
minSize.y = _arg2;
this.stretchableH = _arg3;
this.stretchableV = _arg4;
}
}
}//package com.alternativagame.gui.base
Section 265
//GUIObject (com.alternativagame.gui.base.GUIObject)
package com.alternativagame.gui.base {
import flash.geom.*;
import flash.display.*;
import com.alternativagame.gui.skin.*;
import flash.utils.*;
import com.alternativagame.gui.layout.enums.*;
public class GUIObject extends Sprite implements IGUIObject {
public var isSkined:Boolean;
protected var _stretchableH:Boolean;
private var _skinManager:SkinManager;
private var _minSize:Point;
protected var _stretchableV:Boolean;
private var skinObjects:Dictionary;
protected var _currentSize:Point;
protected var _rootObject:IGUIObject;
public function GUIObject(){
skinObjects = new Dictionary(true);
_currentSize = new Point();
_minSize = new Point();
_stretchableH = false;
_stretchableV = false;
isSkined = false;
}
public function set rootObject(_arg1:IGUIObject):void{
var _local2:IGUIObject;
_rootObject = _arg1;
for each (_local2 in this) {
IGUIObject(_local2).rootObject = _arg1;
};
}
override public function toString():String{
var _local1:String = new String();
_local1 = (_local1 + (("[" + getQualifiedClassName(this)) + "]"));
_local1 = (_local1 + "\n");
_local1 = (_local1 + ("currentSize:" + this._currentSize));
_local1 = (_local1 + "\n");
_local1 = (_local1 + ("stretchableH:" + isStretchable(Direction.HORIZONTAL)));
_local1 = (_local1 + "\n");
_local1 = (_local1 + ("stretchableV:" + isStretchable(Direction.VERTICAL)));
return (_local1);
}
public function repaint(_arg1:Point):void{
draw(computeSize(_arg1));
}
override public function set width(_arg1:Number):void{
if (super.width != _arg1){
super.width = _arg1;
};
}
override public function addChildAt(_arg1:DisplayObject, _arg2:int):DisplayObject{
addSkinnableObject(_arg1);
super.addChildAt(_arg1, _arg2);
return (this);
}
public function repaintCurrentSize():void{
draw(computeSize(currentSize));
}
public function set stretchableH(_arg1:Boolean):void{
_stretchableH = _arg1;
}
public function get currentSize():Point{
return (_currentSize);
}
public function addSkinnableObject(_arg1:DisplayObject):void{
if ((_arg1 is IGUIObject)){
skinObjects[_arg1] = _arg1;
if (skinManager != null){
IGUIObject(_arg1).skinManager = skinManager;
};
};
}
public function set stretchableV(_arg1:Boolean):void{
_stretchableV = _arg1;
}
public function get rootObject():IGUIObject{
return (_rootObject);
}
public function draw(_arg1:Point):void{
_currentSize = _arg1.clone();
}
override public function set height(_arg1:Number):void{
if (super.height != _arg1){
super.height = _arg1;
};
}
public function isStretchable(_arg1:Boolean):Boolean{
return (((_arg1 == Direction.VERTICAL)) ? _stretchableV : _stretchableH);
}
public function computeSize(_arg1:Point):Point{
var _local2:Point = minSize.clone();
if (_arg1 != null){
_local2.x = (isStretchable(Direction.HORIZONTAL)) ? Math.max(_arg1.x, minSize.x) : minSize.x;
_local2.y = (isStretchable(Direction.VERTICAL)) ? Math.max(_arg1.y, minSize.y) : minSize.y;
};
return (_local2);
}
public function removeSkinnableObject(_arg1:DisplayObject):void{
delete skinObjects[_arg1];
}
public function updateSkin():void{
isSkined = true;
}
public function set skinManager(_arg1:SkinManager):void{
var _local2:IGUIObject;
_skinManager = _arg1;
for each (_local2 in skinObjects) {
_local2.skinManager = _arg1;
};
updateSkin();
}
override public function set y(_arg1:Number):void{
if (super.y != _arg1){
super.y = _arg1;
};
}
override public function set x(_arg1:Number):void{
if (super.x != _arg1){
super.x = _arg1;
};
}
public function get minSize():Point{
return (_minSize);
}
override public function addChild(_arg1:DisplayObject):DisplayObject{
addSkinnableObject(_arg1);
if ((((_arg1 is IGUIObject)) && (!((this.rootObject == null))))){
IGUIObject(_arg1).rootObject = this.rootObject;
};
super.addChild(_arg1);
return (this);
}
public function get skinManager():SkinManager{
var _local1:SkinManager;
if ((((((_skinManager == null)) && (!((parent == null))))) && ((parent is GUIObject)))){
_local1 = GUIObject(parent).skinManager;
} else {
_local1 = _skinManager;
};
return (_local1);
}
}
}//package com.alternativagame.gui.base
Section 266
//IGUIObject (com.alternativagame.gui.base.IGUIObject)
package com.alternativagame.gui.base {
import flash.geom.*;
import com.alternativagame.gui.skin.*;
public interface IGUIObject {
function set skinManager(_arg1:SkinManager):void;
function get rootObject():IGUIObject;
function set rootObject(_arg1:IGUIObject):void;
function draw(_arg1:Point):void;
function updateSkin():void;
function set x(_arg1:Number):void;
function set y(_arg1:Number):void;
function get minSize():Point;
function isStretchable(_arg1:Boolean):Boolean;
function get skinManager():SkinManager;
function computeSize(_arg1:Point):Point;
function get y():Number;
function get currentSize():Point;
function get x():Number;
}
}//package com.alternativagame.gui.base
Section 267
//MoveableBase (com.alternativagame.gui.base.MoveableBase)
package com.alternativagame.gui.base {
import flash.geom.*;
import flash.events.*;
import flash.display.*;
import com.alternativagame.gui.layout.*;
import com.alternativagame.gui.cursor.*;
import com.alternativagame.utility.*;
import com.alternativagame.gui.layout.enums.*;
import flash.ui.*;
public class MoveableBase extends GUIObject implements ISnapable {
private var pivot:Point;
private var _moveable:Boolean;
private var _snapEnabled:Boolean;
private var _autoTopEnabled:Boolean;
private var _moveArea:InteractiveObject;
private var oldCoords:Point;
private var _snapRect:Rectangle;
private var oldCacheAsBitmap:Boolean;
public function MoveableBase(){
snapEnabled = true;
autoTopEnabled = true;
}
private function onMoveOut(_arg1:MouseEvent):void{
Cursor.change(Cursor.NORMAL);
}
public function set moveArea(_arg1:InteractiveObject):void{
if (_moveArea != null){
_moveArea.removeEventListener(MouseEvent.MOUSE_DOWN, onStartMove);
if (!(_moveArea is ICursorActive)){
_moveArea.removeEventListener(MouseEvent.MOUSE_OVER, onMoveOver);
_moveArea.removeEventListener(MouseEvent.MOUSE_OUT, onMoveOut);
};
};
_moveArea = _arg1;
if (_arg1 != null){
_arg1.addEventListener(MouseEvent.MOUSE_DOWN, onStartMove);
if (!(_arg1 is ICursorActive)){
_arg1.addEventListener(MouseEvent.MOUSE_OVER, onMoveOver);
_arg1.addEventListener(MouseEvent.MOUSE_OUT, onMoveOut);
};
};
}
protected function updateCoords():void{
}
private function onMoveOver(_arg1:MouseEvent):void{
Cursor.change(Cursor.MOVE);
}
private function onStartMove(_arg1:MouseEvent):void{
oldCacheAsBitmap = cacheAsBitmap;
cacheAsBitmap = true;
pivot = MouseUtility.localCoords(this);
oldCoords = new Point(x, y);
stage.addEventListener(MouseEvent.MOUSE_MOVE, onMove);
stage.addEventListener(MouseEvent.MOUSE_UP, onStopMove);
stage.addEventListener(KeyboardEvent.KEY_DOWN, onCancelMove);
}
public function get snapRect():Rectangle{
var _local1:Rectangle = ((_snapRect)==null) ? new Rectangle(0, 0, width, height) : _snapRect;
return (_local1);
}
private function onMove(_arg1:MouseEvent):void{
var _local2:Point = MouseUtility.localCoords(this);
x = (x + Math.floor((_local2.x - pivot.x)));
y = (y + Math.floor((_local2.y - pivot.y)));
if (snapEnabled){
x = (x + SnapHelper.snapOffset(this, parent, Direction.HORIZONTAL));
y = (y + SnapHelper.snapOffset(this, parent, Direction.VERTICAL));
x = (x + SnapHelper.connectOffset(this, parent, Direction.HORIZONTAL));
y = (y + SnapHelper.connectOffset(this, parent, Direction.VERTICAL));
};
}
private function onSelect(_arg1:MouseEvent):void{
if (parent.getChildIndex(this) < (parent.numChildren - 1)){
parent.setChildIndex(this, (parent.numChildren - 1));
};
}
public function set moveable(_arg1:Boolean):void{
if (_moveable != _arg1){
_moveable = _arg1;
if (_moveable){
_moveArea.addEventListener(MouseEvent.MOUSE_DOWN, onStartMove);
} else {
_moveArea.removeEventListener(MouseEvent.MOUSE_DOWN, onStartMove);
};
};
}
public function get snapEnabled():Boolean{
return (_snapEnabled);
}
public function set snapRect(_arg1:Rectangle):void{
_snapRect = _arg1;
}
private function onCancelMove(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.ESCAPE){
x = oldCoords.x;
y = oldCoords.y;
Cursor.unlock();
onStopMove(null);
};
}
public function get moveable():Boolean{
return (_moveable);
}
public function set snapEnabled(_arg1:Boolean):void{
_snapEnabled = _arg1;
}
private function onStopMove(_arg1:MouseEvent):void{
cacheAsBitmap = oldCacheAsBitmap;
stage.removeEventListener(MouseEvent.MOUSE_MOVE, onMove);
stage.removeEventListener(MouseEvent.MOUSE_UP, onStopMove);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, onCancelMove);
if (!oldCoords.equals(new Point(x, y))){
updateCoords();
};
}
public function set autoTopEnabled(_arg1:Boolean):void{
_autoTopEnabled = _arg1;
if (_arg1){
addEventListener(MouseEvent.MOUSE_DOWN, onSelect);
} else {
removeEventListener(MouseEvent.MOUSE_DOWN, onSelect);
};
}
public function get autoTopEnabled():Boolean{
return (_autoTopEnabled);
}
public function get moveArea():InteractiveObject{
return (_moveArea);
}
}
}//package com.alternativagame.gui.base
Section 268
//ResizeableBase (com.alternativagame.gui.base.ResizeableBase)
package com.alternativagame.gui.base {
import flash.geom.*;
import flash.events.*;
import flash.display.*;
import com.alternativagame.gui.widget.button.*;
import com.alternativagame.gui.cursor.*;
import com.alternativagame.utility.*;
import com.alternativagame.gui.layout.enums.*;
import flash.ui.*;
public class ResizeableBase extends MoveableBase {
private var oldCoords:Point;
private var _leftResizeEnabled:Boolean;
private var edgeB:SimpleRectButton;
private var edgeL:SimpleRectButton;
private var edgeR:SimpleRectButton;
private var edgeT:SimpleRectButton;
private var edgeCornerHeight:uint;
private var pivot:Point;
private var _bottomResizeEnabled:Boolean;
private var edgeBL:SimpleRectButton;
private var oldSize:Point;
private var edgeBR:SimpleRectButton;
private var _rightResizeEnabled:Boolean;
private var edges:Sprite;
private var currentEdge:SimpleRectButton;
private var edgeSurplus:int;// = 2
private var edgeCornerWidth:uint;
private var edgeTL:SimpleRectButton;
private var _topResizeEnabled:Boolean;
private var edgeTR:SimpleRectButton;
private static const maxCornerSize:int = 25;
private static const edgeSize:int = 4;
public function ResizeableBase(_arg1:Boolean, _arg2:Boolean, _arg3:Boolean, _arg4:Boolean){
_topResizeEnabled = _arg1;
_bottomResizeEnabled = _arg2;
_leftResizeEnabled = _arg3;
_rightResizeEnabled = _arg4;
edges = new Sprite();
addChild(edges);
edges.alpha = 0;
edges.x = -(edgeSurplus);
edges.y = -(edgeSurplus);
drawEdges();
}
public function get bottomResizeEnabled():Boolean{
return (_bottomResizeEnabled);
}
public function set bottomResizeEnabled(_arg1:Boolean):void{
_bottomResizeEnabled = _arg1;
drawEdges();
}
protected function updateSize():void{
}
private function onStopResize(_arg1:MouseEvent):void{
stage.removeEventListener(MouseEvent.MOUSE_MOVE, onResize);
stage.removeEventListener(MouseEvent.MOUSE_UP, onStopResize);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, onCancelResize);
if (!oldCoords.equals(new Point(x, y))){
updateCoords();
};
if (!oldSize.equals(currentSize)){
updateSize();
};
}
public function get topResizeEnabled():Boolean{
return (_topResizeEnabled);
}
private function drawEdge(_arg1:SimpleRectButton):void{
var _local2:Sprite;
if (_arg1 != null){
_local2 = Sprite(_arg1.hitArea);
_local2.graphics.clear();
_local2.graphics.beginFill(0xFF0000);
switch (_arg1){
case edgeT:
_arg1.x = (leftResizeEnabled) ? edgeCornerWidth : 0;
_local2.graphics.drawRect(0, 0, (((currentSize.x - _arg1.x) - (rightResizeEnabled) ? edgeCornerWidth : 0) + (edgeSurplus * 2)), edgeSize);
break;
case edgeB:
_arg1.x = (leftResizeEnabled) ? edgeCornerWidth : 0;
_arg1.y = (currentSize.y + (edgeSurplus * 2));
_local2.graphics.drawRect(0, 0, (((currentSize.x - _arg1.x) - (rightResizeEnabled) ? edgeCornerWidth : 0) + (edgeSurplus * 2)), -(edgeSize));
break;
case edgeL:
_arg1.y = (topResizeEnabled) ? edgeCornerHeight : 0;
_local2.graphics.drawRect(0, 0, edgeSize, (((currentSize.y - _arg1.y) - (bottomResizeEnabled) ? edgeCornerHeight : 0) + (edgeSurplus * 2)));
break;
case edgeR:
_arg1.x = (currentSize.x + (edgeSurplus * 2));
_arg1.y = (topResizeEnabled) ? edgeCornerHeight : 0;
_local2.graphics.drawRect(0, 0, -(edgeSize), (((currentSize.y - _arg1.y) - (bottomResizeEnabled) ? edgeCornerHeight : 0) + (edgeSurplus * 2)));
break;
};
};
}
private function updateEdge(_arg1:Boolean, _arg2:String):void{
var _local3:SimpleRectButton;
if (((!(_arg1)) && (!((this[_arg2] == null))))){
this[_arg2].removeEventListener(MouseEvent.MOUSE_OVER, onResizeOver);
this[_arg2].removeEventListener(MouseEvent.MOUSE_OUT, onResizeOut);
this[_arg2].removeEventListener(MouseEvent.MOUSE_DOWN, onStartResize);
edges.removeChild(this[_arg2]);
this[_arg2] = null;
};
if (((_arg1) && ((this[_arg2] == null)))){
_local3 = new SimpleRectButton(new Rectangle());
_local3.useHandCursor = false;
_local3.tabEnabled = false;
_local3.addEventListener(MouseEvent.MOUSE_OVER, onResizeOver);
_local3.addEventListener(MouseEvent.MOUSE_OUT, onResizeOut);
_local3.addEventListener(MouseEvent.MOUSE_DOWN, onStartResize);
edges.addChild(_local3);
this[_arg2] = _local3;
};
}
public function get leftResizeEnabled():Boolean{
return (_leftResizeEnabled);
}
public function set topResizeEnabled(_arg1:Boolean):void{
_topResizeEnabled = _arg1;
drawEdges();
}
public function get rightResizeEnabled():Boolean{
return (_rightResizeEnabled);
}
private function resize(_arg1:Boolean, _arg2:Boolean):void{
var _local3:Point = MouseUtility.localCoords(this);
var _local4:String = (_arg1) ? "y" : "x";
var _local5:int;
var _local6:Point = currentSize.clone();
_local6[_local4] = (_local6[_local4] + ((pivot[_local4] - _local3[_local4]) * (_arg2) ? -1 : 1));
if (_local6.x > stage.stageWidth){
_local6.x = stage.stageWidth;
};
if (_local6.y > stage.stageHeight){
_local6.y = stage.stageHeight;
};
_local6 = computeSize(_local6);
if (_local6 != currentSize){
if (!_arg2){
this.x = (this.x + (currentSize.x - _local6.x));
this.y = (this.y + (currentSize.y - _local6.y));
} else {
pivot.x = (pivot.x + (_local6.x - currentSize.x));
pivot.y = (pivot.y + (_local6.y - currentSize.y));
};
currentSize.x = _local6.x;
currentSize.y = _local6.y;
repaintCurrentSize();
};
}
override public function draw(_arg1:Point):void{
super.draw(_arg1);
drawEdges();
}
public function set leftResizeEnabled(_arg1:Boolean):void{
_leftResizeEnabled = _arg1;
drawEdges();
}
private function onCancelResize(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.ESCAPE){
x = oldCoords.x;
y = oldCoords.y;
draw(oldSize);
Cursor.unlock();
onStopResize(null);
};
}
private function onStartResize(_arg1:MouseEvent):void{
currentEdge = SimpleRectButton(_arg1.target);
pivot = MouseUtility.localCoords(this);
oldCoords = new Point(x, y);
oldSize = currentSize.clone();
stage.addEventListener(MouseEvent.MOUSE_MOVE, onResize);
stage.addEventListener(MouseEvent.MOUSE_UP, onStopResize);
stage.addEventListener(KeyboardEvent.KEY_DOWN, onCancelResize);
}
private function onResizeOut(_arg1:MouseEvent):void{
Cursor.change(Cursor.NORMAL);
}
public function set rightResizeEnabled(_arg1:Boolean):void{
_rightResizeEnabled = _arg1;
drawEdges();
}
private function drawEdgeCorner(_arg1:SimpleRectButton):void{
var dirH:int;
var dirV:int;
var edge = _arg1;
if (edge != null){
switch (edge){
case edgeTL:
dirV = 1;
dirH = 1;
break;
case edgeTR:
dirV = 1;
dirH = -1;
edge.x = (currentSize.x + (edgeSurplus * 2));
break;
case edgeBL:
dirV = -1;
dirH = 1;
edge.y = (currentSize.y + (edgeSurplus * 2));
break;
case edgeBR:
dirV = -1;
dirH = -1;
edge.x = (currentSize.x + (edgeSurplus * 2));
edge.y = (currentSize.y + (edgeSurplus * 2));
break;
};
var _local3 = Sprite(edge.hitArea).graphics;
with (_local3) {
clear();
beginFill(0xFF);
lineTo((edgeCornerWidth * dirH), 0);
lineTo((edgeCornerWidth * dirH), (edgeSize * dirV));
lineTo((edgeSize * dirH), (edgeSize * dirV));
lineTo((edgeSize * dirH), (edgeCornerHeight * dirV));
lineTo(0, (edgeCornerHeight * dirV));
};
};
}
private function onResizeOver(_arg1:MouseEvent):void{
switch (_arg1.target){
case edgeTL:
case edgeBR:
Cursor.change(Cursor.RESIZE_DIAGONAL_DOWN);
break;
case edgeTR:
case edgeBL:
Cursor.change(Cursor.RESIZE_DIAGONAL_UP);
break;
case edgeT:
case edgeB:
Cursor.change(Cursor.RESIZE_VERTICAL);
break;
case edgeL:
case edgeR:
Cursor.change(Cursor.RESIZE_HORIZONTAL);
break;
};
}
private function drawEdges():void{
updateEdge(topResizeEnabled, "edgeT");
updateEdge(bottomResizeEnabled, "edgeB");
updateEdge(leftResizeEnabled, "edgeL");
updateEdge(rightResizeEnabled, "edgeR");
updateEdge(((topResizeEnabled) && (leftResizeEnabled)), "edgeTL");
updateEdge(((topResizeEnabled) && (rightResizeEnabled)), "edgeTR");
updateEdge(((bottomResizeEnabled) && (leftResizeEnabled)), "edgeBL");
updateEdge(((bottomResizeEnabled) && (rightResizeEnabled)), "edgeBR");
if (((((((!((edgeTL == null))) || (!((edgeTR == null))))) || (!((edgeBL == null))))) || (!((edgeBR == null))))){
edgeCornerWidth = Math.min(Math.max((currentSize.x >>> 2), edgeSize), maxCornerSize);
edgeCornerHeight = Math.min(Math.max((currentSize.y >>> 2), edgeSize), maxCornerSize);
drawEdgeCorner(edgeTL);
drawEdgeCorner(edgeTR);
drawEdgeCorner(edgeBL);
drawEdgeCorner(edgeBR);
} else {
edgeCornerWidth = 0;
edgeCornerHeight = 0;
};
drawEdge(edgeT);
drawEdge(edgeB);
drawEdge(edgeL);
drawEdge(edgeR);
}
private function onResize(_arg1:MouseEvent):void{
switch (currentEdge){
case edgeTL:
resize(Direction.HORIZONTAL, false);
resize(Direction.VERTICAL, false);
break;
case edgeTR:
resize(Direction.HORIZONTAL, true);
resize(Direction.VERTICAL, false);
break;
case edgeBL:
resize(Direction.HORIZONTAL, false);
resize(Direction.VERTICAL, true);
break;
case edgeBR:
resize(Direction.HORIZONTAL, true);
resize(Direction.VERTICAL, true);
break;
case edgeT:
resize(Direction.VERTICAL, false);
break;
case edgeB:
resize(Direction.VERTICAL, true);
break;
case edgeL:
resize(Direction.HORIZONTAL, false);
break;
case edgeR:
resize(Direction.HORIZONTAL, true);
break;
};
draw(currentSize);
}
}
}//package com.alternativagame.gui.base
Section 269
//Widget (com.alternativagame.gui.base.Widget)
package com.alternativagame.gui.base {
import flash.events.*;
import com.alternativagame.gui.cursor.*;
public class Widget extends GUIObject implements ICursorActive {
private var _hint:String;
public function Widget(){
tabEnabled = true;
mouseEnabled = true;
addEventListener(FocusEvent.FOCUS_IN, onFocusIn);
addEventListener(FocusEvent.FOCUS_OUT, onFocusOut);
}
public function setOverState():void{
}
public function get hint():String{
return (_hint);
}
public function set hint(_arg1:String):void{
_hint = _arg1;
}
public function setNormalState():void{
}
public function setPressState():void{
}
protected function onFocusOut(_arg1:FocusEvent):void{
}
public function get cursor():uint{
return (Cursor.ACTIVE);
}
protected function onFocusIn(_arg1:FocusEvent):void{
}
}
}//package com.alternativagame.gui.base
Section 270
//WidgetContainer (com.alternativagame.gui.base.WidgetContainer)
package com.alternativagame.gui.base {
import flash.events.*;
import com.alternativagame.gui.container.*;
import com.alternativagame.gui.cursor.*;
public class WidgetContainer extends Container implements ICursorActive {
private var _hint:String;
public function WidgetContainer(){
tabEnabled = true;
mouseEnabled = true;
addEventListener(FocusEvent.FOCUS_IN, onFocusIn);
addEventListener(FocusEvent.FOCUS_OUT, onFocusOut);
}
public function setOverState():void{
}
public function get hint():String{
return (_hint);
}
public function set hint(_arg1:String):void{
_hint = _arg1;
}
public function setNormalState():void{
}
public function setPressState():void{
}
protected function onFocusOut(_arg1:FocusEvent):void{
}
public function get cursor():uint{
return (Cursor.ACTIVE);
}
protected function onFocusIn(_arg1:FocusEvent):void{
}
}
}//package com.alternativagame.gui.base
Section 271
//Box (com.alternativagame.gui.container.box.Box)
package com.alternativagame.gui.container.box {
import com.alternativagame.gui.container.*;
import com.alternativagame.gui.layout.impl.*;
import com.alternativagame.gui.layout.enums.*;
public class Box extends Container {
private var flManager:FillLayoutManager;
private var type:Boolean;
public function Box(_arg1:int, _arg2:Boolean=false, _arg3:uint=1, _arg4:uint=4, _arg5:Boolean=true, _arg6:int=0, _arg7:int=5, _arg8:Array=null){
var _local9:int;
super();
this.type = _arg2;
if (_arg2 == Direction.HORIZONTAL){
marginLeft = _arg6;
marginRight = _arg6;
stretchableH = _arg5;
stretchableV = false;
} else {
marginTop = _arg6;
marginBottom = _arg6;
stretchableV = _arg5;
stretchableH = false;
};
flManager = new FillLayoutManager(type, _arg3, _arg4, _arg7);
setLayoutManager(flManager);
if (_arg8 != null){
_local9 = 0;
while (_local9 < _arg8.length) {
addObject(_arg8[_local9]);
_local9++;
};
};
}
public function get space():int{
return (flManager.space);
}
}
}//package com.alternativagame.gui.container.box
Section 272
//HBox (com.alternativagame.gui.container.box.HBox)
package com.alternativagame.gui.container.box {
import com.alternativagame.gui.layout.enums.*;
public class HBox extends Box {
public function HBox(_arg1:uint=0, _arg2:Boolean=true, _arg3:int=0, _arg4:int=5, ... _args){
super(1, Direction.HORIZONTAL, _arg1, Align.MIDDLE, _arg2, _arg3, _arg4, _args);
}
}
}//package com.alternativagame.gui.container.box
Section 273
//FrameGroup (com.alternativagame.gui.container.group.FrameGroup)
package com.alternativagame.gui.container.group {
import flash.geom.*;
import flash.display.*;
import com.alternativagame.gui.container.*;
import flash.text.*;
import com.alternativagame.gui.skin.container.group.*;
import com.alternativagame.gui.layout.enums.*;
public class FrameGroup extends Container {
protected var eMLbmp:Bitmap;
protected var cTRbmp:Bitmap;
protected var cTLbmp:Bitmap;
private var titleWidth:int;
protected var eTCbmpBefore:Bitmap;
protected var eTCbmpLeft:Bitmap;
protected var _title:String;
protected var eBCbmp:Bitmap;
private var titleHeight:int;
protected var eTCbmpRight:Bitmap;
protected var _titleAlign:uint;
private var frame:Sprite;
protected var eTCbmpAfter:Bitmap;
protected var tf:TextField;
protected var cBRbmp:Bitmap;
protected var eMRbmp:Bitmap;
private var skin:FrameGroupSkin;
protected var cBLbmp:Bitmap;
public function FrameGroup(_arg1:String=null, _arg2:uint=0, _arg3:int=0, _arg4:int=0, _arg5:int=0, _arg6:int=0){
var title = _arg1;
var titleAlign = _arg2;
var marginLeft = _arg3;
var marginTop = _arg4;
var marginRight = _arg5;
var marginBottom = _arg6;
super(marginLeft, marginTop, marginRight, marginBottom);
_title = title;
_titleAlign = titleAlign;
frame = new Sprite();
frame.mouseEnabled = false;
frame.tabEnabled = false;
addChild(frame);
cTLbmp = new Bitmap();
cTRbmp = new Bitmap();
cBLbmp = new Bitmap();
cBRbmp = new Bitmap();
eTCbmpLeft = new Bitmap();
eTCbmpRight = new Bitmap();
eTCbmpBefore = new Bitmap();
eTCbmpAfter = new Bitmap();
eMLbmp = new Bitmap();
eMRbmp = new Bitmap();
eBCbmp = new Bitmap();
frame.addChild(cTLbmp);
frame.addChild(cTRbmp);
frame.addChild(cBLbmp);
frame.addChild(cBRbmp);
frame.addChild(eTCbmpLeft);
frame.addChild(eTCbmpRight);
frame.addChild(eTCbmpBefore);
frame.addChild(eTCbmpAfter);
frame.addChild(eMLbmp);
frame.addChild(eMRbmp);
frame.addChild(eBCbmp);
tf = new TextField();
var _local8 = tf;
with (_local8) {
autoSize = TextFieldAutoSize.LEFT;
antiAliasType = AntiAliasType.ADVANCED;
embedFonts = true;
selectable = false;
multiline = false;
mouseEnabled = false;
visible = true;
text = _title;
};
addChild(tf);
}
protected function calcMinWidth():void{
titleWidth = (Math.round(tf.width) - 3);
titleHeight = (Math.round(tf.height) - 6);
var _local1:int = ((((2 * skin.borderThickness) + titleWidth) + skin.titleMarginLeft) + skin.titleMarginRight);
var _local2:int = ((marginLeft + marginRight) + (2 * skin.borderThickness));
minSize.x = Math.max(_local1, _local2);
minSize.y = (((titleHeight + marginTop) + marginBottom) + skin.borderThickness);
}
override public function computeSize(_arg1:Point):Point{
var _local2:* = _arg1.clone();
var _local3:Point = layoutManager.computeSize(this, _local2.clone().subtract(new Point(((marginLeft + marginRight) + (2 * skin.borderThickness)), (((titleHeight + marginTop) + marginBottom) + skin.borderThickness))));
var _local4:Point = new Point((((_local3.x + marginLeft) + marginRight) + (2 * skin.borderThickness)), ((((_local3.y + titleHeight) + marginTop) + marginBottom) + skin.borderThickness));
_local4.x = (isStretchable(Direction.HORIZONTAL)) ? Math.max(_local2.x, _local4.x) : _local4.x;
_local4.y = (isStretchable(Direction.VERTICAL)) ? Math.max(_local2.y, _local4.y) : _local4.y;
_local4.x = Math.max(minSize.x, _local4.x);
_local4.y = Math.max(minSize.y, _local4.y);
return (_local4);
}
protected function arrangeGraphics(_arg1:Point):void{
cTLbmp.y = (_currentSize.y - _arg1.y);
cTRbmp.x = (_arg1.x - cTRbmp.width);
cTRbmp.y = cTLbmp.y;
cBLbmp.y = (_currentSize.y - cBLbmp.height);
cBRbmp.x = cTRbmp.x;
cBRbmp.y = cBLbmp.y;
eTCbmpBefore.y = cTLbmp.y;
eTCbmpAfter.y = cTLbmp.y;
eTCbmpLeft.y = cTLbmp.y;
eTCbmpRight.y = cTLbmp.y;
eTCbmpBefore.x = (((tf.x + 2) - eTCbmpBefore.width) - 1);
eTCbmpAfter.x = (((tf.x + 2) + titleWidth) + 1);
eTCbmpLeft.x = cTLbmp.width;
eTCbmpLeft.width = (eTCbmpBefore.x - eTCbmpLeft.x);
eTCbmpRight.x = (eTCbmpAfter.x + eTCbmpAfter.width);
eTCbmpRight.width = (cTRbmp.x - eTCbmpRight.x);
var _local2:int = ((_arg1.x - cTLbmp.width) - cTRbmp.width);
var _local3:int = ((_arg1.y - cTLbmp.height) - cBLbmp.height);
eMLbmp.y = (cTLbmp.y + cTLbmp.height);
eMLbmp.height = _local3;
eMRbmp.x = cTRbmp.x;
eMRbmp.y = (cTRbmp.y + cTRbmp.height);
eMRbmp.height = _local3;
eBCbmp.x = cBLbmp.width;
eBCbmp.y = cBLbmp.y;
eBCbmp.width = _local2;
}
override public function draw(_arg1:Point):void{
var _local2:Point = _arg1.clone();
canvas.x = (skin.borderThickness + marginLeft);
canvas.y = (marginTop + titleHeight);
var _local3:Point = layoutManager.draw(this, new Point((((_local2.x - marginLeft) - marginRight) - (2 * skin.borderThickness)), ((((_local2.y - titleHeight) - marginTop) - marginBottom) - skin.borderThickness)));
tf.x = -2;
tf.y = -3;
switch (_titleAlign){
case Align.LEFT:
tf.x = (tf.x + (skin.borderThickness + skin.titleMarginLeft));
break;
case Align.CENTER:
tf.x = (tf.x + Math.round(((_arg1.x - titleWidth) / 2)));
break;
case Align.RIGHT:
tf.x = (tf.x + (((_arg1.x - skin.borderThickness) - skin.titleMarginRight) - titleWidth));
break;
};
_currentSize = _arg1.clone();
arrangeGraphics(new Point(_arg1.x, (_arg1.y - Math.floor(((titleHeight - skin.borderThickness) * 0.5)))));
}
override public function updateSkin():void{
skin = FrameGroupSkin(skinManager.getSkin(FrameGroup));
super.updateSkin();
cTLbmp.bitmapData = skin.cornerTL;
cTRbmp.bitmapData = skin.cornerTR;
cBLbmp.bitmapData = skin.cornerBL;
cBRbmp.bitmapData = skin.cornerBR;
eTCbmpLeft.bitmapData = skin.edgeTC;
eTCbmpRight.bitmapData = skin.edgeTC;
eTCbmpBefore.bitmapData = skin.edgeTCbefore;
eTCbmpAfter.bitmapData = skin.edgeTCafter;
eMLbmp.bitmapData = skin.edgeML;
eMRbmp.bitmapData = skin.edgeMR;
eBCbmp.bitmapData = skin.edgeBC;
tf.thickness = skin.titleThickness;
tf.sharpness = skin.titleSharpness;
tf.setTextFormat(skin.titleTextFormat);
tf.defaultTextFormat = skin.titleTextFormat;
calcMinWidth();
}
}
}//package com.alternativagame.gui.container.group
Section 274
//GroupBase (com.alternativagame.gui.container.group.GroupBase)
package com.alternativagame.gui.container.group {
import flash.geom.*;
import flash.events.*;
import flash.display.*;
import com.alternativagame.gui.base.*;
import com.alternativagame.gui.widget.button.*;
import com.alternativagame.gui.container.*;
import com.alternativagame.gui.layout.impl.*;
import com.alternativagame.gui.skin.container.group.*;
import com.alternativagame.gui.layout.enums.*;
public class GroupBase extends WidgetContainer {
private var titleGfx:Sprite;
private var left:Bitmap;
protected var contentContainer:Container;
private var frameSkin:FrameGroupSkin;
protected var titleContainer:Container;
private var _minimized:Boolean;
private var right:Bitmap;
protected var _locked:Boolean;// = false
private var titleButton:SimpleRectButton;
protected var cBRbmp:Bitmap;
protected var _over:Boolean;// = false
protected var eMLbmp:Bitmap;
private var center:Bitmap;
protected var _pressed:Boolean;// = false
protected var eBCbmp:Bitmap;
private var frame:Sprite;
protected var cBLbmp:Bitmap;
protected var content:Container;
protected var eMRbmp:Bitmap;
private var skin:GroupSkin;
public function GroupBase(_arg1:Boolean=true){
_minimized = _arg1;
stretchableH = true;
stretchableV = false;
frame = new Sprite();
frame.mouseEnabled = false;
frame.tabEnabled = false;
addChild(frame);
cBLbmp = new Bitmap();
cBRbmp = new Bitmap();
eMLbmp = new Bitmap();
eMRbmp = new Bitmap();
eBCbmp = new Bitmap();
frame.addChild(cBLbmp);
frame.addChild(cBRbmp);
frame.addChild(eMLbmp);
frame.addChild(eMRbmp);
frame.addChild(eBCbmp);
titleGfx = new Sprite();
titleGfx.mouseEnabled = false;
titleGfx.mouseChildren = false;
titleGfx.tabEnabled = false;
addChildAt(titleGfx, 0);
left = new Bitmap();
center = new Bitmap();
right = new Bitmap();
titleGfx.addChild(left);
titleGfx.addChild(center);
titleGfx.addChild(right);
titleButton = new SimpleRectButton(new Rectangle(0, 0, 1, 1));
addChildAt(titleButton, 1);
titleButton.addEventListener(MouseEvent.MOUSE_DOWN, onTitleMouseDown);
setLayoutManager(new FillLayoutManager(Direction.VERTICAL, Align.CENTER, Align.TOP));
titleContainer = new Container();
addObject(titleContainer);
titleContainer.mouseEnabled = false;
titleContainer.tabEnabled = false;
titleContainer.stretchableH = true;
titleContainer.stretchableV = false;
createTitle();
contentContainer = new Container();
addObject(contentContainer);
contentContainer.setLayoutManager(new FillLayoutManager(Direction.VERTICAL, Align.CENTER, Align.TOP));
contentContainer.mouseEnabled = false;
contentContainer.tabEnabled = false;
contentContainer.stretchableH = true;
contentContainer.stretchableV = false;
}
public function set minimized(_arg1:Boolean):void{
if (_arg1){
minimize();
} else {
maximize();
};
}
private function state(_arg1:BitmapData, _arg2:BitmapData, _arg3:BitmapData):void{
left.bitmapData = _arg1;
center.bitmapData = _arg2;
right.bitmapData = _arg3;
}
private function calcMinWidth():void{
var _local1:int = (skin.nl.width + skin.nr.width);
minSize.x = _local1;
}
protected function minimize():void{
if (contentContainer != null){
_minimized = true;
contentContainer.mouseEnabled = false;
contentContainer.scaleY = 0;
contentContainer.visible = false;
if (((isSkined) && (!((rootObject == null))))){
GUIObject(rootObject).repaintCurrentSize();
};
};
}
override public function setPressState():void{
_locked = false;
_over = false;
_pressed = true;
super.setPressState();
}
protected function onTitleMouseUp(_arg1:MouseEvent):void{
stage.removeEventListener(MouseEvent.MOUSE_UP, onTitleMouseUp);
titleContainer.y = skin.yNormal;
titleGfx.y = skin.yNormal;
if (_minimized){
maximize();
} else {
minimize();
};
}
override public function setNormalState():void{
_locked = false;
_over = false;
_pressed = false;
super.setNormalState();
}
protected function onTitleMouseDown(_arg1:MouseEvent):void{
stage.addEventListener(MouseEvent.MOUSE_UP, onTitleMouseUp);
titleContainer.y = skin.yPress;
titleGfx.y = skin.yPress;
}
protected function createTitle():void{
}
public function setContainer(_arg1:Container):void{
if (content != null){
contentContainer.removeObject(content);
};
contentContainer.addObject(_arg1);
content = _arg1;
if (isSkined){
content.marginLeft = skin.contentMarginLeft;
content.marginTop = skin.contentMarginTop;
content.marginRight = skin.contentMarginRight;
content.marginBottom = skin.contentMarginBottom;
};
minimized = _minimized;
}
override public function draw(_arg1:Point):void{
titleContainer.draw(new Point(_arg1.x, skin.nc.height));
if (!_minimized){
super.draw(_arg1);
arrangeGraphics(new Point(_arg1.x, (_arg1.y - titleContainer.minSize.y)));
frame.visible = true;
} else {
_currentSize = _arg1.clone();
frame.visible = false;
};
center.x = left.width;
center.width = ((currentSize.x - left.width) - right.width);
right.x = (currentSize.x - right.width);
titleButton.setHitArea(new Rectangle(0, 0, _arg1.x, titleContainer.minSize.y));
}
protected function maximize():void{
if (contentContainer != null){
_minimized = false;
contentContainer.visible = true;
contentContainer.scaleY = 1;
contentContainer.mouseEnabled = true;
trace(("group rootObject: " + rootObject));
if (((isSkined) && (!((rootObject == null))))){
GUIObject(rootObject).repaintCurrentSize();
};
};
}
protected function arrangeGraphics(_arg1:Point):void{
var _local2:int;
var _local3:int;
cBLbmp.y = (_currentSize.y - cBLbmp.height);
cBRbmp.x = (_arg1.x - cBRbmp.width);
cBRbmp.y = cBLbmp.y;
_local2 = ((_arg1.x - cBLbmp.width) - cBRbmp.width);
_local3 = (_arg1.y - cBLbmp.height);
eMLbmp.y = titleContainer.minSize.y;
eMLbmp.height = _local3;
eMRbmp.x = (_arg1.x - eMRbmp.width);
eMRbmp.y = titleContainer.minSize.y;
eMRbmp.height = _local3;
eBCbmp.x = cBLbmp.width;
eBCbmp.y = cBLbmp.y;
eBCbmp.width = _local2;
}
override public function setOverState():void{
_locked = false;
_over = true;
_pressed = false;
super.setOverState();
}
override public function isStretchable(_arg1:Boolean):Boolean{
var _local2:Boolean;
if (_minimized){
_local2 = ((_arg1 == Direction.VERTICAL)) ? false : _stretchableH;
} else {
_local2 = ((_arg1 == Direction.VERTICAL)) ? _stretchableV : _stretchableH;
};
return (_local2);
}
override public function computeSize(_arg1:Point):Point{
var _local2:Point;
if (_minimized){
_local2 = titleContainer.computeSize(new Point(_arg1.x, titleContainer.minSize.y));
} else {
_local2 = super.computeSize(_arg1);
};
return (_local2);
}
protected function switchState():void{
state(skin.nl, skin.nc, skin.nr);
}
override public function updateSkin():void{
skin = GroupSkin(skinManager.getSkin(_slot1));
frameSkin = FrameGroupSkin(skinManager.getSkin(FrameGroup));
super.updateSkin();
cBLbmp.bitmapData = frameSkin.cornerBL;
cBRbmp.bitmapData = frameSkin.cornerBR;
eMLbmp.bitmapData = frameSkin.edgeML;
eMRbmp.bitmapData = frameSkin.edgeMR;
eBCbmp.bitmapData = frameSkin.edgeBC;
titleContainer.minSize.y = skin.nc.height;
titleContainer.marginLeft = skin.titleMarginLeft;
titleContainer.marginTop = skin.titleMarginTop;
titleContainer.marginRight = skin.titleMarginRight;
titleContainer.marginBottom = skin.titleMarginBottom;
titleContainer.y = skin.yNormal;
titleGfx.y = skin.yNormal;
contentContainer.marginLeft = frameSkin.borderThickness;
contentContainer.marginRight = frameSkin.borderThickness;
contentContainer.marginBottom = frameSkin.borderThickness;
if (content != null){
content.marginLeft = skin.contentMarginLeft;
content.marginTop = skin.contentMarginTop;
content.marginRight = skin.contentMarginRight;
content.marginBottom = skin.contentMarginBottom;
};
switchState();
calcMinWidth();
}
}
}//package com.alternativagame.gui.container.group
Section 275
//ScrollBar (com.alternativagame.gui.container.scroller.ScrollBar)
package com.alternativagame.gui.container.scroller {
import flash.geom.*;
import flash.events.*;
import flash.display.*;
import com.alternativagame.gui.widget.button.*;
import com.alternativagame.gui.container.*;
import com.alternativagame.utility.*;
import com.alternativagame.gui.skin.widget.scroll.*;
import com.alternativagame.gui.layout.enums.*;
public class ScrollBar extends Container {
private var size:String;
private var forwardLength:int;
private var skin:ScrollBarSkin;
private var pageForwardButton:PageButton;
private var currentArea:int;// = 0
private var front:Bitmap;
private var _step:int;
private var currentScrollLength:int;// = 0
private var backLength:int;
private var scroller:Scroller;
private var dragPoint:int;
private var currentView:int;// = 0
private var currentLength:int;
private var currentPosition:int;// = 0
private var extraNavigation:Sprite;
private var bg:Bitmap;
private var forwardButton:ImageButton;
private var _minLength:int;
private var back:Bitmap;
private var pageBackButton:PageButton;
private var coord:String;
private var backButton:ImageButton;
private var direction:Boolean;
public function ScrollBar(_arg1:Boolean, _arg2:int=10){
var _local5:ButtonRepeater;
var _local6:ButtonRepeater;
super();
back = new Bitmap();
bg = new Bitmap();
front = new Bitmap();
backButton = new ImageButton(0, 1);
forwardButton = new ImageButton(0, 1);
scroller = new Scroller(4, _arg1);
this.direction = _arg1;
coord = (_arg1) ? "y" : "x";
size = (_arg1) ? "height" : "width";
_step = _arg2;
pageBackButton = new PageButton(1, 1);
pageForwardButton = new PageButton(1, 1);
extraNavigation = new Sprite();
addChildAt(back, 0);
addChildAt(bg, 1);
addChildAt(front, 2);
addChildAt(extraNavigation, 3);
addObject(scroller);
addObject(pageBackButton);
addObject(pageForwardButton);
addObject(backButton);
addObject(forwardButton);
if (backButton != null){
_local5 = new ButtonRepeater(backButton);
};
if (forwardButton != null){
_local6 = new ButtonRepeater(forwardButton);
};
var _local3:ButtonRepeater = new ButtonRepeater(pageBackButton);
var _local4:ButtonRepeater = new ButtonRepeater(pageForwardButton);
scroller.addEventListener(MouseEvent.MOUSE_DOWN, onScrollerStartDrag);
pageBackButton.addEventListener(MouseEvent.CLICK, onPageBackButton);
pageForwardButton.addEventListener(MouseEvent.CLICK, onPageForwardButton);
if (backButton != null){
backButton.addEventListener(MouseEvent.CLICK, onBackButton);
};
if (forwardButton != null){
forwardButton.addEventListener(MouseEvent.CLICK, onForwardButton);
};
addEventListener(MouseEvent.MOUSE_WHEEL, onMouseWheel);
tabEnabled = false;
tabChildren = false;
}
private function updateScrollLength():void{
var _local1:Number = ((currentArea)==0) ? 0 : (currentView / currentArea);
scroller.length = (_local1 * currentScrollLength);
}
private function onScrollerDrag(_arg1:MouseEvent):void{
var _local2:Point = MouseUtility.localCoords(this);
_local2[coord] = (_local2[coord] - dragPoint);
if (((((currentScrollLength - scroller.length) == 0)) || (((currentArea - currentView) == 0)))){
position = 0;
} else {
position = (((_local2[coord] - backLength) / (currentScrollLength - scroller.length)) * (currentArea - currentView));
};
updateScrollPosition();
updateLock();
}
public function get length():int{
return (currentLength);
}
private function updateLock():void{
var _local1 = (currentPosition <= 0);
var _local2 = (currentPosition >= (currentArea - currentView));
var _local3 = (scroller.length <= currentScrollLength);
var _local4 = (currentView >= currentArea);
if (backButton != null){
backButton.locked = ((_local1) || (_local4));
};
if (forwardButton != null){
forwardButton.locked = ((_local2) || (_local4));
};
scroller.visible = ((_local3) && (!(_local4)));
pageBackButton.visible = ((!(_local1)) && (!(_local4)));
pageForwardButton.visible = ((!(_local2)) && (!(_local4)));
}
private function onMouseWheel(_arg1:MouseEvent):void{
var _local2:Number = position;
position = (position - (step * _arg1.delta));
if (((!((position == _local2))) || (!((coord == "y"))))){
_arg1.stopPropagation();
};
}
public function set area(_arg1:Number):void{
currentArea = _arg1;
updateScrollLength();
updateScrollPosition();
updateLock();
}
public function get area():Number{
return (currentArea);
}
public function get extraLength():int{
return (currentScrollLength);
}
public function get extra():Sprite{
return (extraNavigation);
}
public function get view():Number{
return (currentView);
}
private function onPageBackButton(_arg1:MouseEvent):void{
position = (position - (view - step));
}
private function onScrollerStopDrag(_arg1:MouseEvent):void{
stage.removeEventListener(MouseEvent.MOUSE_MOVE, onScrollerDrag);
stage.removeEventListener(MouseEvent.MOUSE_UP, onScrollerStopDrag);
scroller.addEventListener(MouseEvent.MOUSE_DOWN, onScrollerStartDrag);
}
public function get position():Number{
return (currentPosition);
}
private function onBackButton(_arg1:MouseEvent):void{
position = (position - step);
}
private function updateScrollPosition():void{
if (currentPosition > (currentArea - currentView)){
currentPosition = (currentArea - currentView);
};
if (currentPosition < 0){
currentPosition = 0;
};
var _local1:Number = ((currentArea)==currentView) ? 0 : (currentPosition / (currentArea - currentView));
var _local2:int = (_local1 * (currentScrollLength - scroller.length));
scroller[coord] = (backLength + _local2);
pageBackButton[size] = _local2;
pageForwardButton[coord] = (scroller[coord] + scroller.length);
pageForwardButton[size] = ((backLength + currentScrollLength) - pageForwardButton[coord]);
}
private function onForwardButton(_arg1:MouseEvent):void{
position = (position + step);
}
public function set view(_arg1:Number):void{
currentView = _arg1;
updateScrollLength();
updateScrollPosition();
updateLock();
}
public function get extraThickness():int{
return (thickness);
}
public function set length(_arg1:int):void{
if (_arg1 < _minLength){
_arg1 = _minLength;
};
currentLength = _arg1;
currentScrollLength = ((currentLength - backLength) - forwardLength);
if (forwardButton != null){
forwardButton[coord] = (currentLength - forwardLength);
};
bg[size] = ((currentScrollLength - back[size]) - front[size]);
bg[coord] = (back[coord] + back[size]);
front[coord] = (bg[coord] + bg[size]);
updateScrollLength();
updateScrollPosition();
updateLock();
}
public function get step():int{
return (_step);
}
public function get minLength():int{
return (_minLength);
}
public function set position(_arg1:Number):void{
currentPosition = _arg1;
updateScrollPosition();
updateLock();
dispatchEvent(new Event(Event.SCROLL, true));
}
override public function updateSkin():void{
skin = ScrollBarSkin(skinManager.getSkin(ScrollBar));
back.bitmapData = (direction) ? skin.bmpT : skin.bmpL;
bg.bitmapData = (direction) ? skin.bmpM : skin.bmpC;
front.bitmapData = (direction) ? skin.bmpB : skin.bmpR;
backButton.normalBitmap = (direction) ? skin.bmpUN : skin.bmpLN;
backButton.overBitmap = (direction) ? skin.bmpUO : skin.bmpLO;
backButton.pressBitmap = (direction) ? skin.bmpUP : skin.bmpLP;
backButton.lockBitmap = (direction) ? skin.bmpUL : skin.bmpLL;
forwardButton.normalBitmap = (direction) ? skin.bmpDN : skin.bmpRN;
forwardButton.overBitmap = (direction) ? skin.bmpDO : skin.bmpRO;
forwardButton.pressBitmap = (direction) ? skin.bmpDP : skin.bmpRP;
forwardButton.lockBitmap = (direction) ? skin.bmpDL : skin.bmpRL;
super.updateSkin();
backLength = ((backButton)!=null) ? backButton[size] : 0;
forwardLength = ((forwardButton)!=null) ? forwardButton[size] : 0;
_minLength = (((!((backButton == null))) || (!((forwardButton == null))))) ? (backLength + forwardLength) : scroller.length;
currentLength = _minLength;
length = currentLength;
back[coord] = backLength;
bg[coord] = (backLength + back[size]);
extraNavigation[coord] = backLength;
pageBackButton[coord] = backLength;
pageBackButton.width = bg.width;
pageBackButton.height = bg.height;
pageForwardButton.width = bg.width;
pageForwardButton.height = bg.height;
}
private function onPageForwardButton(_arg1:MouseEvent):void{
position = (position + (view - step));
}
public function get thickness():int{
return (((direction)==Direction.HORIZONTAL) ? bg.height : bg.width);
}
private function onScrollerStartDrag(_arg1:MouseEvent):void{
scroller.removeEventListener(MouseEvent.MOUSE_DOWN, onScrollerStartDrag);
dragPoint = MouseUtility.localCoords(scroller)[coord];
stage.addEventListener(MouseEvent.MOUSE_MOVE, onScrollerDrag);
stage.addEventListener(MouseEvent.MOUSE_UP, onScrollerStopDrag);
}
}
}//package com.alternativagame.gui.container.scroller
import com.alternativagame.gui.base.*;
import com.alternativagame.gui.cursor.*;
class PageButton extends GUIObject implements ICursorActive {
private function PageButton(_arg1:int, _arg2:int){
var w = _arg1;
var h = _arg2;
super();
var _local4 = graphics;
with (_local4) {
beginFill(0xFF0000, 0);
drawRect(0, 0, w, h);
};
}
public function setPressState():void{
}
public function setNormalState():void{
}
public function setOverState():void{
}
public function get cursor():uint{
return (Cursor.ACTIVE);
}
public function get hint():String{
return (null);
}
}
Section 276
//ScrollBox (com.alternativagame.gui.container.scroller.ScrollBox)
package com.alternativagame.gui.container.scroller {
import flash.geom.*;
import flash.events.*;
import flash.display.*;
import com.alternativagame.gui.base.*;
import com.alternativagame.gui.cursor.*;
import com.alternativagame.gui.skin.widget.scroll.*;
import com.alternativagame.gui.layout.enums.*;
public class ScrollBox extends WidgetContainer {
private var showHorizontal:Boolean;// = false
private var _normal:Boolean;// = true
private var scrollCorner:Bitmap;
private var scrollMode:int;
private var showVertical:Boolean;// = false
private var mc:Bitmap;
private var scrollBarVertical:ScrollBar;
private var ml:Bitmap;
private var mr:Bitmap;
public var bgEnable:Boolean;// = true
private var _locked:Boolean;// = false
private var bc:Bitmap;
private var br:Bitmap;
private var scrollBarHorizontal:ScrollBar;
private var bl:Bitmap;
private var scrollHorizontal:Boolean;// = false
private var scrollVertical:Boolean;// = false
private var tc:Bitmap;
private var tl:Bitmap;
private var skin:ScrollBoxSkin;
private var tr:Bitmap;
public function ScrollBox(_arg1:int, _arg2:int=0){
minSize.x = 100;
minSize.y = 30;
tl = new Bitmap();
tc = new Bitmap();
tr = new Bitmap();
ml = new Bitmap();
mc = new Bitmap();
mr = new Bitmap();
bl = new Bitmap();
bc = new Bitmap();
br = new Bitmap();
addChildAt(tl, 0);
addChildAt(tc, 1);
addChildAt(tr, 2);
addChildAt(ml, 3);
addChildAt(mc, 4);
addChildAt(mr, 5);
addChildAt(bl, 6);
addChildAt(bc, 7);
addChildAt(br, 8);
this.scrollMode = _arg2;
scrollVertical = ((_arg2 & ScrollMode.AUTO_VERTICAL) == ScrollMode.AUTO_VERTICAL);
scrollHorizontal = ((_arg2 & ScrollMode.AUTO_HORIZONTAL) == ScrollMode.AUTO_HORIZONTAL);
showVertical = ((_arg2 & ScrollMode.SHOW_VERTICAL) == ScrollMode.SHOW_VERTICAL);
showHorizontal = ((_arg2 & ScrollMode.SHOW_HORIZONTAL) == ScrollMode.SHOW_HORIZONTAL);
if (scrollVertical){
scrollBarVertical = new ScrollBar(Direction.VERTICAL);
scrollBarVertical.addEventListener(Event.SCROLL, onScrollVertical);
scrollBarVertical.visible = showVertical;
addChild(scrollBarVertical);
};
if (scrollHorizontal){
scrollBarHorizontal = new ScrollBar(Direction.HORIZONTAL);
scrollBarHorizontal.addEventListener(Event.SCROLL, onScrollHorizontal);
scrollBarHorizontal.visible = showHorizontal;
addChild(scrollBarHorizontal);
};
if (((scrollVertical) && (scrollHorizontal))){
scrollCorner = new Bitmap();
scrollCorner.visible = ((showVertical) && (showHorizontal));
addChild(scrollCorner);
};
if (((scrollVertical) || (scrollHorizontal))){
canvasMask = new Shape();
canvasMask.graphics.beginFill(0, 0);
canvasMask.graphics.drawRect(0, 0, 1, 1);
canvas.mask = canvasMask;
addChild(canvasMask);
};
}
private function onMouseWheel(_arg1:MouseEvent):void{
var _local2:Number;
if (scrollBarVertical.visible){
_local2 = scrollBarVertical.position;
scrollBarVertical.position = (scrollBarVertical.position - (_arg1.delta * scrollBarVertical.step));
if (scrollBarVertical.position != _local2){
_arg1.stopImmediatePropagation();
};
};
}
public function getScrollBarHorizontal():ScrollBar{
return (scrollBarHorizontal);
}
override public function setNormalState():void{
super.setNormalState();
_normal = true;
switchState();
drawBox();
}
private function onScrollVertical(_arg1:Event):void{
canvas.y = (skin.borderThickness - scrollBarVertical.position);
}
public function set locked(_arg1:Boolean):void{
_locked = _arg1;
switchState();
if (isSkined){
drawBox();
};
}
private function switchState():void{
if (_locked){
tl.bitmapData = skin.ltl;
tc.bitmapData = skin.ltc;
tr.bitmapData = skin.ltr;
ml.bitmapData = skin.lml;
mc.bitmapData = skin.lmc;
mr.bitmapData = skin.lmr;
bl.bitmapData = skin.lbl;
bc.bitmapData = skin.lbc;
br.bitmapData = skin.lbr;
} else {
if (_normal){
tl.bitmapData = skin.ntl;
tc.bitmapData = skin.ntc;
tr.bitmapData = skin.ntr;
ml.bitmapData = skin.nml;
mc.bitmapData = skin.nmc;
mr.bitmapData = skin.nmr;
bl.bitmapData = skin.nbl;
bc.bitmapData = skin.nbc;
br.bitmapData = skin.nbr;
} else {
tl.bitmapData = skin.otl;
tc.bitmapData = skin.otc;
tr.bitmapData = skin.otr;
ml.bitmapData = skin.oml;
mc.bitmapData = skin.omc;
mr.bitmapData = skin.omr;
bl.bitmapData = skin.obl;
bc.bitmapData = skin.obc;
br.bitmapData = skin.obr;
};
};
}
override public function draw(_arg1:Point):void{
var _local2:Point = _arg1.clone();
if (showVertical){
_local2.x = (_local2.x - scrollBarVertical.thickness);
};
if (showHorizontal){
_local2.y = (_local2.y - scrollBarHorizontal.thickness);
};
_local2.x = (_local2.x - (2 * skin.borderThickness));
_local2.y = (_local2.y - (2 * skin.borderThickness));
var _local3:Point = super.computeSize(_local2);
if (scrollVertical){
if (!showVertical){
if (_local3.y > _local2.y){
scrollBarVertical.visible = true;
_local2.x = (_local2.x - scrollBarVertical.thickness);
_local3 = super.computeSize(_local2);
} else {
scrollBarVertical.position = 0;
scrollBarVertical.visible = false;
};
} else {
scrollBarVertical.visible = true;
};
};
if (scrollHorizontal){
if (!showHorizontal){
if (_local3.x > _local2.x){
scrollBarHorizontal.visible = true;
_local2.y = (_local2.y - scrollBarHorizontal.thickness);
if (scrollVertical){
if (!scrollBarVertical.visible){
if (_local3.y > _local2.y){
scrollBarVertical.visible = true;
_local2.x = (_local2.x - scrollBarVertical.thickness);
_local3 = super.computeSize(_local2);
};
};
};
} else {
scrollBarHorizontal.position = 0;
scrollBarHorizontal.visible = false;
};
} else {
scrollBarHorizontal.visible = true;
};
};
super.draw(_local3);
canvas.x = (canvas.x + skin.borderThickness);
canvas.y = (canvas.y + skin.borderThickness);
if (((scrollVertical) || (scrollHorizontal))){
if (((scrollVertical) && (scrollBarVertical.visible))){
scrollBarVertical.length = _local2.y;
scrollBarVertical.x = (_local2.x + skin.borderThickness);
scrollBarVertical.area = _local3.y;
scrollBarVertical.view = _local2.y;
scrollBarVertical.position = -((canvas.y - skin.borderThickness));
};
if (((scrollHorizontal) && (scrollBarHorizontal.visible))){
scrollBarHorizontal.length = _local2.x;
scrollBarHorizontal.y = (_local2.y + skin.borderThickness);
scrollBarHorizontal.area = _local3.x;
scrollBarHorizontal.view = _local2.x;
scrollBarHorizontal.position = -((canvas.x - skin.borderThickness));
};
if (scrollCorner != null){
scrollCorner.visible = ((scrollBarVertical.visible) && (scrollBarHorizontal.visible));
scrollCorner.x = (_local2.x + skin.borderThickness);
scrollCorner.y = (_local2.y + skin.borderThickness);
};
if (canvasMask != null){
canvasMask.width = (_local2.x - 1);
canvasMask.height = (_local2.y - 1);
};
};
_currentSize = _arg1.clone();
drawBox();
}
override public function get cursor():uint{
return (Cursor.NORMAL);
}
override public function setOverState():void{
super.setOverState();
_normal = false;
switchState();
drawBox();
}
override public function computeSize(_arg1:Point):Point{
var _local2:Point = new Point();
_local2.x = (isStretchable(Direction.HORIZONTAL)) ? Math.max(_arg1.x, minSize.x) : minSize.x;
_local2.y = (isStretchable(Direction.VERTICAL)) ? Math.max(_arg1.y, minSize.y) : minSize.y;
return (_local2);
}
public function getScrollBarVertical():ScrollBar{
return (scrollBarVertical);
}
public function drawBox():void{
if (bgEnable){
tl.x = 0;
tl.y = 0;
tc.x = (tl.x + tl.width);
tc.y = tl.y;
tc.width = ((currentSize.x - tl.width) - tr.width);
tr.x = (tc.x + tc.width);
tr.y = tl.y;
ml.x = tl.x;
ml.y = (tl.y + tl.height);
ml.height = ((currentSize.y - tl.height) - bl.height);
mc.x = tc.x;
mc.y = ml.y;
mc.width = tc.width;
mc.height = ml.height;
mr.x = tr.x;
mr.y = ml.y;
mr.height = ml.height;
bl.x = tl.x;
bl.y = (ml.y + ml.height);
bc.x = tc.x;
bc.y = bl.y;
bc.width = tc.width;
br.x = tr.x;
br.y = bl.y;
};
}
private function onScrollHorizontal(_arg1:Event):void{
canvas.x = (skin.borderThickness - scrollBarHorizontal.position);
}
override public function updateSkin():void{
skin = ScrollBoxSkin(skinManager.getSkin(ScrollBox));
canvasMask.x = skin.borderThickness;
canvasMask.y = skin.borderThickness;
if (scrollVertical){
scrollBarVertical.y = skin.borderThickness;
};
if (scrollHorizontal){
scrollBarHorizontal.x = skin.borderThickness;
};
if (scrollCorner != null){
scrollCorner.bitmapData = skin.corner;
};
super.updateSkin();
switchState();
}
}
}//package com.alternativagame.gui.container.scroller
Section 277
//Scroller (com.alternativagame.gui.container.scroller.Scroller)
package com.alternativagame.gui.container.scroller {
import flash.display.*;
import com.alternativagame.gui.base.*;
import com.alternativagame.gui.cursor.*;
import com.alternativagame.gui.skin.widget.scroll.*;
public class Scroller extends GUIObject implements ICursorActive {
private var size:String;
private var bg:Bitmap;
private var currentLength:int;
private var minLength:int;
private var back:Bitmap;
private var front:Bitmap;
private var coord:String;
private var skin:ScrollerSkin;
private var direction:Boolean;
public function Scroller(_arg1:int, _arg2:Boolean){
this.direction = _arg2;
coord = (_arg2) ? "y" : "x";
size = (_arg2) ? "height" : "width";
back = new Bitmap();
bg = new Bitmap();
front = new Bitmap();
addChild(back);
addChild(bg);
addChild(front);
tabEnabled = false;
this.minLength = _arg1;
currentLength = _arg1;
}
public function get hint():String{
return (null);
}
public function get length():int{
return (currentLength);
}
public function set length(_arg1:int):void{
if (_arg1 < minLength){
_arg1 = minLength;
};
currentLength = _arg1;
drawScroller();
}
public function setPressState():void{
back.bitmapData = (direction) ? skin.pt : skin.pl;
bg.bitmapData = (direction) ? skin.pm : skin.pc;
front.bitmapData = (direction) ? skin.pb : skin.pr;
drawScroller();
}
public function get cursor():uint{
return (Cursor.ACTIVE);
}
public function setOverState():void{
back.bitmapData = (direction) ? skin.ot : skin.ol;
bg.bitmapData = (direction) ? skin.om : skin.oc;
front.bitmapData = (direction) ? skin.ob : skin.or;
drawScroller();
}
private function drawScroller():void{
if (isSkined){
bg[coord] = back[size];
bg[size] = ((currentLength - back[size]) - front[size]);
front[coord] = (currentLength - front[size]);
};
}
override public function updateSkin():void{
skin = ScrollerSkin(skinManager.getSkin(Scroller));
super.updateSkin();
setNormalState();
}
public function setNormalState():void{
back.bitmapData = (direction) ? skin.nt : skin.nl;
bg.bitmapData = (direction) ? skin.nm : skin.nc;
front.bitmapData = (direction) ? skin.nb : skin.nr;
drawScroller();
}
}
}//package com.alternativagame.gui.container.scroller
Section 278
//Container (com.alternativagame.gui.container.Container)
package com.alternativagame.gui.container {
import flash.geom.*;
import flash.display.*;
import com.alternativagame.gui.base.*;
import com.alternativagame.gui.layout.*;
import com.alternativagame.gui.layout.impl.*;
import flash.utils.*;
import com.alternativagame.gui.layout.enums.*;
public class Container extends GUIObject implements IContainer {
protected var containerBorder:Shape;
protected var canvasHit:Sprite;
public var layoutManager:ILayoutManager;
private var _marginTop:int;
protected var _objects:Array;
private var _marginRight:int;
private var _marginBottom:int;
protected var canvasMask:Shape;
protected var canvas:Sprite;
private var _marginLeft:int;
public function Container(_arg1:int=0, _arg2:int=0, _arg3:int=0, _arg4:int=0){
canvas = new Sprite();
canvas.mouseEnabled = false;
canvas.tabEnabled = false;
addChild(canvas);
this.marginLeft = _arg1;
this.marginTop = _arg2;
this.marginRight = _arg3;
this.marginBottom = _arg4;
setLayoutManager(new LayoutManager());
containerBorder = new Shape();
addChild(containerBorder);
_objects = new Array();
mouseEnabled = false;
tabEnabled = false;
}
public function get marginBottom():int{
return (_marginBottom);
}
public function swapObjects(_arg1:IGUIObject, _arg2:IGUIObject):void{
_objects[_objects.indexOf(_arg1)] = _arg2;
_objects[_objects.indexOf(_arg2)] = _arg1;
}
override public function set rootObject(_arg1:IGUIObject):void{
var _local2:IGUIObject;
_rootObject = _arg1;
for each (_local2 in _objects) {
IGUIObject(_local2).rootObject = _arg1;
};
}
public function set marginTop(_arg1:int):void{
_marginTop = _arg1;
}
public function setObjectIndex(_arg1:IGUIObject, _arg2:int):void{
_objects.splice(_objects.indexOf(_arg1), 1);
_objects.splice(_arg2, 0, _arg1);
}
public function addObjectAt(_arg1:IGUIObject, _arg2:int):void{
_objects.splice(_arg2, 0, _arg1);
canvas.addChild(DisplayObject(_arg1));
addSkinnableObject(DisplayObject(_arg1));
}
public function swapObjectsAt(_arg1:int, _arg2:int):void{
var _local3:IGUIObject = _objects[_arg1];
_objects[_arg1] = _objects[_arg2];
_objects[_arg2] = _local3;
}
public function get marginRight():int{
return (_marginRight);
}
public function set marginRight(_arg1:int):void{
_marginRight = _arg1;
}
public function getObjectIndex(_arg1:IGUIObject):int{
var _local2:int = _objects.indexOf(_arg1);
return (_local2);
}
public function get objects():Array{
return (_objects);
}
public function set marginLeft(_arg1:int):void{
_marginLeft = _arg1;
}
public function addObject(_arg1:IGUIObject):void{
_objects.push(_arg1);
canvas.addChild(DisplayObject(_arg1));
addSkinnableObject(DisplayObject(_arg1));
if (this.rootObject != null){
_arg1.rootObject = this.rootObject;
};
}
override public function draw(_arg1:Point):void{
var _local2:Point = _arg1.clone();
if (canvas.x != marginLeft){
canvas.x = marginLeft;
};
if (canvas.y != marginTop){
canvas.y = marginTop;
};
var _local3:Point = layoutManager.draw(this, new Point(((_local2.x - marginLeft) - marginRight), ((_local2.y - marginTop) - marginBottom)));
super.draw(_local2);
}
public function get marginTop():int{
return (_marginTop);
}
public function getObjectAt(_arg1:int):IGUIObject{
return (_objects[_arg1]);
}
public function get marginLeft():int{
return (_marginLeft);
}
public function setLayoutManager(_arg1:ILayoutManager):void{
layoutManager = _arg1;
}
public function removeObject(_arg1:IGUIObject):void{
_objects.splice(_objects.indexOf(_arg1), 1);
canvas.removeChild(DisplayObject(_arg1));
removeSkinnableObject(DisplayObject(_arg1));
}
public function addObjectBefore(_arg1:IGUIObject, _arg2:IGUIObject):void{
_objects.splice(_objects.indexOf(_arg2), 0, _arg1);
canvas.addChild(DisplayObject(_arg1));
addSkinnableObject(DisplayObject(_arg1));
}
override public function toString():String{
var _local1:String = new String();
_local1 = (_local1 + (("[" + getQualifiedClassName(this)) + "]"));
_local1 = (_local1 + "\n");
_local1 = (_local1 + ("currentSize:" + this._currentSize));
_local1 = (_local1 + "\n");
_local1 = (_local1 + ("layoutManager:" + this.layoutManager));
_local1 = (_local1 + "\n");
_local1 = (_local1 + ("stretchableH:" + isStretchable(Direction.HORIZONTAL)));
_local1 = (_local1 + "\n");
_local1 = (_local1 + ("stretchableV:" + isStretchable(Direction.VERTICAL)));
return (_local1);
}
public function getLayoutManager():ILayoutManager{
return (layoutManager);
}
override public function computeSize(_arg1:Point):Point{
var _local2:Point = _arg1.clone();
_local2.x = Math.max(minSize.x, _local2.x);
_local2.y = Math.max(minSize.y, _local2.y);
var _local3:Point = layoutManager.computeSize(this, _local2.clone().subtract(new Point((marginLeft + marginRight), (marginTop + marginBottom))));
var _local4:Point = new Point(((_local3.x + marginLeft) + marginRight), ((_local3.y + marginTop) + marginBottom));
_local4.x = (isStretchable(Direction.HORIZONTAL)) ? Math.max(_local2.x, _local4.x) : _local4.x;
_local4.y = (isStretchable(Direction.VERTICAL)) ? Math.max(_local2.y, _local4.y) : _local4.y;
_local4.x = Math.max(minSize.x, _local4.x);
_local4.y = Math.max(minSize.y, _local4.y);
return (_local4);
}
public function set marginBottom(_arg1:int):void{
_marginBottom = _arg1;
}
public function removeObjectAt(_arg1:int):void{
var _local2:DisplayObject = _objects[_arg1];
_objects.splice(_arg1, 1);
canvas.removeChild(DisplayObject(_local2));
removeSkinnableObject(DisplayObject(_local2));
}
public function removeObjects():void{
var _local1:DisplayObject;
for each (_local1 in _objects) {
canvas.removeChild(_local1);
removeSkinnableObject(_local1);
};
_objects = new Array();
}
public function hasObject(_arg1:IGUIObject):Boolean{
return ((_objects.indexOf(_arg1) >= 0));
}
public function addObjectAfter(_arg1:IGUIObject, _arg2:IGUIObject):void{
_objects.splice((_objects.indexOf(_arg2) + 1), 0, _arg1);
canvas.addChild(DisplayObject(_arg1));
addSkinnableObject(DisplayObject(_arg1));
}
}
}//package com.alternativagame.gui.container
Section 279
//IContainer (com.alternativagame.gui.container.IContainer)
package com.alternativagame.gui.container {
import com.alternativagame.gui.base.*;
public interface IContainer {
function addObject(_arg1:IGUIObject):void;
function removeObject(_arg1:IGUIObject):void;
}
}//package com.alternativagame.gui.container
Section 280
//WindowContainer (com.alternativagame.gui.container.WindowContainer)
package com.alternativagame.gui.container {
import com.alternativagame.gui.window.*;
import com.alternativagame.gui.layout.impl.*;
public class WindowContainer extends Container {
public function WindowContainer(){
_stretchableH = true;
_stretchableV = true;
setLayoutManager(new WindowLayoutManager());
}
public function center(_arg1:WindowBase):void{
_arg1.x = ((currentSize.x - _arg1.currentSize.x) >>> 1);
_arg1.y = ((currentSize.y - _arg1.currentSize.y) >>> 1);
}
}
}//package com.alternativagame.gui.container
Section 281
//Cursor (com.alternativagame.gui.cursor.Cursor)
package com.alternativagame.gui.cursor {
import flash.geom.*;
import flash.events.*;
import flash.display.*;
import com.alternativagame.gui.window.*;
import flash.text.*;
import com.alternativagame.gui.dnd.*;
import flash.utils.*;
import com.alternativagame.utility.*;
import flash.ui.*;
public class Cursor extends Sprite {
private var hintTimer:uint;
private var hint:TextField;
private var locked:Boolean;// = false
private var state:Array;
private var dragged:IDrag;
private var dragObject:IDragObject;
private var ctrlKeyPressed:Boolean;// = false
private var current:uint;
private var pressed:DisplayObject;
private var dropped:IDrop;
private var log:TextField;
private var altKeyPressed:Boolean;// = false
private var shiftKeyPressed:Boolean;// = false
private var dragOffset:Point;
private var overed:DisplayObject;
private var gfx:DisplayObject;
private var focused:DisplayObject;
public static const ACTIVE:uint = 2;
public static const RESIZE_HORIZONTAL:uint = 7;
private static const debugMode:Boolean = false;
public static const RESIZE_VERTICAL:uint = 8;
public static const RESIZE_DIAGONAL_DOWN:uint = 10;
private static const cursorDrag:Class = Cursor_cursorDrag;
public static const NONE:uint = 0;
public static const DRAG:uint = 4;
private static const hintDelay:Number = 600;
private static const cursorResizeVertical:Class = Cursor_cursorResizeVertical;
private static const cursorResizeDiagonalDown:Class = Cursor_cursorResizeDiagonalDown;
private static const cursorGrab:Class = Cursor_cursorGrab;
private static const cursorMove:Class = Cursor_cursorMove;
private static const cursorImposible:Class = Cursor_cursorImposible;
public static const GRAB:uint = 3;
public static const MOVE:uint = 6;
private static const cursorNormal:Class = Cursor_cursorNormal;
public static const RESIZE_DIAGONAL_UP:uint = 9;
public static const IMPOSIBLE:uint = 11;
private static const cursorHand:Class = Cursor_cursorHand;
public static const NORMAL:uint = 1;
private static const hintTimeout:Number = 3000;
private static const cursorDrop:Class = Cursor_cursorDrop;
private static const cursorResizeHorizontal:Class = Cursor_cursorResizeHorizontal;
public static const DROP:uint = 5;
private static const dragEnableDistance:Number = 2;
private static const cursorResizeDiagonalUp:Class = Cursor_cursorResizeDiagonalUp;
private static const cursorActive:Class = Cursor_cursorActive;
private static var instance:Cursor;
public function Cursor(_arg1:DisplayObjectContainer){
var parent = _arg1;
super();
state = new Array();
state[NORMAL] = {cursorState:cursorNormal, xOffset:1, yOffset:1};
state[ACTIVE] = {cursorState:cursorActive, xOffset:1, yOffset:1};
state[GRAB] = {cursorState:cursorGrab, xOffset:9, yOffset:14};
state[DRAG] = {cursorState:cursorDrag, xOffset:7, yOffset:5};
state[DROP] = {cursorState:cursorDrop, xOffset:7, yOffset:5};
state[MOVE] = {cursorState:cursorMove, xOffset:10, yOffset:10};
state[RESIZE_HORIZONTAL] = {cursorState:cursorResizeHorizontal, xOffset:11, yOffset:4};
state[RESIZE_VERTICAL] = {cursorState:cursorResizeVertical, xOffset:4, yOffset:11};
state[RESIZE_DIAGONAL_UP] = {cursorState:cursorResizeDiagonalUp, xOffset:9, yOffset:9};
state[RESIZE_DIAGONAL_DOWN] = {cursorState:cursorResizeDiagonalDown, xOffset:9, yOffset:9};
state[IMPOSIBLE] = {cursorState:cursorImposible, xOffset:8, yOffset:8};
hint = new TextField();
var _local3 = hint;
with (_local3) {
defaultTextFormat = new TextFormat("Alternativa", 12, 0);
autoSize = TextFieldAutoSize.LEFT;
antiAliasType = AntiAliasType.ADVANCED;
sharpness = -50;
thickness = 50;
embedFonts = true;
selectable = false;
border = true;
borderColor = 0;
background = true;
backgroundColor = 16777151;
visible = false;
};
addChild(hint);
if (debugMode){
log = new TextField();
_local3 = log;
with (_local3) {
defaultTextFormat = new TextFormat("Alternativa", 12, 0);
autoSize = TextFieldAutoSize.LEFT;
antiAliasType = AntiAliasType.ADVANCED;
thickness = 50;
sharpness = -50;
embedFonts = true;
border = true;
borderColor = 0;
background = true;
backgroundColor = 0xFFFFFF;
x = 20;
y = -90;
alpha = 0.9;
};
addChild(log);
updateLog();
};
visible = false;
parent.mouseEnabled = false;
parent.mouseChildren = false;
parent.addChild(this);
stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
stage.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
stage.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
stage.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
stage.addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
stage.addEventListener(FocusEvent.FOCUS_IN, onFocusIn);
stage.addEventListener(FocusEvent.FOCUS_OUT, onFocusOut);
stage.addEventListener(Event.MOUSE_LEAVE, onMouseLeave);
stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
stage.addEventListener(KeyboardEvent.KEY_UP, onKeyUp);
}
private function getDropObject(_arg1:DisplayObject):IDrop{
var _local3:DisplayObject;
var _local2:IDrop;
if (_arg1 != null){
_local3 = _arg1;
while (_local3 != null) {
if ((((_local3 is IDrop)) && (!((_local3 == dragged))))){
if (IDrop(_local3).canDrop(dragObject)){
_local2 = IDrop(_local3);
break;
};
};
_local3 = _local3.parent;
};
};
return (_local2);
}
private function startHint(_arg1:ICursorActive):void{
if (((!((_arg1.hint == null))) && (!((_arg1.hint == ""))))){
hintTimer = setTimeout(showHint, hintDelay, _arg1.hint);
};
}
private function setActiveParentsNormal(_arg1:DisplayObject):void{
var _local2:DisplayObject;
if (_arg1 != null){
_local2 = _arg1.parent;
while (_local2 != null) {
if ((_local2 is ICursorActive)){
if (_local2 != focused){
ICursorActive(_local2).setNormalState();
};
};
_local2 = _local2.parent;
};
};
}
private function showHint(_arg1:String):void{
hint.htmlText = _arg1;
hint.width = Math.ceil(hint.width);
hint.visible = true;
hintTimer = setTimeout(hideHint, hintTimeout);
posHint();
}
private function onKeyUp(_arg1:KeyboardEvent):void{
switch (_arg1.keyCode){
case Keyboard.CONTROL:
ctrlKeyPressed = false;
if (((!((overed == null))) && ((overed is WindowTitleBase)))){
WindowTitleBase(overed).moveable = true;
};
break;
case Keyboard.SHIFT:
shiftKeyPressed = false;
break;
};
}
private function getInfo(_arg1:Object):String{
var _local2:String = new String();
_local2 = (_local2 + _arg1.toString());
_local2 = (_local2 + "\n\n");
if (_arg1.parent != null){
_local2 = (_local2 + getInfo(_arg1.parent));
};
return (_local2);
}
private function onFocusIn(_arg1:FocusEvent):void{
focused = DisplayObject(_arg1.target);
if ((focused is ICursorActive)){
if (((!((focused == overed))) && (!((focused == pressed))))){
ICursorActive(focused).setOverState();
};
};
if (debugMode){
updateLog("focusIn");
};
}
private function onMouseUp(_arg1:MouseEvent):void{
var _local2:Point;
if (dragged != null){
if (dropped != null){
EventDispatcher(dragged).dispatchEvent(new DragEvent(DragEvent.STOP, dragObject));
_local2 = MouseUtility.localCoords(DisplayObject(dropped));
EventDispatcher(dropped).dispatchEvent(new DragEvent(DragEvent.DROP, dragObject, _local2.x, _local2.y));
hideHint();
dropped = null;
} else {
EventDispatcher(dragged).dispatchEvent(new DragEvent(DragEvent.CANCEL, dragObject));
};
if (dragObject.graphics != null){
if (contains(dragObject.graphics)){
removeChild(dragObject.graphics);
};
dragObject = null;
};
dragged = null;
} else {
if (overed == pressed){
if ((pressed is ICursorActive)){
ICursorActive(pressed).setOverState();
};
} else {
if ((pressed is ICursorActive)){
if (pressed == focused){
ICursorActive(focused).setOverState();
} else {
ICursorActive(pressed).setNormalState();
};
};
setActiveParentsNormal(pressed);
if ((overed is ICursorActive)){
ICursorActive(overed).setOverState();
};
setActiveParentsOver(overed);
};
};
unlock();
dragOffset = null;
pressed = null;
if (debugMode){
updateLog("mouseUp");
};
}
private function onKeyDown(_arg1:KeyboardEvent):void{
switch (_arg1.keyCode){
case Keyboard.CONTROL:
ctrlKeyPressed = true;
if (((!((overed == null))) && ((overed is WindowTitleBase)))){
WindowTitleBase(overed).moveable = false;
};
break;
case Keyboard.SHIFT:
shiftKeyPressed = true;
break;
};
}
private function onMouseDown(_arg1:MouseEvent):void{
pressed = DisplayObject(_arg1.target);
lock();
hideHint();
if ((pressed is ICursorActive)){
ICursorActive(pressed).setPressState();
if ((((((pressed is IDrag)) && (ctrlKeyPressed))) && (IDrag(pressed).isDragable()))){
dragOffset = MouseUtility.localCoords(pressed);
};
};
if (debugMode){
updateLog("mouseDown");
};
}
private function onMouseLeave(_arg1:Event):void{
Mouse.show();
visible = false;
}
private function draw(_arg1:uint):void{
if (gfx != null){
if (contains(gfx)){
removeChild(gfx);
};
};
if (_arg1 != NONE){
gfx = Bitmap(new state[_arg1].cursorState());
gfx.x = -(state[_arg1].xOffset);
gfx.y = -(state[_arg1].yOffset);
addChild(gfx);
};
}
private function onFocusOut(_arg1:FocusEvent):void{
if ((focused is ICursorActive)){
if (((!((focused == overed))) && (!((focused == pressed))))){
ICursorActive(focused).setNormalState();
};
};
focused = null;
if (debugMode){
updateLog("focusOut");
};
}
private function setActiveParentsOver(_arg1:DisplayObject):void{
var _local2:DisplayObject;
if (_arg1 != null){
_local2 = _arg1.parent;
while (_local2 != null) {
if ((_local2 is ICursorActive)){
ICursorActive(_local2).setOverState();
};
_local2 = _local2.parent;
};
};
}
private function updateLog(_arg1:String=""):void{
if (overed != null){
log.htmlText = getInfo(overed);
} else {
log.htmlText = "";
};
}
private function onMouseOut(_arg1:MouseEvent):void{
var _local2:IDrop;
var _local3:Point;
if (dragged != null){
if (dropped != null){
_local2 = getDropObject(_arg1.relatedObject);
if (_local2 != dropped){
draw(DRAG);
hideHint();
if ((overed is ICursorActive)){
ICursorActive(overed).setNormalState();
};
setActiveParentsNormal(overed);
_local3 = MouseUtility.localCoords(DisplayObject(dropped));
EventDispatcher(dropped).dispatchEvent(new DragEvent(DragEvent.OUT, dragObject, _local3.x, _local3.y));
dropped = null;
};
};
} else {
if (pressed != null){
if (overed == pressed){
if ((overed is ICursorActive)){
ICursorActive(overed).setOverState();
};
};
} else {
if ((overed is ICursorActive)){
if (overed != focused){
ICursorActive(overed).setNormalState();
};
};
setActiveParentsNormal(overed);
};
hideHint();
};
change(NORMAL);
overed = null;
if (debugMode){
updateLog("mouseOut");
};
}
private function hideHint():void{
hint.htmlText = "";
hint.visible = false;
clearTimeout(hintTimer);
}
private function onDragKeyDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.ESCAPE){
EventDispatcher(dragged).dispatchEvent(new DragEvent(DragEvent.CANCEL, dragObject));
if (dragObject.graphics != null){
if (contains(dragObject.graphics)){
removeChild(dragObject.graphics);
};
dragObject = null;
};
dragged = null;
unlock();
};
}
private function onMouseMove(_arg1:MouseEvent):void{
var _local3:Number;
if (!visible){
Mouse.hide();
visible = true;
};
var _local2:Point = globalToLocal(new Point(stage.mouseX, stage.mouseY));
x = (x + _local2.x);
y = (y + _local2.y);
if (hint.visible){
posHint();
};
if (((!((dragOffset == null))) && (!((pressed == null))))){
_local3 = Point.distance(dragOffset, MouseUtility.localCoords(pressed));
if (_local3 > dragEnableDistance){
dragged = IDrag(pressed);
draw(DRAG);
dragged.setNormalState();
setActiveParentsNormal(DisplayObject(dragged));
dragObject = dragged.getDragObject();
EventDispatcher(dragged).dispatchEvent(new DragEvent(DragEvent.START, dragObject, dragOffset.x, dragOffset.y));
dropped = getDropObject(overed);
if (dropped != null){
draw(DROP);
dropped.setOverState();
startHint(dropped);
};
addChildAt(dragObject.graphics, 0);
dragObject.graphics.x = (dragObject.graphics.x - dragOffset.x);
dragObject.graphics.y = (dragObject.graphics.y - dragOffset.y);
pressed = null;
dragOffset = null;
};
};
if (debugMode){
updateLog("mouseMove");
};
_arg1.updateAfterEvent();
}
private function onMouseOver(_arg1:MouseEvent):void{
var _local2:IDrop;
var _local3:Point;
overed = DisplayObject(_arg1.target);
if (dragged != null){
_local2 = getDropObject(overed);
if (_local2 != dropped){
dropped = _local2;
draw(DROP);
_local3 = MouseUtility.localCoords(DisplayObject(dropped));
EventDispatcher(dropped).dispatchEvent(new DragEvent(DragEvent.OVER, dragObject, _local3.x, _local3.y));
startHint(dropped);
dropped.setOverState();
};
} else {
if ((((((overed is IDrag)) && (ctrlKeyPressed))) && ((overed is WindowTitleBase)))){
WindowTitleBase(overed).moveable = false;
};
if (pressed != null){
if (overed == pressed){
if ((overed is ICursorActive)){
ICursorActive(overed).setPressState();
};
};
} else {
if ((overed is ICursorActive)){
ICursorActive(overed).setOverState();
startHint(ICursorActive(overed));
};
setActiveParentsOver(overed);
};
};
if ((overed is ICursorActive)){
change(ICursorActive(overed).cursor);
};
if (debugMode){
updateLog("mouseOver");
};
}
private function posHint():void{
var _local1:Point = localToGlobal(new Point(hint.width, hint.height));
if ((_local1.x + 6) > stage.stageWidth){
hint.x = (-2 - hint.width);
} else {
hint.x = 6;
};
if ((_local1.y + 12) > stage.stageHeight){
hint.y = (-2 - hint.height);
} else {
hint.y = 12;
};
}
public static function init(_arg1:DisplayObjectContainer):void{
if (instance == null){
instance = new Cursor(_arg1);
};
change(NORMAL);
}
public static function lock():void{
instance.locked = true;
}
public static function change(_arg1:uint):void{
instance.current = _arg1;
if (!instance.locked){
instance.draw(_arg1);
};
}
public static function unlock():void{
instance.locked = false;
instance.draw(instance.current);
}
}
}//package com.alternativagame.gui.cursor
Section 282
//Cursor_cursorActive (com.alternativagame.gui.cursor.Cursor_cursorActive)
package com.alternativagame.gui.cursor {
import mx.core.*;
public class Cursor_cursorActive extends BitmapAsset {
}
}//package com.alternativagame.gui.cursor
Section 283
//Cursor_cursorDrag (com.alternativagame.gui.cursor.Cursor_cursorDrag)
package com.alternativagame.gui.cursor {
import mx.core.*;
public class Cursor_cursorDrag extends BitmapAsset {
}
}//package com.alternativagame.gui.cursor
Section 284
//Cursor_cursorDrop (com.alternativagame.gui.cursor.Cursor_cursorDrop)
package com.alternativagame.gui.cursor {
import mx.core.*;
public class Cursor_cursorDrop extends BitmapAsset {
}
}//package com.alternativagame.gui.cursor
Section 285
//Cursor_cursorGrab (com.alternativagame.gui.cursor.Cursor_cursorGrab)
package com.alternativagame.gui.cursor {
import mx.core.*;
public class Cursor_cursorGrab extends BitmapAsset {
}
}//package com.alternativagame.gui.cursor
Section 286
//Cursor_cursorHand (com.alternativagame.gui.cursor.Cursor_cursorHand)
package com.alternativagame.gui.cursor {
import mx.core.*;
public class Cursor_cursorHand extends BitmapAsset {
}
}//package com.alternativagame.gui.cursor
Section 287
//Cursor_cursorImposible (com.alternativagame.gui.cursor.Cursor_cursorImposible)
package com.alternativagame.gui.cursor {
import mx.core.*;
public class Cursor_cursorImposible extends BitmapAsset {
}
}//package com.alternativagame.gui.cursor
Section 288
//Cursor_cursorMove (com.alternativagame.gui.cursor.Cursor_cursorMove)
package com.alternativagame.gui.cursor {
import mx.core.*;
public class Cursor_cursorMove extends BitmapAsset {
}
}//package com.alternativagame.gui.cursor
Section 289
//Cursor_cursorNormal (com.alternativagame.gui.cursor.Cursor_cursorNormal)
package com.alternativagame.gui.cursor {
import mx.core.*;
public class Cursor_cursorNormal extends BitmapAsset {
}
}//package com.alternativagame.gui.cursor
Section 290
//Cursor_cursorResizeDiagonalDown (com.alternativagame.gui.cursor.Cursor_cursorResizeDiagonalDown)
package com.alternativagame.gui.cursor {
import mx.core.*;
public class Cursor_cursorResizeDiagonalDown extends BitmapAsset {
}
}//package com.alternativagame.gui.cursor
Section 291
//Cursor_cursorResizeDiagonalUp (com.alternativagame.gui.cursor.Cursor_cursorResizeDiagonalUp)
package com.alternativagame.gui.cursor {
import mx.core.*;
public class Cursor_cursorResizeDiagonalUp extends BitmapAsset {
}
}//package com.alternativagame.gui.cursor
Section 292
//Cursor_cursorResizeHorizontal (com.alternativagame.gui.cursor.Cursor_cursorResizeHorizontal)
package com.alternativagame.gui.cursor {
import mx.core.*;
public class Cursor_cursorResizeHorizontal extends BitmapAsset {
}
}//package com.alternativagame.gui.cursor
Section 293
//Cursor_cursorResizeVertical (com.alternativagame.gui.cursor.Cursor_cursorResizeVertical)
package com.alternativagame.gui.cursor {
import mx.core.*;
public class Cursor_cursorResizeVertical extends BitmapAsset {
}
}//package com.alternativagame.gui.cursor
Section 294
//ICursorActive (com.alternativagame.gui.cursor.ICursorActive)
package com.alternativagame.gui.cursor {
public interface ICursorActive {
function setPressState():void;
function get cursor():uint;
function get hint():String;
function setNormalState():void;
function setOverState():void;
}
}//package com.alternativagame.gui.cursor
Section 295
//DragEvent (com.alternativagame.gui.dnd.DragEvent)
package com.alternativagame.gui.dnd {
import flash.events.*;
public class DragEvent extends Event {
public var dragObject:IDragObject;
public var localX:Number;
public var localY:Number;
public static const OVER:String = "dragOver";
public static const STOP:String = "stopDrag";
public static const OUT:String = "dragOut";
public static const START:String = "startDrag";
public static const DROP:String = "drop";
public static const CANCEL:String = "cancelDrag";
public static const DRAG:String = "drag";
public function DragEvent(_arg1:String, _arg2:IDragObject, _arg3:Number=0, _arg4:Number=0){
this.dragObject = _arg2;
this.localX = _arg3;
this.localY = _arg4;
super(_arg1, true);
}
}
}//package com.alternativagame.gui.dnd
Section 296
//IDrag (com.alternativagame.gui.dnd.IDrag)
package com.alternativagame.gui.dnd {
import com.alternativagame.gui.cursor.*;
public interface IDrag extends ICursorActive {
function isDragable():Boolean;
function getDragObject():IDragObject;
}
}//package com.alternativagame.gui.dnd
Section 297
//IDragObject (com.alternativagame.gui.dnd.IDragObject)
package com.alternativagame.gui.dnd {
import flash.display.*;
public interface IDragObject {
function get data():Object;
function get graphics():DisplayObject;
}
}//package com.alternativagame.gui.dnd
Section 298
//IDrop (com.alternativagame.gui.dnd.IDrop)
package com.alternativagame.gui.dnd {
import com.alternativagame.gui.cursor.*;
public interface IDrop extends ICursorActive {
function canDrop(_arg1:IDragObject):Boolean;
}
}//package com.alternativagame.gui.dnd
Section 299
//GlobalIcon (com.alternativagame.gui.icon.GlobalIcon)
package com.alternativagame.gui.icon {
import flash.display.*;
public final class GlobalIcon {
public static var EMPTY_ITEM:BitmapData;
public static function init():void{
EMPTY_ITEM = new BitmapData(19, 19, true, 0);
}
}
}//package com.alternativagame.gui.icon
Section 300
//Align (com.alternativagame.gui.layout.enums.Align)
package com.alternativagame.gui.layout.enums {
public final class Align {
public static const RIGHT:uint = 2;
public static const MIDDLE:uint = 4;
public static const LEFT:uint = 0;
public static const BOTTOM:uint = 5;
public static const JUSTIFY:uint = 6;
public static const TOP:uint = 3;
public static const CENTER:uint = 1;
}
}//package com.alternativagame.gui.layout.enums
Section 301
//Direction (com.alternativagame.gui.layout.enums.Direction)
package com.alternativagame.gui.layout.enums {
public final class Direction {
public static const HORIZONTAL:Boolean = false;
public static const VERTICAL:Boolean = true;
}
}//package com.alternativagame.gui.layout.enums
Section 302
//ScrollMode (com.alternativagame.gui.layout.enums.ScrollMode)
package com.alternativagame.gui.layout.enums {
public final class ScrollMode {
public static const SHOW_HORIZONTAL:uint = 10;
public static const AUTO_VERTICAL:uint = 1;
public static const AUTO:uint = 3;
public static const AUTO_HORIZONTAL:uint = 2;
public static const SHOW_VERTICAL:uint = 5;
public static const SHOW:uint = 15;
public static const NONE:uint = 0;
}
}//package com.alternativagame.gui.layout.enums
Section 303
//CompletelyFillLayoutManager (com.alternativagame.gui.layout.impl.CompletelyFillLayoutManager)
package com.alternativagame.gui.layout.impl {
import flash.geom.*;
import com.alternativagame.gui.base.*;
import com.alternativagame.gui.layout.*;
import com.alternativagame.gui.container.*;
import com.alternativagame.gui.layout.enums.*;
public class CompletelyFillLayoutManager implements ILayoutManager {
private var _space:int;
private var objectsNum:uint;
private var objects:Array;
private var areaSize:Point;
private var vAlign:uint;
private var objectsSize:Array;
private var hAlign:uint;
private var direction:Boolean;
public function CompletelyFillLayoutManager(_arg1:Boolean=false, _arg2:uint=1, _arg3:uint=4, _arg4:int=0){
this.direction = _arg1;
this.hAlign = _arg2;
this.vAlign = _arg3;
_space = _arg4;
this.objectsSize = new Array();
}
public function draw(_arg1:Container, _arg2:Point):Point{
var _local4:int;
var _local5:IGUIObject;
var _local6:Point;
var _local3:int;
if (objectsNum > 0){
if (direction == Direction.HORIZONTAL){
switch (hAlign){
case Align.LEFT:
break;
case Align.CENTER:
_local3 = int((((_arg2.x - areaSize.x) * 0.5) + 0.5));
break;
case Align.RIGHT:
_local3 = (_arg2.x - areaSize.x);
break;
};
} else {
switch (vAlign){
case Align.TOP:
break;
case Align.MIDDLE:
_local3 = int((((_arg2.y - areaSize.y) * 0.5) + 0.5));
break;
case Align.BOTTOM:
_local3 = (_arg2.y - areaSize.y);
break;
};
};
_local4 = 0;
while (_local4 < objectsNum) {
_local5 = IGUIObject(objects[_local4]);
_local6 = Point(objectsSize[_local4]);
if (_local6 != _local5.currentSize){
_local5.draw(_local6);
};
if (direction == Direction.HORIZONTAL){
_local5.x = _local3;
_local3 = (_local3 + (_local6.x + _space));
switch (vAlign){
case Align.TOP:
break;
case Align.MIDDLE:
_local5.y = int((((_arg2.y - _local6.y) * 0.5) + 0.5));
break;
case Align.BOTTOM:
_local5.y = (_arg2.y - _local6.y);
break;
};
} else {
_local5.y = _local3;
_local3 = (_local3 + (_local6.y + _space));
switch (hAlign){
case Align.LEFT:
break;
case Align.CENTER:
_local5.x = int((((_arg2.x - _local6.x) * 0.5) + 0.5));
break;
case Align.RIGHT:
_local5.x = (_arg2.x - _local6.x);
break;
};
};
_local4++;
};
};
return (_arg2);
}
public function get space():int{
return (_space);
}
public function set space(_arg1:int):void{
_space = _arg1;
}
public function computeSize(_arg1:Container, _arg2:Point=null):Point{
var _local4:Point;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:IGUIObject;
var _local13:Point;
var _local14:int;
var _local15:int;
var _local16:int;
if (_arg2 == null){
_local4 = new Point();
} else {
_local4 = _arg2.clone();
};
objects = _arg1.objects;
objectsNum = objects.length;
var _local3:Point = new Point();
if (objectsNum > 0){
_local5 = (space * (objectsNum - 1));
if (direction == Direction.HORIZONTAL){
_local4.x = (_local4.x - _local5);
} else {
_local4.y = (_local4.y - _local5);
};
_local6 = 0;
_local7 = 0;
_local8 = 0;
_local9 = 0;
_local11 = 0;
while (_local11 < objectsNum) {
_local12 = IGUIObject(objects[_local11]);
if ((_local12 is IContainer)){
_local13 = _local12.computeSize(new Point());
} else {
_local13 = _local12.minSize.clone();
};
objectsSize[_local11] = _local13;
if (!_local12.isStretchable(direction)){
_local6 = (_local6 + directionSize(_local13));
_local7++;
} else {
_local8 = (_local8 + directionSize(_local13));
};
addObjectSize(_local3, _local13);
if (_local12.isStretchable(!(direction))){
objectsSize[_local11] = ((direction == Direction.HORIZONTAL)) ? new Point(objectsSize[_local11].x, _local4.y) : new Point(_local4.x, objectsSize[_local11].y);
if ((_local12 is IContainer)){
_local12.computeSize(new Point(Point(objectsSize[_local11]).x, Point(objectsSize[_local11]).y));
};
};
_local11++;
};
_local9 = (objectsNum - _local7);
_local10 = ((directionSize(_local4) - _local8) - _local6);
if ((((directionSize(_local3) <= directionSize(_local4))) && (!((_local9 == 0))))){
_local14 = Math.round(((directionSize(_local4) - _local6) / _local9));
_local11 = 0;
while (_local11 < objectsNum) {
_local12 = IGUIObject(objects[_local11]);
if (_local12.isStretchable(direction)){
_local15 = _local11;
if (directionSize(objectsSize[_local11]) < _local14){
_local16 = (_local14 - directionSize(objectsSize[_local11]));
if (_local10 >= _local16){
if (direction == Direction.HORIZONTAL){
objectsSize[_local11] = new Point((Point(objectsSize[_local11]).x + _local16), Point(objectsSize[_local11]).y);
addObjectSize(_local3, new Point(_local16, 0));
} else {
objectsSize[_local11] = new Point(Point(objectsSize[_local11]).x, (Point(objectsSize[_local11]).y + _local16));
addObjectSize(_local3, new Point(0, _local16));
};
_local10 = (_local10 - _local16);
} else {
if (direction == Direction.HORIZONTAL){
objectsSize[_local11] = new Point((Point(objectsSize[_local11]).x + _local10), Point(objectsSize[_local11]).y);
addObjectSize(_local3, new Point(_local10, 0));
} else {
objectsSize[_local11] = new Point(Point(objectsSize[_local11]).x, (Point(objectsSize[_local11]).y + _local10));
addObjectSize(_local3, new Point(0, _local10));
};
_local10 = 0;
};
if ((_local12 is IContainer)){
_local12.computeSize(new Point(Point(objectsSize[_local11]).x, Point(objectsSize[_local11]).y));
};
};
};
_local11++;
};
if (_local10 > 0){
if (direction == Direction.HORIZONTAL){
objectsSize[_local15] = new Point((Point(objectsSize[_local15]).x + _local10), Point(objectsSize[_local15]).y);
addObjectSize(_local3, new Point(_local10, 0));
} else {
objectsSize[_local15] = new Point(Point(objectsSize[_local15]).x, (Point(objectsSize[_local15]).y + _local10));
addObjectSize(_local3, new Point(0, _local10));
};
_local10 = 0;
};
};
};
if (direction == Direction.HORIZONTAL){
_local3.x = (_local3.x + _local5);
} else {
_local3.y = (_local3.y + _local5);
};
areaSize = _local3;
return (_local3);
}
private function directionSize(_arg1:Point):int{
return (((direction == Direction.HORIZONTAL)) ? _arg1.x : _arg1.y);
}
private function addObjectSize(_arg1:Point, _arg2:Point):void{
if (direction == Direction.HORIZONTAL){
_arg1.x = (_arg1.x + _arg2.x);
_arg1.y = Math.max(_arg1.y, _arg2.y);
} else {
_arg1.y = (_arg1.y + _arg2.y);
_arg1.x = Math.max(_arg1.x, _arg2.x);
};
}
}
}//package com.alternativagame.gui.layout.impl
Section 304
//FillLayoutManager (com.alternativagame.gui.layout.impl.FillLayoutManager)
package com.alternativagame.gui.layout.impl {
import flash.geom.*;
import com.alternativagame.gui.base.*;
import com.alternativagame.gui.layout.*;
import com.alternativagame.gui.container.*;
import com.alternativagame.gui.layout.enums.*;
public final class FillLayoutManager implements ILayoutManager {
private var hAlign:uint;
private var _space:int;
private var areaSize:Point;
private var vAlign:uint;
private var objectsSize:Array;
private var direction:Boolean;
private static const debugMode:Boolean = false;
public function FillLayoutManager(_arg1:Boolean=false, _arg2:uint=1, _arg3:uint=4, _arg4:int=0){
this.direction = _arg1;
this.hAlign = _arg2;
this.vAlign = _arg3;
_space = _arg4;
this.objectsSize = new Array();
}
private function directionSize(_arg1:Point):int{
return (((direction == Direction.HORIZONTAL)) ? _arg1.x : _arg1.y);
}
private function addObjectSize(_arg1:Point, _arg2:Point):void{
if (direction == Direction.HORIZONTAL){
_arg1.x = (_arg1.x + _arg2.x);
_arg1.y = Math.max(_arg1.y, _arg2.y);
} else {
_arg1.y = (_arg1.y + _arg2.y);
_arg1.x = Math.max(_arg1.x, _arg2.x);
};
}
public function draw(_arg1:Container, _arg2:Point):Point{
var _local6:int;
var _local7:IGUIObject;
var _local8:Point;
var _local3:Array = _arg1.objects;
var _local4:uint = _local3.length;
var _local5:int;
if (_local4 > 0){
if (direction == Direction.HORIZONTAL){
switch (hAlign){
case Align.LEFT:
break;
case Align.CENTER:
_local5 = int((((_arg2.x - areaSize.x) * 0.5) + 0.5));
break;
case Align.RIGHT:
_local5 = (_arg2.x - areaSize.x);
break;
};
} else {
switch (vAlign){
case Align.TOP:
break;
case Align.MIDDLE:
_local5 = int((((_arg2.y - areaSize.y) * 0.5) + 0.5));
break;
case Align.BOTTOM:
_local5 = (_arg2.y - areaSize.y);
break;
};
};
_local6 = 0;
while (_local6 < _local4) {
_local7 = IGUIObject(_local3[_local6]);
_local8 = Point(objectsSize[_local6]);
if (_local8 != _local7.currentSize){
_local7.draw(_local8);
};
if (direction == Direction.HORIZONTAL){
_local7.x = _local5;
_local5 = (_local5 + (_local8.x + space));
switch (vAlign){
case Align.TOP:
break;
case Align.MIDDLE:
_local7.y = int((((_arg2.y - _local8.y) * 0.5) + 0.5));
break;
case Align.BOTTOM:
_local7.y = (_arg2.y - _local8.y);
break;
};
} else {
_local7.y = _local5;
_local5 = (_local5 + (_local8.y + space));
switch (hAlign){
case Align.LEFT:
break;
case Align.CENTER:
_local7.x = int((((_arg2.x - _local8.x) * 0.5) + 0.5));
break;
case Align.RIGHT:
_local7.x = (_arg2.x - _local8.x);
break;
};
};
_local6++;
};
};
return (_arg2);
}
public function set space(_arg1:int):void{
_space = _arg1;
}
public function get space():int{
return (_space);
}
public function computeSize(_arg1:Container, _arg2:Point=null):Point{
var _local3:Point = _computeSize(_arg1, _arg2);
if (_arg2 != _local3){
_local3 = _computeSize(_arg1, _local3);
};
return (_local3);
}
private function _computeSize(_arg1:Container, _arg2:Point):Point{
var _local7:int;
var _local8:int;
var _local9:uint;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:IGUIObject;
var _local14:Point;
var _local3:Point = _arg2.clone();
var _local4:Array = _arg1.objects;
var _local5:uint = _local4.length;
var _local6:Point = new Point();
if (_local5 > 0){
_local7 = (space * (_local5 - 1));
if (direction == Direction.HORIZONTAL){
_local3.x = (_local3.x - _local7);
} else {
_local3.y = (_local3.y - _local7);
};
_local8 = 0;
_local9 = 0;
_local10 = 0;
while (_local10 < _local5) {
_local13 = IGUIObject(_local4[_local10]);
if (!_local13.isStretchable(direction)){
_local14 = _local13.computeSize(_local3);
_local8 = (_local8 + directionSize(_local14));
_local9++;
objectsSize[_local10] = _local14;
addObjectSize(_local6, _local14);
};
_local10++;
};
_local11 = Math.floor(((directionSize(_local3) - _local8) / (_local5 - _local9)));
_local12 = (((_local8 + (_local11 * (_local5 - _local9))) + _local7) - directionSize(_local3));
_local10 = 0;
while (_local10 < _local5) {
_local13 = IGUIObject(_local4[_local10]);
if (_local13.isStretchable(direction)){
_local14 = _local13.computeSize(new Point(((direction == Direction.HORIZONTAL)) ? _local11 : _local3.x, ((direction == Direction.VERTICAL)) ? _local11 : _local3.y));
objectsSize[_local10] = _local14;
addObjectSize(_local6, _local14);
};
_local10++;
};
if (direction == Direction.HORIZONTAL){
_local6.x = (_local6.x + _local7);
} else {
_local6.y = (_local6.y + _local7);
};
areaSize = _local6;
};
return (_local6);
}
public function toString():String{
var _local1:String = new String();
_local1 = (_local1 + "FillLayoutManager");
_local1 = (_local1 + (" Direction:" + this.direction));
_local1 = (_local1 + (" hAlign:" + this.hAlign));
_local1 = (_local1 + (" vAlign:" + this.vAlign));
_local1 = (_local1 + (" Space:" + this.space));
return (_local1);
}
}
}//package com.alternativagame.gui.layout.impl
Section 305
//GridLayoutManager (com.alternativagame.gui.layout.impl.GridLayoutManager)
package com.alternativagame.gui.layout.impl {
import flash.geom.*;
import com.alternativagame.gui.base.*;
import com.alternativagame.gui.layout.*;
import com.alternativagame.gui.container.*;
import com.alternativagame.gui.layout.enums.*;
public class GridLayoutManager implements ILayoutManager {
private var realHeigths:Array;
private var vMargin:Point;
private var hAligns:Array;
private var numCol:int;
private var vAligns:Array;
public var realWidths:Array;
private var widths:Array;
private var objectsSize:Array;
private var _freeze:Boolean;
private var hMargins:Array;
public function GridLayoutManager(_arg1:int, _arg2:Point=null){
this.numCol = _arg1;
this.widths = new Array(_arg1);
this.realWidths = new Array(_arg1);
this.realHeigths = new Array();
this.objectsSize = new Array();
this.hAligns = new Array();
this.vAligns = new Array();
this.hMargins = new Array();
this.vMargin = ((_arg2)!=null) ? _arg2 : new Point(0, 0);
this.freeze = false;
}
public function draw(_arg1:Container, _arg2:Point):Point{
var _local9:int;
var _local10:IGUIObject;
var _local11:Point;
var _local12:Point;
var _local3:Array = _arg1.objects;
var _local4:uint = int(((_local3.length / numCol) + 0.5));
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
while (_local8 < _local4) {
_local5 = 0;
_local9 = 0;
while (_local9 < numCol) {
_local10 = _local3[_local7];
if (_local10 == null){
break;
};
_local11 = Point(hMargins[_local9]);
_local12 = objectsSize[_local7];
if (_local12 != _local10.currentSize){
_local10.draw(_local12);
};
switch (hAligns[_local9]){
case Align.LEFT:
_local10.x = Math.round((_local5 + _local11.x));
break;
case Align.RIGHT:
_local10.x = Math.round((((_local5 + realWidths[_local9]) - _local12.x) - _local11.y));
break;
case Align.CENTER:
_local10.x = Math.round(((_local5 + _local11.x) + ((((realWidths[_local9] - _local12.x) - _local11.x) - _local11.y) / 2)));
break;
};
switch (vAligns[_local9]){
case Align.TOP:
_local10.y = Math.round((_local6 + vMargin.x));
break;
case Align.BOTTOM:
_local10.y = Math.round((((_local6 + realHeigths[_local8]) - _local12.y) - vMargin.y));
break;
case Align.MIDDLE:
_local10.y = Math.round(((_local6 + vMargin.x) + (((realHeigths[_local8] - _local12.y) - vMargin.y) / 2)));
break;
};
_local5 = (_local5 + realWidths[_local9]);
_local7++;
_local9++;
};
_local6 = (_local6 + ((realHeigths[_local8] + vMargin.x) + vMargin.y));
_local8++;
};
return (_arg2);
}
public function toString():String{
var _local1:String = new String();
_local1 = (_local1 + "GridLayoutManager");
_local1 = (_local1 + (" RealWidths:" + this.realWidths));
_local1 = (_local1 + (" RealHeigth:" + this.realHeigths));
return (_local1);
}
public function computeSize(_arg1:Container, _arg2:Point=null):Point{
var _local4:int;
var _local3:int;
while (_local3 < numCol) {
if (this.widths[_local3] > 0){
realWidths[_local3] = this.widths[_local3];
} else {
realWidths[_local3] = 0;
};
_local3++;
};
if (!_freeze){
_local4 = 0;
while (_local4 < this.realHeigths.length) {
this.realHeigths[_local4] = 0;
_local4++;
};
};
return (compute(_arg1, _arg2));
}
public function set freeze(_arg1:Boolean):void{
this._freeze = _arg1;
}
private function compute(_arg1:Container, _arg2:Point=null):Point{
var _local14:int;
var _local15:int;
var _local16:Boolean;
var _local17:IGUIObject;
var _local18:Point;
var _local19:Point;
var _local20:int;
if (_arg2 == null){
_arg2 = new Point(0, 0);
};
var _local3:Point = new Point(0, 0);
var _local4:Array = _arg1.objects;
var _local5:uint = int(((_local4.length / numCol) + 0.5));
_arg2.y = (_arg2.y - ((vMargin.x + vMargin.y) * _local5));
var _local6:int = _arg2.x;
var _local7:int;
while (_local7 < numCol) {
if (widths[_local7] > 0){
_local6 = (_local6 - widths[_local7]);
};
_local7++;
};
if (_local6 < 0){
_local6 = 0;
};
var _local8:Number = (_local6 / 100);
var _local9:int;
while (_local9 < numCol) {
_local14 = this.widths[_local9];
_local15 = ((_local14)>0) ? _local14 : int(((_local8 * -(_local14)) + 0.5));
realWidths[_local9] = _local15;
_local3.x = (_local3.x + _local15);
_local9++;
};
var _local10:uint;
var _local11:uint;
var _local12:int;
var _local13:int;
while (_local13 < _local5) {
_local16 = false;
if (realHeigths.length <= _local13){
realHeigths[_local13] = 0;
};
_local9 = 0;
while (_local9 < numCol) {
_local17 = _local4[_local12];
if (_local17 == null){
break;
};
_local18 = Point(hMargins[_local9]);
_local19 = _local17.computeSize(new Point(((realWidths[_local9] - _local18.x) - _local18.y), realHeigths[_local13]));
objectsSize[_local12] = _local19;
realHeigths[_local13] = Math.max(realHeigths[_local13], _local19.y);
if (_local17.isStretchable(Direction.VERTICAL)){
_local16 = true;
};
_local12++;
_local9++;
};
if (_local16){
_local10++;
} else {
_local11 = (_local11 + realHeigths[_local13]);
};
_local13++;
};
if (_local10 > 0){
_local20 = int(((_arg2.y - _local11) / _local10));
_local12 = 0;
if (_local20 >= 0){
_local13 = 0;
while (_local13 < _local5) {
_local9 = 0;
while (_local9 < numCol) {
_local17 = _local4[_local12];
if (_local17 == null){
break;
};
if (_local17.isStretchable(Direction.VERTICAL)){
realHeigths[_local13] = Math.max(realHeigths[_local13], _local20);
objectsSize[_local12].y = realHeigths[_local13];
};
_local12++;
_local9++;
};
_local13++;
};
};
};
_local13 = 0;
while (_local13 < realHeigths.length) {
_local3.y = (_local3.y + realHeigths[_local13]);
_local13++;
};
_local3.y = (_local3.y + ((vMargin.x + vMargin.y) * realHeigths.length));
return (_local3);
}
public function colParam(_arg1:uint, _arg2:int, _arg3:int=1, _arg4:int=4, _arg5:Point=null):GridLayoutManager{
this.widths[_arg1] = _arg2;
this.hAligns[_arg1] = _arg3;
this.vAligns[_arg1] = _arg4;
this.hMargins[_arg1] = ((_arg5)!=null) ? _arg5 : new Point(0, 0);
return (this);
}
}
}//package com.alternativagame.gui.layout.impl
Section 306
//LayoutManager (com.alternativagame.gui.layout.impl.LayoutManager)
package com.alternativagame.gui.layout.impl {
import flash.geom.*;
import com.alternativagame.gui.layout.*;
import com.alternativagame.gui.container.*;
public class LayoutManager implements ILayoutManager {
public function computeSize(_arg1:Container, _arg2:Point=null):Point{
var _local3:Point;
var _local6:Point;
_local3 = ((_arg2)!=null) ? _arg2.clone() : new Point(0, 0);
var _local4:Array = _arg1.objects;
var _local5:int;
while (_local5 < _local4.length) {
_local6 = _local4[_local5].computeSize(_local3);
_local6.offset(_local4[_local5].x, _local4[_local5].y);
_local3.x = Math.max(_local3.x, _local6.x);
_local3.y = Math.max(_local3.y, _local6.y);
_local5++;
};
return (_local3);
}
public function draw(_arg1:Container, _arg2:Point):Point{
var _local3:Point;
var _local6:Point;
_local3 = ((_arg2)!=null) ? _arg2.clone() : new Point(0, 0);
var _local4:Array = _arg1.objects;
var _local5:int;
while (_local5 < _local4.length) {
_local6 = _local4[_local5].computeSize(_arg2);
_local4[_local5].draw(_local6);
_local6.offset(_local4[_local5].x, _local4[_local5].y);
_local3.x = Math.max(_local3.x, _local6.x);
_local3.y = Math.max(_local3.y, _local6.y);
_local5++;
};
return (_local3);
}
}
}//package com.alternativagame.gui.layout.impl
Section 307
//WindowLayoutManager (com.alternativagame.gui.layout.impl.WindowLayoutManager)
package com.alternativagame.gui.layout.impl {
import flash.geom.*;
import flash.display.*;
import com.alternativagame.gui.base.*;
import com.alternativagame.gui.layout.*;
import com.alternativagame.gui.container.*;
import com.alternativagame.gui.window.panel.*;
import com.alternativagame.gui.layout.enums.*;
public class WindowLayoutManager implements ILayoutManager {
private var objectsCoord:Array;
private var objectsNum:uint;
private var objects:Array;
private var objectsSize:Array;
public function WindowLayoutManager(){
this.objectsSize = new Array();
this.objectsCoord = new Array();
}
public function draw(_arg1:Container, _arg2:Point):Point{
var _local3:int;
var _local4:IGUIObject;
var _local5:Point;
if (objectsNum > 0){
_local3 = 0;
while (_local3 < objectsNum) {
_local4 = IGUIObject(objects[_local3]);
_local5 = Point(objectsSize[_local3]);
if (_local5 != _local4.currentSize){
_local4.draw(_local5);
};
DisplayObject(_local4).x = Point(objectsCoord[_local3]).x;
DisplayObject(_local4).y = Point(objectsCoord[_local3]).y;
_local3++;
};
};
return (_arg2);
}
public function computeSize(_arg1:Container, _arg2:Point=null):Point{
var _local3:Point;
var _local4:int;
var _local5:IGUIObject;
var _local6:Point;
if (_arg2 == null){
_local3 = new Point();
} else {
_local3 = _arg2.clone();
};
objects = _arg1.objects;
objectsNum = objects.length;
if (objectsNum > 0){
_local4 = 0;
while (_local4 < objectsNum) {
_local5 = IGUIObject(objects[_local4]);
_local6 = ((GUIObject(_local5).currentSize)!=null) ? GUIObject(_local5).currentSize : new Point();
if ((_local5 is ResizeablePanelBase)){
switch (ResizeablePanelBase(_local5).align){
case Align.LEFT:
objectsSize[_local4] = _local5.computeSize(new Point(_local6.x, _local3.y));
break;
case Align.TOP:
objectsSize[_local4] = _local5.computeSize(new Point(_local3.x, _local6.y));
break;
case Align.RIGHT:
objectsSize[_local4] = _local5.computeSize(new Point(_local6.x, _local3.y));
break;
case Align.BOTTOM:
objectsSize[_local4] = _local5.computeSize(new Point(_local3.x, _local6.y));
break;
};
} else {
objectsSize[_local4] = _local5.computeSize(_local6);
};
if ((_local5 is ResizeablePanelBase)){
switch (ResizeablePanelBase(_local5).align){
case Align.LEFT:
objectsCoord[_local4] = new Point(0, 0);
break;
case Align.TOP:
objectsCoord[_local4] = new Point(0, 0);
break;
case Align.RIGHT:
objectsCoord[_local4] = new Point((_local3.x - Point(objectsSize[_local4]).x), 0);
break;
case Align.BOTTOM:
objectsCoord[_local4] = new Point(0, (_local3.y - Point(objectsSize[_local4]).y));
break;
};
} else {
objectsCoord[_local4] = new Point(DisplayObject(_local5).x, DisplayObject(_local5).y);
};
_local4++;
};
};
return (_local3);
}
}
}//package com.alternativagame.gui.layout.impl
Section 308
//ILayoutManager (com.alternativagame.gui.layout.ILayoutManager)
package com.alternativagame.gui.layout {
import flash.geom.*;
import com.alternativagame.gui.container.*;
public interface ILayoutManager {
function computeSize(_arg1:Container, _arg2:Point=null):Point;
function draw(_arg1:Container, _arg2:Point):Point;
}
}//package com.alternativagame.gui.layout
Section 309
//ISnapable (com.alternativagame.gui.layout.ISnapable)
package com.alternativagame.gui.layout {
import flash.geom.*;
public interface ISnapable {
function get snapEnabled():Boolean;
function get x():Number;
function get y():Number;
function set snapRect(_arg1:Rectangle):void;
function get snapRect():Rectangle;
}
}//package com.alternativagame.gui.layout
Section 310
//SnapHelper (com.alternativagame.gui.layout.SnapHelper)
package com.alternativagame.gui.layout {
import flash.geom.*;
import flash.display.*;
public final class SnapHelper {
private static const snapSensitivity:uint = 10;
private static const snapSpace:uint = 1;
private static function cross(_arg1:int, _arg2:int, _arg3:int, _arg4:int):Boolean{
return ((((((((((_arg1 >= _arg3)) && ((_arg1 <= _arg4)))) || ((((_arg2 >= _arg3)) && ((_arg2 <= _arg4)))))) || ((((_arg1 >= _arg3)) && ((_arg2 <= _arg4)))))) || ((((_arg3 >= _arg1)) && ((_arg4 <= _arg2))))));
}
public static function connectOffset(_arg1:ISnapable, _arg2:DisplayObjectContainer, _arg3:Boolean):int{
var _local14:DisplayObject;
var _local15:ISnapable;
var _local16:int;
var _local17:int;
var _local18:int;
var _local19:int;
var _local4:int;
var _local5:String = (_arg3) ? "x" : "y";
var _local6:String = (_arg3) ? "width" : "height";
var _local7:String = (_arg3) ? "y" : "x";
var _local8:String = (_arg3) ? "height" : "width";
var _local9:int = (_arg1[_local7] + _arg1.snapRect[_local7]);
var _local10:int = (_local9 + _arg1.snapRect[_local8]);
var _local11:int = (_arg1[_local5] + _arg1.snapRect[_local5]);
var _local12:int = (_local11 + _arg1.snapRect[_local6]);
var _local13:int;
while (_local13 < _arg2.numChildren) {
_local14 = _arg2.getChildAt(_local13);
if ((((_local14 is ISnapable)) && (!((_local14 == _arg1))))){
_local15 = ISnapable(_local14);
if (_local15.snapEnabled){
_local16 = (_local15[_local7] + _local15.snapRect[_local7]);
_local17 = (_local16 + _local15.snapRect[_local8]);
_local18 = (_local15[_local5] + _local15.snapRect[_local5]);
_local19 = (_local18 + _local15.snapRect[_local6]);
if (((cross(_local9, _local10, _local16, _local17)) && ((((Math.abs((_local12 - _local18)) == snapSpace)) || ((Math.abs((_local11 - _local19)) == snapSpace)))))){
if (near(_local9, _local16)){
_local4 = (_local16 - _local9);
};
if (near(_local10, _local17)){
_local4 = (_local17 - _local10);
};
};
};
};
_local13++;
};
return (_local4);
}
public static function snapOffset(_arg1:ISnapable, _arg2:DisplayObjectContainer, _arg3:Boolean):int{
var _local20:DisplayObject;
var _local21:ISnapable;
var _local4:int;
var _local5:String = (_arg3) ? "x" : "y";
var _local6:String = (_arg3) ? "width" : "height";
var _local7:String = (_arg3) ? "y" : "x";
var _local8:String = (_arg3) ? "height" : "width";
var _local9:int = (_arg1[_local7] + _arg1.snapRect[_local7]);
var _local10:int = (_local9 + _arg1.snapRect[_local8]);
var _local11:int = (_arg1[_local5] + _arg1.snapRect[_local5]);
var _local12:int = (_local11 + _arg1.snapRect[_local6]);
var _local13:Point = _arg2.globalToLocal(new Point());
var _local14:Point = new Point(_arg2.stage.stageWidth, _arg2.stage.stageHeight);
var _local15:int = _local13[_local7];
var _local16:int = (_local13[_local7] + _local14[_local7]);
var _local17:int = _local13[_local5];
var _local18:int = (_local13[_local5] + _local14[_local5]);
if (near(_local9, _local15)){
_local4 = ((_local15 - _local9) + snapSpace);
};
if (near(_local10, _local16)){
_local4 = ((_local16 - _local10) - snapSpace);
};
var _local19:int;
while (_local19 < _arg2.numChildren) {
_local20 = _arg2.getChildAt(_local19);
if ((((_local20 is ISnapable)) && (!((_local20 == _arg1))))){
_local21 = ISnapable(_local20);
if (_local21.snapEnabled){
_local15 = (_local21[_local7] + _local21.snapRect[_local7]);
_local16 = (_local15 + _local21.snapRect[_local8]);
_local17 = (_local21[_local5] + _local21.snapRect[_local5]);
_local18 = (_local17 + _local21.snapRect[_local6]);
if (cross(_local11, _local12, _local17, _local18)){
if (near(_local10, _local15)){
if (_local15 > _local10){
_local4 = ((_local15 - _local10) - snapSpace);
};
};
if (near(_local9, _local16)){
if (_local9 > _local16){
_local4 = ((_local16 - _local9) + snapSpace);
};
};
};
};
};
_local19++;
};
return (_local4);
}
private static function near(_arg1:int, _arg2:int):Boolean{
return ((Math.abs((_arg1 - _arg2)) <= snapSensitivity));
}
}
}//package com.alternativagame.gui.layout
Section 311
//FrameGroupSkin (com.alternativagame.gui.skin.container.group.FrameGroupSkin)
package com.alternativagame.gui.skin.container.group {
import flash.display.*;
import com.alternativagame.gui.skin.*;
import flash.text.*;
public class FrameGroupSkin implements ISkin {
public var titleTextFormat:TextFormat;
public var titleSharpness:Number;
public var titleThickness:Number;
public var cornerTL:BitmapData;
public var cornerTR:BitmapData;
public var titleMarginLeft:int;
public var edgeML:BitmapData;
public var titleMarginRight:int;
public var cornerBL:BitmapData;
public var edgeMR:BitmapData;
public var cornerBR:BitmapData;
public var borderThickness:int;
public var edgeTCbefore:BitmapData;
public var edgeTC:BitmapData;
public var edgeTCafter:BitmapData;
public var edgeBC:BitmapData;
public function FrameGroupSkin(_arg1:BitmapData, _arg2:BitmapData, _arg3:BitmapData, _arg4:BitmapData, _arg5:BitmapData, _arg6:BitmapData, _arg7:BitmapData, _arg8:BitmapData, _arg9:BitmapData, _arg10:BitmapData, _arg11:int, _arg12:int, _arg13:int, _arg14:TextFormat, _arg15:Number, _arg16:Number){
this.cornerTL = _arg1;
this.cornerTR = _arg2;
this.cornerBL = _arg3;
this.cornerBR = _arg4;
this.edgeTC = _arg5;
this.edgeTCbefore = _arg6;
this.edgeTCafter = _arg7;
this.edgeML = _arg8;
this.edgeMR = _arg9;
this.edgeBC = _arg10;
this.borderThickness = _arg11;
this.titleMarginLeft = _arg12;
this.titleMarginRight = _arg13;
this.titleTextFormat = _arg14;
this.titleSharpness = _arg15;
this.titleThickness = _arg16;
}
}
}//package com.alternativagame.gui.skin.container.group
Section 312
//GroupSkin (com.alternativagame.gui.skin.container.group.GroupSkin)
package com.alternativagame.gui.skin.container.group {
import flash.display.*;
import com.alternativagame.gui.skin.*;
public class GroupSkin implements ISkin {
public var yNormal:int;
public var nr:BitmapData;
public var yPress:int;
public var maximize:BitmapData;
public var titleMarginLeft:int;
public var contentMarginTop:int;
public var titleMarginTop:int;
public var contentMarginBottom:int;
public var contentMarginRight:int;
public var titleMarginRight:int;
public var minimize:BitmapData;
public var contentMarginLeft:int;
public var titleMarginBottom:int;
public var nc:BitmapData;
public var close:BitmapData;
public var nl:BitmapData;
public function GroupSkin(_arg1:BitmapData, _arg2:BitmapData, _arg3:BitmapData, _arg4:int, _arg5:int, _arg6:int, _arg7:int, _arg8:int, _arg9:int, _arg10:int, _arg11:int, _arg12:int, _arg13:int){
this.nl = _arg1;
this.nc = _arg2;
this.nr = _arg3;
this.yNormal = _arg4;
this.yPress = _arg5;
this.titleMarginTop = _arg6;
this.titleMarginBottom = _arg7;
this.titleMarginLeft = _arg8;
this.titleMarginRight = _arg9;
this.contentMarginTop = _arg10;
this.contentMarginBottom = _arg11;
this.contentMarginLeft = _arg12;
this.contentMarginRight = _arg13;
}
}
}//package com.alternativagame.gui.skin.container.group
Section 313
//ButtonSkin (com.alternativagame.gui.skin.widget.button.ButtonSkin)
package com.alternativagame.gui.skin.widget.button {
import flash.geom.*;
import flash.display.*;
import com.alternativagame.gui.skin.*;
import flash.text.*;
public class ButtonSkin implements ISkin {
public var ll:BitmapData;
public var pr:BitmapData;
public var pl:BitmapData;
public var lr:BitmapData;
public var space:int;
public var textSharpness:Number;
public var tfLocked:TextFormat;
public var colorNormal:ColorTransform;
public var margin:int;
public var nc:BitmapData;
public var nl:BitmapData;
public var colorPressed:ColorTransform;
public var nr:BitmapData;
public var textThickness:Number;
public var colorLocked:ColorTransform;
public var tfPressed:TextFormat;
public var oc:BitmapData;
public var colorOver:ColorTransform;
public var yPressShift:int;
public var ol:BitmapData;
public var or:BitmapData;
public var tfOver:TextFormat;
public var pc:BitmapData;
public var lc:BitmapData;
public var tfNormal:TextFormat;
public function ButtonSkin(_arg1:BitmapData, _arg2:BitmapData, _arg3:BitmapData, _arg4:BitmapData, _arg5:BitmapData, _arg6:BitmapData, _arg7:BitmapData, _arg8:BitmapData, _arg9:BitmapData, _arg10:BitmapData, _arg11:BitmapData, _arg12:BitmapData, _arg13:int, _arg14:Number, _arg15:Number, _arg16:TextFormat, _arg17:TextFormat, _arg18:TextFormat, _arg19:TextFormat, _arg20:ColorTransform, _arg21:ColorTransform, _arg22:ColorTransform, _arg23:ColorTransform, _arg24:int, _arg25:int){
this.nl = _arg1;
this.nc = _arg2;
this.nr = _arg3;
this.ol = _arg4;
this.oc = _arg5;
this.or = _arg6;
this.pl = _arg7;
this.pc = _arg8;
this.pr = _arg9;
this.ll = _arg10;
this.lc = _arg11;
this.lr = _arg12;
this.yPressShift = _arg13;
this.textSharpness = _arg15;
this.textThickness = _arg14;
this.tfNormal = _arg16;
this.tfOver = _arg17;
this.tfPressed = _arg18;
this.tfLocked = _arg19;
this.colorNormal = _arg20;
this.colorOver = _arg21;
this.colorPressed = _arg22;
this.colorLocked = _arg23;
this.margin = _arg24;
this.space = _arg25;
}
}
}//package com.alternativagame.gui.skin.widget.button
Section 314
//ImageButtonSkin (com.alternativagame.gui.skin.widget.button.ImageButtonSkin)
package com.alternativagame.gui.skin.widget.button {
import flash.geom.*;
import com.alternativagame.gui.skin.*;
public class ImageButtonSkin implements ISkin {
public var colorPress:ColorTransform;
public var colorLock:ColorTransform;
public var colorOver:ColorTransform;
public var colorNormal:ColorTransform;
public function ImageButtonSkin(_arg1:ColorTransform, _arg2:ColorTransform, _arg3:ColorTransform, _arg4:ColorTransform){
this.colorNormal = _arg1;
this.colorOver = _arg2;
this.colorPress = _arg3;
this.colorLock = _arg4;
}
}
}//package com.alternativagame.gui.skin.widget.button
Section 315
//SliderSkin (com.alternativagame.gui.skin.widget.button.SliderSkin)
package com.alternativagame.gui.skin.widget.button {
import flash.display.*;
import com.alternativagame.gui.skin.*;
public class SliderSkin implements ISkin {
public var trackCenter:BitmapData;
public var borderThickness:int;
public var tickMargin:int;
public var trackRight:BitmapData;
public var trackLeft:BitmapData;
public var runner:BitmapData;
public var tick:BitmapData;
public function SliderSkin(_arg1:BitmapData, _arg2:BitmapData, _arg3:BitmapData, _arg4:BitmapData, _arg5:BitmapData, _arg6:int, _arg7:int){
this.trackLeft = _arg1;
this.trackCenter = _arg2;
this.trackRight = _arg3;
this.runner = _arg4;
this.tick = _arg5;
this.borderThickness = _arg6;
this.tickMargin = _arg7;
}
}
}//package com.alternativagame.gui.skin.widget.button
Section 316
//SwitchSkin (com.alternativagame.gui.skin.widget.button.SwitchSkin)
package com.alternativagame.gui.skin.widget.button {
import flash.display.*;
import com.alternativagame.gui.skin.*;
public class SwitchSkin implements ISkin {
public var edgeMR:BitmapData;
public var cornerBR:BitmapData;
public var borderThickness:int;
public var arrow:BitmapData;
public var edgeTC:BitmapData;
public var cornerTL:BitmapData;
public var cornerBL:BitmapData;
public var cornerTR:BitmapData;
public var edgeBC:BitmapData;
public var bgMC:BitmapData;
public var edgeML:BitmapData;
public function SwitchSkin(_arg1:BitmapData, _arg2:BitmapData, _arg3:BitmapData, _arg4:BitmapData, _arg5:BitmapData, _arg6:BitmapData, _arg7:BitmapData, _arg8:BitmapData, _arg9:BitmapData, _arg10:BitmapData, _arg11:int){
this.cornerTL = _arg1;
this.cornerTR = _arg2;
this.cornerBL = _arg3;
this.cornerBR = _arg4;
this.edgeTC = _arg5;
this.edgeML = _arg6;
this.edgeMR = _arg7;
this.edgeBC = _arg8;
this.bgMC = _arg9;
this.arrow = _arg10;
this.borderThickness = _arg11;
}
}
}//package com.alternativagame.gui.skin.widget.button
Section 317
//TriggerButtonSkin (com.alternativagame.gui.skin.widget.button.TriggerButtonSkin)
package com.alternativagame.gui.skin.widget.button {
import flash.display.*;
import com.alternativagame.gui.skin.*;
public class TriggerButtonSkin implements ISkin {
public var unselected:BitmapData;
public var lockedSelected:BitmapData;
public var selected:BitmapData;
public var lockedUnselected:BitmapData;
public function TriggerButtonSkin(_arg1:BitmapData, _arg2:BitmapData, _arg3:BitmapData, _arg4:BitmapData){
this.unselected = _arg1;
this.selected = _arg2;
this.lockedUnselected = _arg3;
this.lockedSelected = _arg4;
}
}
}//package com.alternativagame.gui.skin.widget.button
Section 318
//ComboBoxSkin (com.alternativagame.gui.skin.widget.comboBox.ComboBoxSkin)
package com.alternativagame.gui.skin.widget.comboBox {
import flash.display.*;
import com.alternativagame.gui.skin.*;
public class ComboBoxSkin implements ISkin {
public var ll:BitmapData;
public var nr:BitmapData;
public var lr:BitmapData;
public var buttonOver:BitmapData;
public var borderThickness:int;
public var buttonPress:BitmapData;
public var nc:BitmapData;
public var lc:BitmapData;
public var buttonNormal:BitmapData;
public var buttonLock:BitmapData;
public var nl:BitmapData;
public function ComboBoxSkin(_arg1:BitmapData, _arg2:BitmapData, _arg3:BitmapData, _arg4:BitmapData, _arg5:BitmapData, _arg6:BitmapData, _arg7:BitmapData, _arg8:BitmapData, _arg9:BitmapData, _arg10:BitmapData, _arg11:int){
this.nl = _arg1;
this.nc = _arg2;
this.nr = _arg3;
this.ll = _arg4;
this.lc = _arg5;
this.lr = _arg6;
this.buttonNormal = _arg7;
this.buttonOver = _arg8;
this.buttonPress = _arg9;
this.buttonLock = _arg10;
this.borderThickness = _arg11;
}
}
}//package com.alternativagame.gui.skin.widget.comboBox
Section 319
//ListItemSkin (com.alternativagame.gui.skin.widget.list.ListItemSkin)
package com.alternativagame.gui.skin.widget.list {
import com.alternativagame.gui.skin.*;
public class ListItemSkin implements ISkin {
public var selectionAlphaOverSelected:Number;
public var selectionAlphaOver:Number;
public var selectionColor:uint;
public var selectionAlphaSelected:Number;
public function ListItemSkin(_arg1:uint, _arg2:Number, _arg3:Number, _arg4:Number){
this.selectionColor = _arg1;
this.selectionAlphaOver = _arg2;
this.selectionAlphaOverSelected = _arg3;
this.selectionAlphaSelected = _arg4;
}
}
}//package com.alternativagame.gui.skin.widget.list
Section 320
//ScrollBarSkin (com.alternativagame.gui.skin.widget.scroll.ScrollBarSkin)
package com.alternativagame.gui.skin.widget.scroll {
import flash.display.*;
import com.alternativagame.gui.skin.*;
public class ScrollBarSkin implements ISkin {
public var bmpRN:BitmapData;
public var bmpLL:BitmapData;
public var bmpLN:BitmapData;
public var bmpLO:BitmapData;
public var bmpLP:BitmapData;
public var bmpDL:BitmapData;
public var bmpDN:BitmapData;
public var bmpDP:BitmapData;
public var bmpDO:BitmapData;
public var repeatInterval:int;
public var bmpRP:BitmapData;
public var bmpUL:BitmapData;
public var bmpB:BitmapData;
public var bmpC:BitmapData;
public var bmpUO:BitmapData;
public var bmpRO:BitmapData;
public var clickInterval:int;
public var bmpUP:BitmapData;
public var bmpM:BitmapData;
public var bmpL:BitmapData;
public var bmpT:BitmapData;
public var bmpR:BitmapData;
public var bmpUN:BitmapData;
public var bmpRL:BitmapData;
public function ScrollBarSkin(_arg1:BitmapData, _arg2:BitmapData, _arg3:BitmapData, _arg4:BitmapData, _arg5:BitmapData, _arg6:BitmapData, _arg7:BitmapData, _arg8:BitmapData, _arg9:BitmapData, _arg10:BitmapData, _arg11:BitmapData, _arg12:BitmapData, _arg13:BitmapData, _arg14:BitmapData, _arg15:BitmapData, _arg16:BitmapData, _arg17:BitmapData, _arg18:BitmapData, _arg19:BitmapData, _arg20:BitmapData, _arg21:BitmapData, _arg22:BitmapData, _arg23:int, _arg24:int){
this.bmpT = _arg1;
this.bmpM = _arg2;
this.bmpB = _arg3;
this.bmpUN = _arg4;
this.bmpUO = _arg5;
this.bmpUP = _arg6;
this.bmpUL = _arg7;
this.bmpDN = _arg8;
this.bmpDO = _arg9;
this.bmpDP = _arg10;
this.bmpDL = _arg11;
this.bmpL = _arg12;
this.bmpC = _arg13;
this.bmpR = _arg14;
this.bmpLN = _arg15;
this.bmpLO = _arg16;
this.bmpLP = _arg17;
this.bmpLL = _arg18;
this.bmpRN = _arg19;
this.bmpRO = _arg20;
this.bmpRP = _arg21;
this.bmpRL = _arg22;
this.repeatInterval = _arg24;
this.clickInterval = _arg23;
}
}
}//package com.alternativagame.gui.skin.widget.scroll
Section 321
//ScrollBoxSkin (com.alternativagame.gui.skin.widget.scroll.ScrollBoxSkin)
package com.alternativagame.gui.skin.widget.scroll {
import flash.display.*;
import com.alternativagame.gui.skin.*;
public class ScrollBoxSkin implements ISkin {
public var lmc:BitmapData;
public var nmc:BitmapData;
public var lml:BitmapData;
public var nml:BitmapData;
public var lmr:BitmapData;
public var nmr:BitmapData;
public var otc:BitmapData;
public var otl:BitmapData;
public var otr:BitmapData;
public var nbc:BitmapData;
public var lbc:BitmapData;
public var borderThickness:int;
public var nbl:BitmapData;
public var lbl:BitmapData;
public var nbr:BitmapData;
public var lbr:BitmapData;
public var omc:BitmapData;
public var oml:BitmapData;
public var omr:BitmapData;
public var ltc:BitmapData;
public var corner:BitmapData;
public var ntc:BitmapData;
public var ltl:BitmapData;
public var ntl:BitmapData;
public var ltr:BitmapData;
public var ntr:BitmapData;
public var obc:BitmapData;
public var obl:BitmapData;
public var obr:BitmapData;
public function ScrollBoxSkin(_arg1:BitmapData, _arg2:BitmapData, _arg3:BitmapData, _arg4:BitmapData, _arg5:BitmapData, _arg6:BitmapData, _arg7:BitmapData, _arg8:BitmapData, _arg9:BitmapData, _arg10:BitmapData, _arg11:BitmapData, _arg12:BitmapData, _arg13:BitmapData, _arg14:BitmapData, _arg15:BitmapData, _arg16:BitmapData, _arg17:BitmapData, _arg18:BitmapData, _arg19:BitmapData, _arg20:BitmapData, _arg21:BitmapData, _arg22:BitmapData, _arg23:BitmapData, _arg24:BitmapData, _arg25:BitmapData, _arg26:BitmapData, _arg27:BitmapData, _arg28:BitmapData, _arg29:int){
this.ntl = _arg1;
this.ntc = _arg2;
this.ntr = _arg3;
this.nml = _arg4;
this.nmc = _arg5;
this.nmr = _arg6;
this.nbl = _arg7;
this.nbc = _arg8;
this.nbr = _arg9;
this.otl = _arg10;
this.otc = _arg11;
this.otr = _arg12;
this.oml = _arg13;
this.omc = _arg14;
this.omr = _arg15;
this.obl = _arg16;
this.obc = _arg17;
this.obr = _arg18;
this.ltl = _arg19;
this.ltc = _arg20;
this.ltr = _arg21;
this.lml = _arg22;
this.lmc = _arg23;
this.lmr = _arg24;
this.lbl = _arg25;
this.lbc = _arg26;
this.lbr = _arg27;
this.corner = _arg28;
this.borderThickness = _arg29;
}
}
}//package com.alternativagame.gui.skin.widget.scroll
Section 322
//ScrollerSkin (com.alternativagame.gui.skin.widget.scroll.ScrollerSkin)
package com.alternativagame.gui.skin.widget.scroll {
import flash.display.*;
import com.alternativagame.gui.skin.*;
public class ScrollerSkin implements ISkin {
public var pr:BitmapData;
public var pt:BitmapData;
public var nt:BitmapData;
public var nr:BitmapData;
public var ob:BitmapData;
public var oc:BitmapData;
public var minLength:int;
public var ol:BitmapData;
public var om:BitmapData;
public var or:BitmapData;
public var ot:BitmapData;
public var pl:BitmapData;
public var pb:BitmapData;
public var pc:BitmapData;
public var nb:BitmapData;
public var nc:BitmapData;
public var pm:BitmapData;
public var nl:BitmapData;
public var nm:BitmapData;
public function ScrollerSkin(_arg1:BitmapData, _arg2:BitmapData, _arg3:BitmapData, _arg4:BitmapData, _arg5:BitmapData, _arg6:BitmapData, _arg7:BitmapData, _arg8:BitmapData, _arg9:BitmapData, _arg10:BitmapData, _arg11:BitmapData, _arg12:BitmapData, _arg13:BitmapData, _arg14:BitmapData, _arg15:BitmapData, _arg16:BitmapData, _arg17:BitmapData, _arg18:BitmapData, _arg19:int){
this.nt = _arg1;
this.nm = _arg2;
this.nb = _arg3;
this.ot = _arg4;
this.om = _arg5;
this.ob = _arg6;
this.pt = _arg7;
this.pm = _arg8;
this.pb = _arg9;
this.nl = _arg10;
this.nc = _arg11;
this.nr = _arg12;
this.ol = _arg13;
this.oc = _arg14;
this.or = _arg15;
this.pl = _arg16;
this.pc = _arg17;
this.pr = _arg18;
this.minLength = _arg19;
}
}
}//package com.alternativagame.gui.skin.widget.scroll
Section 323
//TreeGraphicsSkin (com.alternativagame.gui.skin.widget.tree.TreeGraphicsSkin)
package com.alternativagame.gui.skin.widget.tree {
import flash.display.*;
import com.alternativagame.gui.skin.*;
public class TreeGraphicsSkin implements ISkin {
public var bitmapConnectTri:BitmapData;
public var bitmapConnectBottom:BitmapData;
public var bitmapConnectTop:BitmapData;
public var bitmapConnectLine:BitmapData;
public function TreeGraphicsSkin(_arg1:BitmapData, _arg2:BitmapData, _arg3:BitmapData, _arg4:BitmapData){
this.bitmapConnectLine = _arg1;
this.bitmapConnectTri = _arg2;
this.bitmapConnectTop = _arg3;
this.bitmapConnectBottom = _arg4;
}
}
}//package com.alternativagame.gui.skin.widget.tree
Section 324
//TreeItemSkin (com.alternativagame.gui.skin.widget.tree.TreeItemSkin)
package com.alternativagame.gui.skin.widget.tree {
import flash.display.*;
import com.alternativagame.gui.skin.*;
public class TreeItemSkin implements ISkin {
public var bitmapSubOpened:BitmapData;
public var bitmapSubClosed:BitmapData;
public function TreeItemSkin(_arg1:BitmapData, _arg2:BitmapData){
this.bitmapSubClosed = _arg2;
this.bitmapSubOpened = _arg1;
}
}
}//package com.alternativagame.gui.skin.widget.tree
Section 325
//ImageSkin (com.alternativagame.gui.skin.widget.ImageSkin)
package com.alternativagame.gui.skin.widget {
import flash.geom.*;
import com.alternativagame.gui.skin.*;
public class ImageSkin implements ISkin {
public var colorNormal:ColorTransform;
public var colorLocked:ColorTransform;
public function ImageSkin(_arg1:ColorTransform, _arg2:ColorTransform){
this.colorNormal = _arg1;
this.colorLocked = _arg2;
}
}
}//package com.alternativagame.gui.skin.widget
Section 326
//InputSkin (com.alternativagame.gui.skin.widget.InputSkin)
package com.alternativagame.gui.skin.widget {
import flash.display.*;
import flash.text.*;
public class InputSkin extends TextSkin {
public var bmpNL:BitmapData;
public var bmpLL:BitmapData;
public var bmpNR:BitmapData;
public var bmpLR:BitmapData;
public var leftMargin:int;
public var bmpOC:BitmapData;
public var bmpOL:BitmapData;
public var topMargin:int;
public var bmpOR:BitmapData;
public var rightMargin:int;
public var bmpNC:BitmapData;
public var bmpLC:BitmapData;
public function InputSkin(_arg1:BitmapData, _arg2:BitmapData, _arg3:BitmapData, _arg4:BitmapData, _arg5:BitmapData, _arg6:BitmapData, _arg7:BitmapData, _arg8:BitmapData, _arg9:BitmapData, _arg10:int, _arg11:int, _arg12:int, _arg13:Number, _arg14:Number, _arg15:TextFormat, _arg16:TextFormat){
super(_arg15, _arg16, _arg13, _arg14);
this.bmpNL = _arg1;
this.bmpNC = _arg2;
this.bmpNR = _arg3;
this.bmpOL = _arg4;
this.bmpOC = _arg5;
this.bmpOR = _arg6;
this.bmpLL = _arg7;
this.bmpLC = _arg8;
this.bmpLR = _arg9;
this.topMargin = _arg10;
this.leftMargin = _arg11;
this.rightMargin = _arg12;
}
}
}//package com.alternativagame.gui.skin.widget
Section 327
//LabelSkin (com.alternativagame.gui.skin.widget.LabelSkin)
package com.alternativagame.gui.skin.widget {
import com.alternativagame.gui.skin.*;
import flash.text.*;
public class LabelSkin implements ISkin {
public var sharpness:Number;
public var thickness:Number;
public var tfNormal:TextFormat;
public var tfLocked:TextFormat;
public function LabelSkin(_arg1:TextFormat, _arg2:TextFormat, _arg3:Number, _arg4:Number){
this.tfNormal = _arg1;
this.tfLocked = _arg2;
this.thickness = _arg3;
this.sharpness = _arg4;
}
}
}//package com.alternativagame.gui.skin.widget
Section 328
//LineSkin (com.alternativagame.gui.skin.widget.LineSkin)
package com.alternativagame.gui.skin.widget {
import flash.display.*;
import com.alternativagame.gui.skin.*;
public class LineSkin implements ISkin {
public var bmpHC:BitmapData;
public var bmpVT:BitmapData;
public var bmpHL:BitmapData;
public var bmpHR:BitmapData;
public var bmpVB:BitmapData;
public var bmpVM:BitmapData;
public function LineSkin(_arg1:BitmapData, _arg2:BitmapData, _arg3:BitmapData, _arg4:BitmapData, _arg5:BitmapData, _arg6:BitmapData){
this.bmpVT = _arg1;
this.bmpVM = _arg2;
this.bmpVB = _arg3;
this.bmpHL = _arg4;
this.bmpHC = _arg5;
this.bmpHR = _arg6;
}
}
}//package com.alternativagame.gui.skin.widget
Section 329
//NumberInputSkin (com.alternativagame.gui.skin.widget.NumberInputSkin)
package com.alternativagame.gui.skin.widget {
import flash.display.*;
import com.alternativagame.gui.skin.*;
public class NumberInputSkin implements ISkin {
public var incButtonLock:BitmapData;
public var incButtonOver:BitmapData;
public var decButtonOver:BitmapData;
public var incButtonPress:BitmapData;
public var incButtonNormal:BitmapData;
public var decButtonNormal:BitmapData;
public var decButtonPress:BitmapData;
public var decButtonLock:BitmapData;
public function NumberInputSkin(_arg1:BitmapData, _arg2:BitmapData, _arg3:BitmapData, _arg4:BitmapData, _arg5:BitmapData, _arg6:BitmapData, _arg7:BitmapData, _arg8:BitmapData){
this.incButtonNormal = _arg1;
this.incButtonOver = _arg2;
this.incButtonPress = _arg3;
this.incButtonLock = _arg4;
this.decButtonNormal = _arg5;
this.decButtonOver = _arg6;
this.decButtonPress = _arg7;
this.decButtonLock = _arg8;
}
}
}//package com.alternativagame.gui.skin.widget
Section 330
//TextSkin (com.alternativagame.gui.skin.widget.TextSkin)
package com.alternativagame.gui.skin.widget {
import flash.text.*;
public class TextSkin extends LabelSkin {
public function TextSkin(_arg1:TextFormat, _arg2:TextFormat, _arg3:Number, _arg4:Number){
super(_arg1, _arg2, _arg3, _arg4);
}
}
}//package com.alternativagame.gui.skin.widget
Section 331
//PanelTitleSkin (com.alternativagame.gui.skin.window.panel.PanelTitleSkin)
package com.alternativagame.gui.skin.window.panel {
import flash.display.*;
import flash.text.*;
import com.alternativagame.gui.skin.window.*;
public class PanelTitleSkin extends WindowTitleSkin {
public var iconMaximize:BitmapData;
public var iconMinimize:BitmapData;
public function PanelTitleSkin(_arg1:BitmapData, _arg2:BitmapData, _arg3:BitmapData, _arg4:BitmapData, _arg5:BitmapData, _arg6:BitmapData, _arg7:BitmapData, _arg8:BitmapData, _arg9:BitmapData, _arg10:BitmapData, _arg11:BitmapData, _arg12:BitmapData, _arg13:BitmapData, _arg14:BitmapData, _arg15:BitmapData, _arg16:BitmapData, _arg17:BitmapData, _arg18:BitmapData, _arg19:BitmapData, _arg20:BitmapData, _arg21:BitmapData, _arg22:BitmapData, _arg23:BitmapData, _arg24:BitmapData, _arg25:BitmapData, _arg26:BitmapData, _arg27:BitmapData, _arg28:BitmapData, _arg29:TextFormat, _arg30:TextFormat, _arg31:TextFormat, _arg32:TextFormat, _arg33:TextFormat, _arg34:TextFormat, _arg35:Number, _arg36:Number, _arg37:int, _arg38:int, _arg39:int, _arg40:int, _arg41:int){
super(_arg1, _arg2, _arg3, _arg1, _arg2, _arg3, _arg1, _arg2, _arg3, _arg1, _arg2, _arg3, _arg1, _arg2, _arg3, _arg1, _arg2, _arg3, _arg19, _arg20, _arg21, _arg22, _arg23, _arg24, _arg25, _arg26, _arg29, _arg30, _arg31, _arg32, _arg33, _arg34, _arg35, _arg36, _arg37, _arg38, _arg39, _arg40, _arg41);
this.iconMinimize = _arg27;
this.iconMaximize = _arg28;
}
}
}//package com.alternativagame.gui.skin.window.panel
Section 332
//WindowSkin (com.alternativagame.gui.skin.window.WindowSkin)
package com.alternativagame.gui.skin.window {
import flash.display.*;
import com.alternativagame.gui.skin.*;
public class WindowSkin implements ISkin {
public var cornerTRmargin:BitmapData;
public var cornerTL:BitmapData;
public var titleSpace:int;
public var containerMargin:int;
public var cornerTR:BitmapData;
public var controlButtonMarginTop:int;
public var bgMC:BitmapData;
public var edgeML:BitmapData;
public var controlButtonMarginRight:int;
public var edgeMR:BitmapData;
public var controlButtonMarginLeft:int;
public var closeAN:BitmapData;
public var closeAP:BitmapData;
public var borderThickness:int;
public var titleMargin:int;
public var closeNP:BitmapData;
public var closeNN:BitmapData;
public var edgeBC:BitmapData;
public var minimizeAN:BitmapData;
public var minimizeAP:BitmapData;
public var cornerTLactive:BitmapData;
public var controlButtonSpace:int;
public var cornerTRactive:BitmapData;
public var minimizeNN:BitmapData;
public var cornerBL:BitmapData;
public var minimizeNP:BitmapData;
public var cornerBR:BitmapData;
public var edgeTC:BitmapData;
public var edgeTCactive:BitmapData;
public var cornerTLmargin:BitmapData;
public function WindowSkin(_arg1:BitmapData, _arg2:BitmapData, _arg3:BitmapData, _arg4:BitmapData, _arg5:BitmapData, _arg6:BitmapData, _arg7:BitmapData, _arg8:BitmapData, _arg9:BitmapData, _arg10:BitmapData, _arg11:BitmapData, _arg12:BitmapData, _arg13:BitmapData, _arg14:BitmapData, _arg15:BitmapData, _arg16:BitmapData, _arg17:BitmapData, _arg18:BitmapData, _arg19:BitmapData, _arg20:BitmapData, _arg21:BitmapData, _arg22:BitmapData, _arg23:int, _arg24:int, _arg25:int, _arg26:int, _arg27:int, _arg28:int, _arg29:int, _arg30:int){
this.cornerTL = _arg1;
this.cornerTR = _arg4;
this.cornerBL = _arg7;
this.cornerBR = _arg8;
this.edgeTC = _arg9;
this.edgeML = _arg11;
this.edgeMR = _arg12;
this.edgeBC = _arg13;
this.bgMC = _arg14;
this.cornerTLmargin = _arg3;
this.cornerTRmargin = _arg6;
this.cornerTLactive = _arg2;
this.cornerTRactive = _arg5;
this.edgeTCactive = _arg10;
this.closeNN = _arg15;
this.closeNP = _arg16;
this.closeAN = _arg17;
this.closeAP = _arg18;
this.minimizeNN = _arg19;
this.minimizeNP = _arg20;
this.minimizeAN = _arg21;
this.minimizeAP = _arg22;
this.containerMargin = _arg23;
this.titleMargin = _arg24;
this.titleSpace = _arg25;
this.controlButtonMarginLeft = _arg26;
this.controlButtonMarginTop = _arg27;
this.controlButtonMarginRight = _arg28;
this.controlButtonSpace = _arg29;
this.borderThickness = _arg30;
}
}
}//package com.alternativagame.gui.skin.window
Section 333
//WindowTitleSkin (com.alternativagame.gui.skin.window.WindowTitleSkin)
package com.alternativagame.gui.skin.window {
import flash.display.*;
import com.alternativagame.gui.skin.*;
import flash.text.*;
public class WindowTitleSkin implements ISkin {
public var activePL:BitmapData;
public var normalOL:BitmapData;
public var space:int;
public var normalOR:BitmapData;
public var marginRight:int;
public var activePR:BitmapData;
public var normalPC:BitmapData;
public var normalPL:BitmapData;
public var closeAN:BitmapData;
public var closeAP:BitmapData;
public var borderThickness:int;
public var normalPR:BitmapData;
public var textFormatAN:TextFormat;
public var textFormatAO:TextFormat;
public var textFormatAP:TextFormat;
public var closeNN:BitmapData;
public var closeNP:BitmapData;
public var activeNC:BitmapData;
public var activeNL:BitmapData;
public var textFormatNO:TextFormat;
public var titleSharpness:Number;
public var minimizeAN:BitmapData;
public var activeNR:BitmapData;
public var textFormatNN:TextFormat;
public var minimizeAP:BitmapData;
public var textFormatNP:TextFormat;
public var controlButtonSpace:int;
public var activeOC:BitmapData;
public var normalNC:BitmapData;
public var minimizeNN:BitmapData;
public var minimizeNP:BitmapData;
public var activeOL:BitmapData;
public var normalNL:BitmapData;
public var activeOR:BitmapData;
public var normalNR:BitmapData;
public var marginLeft:int;
public var activePC:BitmapData;
public var normalOC:BitmapData;
public var titleThickness:Number;
public function WindowTitleSkin(_arg1:BitmapData, _arg2:BitmapData, _arg3:BitmapData, _arg4:BitmapData, _arg5:BitmapData, _arg6:BitmapData, _arg7:BitmapData, _arg8:BitmapData, _arg9:BitmapData, _arg10:BitmapData, _arg11:BitmapData, _arg12:BitmapData, _arg13:BitmapData, _arg14:BitmapData, _arg15:BitmapData, _arg16:BitmapData, _arg17:BitmapData, _arg18:BitmapData, _arg19:BitmapData, _arg20:BitmapData, _arg21:BitmapData, _arg22:BitmapData, _arg23:BitmapData, _arg24:BitmapData, _arg25:BitmapData, _arg26:BitmapData, _arg27:TextFormat, _arg28:TextFormat, _arg29:TextFormat, _arg30:TextFormat, _arg31:TextFormat, _arg32:TextFormat, _arg33:Number, _arg34:Number, _arg35:int, _arg36:int, _arg37:int, _arg38:int, _arg39:int){
this.normalNL = _arg1;
this.normalNC = _arg2;
this.normalNR = _arg3;
this.normalOL = _arg4;
this.normalOC = _arg5;
this.normalOR = _arg6;
this.normalPL = _arg7;
this.normalPC = _arg8;
this.normalPR = _arg9;
this.activeNL = _arg10;
this.activeNC = _arg11;
this.activeNR = _arg12;
this.activeOL = _arg13;
this.activeOC = _arg14;
this.activeOR = _arg15;
this.activePL = _arg16;
this.activePC = _arg17;
this.activePR = _arg18;
this.closeNN = _arg19;
this.closeNP = _arg20;
this.closeAN = _arg21;
this.closeAP = _arg22;
this.minimizeNN = _arg23;
this.minimizeNP = _arg24;
this.minimizeAN = _arg25;
this.minimizeAP = _arg26;
this.textFormatNN = _arg27;
this.textFormatNO = _arg28;
this.textFormatNP = _arg29;
this.textFormatAN = _arg30;
this.textFormatAO = _arg31;
this.textFormatAP = _arg32;
this.titleSharpness = _arg33;
this.titleThickness = _arg34;
this.marginLeft = _arg35;
this.marginRight = _arg36;
this.space = _arg37;
this.controlButtonSpace = _arg38;
this.borderThickness = _arg39;
}
}
}//package com.alternativagame.gui.skin.window
Section 334
//ISkin (com.alternativagame.gui.skin.ISkin)
package com.alternativagame.gui.skin {
public interface ISkin {
}
}//package com.alternativagame.gui.skin
Section 335
//SkinManager (com.alternativagame.gui.skin.SkinManager)
package com.alternativagame.gui.skin {
import flash.utils.*;
public class SkinManager {
private var skinList:Dictionary;
public function SkinManager(){
skinList = new Dictionary();
}
public function getSkin(_arg1:Class):ISkin{
return (skinList[_arg1]);
}
public function addSkin(_arg1:ISkin, _arg2:Class):void{
skinList[_arg2] = _arg1;
}
}
}//package com.alternativagame.gui.skin
Section 336
//BaseButton (com.alternativagame.gui.widget.button.BaseButton)
package com.alternativagame.gui.widget.button {
import flash.events.*;
import com.alternativagame.gui.base.*;
import flash.ui.*;
public class BaseButton extends Widget implements IButton {
protected var _group:ButtonGroup;
protected var _pressed:Boolean;
protected var _locked:Boolean;
protected var _over:Boolean;
public function BaseButton(){
_locked = false;
_pressed = false;
_over = false;
}
private function onKeyDown(_arg1:KeyboardEvent):void{
switch (_arg1.keyCode){
case Keyboard.ENTER:
dispatchEvent(new MouseEvent(MouseEvent.CLICK));
case Keyboard.SPACE:
dispatchEvent(new MouseEvent(MouseEvent.MOUSE_DOWN));
addEventListener(KeyboardEvent.KEY_UP, onKeyUp);
};
}
public function set pressed(_arg1:Boolean):void{
_pressed = _arg1;
if (isSkined){
switchState();
draw(currentSize);
};
}
override protected function onFocusIn(_arg1:FocusEvent):void{
addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
}
public function get locked():Boolean{
return (_locked);
}
override public function setPressState():void{
super.setPressState();
switchState();
draw(currentSize);
if (group != null){
group.pressButton(this);
};
}
public function get over():Boolean{
return (_over);
}
override protected function onFocusOut(_arg1:FocusEvent):void{
removeEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
}
public function get pressed():Boolean{
return (_pressed);
}
override public function updateSkin():void{
super.updateSkin();
switchState();
}
override public function setNormalState():void{
super.setNormalState();
switchState();
draw(currentSize);
}
override public function setOverState():void{
super.setOverState();
switchState();
draw(currentSize);
}
public function set locked(_arg1:Boolean):void{
_locked = _arg1;
tabEnabled = !(_arg1);
mouseEnabled = !(_arg1);
_over = false;
if (_arg1){
if (((!((stage == null))) && ((stage.focus == this)))){
stage.focus = null;
};
};
if (!isSkined){
return;
};
switchState();
}
private function onKeyUp(_arg1:KeyboardEvent):void{
switch (_arg1.keyCode){
case Keyboard.SPACE:
dispatchEvent(new MouseEvent(MouseEvent.CLICK));
case Keyboard.ENTER:
dispatchEvent(new MouseEvent(MouseEvent.MOUSE_UP));
removeEventListener(KeyboardEvent.KEY_UP, onKeyUp);
};
}
protected function switchState():void{
}
public function set group(_arg1:ButtonGroup):void{
_group = _arg1;
}
public function get group():ButtonGroup{
return (_group);
}
}
}//package com.alternativagame.gui.widget.button
Section 337
//BitmapSlider (com.alternativagame.gui.widget.button.BitmapSlider)
package com.alternativagame.gui.widget.button {
import flash.geom.*;
import flash.events.*;
import flash.display.*;
import com.alternativagame.gui.base.*;
import com.alternativagame.utility.*;
import com.alternativagame.gui.layout.enums.*;
public class BitmapSlider extends Widget implements IButton {
protected var ticks:Shape;
protected var offset:int;
protected var divisionWidth:Number;
protected var _trackBitmap:BitmapData;
protected var runner:SliderRunnerButton;
protected var segmentAligned:Boolean;
private var runnerAlign:uint;
private var _posNum:int;
private var _currentPos:int;
private var dragPoint:Point;
protected var _tickMargin:int;
protected var track:Sprite;
protected var _tickBitmap:BitmapData;
protected var _runnerBitmap:BitmapData;
protected var _borderThickness:int;
protected var runnerWidth:int;
public function BitmapSlider(_arg1:BitmapData, _arg2:BitmapData, _arg3:int, _arg4:int, _arg5:int, _arg6:Boolean, _arg7:BitmapData=null, _arg8:int=1){
_trackBitmap = _arg1;
_runnerBitmap = _arg2;
_posNum = _arg3;
_borderThickness = _arg5;
this.segmentAligned = _arg6;
this.runnerAlign = Align.CENTER;
_tickBitmap = _arg7;
_tickMargin = _arg8;
stretchableH = false;
stretchableV = false;
createTrack();
ticks = new Shape();
addChild(ticks);
runner = new SliderRunnerButton(0, 1, _arg2);
addChild(runner);
if (((!((_arg1 == null))) && (!((_arg2 == null))))){
arrangeGraphics();
this.currentPos = _arg4;
} else {
_currentPos = _arg4;
};
runner.addEventListener(MouseEvent.MOUSE_DOWN, onSliderStartDrag);
track.addEventListener(MouseEvent.CLICK, onLocationClick);
}
protected function addTickHitArea():void{
track.graphics.clear();
track.graphics.beginFill(0xFF0000, 0);
track.graphics.drawRect(0, _trackBitmap.height, _trackBitmap.width, (_tickBitmap.height + _tickMargin));
}
public function get posNum():int{
return (_posNum);
}
public function get currentPos():int{
return (_currentPos);
}
protected function drawTicks():void{
var _local2:Matrix;
var _local3:int;
ticks.graphics.clear();
var _local1:int;
while (_local1 < posNum) {
_local2 = new Matrix();
if (segmentAligned){
_local3 = (Math.floor(((divisionWidth - _tickBitmap.width) * 0.5)) + Math.floor((_local1 * divisionWidth)));
} else {
_local3 = (offset + Math.floor((_local1 * divisionWidth)));
};
Matrix(_local2).createBox(1, 1, 0, _local3, 0);
ticks.graphics.beginBitmapFill(_tickBitmap, _local2, false, false);
ticks.graphics.drawRect(_local3, 0, _tickBitmap.width, _tickBitmap.height);
ticks.graphics.endFill();
_local1++;
};
addTickHitArea();
}
private function onSliderStopDrag(_arg1:MouseEvent):void{
stage.removeEventListener(MouseEvent.MOUSE_MOVE, onSliderDrag);
stage.removeEventListener(MouseEvent.MOUSE_UP, onSliderStopDrag);
runner.addEventListener(MouseEvent.MOUSE_DOWN, onSliderStartDrag);
runner.dragON = false;
}
protected function createTrack():void{
var _local1:Bitmap;
track = new Sprite();
track.tabEnabled = false;
addChild(track);
if (_trackBitmap != null){
_local1 = new Bitmap(_trackBitmap);
track.addChild(_local1);
};
}
public function set trackBitmap(_arg1:BitmapData):void{
_trackBitmap = _arg1;
var _local2:Bitmap = new Bitmap(_trackBitmap);
track.addChild(_local2);
if (_runnerBitmap != null){
arrangeGraphics();
};
}
private function onLocationClick(_arg1:MouseEvent):void{
var _local2:Point = MouseUtility.localCoords(this);
currentPos = (Math.floor(((_local2.x - _borderThickness) / divisionWidth)) + 1);
}
public function set currentPos(_arg1:int):void{
if ((((_arg1 >= 1)) && ((_arg1 <= posNum)))){
if (segmentAligned){
runner.x = (_borderThickness + Math.floor((((_arg1 - 1) * divisionWidth) - Math.round((runnerWidth / 2)))));
if (runnerAlign == Align.CENTER){
runner.x = (runner.x + Math.round((divisionWidth / 2)));
} else {
if (runnerAlign == Align.RIGHT){
runner.x = (runner.x + divisionWidth);
};
};
} else {
runner.x = ((_borderThickness + offset) + Math.floor((((_arg1 - 1) * divisionWidth) + Math.floor(((_tickBitmap.width - runnerWidth) * 0.5)))));
};
if (_currentPos != _arg1){
_currentPos = _arg1;
dispatchEvent(new SliderEvent(_currentPos));
};
};
}
override public function draw(_arg1:Point):void{
}
public function set borderThickness(_arg1:int):void{
if (((((!((_trackBitmap == null))) && (!((_runnerBitmap == null))))) && (!((_arg1 == _borderThickness))))){
_borderThickness = _arg1;
arrangeGraphics();
} else {
_borderThickness = _arg1;
};
}
protected function arrangeGraphics():void{
if (_trackBitmap.height > _runnerBitmap.height){
runner.y = Math.round(((_trackBitmap.height - _runnerBitmap.height) / 2));
} else {
track.y = Math.round(((_runnerBitmap.height - _trackBitmap.height) / 2));
};
runnerWidth = _runnerBitmap.width;
if (segmentAligned){
offset = 0;
divisionWidth = ((_trackBitmap.width - (_borderThickness * 2)) / posNum);
} else {
offset = ((runnerWidth)>_tickBitmap.width) ? Math.floor(((runnerWidth - _tickBitmap.width) * 0.5)) : 0;
divisionWidth = ((((_trackBitmap.width - (offset * 2)) - (_borderThickness * 2)) - _tickBitmap.width) / (posNum - 1));
};
if (_tickBitmap != null){
drawTicks();
ticks.x = _borderThickness;
ticks.y = ((track.y + _trackBitmap.height) + _tickMargin);
if (_trackBitmap.height > _runnerBitmap.height){
minSize.y = ((_trackBitmap.height + _tickMargin) + _tickBitmap.height);
} else {
minSize.y = (((track.y + _trackBitmap.height) + _tickMargin) + _tickBitmap.height);
};
} else {
minSize.y = Math.max(_runnerBitmap.height, _trackBitmap.height);
};
minSize.x = _trackBitmap.width;
_currentSize = minSize.clone();
}
public function set tickBitmap(_arg1:BitmapData):void{
_tickBitmap = _arg1;
drawTicks();
}
override public function computeSize(_arg1:Point):Point{
return (minSize);
}
private function onSliderDrag(_arg1:MouseEvent):void{
var _local4:int;
var _local2:Point = MouseUtility.localCoords(this);
var _local3:int = Math.round(((_local2.x - dragPoint.x) + (runnerWidth / 2)));
if (_local3 >= _borderThickness){
if (_local3 < (track.width - _borderThickness)){
if (segmentAligned){
_local4 = (Math.floor(((_local3 - _borderThickness) / divisionWidth)) + 1);
} else {
_local4 = (Math.floor(((((_local3 - _borderThickness) - offset) + (divisionWidth / 2)) / divisionWidth)) + 1);
};
if (_local4 != currentPos){
currentPos = _local4;
};
} else {
currentPos = _posNum;
};
} else {
currentPos = 1;
};
}
private function onSliderStartDrag(_arg1:MouseEvent):void{
runner.removeEventListener(MouseEvent.MOUSE_DOWN, onSliderStartDrag);
dragPoint = MouseUtility.localCoords(runner);
stage.addEventListener(MouseEvent.MOUSE_MOVE, onSliderDrag);
stage.addEventListener(MouseEvent.MOUSE_UP, onSliderStopDrag);
runner.dragON = true;
}
public function set runnerBitmap(_arg1:BitmapData):void{
_runnerBitmap = _arg1;
runner.normalBitmap = _arg1;
if (_trackBitmap != null){
arrangeGraphics();
};
}
}
}//package com.alternativagame.gui.widget.button
Section 338
//Button (com.alternativagame.gui.widget.button.Button)
package com.alternativagame.gui.widget.button {
import flash.geom.*;
import flash.display.*;
import flash.text.*;
import com.alternativagame.gui.skin.widget.button.*;
import com.alternativagame.gui.layout.enums.*;
public class Button extends BaseButton {
private var tf:TextField;
private var _align:uint;
private var left:Bitmap;
private var yShift:int;// = 0
private var _text:String;
private var center:Bitmap;
private var right:Bitmap;
private var gfx:Bitmap;
private var skin:ButtonSkin;
public function Button(_arg1:String=null, _arg2:BitmapData=null, _arg3:uint=1){
var text = _arg1;
var image = _arg2;
var align = _arg3;
super();
left = new Bitmap();
center = new Bitmap();
right = new Bitmap();
gfx = new Bitmap();
tf = new TextField();
var _local5 = tf;
with (_local5) {
autoSize = TextFieldAutoSize.LEFT;
antiAliasType = AntiAliasType.ADVANCED;
embedFonts = true;
selectable = false;
mouseEnabled = false;
cacheAsBitmap = true;
};
addChild(left);
addChild(center);
addChild(right);
addChild(gfx);
addChild(tf);
setText(text);
setAlign(align);
setImage(image);
}
private function setAlign(_arg1:int):void{
_align = _arg1;
}
override public function draw(_arg1:Point):void{
super.draw(_arg1);
drawButton();
drawTextAndImage();
}
public function set image(_arg1:BitmapData):void{
setImage(image);
if (skin == null){
return;
};
calcMinWidth();
drawTextAndImage();
}
public function get image():BitmapData{
return (gfx.bitmapData);
}
public function set align(_arg1:uint):void{
setAlign(_arg1);
if (skin == null){
return;
};
drawTextAndImage();
}
private function calcMinWidth():void{
var _local1:int = (skin.margin * 2);
if (((!((_text == null))) && (!((_text == ""))))){
_local1 = (_local1 + Math.round((tf.width - 3)));
};
if (image != null){
_local1 = (_local1 + (Math.round(gfx.width) + (((!((_text == null))) && (!((_text == ""))))) ? skin.space : 0));
};
minSize.x = _local1;
}
private function state(_arg1:BitmapData, _arg2:BitmapData, _arg3:BitmapData, _arg4:int, _arg5:TextFormat, _arg6:ColorTransform):void{
left.bitmapData = _arg1;
center.bitmapData = _arg2;
right.bitmapData = _arg3;
yShift = _arg4;
tf.setTextFormat(_arg5);
tf.defaultTextFormat = _arg5;
gfx.transform.colorTransform = _arg6;
}
public function get align():uint{
return (_align);
}
private function drawButton():void{
center.x = left.width;
center.width = ((currentSize.x - left.width) - right.width);
right.x = (currentSize.x - right.width);
}
override public function setPressState():void{
_locked = false;
_over = false;
_pressed = true;
super.setPressState();
}
private function setImage(_arg1:BitmapData):void{
gfx.bitmapData = _arg1;
}
public function set text(_arg1:String):void{
setText(_arg1);
if (skin == null){
return;
};
calcMinWidth();
repaintCurrentSize();
}
override public function setOverState():void{
_locked = false;
_over = true;
_pressed = false;
super.setOverState();
}
override public function updateSkin():void{
skin = ButtonSkin(skinManager.getSkin(Button));
minSize.y = skin.nc.height;
tf.thickness = skin.textThickness;
tf.sharpness = skin.textSharpness;
super.updateSkin();
calcMinWidth();
}
override public function setNormalState():void{
_locked = false;
_over = false;
_pressed = false;
super.setNormalState();
}
override public function set stretchableV(_arg1:Boolean):void{
}
private function drawTextAndImage():void{
var _local1:int;
var _local2:int;
_local2 = (((!((image == null))) && (((!((_text == null))) && (!((_text == ""))))))) ? skin.space : 0;
var _local3:int = ((gfx.width + _local2) + (((!((_text == null))) && (!((_text == ""))))) ? (tf.width - 3) : 0);
switch (align){
case Align.LEFT:
_local1 = skin.margin;
break;
case Align.CENTER:
_local1 = Math.round(((currentSize.x - _local3) / 2));
break;
case Align.RIGHT:
_local1 = ((currentSize.x - _local3) - skin.margin);
break;
};
gfx.x = _local1;
tf.x = (((_local1 + gfx.width) + _local2) - 3);
if (image != null){
gfx.y = (Math.round(((minSize.y - image.height) / 2)) + yShift);
};
if (((!((_text == null))) && (!((_text == ""))))){
tf.y = ((Math.round(((minSize.y - (tf.height - 6)) / 2)) - 4) + yShift);
};
}
override protected function switchState():void{
if (locked){
state(skin.ll, skin.lc, skin.lr, 0, skin.tfLocked, skin.colorLocked);
} else {
if (pressed){
state(skin.pl, skin.pc, skin.pr, skin.yPressShift, skin.tfPressed, skin.colorPressed);
} else {
if (over){
state(skin.ol, skin.oc, skin.or, 0, skin.tfOver, skin.colorOver);
} else {
state(skin.nl, skin.nc, skin.nr, 0, skin.tfNormal, skin.colorNormal);
};
};
};
}
public function setText(_arg1:String):void{
_text = _arg1;
if (_arg1 != null){
tf.text = _arg1;
tf.visible = true;
} else {
tf.text = "";
tf.visible = false;
};
}
}
}//package com.alternativagame.gui.widget.button
Section 339
//ButtonGroup (com.alternativagame.gui.widget.button.ButtonGroup)
package com.alternativagame.gui.widget.button {
public class ButtonGroup {
private var pressedButton:BaseButton;
private var buttonsList:Array;
public function ButtonGroup(){
buttonsList = new Array();
}
public function addButton(_arg1:BaseButton):void{
buttonsList.push(_arg1);
if (buttonsList.length == 1){
pressedButton = _arg1;
_arg1.pressed = true;
};
_arg1.group = this;
}
public function pressButton(_arg1:BaseButton):void{
if (_arg1 != pressedButton){
pressedButton.pressed = false;
pressedButton = _arg1;
};
if (!_arg1.pressed){
_arg1.pressed = true;
};
}
}
}//package com.alternativagame.gui.widget.button
Section 340
//ButtonRepeater (com.alternativagame.gui.widget.button.ButtonRepeater)
package com.alternativagame.gui.widget.button {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class ButtonRepeater {
private var repeatInterval:Number;
private var clickId:uint;
private var clickInterval:Number;
private var button:InteractiveObject;
private var repeatId:uint;
private var myClick:Boolean;
public function ButtonRepeater(_arg1:InteractiveObject, _arg2:Number=300, _arg3:Number=80){
this.button = _arg1;
this.clickInterval = _arg2;
this.repeatInterval = _arg3;
_arg1.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
_arg1.addEventListener(MouseEvent.CLICK, onMouseClick);
}
private function onContinueRepeat(_arg1:MouseEvent):void{
repeatId = setInterval(sendClick, repeatInterval);
button.removeEventListener(MouseEvent.MOUSE_OVER, onContinueRepeat);
button.addEventListener(MouseEvent.MOUSE_OUT, onFreezeRepeat);
}
private function onMouseClick(_arg1:MouseEvent):void{
if (!myClick){
_arg1.stopImmediatePropagation();
} else {
myClick = false;
};
}
private function onMouseDown(_arg1:MouseEvent):void{
sendClick();
clickId = setTimeout(onStartRepeat, clickInterval, null);
button.removeEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
button.stage.addEventListener(MouseEvent.MOUSE_UP, onStopWait);
button.addEventListener(MouseEvent.MOUSE_OUT, onFreezeRepeat);
}
public function remove():void{
button.removeEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
button.removeEventListener(MouseEvent.CLICK, onMouseClick);
}
private function sendClick():void{
myClick = true;
button.dispatchEvent(new MouseEvent(MouseEvent.CLICK));
}
private function onFreezeRepeat(_arg1:MouseEvent):void{
clearTimeout(clickId);
button.stage.removeEventListener(MouseEvent.MOUSE_UP, onStopWait);
button.stage.addEventListener(MouseEvent.MOUSE_UP, onStopRepeat);
clearInterval(repeatId);
button.removeEventListener(MouseEvent.MOUSE_OUT, onFreezeRepeat);
button.addEventListener(MouseEvent.MOUSE_OVER, onContinueRepeat);
}
private function onStopRepeat(_arg1:MouseEvent):void{
clearInterval(repeatId);
button.stage.removeEventListener(MouseEvent.MOUSE_UP, onStopRepeat);
button.removeEventListener(MouseEvent.MOUSE_OUT, onFreezeRepeat);
button.removeEventListener(MouseEvent.MOUSE_OVER, onContinueRepeat);
button.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
}
private function onStopWait(_arg1:MouseEvent):void{
clearTimeout(clickId);
button.stage.removeEventListener(MouseEvent.MOUSE_UP, onStopWait);
button.removeEventListener(MouseEvent.MOUSE_OUT, onFreezeRepeat);
button.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
}
private function onStartRepeat(_arg1:MouseEvent):void{
repeatId = setInterval(sendClick, repeatInterval);
button.stage.removeEventListener(MouseEvent.MOUSE_UP, onStopWait);
button.stage.addEventListener(MouseEvent.MOUSE_UP, onStopRepeat);
}
}
}//package com.alternativagame.gui.widget.button
Section 341
//ButtonSwitch (com.alternativagame.gui.widget.button.ButtonSwitch)
package com.alternativagame.gui.widget.button {
import flash.geom.*;
import flash.events.*;
import flash.display.*;
import com.alternativagame.gui.base.*;
import com.alternativagame.gui.cursor.*;
import com.alternativagame.utility.*;
import com.alternativagame.gui.skin.widget.button.*;
import com.alternativagame.gui.layout.enums.*;
public class ButtonSwitch extends Widget implements IButton {
private var switchButton:SwitchButton;
private var cTLbmp:Bitmap;
private var posNum:int;
private var posSpace:int;
private var bgbmp:Bitmap;
private var posIcons:Array;
private var posSpaceRatio:Number;
private var switchArrow:Bitmap;
private var cBRbmp:Bitmap;
private var _currentPos:int;
private var dragPoint:Point;
private var eMLbmp:Bitmap;
private var cTRbmp:Bitmap;
private var posMinSpace:int;
private var buttonSkin:ButtonSkin;
private var posNames:Array;
private var eBCbmp:Bitmap;
private var iconsVSpace:int;
private var eTCbmp:Bitmap;
private var gfx:Sprite;
private var eMRbmp:Bitmap;
private var skin:SwitchSkin;
private var cBLbmp:Bitmap;
public function ButtonSwitch(_arg1:int, _arg2:int, _arg3:int, _arg4:Boolean, _arg5:Array, _arg6:Array=null, _arg7:int=3){
var _local9:int;
super();
cTLbmp = new Bitmap();
cTRbmp = new Bitmap();
cBLbmp = new Bitmap();
cBRbmp = new Bitmap();
eTCbmp = new Bitmap();
eMLbmp = new Bitmap();
eMRbmp = new Bitmap();
eBCbmp = new Bitmap();
bgbmp = new Bitmap();
gfx = new Sprite();
gfx.mouseEnabled = false;
gfx.tabEnabled = false;
addChildAt(gfx, 0);
gfx.addChild(cTLbmp);
gfx.addChild(cTRbmp);
gfx.addChild(cBLbmp);
gfx.addChild(cBRbmp);
gfx.addChild(eTCbmp);
gfx.addChild(eMLbmp);
gfx.addChild(eMRbmp);
gfx.addChild(eBCbmp);
gfx.addChild(bgbmp);
this.posNum = _arg1;
_currentPos = _arg2;
this.posMinSpace = _arg3;
this.posSpace = _arg3;
this.stretchableH = _arg4;
this.stretchableV = false;
this.iconsVSpace = _arg7;
switchButton = new SwitchButton("Сказать", null, Align.CENTER);
addChild(switchButton);
switchArrow = new Bitmap();
addChild(switchArrow);
this.posIcons = new Array();
if (((!((_arg6 == null))) && (!((_arg6.length == 0))))){
_local9 = 0;
while (_local9 < _arg6.length) {
this.posIcons.push(new Bitmap(_arg6[_local9]));
addChild(this.posIcons[_local9]);
_local9++;
};
} else {
switchArrow.visible = false;
};
this.posNames = new Array();
var _local8:int;
while (_local8 < _arg5.length) {
this.posNames.push(_arg5[_local8]);
_local8++;
};
switchButton.addEventListener(MouseEvent.MOUSE_DOWN, onSwitchStartDrag);
}
private function onSwitchStartDrag(_arg1:MouseEvent):void{
switchButton.removeEventListener(MouseEvent.MOUSE_DOWN, onSwitchStartDrag);
dragPoint = MouseUtility.localCoords(switchButton);
stage.addEventListener(MouseEvent.MOUSE_MOVE, onSwitchDrag);
stage.addEventListener(MouseEvent.MOUSE_UP, onSwitchStopDrag);
}
private function calcMinWidth():void{
minSize.x = ((switchButton.minSize.x + (posMinSpace * (posNum - 1))) + (2 * skin.borderThickness));
posSpaceRatio = (posMinSpace / minSize.x);
}
public function get currentPos():int{
return (_currentPos);
}
public function set currentPos(_arg1:int):void{
_currentPos = _arg1;
switchButton.x = (((_arg1 - 1) * posSpace) + skin.borderThickness);
if (posIcons.length > 0){
switchArrow.x = Math.round(((switchButton.x + (switchButton.width / 2)) - (switchArrow.width / 2)));
};
switchButton.setText(posNames[(_arg1 - 1)]);
switchButton.draw(switchButton.currentSize);
}
private function onSwitchDrag(_arg1:MouseEvent):void{
var _local2:Point = MouseUtility.localCoords(this);
var _local3:int = (_local2.x - dragPoint.x);
var _local4:int = (Math.round(((_local3 - skin.borderThickness) / posSpace)) + 1);
if (_local4 > posNum){
_local4 = posNum;
};
if (_local4 < 1){
_local4 = 1;
};
if (_local4 != _currentPos){
currentPos = _local4;
};
}
override public function draw(_arg1:Point):void{
var _local7:int;
var _local8:int;
var _local9:int;
var _local2:int = (_arg1.x - cBRbmp.width);
var _local3:int = (_arg1.y - cBRbmp.height);
cTRbmp.x = _local2;
cBLbmp.y = _local3;
cBRbmp.x = _local2;
cBRbmp.y = _local3;
var _local4:int = ((_arg1.x - cTLbmp.width) - cTRbmp.width);
var _local5:int = ((_arg1.y - cTLbmp.height) - cBLbmp.height);
eTCbmp.x = cTLbmp.width;
eTCbmp.width = _local4;
eMLbmp.y = cTLbmp.height;
eMLbmp.height = _local5;
eMRbmp.x = _local2;
eMRbmp.y = cTRbmp.height;
eMRbmp.height = _local5;
eBCbmp.x = cBLbmp.width;
eBCbmp.y = _local3;
eBCbmp.width = _local4;
bgbmp.x = cTLbmp.width;
bgbmp.y = cTLbmp.height;
bgbmp.width = _local4;
bgbmp.height = _local5;
posSpace = Math.round((posSpaceRatio * _arg1.x));
switchButton.draw(new Point(((_arg1.x - (2 * skin.borderThickness)) - (posSpace * (posNum - 1))), buttonSkin.nc.height));
switchButton.x = (((_currentPos - 1) * posSpace) + skin.borderThickness);
var _local6:int = posIcons.length;
if (_local6 > 0){
_local7 = Bitmap(posIcons[0]).width;
_local8 = Bitmap(posIcons[0]).height;
_local9 = 0;
while (_local9 < _local6) {
posIcons[_local9].x = Math.round((((_arg1.x - _local7) * 0.5) + ((_local9 - ((_local6 - 1) / 2)) * posSpace)));
posIcons[_local9].y = (-(iconsVSpace) - _local8);
_local9++;
};
switchArrow.x = Math.round(((switchButton.x + (switchButton.width / 2)) - (switchArrow.width / 2)));
};
super.draw(_arg1);
}
override public function get cursor():uint{
return (Cursor.NORMAL);
}
override public function updateSkin():void{
skin = SwitchSkin(skinManager.getSkin(_slot1));
buttonSkin = ButtonSkin(skinManager.getSkin(Button));
cTLbmp.bitmapData = skin.cornerTL;
cTRbmp.bitmapData = skin.cornerTR;
cBLbmp.bitmapData = skin.cornerBL;
cBRbmp.bitmapData = skin.cornerBR;
eTCbmp.bitmapData = skin.edgeTC;
eMLbmp.bitmapData = skin.edgeML;
eMRbmp.bitmapData = skin.edgeMR;
eBCbmp.bitmapData = skin.edgeBC;
bgbmp.bitmapData = skin.bgMC;
switchArrow.bitmapData = skin.arrow;
super.updateSkin();
minSize.y = (buttonSkin.nc.height + (2 * skin.borderThickness));
var _local1:int;
var _local2:int;
var _local3:int;
while (_local3 < posNames.length) {
if (_local1 < String(posNames[_local3]).length){
_local1 = String(posNames[_local3]).length;
_local2 = _local3;
};
_local3++;
};
switchButton.text = posNames[_local2];
calcMinWidth();
switchButton.y = skin.borderThickness;
if (posIcons.length > 0){
switchArrow.y = (switchButton.y - Math.round((switchArrow.height * 0.5)));
};
currentPos = _currentPos;
}
private function onSwitchStopDrag(_arg1:MouseEvent):void{
stage.removeEventListener(MouseEvent.MOUSE_MOVE, onSwitchDrag);
stage.removeEventListener(MouseEvent.MOUSE_UP, onSwitchStopDrag);
switchButton.addEventListener(MouseEvent.MOUSE_DOWN, onSwitchStartDrag);
}
}
}//package com.alternativagame.gui.widget.button
Section 342
//CheckBox (com.alternativagame.gui.widget.button.CheckBox)
package com.alternativagame.gui.widget.button {
public class CheckBox extends TriggerButton {
public function CheckBox(_arg1:String=""){
super(_arg1);
}
override protected function getSkinType():Class{
return (_slot1);
}
}
}//package com.alternativagame.gui.widget.button
Section 343
//IButton (com.alternativagame.gui.widget.button.IButton)
package com.alternativagame.gui.widget.button {
import com.alternativagame.gui.base.*;
public interface IButton extends IGUIObject {
}
}//package com.alternativagame.gui.widget.button
Section 344
//ImageButton (com.alternativagame.gui.widget.button.ImageButton)
package com.alternativagame.gui.widget.button {
import flash.geom.*;
import flash.display.*;
import com.alternativagame.gui.skin.widget.button.*;
public class ImageButton extends BaseButton {
private var yNormal:int;
private var _hitArea:Shape;
private var _overBitmap:BitmapData;
private var yPress:int;
private var _pressBitmap:BitmapData;
private var _normalBitmap:BitmapData;
private var _lockBitmap:BitmapData;
private var bitmap:Bitmap;
private var skin:ImageButtonSkin;
public function ImageButton(_arg1:int, _arg2:int, _arg3:BitmapData=null, _arg4:BitmapData=null, _arg5:BitmapData=null, _arg6:BitmapData=null){
this.yNormal = _arg1;
this.yPress = _arg2;
stretchableH = false;
stretchableV = false;
_normalBitmap = _arg3;
_overBitmap = ((_arg4)!=null) ? _arg4 : _arg3;
_pressBitmap = ((_arg5)!=null) ? _arg5 : _arg3;
_lockBitmap = ((_arg6)!=null) ? _arg6 : _arg3;
_hitArea = new Shape();
addChild(_hitArea);
if (_normalBitmap != null){
drawHitArea(new Rectangle(0, 0, _normalBitmap.width, _normalBitmap.height));
minSize.x = _normalBitmap.width;
minSize.y = _normalBitmap.height;
};
bitmap = new Bitmap();
addChild(bitmap);
}
public function set overBitmap(_arg1:BitmapData):void{
_overBitmap = _arg1;
if (isSkined){
switchState();
};
}
override protected function switchState():void{
if (locked){
bitmap.bitmapData = _lockBitmap;
bitmap.transform.colorTransform = skin.colorLock;
bitmap.y = yNormal;
} else {
if (pressed){
bitmap.bitmapData = _pressBitmap;
bitmap.transform.colorTransform = skin.colorPress;
bitmap.y = yPress;
} else {
if (over){
bitmap.bitmapData = _overBitmap;
bitmap.transform.colorTransform = skin.colorOver;
bitmap.y = yNormal;
} else {
bitmap.bitmapData = _normalBitmap;
bitmap.transform.colorTransform = skin.colorNormal;
bitmap.y = yNormal;
};
};
};
}
override public function setPressState():void{
_over = false;
_pressed = true;
super.setPressState();
}
public function get pressBitmap():BitmapData{
return (_pressBitmap);
}
override public function computeSize(_arg1:Point):Point{
var _local2:Point = ((_normalBitmap)!=null) ? new Point(_normalBitmap.width, _normalBitmap.height) : new Point();
return (_local2);
}
override public function setOverState():void{
_over = true;
_pressed = false;
super.setOverState();
}
private function drawHitArea(_arg1:Rectangle):void{
var rect = _arg1;
var _local3 = _hitArea.graphics;
with (_local3) {
clear();
beginFill(0xFF0000, 0);
drawRect(rect.x, rect.y, rect.width, rect.height);
};
}
public function get overBitmap():BitmapData{
return (_overBitmap);
}
public function set pressBitmap(_arg1:BitmapData):void{
_pressBitmap = _arg1;
if (isSkined){
switchState();
};
}
public function get lockBitmap():BitmapData{
return (_lockBitmap);
}
override public function setNormalState():void{
_over = false;
_pressed = false;
super.setNormalState();
}
public function set normalBitmap(_arg1:BitmapData):void{
_normalBitmap = _arg1;
drawHitArea(new Rectangle(0, 0, _normalBitmap.width, _normalBitmap.height));
minSize.x = _normalBitmap.width;
minSize.y = _normalBitmap.height;
if (isSkined){
switchState();
};
}
public function set lockBitmap(_arg1:BitmapData):void{
_lockBitmap = _arg1;
if (isSkined){
switchState();
};
}
override public function updateSkin():void{
skin = ImageButtonSkin(skinManager.getSkin(ImageButton));
super.updateSkin();
}
public function get normalBitmap():BitmapData{
return (_normalBitmap);
}
}
}//package com.alternativagame.gui.widget.button
Section 345
//RadioButton (com.alternativagame.gui.widget.button.RadioButton)
package com.alternativagame.gui.widget.button {
public class RadioButton extends TriggerButton {
public function RadioButton(_arg1:String=""){
super(_arg1);
}
override protected function getSkinType():Class{
return (_slot1);
}
}
}//package com.alternativagame.gui.widget.button
Section 346
//SimpleRectButton (com.alternativagame.gui.widget.button.SimpleRectButton)
package com.alternativagame.gui.widget.button {
import flash.geom.*;
import flash.display.*;
public class SimpleRectButton extends Sprite {
private var _hitArea:Sprite;
private var _enabled:Boolean;
public function SimpleRectButton(_arg1:Rectangle){
_hitArea = new Sprite();
_hitArea.mouseEnabled = false;
_hitArea.graphics.beginFill(0xCC00, 0);
_hitArea.graphics.drawRect(_arg1.x, _arg1.y, _arg1.width, _arg1.height);
_hitArea.graphics.endFill();
addChild(_hitArea);
hitArea = _hitArea;
}
public function get enabled():Boolean{
return (_enabled);
}
public function set enabled(_arg1:Boolean):void{
_enabled = _arg1;
mouseEnabled = _arg1;
}
public function setHitArea(_arg1:Rectangle):void{
_hitArea.graphics.clear();
_hitArea.graphics.beginFill(0xCC0000, 0);
_hitArea.graphics.drawRect(_arg1.x, _arg1.y, _arg1.width, _arg1.height);
_hitArea.graphics.endFill();
}
}
}//package com.alternativagame.gui.widget.button
Section 347
//Slider (com.alternativagame.gui.widget.button.Slider)
package com.alternativagame.gui.widget.button {
import flash.geom.*;
import flash.display.*;
import com.alternativagame.gui.skin.widget.button.*;
import com.alternativagame.gui.layout.enums.*;
public class Slider extends BitmapSlider {
private var trackCenter:Bitmap;
private var divisionMinWidth:int;
private var showTicks:Boolean;
private var trackRight:Bitmap;
private var trackLeft:Bitmap;
private var skin:SliderSkin;
public function Slider(_arg1:int, _arg2:int, _arg3:int, _arg4:Boolean){
super(null, null, _arg1, _arg2, 0, false);
this.divisionMinWidth = _arg3;
this.showTicks = _arg4;
}
override public function updateSkin():void{
skin = SliderSkin(skinManager.getSkin(_slot1));
super.updateSkin();
setTrackParts(skin.trackLeft, skin.trackCenter, skin.trackRight);
_runnerBitmap = skin.runner;
runner.normalBitmap = _runnerBitmap;
runner.overBitmap = _runnerBitmap;
runner.pressBitmap = _runnerBitmap;
runner.lockBitmap = _runnerBitmap;
_tickBitmap = skin.tick;
_borderThickness = skin.borderThickness;
_tickMargin = skin.tickMargin;
arrangeGraphics();
}
override public function draw(_arg1:Point):void{
_currentSize = _arg1.clone();
trackCenter.x = trackLeft.width;
trackRight.x = (_arg1.x - trackRight.width);
trackCenter.width = (trackRight.x - trackCenter.x);
divisionWidth = ((((track.width - (offset * 2)) - (_borderThickness * 2)) - _tickBitmap.width) / (posNum - 1));
if (((!((_tickBitmap == null))) && (showTicks))){
drawTicks();
};
this.currentPos = currentPos;
}
override protected function createTrack():void{
track = new Sprite();
track.tabEnabled = false;
addChild(track);
trackLeft = new Bitmap();
trackCenter = new Bitmap();
trackRight = new Bitmap();
track.addChild(trackLeft);
track.addChild(trackCenter);
track.addChild(trackRight);
}
private function setTrackParts(_arg1:BitmapData, _arg2:BitmapData, _arg3:BitmapData):void{
trackLeft.bitmapData = _arg1;
trackCenter.bitmapData = _arg2;
trackRight.bitmapData = _arg3;
}
override public function computeSize(_arg1:Point):Point{
var _local2:Point = minSize.clone();
if (_arg1 != null){
_local2.x = (isStretchable(Direction.HORIZONTAL)) ? Math.max(_arg1.x, minSize.x) : minSize.x;
_local2.y = minSize.y;
};
return (_local2);
}
override protected function addTickHitArea():void{
track.graphics.clear();
track.graphics.beginFill(0xFF0000, 0);
track.graphics.drawRect(0, skin.trackCenter.height, track.width, (skin.trackCenter.height + _tickMargin));
}
override protected function arrangeGraphics():void{
if (trackCenter.height > _runnerBitmap.height){
runner.y = Math.round(((trackCenter.height - _runnerBitmap.height) / 2));
} else {
track.y = Math.round(((_runnerBitmap.height - trackCenter.height) / 2));
};
runnerWidth = _runnerBitmap.width;
if (segmentAligned){
offset = 0;
minSize.x = ((2 * skin.borderThickness) + (divisionMinWidth * posNum));
} else {
offset = ((runnerWidth)>_tickBitmap.width) ? Math.floor(((runnerWidth - _tickBitmap.width) * 0.5)) : 0;
minSize.x = ((((2 * skin.borderThickness) + (offset * 2)) + (divisionMinWidth * (posNum - 1))) + _tickBitmap.width);
};
divisionWidth = divisionMinWidth;
if (((!((_tickBitmap == null))) && (showTicks))){
drawTicks();
ticks.x = _borderThickness;
ticks.y = ((track.y + skin.trackCenter.height) + _tickMargin);
if (skin.trackCenter.height > _runnerBitmap.height){
minSize.y = ((skin.trackCenter.height + _tickMargin) + _tickBitmap.height);
} else {
minSize.y = (((track.y + skin.trackCenter.height) + _tickMargin) + _tickBitmap.height);
};
} else {
minSize.y = Math.max(_runnerBitmap.height, skin.trackCenter.height);
};
}
}
}//package com.alternativagame.gui.widget.button
Section 348
//SliderEvent (com.alternativagame.gui.widget.button.SliderEvent)
package com.alternativagame.gui.widget.button {
import flash.events.*;
public class SliderEvent extends Event {
public var pos:int;
public static const ONCHANGE_POS:String = "SliderEventOnChangePos";
public function SliderEvent(_arg1:int){
super(SliderEvent.ONCHANGE_POS, true, true);
this.pos = _arg1;
}
}
}//package com.alternativagame.gui.widget.button
Section 349
//SliderRunnerButton (com.alternativagame.gui.widget.button.SliderRunnerButton)
package com.alternativagame.gui.widget.button {
import flash.display.*;
public class SliderRunnerButton extends ImageButton {
private var _dragON:Boolean;// = false
public function SliderRunnerButton(_arg1:int, _arg2:int, _arg3:BitmapData=null, _arg4:BitmapData=null, _arg5:BitmapData=null, _arg6:BitmapData=null){
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
}
public function get dragON():Boolean{
return (_dragON);
}
public function set dragON(_arg1:Boolean):void{
_dragON = _arg1;
if (_arg1 == false){
setNormalState();
};
}
override public function setNormalState():void{
if (!_dragON){
_locked = false;
_over = false;
_pressed = false;
super.setNormalState();
};
}
override public function setOverState():void{
if (!_dragON){
_locked = false;
_over = true;
_pressed = false;
super.setOverState();
};
}
}
}//package com.alternativagame.gui.widget.button
Section 350
//SwitchButton (com.alternativagame.gui.widget.button.SwitchButton)
package com.alternativagame.gui.widget.button {
import flash.display.*;
public class SwitchButton extends Button {
public function SwitchButton(_arg1:String=null, _arg2:BitmapData=null, _arg3:uint=1){
super(_arg1, _arg2, _arg3);
}
override public function setPressState():void{
_locked = false;
_over = false;
_pressed = true;
}
}
}//package com.alternativagame.gui.widget.button
Section 351
//TriggerButton (com.alternativagame.gui.widget.button.TriggerButton)
package com.alternativagame.gui.widget.button {
import flash.geom.*;
import flash.display.*;
import com.alternativagame.gui.widget.*;
import com.alternativagame.gui.skin.widget.button.*;
import com.alternativagame.gui.layout.enums.*;
public class TriggerButton extends BaseButton {
private const g:Number = 1.5;
private var bitmap:Bitmap;
private var tf:Label;
private var skin:TriggerButtonSkin;
public function TriggerButton(_arg1:String=""){
bitmap = new Bitmap();
addChild(bitmap);
tf = new Label(_arg1, Align.LEFT);
addChild(tf);
}
override public function updateSkin():void{
skin = TriggerButtonSkin(skinManager.getSkin(getSkinType()));
minSize.x = skin.unselected.width;
if (((!((tf.text == null))) && (!((tf.text == ""))))){
minSize.x = (Math.round((minSize.x * g)) + tf.minSize.x);
};
minSize.y = Math.max(skin.unselected.height, tf.minSize.y);
tf.x = Math.round((skin.unselected.width * g));
tf.y = Math.round(((skin.unselected.height - tf.minSize.y) / 2));
super.updateSkin();
}
override public function setNormalState():void{
_locked = false;
_over = false;
super.setNormalState();
}
override protected function switchState():void{
if (_pressed){
if (_locked){
bitmap.bitmapData = skin.lockedSelected;
} else {
bitmap.bitmapData = skin.selected;
};
} else {
if (_locked){
bitmap.bitmapData = skin.lockedUnselected;
} else {
bitmap.bitmapData = skin.unselected;
};
};
}
override public function setPressState():void{
_locked = false;
_over = false;
_pressed = !(_pressed);
super.setPressState();
}
protected function getSkinType():Class{
return (null);
}
override public function computeSize(_arg1:Point):Point{
var _local2:Point = (isSkined) ? minSize : new Point();
return (_local2);
}
override public function setOverState():void{
_locked = false;
_over = true;
super.setOverState();
}
}
}//package com.alternativagame.gui.widget.button
Section 352
//ComboBox (com.alternativagame.gui.widget.comboBox.ComboBox)
package com.alternativagame.gui.widget.comboBox {
import flash.geom.*;
import flash.display.*;
import com.alternativagame.gui.base.*;
import com.alternativagame.gui.container.*;
import com.alternativagame.gui.widget.list.*;
import com.alternativagame.gui.layout.impl.*;
import com.alternativagame.gui.skin.widget.comboBox.*;
import com.alternativagame.gui.layout.enums.*;
public class ComboBox extends WidgetContainer {
private var left:Bitmap;
private var selectedItem:IListItem;
private var selectedItemContainer:Container;
private var center:Bitmap;
private var right:Bitmap;
protected var opened:Boolean;
private var gfx:Sprite;
private var selectList:AbstractList;
protected var skin:ComboBoxSkin;
public function ComboBox(_arg1:AbstractList, _arg2:Class){
this.selectList = _arg1;
setLayoutManager(new FillLayoutManager(Direction.HORIZONTAL, Align.CENTER, Align.MIDDLE, 0));
gfx = new Sprite();
gfx.mouseEnabled = false;
gfx.tabEnabled = false;
addChildAt(gfx, 0);
left = new Bitmap();
center = new Bitmap();
right = new Bitmap();
gfx.addChild(left);
gfx.addChild(center);
gfx.addChild(right);
selectedItemContainer = new Container();
addObject(selectedItemContainer);
selectedItemContainer.stretchableH = true;
selectedItemContainer.stretchableV = false;
selectedItem = new (_arg2);
selectedItemContainer.addObject(selectedItem);
addChild(_arg1);
_arg1.visible = false;
_arg1.stretchableH = true;
_arg1.stretchableV = true;
_arg1.addEventListener(ListItemEvent.CLICK, onListItemSelect);
opened = false;
}
protected function hideList():void{
selectList.visible = false;
opened = false;
}
override public function draw(_arg1:Point):void{
super.draw(_arg1);
center.x = left.width;
center.width = ((currentSize.x - left.width) - right.width);
right.x = (currentSize.x - right.width);
selectList.y = _currentSize.y;
selectList.repaint(new Point(_arg1.x, 100));
}
private function calcMinWidth():void{
var _local1:int = (marginLeft + marginRight);
minSize.x = _local1;
}
protected function switchState():void{
state(skin.nl, skin.nc, skin.nr);
}
override public function setPressState():void{
super.setPressState();
switchState();
repaint(currentSize);
}
private function state(_arg1:BitmapData, _arg2:BitmapData, _arg3:BitmapData):void{
left.bitmapData = _arg1;
center.bitmapData = _arg2;
right.bitmapData = _arg3;
}
override public function setOverState():void{
super.setOverState();
switchState();
repaint(currentSize);
}
override public function setNormalState():void{
super.setNormalState();
switchState();
repaint(currentSize);
}
private function onListItemSelect(_arg1:ListItemEvent):void{
hideList();
selectItem(_arg1.data);
}
override public function updateSkin():void{
skin = ComboBoxSkin(skinManager.getSkin(ComboBox));
super.updateSkin();
minSize.y = skin.nc.height;
marginLeft = skin.borderThickness;
marginTop = skin.borderThickness;
marginRight = skin.borderThickness;
marginBottom = skin.borderThickness;
selectedItemContainer.setLayoutManager(new FillLayoutManager(Direction.HORIZONTAL, Align.CENTER, Align.MIDDLE, 0));
switchState();
calcMinWidth();
}
protected function selectItem(_arg1:Object):void{
selectedItem.data = _arg1;
repaintCurrentSize();
}
protected function showList():void{
selectList.visible = true;
opened = true;
}
}
}//package com.alternativagame.gui.widget.comboBox
Section 353
//AbstractList (com.alternativagame.gui.widget.list.AbstractList)
package com.alternativagame.gui.widget.list {
import flash.geom.*;
import flash.events.*;
import com.alternativagame.gui.container.scroller.*;
import com.alternativagame.gui.layout.impl.*;
import com.alternativagame.utility.*;
import com.alternativagame.gui.layout.enums.*;
public class AbstractList extends ScrollBox {
private var selectionCount:uint;
private var shiftIndex:int;// = -1
protected var _dataItems:Array;
public function AbstractList(_arg1:uint=3){
super(1, _arg1);
setLayoutManager(new FillLayoutManager(Direction.VERTICAL, Align.LEFT, Align.TOP));
stretchableV = false;
addEventListener(MouseEvent.CLICK, onMouseClick);
mouseEnabled = true;
}
private function onMouseClick(_arg1:MouseEvent):void{
var _local5:IListItem;
var _local6:ListItemEvent;
var _local2:uint = this.objects.length;
var _local3:Point = MouseUtility.localCoords(this.canvas);
var _local4:uint;
while (_local4 < _local2) {
_local3.y = (_local3.y - getObjectAt(_local4).currentSize.y);
if (_local3.y <= 0){
_local5 = IListItem(getObjectAt(_local4));
_local6 = new ListItemEvent(ListItemEvent.CLICK, _local5.data, _arg1.shiftKey, _arg1.ctrlKey);
onItemClick(_local6, _local5);
dispatchEvent(_local6);
break;
};
_local4++;
};
}
public function getSelection():Array{
var _local3:IListItem;
var _local1:Array = new Array();
var _local2:uint;
while (_local2 < objects.length) {
_local3 = IListItem(objects[_local2]);
if (_local3.selected){
_local1.push(_local3.data);
};
_local2++;
};
return (_local1);
}
public function getSelectionAt(_arg1:IListItem):Boolean{
return (_arg1.selected);
}
public function setSelection(_arg1:Object, _arg2:Boolean):void{
var _local3:int = dataItems.indexOf(_arg1);
if (_local3 >= 0){
setSelectionAt(IListItem(objects[_local3]), _arg2);
};
}
public function set dataItems(_arg1:Array):void{
clearSelection();
this._dataItems = _arg1;
if (isSkined){
repaintItems();
repaintCurrentSize();
};
}
protected function createItem():IListItem{
return (null);
}
override public function updateSkin():void{
super.updateSkin();
if (dataItems != null){
repaintItems();
};
}
public function get dataItems():Array{
return (_dataItems);
}
private function onItemClick(_arg1:ListItemEvent, _arg2:IListItem):void{
var _local4:int;
var _local5:uint;
var _local6:uint;
var _local7:uint;
var _local3:uint = objects.indexOf(_arg2);
if (_arg1.ctrlKey){
setSelectionAt(_arg2, !(getSelectionAt(_arg2)));
if (selectionCount > 0){
shiftIndex = _local3;
} else {
shiftIndex = -1;
};
} else {
if (((_arg1.shiftKey) && ((shiftIndex >= 0)))){
_local4 = shiftIndex;
clearSelection();
shiftIndex = _local4;
_local5 = Math.min(shiftIndex, _local3);
_local6 = Math.max(shiftIndex, _local3);
_local7 = _local5;
while (_local7 <= _local6) {
setSelectionAt(IListItem(objects[_local7]), true);
_local7++;
};
} else {
clearSelection();
setSelectionAt(_arg2, true);
shiftIndex = _local3;
};
};
}
public function removeFirst():void{
this.dataItems.shift();
if (isSkined){
repaintItems();
repaintCurrentSize();
};
}
private function repaintItems():void{
var _local1:IListItem;
removeObjects();
var _local2:int;
while (_local2 < dataItems.length) {
_local1 = createItem();
_local1.setList(this);
addObject(_local1);
_local1.data = dataItems[_local2];
_local2++;
};
}
public function setSelectionAt(_arg1:IListItem, _arg2:Boolean):void{
if (_arg1.selected != _arg2){
selectionCount = (selectionCount + (_arg2) ? 1 : -1);
_arg1.selected = _arg2;
};
}
public function addLast(_arg1:Object):void{
dataItems.push(_arg1);
if (isSkined){
repaintItems();
repaintCurrentSize();
};
}
public function clearSelection():void{
var _local1:uint;
while (_local1 < objects.length) {
setSelectionAt(IListItem(objects[_local1]), false);
_local1++;
};
shiftIndex = -1;
}
}
}//package com.alternativagame.gui.widget.list
Section 354
//IListItem (com.alternativagame.gui.widget.list.IListItem)
package com.alternativagame.gui.widget.list {
import com.alternativagame.gui.base.*;
public interface IListItem extends IGUIObject {
function setList(_arg1:AbstractList):void;
function set data(_arg1:Object):void;
function set selected(_arg1:Boolean):void;
function get data():Object;
function get selected():Boolean;
}
}//package com.alternativagame.gui.widget.list
Section 355
//ListItem (com.alternativagame.gui.widget.list.ListItem)
package com.alternativagame.gui.widget.list {
import flash.geom.*;
import flash.events.*;
import flash.display.*;
import com.alternativagame.gui.base.*;
import com.alternativagame.gui.layout.impl.*;
import com.alternativagame.gui.skin.widget.list.*;
import com.alternativagame.gui.layout.enums.*;
public class ListItem extends WidgetContainer implements IListItem {
private var _data:Object;// = null
protected var selection:Shape;
protected var list:AbstractList;
private var _hint:String;// = null
private var _selected:Boolean;// = false
private var skin:ListItemSkin;
public function ListItem(_arg1:uint=0, _arg2:uint=4, _arg3:int=0, _arg4:int=0){
stretchableH = true;
setLayoutManager(new FillLayoutManager(Direction.HORIZONTAL, _arg1, _arg2, _arg4));
marginLeft = _arg3;
marginRight = _arg3;
selection = new Shape();
selection.visible = false;
addChildAt(selection, 0);
addEventListener(MouseEvent.CLICK, onClick);
mouseEnabled = true;
}
override public function draw(_arg1:Point):void{
super.draw(_arg1);
if (selection.visible){
drawSelection();
};
}
protected function getSkinType():Class{
return (ListItem);
}
override public function setPressState():void{
super.setPressState();
setOverState();
}
public function set data(_arg1:Object):void{
_data = _arg1;
}
public function setList(_arg1:AbstractList):void{
this.list = _arg1;
}
override public function setOverState():void{
super.setOverState();
if (selected){
selection.alpha = skin.selectionAlphaOverSelected;
selection.visible = true;
} else {
selection.alpha = skin.selectionAlphaOver;
selection.visible = true;
};
drawSelection();
}
protected function drawSelection():void{
selection.width = currentSize.x;
selection.height = currentSize.y;
}
private function onClick(_arg1:MouseEvent):void{
}
public function get selected():Boolean{
return (_selected);
}
override public function updateSkin():void{
skin = ListItemSkin(skinManager.getSkin(getSkinType()));
super.updateSkin();
var _local2 = selection.graphics;
with (_local2) {
clear();
beginFill(skin.selectionColor);
drawRect(0, 0, 10, 10);
};
}
override public function setNormalState():void{
super.setNormalState();
if (selected){
selection.alpha = skin.selectionAlphaSelected;
selection.visible = true;
drawSelection();
} else {
selection.visible = false;
};
}
public function get data():Object{
return (_data);
}
public function set selected(_arg1:Boolean):void{
if (_selected != _arg1){
_selected = _arg1;
if (_arg1){
selection.alpha = skin.selectionAlphaSelected;
selection.visible = true;
drawSelection();
} else {
selection.visible = false;
};
};
}
}
}//package com.alternativagame.gui.widget.list
Section 356
//ListItemEvent (com.alternativagame.gui.widget.list.ListItemEvent)
package com.alternativagame.gui.widget.list {
import flash.events.*;
public class ListItemEvent extends Event {
public var data:Object;
public var ctrlKey:Boolean;
public var shiftKey:Boolean;
public static const CLICK:String = "listItemClick";
public static const EXPAND:String = "listItemExpand";
public static const COLLAPSE:String = "listItemCollapse";
public function ListItemEvent(_arg1:String, _arg2:Object, _arg3:Boolean=false, _arg4:Boolean=false){
this.data = _arg2;
this.shiftKey = _arg3;
this.ctrlKey = _arg4;
super(_arg1, true);
}
}
}//package com.alternativagame.gui.widget.list
Section 357
//TreeData (com.alternativagame.gui.widget.tree.TreeData)
package com.alternativagame.gui.widget.tree {
public class TreeData {
public var sub:Boolean;
public var connect:Array;
public var data:Object;
public function TreeData(_arg1:Array, _arg2:Boolean, _arg3:Object){
this.connect = _arg1;
this.sub = _arg2;
this.data = _arg3;
}
}
}//package com.alternativagame.gui.widget.tree
Section 358
//TreeGraphics (com.alternativagame.gui.widget.tree.TreeGraphics)
package com.alternativagame.gui.widget.tree {
import com.alternativagame.gui.base.*;
import com.alternativagame.gui.widget.*;
import com.alternativagame.gui.skin.widget.tree.*;
import com.alternativagame.gui.container.box.*;
import com.alternativagame.gui.layout.enums.*;
public class TreeGraphics extends HBox {
private var skin:TreeGraphicsSkin;
public function TreeGraphics(){
super(Align.LEFT, false, 0, 0);
stretchableH = false;
stretchableV = false;
}
public function addGraphics(_arg1:Array=null):void{
var _local2:uint;
if (_arg1 != null){
_local2 = 0;
while (_local2 < _arg1.length) {
switch (_arg1[_local2]){
case 0:
addObject(new Dummy(19, 19, false));
break;
case 1:
addObject(new Image(skin.bitmapConnectLine));
break;
case 2:
addObject(new Image(skin.bitmapConnectTri));
break;
case 3:
addObject(new Image(skin.bitmapConnectTop));
break;
case 4:
addObject(new Image(skin.bitmapConnectBottom));
break;
};
_local2++;
};
} else {
addObject(new Dummy(0, 19, false));
};
}
override public function updateSkin():void{
super.updateSkin();
skin = TreeGraphicsSkin(skinManager.getSkin(TreeGraphics));
}
}
}//package com.alternativagame.gui.widget.tree
Section 359
//TreeItem (com.alternativagame.gui.widget.tree.TreeItem)
package com.alternativagame.gui.widget.tree {
import flash.events.*;
import com.alternativagame.gui.base.*;
import com.alternativagame.gui.widget.list.*;
import com.alternativagame.gui.layout.impl.*;
import com.alternativagame.gui.widget.*;
import com.alternativagame.gui.skin.widget.tree.*;
import com.alternativagame.gui.layout.enums.*;
public class TreeItem extends WidgetContainer implements IListItem {
private var treeGraphics:TreeGraphics;
protected var item:ListItem;
private var subBtn:Image;
private var skin:TreeItemSkin;
public function TreeItem(_arg1:Class){
stretchableH = true;
stretchableV = false;
setLayoutManager(new FillLayoutManager(Direction.HORIZONTAL, Align.LEFT, Align.MIDDLE));
treeGraphics = new TreeGraphics();
subBtn = new Image();
subBtn.mouseEnabled = true;
item = new (_arg1);
addObject(treeGraphics);
item.stretchableH = true;
addObject(item);
}
public function setList(_arg1:AbstractList):void{
item.setList(_arg1);
}
protected function drawTree(_arg1:TreeData):void{
treeGraphics.removeObjects();
if (_arg1 != null){
treeGraphics.addGraphics(_arg1.connect);
if (hasObject(subBtn)){
removeObject(subBtn);
};
subBtn.bitmapData = (_arg1.sub) ? skin.bitmapSubClosed : skin.bitmapSubOpened;
subBtn.removeEventListener(MouseEvent.CLICK, onSubOpen);
subBtn.removeEventListener(MouseEvent.CLICK, onSubClose);
subBtn.addEventListener(MouseEvent.CLICK, (_arg1.sub) ? onSubOpen : onSubClose);
addObjectAfter(subBtn, treeGraphics);
};
}
private function onSubOpen(_arg1:MouseEvent):void{
item.dispatchEvent(new ListItemEvent(ListItemEvent.EXPAND, data, _arg1.shiftKey, _arg1.ctrlKey));
}
override public function updateSkin():void{
super.updateSkin();
skin = TreeItemSkin(skinManager.getSkin(TreeItem));
}
public function get data():Object{
return (item.data);
}
public function set data(_arg1:Object):void{
var _local2:TreeData = TreeData(_arg1);
if (_local2 != null){
item.data = _local2.data;
} else {
item.data = null;
};
drawTree(_local2);
}
public function set selected(_arg1:Boolean):void{
item.selected = _arg1;
}
private function onSubClose(_arg1:MouseEvent):void{
item.dispatchEvent(new ListItemEvent(ListItemEvent.COLLAPSE, data, _arg1.shiftKey, _arg1.ctrlKey));
}
public function get selected():Boolean{
return (item.selected);
}
}
}//package com.alternativagame.gui.widget.tree
Section 360
//Image (com.alternativagame.gui.widget.Image)
package com.alternativagame.gui.widget {
import flash.geom.*;
import flash.display.*;
import com.alternativagame.gui.base.*;
import com.alternativagame.gui.cursor.*;
import com.alternativagame.gui.skin.widget.*;
public class Image extends Widget {
private var skin:ImageSkin;
private var _locked:Boolean;// = false
private var bitmap:Bitmap;
private var maskBitmap:Shape;
public function Image(_arg1:BitmapData=null){
bitmap = new Bitmap();
addChild(bitmap);
stretchableH = false;
stretchableV = false;
if (_arg1 != null){
this.bitmapData = _arg1;
};
maskBitmap = new Shape();
maskBitmap.graphics.beginFill(0);
maskBitmap.graphics.drawRect(0, 0, 1, 1);
bitmap.mask = maskBitmap;
addChild(maskBitmap);
}
public function get bitmapData():BitmapData{
return (bitmap.bitmapData);
}
override public function updateSkin():void{
skin = ImageSkin(skinManager.getSkin(Image));
super.updateSkin();
this.locked = locked;
}
public function get locked():Boolean{
return (_locked);
}
override public function draw(_arg1:Point):void{
super.draw(_arg1);
maskBitmap.width = _arg1.x;
maskBitmap.height = _arg1.y;
}
public function set locked(_arg1:Boolean):void{
_locked = _arg1;
mouseEnabled = !(_arg1);
if (isSkined){
bitmap.transform.colorTransform = (_arg1) ? skin.colorLocked : skin.colorNormal;
};
}
public function set bitmapData(_arg1:BitmapData):void{
bitmap.bitmapData = _arg1;
bitmap.width = _arg1.width;
bitmap.height = _arg1.height;
minSize.x = _arg1.width;
minSize.y = _arg1.height;
}
override public function get cursor():uint{
return (Cursor.NORMAL);
}
}
}//package com.alternativagame.gui.widget
Section 361
//Input (com.alternativagame.gui.widget.Input)
package com.alternativagame.gui.widget {
import flash.geom.*;
import flash.display.*;
import flash.text.*;
import com.alternativagame.gui.skin.widget.*;
import com.alternativagame.gui.layout.enums.*;
public class Input extends Text {
private var _normal:Boolean;
private var left:Bitmap;
private var center:Bitmap;
private var right:Bitmap;
private var skin:InputSkin;
public function Input(_arg1:String=null, _arg2:uint=0){
super(_arg1, Align.LEFT, false, true, _arg2);
stretchableH = true;
tf.multiline = false;
tf.autoSize = TextFieldAutoSize.NONE;
tf.textColor = 0xFFFFFF;
left = new Bitmap();
center = new Bitmap();
right = new Bitmap();
addChildAt(left, 0);
addChildAt(center, 1);
addChildAt(right, 2);
}
override public function draw(_arg1:Point):void{
super.draw(_arg1);
drawInput();
}
override protected function calcMinWidth(_arg1:Point):void{
minSize.y = skin.bmpNC.height;
}
override protected function getSkinType():Class{
return (Input);
}
override public function set locked(_arg1:Boolean):void{
super.locked = _arg1;
if (isSkined){
switchState();
drawInput();
};
}
private function switchState():void{
if (_locked){
left.bitmapData = skin.bmpLL;
center.bitmapData = skin.bmpLC;
right.bitmapData = skin.bmpLR;
} else {
if (_normal){
left.bitmapData = skin.bmpNL;
center.bitmapData = skin.bmpNC;
right.bitmapData = skin.bmpNR;
} else {
left.bitmapData = skin.bmpOL;
center.bitmapData = skin.bmpOC;
right.bitmapData = skin.bmpOR;
};
};
}
override public function setOverState():void{
super.setOverState();
_normal = false;
switchState();
drawInput();
}
override public function updateSkin():void{
skin = InputSkin(skinManager.getSkin(getSkinType()));
super.updateSkin();
}
override public function setNormalState():void{
super.setNormalState();
_normal = true;
switchState();
drawInput();
}
override protected function drawTextField():void{
tf.x = skin.leftMargin;
tf.y = skin.topMargin;
}
private function drawInput():void{
tf.width = ((currentSize.x - skin.leftMargin) - skin.rightMargin);
center.x = left.width;
center.width = ((currentSize.x - left.width) - right.width);
right.x = (currentSize.x - right.width);
}
public function set password(_arg1:Boolean):void{
tf.displayAsPassword = _arg1;
}
}
}//package com.alternativagame.gui.widget
Section 362
//Label (com.alternativagame.gui.widget.Label)
package com.alternativagame.gui.widget {
import flash.geom.*;
import flash.events.*;
import com.alternativagame.gui.base.*;
import flash.text.*;
import com.alternativagame.gui.skin.widget.*;
import com.alternativagame.gui.layout.enums.*;
public class Label extends Widget {
protected var _align:uint;
protected var _text:String;
protected var _textWidth:int;
protected var _locked:Boolean;// = false
public var tf:TextField;
private var skin:LabelSkin;
public function Label(_arg1:String=null, _arg2:uint=0){
var text = _arg1;
var align = _arg2;
super();
tf = new TextField();
addChild(tf);
mouseEnabled = false;
tabEnabled = false;
this.align = align;
this.text = text;
var _local4 = tf;
with (_local4) {
autoSize = TextFieldAutoSize.LEFT;
antiAliasType = AntiAliasType.ADVANCED;
embedFonts = true;
selectable = false;
multiline = false;
mouseEnabled = false;
visible = true;
x = -2;
y = -3;
};
}
override public function draw(_arg1:Point):void{
super.draw(_arg1);
drawTextField();
}
public function selectAll():void{
tf.setSelection(0, tf.text.length);
}
protected function calcMinWidth(_arg1:Point):void{
minSize.x = (Math.round(tf.width) - 3);
_textWidth = minSize.x;
minSize.y = (Math.round(tf.height) - 6);
}
public function set align(_arg1:uint):void{
_align = _arg1;
var _local2:TextFormat = tf.defaultTextFormat;
switch (align){
case Align.LEFT:
_local2.align = TextFormatAlign.LEFT;
break;
case Align.CENTER:
_local2.align = TextFormatAlign.CENTER;
break;
case Align.RIGHT:
_local2.align = TextFormatAlign.RIGHT;
break;
};
if (!isSkined){
return;
};
calcMinWidth(currentSize);
drawTextField();
}
protected function getSkinType():Class{
return (Label);
}
public function get locked():Boolean{
return (_locked);
}
public function set locked(_arg1:Boolean):void{
_locked = _arg1;
if (!isSkined){
return;
};
var _local2:String = tf.defaultTextFormat.align;
var _local3:TextFormat = (_arg1) ? skin.tfLocked : skin.tfNormal;
_local3.align = _local2;
tf.setTextFormat(_local3);
tf.defaultTextFormat = _local3;
}
public function set text(_arg1:String):void{
_text = _arg1;
if (_arg1 != null){
tf.text = _arg1;
tf.visible = true;
if (isSkined){
calcMinWidth(currentSize);
drawTextField();
};
} else {
tf.text = "";
tf.visible = true;
minSize.x = 0;
minSize.y = 0;
};
}
public function get align():uint{
return (_align);
}
override public function updateSkin():void{
skin = LabelSkin(skinManager.getSkin(getSkinType()));
super.updateSkin();
tf.thickness = skin.thickness;
tf.sharpness = skin.sharpness;
this.locked = locked;
calcMinWidth(currentSize);
}
override public function computeSize(_arg1:Point):Point{
calcMinWidth(_arg1);
return (super.computeSize(_arg1));
}
protected function drawTextField():void{
switch (align){
case Align.LEFT:
tf.x = 0;
break;
case Align.CENTER:
tf.x = ((currentSize.x - _textWidth) >> 1);
break;
case Align.RIGHT:
tf.x = (currentSize.x - _textWidth);
break;
};
tf.x = (tf.x - 2);
}
public function get text():String{
return (tf.text);
}
override protected function onFocusIn(_arg1:FocusEvent):void{
if (_arg1.target == this){
if (stage != null){
stage.focus = tf;
};
};
}
}
}//package com.alternativagame.gui.widget
Section 363
//Line (com.alternativagame.gui.widget.Line)
package com.alternativagame.gui.widget {
import flash.geom.*;
import com.alternativagame.gui.base.*;
import com.alternativagame.gui.skin.widget.*;
import com.alternativagame.gui.layout.enums.*;
public class Line extends GUIObject {
private var _direction:Boolean;
private var skin:LineSkin;
public function Line(_arg1:Boolean){
this._direction = _arg1;
stretchableV = (_direction == Direction.VERTICAL);
stretchableH = (_direction == Direction.HORIZONTAL);
}
override public function draw(_arg1:Point):void{
super.draw(_arg1);
if (_direction == Direction.VERTICAL){
graphics.beginBitmapFill(skin.bmpVT, null, false, false);
graphics.drawRect(0, 0, minSize.x, skin.bmpVT.height);
graphics.endFill();
graphics.beginBitmapFill(skin.bmpVM, null, false, false);
graphics.drawRect(0, skin.bmpVT.height, minSize.x, (_arg1.y - minSize.y));
graphics.endFill();
graphics.beginBitmapFill(skin.bmpVB, null, false, false);
graphics.drawRect(0, (_arg1.y - skin.bmpVB.height), minSize.x, skin.bmpVB.height);
graphics.endFill();
} else {
graphics.beginBitmapFill(skin.bmpHL, null, false, false);
graphics.drawRect(0, 0, skin.bmpHL.width, minSize.y);
graphics.endFill();
graphics.beginBitmapFill(skin.bmpVM, null, false, false);
graphics.drawRect(skin.bmpHL.width, 0, (_arg1.x - minSize.x), minSize.y);
graphics.endFill();
graphics.beginBitmapFill(skin.bmpVB, null, false, false);
graphics.drawRect((_arg1.x - skin.bmpHR.width), 0, skin.bmpHR.width, minSize.y);
graphics.endFill();
};
}
override public function updateSkin():void{
skin = LineSkin(skinManager.getSkin(Line));
super.updateSkin();
if (_direction == Direction.VERTICAL){
minSize.x = skin.bmpVM.width;
minSize.y = (skin.bmpVT.height + skin.bmpVB.height);
} else {
minSize.x = (skin.bmpHL.width + skin.bmpHR.width);
minSize.y = skin.bmpHC.height;
};
}
}
}//package com.alternativagame.gui.widget
Section 364
//NumberInput (com.alternativagame.gui.widget.NumberInput)
package com.alternativagame.gui.widget {
import flash.events.*;
import com.alternativagame.gui.base.*;
import com.alternativagame.gui.widget.button.*;
import com.alternativagame.gui.container.*;
import com.alternativagame.gui.layout.impl.*;
import com.alternativagame.gui.skin.widget.*;
import com.alternativagame.gui.layout.enums.*;
import flash.ui.*;
public class NumberInput extends WidgetContainer {
private var buttonsContainer:Container;
private var inputValue:Number;
private var input:Input;
private var step:Number;
private var decButton:ImageButton;
private var _locked:Boolean;
private var maxValue:Number;
private var incButton:ImageButton;
private var skin:NumberInputSkin;
private var minValue:Number;
public function NumberInput(_arg1:Number, _arg2:Number, _arg3:Number){
tabEnabled = true;
tabChildren = false;
this.minValue = _arg1;
this.maxValue = _arg2;
this.step = _arg3;
setLayoutManager(new FillLayoutManager(Direction.HORIZONTAL, Align.LEFT, Align.MIDDLE, 0));
input = new Input();
addObject(input);
input.text = String(_arg1);
inputValue = _arg1;
buttonsContainer = new Container();
buttonsContainer.setLayoutManager(new FillLayoutManager(Direction.VERTICAL, Align.CENTER, Align.MIDDLE, 0));
addObject(buttonsContainer);
incButton = new ImageButton(0, 0);
decButton = new ImageButton(0, 0);
buttonsContainer.addObject(incButton);
buttonsContainer.addObject(decButton);
var _local4:ButtonRepeater = new ButtonRepeater(incButton, 500, 50);
var _local5:ButtonRepeater = new ButtonRepeater(decButton, 500, 50);
incButton.addEventListener(MouseEvent.MOUSE_DOWN, onIncButtonMouseDown);
decButton.addEventListener(MouseEvent.MOUSE_DOWN, onDecButtonMouseDown);
incButton.addEventListener(MouseEvent.CLICK, onIncButtonClick);
decButton.addEventListener(MouseEvent.CLICK, onDecButtonClick);
input.addEventListener(KeyboardEvent.KEY_DOWN, onInputKeyDown);
input.addEventListener(FocusEvent.FOCUS_OUT, onFocusOut);
}
override protected function onFocusIn(_arg1:FocusEvent):void{
if (_arg1.target == this){
if (stage != null){
stage.focus = input;
};
};
input.selectAll();
}
public function get locked():Boolean{
return (_locked);
}
private function onDecButtonClick(_arg1:MouseEvent=null):void{
value = (Number(input.text) - step);
}
override protected function onFocusOut(_arg1:FocusEvent):void{
value = Number(input.text);
}
private function onIncButtonMouseUp(_arg1:MouseEvent):void{
incButton.removeEventListener(MouseEvent.MOUSE_UP, onIncButtonMouseUp);
}
private function onIncButtonMouseDown(_arg1:MouseEvent):void{
incButton.addEventListener(MouseEvent.MOUSE_UP, onIncButtonMouseUp);
}
public function set value(_arg1:Number):void{
var _local2:Number = _arg1;
if (_local2 < minValue){
_local2 = minValue;
} else {
if (_local2 > maxValue){
_local2 = maxValue;
};
};
input.text = String(_local2);
inputValue = _local2;
if (_local2 != minValue){
if (decButton.locked){
decButton.locked = false;
};
} else {
decButton.locked = true;
};
if (_local2 != maxValue){
if (incButton.locked){
incButton.locked = false;
};
} else {
incButton.locked = true;
};
dispatchEvent(new Event(Event.CHANGE, true, true));
}
public function set locked(_arg1:Boolean):void{
_locked = _arg1;
input.locked = _arg1;
incButton.locked = _arg1;
decButton.locked = _arg1;
}
override public function updateSkin():void{
skin = NumberInputSkin(skinManager.getSkin(_slot1));
super.updateSkin();
incButton.normalBitmap = skin.incButtonNormal;
incButton.overBitmap = skin.incButtonOver;
incButton.pressBitmap = skin.incButtonPress;
incButton.lockBitmap = skin.incButtonLock;
decButton.normalBitmap = skin.decButtonNormal;
decButton.overBitmap = skin.decButtonOver;
decButton.pressBitmap = skin.decButtonPress;
decButton.lockBitmap = skin.decButtonLock;
if (inputValue == minValue){
decButton.locked = true;
};
if (inputValue == maxValue){
incButton.locked = true;
};
}
private function onDecButtonMouseUp(_arg1:MouseEvent):void{
decButton.removeEventListener(MouseEvent.MOUSE_UP, onDecButtonMouseUp);
}
public function get value():Number{
return (inputValue);
}
private function onDecButtonMouseDown(_arg1:MouseEvent):void{
decButton.addEventListener(MouseEvent.MOUSE_UP, onDecButtonMouseUp);
}
private function onInputKeyDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.ENTER){
value = Number(input.text);
};
}
private function onIncButtonClick(_arg1:MouseEvent=null):void{
value = (Number(input.text) + step);
}
}
}//package com.alternativagame.gui.widget
Section 365
//Text (com.alternativagame.gui.widget.Text)
package com.alternativagame.gui.widget {
import flash.geom.*;
import flash.events.*;
import flash.text.*;
import com.alternativagame.gui.cursor.*;
import com.alternativagame.gui.skin.widget.*;
public class Text extends Label {
private var _editable:Boolean;
private var _wordWrap:Boolean;
private var skin:TextSkin;
public function Text(_arg1:String=null, _arg2:uint=0, _arg3:Boolean=false, _arg4:Boolean=false, _arg5:uint=0xFF){
tf.selectable = true;
tf.mouseEnabled = true;
tf.multiline = true;
tf.embedFonts = true;
mouseEnabled = true;
tabEnabled = true;
this.maxChars = _arg5;
this.wordWrap = _arg3;
this.align = _arg2;
this.editable = _arg4;
this.text = _arg1;
tf.addEventListener(Event.CHANGE, onChange);
}
public function set wordWrap(_arg1:Boolean):void{
_wordWrap = _arg1;
tf.wordWrap = _arg1;
if (isSkined){
repaintCurrentSize();
};
}
override public function draw(_arg1:Point):void{
super.draw(_arg1);
tf.width = _arg1.x;
tf.height = _arg1.y;
}
private function onMouse(_arg1:MouseEvent):void{
dispatchEvent(new MouseEvent(_arg1.type));
_arg1.stopPropagation();
}
override protected function getSkinType():Class{
return (Text);
}
private function onChange(_arg1:Event):void{
dispatchEvent(new Event(Event.CHANGE));
_text = tf.text;
}
public function set maxChars(_arg1:uint):void{
tf.maxChars = _arg1;
}
override public function set locked(_arg1:Boolean):void{
_locked = _arg1;
tf.tabEnabled = !(_arg1);
tf.mouseEnabled = !(_arg1);
mouseEnabled = !(_arg1);
if (_arg1){
if (((!((stage == null))) && ((stage.focus == this)))){
stage.focus = null;
};
dispatchEvent(new MouseEvent(MouseEvent.MOUSE_OUT));
};
if (isSkined){
drawEffect();
};
}
override public function get cursor():uint{
return (Cursor.NONE);
}
public function set editable(_arg1:Boolean):void{
_editable = _arg1;
tabEnabled = !(_arg1);
if (isSkined){
drawEffect();
};
}
override public function computeSize(_arg1:Point):Point{
var _local2:Point;
if (_wordWrap){
_local2 = _arg1.clone();
tf.width = _arg1.x;
tf.autoSize = TextFieldAutoSize.CENTER;
_local2.y = tf.height;
tf.autoSize = TextFieldAutoSize.NONE;
_local2.x = _arg1.x;
_textWidth = _local2.x;
return (_local2);
};
return (super.computeSize(_arg1));
}
private function drawEffect():void{
var _local1:TextFormat;
tf.type = (((!(_editable)) || (_locked))) ? TextFieldType.DYNAMIC : TextFieldType.INPUT;
if (isSkined){
_local1 = (_locked) ? skin.tfLocked : skin.tfNormal;
tf.setTextFormat(_local1);
tf.defaultTextFormat = _local1;
};
}
override public function updateSkin():void{
skin = TextSkin(skinManager.getSkin(getSkinType()));
super.updateSkin();
this.locked = locked;
}
}
}//package com.alternativagame.gui.widget
Section 366
//PanelTitleBase (com.alternativagame.gui.window.panel.PanelTitleBase)
package com.alternativagame.gui.window.panel {
import flash.geom.*;
import flash.display.*;
import com.alternativagame.gui.window.*;
import com.alternativagame.gui.container.*;
import com.alternativagame.gui.cursor.*;
import com.alternativagame.gui.skin.window.panel.*;
public class PanelTitleBase extends WindowTitleBase {
private var _minimized:Boolean;// = false
private var icon:Bitmap;
public function PanelTitleBase(_arg1:Container, _arg2:String=null, _arg3:Boolean=false, _arg4:Boolean=false){
super(_arg1, _arg2, _arg3, _arg4);
icon = new Bitmap();
gfx.addChild(icon);
}
override public function draw(_arg1:Point):void{
super.draw(_arg1);
icon.x = Math.floor(((_arg1.x - icon.width) / 2));
icon.y = Math.floor(((_arg1.y - icon.height) / 2));
}
override public function updateSkin():void{
super.updateSkin();
setMaximizedState();
}
override protected function getSkinType():Class{
return (PanelTitleBase);
}
public function setMinimizedState():void{
_minimized = true;
icon.bitmapData = PanelTitleSkin(skin).iconMaximize;
}
override public function get cursor():uint{
var _local1:uint = Cursor.ACTIVE;
return (_local1);
}
public function setMaximizedState():void{
_minimized = false;
icon.bitmapData = PanelTitleSkin(skin).iconMinimize;
}
}
}//package com.alternativagame.gui.window.panel
Section 367
//ResizeablePanelBase (com.alternativagame.gui.window.panel.ResizeablePanelBase)
package com.alternativagame.gui.window.panel {
import flash.geom.*;
import flash.events.*;
import com.alternativagame.gui.base.*;
import com.alternativagame.gui.window.*;
import com.alternativagame.gui.container.*;
import com.alternativagame.gui.layout.enums.*;
public class ResizeablePanelBase extends DialogWindowBase {
private var containerMaxSize:Point;
private var _align:uint;
public function ResizeablePanelBase(_arg1:uint, _arg2:int, _arg3:Boolean=false, _arg4:Boolean=false, _arg5:String=null, _arg6:Boolean=true, _arg7:Boolean=false, _arg8:Boolean=false){
super(0, 0, _arg3, _arg4, _arg5, _arg6, _arg7);
_align = _arg1;
this.minimized = _arg8;
moveArea = null;
switch (_arg1){
case Align.LEFT:
this.minSize.x = _arg2;
this.minSize.y = 0;
this.stretchableH = false;
this.stretchableV = true;
leftResizeEnabled = false;
topResizeEnabled = false;
bottomResizeEnabled = false;
break;
case Align.TOP:
this.minSize.y = _arg2;
this.minSize.x = 0;
this.stretchableH = true;
this.stretchableV = false;
leftResizeEnabled = false;
rightResizeEnabled = false;
topResizeEnabled = false;
break;
case Align.RIGHT:
this.minSize.x = _arg2;
this.minSize.y = 0;
this.stretchableH = false;
this.stretchableV = true;
rightResizeEnabled = false;
topResizeEnabled = false;
bottomResizeEnabled = false;
break;
case Align.BOTTOM:
this.minSize.y = _arg2;
this.minSize.x = 0;
this.stretchableH = true;
this.stretchableV = false;
leftResizeEnabled = false;
rightResizeEnabled = false;
bottomResizeEnabled = false;
break;
};
if (_arg4){
winTitle.addEventListener(MouseEvent.CLICK, onTitleClick);
};
}
public function get align():uint{
return (_align);
}
public function set align(_arg1:uint):void{
_align = _arg1;
}
protected function maximize():void{
trace("maximize");
minimized = false;
PanelTitleBase(winTitle).setMaximizedState();
container.visible = true;
container.scaleY = 1;
container.mouseEnabled = true;
gfx.visible = true;
gfx.scaleY = 1;
gfx.mouseEnabled = true;
Container(parent.parent).computeSize(GUIObject(parent.parent).currentSize);
Container(parent.parent).repaintCurrentSize();
}
override protected function getSkinType():Class{
return (ResizeablePanelBase);
}
private function onTitleClick(_arg1:MouseEvent):void{
if (minimized){
maximize();
} else {
minimize();
};
}
override protected function createTitle(_arg1:Container, _arg2:String, _arg3:Boolean):WindowTitleBase{
return (new PanelTitleBase(_arg1, _arg2, _arg3, true));
}
protected function minimize():void{
trace("minimize");
minimized = true;
PanelTitleBase(winTitle).setMinimizedState();
containerMaxSize = new Point(container.currentSize.x, container.currentSize.y);
container.mouseEnabled = false;
container.scaleY = 0;
container.visible = false;
gfx.mouseEnabled = false;
gfx.scaleY = 0;
gfx.visible = false;
Container(parent.parent).computeSize(GUIObject(parent.parent).currentSize);
GUIObject(parent.parent).repaintCurrentSize();
}
override public function computeSize(_arg1:Point):Point{
var _local2:Point = new Point();
if (((titled) && (minimized))){
_local2 = new Point(_arg1.x, winTitle.currentSize.y);
} else {
_local2 = super.computeSize(_arg1);
};
return (_local2);
}
}
}//package com.alternativagame.gui.window.panel
Section 368
//DialogWindowBase (com.alternativagame.gui.window.DialogWindowBase)
package com.alternativagame.gui.window {
import flash.events.*;
import com.alternativagame.gui.container.*;
public class DialogWindowBase extends WindowBase {
protected var winTitle:WindowTitleBase;
public function DialogWindowBase(_arg1:uint=0, _arg2:uint=0, _arg3:Boolean=true, _arg4:Boolean=true, _arg5:String=null, _arg6:Boolean=true, _arg7:Boolean=false){
super(_arg1, _arg2, _arg3, _arg4, _arg6, _arg7);
if (_arg4){
_title = _arg5;
winTitle = createTitle(container, _arg5, true);
addTitle(winTitle);
moveArea = winTitle;
winTitle.addEventListener(Event.CLOSE, onClose);
};
}
public function onClose(_arg1:Event):void{
dispatchEvent(new WindowEvent(WindowEvent.CLOSE));
}
protected function createTitle(_arg1:Container, _arg2:String, _arg3:Boolean):WindowTitleBase{
return (null);
}
public function set title(_arg1:String):void{
if (titled){
_title = _arg1;
winTitle.title = _arg1;
};
}
}
}//package com.alternativagame.gui.window
Section 369
//Tab (com.alternativagame.gui.window.Tab)
package com.alternativagame.gui.window {
import com.alternativagame.gui.base.*;
public class Tab extends WidgetContainer {
public var closeable:Boolean;
private var _title:String;
public function Tab(_arg1:String, _arg2:Boolean=true){
this.title = _arg1;
this.closeable = _arg2;
}
public function set title(_arg1:String):void{
_title = _arg1;
}
public function get title():String{
return (_title);
}
}
}//package com.alternativagame.gui.window
Section 370
//TabbedWindowBase (com.alternativagame.gui.window.TabbedWindowBase)
package com.alternativagame.gui.window {
import flash.events.*;
import com.alternativagame.gui.layout.enums.*;
public class TabbedWindowBase extends WindowBase {
protected var activeTabIndex:int;// = -1
protected var tabList:Array;
public function TabbedWindowBase(_arg1:uint=0, _arg2:uint=0, _arg3:Boolean=true, _arg4:Boolean=true){
super(_arg1, _arg2, _arg3, _arg4);
tabList = new Array();
}
public function getTabByTitle(_arg1:WindowTitleBase):Tab{
var _local2:Tab;
var _local3:Object;
for each (_local3 in tabList) {
if (_local3.title == _arg1){
_local2 = _local3.tab;
};
};
return (_local2);
}
protected function onTabClose(_arg1:Event):void{
}
protected function createTitle(_arg1:Tab, _arg2:Boolean):WindowTitleBase{
return (null);
}
public function setActiveTab(_arg1:Tab):void{
var _local2:Object;
container.removeObjects();
for each (_local2 in tabList) {
if (_local2.tab == _arg1){
_local2.title.active = true;
moveArea = _local2.title;
activeTabIndex = tabList.indexOf(_local2);
container.addObject(_arg1);
} else {
_local2.title.active = false;
};
};
if (isSkined){
repaintCurrentSize();
};
}
public function removeTab(_arg1:Tab):void{
var _local2:Object;
var _local3:int;
for each (_local2 in tabList) {
if (_local2.tab == _arg1){
_local3 = tabList.indexOf(_local2);
tabTitleContainer.removeObject(_local2.title);
tabList.splice(_local3, 1);
if (tabList.length == 0){
} else {
if (tabList.length == 1){
setActiveTab(tabList[0].tab);
tabList[0].title.titleAlign = Align.LEFT;
} else {
if (_local2.title.active){
container.removeObject(_local2.tab);
if (_local3 < tabList.length){
setActiveTab(tabList[_local3].tab);
} else {
setActiveTab(tabList[(tabList.length - 1)].tab);
};
};
};
repaintCurrentSize();
};
};
};
}
private function onTabSelect(_arg1:Event):void{
setActiveTab(getTabByTitle(WindowTitleBase(_arg1.target)));
}
public function addTab(_arg1:Tab):void{
var _local2:WindowTitleBase = createTitle(_arg1, (tabList.length == 0));
_local2.parentWindow = this;
tabList.push({title:_local2, tab:_arg1});
addTitle(_local2);
_local2.addEventListener(Event.SELECT, onTabSelect);
_local2.addEventListener(Event.CLOSE, onTabClose);
if (tabList.length == 1){
setActiveTab(_arg1);
_local2.titleAlign = Align.LEFT;
} else {
if (tabList.length == 2){
tabList[0].title.titleAlign = Align.CENTER;
};
_local2.titleAlign = Align.CENTER;
if (isSkined){
repaintCurrentSize();
};
};
}
public function getTitleByTab(_arg1:Tab):WindowTitleBase{
var _local2:WindowTitleBase;
var _local3:Object;
for each (_local3 in tabList) {
if (_local3.tab == _arg1){
_local2 = _local3.title;
};
};
return (_local2);
}
}
}//package com.alternativagame.gui.window
Section 371
//WindowBase (com.alternativagame.gui.window.WindowBase)
package com.alternativagame.gui.window {
import flash.geom.*;
import flash.events.*;
import flash.display.*;
import com.alternativagame.gui.base.*;
import com.alternativagame.gui.layout.*;
import com.alternativagame.gui.widget.button.*;
import com.alternativagame.gui.container.*;
import com.alternativagame.gui.layout.impl.*;
import com.alternativagame.gui.skin.window.*;
import com.alternativagame.gui.layout.enums.*;
public class WindowBase extends ResizeableBase {
protected var windowContainer:Container;
protected var container:Container;
private var _minimized:Boolean;
protected var titleContainer:Container;
protected var cTLbmp:Bitmap;
protected var titled:Boolean;
protected var cBLbmp:Bitmap;
protected var minimizeButton:ImageButton;
protected var bgbmp:Bitmap;
private var subtract:Shape;
protected var cBRbmp:Bitmap;
protected var eMLbmp:Bitmap;
protected var cTRbmp:Bitmap;
private var oldSize:Point;
protected var closeButton:ImageButton;
protected var controlButtonContainer:Container;
protected var closeable:Boolean;
protected var eBCbmp:Bitmap;
protected var _title:String;
private var oldPosition:Point;
protected var eTCbmp:Bitmap;
protected var minimizeable:Boolean;
protected var gfx:Sprite;
protected var eMRbmp:Bitmap;
protected var skin:WindowSkin;
protected var tabTitleContainer:Container;
public function WindowBase(_arg1:uint=0, _arg2:uint=0, _arg3:Boolean=true, _arg4:Boolean=true, _arg5:Boolean=true, _arg6:Boolean=false){
mouseEnabled = true;
super(_arg3, _arg3, _arg3, _arg3);
stretchableH = true;
stretchableV = true;
this.titled = _arg4;
this.closeable = _arg5;
this.minimizeable = _arg6;
cTLbmp = new Bitmap();
cTRbmp = new Bitmap();
cBLbmp = new Bitmap();
cBRbmp = new Bitmap();
eTCbmp = new Bitmap();
eMLbmp = new Bitmap();
eMRbmp = new Bitmap();
eBCbmp = new Bitmap();
bgbmp = new Bitmap();
windowContainer = new Container();
windowContainer.stretchableH = true;
windowContainer.stretchableV = true;
windowContainer.minSize.x = _arg1;
windowContainer.minSize.y = _arg2;
addChild(windowContainer);
windowContainer.setLayoutManager(new FillLayoutManager(Direction.VERTICAL, Align.JUSTIFY, Align.TOP));
windowContainer.rootObject = this;
if (_arg4){
createTitleContainer();
};
createContentContainer();
gfx = new Sprite();
gfx.mouseEnabled = false;
gfx.addChild(cTLbmp);
gfx.addChild(cTRbmp);
gfx.addChild(cBLbmp);
gfx.addChild(cBRbmp);
gfx.addChild(eTCbmp);
gfx.addChild(eMLbmp);
gfx.addChild(eMRbmp);
gfx.addChild(eBCbmp);
gfx.addChild(bgbmp);
container.addChildAt(gfx, 0);
if (_arg4){
if (_arg6){
minimizeButton = new ImageButton(0, 1);
minimizeButton.stretchableH = false;
minimizeButton.stretchableV = false;
addControlButton(minimizeButton);
};
if (_arg5){
closeButton = new ImageButton(0, 1);
closeButton.stretchableH = false;
closeButton.stretchableV = false;
addControlButton(closeButton);
};
};
addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
}
public function addObjectAfter(_arg1:IGUIObject, _arg2:IGUIObject):void{
container.addObjectAfter(_arg1, _arg2);
}
public function get minimized():Boolean{
return (_minimized);
}
override public function repaintCurrentSize():void{
var _local1:Point = currentSize;
draw(computeSize(currentSize));
if (!currentSize.equals(_local1)){
updateSize();
};
}
public function addObjectAt(_arg1:IGUIObject, _arg2:int):void{
container.addObjectAt(_arg1, _arg2);
}
public function swapObjects(_arg1:IGUIObject, _arg2:IGUIObject):void{
container.swapObjects(_arg1, _arg2);
}
public function get title():String{
return (_title);
}
protected function createTitleContainer():void{
titleContainer = new Container();
titleContainer.stretchableH = true;
titleContainer.stretchableV = false;
windowContainer.addObject(titleContainer);
tabTitleContainer = new Container();
tabTitleContainer.stretchableH = true;
tabTitleContainer.stretchableV = false;
titleContainer.addObject(tabTitleContainer);
controlButtonContainer = new Container();
controlButtonContainer.stretchableH = false;
controlButtonContainer.stretchableV = false;
titleContainer.addObject(controlButtonContainer);
}
public function hasObject(_arg1:IGUIObject):Boolean{
return (container.hasObject(_arg1));
}
public function removeObjects():void{
container.removeObjects();
}
public function swapObjectsAt(_arg1:int, _arg2:int):void{
container.swapObjectsAt(_arg1, _arg2);
}
public function set minimized(_arg1:Boolean):void{
_minimized = _arg1;
}
public function removeObjectAt(_arg1:int):void{
container.removeObjectAt(_arg1);
}
public function addTitle(_arg1:WindowTitleBase):void{
if (titled){
tabTitleContainer.addObject(_arg1);
};
}
protected function createContentContainer():void{
container = new Container();
container.setLayoutManager(new FillLayoutManager(Direction.VERTICAL, Align.CENTER, Align.TOP));
windowContainer.addObject(container);
container.stretchableH = true;
container.stretchableV = true;
}
public function addObjectBefore(_arg1:IGUIObject, _arg2:IGUIObject):void{
container.addObjectBefore(_arg1, _arg2);
}
public function addObject(_arg1:IGUIObject):void{
container.addObject(_arg1);
}
override public function draw(_arg1:Point):void{
windowContainer.draw(_arg1);
super.draw(_arg1);
arrangeGraphics(container.currentSize);
snapRect = new Rectangle(0, 0, _arg1.x, _arg1.y);
}
protected function getSkinType():Class{
return (WindowBase);
}
public function addControlButton(_arg1:IButton):void{
if (titled){
controlButtonContainer.addObject(_arg1);
};
}
public function getObjectAt(_arg1:int):IGUIObject{
return (container.getObjectAt(_arg1));
}
protected function arrangeGraphics(_arg1:Point):void{
var _local2:int = (_arg1.x - cBRbmp.width);
var _local3:int = (_arg1.y - cBRbmp.height);
cTRbmp.x = _local2;
cBLbmp.y = _local3;
cBRbmp.x = _local2;
cBRbmp.y = _local3;
var _local4:int = ((_arg1.x - cTLbmp.width) - cTRbmp.width);
var _local5:int = ((_arg1.y - cTLbmp.height) - cBLbmp.height);
eTCbmp.x = cTLbmp.width;
eTCbmp.width = _local4;
eMLbmp.y = cTLbmp.height;
eMLbmp.height = _local5;
eMRbmp.x = _local2;
eMRbmp.y = cTRbmp.height;
eMRbmp.height = _local5;
eBCbmp.x = cBLbmp.width;
eBCbmp.y = _local3;
eBCbmp.width = _local4;
bgbmp.x = cTLbmp.width;
bgbmp.y = cTLbmp.height;
bgbmp.width = _local4;
bgbmp.height = _local5;
}
override public function computeSize(_arg1:Point):Point{
return (windowContainer.computeSize(_arg1));
}
protected function loadBitmaps():void{
cTLbmp.bitmapData = skin.cornerTLmargin;
cTRbmp.bitmapData = skin.cornerTRmargin;
cBLbmp.bitmapData = skin.cornerBL;
cBRbmp.bitmapData = skin.cornerBR;
eTCbmp.bitmapData = skin.edgeTC;
eMLbmp.bitmapData = skin.edgeML;
eMRbmp.bitmapData = skin.edgeMR;
eBCbmp.bitmapData = skin.edgeBC;
bgbmp.bitmapData = skin.bgMC;
if (titled){
if (closeable){
closeButton.normalBitmap = skin.closeNN;
closeButton.overBitmap = skin.closeNN;
closeButton.pressBitmap = skin.closeNP;
closeButton.lockBitmap = skin.closeNN;
};
if (minimizeable){
minimizeButton.normalBitmap = skin.minimizeNN;
minimizeButton.overBitmap = skin.minimizeNN;
minimizeButton.pressBitmap = skin.minimizeNP;
minimizeButton.lockBitmap = skin.minimizeNN;
};
cTLbmp.bitmapData = skin.cornerTLactive;
cTRbmp.bitmapData = skin.cornerTRactive;
eTCbmp.bitmapData = skin.edgeTCactive;
};
}
public function setLayoutManager(_arg1:ILayoutManager):void{
container.setLayoutManager(_arg1);
}
public function removeObject(_arg1:IGUIObject):void{
container.removeObject(_arg1);
}
public function setObjectIndex(_arg1:IGUIObject, _arg2:int):void{
container.setObjectIndex(_arg1, _arg2);
}
override public function updateSkin():void{
skin = WindowSkin(skinManager.getSkin(getSkinType()));
super.updateSkin();
loadBitmaps();
container.marginLeft = skin.containerMargin;
container.marginTop = skin.containerMargin;
container.marginRight = skin.containerMargin;
container.marginBottom = skin.containerMargin;
if (titled){
titleContainer.setLayoutManager(new CompletelyFillLayoutManager(Direction.HORIZONTAL, Align.JUSTIFY, Align.TOP));
tabTitleContainer.setLayoutManager(new CompletelyFillLayoutManager(Direction.HORIZONTAL, Align.LEFT, Align.MIDDLE, skin.titleSpace));
titleContainer.marginLeft = skin.titleMargin;
titleContainer.marginRight = skin.titleMargin;
controlButtonContainer.setLayoutManager(new CompletelyFillLayoutManager(Direction.HORIZONTAL, Align.RIGHT, Align.TOP, skin.controlButtonSpace));
if (((closeable) || (minimizeable))){
controlButtonContainer.marginLeft = skin.controlButtonMarginLeft;
controlButtonContainer.marginTop = skin.controlButtonMarginTop;
controlButtonContainer.marginRight = skin.controlButtonMarginRight;
};
};
}
private function onMouseDown(_arg1:MouseEvent):void{
dispatchEvent(new WindowEvent(WindowEvent.SELECT));
}
protected function toFront():void{
if (parent.getChildIndex(this) < (parent.numChildren - 1)){
parent.setChildIndex(this, (parent.numChildren - 1));
};
}
override public function get minSize():Point{
return (windowContainer.minSize);
}
public function getLayoutManager():ILayoutManager{
return (container.getLayoutManager());
}
}
}//package com.alternativagame.gui.window
Section 372
//WindowEvent (com.alternativagame.gui.window.WindowEvent)
package com.alternativagame.gui.window {
import flash.events.*;
public class WindowEvent extends Event {
public static const SELECT:String = "WindowEventSelect";
public static const MINIMIZE:String = "WindowEventMimimize";
public static const CLOSE:String = "WindowEventClose";
public function WindowEvent(_arg1:String){
super(_arg1, true, true);
}
}
}//package com.alternativagame.gui.window
Section 373
//WindowTitleBase (com.alternativagame.gui.window.WindowTitleBase)
package com.alternativagame.gui.window {
import flash.geom.*;
import flash.events.*;
import flash.display.*;
import com.alternativagame.gui.base.*;
import com.alternativagame.gui.widget.button.*;
import com.alternativagame.gui.container.*;
import flash.text.*;
import com.alternativagame.gui.dnd.*;
import com.alternativagame.gui.cursor.*;
import com.alternativagame.gui.skin.window.*;
import com.alternativagame.gui.layout.enums.*;
public class WindowTitleBase extends GUIObject implements ICursorActive, IDrag, IDrop {
private var tf:TextField;
private var titleActiveNormal:TextField;
private var left:Bitmap;
private var _moveable:Boolean;
private var dragable:Boolean;
protected var tab:Container;
private var _parentWindow:WindowBase;
private var right:Bitmap;
private var titleActiveOver:TextField;
private var titleNormalPress:TextField;
private var _active:Boolean;
private var titleNormalNormal:TextField;
private var _titleAlign:uint;
private var _over:Boolean;// = false
private var closeBtn:ImageButton;
private var _closable:Boolean;
private var titleNormalOver:TextField;
private var center:Bitmap;
private var _minimizeable:Boolean;
private var _title:String;
private var minimizeBtn:ImageButton;
private var _pressed:Boolean;// = false
private var titleActivePress:TextField;
private var close:Bitmap;
protected var gfx:Sprite;
protected var skin:WindowTitleSkin;
public function WindowTitleBase(_arg1:Container, _arg2:String=null, _arg3:Boolean=false, _arg4:Boolean=false, _arg5:Boolean=false, _arg6:uint=0){
var tab = _arg1;
var title = _arg2;
var closable = _arg3;
var minimizeable = _arg4;
var active = _arg5;
var align = _arg6;
super();
mouseEnabled = true;
tabChildren = false;
stretchableH = true;
this.tab = tab;
_title = ((title)!=null) ? title : "";
_closable = closable;
_minimizeable = minimizeable;
_active = active;
_titleAlign = align;
dragable = true;
left = new Bitmap();
center = new Bitmap();
right = new Bitmap();
gfx = new Sprite();
gfx.mouseEnabled = false;
var _local8 = gfx;
with (_local8) {
addChild(left);
addChild(center);
addChild(right);
cacheAsBitmap = true;
};
addChild(gfx);
tf = new TextField();
_local8 = tf;
with (_local8) {
autoSize = TextFieldAutoSize.LEFT;
antiAliasType = AntiAliasType.ADVANCED;
embedFonts = true;
selectable = false;
mouseEnabled = false;
text = _title;
};
addChild(tf);
if (_minimizeable){
minimizeBtn = new ImageButton(0, 1);
addChild(minimizeBtn);
minimizeBtn.addEventListener(MouseEvent.MOUSE_DOWN, onMinimizeMouseDown);
};
if (_closable){
closeBtn = new ImageButton(0, 1);
addChild(closeBtn);
closeBtn.addEventListener(MouseEvent.MOUSE_DOWN, onCloseMouseDown);
};
addEventListener(DragEvent.STOP, onTabStopDrag);
addEventListener(DragEvent.DROP, onTabDrop);
}
public function get active():Boolean{
return (_active);
}
private function calcMinWidth():void{
minSize.x = (skin.marginLeft + skin.marginRight);
if (((!((_title == null))) && (!((_title == ""))))){
minSize.x = (minSize.x + Math.round((tf.width - 3)));
};
if (((_closable) || (_minimizeable))){
minSize.x = (minSize.x + skin.space);
if (_closable){
minSize.x = (minSize.x + skin.closeNN.width);
};
if (_minimizeable){
minSize.x = (minSize.x + skin.minimizeNN.width);
};
if (((_closable) && (_minimizeable))){
minSize.x = (minSize.x + skin.controlButtonSpace);
};
};
}
public function get titleAlign():uint{
return (_titleAlign);
}
public function setPressState():void{
_over = false;
_pressed = true;
switchState();
draw(currentSize);
}
public function set active(_arg1:Boolean):void{
_active = _arg1;
if (isSkined){
switchState();
draw(currentSize);
};
}
public function get hint():String{
return (_title);
}
private function state(_arg1:BitmapData, _arg2:BitmapData, _arg3:BitmapData, _arg4:BitmapData, _arg5:BitmapData, _arg6:TextFormat):void{
left.bitmapData = _arg1;
center.bitmapData = _arg2;
right.bitmapData = _arg3;
if (_closable){
closeBtn.normalBitmap = _arg4;
closeBtn.overBitmap = _arg4;
closeBtn.pressBitmap = _arg4;
closeBtn.lockBitmap = _arg4;
};
if (_minimizeable){
minimizeBtn.normalBitmap = _arg5;
minimizeBtn.overBitmap = _arg5;
minimizeBtn.pressBitmap = _arg5;
minimizeBtn.lockBitmap = _arg5;
};
tf.setTextFormat(_arg6);
tf.defaultTextFormat = _arg6;
}
public function set titleAlign(_arg1:uint):void{
_titleAlign = _arg1;
if (isSkined){
drawTitleText();
};
}
public function getDragObject():IDragObject{
return (null);
}
public function get pressed():Boolean{
return (_pressed);
}
public function setNormalState():void{
_over = false;
_pressed = false;
switchState();
draw(currentSize);
}
public function get moveable():Boolean{
return (_moveable);
}
private function onCloseMouseDown(_arg1:MouseEvent):void{
closeBtn.addEventListener(MouseEvent.MOUSE_UP, onCloseMouseUp);
}
private function onCloseMouseUp(_arg1:MouseEvent):void{
closeBtn.removeEventListener(MouseEvent.MOUSE_UP, onCloseMouseUp);
dispatchEvent(new Event(Event.CLOSE));
}
public function set title(_arg1:String):void{
_title = _arg1;
tf.text = _title;
if (isSkined){
calcMinWidth();
repaintCurrentSize();
};
}
private function onTabStopDrag(_arg1:DragEvent):void{
TabbedWindowBase(parentWindow).removeTab(Tab(getDragObject().data));
}
protected function switchState():void{
if (_pressed){
if (active){
state(skin.activePL, skin.activePC, skin.activePR, skin.closeAP, skin.minimizeAP, skin.textFormatAP);
} else {
dispatchEvent(new Event(Event.SELECT));
state(skin.normalPL, skin.normalPC, skin.normalPR, skin.closeNP, skin.minimizeNP, skin.textFormatNP);
};
} else {
if (_over){
if (active){
state(skin.activeOL, skin.activeOC, skin.activeOR, skin.closeAN, skin.minimizeAN, skin.textFormatAO);
} else {
state(skin.normalOL, skin.normalOC, skin.normalOR, skin.closeNN, skin.minimizeNN, skin.textFormatNO);
};
} else {
if (active){
state(skin.activeNL, skin.activeNC, skin.activeNR, skin.closeAN, skin.minimizeAN, skin.textFormatAN);
} else {
state(skin.normalNL, skin.normalNC, skin.normalNR, skin.closeNN, skin.minimizeNN, skin.textFormatNN);
};
};
};
}
private function drawTitleText():void{
var _local1:int;
if (((!((_title == null))) && (!((_title == ""))))){
_local1 = (tf.width - 3);
switch (_titleAlign){
case Align.LEFT:
tf.x = skin.marginLeft;
break;
case Align.CENTER:
tf.x = Math.round(((currentSize.x - _local1) / 2));
break;
case Align.RIGHT:
tf.x = ((currentSize.x - _local1) - skin.marginRight);
break;
};
tf.x = (tf.x - 3);
tf.y = (Math.round(((currentSize.y - (tf.height - 6)) / 2)) - 3);
};
}
private function onMinimizeMouseUp(_arg1:MouseEvent):void{
minimizeBtn.removeEventListener(MouseEvent.MOUSE_UP, onMinimizeMouseUp);
dispatchEvent(new WindowEvent(WindowEvent.MINIMIZE));
}
private function onTabDrop(_arg1:DragEvent):void{
TabbedWindowBase(parentWindow).addTab(Tab(_arg1.dragObject.data));
TabbedWindowBase(parentWindow).setActiveTab(Tab(_arg1.dragObject.data));
}
public function get parentWindow():WindowBase{
return (_parentWindow);
}
override public function draw(_arg1:Point):void{
super.draw(_arg1);
right.x = (_arg1.x - right.width);
center.x = left.width;
center.width = ((_arg1.x - left.width) - right.width);
drawTitleText();
if (((_closable) || (_minimizeable))){
drawControlButtons();
};
}
private function drawControlButtons():void{
if (_closable){
closeBtn.x = ((currentSize.x - skin.closeNN.width) - skin.marginRight);
closeBtn.y = ((currentSize.y - skin.closeNN.height) >>> 1);
};
if (_minimizeable){
minimizeBtn.x = ((currentSize.x - skin.minimizeNN.width) - skin.marginRight);
if (_closable){
minimizeBtn.x = (minimizeBtn.x - (closeBtn.width + skin.controlButtonSpace));
};
minimizeBtn.y = ((currentSize.y - skin.minimizeNN.height) >>> 1);
};
}
protected function getSkinType():Class{
return (WindowTitleBase);
}
public function get cursor():uint{
var _local1:uint = (active) ? Cursor.MOVE : Cursor.ACTIVE;
return (_local1);
}
public function setOverState():void{
_over = true;
_pressed = false;
switchState();
draw(currentSize);
}
public function get title():String{
return (_title);
}
public function isDragable():Boolean{
return (dragable);
}
private function onMinimizeMouseDown(_arg1:MouseEvent):void{
minimizeBtn.addEventListener(MouseEvent.MOUSE_UP, onMinimizeMouseUp);
}
override public function updateSkin():void{
skin = WindowTitleSkin(skinManager.getSkin(getSkinType()));
super.updateSkin();
switchState();
minSize.y = skin.activeNC.height;
tf.thickness = skin.titleThickness;
tf.sharpness = skin.titleSharpness;
calcMinWidth();
}
public function set moveable(_arg1:Boolean):void{
if (_moveable != _arg1){
_moveable = _arg1;
if (_moveable){
if (active){
parentWindow.moveArea = this;
};
} else {
if (active){
parentWindow.moveArea = null;
};
};
};
}
public function set parentWindow(_arg1:WindowBase):void{
_parentWindow = _arg1;
}
public function canDrop(_arg1:IDragObject):Boolean{
return (false);
}
}
}//package com.alternativagame.gui.window
Section 374
//AlternativaFont (com.alternativagame.init.AlternativaFont)
package com.alternativagame.init {
import flash.text.*;
import com.alternativagame.kernel.*;
public class AlternativaFont {
private static const ttfBold:Class = AlternativaFont_ttfBold;
private static const ttfNormal:Class = AlternativaFont_ttfNormal;
public static function init():void{
Font.registerFont(ttfNormal);
Font.registerFont(ttfBold);
Dispatcher.writeConsole("Шрифт Alternativa проинициализирован");
}
}
}//package com.alternativagame.init
Section 375
//AlternativaFont_ttfBold (com.alternativagame.init.AlternativaFont_ttfBold)
package com.alternativagame.init {
import mx.core.*;
public class AlternativaFont_ttfBold extends FontAsset {
}
}//package com.alternativagame.init
Section 376
//AlternativaFont_ttfNormal (com.alternativagame.init.AlternativaFont_ttfNormal)
package com.alternativagame.init {
import mx.core.*;
public class AlternativaFont_ttfNormal extends FontAsset {
}
}//package com.alternativagame.init
Section 377
//GUI (com.alternativagame.init.GUI)
package com.alternativagame.init {
import flash.display.*;
import com.alternativagame.kernel.*;
import com.alternativagame.gui.cursor.*;
import com.alternativagame.gui.icon.*;
public class GUI {
public static function init(_arg1:DisplayObjectContainer=null):void{
Cursor.init(((_arg1)==null) ? Dispatcher.cursor : _arg1);
GlobalIcon.init();
Dispatcher.writeConsole("Библиотека GUI проинициализирована");
}
}
}//package com.alternativagame.init
Section 378
//ClassData (com.alternativagame.kernel.ClassData)
package com.alternativagame.kernel {
import com.alternativagame.type.*;
import com.alternativagame.object.*;
import com.alternativagame.text.*;
import flash.system.*;
public class ClassData {
private var _name:String;
private var params:Array;
private var models:Array;
private var type:Class;
public function ClassData(_arg1:String, _arg2:Array, _arg3:Array=null){
var _local4:uint;
var _local6:Class;
var _local7:Short;
var _local8:String;
super();
_name = _arg1;
this.models = _arg2;
this.type = Class(ApplicationDomain.currentDomain.getDefinition(_arg1));
this.params = new Array();
var _local5:uint = _arg2.length;
_local4 = 0;
while (_local4 < _local5) {
_local6 = Code.getParams(_arg2[_local4]);
this.params[_arg2[_local4]] = ((_local6)==null) ? null : new (_local6);
_local4++;
};
if (_arg3 != null){
_local5 = _arg3.length;
_local4 = 0;
while (_local4 < _local5) {
_local7 = new Short(_arg3[_local4]);
_local8 = Code.getModelName(_local7);
if (_local8 != null){
if (this.params[_local7] != null){
IModelParams(this.params[_local7]).parse(_arg3[(_local4 + 1)]);
Dispatcher.writeConsole(TextUtils.insertVars(ConsoleText.PARSE_PARAMS, _local8, this.params[_local7]));
} else {
Dispatcher.writeConsole(TextUtils.insertVars(ConsoleText.MODEL_HAS_NO_PARAMS, _local8));
};
} else {
Dispatcher.writeConsole(TextUtils.insertVars(ConsoleText.MODEL_NOT_FOUND, _local7.value), 0xFF0000);
};
_local4 = (_local4 + 2);
};
};
}
public function get name():String{
return (_name);
}
public function createObject(_arg1:Long, _arg2:Array=null):IObject{
var _local5:uint;
var _local7:IModelParams;
var _local8:String;
var _local9:Short;
var _local3:IObject = new type();
Dispatcher.registerObject(_local3, _arg1);
var _local4:Array = new Array();
var _local6:uint = _arg2.length;
_local5 = 0;
while (_local5 < _local6) {
_local4[_arg2[_local5]] = _arg2[(_local5 + 1)];
_local5 = (_local5 + 2);
};
_local5 = 0;
while (_local5 < models.length) {
_local9 = models[_local5];
_local8 = Code.getModelName(_local9);
if (_local8 != null){
if (this.params[_local9] != null){
_local7 = IModelParams(this.params[_local9]);
if (_local4[_local9] != undefined){
_local7 = _local7.clone();
_local7.parse(_local4[_local9]);
Dispatcher.writeConsole(TextUtils.insertVars(ConsoleText.PARSE_PARAMS, _local8, _local7));
};
};
if (Object(_local3).hasOwnProperty(("init" + _local8))){
if (this.params[_local9] != null){
_local3[("init" + _local8)].apply(_local3, [_local7]);
} else {
_local3[("init" + _local8)].apply(_local3);
};
} else {
Dispatcher.writeConsole(TextUtils.insertVars(ConsoleText.OBJECT_MODEL_INIT_NOT_FOUND, _local8, _arg1, name), 0xFF0000);
};
} else {
Dispatcher.writeConsole(TextUtils.insertVars(ConsoleText.MODEL_NOT_FOUND, _local9), 0xFF0000);
};
_local5++;
};
return (_local3);
}
}
}//package com.alternativagame.kernel
Section 379
//Code (com.alternativagame.kernel.Code)
package com.alternativagame.kernel {
import com.alternativagame.type.*;
public final class Code {
private static var method:Array = new Array();
private static var params:Array = new Array();
private static var model:Array = new Array();
public static function getModelCode(_arg1:String):Short{
var _local2:int = model.indexOf(_arg1);
return (((_local2)>=0) ? new Short(_local2) : null);
}
public static function registerMethod(_arg1:uint, _arg2:uint, _arg3:String):void{
method[((_arg1 << 8) + _arg2)] = _arg3;
}
public static function getMethodCode(_arg1:Short, _arg2:String):Byte{
var _local3 = -1;
do {
_local3 = method.indexOf(_arg2, (_local3 + 1));
} while ((((_local3 >= 0)) && (!(((_local3 >> 8) == _arg1.value)))));
return (((_local3)>=0) ? new Byte((_local3 & 0xFF)) : null);
}
public static function registerModel(_arg1:uint, _arg2:String):void{
model[_arg1] = _arg2;
}
public static function getMethodName(_arg1:Short, _arg2:Byte):String{
return (((method[((_arg1.value << 8) + _arg2.value)])!=undefined) ? method[((_arg1.value << 8) + _arg2.value)] : null);
}
public static function registerParams(_arg1:uint, _arg2:Class):void{
params[_arg1] = _arg2;
}
public static function getParams(_arg1:Short):Class{
return (((params[_arg1.value])!=undefined) ? params[_arg1.value] : null);
}
public static function getModelName(_arg1:Short):String{
return (((model[_arg1.value])!=undefined) ? model[_arg1.value] : null);
}
}
}//package com.alternativagame.kernel
Section 380
//Dispatcher (com.alternativagame.kernel.Dispatcher)
package com.alternativagame.kernel {
import flash.events.*;
import com.alternativagame.type.*;
import flash.display.*;
import com.alternativagame.model.kernel.*;
import com.alternativagame.object.*;
import com.alternativagame.resource.*;
import com.alternativagame.net.events.*;
import com.alternativagame.net.command.*;
import com.alternativagame.net.*;
import flash.utils.*;
import com.alternativagame.admin.*;
import com.alternativagame.text.*;
import flash.system.*;
public final class Dispatcher extends SimpleObject implements IDispatcherModel, IParentModel {
private var timer:int;
public var resourcesURL:String;
private var objects:Array;
private var resources:Array;
private var classes:Array;
private var connection:NetClient;
private var info:Array;
public static var cursor:DisplayObjectContainer;
private static var console:Console;
public static var canvas:DisplayObjectContainer;
private static var instance:Dispatcher;
private static var fps:FPS;
public function Dispatcher(){
classes = new Array();
objects = new Array();
info = new Array();
resources = new Array();
}
public function unloadObject(_arg1:Long):void{
var _local2:IObject = getObject(_arg1);
if (_local2 != null){
writeConsole(TextUtils.insertVars(ConsoleText.OBJECT_UNLOADED, _arg1));
objects[_arg1].dispose();
unregisterObject(_arg1);
};
}
private function onIOError(_arg1:IOErrorEvent):void{
writeConsole(ConsoleText.SERVER_UNAVAILABLE, 0xFF0000);
}
public function initDispatcher():void{
}
private function onSend(_arg1:NetClientEvent):void{
var _local2:CommandZero = CommandZero(_arg1.command);
var _local3:String = _local2.params.join(", ");
writeConsole(TextUtils.insertVars(ConsoleText.SEND_COMMAND, _local2.id, Code.getModelName(_local2.model), Code.getMethodName(_local2.model, _local2.method), _local3, (getTimer() - timer)), 153);
timer = getTimer();
}
private function onConnect(_arg1:Event):void{
writeConsole(ConsoleText.CONNECTED);
timer = getTimer();
}
public function setObjectInfo(_arg1:Long, _arg2:String):void{
info[_arg1] = _arg2;
}
public function remove(_arg1:IChildModel):void{
canvas.removeChild(DisplayObject(_arg1));
}
public function initParent():void{
}
private function onDisconnect(_arg1:Event):void{
console.show();
writeConsole(ConsoleText.DISCONNECTED, 0xFF0000);
connection = null;
}
public function loadObject(_arg1:Long, _arg2:Long, _arg3:Array=null):void{
var _local4:IObject;
if (classes[_arg2] != undefined){
_local4 = ClassData(classes[_arg2]).createObject(_arg1, _arg3);
writeConsole(TextUtils.insertVars(ConsoleText.OBJECT_LOADED, _arg1));
} else {
writeConsole(TextUtils.insertVars(ConsoleText.CLASS_NOT_LOADED, _arg1), 0xFF0000);
};
}
public function loadClassAndObject(_arg1:Long, _arg2:Long, _arg3:String, _arg4:Array, _arg5:Array=null, _arg6:Array=null):void{
if (ApplicationDomain.currentDomain.hasDefinition(_arg3)){
if (classes[_arg1] == undefined){
registerClass(new ClassData(_arg3, _arg4, _arg5), _arg1);
writeConsole(TextUtils.insertVars(ConsoleText.CLASS_LOADED, _arg3, _arg1));
loadObject(_arg2, _arg1, _arg6);
} else {
writeConsole(TextUtils.insertVars(ConsoleText.CLASS_ALREADY_LOADED, _arg3, _arg1), 0xFF0000);
};
} else {
writeConsole(TextUtils.insertVars(ConsoleText.CLASS_NOT_FOUND, _arg3), 0xFF0000);
};
}
public function loadResource(_arg1:Long, _arg2:int, _arg3:Byte):void{
var _local4:Class;
var _local5:IResource;
var _local6:String;
switch (_arg3.value){
case 0:
_local4 = LibraryResource;
break;
default:
_local4 = null;
};
if (_local4 != null){
_local5 = new (_local4);
registerResource(_local5, _arg1);
_local6 = makeResourceUrl(_arg1, _arg2);
writeConsole(TextUtils.insertVars(ConsoleText.LOADING_RESOURCE, _local5.name, _arg1, _arg2, _local6));
_local5.load(_local6);
} else {
writeConsole(TextUtils.insertVars(ConsoleText.RESOURCE_TYPE_NOT_DESCRIBED, _arg3), 0xFF0000);
};
}
public function updateClass(_arg1:Long, _arg2:Array=null):void{
}
public function add(_arg1:IChildModel):void{
canvas.addChild(DisplayObject(_arg1));
}
public function unloadResources(_arg1:Array):void{
var _local3:IResource;
var _local2:uint = _arg1.length;
var _local4:uint;
while (_local4 < _local2) {
_local3 = getResource(_arg1[_local4]);
writeConsole(TextUtils.insertVars(ConsoleText.RESOURCE_UNLOADED, _local3.name, _local3.id));
_local3.unload();
unregisterResource(Long(_arg1[_local4]));
_local4++;
};
}
private function invokeMethod(_arg1:ICommand):void{
var modelName:String;
var method:String;
var stackTrace:String;
var command = _arg1;
var c:CommandZero = CommandZero(command);
var object:IObject = getObject(c.id);
if (object != null){
modelName = Code.getModelName(c.model);
if (modelName != null){
method = Code.getMethodName(c.model, c.method);
if (method != null){
if (Object(object).hasOwnProperty(method)){
writeConsole(TextUtils.insertVars(ConsoleText.INVOKED_METHOD, method, Code.getModelName(c.model)), 0x9999);
try {
object[method].apply(object, c.params);
} catch(error:Error) {
console.show();
stackTrace = error.getStackTrace();
if (stackTrace != null){
writeConsole(stackTrace, 0xFF0000);
} else {
writeConsole(error, 0xFF0000);
};
};
} else {
writeConsole(TextUtils.insertVars(ConsoleText.METHOD_NOT_FOUND, method, c.id), 0xFF0000);
};
} else {
writeConsole(TextUtils.insertVars(ConsoleText.METHOD_NOT_DESCRIBED, modelName, c.method.value), 0xFF0000);
};
} else {
writeConsole(TextUtils.insertVars(ConsoleText.MODEL_NOT_FOUND, c.model.value), 0xFF0000);
};
};
}
private function onRecieve(_arg1:NetClientEvent):void{
var _local2:CommandZero = CommandZero(_arg1.command);
var _local3:String = _local2.params.join(", ");
writeConsole(TextUtils.insertVars(ConsoleText.RECIEVE_COMMAND, _local2.id, Code.getModelName(_local2.model), Code.getMethodName(_local2.model, _local2.method), _local3, (getTimer() - timer)), 0x9900);
timer = getTimer();
invokeMethod(_arg1.command);
}
public function unloadClasses(_arg1:Array):void{
var _local2:uint = _arg1.length;
var _local3:uint;
while (_local3 < _local2) {
writeConsole(TextUtils.insertVars(ConsoleText.CLASS_UNLOADED, ClassData(classes[_arg1[_local3]]).name, _arg1[_local3]));
unregisterClass(Long(_arg1[_local3]));
_local3++;
};
}
public static function registerObject(_arg1:IObject, _arg2:Long):void{
instance.objects[_arg2] = _arg1;
_arg1.id = _arg2;
}
public static function getObjectInfo(_arg1:Long):String{
if (instance.info[_arg1] == undefined){
writeConsole(TextUtils.insertVars(ConsoleText.OBJECT_INFO_NOT_FOUND, _arg1), 0xFF0000);
return (null);
};
return (instance.info[_arg1]);
}
public static function getResource(_arg1:Long):IResource{
if (instance.resources[_arg1] == undefined){
writeConsole(TextUtils.insertVars(ConsoleText.RESOURCE_NOT_FOUND, _arg1), 0xFF0000);
return (null);
};
return (instance.resources[_arg1]);
}
public static function registerResource(_arg1:IResource, _arg2:Long):void{
instance.resources[_arg2] = _arg1;
_arg1.id = _arg2;
}
public static function resourceLoadError(_arg1:Long):void{
writeConsole(TextUtils.insertVars(ConsoleText.RESOURCE_LOAD_ERROR, getResource(_arg1).name, _arg1), 0xFF0000);
}
public static function registerClass(_arg1:ClassData, _arg2:Long):void{
instance.classes[_arg2] = _arg1;
}
public static function unregisterObject(_arg1:Long):void{
delete instance.objects[_arg1];
}
public static function unregisterClass(_arg1:Long):void{
delete instance.classes[_arg1];
}
public static function sendCommand(_arg1:Object, _arg2:Short, _arg3:Byte, ... _args):void{
var _local5:CommandZero;
if (instance.connection != null){
_local5 = new CommandZero();
_local5.id = IObject(_arg1).id;
_local5.model = _arg2;
_local5.method = _arg3;
_local5.params = _args;
instance.connection.sendCommand(_local5);
};
}
public static function connect(_arg1:String, _arg2:String, _arg3:uint, _arg4:String):void{
instance.connection = new NetClient(_arg2, _arg3);
instance.resourcesURL = _arg4;
var _local5:NetClient = instance.connection;
_local5.addEventListener(NetClientEvent.RECIEVE, instance.onRecieve);
_local5.addEventListener(NetClientEvent.SEND, instance.onSend);
_local5.socket.addEventListener(Event.CONNECT, instance.onConnect);
_local5.socket.addEventListener(Event.CLOSE, instance.onDisconnect);
_local5.socket.addEventListener(IOErrorEvent.IO_ERROR, instance.onIOError);
}
public static function sendCustomCommand(_arg1:Long, _arg2:Short, _arg3:Byte, _arg4:Array):void{
var _local5:CommandZero;
if (instance.connection != null){
_local5 = new CommandZero();
_local5.id = _arg1;
_local5.model = _arg2;
_local5.method = _arg3;
_local5.params = _arg4;
instance.connection.sendCommand(_local5);
};
}
public static function resourceLoaded(_arg1:Long, _arg2:uint):void{
writeConsole(TextUtils.insertVars(ConsoleText.RESOURCE_LOADED, getResource(_arg1).name, _arg1));
FPS.addDownloadBytes(_arg2);
DispatcherModel.loadResourceComplete(instance, _arg1);
}
public static function getObject(_arg1:Long):IObject{
if (instance.objects[_arg1] == undefined){
writeConsole(TextUtils.insertVars(ConsoleText.OBJECT_NOT_FOUND, _arg1), 0xFF0000);
return (null);
};
return (instance.objects[_arg1]);
}
public static function writeConsole(... _args):void{
if (console != null){
if (_args.length > 1){
console.write(_args[0], _args[1]);
} else {
console.write(_args[0], 0x666666);
};
} else {
trace(_args[0]);
};
}
public static function unregisterResource(_arg1:Long):void{
delete instance.resources[_arg1];
}
public static function makeResourceUrl(_arg1:Long, _arg2:int):String{
var _local3:String = (instance.resourcesURL + _arg1.hi.toString(16));
_local3 = (_local3 + ("/" + (_arg1.lo >>> 16).toString(16)));
_local3 = (_local3 + ("/" + ((_arg1.lo << 16) >>> 24).toString(16)));
_local3 = (_local3 + ("/" + ((_arg1.lo << 24) >>> 24).toString(16)));
_local3 = (_local3 + (("/" + _arg2.toString()) + "/"));
return (_local3);
}
public static function create(_arg1:DisplayObjectContainer):void{
if (instance == null){
instance = new (Dispatcher);
registerObject(instance, new Long(1, 0));
canvas = new Sprite();
_arg1.addChild(canvas);
console = new Console();
registerObject(console, new Long(8, 0));
_arg1.addChild(console);
console.initConsole();
cursor = new Sprite();
_arg1.addChild(cursor);
};
}
}
}//package com.alternativagame.kernel
Section 381
//IModelParams (com.alternativagame.kernel.IModelParams)
package com.alternativagame.kernel {
public interface IModelParams {
function parse(_arg1:Array):void;
function toString():String;
function clone():IModelParams;
}
}//package com.alternativagame.kernel
Section 382
//IConsoleModel (com.alternativagame.model.admin.IConsoleModel)
package com.alternativagame.model.admin {
public interface IConsoleModel {
function initConsole():void;
function write(_arg1:String, _arg2:int):void;
}
}//package com.alternativagame.model.admin
Section 383
//ChildParams (com.alternativagame.model.kernel.ChildParams)
package com.alternativagame.model.kernel {
import com.alternativagame.type.*;
import com.alternativagame.kernel.*;
public class ChildParams implements IModelParams {
public var parentId:Long;
public function parse(_arg1:Array):void{
var _local2:uint = _arg1.length;
var _local3:uint;
while (_local3 < _local2) {
switch (_arg1[_local3].value){
case 1:
parentId = Long(_arg1[(_local3 + 1)]);
break;
};
_local3 = (_local3 + 2);
};
}
public function toString():String{
var _local1 = "";
_local1 = (_local1 + ("parentId = " + parentId));
return (_local1);
}
public function clone():IModelParams{
var _local1:ChildParams = new ChildParams();
_local1.parentId = parentId;
return (_local1);
}
}
}//package com.alternativagame.model.kernel
Section 384
//DispatcherModel (com.alternativagame.model.kernel.DispatcherModel)
package com.alternativagame.model.kernel {
import com.alternativagame.type.*;
import com.alternativagame.kernel.*;
public final class DispatcherModel {
public static function getObjectInfo(_arg1:IDispatcherModel, _arg2:Long):void{
Dispatcher.sendCommand(_arg1, new Short(1), new Byte(100), _arg2);
}
public static function loadResourceComplete(_arg1:IDispatcherModel, _arg2:Long):void{
Dispatcher.sendCommand(_arg1, new Short(1), new Byte(4), _arg2);
}
public static function registerModel():void{
Code.registerModel(1, "Dispatcher");
Code.registerMethod(1, 4, "loadResourceComplete");
Code.registerMethod(1, 100, "getObjectInfo");
Code.registerMethod(1, 9, "loadClassAndObject");
Code.registerMethod(1, 7, "loadObject");
Code.registerMethod(1, 10, "updateClass");
Code.registerMethod(1, 6, "loadResource");
Code.registerMethod(1, 8, "unloadObject");
Code.registerMethod(1, 12, "unloadClasses");
Code.registerMethod(1, 11, "unloadResources");
Code.registerMethod(1, 101, "setObjectInfo");
}
}
}//package com.alternativagame.model.kernel
Section 385
//IChildModel (com.alternativagame.model.kernel.IChildModel)
package com.alternativagame.model.kernel {
import com.alternativagame.type.*;
public interface IChildModel {
function changeParent(_arg1:Long):void;
function initChild(_arg1:ChildParams):void;
}
}//package com.alternativagame.model.kernel
Section 386
//IDispatcherModel (com.alternativagame.model.kernel.IDispatcherModel)
package com.alternativagame.model.kernel {
import com.alternativagame.type.*;
public interface IDispatcherModel {
function setObjectInfo(_arg1:Long, _arg2:String):void;
function loadResource(_arg1:Long, _arg2:int, _arg3:Byte):void;
function loadObject(_arg1:Long, _arg2:Long, _arg3:Array=null):void;
function unloadResources(_arg1:Array):void;
function unloadClasses(_arg1:Array):void;
function initDispatcher():void;
function loadClassAndObject(_arg1:Long, _arg2:Long, _arg3:String, _arg4:Array, _arg5:Array=null, _arg6:Array=null):void;
function unloadObject(_arg1:Long):void;
function updateClass(_arg1:Long, _arg2:Array=null):void;
}
}//package com.alternativagame.model.kernel
Section 387
//IParentModel (com.alternativagame.model.kernel.IParentModel)
package com.alternativagame.model.kernel {
public interface IParentModel {
function add(_arg1:IChildModel):void;
function initParent():void;
function remove(_arg1:IChildModel):void;
}
}//package com.alternativagame.model.kernel
Section 388
//CommandZero (com.alternativagame.net.command.CommandZero)
package com.alternativagame.net.command {
import com.alternativagame.type.*;
import com.alternativagame.kernel.*;
public class CommandZero implements ICommand {
public var method:Byte;
public var params:Array;
public var model:Short;
public var id:Long;
private var iteration:int;
public function ident():Long{
return (id);
}
public function toString():String{
var _local1 = (((("ID: " + id.toString()) + "\rModel: ") + Code.getModelName(model)) + "\rMethod: ");
var _local2:String = Code.getMethodName(model, method);
if (_local2 != null){
_local1 = (_local1 + _local2);
} else {
_local1 = (_local1 + method.toString());
};
_local1 = (_local1 + ("\rParams:\r" + paramToString(1, params)));
return (_local1);
}
private function paramToString(_arg1:int, _arg2:Object, _arg3:String=null):String{
var _local7:String;
var _local4 = "";
var _local5:int;
while (_local5 < _arg1) {
_local4 = (_local4 + "\t");
_local5++;
};
var _local6:String = _local4;
if (_arg3 != null){
_local6 = (_local6 + (("[" + _arg3) + "] "));
};
if ((_arg2 is String)){
_local6 = (_local6 + (_arg2 + " (String)\r"));
} else {
if ((_arg2 is Boolean)){
_local6 = (_local6 + (_arg2.toString() + " (Boolean)\r"));
} else {
if ((_arg2 is Byte)){
_local6 = (_local6 + (_arg2.toString() + " (Byte)\r"));
} else {
if ((_arg2 is Long)){
_local6 = (_local6 + (_arg2.toString() + " (Long)\r"));
} else {
if ((_arg2 is Short)){
_local6 = (_local6 + (_arg2.toString() + " (Short)\r"));
} else {
if ((_arg2 is int)){
_local6 = (_local6 + (_arg2.toString() + " (Int)\r"));
} else {
if ((_arg2 is Number)){
_local6 = (_local6 + (_arg2.toString() + " (Double)\r"));
} else {
if ((_arg2 is Array)){
_local6 = (_local6 + "Array/List:\r");
} else {
_local6 = (_local6 + "Map:\r");
};
for (_local7 in _arg2) {
_local6 = (_local6 + paramToString((_arg1 + 1), _arg2[_local7], _local7));
};
};
};
};
};
};
};
};
return (_local6);
}
}
}//package com.alternativagame.net.command
Section 389
//ICommand (com.alternativagame.net.command.ICommand)
package com.alternativagame.net.command {
import com.alternativagame.type.*;
public interface ICommand {
function ident():Long;
function toString():String;
}
}//package com.alternativagame.net.command
Section 390
//NetClientEvent (com.alternativagame.net.events.NetClientEvent)
package com.alternativagame.net.events {
import flash.events.*;
import com.alternativagame.net.command.*;
public class NetClientEvent extends Event {
public var command:ICommand;
public static const SEND:String = "send";
public static const RECIEVE:String = "recieve";
public function NetClientEvent(_arg1:String, _arg2:ICommand){
super(_arg1);
this.command = _arg2;
}
}
}//package com.alternativagame.net.events
Section 391
//CommandZeroEncoder (com.alternativagame.net.protocol.encoder.command.CommandZeroEncoder)
package com.alternativagame.net.protocol.encoder.command {
import com.alternativagame.type.*;
import com.alternativagame.net.command.*;
import flash.net.*;
import com.alternativagame.net.*;
import com.alternativagame.net.protocol.encoder.helpers.*;
import com.alternativagame.net.protocol.encoder.*;
import com.alternativagame.net.protocol.encoder.helpers.impl.*;
public class CommandZeroEncoder implements IEncoder {
public function encode(_arg1:NetClient, _arg2:Object, _arg3:Socket):void{
var _local4:CommandZero = CommandZero(_arg2);
_arg1.sendObject(new Byte(0));
_arg1.sendObject(_local4.id);
_arg1.sendObject(_local4.model);
_arg1.sendObject(_local4.method);
_arg1.sendObject(new ListHelper(LENGTH.BYTE, _local4.params));
}
}
}//package com.alternativagame.net.protocol.encoder.command
Section 392
//ArrayHelper (com.alternativagame.net.protocol.encoder.helpers.impl.ArrayHelper)
package com.alternativagame.net.protocol.encoder.helpers.impl {
import com.alternativagame.net.protocol.encoder.helpers.*;
import com.alternativagame.net.protocol.*;
public class ArrayHelper extends StructuredHelper {
private var array_value:Array;
private var child_value:ITBTYPE;
public function ArrayHelper(_arg1:LENGTH, _arg2:Array, _arg3:ITBTYPE){
super(_arg1, ITBTYPE.SARRAY);
this.array_value = _arg2;
this.child_value = _arg3;
}
override public function get size():int{
return (this.array.length);
}
public function get child():ITBTYPE{
return (this.child_value);
}
public function get array():Array{
return (this.array_value);
}
}
}//package com.alternativagame.net.protocol.encoder.helpers.impl
Section 393
//ListHelper (com.alternativagame.net.protocol.encoder.helpers.impl.ListHelper)
package com.alternativagame.net.protocol.encoder.helpers.impl {
import com.alternativagame.net.protocol.encoder.helpers.*;
import com.alternativagame.net.protocol.*;
public class ListHelper extends StructuredHelper {
private var array_value:Array;
public function ListHelper(_arg1:LENGTH, _arg2:Array){
super(_arg1, ITBTYPE.SLIST);
this.array_value = _arg2;
}
public function get array():Array{
return (this.array_value);
}
override public function get size():int{
return (this.array.length);
}
}
}//package com.alternativagame.net.protocol.encoder.helpers.impl
Section 394
//MapHelper (com.alternativagame.net.protocol.encoder.helpers.impl.MapHelper)
package com.alternativagame.net.protocol.encoder.helpers.impl {
import com.alternativagame.net.protocol.encoder.helpers.*;
import com.alternativagame.net.protocol.*;
public class MapHelper extends StructuredHelper {
private var count:int;
public var value:ITBTYPE;
private var array_value:Object;
public var key:ITBTYPE;
public function MapHelper(_arg1:LENGTH, _arg2:int, _arg3:Object, _arg4:ITBTYPE, _arg5:ITBTYPE){
super(_arg1, ITBTYPE.SMAP);
this.array_value = _arg3;
this.key = _arg4;
this.value = _arg5;
this.count = _arg2;
}
override public function get size():int{
return (this.count);
}
public function get array():Object{
return (this.array_value);
}
}
}//package com.alternativagame.net.protocol.encoder.helpers.impl
Section 395
//StringHelper (com.alternativagame.net.protocol.encoder.helpers.impl.StringHelper)
package com.alternativagame.net.protocol.encoder.helpers.impl {
import com.alternativagame.net.protocol.encoder.helpers.*;
import com.alternativagame.net.protocol.*;
import flash.utils.*;
public class StringHelper extends StructuredHelper {
private var string_value:String;
public function StringHelper(_arg1:LENGTH, _arg2:String){
super(_arg1, ITBTYPE.SS);
this.string_value = _arg2;
}
override public function get size():int{
var _local1:ByteArray = new ByteArray();
_local1.writeUTFBytes(value);
return (_local1.length);
}
public function get value():String{
return (this.string_value);
}
}
}//package com.alternativagame.net.protocol.encoder.helpers.impl
Section 396
//HelperFactory (com.alternativagame.net.protocol.encoder.helpers.HelperFactory)
package com.alternativagame.net.protocol.encoder.helpers {
import com.alternativagame.type.*;
import com.alternativagame.net.protocol.*;
import flash.utils.*;
import com.alternativagame.net.protocol.encoder.helpers.impl.*;
public class HelperFactory {
public static var instance:HelperFactory = new (HelperFactory);
;
private function arrayTypes(_arg1:Array):IHelper{
var _local5:Object;
var _local6:IHelper;
var _local2:Boolean;
var _local3:String;
var _local4:Boolean;
for each (_local5 in _arg1) {
if (!_local4){
_local2 = ((_local2) && ((getQualifiedClassName(_local5) == _local3)));
} else {
_local3 = getQualifiedClassName(_local5);
_local4 = false;
};
if (!_local2){
break;
};
};
_local6 = null;
if ((((_arg1.length > 0)) && (_local2))){
_local6 = new ArrayHelper(LENGTH.makeType(_arg1.length), _arg1, helperFor(_arg1[0]).itb);
} else {
_local6 = new ListHelper(LENGTH.makeType(_arg1.length), _arg1);
};
return (_local6);
}
private function primitiveTypes(_arg1:Object):IHelper{
var _local2:PrimitiveHelper;
var _local3:ITBTYPE;
if ((_arg1 is Byte)){
_local3 = ITBTYPE.BYTE;
} else {
if ((_arg1 is Short)){
_local3 = ITBTYPE.SHORT;
} else {
if ((_arg1 is int)){
_local3 = ITBTYPE.INT;
} else {
if ((_arg1 is Long)){
_local3 = ITBTYPE.LONG;
} else {
if ((_arg1 is Double)){
_local3 = ITBTYPE.DOUBLE;
} else {
if ((_arg1 is Boolean)){
_local3 = ITBTYPE.BOOLEAN;
};
};
};
};
};
};
if (_local3 != null){
_local2 = new PrimitiveHelper(_local3, _arg1);
};
return (_local2);
}
public function helperFor(_arg1:Object):IHelper{
var _local3:int;
var _local4:Object;
var _local5:ITBTYPE;
var _local6:ITBTYPE;
var _local7:String;
var _local2:IHelper;
if ((_arg1 is Array)){
_local2 = arrayTypes((_arg1 as Array));
} else {
_local2 = primitiveTypes(_arg1);
};
if ((((_local2 == null)) && ((getQualifiedClassName(_arg1) == "Object")))){
_local3 = 0;
for (_local4 in _arg1) {
_local3++;
};
for (_local4 in _arg1) {
_local5 = helperFor(_local4).itb;
_local6 = helperFor(_arg1[_local4]).itb;
_local2 = new MapHelper(LENGTH.makeType(_local3), _local3, _arg1, _local5, _local6);
break;
};
};
if ((((_local2 == null)) && ((_arg1 is String)))){
_local7 = String(_arg1);
_local2 = new StringHelper(LENGTH.makeType(_local7.length), _local7);
};
return (_local2);
}
}
}//package com.alternativagame.net.protocol.encoder.helpers
Section 397
//IHelper (com.alternativagame.net.protocol.encoder.helpers.IHelper)
package com.alternativagame.net.protocol.encoder.helpers {
import com.alternativagame.net.protocol.*;
public interface IHelper {
function get itb():ITBTYPE;
}
}//package com.alternativagame.net.protocol.encoder.helpers
Section 398
//LENGTH (com.alternativagame.net.protocol.encoder.helpers.LENGTH)
package com.alternativagame.net.protocol.encoder.helpers {
import com.alternativagame.type.*;
import flash.net.*;
import com.alternativagame.admin.*;
public class LENGTH {
private var ordinal_value:int;
public static const SHORT:LENGTH = new LENGTH(1);
;
public static const BYTE:LENGTH = new LENGTH(0);
;
public static const LONG:LENGTH = new LENGTH(2);
;
public function LENGTH(_arg1:int){
this.ordinal_value = _arg1;
}
public function get ordinal():int{
return (ordinal_value);
}
public function getLength(_arg1:int):Object{
var _local2:Object;
switch (ordinal){
case 0:
_arg1 = ((_arg1)>127) ? ((-(_arg1) ^ 0xFF) + 1) : _arg1;
_local2 = new Byte(_arg1);
break;
case 1:
_arg1 = ((_arg1)>32767) ? ((-(_arg1) ^ 0xFFFF) + 1) : _arg1;
_local2 = new Short(_arg1);
break;
case 2:
_local2 = _arg1;
break;
};
return (_local2);
}
public static function makeType(_arg1:int):LENGTH{
var _local2:LENGTH = LENGTH.LONG;
if (_arg1 < 0xFF){
_local2 = LENGTH.BYTE;
} else {
if (_arg1 < 0xFFFF){
_local2 = LENGTH.SHORT;
};
};
return (_local2);
}
public static function readSize(_arg1:Socket, _arg2:int):int{
var _local3 = -1;
switch (_arg2){
case 1:
_local3 = _arg1.readUnsignedByte();
break;
case 2:
_local3 = _arg1.readUnsignedShort();
break;
case 4:
_local3 = _arg1.readInt();
break;
};
FPS.addSocketInBytes(_arg2);
return (_local3);
}
}
}//package com.alternativagame.net.protocol.encoder.helpers
Section 399
//PrimitiveHelper (com.alternativagame.net.protocol.encoder.helpers.PrimitiveHelper)
package com.alternativagame.net.protocol.encoder.helpers {
import com.alternativagame.net.protocol.*;
public class PrimitiveHelper implements IHelper {
private var itb_value:ITBTYPE;
private var obj_value:Object;
public function PrimitiveHelper(_arg1:ITBTYPE, _arg2:Object){
this.itb_value = _arg1;
this.obj_value = _arg2;
}
public function get obj():Object{
return (this.obj_value);
}
public function get itb():ITBTYPE{
return (this.itb_value);
}
}
}//package com.alternativagame.net.protocol.encoder.helpers
Section 400
//StructuredHelper (com.alternativagame.net.protocol.encoder.helpers.StructuredHelper)
package com.alternativagame.net.protocol.encoder.helpers {
import com.alternativagame.net.protocol.*;
public class StructuredHelper implements IHelper {
private var length_type:LENGTH;
private var baseITB:ITBTYPE;
private var itb_value:ITBTYPE;// = null
public function StructuredHelper(_arg1:LENGTH, _arg2:ITBTYPE){
this.length_type = _arg1;
this.baseITB = _arg2;
this.itb_value = ITBTYPE.getITBType((_arg1.ordinal + _arg2.ordinal));
}
public function get size():int{
return (0);
}
public function get length():Object{
return (length_type.getLength(this.size));
}
public function get itb():ITBTYPE{
return (itb_value);
}
}
}//package com.alternativagame.net.protocol.encoder.helpers
Section 401
//BooleanEncoder (com.alternativagame.net.protocol.encoder.primitive.BooleanEncoder)
package com.alternativagame.net.protocol.encoder.primitive {
import flash.net.*;
import com.alternativagame.net.*;
import com.alternativagame.admin.*;
import com.alternativagame.net.protocol.encoder.*;
public class BooleanEncoder implements IEncoder {
public function encode(_arg1:NetClient, _arg2:Object, _arg3:Socket):void{
var _local4:Boolean = Boolean(_arg2);
_arg3.writeByte((_local4) ? 1 : 0);
FPS.addSocketOutBytes(1);
}
}
}//package com.alternativagame.net.protocol.encoder.primitive
Section 402
//ByteEncoder (com.alternativagame.net.protocol.encoder.primitive.ByteEncoder)
package com.alternativagame.net.protocol.encoder.primitive {
import com.alternativagame.type.*;
import flash.net.*;
import com.alternativagame.net.*;
import com.alternativagame.admin.*;
import com.alternativagame.net.protocol.encoder.*;
public class ByteEncoder implements IEncoder {
public function encode(_arg1:NetClient, _arg2:Object, _arg3:Socket):void{
var _local4:Byte = Byte(_arg2);
_arg3.writeByte(_local4.value);
FPS.addSocketOutBytes(1);
}
}
}//package com.alternativagame.net.protocol.encoder.primitive
Section 403
//DoubleEncoder (com.alternativagame.net.protocol.encoder.primitive.DoubleEncoder)
package com.alternativagame.net.protocol.encoder.primitive {
import com.alternativagame.type.*;
import flash.net.*;
import com.alternativagame.net.*;
import com.alternativagame.admin.*;
import com.alternativagame.net.protocol.encoder.*;
public class DoubleEncoder implements IEncoder {
public function encode(_arg1:NetClient, _arg2:Object, _arg3:Socket):void{
var _local4:Double = (_arg2 as Double);
_arg3.writeDouble(_local4.value);
FPS.addSocketOutBytes(8);
}
}
}//package com.alternativagame.net.protocol.encoder.primitive
Section 404
//IntEncoder (com.alternativagame.net.protocol.encoder.primitive.IntEncoder)
package com.alternativagame.net.protocol.encoder.primitive {
import flash.net.*;
import com.alternativagame.net.*;
import com.alternativagame.admin.*;
import com.alternativagame.net.protocol.encoder.*;
public class IntEncoder implements IEncoder {
public function encode(_arg1:NetClient, _arg2:Object, _arg3:Socket):void{
_arg3.writeInt(int(_arg2));
FPS.addSocketOutBytes(4);
}
}
}//package com.alternativagame.net.protocol.encoder.primitive
Section 405
//ITBEncoder (com.alternativagame.net.protocol.encoder.primitive.ITBEncoder)
package com.alternativagame.net.protocol.encoder.primitive {
import com.alternativagame.type.*;
import flash.net.*;
import com.alternativagame.net.*;
import com.alternativagame.net.protocol.*;
import com.alternativagame.net.protocol.encoder.*;
public class ITBEncoder implements IEncoder {
public function encode(_arg1:NetClient, _arg2:Object, _arg3:Socket):void{
var _local4:ITBTYPE = ITBTYPE(_arg2);
_arg1.sendObject(new Byte(_local4.itb));
}
}
}//package com.alternativagame.net.protocol.encoder.primitive
Section 406
//LongEncoder (com.alternativagame.net.protocol.encoder.primitive.LongEncoder)
package com.alternativagame.net.protocol.encoder.primitive {
import com.alternativagame.type.*;
import flash.net.*;
import com.alternativagame.net.*;
import com.alternativagame.admin.*;
import com.alternativagame.net.protocol.encoder.*;
public class LongEncoder implements IEncoder {
public function encode(_arg1:NetClient, _arg2:Object, _arg3:Socket):void{
var _local4:Long = Long(_arg2);
_arg3.writeInt(_local4.hi);
_arg3.writeInt(_local4.lo);
FPS.addSocketOutBytes(8);
}
}
}//package com.alternativagame.net.protocol.encoder.primitive
Section 407
//ShortEncoder (com.alternativagame.net.protocol.encoder.primitive.ShortEncoder)
package com.alternativagame.net.protocol.encoder.primitive {
import com.alternativagame.type.*;
import flash.net.*;
import com.alternativagame.net.*;
import com.alternativagame.admin.*;
import com.alternativagame.net.protocol.encoder.*;
public class ShortEncoder implements IEncoder {
public function encode(_arg1:NetClient, _arg2:Object, _arg3:Socket):void{
var _local4:Short = Short(_arg2);
_arg3.writeShort(_local4.value);
FPS.addSocketOutBytes(2);
}
}
}//package com.alternativagame.net.protocol.encoder.primitive
Section 408
//StringEncoder (com.alternativagame.net.protocol.encoder.primitive.StringEncoder)
package com.alternativagame.net.protocol.encoder.primitive {
import flash.net.*;
import com.alternativagame.net.*;
import com.alternativagame.admin.*;
import com.alternativagame.net.protocol.encoder.*;
public class StringEncoder implements IEncoder {
public function encode(_arg1:NetClient, _arg2:Object, _arg3:Socket):void{
var _local4:String = String(_arg2);
_arg3.writeUTFBytes(_local4);
FPS.addSocketOutBytes((_local4.length * 2));
}
}
}//package com.alternativagame.net.protocol.encoder.primitive
Section 409
//ArrayHelperEncoder (com.alternativagame.net.protocol.encoder.struct.ArrayHelperEncoder)
package com.alternativagame.net.protocol.encoder.struct {
import flash.net.*;
import com.alternativagame.net.*;
import com.alternativagame.net.protocol.encoder.helpers.*;
import com.alternativagame.net.protocol.encoder.*;
import com.alternativagame.net.protocol.encoder.helpers.impl.*;
public class ArrayHelperEncoder implements IEncoder {
public function encode(_arg1:NetClient, _arg2:Object, _arg3:Socket):void{
var _local5:Object;
var _local4:ArrayHelper = ArrayHelper(_arg2);
_arg1.sendObject(_local4.length);
_arg1.sendObject(_local4.child);
for each (_local5 in _local4.array) {
_arg1.sendObject(HelperFactory.instance.helperFor(_local5));
};
}
}
}//package com.alternativagame.net.protocol.encoder.struct
Section 410
//ListHelperEncoder (com.alternativagame.net.protocol.encoder.struct.ListHelperEncoder)
package com.alternativagame.net.protocol.encoder.struct {
import flash.net.*;
import com.alternativagame.net.*;
import com.alternativagame.net.protocol.encoder.helpers.*;
import com.alternativagame.net.protocol.encoder.*;
import com.alternativagame.net.protocol.encoder.helpers.impl.*;
public class ListHelperEncoder implements IEncoder {
public function encode(_arg1:NetClient, _arg2:Object, _arg3:Socket):void{
var _local5:Object;
var _local6:IHelper;
var _local4:ListHelper = ListHelper(_arg2);
_arg1.sendObject(_local4.length);
for each (_local5 in _local4.array) {
_local6 = HelperFactory.instance.helperFor(_local5);
_arg1.sendObject(_local6.itb);
_arg1.sendObject(_local6);
};
}
}
}//package com.alternativagame.net.protocol.encoder.struct
Section 411
//MapHelperEncoder (com.alternativagame.net.protocol.encoder.struct.MapHelperEncoder)
package com.alternativagame.net.protocol.encoder.struct {
import flash.net.*;
import com.alternativagame.net.*;
import com.alternativagame.net.protocol.encoder.helpers.*;
import com.alternativagame.net.protocol.encoder.*;
import com.alternativagame.net.protocol.encoder.helpers.impl.*;
public class MapHelperEncoder implements IEncoder {
public function encode(_arg1:NetClient, _arg2:Object, _arg3:Socket):void{
var _local5:Object;
var _local4:MapHelper = MapHelper(_arg2);
_arg1.sendObject(_local4.length);
_arg1.sendObject(_local4.key);
_arg1.sendObject(_local4.value);
for (_local5 in _local4.array) {
_arg1.sendObject(HelperFactory.instance.helperFor(_local5));
_arg1.sendObject(HelperFactory.instance.helperFor(_local4.array[_local5]));
};
}
}
}//package com.alternativagame.net.protocol.encoder.struct
Section 412
//PrimitiveHelperEncoder (com.alternativagame.net.protocol.encoder.struct.PrimitiveHelperEncoder)
package com.alternativagame.net.protocol.encoder.struct {
import flash.net.*;
import com.alternativagame.net.*;
import com.alternativagame.net.protocol.encoder.helpers.*;
import com.alternativagame.net.protocol.encoder.*;
public class PrimitiveHelperEncoder implements IEncoder {
public function encode(_arg1:NetClient, _arg2:Object, _arg3:Socket):void{
var _local4:PrimitiveHelper = PrimitiveHelper(_arg2);
_arg1.sendObject(_local4.obj);
}
}
}//package com.alternativagame.net.protocol.encoder.struct
Section 413
//StringHelperEncoder (com.alternativagame.net.protocol.encoder.struct.StringHelperEncoder)
package com.alternativagame.net.protocol.encoder.struct {
import flash.net.*;
import com.alternativagame.net.*;
import com.alternativagame.net.protocol.encoder.*;
import com.alternativagame.net.protocol.encoder.helpers.impl.*;
public class StringHelperEncoder implements IEncoder {
public function encode(_arg1:NetClient, _arg2:Object, _arg3:Socket):void{
var _local4:StringHelper = StringHelper(_arg2);
_arg1.sendObject(_local4.length);
_arg1.sendObject(_local4.value);
}
}
}//package com.alternativagame.net.protocol.encoder.struct
Section 414
//EncoderRegistry (com.alternativagame.net.protocol.encoder.EncoderRegistry)
package com.alternativagame.net.protocol.encoder {
import com.alternativagame.type.*;
import com.alternativagame.net.command.*;
import flash.net.*;
import com.alternativagame.net.*;
import com.alternativagame.net.protocol.encoder.helpers.*;
import com.alternativagame.net.protocol.*;
import com.alternativagame.net.protocol.encoder.primitive.*;
import com.alternativagame.net.protocol.encoder.struct.*;
import com.alternativagame.net.protocol.encoder.helpers.impl.*;
import com.alternativagame.net.protocol.encoder.command.*;
public class EncoderRegistry implements IEncoder {
private var longEncoder:IEncoder;
private var itbEncoder:IEncoder;
private var commandZeroEncoder:IEncoder;
private var stringEncoder:IEncoder;
private var listHelperEncoder:IEncoder;
private var doubleEncoder:IEncoder;
private var booleanEncoder:IEncoder;
private var shortEncoder:IEncoder;
private var mapHelperEncoder:IEncoder;
private var primitiveHelperEncoder:IEncoder;
private var intEncoder:IEncoder;
private var byteEncoder:IEncoder;
private var arrayHelperEncoder:IEncoder;
private var stringHelperEncoder:IEncoder;
public function EncoderRegistry(){
this.commandZeroEncoder = new CommandZeroEncoder();
this.booleanEncoder = new BooleanEncoder();
this.byteEncoder = new ByteEncoder();
this.doubleEncoder = new DoubleEncoder();
this.intEncoder = new IntEncoder();
this.longEncoder = new LongEncoder();
this.shortEncoder = new ShortEncoder();
this.stringEncoder = new StringEncoder();
this.itbEncoder = new ITBEncoder();
this.stringHelperEncoder = new StringHelperEncoder();
this.arrayHelperEncoder = new ArrayHelperEncoder();
this.listHelperEncoder = new ListHelperEncoder();
this.mapHelperEncoder = new MapHelperEncoder();
this.primitiveHelperEncoder = new PrimitiveHelperEncoder();
}
public function encode(_arg1:NetClient, _arg2:Object, _arg3:Socket):void{
var _local4:IEncoder;
if ((_arg2 is PrimitiveHelper)){
_local4 = primitiveHelperEncoder;
} else {
if ((_arg2 is CommandZero)){
_local4 = commandZeroEncoder;
} else {
if ((_arg2 is Boolean)){
_local4 = booleanEncoder;
} else {
if ((_arg2 is Byte)){
_local4 = byteEncoder;
} else {
if ((_arg2 is Number)){
_local4 = intEncoder;
} else {
if ((_arg2 is Double)){
_local4 = doubleEncoder;
} else {
if ((_arg2 is Long)){
_local4 = longEncoder;
} else {
if ((_arg2 is Short)){
_local4 = shortEncoder;
} else {
if ((_arg2 is String)){
_local4 = stringEncoder;
} else {
if ((_arg2 is ITBTYPE)){
_local4 = itbEncoder;
} else {
if ((_arg2 is StringHelper)){
_local4 = stringHelperEncoder;
} else {
if ((_arg2 is ArrayHelper)){
_local4 = arrayHelperEncoder;
} else {
if ((_arg2 is ListHelper)){
_local4 = listHelperEncoder;
} else {
if ((_arg2 is MapHelper)){
_local4 = mapHelperEncoder;
};
};
};
};
};
};
};
};
};
};
};
};
};
};
_local4.encode(_arg1, _arg2, _arg3);
}
}
}//package com.alternativagame.net.protocol.encoder
Section 415
//IEncoder (com.alternativagame.net.protocol.encoder.IEncoder)
package com.alternativagame.net.protocol.encoder {
import flash.net.*;
import com.alternativagame.net.*;
public interface IEncoder {
function encode(_arg1:NetClient, _arg2:Object, _arg3:Socket):void;
}
}//package com.alternativagame.net.protocol.encoder
Section 416
//DataQueue (com.alternativagame.net.protocol.parser.core.DataQueue)
package com.alternativagame.net.protocol.parser.core {
import com.alternativagame.net.protocol.parser.folding.*;
public class DataQueue {
private var array:Array;
public function DataQueue(){
array = new Array();
super();
}
public function getData():Object{
var _local1:Object = array.shift();
if (((!((_local1 == null))) && ((_local1 is IFoldingType)))){
_local1 = IFoldingType(_local1).folding(this);
};
return (_local1);
}
public function addData(_arg1:Object):void{
array.push(_arg1);
}
}
}//package com.alternativagame.net.protocol.parser.core
Section 417
//ParserStack (com.alternativagame.net.protocol.parser.core.ParserStack)
package com.alternativagame.net.protocol.parser.core {
import com.alternativagame.net.protocol.parser.decoder.*;
public class ParserStack {
private var array:Array;
public function ParserStack(){
array = new Array();
super();
}
public function getNextTypeDecoder():ITypeDecoder{
var _local1:ITypeDecoder = array.pop();
array.push(_local1);
return (_local1);
}
public function removeTypeDecoder():void{
array.pop();
}
public function push(_arg1:ITypeDecoder):void{
array.push(_arg1);
}
}
}//package com.alternativagame.net.protocol.parser.core
Section 418
//COMMAND (com.alternativagame.net.protocol.parser.decoder.command.COMMAND)
package com.alternativagame.net.protocol.parser.decoder.command {
import flash.net.*;
import com.alternativagame.net.protocol.parser.core.*;
import com.alternativagame.net.protocol.parser.decoder.*;
import com.alternativagame.admin.*;
import com.alternativagame.net.protocol.parser.decoder.number.*;
import com.alternativagame.net.protocol.parser.folding.impl.*;
import com.alternativagame.net.protocol.parser.decoder.struct.*;
public class COMMAND extends LengthTypeDecoder {
public static const instance:COMMAND = new (COMMAND);
;
public function COMMAND(){
super(1);
}
override public function decode(_arg1:Socket, _arg2:ParserStack, _arg3:DataQueue):void{
var _local4:int = _arg1.readByte();
FPS.addSocketInBytes(1);
switch (_local4){
case 0:
_arg2.push(DecoderList.SLIST);
_arg2.push(BYTEDecoder.instance);
_arg2.push(SHORTDecoder.instance);
_arg2.push(LONGDecoder.instance);
_arg3.addData(new CmdZeroFolding());
break;
default:
trace(("decoder: command not found, code " + _local4));
break;
};
}
}
}//package com.alternativagame.net.protocol.parser.decoder.command
Section 419
//ITB (com.alternativagame.net.protocol.parser.decoder.command.ITB)
package com.alternativagame.net.protocol.parser.decoder.command {
import flash.net.*;
import com.alternativagame.net.protocol.parser.core.*;
import com.alternativagame.net.protocol.parser.decoder.*;
import com.alternativagame.net.protocol.*;
import com.alternativagame.admin.*;
public class ITB extends LengthTypeDecoder {
public static const instance:ITB = new (ITB);
;
public function ITB(){
super(1);
}
override public function decode(_arg1:Socket, _arg2:ParserStack, _arg3:DataQueue):void{
_arg2.removeTypeDecoder();
var _local4:int = _arg1.readByte();
FPS.addSocketInBytes(1);
var _local5:ITBTYPE = ITBTYPE.getITBForType(_local4);
_arg2.push(_local5.decoder);
}
}
}//package com.alternativagame.net.protocol.parser.decoder.command
Section 420
//BOOLEANDecoder (com.alternativagame.net.protocol.parser.decoder.number.BOOLEANDecoder)
package com.alternativagame.net.protocol.parser.decoder.number {
import flash.net.*;
import com.alternativagame.net.protocol.parser.core.*;
import com.alternativagame.net.protocol.parser.decoder.*;
import com.alternativagame.admin.*;
public class BOOLEANDecoder extends LengthTypeDecoder {
public function BOOLEANDecoder(){
super(1);
}
override public function decode(_arg1:Socket, _arg2:ParserStack, _arg3:DataQueue):void{
_arg2.removeTypeDecoder();
_arg3.addData(new Boolean(!((_arg1.readByte() == 0))));
FPS.addSocketInBytes(1);
}
}
}//package com.alternativagame.net.protocol.parser.decoder.number
Section 421
//BYTEDecoder (com.alternativagame.net.protocol.parser.decoder.number.BYTEDecoder)
package com.alternativagame.net.protocol.parser.decoder.number {
import com.alternativagame.type.*;
import flash.net.*;
import com.alternativagame.net.protocol.parser.core.*;
import com.alternativagame.net.protocol.parser.decoder.*;
import com.alternativagame.admin.*;
public class BYTEDecoder extends LengthTypeDecoder {
public static const instance:BYTEDecoder = new (BYTEDecoder);
;
public function BYTEDecoder(){
super(1);
}
override public function decode(_arg1:Socket, _arg2:ParserStack, _arg3:DataQueue):void{
_arg2.removeTypeDecoder();
_arg3.addData(new Byte(_arg1.readByte()));
FPS.addSocketInBytes(1);
}
}
}//package com.alternativagame.net.protocol.parser.decoder.number
Section 422
//DOUBLEDecoder (com.alternativagame.net.protocol.parser.decoder.number.DOUBLEDecoder)
package com.alternativagame.net.protocol.parser.decoder.number {
import com.alternativagame.type.*;
import flash.net.*;
import com.alternativagame.net.protocol.parser.core.*;
import com.alternativagame.net.protocol.parser.decoder.*;
import com.alternativagame.admin.*;
public class DOUBLEDecoder extends LengthTypeDecoder {
public function DOUBLEDecoder(){
super(8);
}
override public function decode(_arg1:Socket, _arg2:ParserStack, _arg3:DataQueue):void{
_arg2.removeTypeDecoder();
_arg3.addData(new Double(_arg1.readDouble()));
FPS.addSocketInBytes(8);
}
}
}//package com.alternativagame.net.protocol.parser.decoder.number
Section 423
//INTDecoder (com.alternativagame.net.protocol.parser.decoder.number.INTDecoder)
package com.alternativagame.net.protocol.parser.decoder.number {
import flash.net.*;
import com.alternativagame.net.protocol.parser.core.*;
import com.alternativagame.net.protocol.parser.decoder.*;
import com.alternativagame.admin.*;
public class INTDecoder extends LengthTypeDecoder {
public static const instance:INTDecoder = new (INTDecoder);
;
public function INTDecoder(){
super(4);
}
override public function decode(_arg1:Socket, _arg2:ParserStack, _arg3:DataQueue):void{
_arg2.removeTypeDecoder();
_arg3.addData(_arg1.readInt());
FPS.addSocketInBytes(4);
}
}
}//package com.alternativagame.net.protocol.parser.decoder.number
Section 424
//LONGDecoder (com.alternativagame.net.protocol.parser.decoder.number.LONGDecoder)
package com.alternativagame.net.protocol.parser.decoder.number {
import com.alternativagame.type.*;
import flash.net.*;
import com.alternativagame.net.protocol.parser.core.*;
import com.alternativagame.net.protocol.parser.decoder.*;
import com.alternativagame.admin.*;
public class LONGDecoder extends LengthTypeDecoder {
public static const instance:LONGDecoder = new (LONGDecoder);
;
public function LONGDecoder(){
super(8);
}
override public function decode(_arg1:Socket, _arg2:ParserStack, _arg3:DataQueue):void{
_arg2.removeTypeDecoder();
var _local4:int = _arg1.readInt();
var _local5:int = _arg1.readInt();
_arg3.addData(new Long(_local5, _local4));
FPS.addSocketInBytes(8);
}
}
}//package com.alternativagame.net.protocol.parser.decoder.number
Section 425
//SHORTDecoder (com.alternativagame.net.protocol.parser.decoder.number.SHORTDecoder)
package com.alternativagame.net.protocol.parser.decoder.number {
import com.alternativagame.type.*;
import flash.net.*;
import com.alternativagame.net.protocol.parser.core.*;
import com.alternativagame.net.protocol.parser.decoder.*;
import com.alternativagame.admin.*;
public class SHORTDecoder extends LengthTypeDecoder {
public static const instance:SHORTDecoder = new (SHORTDecoder);
;
public function SHORTDecoder(){
super(2);
}
override public function decode(_arg1:Socket, _arg2:ParserStack, _arg3:DataQueue):void{
_arg2.removeTypeDecoder();
_arg3.addData(new Short(_arg1.readShort()));
FPS.addSocketInBytes(2);
}
}
}//package com.alternativagame.net.protocol.parser.decoder.number
Section 426
//DecoderArray (com.alternativagame.net.protocol.parser.decoder.struct.DecoderArray)
package com.alternativagame.net.protocol.parser.decoder.struct {
import flash.net.*;
import com.alternativagame.net.protocol.parser.core.*;
import com.alternativagame.net.protocol.parser.decoder.*;
import com.alternativagame.net.protocol.*;
import com.alternativagame.admin.*;
import com.alternativagame.net.protocol.parser.folding.impl.*;
public class DecoderArray extends LengthTypeDecoder {
public static const SARRAY:DecoderArray = new DecoderArray(1);
;
public static const MARRAY:DecoderArray = new DecoderArray(2);
;
public static const LARRAY:DecoderArray = new DecoderArray(4);
;
public function DecoderArray(_arg1:int){
super((_arg1 + 1));
this.type = _arg1;
}
override public function decode(_arg1:Socket, _arg2:ParserStack, _arg3:DataQueue):void{
var _local7:int;
_arg2.removeTypeDecoder();
var _local4:int = size(_arg1);
var _local5:int = _arg1.readByte();
FPS.addSocketInBytes(1);
var _local6:ITBTYPE = ITBTYPE.getITBForType(_local5);
while (_local7 < _local4) {
_arg2.push(_local6.decoder);
_local7++;
};
_arg3.addData(new ArrayFolding(_local4));
}
}
}//package com.alternativagame.net.protocol.parser.decoder.struct
Section 427
//DecoderList (com.alternativagame.net.protocol.parser.decoder.struct.DecoderList)
package com.alternativagame.net.protocol.parser.decoder.struct {
import flash.net.*;
import com.alternativagame.net.protocol.parser.core.*;
import com.alternativagame.net.protocol.parser.decoder.*;
import com.alternativagame.net.protocol.parser.decoder.command.*;
import com.alternativagame.net.protocol.parser.folding.impl.*;
public class DecoderList extends LengthTypeDecoder {
public static const SLIST:DecoderList = new DecoderList(1);
;
public static const LLIST:DecoderList = new DecoderList(4);
;
public static const MLIST:DecoderList = new DecoderList(2);
;
public function DecoderList(_arg1:int){
super(_arg1);
this.type = _arg1;
}
override public function decode(_arg1:Socket, _arg2:ParserStack, _arg3:DataQueue):void{
var _local5:int;
_arg2.removeTypeDecoder();
var _local4:int = size(_arg1);
while (_local5 < _local4) {
_arg2.push(ITB.instance);
_local5++;
};
_arg3.addData(new ListFolding(_local4));
}
}
}//package com.alternativagame.net.protocol.parser.decoder.struct
Section 428
//DecoderMap (com.alternativagame.net.protocol.parser.decoder.struct.DecoderMap)
package com.alternativagame.net.protocol.parser.decoder.struct {
import flash.net.*;
import com.alternativagame.net.protocol.parser.core.*;
import com.alternativagame.net.protocol.parser.decoder.*;
import com.alternativagame.net.protocol.*;
import com.alternativagame.admin.*;
import com.alternativagame.net.protocol.parser.folding.impl.*;
public class DecoderMap extends LengthTypeDecoder {
public static const LMAP:DecoderMap = new DecoderMap(4);
;
public static const SMAP:DecoderMap = new DecoderMap(1);
;
public static const MMAP:DecoderMap = new DecoderMap(2);
;
public function DecoderMap(_arg1:int){
super((_arg1 + 2));
this.type = _arg1;
}
override public function decode(_arg1:Socket, _arg2:ParserStack, _arg3:DataQueue):void{
var _local9:int;
_arg2.removeTypeDecoder();
var _local4:int = size(_arg1);
var _local5:int = _arg1.readByte();
FPS.addSocketInBytes(1);
var _local6:ITBTYPE = ITBTYPE.getITBForType(_local5);
var _local7:int = _arg1.readByte();
FPS.addSocketInBytes(1);
var _local8:ITBTYPE = ITBTYPE.getITBForType(_local7);
while (_local9 < _local4) {
_arg2.push(_local8.decoder);
_arg2.push(_local6.decoder);
_local9++;
};
_arg3.addData(new MapFolding(_local4));
}
}
}//package com.alternativagame.net.protocol.parser.decoder.struct
Section 429
//DecoderString (com.alternativagame.net.protocol.parser.decoder.struct.DecoderString)
package com.alternativagame.net.protocol.parser.decoder.struct {
import flash.net.*;
import com.alternativagame.net.protocol.parser.core.*;
import com.alternativagame.net.protocol.parser.decoder.*;
import com.alternativagame.admin.*;
public class DecoderString extends LengthTypeDecoder {
private var str_size:int;// = -1
public static const SS:DecoderString = new DecoderString(1);
;
public static const MS:DecoderString = new DecoderString(2);
;
public static const LS:DecoderString = new DecoderString(4);
;
public function DecoderString(_arg1:int){
super(_arg1);
this.type = _arg1;
}
override public function decode(_arg1:Socket, _arg2:ParserStack, _arg3:DataQueue):void{
var _local4:String;
if (str_size == -1){
str_size = size(_arg1);
super.data_need = str_size;
} else {
_arg2.removeTypeDecoder();
_local4 = _arg1.readUTFBytes(str_size);
FPS.addSocketInBytes(str_size);
_arg3.addData(_local4);
super.data_need = type;
this.str_size = -1;
};
}
}
}//package com.alternativagame.net.protocol.parser.decoder.struct
Section 430
//ITypeDecoder (com.alternativagame.net.protocol.parser.decoder.ITypeDecoder)
package com.alternativagame.net.protocol.parser.decoder {
import flash.net.*;
import com.alternativagame.net.protocol.parser.core.*;
public interface ITypeDecoder {
function decodable(_arg1:Socket):Boolean;
function decode(_arg1:Socket, _arg2:ParserStack, _arg3:DataQueue):void;
}
}//package com.alternativagame.net.protocol.parser.decoder
Section 431
//LengthTypeDecoder (com.alternativagame.net.protocol.parser.decoder.LengthTypeDecoder)
package com.alternativagame.net.protocol.parser.decoder {
import flash.net.*;
import com.alternativagame.net.protocol.parser.core.*;
import com.alternativagame.net.protocol.encoder.helpers.*;
public class LengthTypeDecoder implements ITypeDecoder {
public var type:int;
public var data_need:int;
public function LengthTypeDecoder(_arg1:int){
this.data_need = _arg1;
}
public function size(_arg1:Socket):int{
return (LENGTH.readSize(_arg1, type));
}
public function decodable(_arg1:Socket):Boolean{
return ((_arg1.bytesAvailable >= data_need));
}
public function decode(_arg1:Socket, _arg2:ParserStack, _arg3:DataQueue):void{
}
}
}//package com.alternativagame.net.protocol.parser.decoder
Section 432
//ArrayFolding (com.alternativagame.net.protocol.parser.folding.impl.ArrayFolding)
package com.alternativagame.net.protocol.parser.folding.impl {
import com.alternativagame.net.protocol.parser.core.*;
import com.alternativagame.net.protocol.parser.folding.*;
public class ArrayFolding implements IFoldingType {
private var size:int;
public function ArrayFolding(_arg1:int){
this.size = _arg1;
}
public function folding(_arg1:DataQueue):Object{
var _local3:int;
var _local2:Array = new Array();
while (_local3 < this.size) {
_local2.push(_arg1.getData());
_local3++;
};
return (_local2);
}
}
}//package com.alternativagame.net.protocol.parser.folding.impl
Section 433
//CmdZeroFolding (com.alternativagame.net.protocol.parser.folding.impl.CmdZeroFolding)
package com.alternativagame.net.protocol.parser.folding.impl {
import com.alternativagame.type.*;
import com.alternativagame.net.command.*;
import com.alternativagame.net.protocol.parser.core.*;
import com.alternativagame.net.protocol.parser.folding.*;
public class CmdZeroFolding implements IFoldingType {
public function folding(_arg1:DataQueue):Object{
var _local2:CommandZero = new CommandZero();
var _local3:Long = Long(_arg1.getData());
var _local4:Short = Short(_arg1.getData());
var _local5:Byte = Byte(_arg1.getData());
var _local6:Array = (_arg1.getData() as Array);
_local2.id = _local3;
_local2.model = _local4;
_local2.method = _local5;
_local2.params = _local6;
return (_local2);
}
}
}//package com.alternativagame.net.protocol.parser.folding.impl
Section 434
//ListFolding (com.alternativagame.net.protocol.parser.folding.impl.ListFolding)
package com.alternativagame.net.protocol.parser.folding.impl {
import com.alternativagame.net.protocol.parser.core.*;
import com.alternativagame.net.protocol.parser.folding.*;
public class ListFolding implements IFoldingType {
private var size:int;
public function ListFolding(_arg1:int){
this.size = _arg1;
}
public function folding(_arg1:DataQueue):Object{
var _local3:int;
var _local2:Array = new Array();
while (_local3 < this.size) {
_local2.push(_arg1.getData());
_local3++;
};
return (_local2);
}
}
}//package com.alternativagame.net.protocol.parser.folding.impl
Section 435
//MapFolding (com.alternativagame.net.protocol.parser.folding.impl.MapFolding)
package com.alternativagame.net.protocol.parser.folding.impl {
import com.alternativagame.net.protocol.parser.core.*;
import com.alternativagame.net.protocol.parser.folding.*;
public class MapFolding implements IFoldingType {
private var size:int;
public function MapFolding(_arg1:int){
this.size = _arg1;
}
public function folding(_arg1:DataQueue):Object{
var _local3:int;
var _local2:Object = new Object();
while (_local3 < this.size) {
_local2[_arg1.getData()] = _arg1.getData();
_local3++;
};
return (_local2);
}
}
}//package com.alternativagame.net.protocol.parser.folding.impl
Section 436
//IFoldingType (com.alternativagame.net.protocol.parser.folding.IFoldingType)
package com.alternativagame.net.protocol.parser.folding {
import com.alternativagame.net.protocol.parser.core.*;
public interface IFoldingType {
function folding(_arg1:DataQueue):Object;
}
}//package com.alternativagame.net.protocol.parser.folding
Section 437
//ITBTYPE (com.alternativagame.net.protocol.ITBTYPE)
package com.alternativagame.net.protocol {
import com.alternativagame.net.protocol.parser.decoder.*;
import com.alternativagame.net.protocol.parser.decoder.number.*;
import com.alternativagame.net.protocol.parser.decoder.struct.*;
public class ITBTYPE {
private var ordinal_value:int;
public var decoder:ITypeDecoder;
private var itb_value:int;
public static const SARRAY:ITBTYPE = new ITBTYPE(-95, DecoderArray.SARRAY);
;
public static const LS:ITBTYPE = new ITBTYPE(19, DecoderString.LS);
;
public static const BYTE:ITBTYPE = new ITBTYPE(33, new BYTEDecoder());
;
public static const SMAP:ITBTYPE = new ITBTYPE(-79, DecoderMap.SMAP);
;
public static const INT:ITBTYPE = new ITBTYPE(35, new INTDecoder());
;
public static const DOUBLE:ITBTYPE = new ITBTYPE(49, new DOUBLEDecoder());
;
public static const MMAP:ITBTYPE = new ITBTYPE(-78, DecoderMap.MMAP);
;
public static const MARRAY:ITBTYPE = new ITBTYPE(-94, DecoderArray.MARRAY);
;
public static const SHORT:ITBTYPE = new ITBTYPE(34, new SHORTDecoder());
;
public static const SS:ITBTYPE = new ITBTYPE(17, DecoderString.SS);
;
public static const MS:ITBTYPE = new ITBTYPE(18, DecoderString.MS);
;
public static const BOOLEAN:ITBTYPE = new ITBTYPE(65, new BOOLEANDecoder());
;
public static const MLIST:ITBTYPE = new ITBTYPE(-62, DecoderList.MLIST);
;
public static const LARRAY:ITBTYPE = new ITBTYPE(-93, DecoderArray.LARRAY);
;
public static const LMAP:ITBTYPE = new ITBTYPE(-77, DecoderMap.LMAP);
;
public static const SLIST:ITBTYPE = new ITBTYPE(-63, DecoderList.SLIST);
;
public static const LLIST:ITBTYPE = new ITBTYPE(-61, DecoderList.LLIST);
;
public static const LONG:ITBTYPE = new ITBTYPE(36, new LONGDecoder());
;
private static var ordinal_count:int = 0;
private static var map:Object = new Object();
private static var list:Array = new Array();
public function ITBTYPE(_arg1:int, _arg2:ITypeDecoder){
this.itb_value = _arg1;
this.decoder = _arg2;
this.ordinal_value = ordinal_count;
ordinal_count++;
list[this.ordinal] = this;
map[_arg1] = this;
}
public function get ordinal():int{
return (this.ordinal_value);
}
public function get itb():int{
return (itb_value);
}
public static function getITBForType(_arg1:int):ITBTYPE{
return (ITBTYPE.map[_arg1]);
}
public static function getITBType(_arg1:int):ITBTYPE{
return (ITBTYPE.list[_arg1]);
}
}
}//package com.alternativagame.net.protocol
Section 438
//NetClient (com.alternativagame.net.NetClient)
package com.alternativagame.net {
import flash.events.*;
import com.alternativagame.net.events.*;
import com.alternativagame.net.command.*;
import flash.net.*;
import com.alternativagame.net.protocol.parser.core.*;
import com.alternativagame.net.protocol.parser.decoder.*;
import com.alternativagame.net.protocol.encoder.*;
import com.alternativagame.net.protocol.parser.decoder.command.*;
public class NetClient extends EventDispatcher {
private var queue:DataQueue;
public var socket:Socket;
private var stack:ParserStack;
private var encoderRegistry:EncoderRegistry;
public function NetClient(_arg1:String, _arg2:uint):void{
socket = new Socket(_arg1, _arg2);
socket.addEventListener(ProgressEvent.SOCKET_DATA, socketDataHandler);
encoderRegistry = new EncoderRegistry();
stack = new ParserStack();
queue = new DataQueue();
stack.push(COMMAND.instance);
}
public function sendCommand(_arg1:ICommand):void{
sendObject(_arg1);
socket.flush();
dispatchEvent(new NetClientEvent(NetClientEvent.SEND, _arg1));
}
public function sendObject(_arg1:Object):void{
encoderRegistry.encode(this, _arg1, this.socket);
}
private function socketDataHandler(_arg1:ProgressEvent):void{
var _local3:ITypeDecoder;
var _local4:ICommand;
var _local2:Boolean;
while (_local2) {
_local3 = this.stack.getNextTypeDecoder();
if (_local3.decodable(this.socket)){
_local3.decode(this.socket, this.stack, this.queue);
if (this.stack.getNextTypeDecoder() == COMMAND.instance){
_local4 = ICommand(this.queue.getData());
dispatchEvent(new NetClientEvent(NetClientEvent.RECIEVE, _local4));
};
} else {
_local2 = false;
};
};
}
}
}//package com.alternativagame.net
Section 439
//IObject (com.alternativagame.object.IObject)
package com.alternativagame.object {
import com.alternativagame.type.*;
public interface IObject {
function get id():Long;
function set id(_arg1:Long):void;
function dispose():void;
}
}//package com.alternativagame.object
Section 440
//SimpleObject (com.alternativagame.object.SimpleObject)
package com.alternativagame.object {
import com.alternativagame.type.*;
public class SimpleObject implements IObject {
private var _id:Long;
public function get id():Long{
return (_id);
}
public function set id(_arg1:Long):void{
_id = _arg1;
}
public function dispose():void{
}
}
}//package com.alternativagame.object
Section 441
//IResource (com.alternativagame.resource.IResource)
package com.alternativagame.resource {
import com.alternativagame.type.*;
public interface IResource {
function get name():String;
function set id(_arg1:Long):void;
function get id():Long;
function load(_arg1:String):void;
function unload():void;
}
}//package com.alternativagame.resource
Section 442
//LibraryResource (com.alternativagame.resource.LibraryResource)
package com.alternativagame.resource {
import flash.events.*;
import com.alternativagame.type.*;
import flash.display.*;
import com.alternativagame.kernel.*;
import flash.net.*;
import flash.system.*;
public class LibraryResource implements IResource {
private var infoLoader:URLLoader;
private var libraryName:String;
private var libraryLoader:Loader;
private var url:String;
private var _id:Long;
private static const initClassPath:String = "com.alternativagame.init";
public function LibraryResource(){
infoLoader = new URLLoader();
infoLoader.addEventListener(Event.COMPLETE, onInfoLoadComplete);
infoLoader.addEventListener(IOErrorEvent.IO_ERROR, onLoadError);
infoLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onLoadError);
libraryLoader = new Loader();
libraryLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLibraryLoadComplete);
libraryLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onLoadError);
libraryLoader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onLoadError);
}
private function onLoadError(_arg1:Event):void{
Dispatcher.resourceLoadError(_id);
}
public function get id():Long{
return (_id);
}
private function onLibraryLoadComplete(_arg1:Event):void{
Dispatcher.resourceLoaded(_id, LoaderInfo(_arg1.target).bytesTotal);
if (ApplicationDomain.currentDomain.hasDefinition(((initClassPath + ".") + libraryName))){
ApplicationDomain.currentDomain.getDefinition(((initClassPath + ".") + libraryName)).init();
};
}
public function get name():String{
return (("библиотека" + ((libraryName)==null) ? "" : (" " + libraryName)));
}
public function load(_arg1:String):void{
this.url = _arg1;
infoLoader.load(new URLRequest((_arg1 + "info.xml")));
}
public function set id(_arg1:Long):void{
_id = _arg1;
}
private function onInfoLoadComplete(_arg1:Event):void{
var _local2:XML = new XML(URLLoader(_arg1.target).data);
libraryName = _local2.@name;
var _local3:LoaderContext = new LoaderContext();
_local3.applicationDomain = ApplicationDomain.currentDomain;
_local3.securityDomain = SecurityDomain.currentDomain;
libraryLoader.load(new URLRequest((url + "library.swf")), _local3);
}
public function unload():void{
infoLoader = null;
libraryLoader.unload();
libraryLoader = null;
}
}
}//package com.alternativagame.resource
Section 443
//Bubble (com.alternativagame.test.Bubble)
package com.alternativagame.test {
import flash.display.*;
import flash.text.*;
public class Bubble extends Sprite {
private var tf:TextField;
private var offset:Number;// = -40
private var _text:String;
public function Bubble(_arg1:String=""){
tf = new TextField();
tf.defaultTextFormat = new TextFormat("Alternativa", 14, 0);
tf.antiAliasType = AntiAliasType.ADVANCED;
tf.autoSize = TextFieldAutoSize.LEFT;
tf.selectable = false;
tf.embedFonts = true;
tf.y = offset;
addChild(tf);
blendMode = BlendMode.HARDLIGHT;
this.text = _arg1;
}
public function set text(_arg1:String):void{
_text = _arg1;
draw();
}
public function clone():Bubble{
var _local1:Bubble = new Bubble(_text);
return (_local1);
}
private function draw():void{
tf.text = _text;
tf.x = (-(tf.width) / 2);
var w:Number = (tf.width + 20);
var h:Number = 29;
var l:Number = (-(w) / 2);
var r:Number = (w / 2);
var t:Number = (offset - 5);
var b:Number = (t + h);
var rad:Number = 10;
var _local2 = graphics;
with (_local2) {
clear();
lineStyle(1, 0x333333, 1, true);
beginFill(0xFFFFFF, 0.7);
moveTo((l + rad), t);
lineTo((r - rad), t);
curveTo(r, t, r, (t + rad));
lineTo(r, (b - rad));
curveTo(r, b, (r - rad), b);
lineTo(10, b);
curveTo(5, (b + 10), -5, (b + 15));
curveTo(0, (b + 10), 0, b);
lineTo((l + rad), b);
curveTo(l, b, l, (b - rad));
lineTo(l, (t + rad));
curveTo(l, t, (l + rad), t);
endFill();
};
}
public function get text():String{
return (_text);
}
}
}//package com.alternativagame.test
Section 444
//Character (com.alternativagame.test.Character)
package com.alternativagame.test {
import flash.geom.*;
import com.alternativagame.engine3d.*;
import com.alternativagame.type.*;
import flash.display.*;
public class Character extends Object3D {
private var spriteData:SpriteData;
private var bubbleObject:Object3D;
private var bubble:Bubble;
private var bubbleRenderer:DisplayObjectRenderer;
public function Character(_arg1:BitmapData){
var _local2:uint;
super();
if (spriteData == null){
spriteData = new SpriteData(false, false);
_local2 = 0;
while (_local2 < 18) {
spriteData.addPhase(_arg1, new Rectangle((_local2 * 150), 0, 150, 249), "default", -30, (_local2 * 20), new Point(75, 200));
_local2++;
};
_arg1.dispose();
};
addRenderer(new SpriteRenderer(spriteData, "default"));
bubbleObject = new Object3D();
bubbleObject.z = 200;
attach(bubbleObject);
bubble = new Bubble();
bubbleRenderer = new DisplayObjectRenderer(bubble);
}
public function set text(_arg1:String):void{
if (_arg1 == null){
bubbleObject.removeRenderer(bubbleRenderer);
} else {
bubbleObject.addRenderer(bubbleRenderer);
bubble.text = _arg1;
};
}
public function get text():String{
if (bubbleObject.renderers.has(bubbleRenderer)){
return (bubble.text);
};
return (null);
}
}
}//package com.alternativagame.test
Section 445
//DemoControlsWindow (com.alternativagame.test.DemoControlsWindow)
package com.alternativagame.test {
import flash.geom.*;
import flash.events.*;
import flash.display.*;
import com.alternativagame.gui.widget.button.*;
import com.alternativagame.gui.container.*;
import com.alternativagame.gui.layout.impl.*;
import com.alternativagame.gui.admin.window.*;
import com.alternativagame.gui.widget.*;
import com.alternativagame.gui.container.group.*;
import com.alternativagame.gui.layout.enums.*;
public class DemoControlsWindow extends DialogWindow {
private const qualityGroupTitle:String = "Качество";
private const renderQualityLow:String = "низкое";
private const helpString:String = "Таскать мышью — поворот
С зажатым пробелом — перемещение";
private const helpGroupTitle:String = "Камера";
private const charactersWalkEnabledText:String = "Персонажи перемещаются (тест)";
private const zoomTitle:String = "Масштаб: ";
private const windowTitle:String = "Управление";
private const renderQualityHigh:String = "высокое";
private const lightingQualityTitle:String = "Освещение:";
private const renderQualityTitle:String = "Качество
отрисовки:";
private const textureQualityTitle:String = "Текстуры:";
private const renderQualityMedium:String = "среднее";
private const qualitySlidersTitle:String = "качество";
private const daytimeTitle:String = "Время суток: ";
private const lightningsEnabledText:String = "Гроза (может тормозить)";
private const smothingEnabledTitle:String = "сглажено";
private const charactersTalkEnabledText:String = "Персонажи разговаривают";
private const exTick:BitmapData;
private var timeSlider:Slider;
private var qualitySwitch:ButtonSwitch;
private var zoomSlider:Slider;
private var lightningsEnabled:CheckBox;
private var lightingQualitySlider:Slider;
private var qualitySwitchOldPos:int;
private var lightingSmothingEnabled:CheckBox;
private var timeLabel:Label;
private var charactersTalkEnabled:CheckBox;
private var textureSmothingEnabled:CheckBox;
private var demoStage:Test3D;
private var zoomLabel:Label;
private var charactersWalkEnabled:CheckBox;
private var textureQualitySlider:Slider;
private static const exampleTickBitmap:Class = DemoControlsWindow_exampleTickBitmap;
public function DemoControlsWindow(_arg1:Test3D){
exTick = new exampleTickBitmap().bitmapData;
this.demoStage = _arg1;
super(windowTitle, 0, 0, false, false, false);
setLayoutManager(new CompletelyFillLayoutManager(Direction.VERTICAL, Align.LEFT, Align.TOP, 2));
timeLabel = new Label(daytimeTitle, Align.LEFT);
addObject(timeLabel);
timeSlider = new Slider(49, 1, 2, false);
timeSlider.stretchableH = true;
addObject(timeSlider);
timeSlider.addEventListener(SliderEvent.ONCHANGE_POS, onTimeChange);
zoomLabel = new Label(zoomTitle, Align.LEFT);
addObject(zoomLabel);
zoomSlider = new Slider(19, 9, 1, false);
zoomSlider.stretchableH = true;
addObject(zoomSlider);
zoomSlider.addEventListener(SliderEvent.ONCHANGE_POS, onZoomChange);
lightningsEnabled = new CheckBox(lightningsEnabledText);
lightningsEnabled.addEventListener(MouseEvent.CLICK, changeLightingsEnabled);
addObject(lightningsEnabled);
charactersTalkEnabled = new CheckBox(charactersTalkEnabledText);
charactersWalkEnabled = new CheckBox(charactersWalkEnabledText);
addObject(charactersTalkEnabled);
addObject(charactersWalkEnabled);
charactersTalkEnabled.addEventListener(MouseEvent.CLICK, changeCharactersTalkEnabled);
charactersWalkEnabled.addEventListener(MouseEvent.CLICK, changeCharactersWalkEnabled);
var _local2:FrameGroup = new FrameGroup(qualityGroupTitle, Align.LEFT, 5, 0, 5, 5);
_local2.setLayoutManager(new CompletelyFillLayoutManager(Direction.VERTICAL, Align.CENTER, Align.MIDDLE, 10));
_local2.stretchableH = true;
addObject(_local2);
var _local3:Container = new Container();
var _local4:GridLayoutManager = new GridLayoutManager(3, new Point(1, 1));
_local4.colParam(0, -30, Align.LEFT);
_local4.colParam(1, -20, Align.CENTER);
_local4.colParam(2, -50, Align.CENTER);
_local3.setLayoutManager(_local4);
_local3.stretchableH = true;
_local2.addObject(_local3);
_local3.addObject(new Label(" "));
_local3.addObject(new Label(smothingEnabledTitle));
_local3.addObject(new Label(qualitySlidersTitle));
_local3.addObject(new Label(textureQualityTitle));
textureSmothingEnabled = new CheckBox();
textureSmothingEnabled.addEventListener(MouseEvent.CLICK, changeTextureSmothingEnabled);
_local3.addObject(textureSmothingEnabled);
textureQualitySlider = new Slider(20, 20, 3, false);
textureQualitySlider.addEventListener(SliderEvent.ONCHANGE_POS, onTextureQualityChange);
_local3.addObject(textureQualitySlider);
_local3.addObject(new Label(lightingQualityTitle));
lightingSmothingEnabled = new CheckBox();
lightingSmothingEnabled.addEventListener(MouseEvent.CLICK, changeLightingSmothingEnabled);
_local3.addObject(lightingSmothingEnabled);
lightingQualitySlider = new Slider(20, 20, 3, false);
lightingQualitySlider.addEventListener(SliderEvent.ONCHANGE_POS, onLightingQualityChange);
_local3.addObject(lightingQualitySlider);
var _local5:Container = new Container();
_local5.setLayoutManager(new CompletelyFillLayoutManager(Direction.HORIZONTAL, Align.LEFT, Align.MIDDLE, 5));
_local2.addObject(_local5);
_local5.stretchableH = true;
_local5.addObject(new Label(renderQualityTitle));
qualitySwitch = new ButtonSwitch(3, 3, 30, true, new Array(renderQualityLow, renderQualityMedium, renderQualityHigh), new Array(exTick, exTick, exTick));
_local5.addObject(qualitySwitch);
qualitySwitch.addEventListener(MouseEvent.MOUSE_DOWN, onQualitySwitchMouseDown);
var _local6:FrameGroup = new FrameGroup(helpGroupTitle, Align.LEFT, 5, 0, 5, 5);
_local6.setLayoutManager(new CompletelyFillLayoutManager(Direction.VERTICAL, Align.LEFT, Align.MIDDLE, 10));
_local6.stretchableH = true;
addObject(_local6);
_local6.addObject(new Label(helpString));
}
private function onQualitySwitchMouseMove(_arg1:MouseEvent):void{
var _local2:int = qualitySwitch.currentPos;
if (_local2 != qualitySwitchOldPos){
switch (_local2){
case 1:
demoStage.renderQuality = StageQuality.LOW;
break;
case 2:
demoStage.renderQuality = StageQuality.MEDIUM;
break;
case 3:
demoStage.renderQuality = StageQuality.HIGH;
break;
};
qualitySwitchOldPos = _local2;
};
}
private function changeTextureSmothingEnabled(_arg1:MouseEvent):void{
demoStage.smoothTextures = CheckBox(_arg1.target).pressed;
}
private function onQualitySwitchMouseUp(_arg1:MouseEvent):void{
qualitySwitch.removeEventListener(MouseEvent.MOUSE_MOVE, onQualitySwitchMouseMove);
qualitySwitch.removeEventListener(MouseEvent.MOUSE_UP, onQualitySwitchMouseUp);
}
public function init():void{
var _local1:Number = demoStage.daytime;
var _local2:int = Math.floor(_local1);
timeSlider.currentPos = ((_local1)!=_local2) ? ((_local2 * 2) + 1) : (_local2 * 2);
timeLabel.text = (daytimeTitle + hoursToString(_local1));
var _local3:Number = demoStage.zoom;
zoomSlider.currentPos = ((_local3 * 10) - 1);
zoomLabel.text = ((zoomTitle + String(_local3)) + "x");
lightningsEnabled.pressed = demoStage.lightnings;
charactersTalkEnabled.pressed = demoStage.charactersTalk;
charactersWalkEnabled.pressed = demoStage.charactersMove;
var _local4:int = (21 - demoStage.textureQuality);
textureQualitySlider.currentPos = _local4;
var _local5:int = (21 - demoStage.lightMapQuality);
lightingQualitySlider.currentPos = _local5;
textureSmothingEnabled.pressed = demoStage.smoothTextures;
lightingSmothingEnabled.pressed = demoStage.smoothLightEffects;
switch (demoStage.renderQuality){
case StageQuality.LOW:
qualitySwitchOldPos = 1;
break;
case StageQuality.MEDIUM:
qualitySwitchOldPos = 2;
break;
case StageQuality.HIGH:
qualitySwitchOldPos = 3;
break;
};
qualitySwitch.currentPos = qualitySwitchOldPos;
}
private function hoursToString(_arg1:Number):String{
var _local2:int = Math.floor(_arg1);
var _local3:String = String(_local2);
if (_local2 < 10){
_local3 = ("0" + _local3);
};
var _local4:String = ((_arg1)!=_local2) ? "30" : "00";
return (((_local3 + ":") + _local4));
}
private function changeCharactersWalkEnabled(_arg1:MouseEvent):void{
demoStage.charactersMove = CheckBox(_arg1.target).pressed;
}
private function onZoomChange(_arg1:SliderEvent):void{
var _local2:Number = (((Slider(_arg1.target).currentPos - 1) + 2) / 10);
zoomLabel.text = ((zoomTitle + String(_local2)) + "x");
demoStage.zoom = _local2;
}
private function changeLightingsEnabled(_arg1:MouseEvent):void{
demoStage.lightnings = CheckBox(_arg1.target).pressed;
}
private function onTimeChange(_arg1:SliderEvent):void{
var _local2:int = (Slider(_arg1.target).currentPos - 1);
var _local3:Number = (_local2 / 2);
timeLabel.text = (daytimeTitle + hoursToString(_local3));
demoStage.daytime = ((_local3)!=24) ? _local3 : 0;
}
private function onLightingQualityChange(_arg1:SliderEvent):void{
demoStage.lightMapQuality = (21 - Slider(_arg1.target).currentPos);
}
private function changeLightingSmothingEnabled(_arg1:MouseEvent):void{
demoStage.smoothLightEffects = CheckBox(_arg1.target).pressed;
}
private function onTextureQualityChange(_arg1:SliderEvent):void{
demoStage.textureQuality = (21 - Slider(_arg1.target).currentPos);
}
private function changeCharactersTalkEnabled(_arg1:MouseEvent):void{
demoStage.charactersTalk = CheckBox(_arg1.target).pressed;
}
override public function updateSkin():void{
super.updateSkin();
container.marginLeft = 4;
container.marginRight = 4;
container.marginTop = 4;
container.marginBottom = 4;
}
private function onQualitySwitchMouseDown(_arg1:MouseEvent):void{
qualitySwitch.addEventListener(MouseEvent.MOUSE_MOVE, onQualitySwitchMouseMove);
qualitySwitch.addEventListener(MouseEvent.MOUSE_UP, onQualitySwitchMouseUp);
}
}
}//package com.alternativagame.test
Section 446
//DemoControlsWindow_exampleTickBitmap (com.alternativagame.test.DemoControlsWindow_exampleTickBitmap)
package com.alternativagame.test {
import mx.core.*;
public class DemoControlsWindow_exampleTickBitmap extends BitmapAsset {
}
}//package com.alternativagame.test
Section 447
//Female (com.alternativagame.test.Female)
package com.alternativagame.test {
import flash.display.*;
import com.alternativagame.utility.*;
public class Female extends Character {
private static const bmpFemale:Class = Female_bmpFemale;
private static const bmpFemaleAlpha:Class = Female_bmpFemaleAlpha;
private static var femaleBitmap:BitmapData = BitmapUtility.mergeBitmapAlpha(new bmpFemale().bitmapData, new bmpFemaleAlpha().bitmapData, true);
public function Female(){
super(femaleBitmap);
}
}
}//package com.alternativagame.test
Section 448
//Female_bmpFemale (com.alternativagame.test.Female_bmpFemale)
package com.alternativagame.test {
import mx.core.*;
public class Female_bmpFemale extends BitmapAsset {
}
}//package com.alternativagame.test
Section 449
//Female_bmpFemaleAlpha (com.alternativagame.test.Female_bmpFemaleAlpha)
package com.alternativagame.test {
import mx.core.*;
public class Female_bmpFemaleAlpha extends BitmapAsset {
}
}//package com.alternativagame.test
Section 450
//Fence (com.alternativagame.test.Fence)
package com.alternativagame.test {
import com.alternativagame.engine3d.*;
import com.alternativagame.type.*;
import flash.display.*;
import com.alternativagame.utility.*;
public class Fence extends Object3D {
private var renderer:SpriteRenderer;
private static const bmpFenceAlpha:Class = Fence_bmpFenceAlpha;
private static const bmpFence:Class = Fence_bmpFence;
private static var fenceBitmap:BitmapData = BitmapUtility.mergeBitmapAlpha(new bmpFence().bitmapData, new bmpFenceAlpha().bitmapData, true);
private static var spriteData:SpriteData;
public function Fence(){
if (spriteData == null){
spriteData = new SpriteData();
spriteData.addPhase(fenceBitmap, null, "default", 0, 0, null, 0.5, 1);
fenceBitmap.dispose();
};
renderer = new SpriteRenderer(spriteData, "default", 1.5);
addRenderer(renderer);
}
}
}//package com.alternativagame.test
Section 451
//Fence_bmpFence (com.alternativagame.test.Fence_bmpFence)
package com.alternativagame.test {
import mx.core.*;
public class Fence_bmpFence extends BitmapAsset {
}
}//package com.alternativagame.test
Section 452
//Fence_bmpFenceAlpha (com.alternativagame.test.Fence_bmpFenceAlpha)
package com.alternativagame.test {
import mx.core.*;
public class Fence_bmpFenceAlpha extends BitmapAsset {
}
}//package com.alternativagame.test
Section 453
//House (com.alternativagame.test.House)
package com.alternativagame.test {
import com.alternativagame.engine3d.*;
import com.alternativagame.type.*;
import flash.display.*;
public class House extends Mesh {
private const socleHeight:Number = 44;
private const specular:Number = 2;
private var rightSide3:TextureRenderer;
private var rightSide1:TextureRenderer;
private var eaves:TextureRenderer;
private var frontSide1:TextureRenderer;
private var frontSide2:TextureRenderer;
private var backSide1:TextureRenderer;
private var backSide2:TextureRenderer;
private var windowGlow1:PolyTextureObject;
private var windowGlow2:PolyTextureObject;
private var windowGlow3:PolyTextureObject;
private var windowGlow4:PolyTextureObject;
private var windowGlow5:PolyTextureObject;
private var windowGlow6:PolyTextureObject;
private var doorGlow1:PolyTextureObject;
private var omni1:Object3D;
private var window1:SpriteTextureObject;
private var window4:SpriteTextureObject;
private var window5:SpriteTextureObject;
private var roofSide1:TextureRenderer;
private var roofSide2:TextureRenderer;
private var roofSide3:TextureRenderer;
private var window2:SpriteTextureObject;
private var window3:SpriteTextureObject;
private var door2:SpriteTextureObject;
private var _smoothShadows:Boolean;// = true
private var doorGlow2:PolyTextureObject;
private var omni2:Object3D;
private var door1:SpriteTextureObject;
private var window6:SpriteTextureObject;
private var shadowLight:Directional;
private var roof1:TextureRenderer;
private var roof2:TextureRenderer;
private var roof3:TextureRenderer;
private var roof4:TextureRenderer;
private var roof5:TextureRenderer;
private var _light1:Boolean;// = false
private var _light2:Boolean;// = false
private var leftSide:TextureRenderer;
private var rightSide2:TextureRenderer;
private static const socle:TextureData = new TextureData(new bmpSocle().bitmapData, 1);
private static const bmpWindowLight:Class = House_bmpWindowLight;
private static const bmpDoorLight:Class = House_bmpDoorLight;
private static const wall:TextureData = new TextureData(new bmpWall().bitmapData, 1);
private static const roofSide:TextureData = new TextureData(new bmpRoofSide().bitmapData, 1);
private static const bmpDoor:Class = House_bmpDoor;
private static const roof:TextureData = new TextureData(new bmpRoof().bitmapData, 1);
private static const bmpWindow:Class = House_bmpWindow;
private static const doorLightBmp:BitmapData = new bmpDoorLight().bitmapData;
private static const windowLightBmp:BitmapData = new bmpWindowLight().bitmapData;
private static const bmpWall:Class = House_bmpWall;
private static const bmpRoofSide:Class = House_bmpRoofSide;
private static const windowBmp:BitmapData = new bmpWindow().bitmapData;
private static const doorBmp:BitmapData = new bmpDoor().bitmapData;
private static const bmpRoof:Class = House_bmpRoof;
private static const bmpSocle:Class = House_bmpSocle;
public function House(_arg1:Directional){
var _local3:Array;
var _local4:Array;
var _local5:Face;
var _local6:PolyTextureObject;
var _local7:PolyTextureObject;
var _local8:SpriteData;
var _local9:SpriteData;
var _local10:Omni;
var _local11:Vertex;
super();
var _local2:Array = new Array();
_local2[0] = [new Vertex(-200, -600, -250), new Vertex(200, -600, -250), new Vertex(200, -200, -250), new Vertex(400, -200, -250), new Vertex(400, 200, -250), new Vertex(200, 200, -250), new Vertex(200, 400, -250), new Vertex(-200, 400, -250), new Vertex(-200, 200, -250), new Vertex(-200, -200, -250)];
_local2[1] = [new Vertex(-200, -600, 50), new Vertex(200, -600, 50), new Vertex(200, -200, 50), new Vertex(400, -200, 50), new Vertex(400, 200, 50), new Vertex(200, 200, 50), new Vertex(200, 400, 50), new Vertex(-200, 400, 50), new Vertex(-200, 200, 50), new Vertex(-200, -200, 50)];
_local2[2] = [new Vertex(-250, -650, 50), new Vertex(250, -650, 50), new Vertex(250, -250, 50), new Vertex(450, -250, 50), new Vertex(450, 250, 50), new Vertex(250, 250, 50), new Vertex(250, 450, 50), new Vertex(-250, 450, 50), new Vertex(-250, 200, 50), new Vertex(-250, -200, 50)];
_local2[3] = [new Vertex(-200, -650, 160), new Vertex(200, -650, 160), new Vertex(200, -200, 160), new Vertex(450, -200, 160), new Vertex(450, 200, 160), new Vertex(200, 200, 160), new Vertex(200, 450, 160), new Vertex(-200, 450, 160), new Vertex(-200, 200, 160), new Vertex(-200, -200, 160)];
_local2[4] = [new Vertex(-120, -650, 240), new Vertex(120, -650, 240), new Vertex(120, -120, 240), new Vertex(450, -120, 240), new Vertex(450, 120, 240), new Vertex(120, 120, 240), new Vertex(120, 450, 240), new Vertex(-120, 450, 240), new Vertex(-120, 120, 240), new Vertex(-120, -120, 240)];
_local2[5] = [new Vertex(0, -650, 280), new Vertex(0, 0, 280), new Vertex(0, 450, 280), new Vertex(450, 0, 280)];
for each (_local3 in _local2) {
for each (_local11 in _local3) {
addVertex(_local11);
};
};
_local4 = [new Face(_local2[0][0], _local2[0][1], _local2[1][1], _local2[1][0]), new Face(_local2[0][1], _local2[0][2], _local2[1][2], _local2[1][1]), new Face(_local2[0][2], _local2[0][3], _local2[1][3], _local2[1][2]), new Face(_local2[0][3], _local2[0][4], _local2[1][4], _local2[1][3]), new Face(_local2[0][4], _local2[0][5], _local2[1][5], _local2[1][4]), new Face(_local2[0][5], _local2[0][6], _local2[1][6], _local2[1][5]), new Face(_local2[0][6], _local2[0][7], _local2[1][7], _local2[1][6]), new Face(_local2[0][7], _local2[0][8], _local2[1][8], _local2[1][7]), new Face(_local2[0][8], _local2[0][9], _local2[1][9], _local2[1][8]), new Face(_local2[0][9], _local2[0][0], _local2[1][0], _local2[1][9]), new Face(_local2[1][0], _local2[1][1], _local2[2][1], _local2[2][0]), new Face(_local2[1][1], _local2[1][2], _local2[2][2], _local2[2][1]), new Face(_local2[1][2], _local2[1][3], _local2[2][3], _local2[2][2]), new Face(_local2[1][3], _local2[1][4], _local2[2][4], _local2[2][3]), new Face(_local2[1][4], _local2[1][5], _local2[2][5], _local2[2][4]), new Face(_local2[1][5], _local2[1][6], _local2[2][6], _local2[2][5]), new Face(_local2[1][6], _local2[1][7], _local2[2][7], _local2[2][6]), new Face(_local2[1][7], _local2[1][8], _local2[2][8], _local2[2][7]), new Face(_local2[1][8], _local2[1][9], _local2[2][9], _local2[2][8]), new Face(_local2[1][9], _local2[1][0], _local2[2][0], _local2[2][9]), new Face(_local2[2][0], _local2[2][1], _local2[3][1], _local2[4][1], _local2[5][0], _local2[4][0], _local2[3][0]), new Face(_local2[2][3], _local2[2][4], _local2[3][4], _local2[4][4], _local2[5][3], _local2[4][3], _local2[3][3]), new Face(_local2[2][6], _local2[2][7], _local2[3][7], _local2[4][7], _local2[5][2], _local2[4][6], _local2[3][6]), new Face(_local2[2][1], _local2[2][2], _local2[3][2], _local2[3][1]), new Face(_local2[2][2], _local2[2][3], _local2[3][3], _local2[3][2]), new Face(_local2[2][4], _local2[2][5], _local2[3][5], _local2[3][4]), new Face(_local2[2][5], _local2[2][6], _local2[3][6], _local2[3][5]), new Face(_local2[2][7], _local2[2][8], _local2[3][8], _local2[3][7]), new Face(_local2[2][8], _local2[2][9], _local2[3][9], _local2[3][8]), new Face(_local2[2][9], _local2[2][0], _local2[3][0], _local2[3][9]), new Face(_local2[3][1], _local2[3][2], _local2[4][2], _local2[4][1]), new Face(_local2[3][2], _local2[3][3], _local2[4][3], _local2[4][2]), new Face(_local2[3][4], _local2[3][5], _local2[4][5], _local2[4][4]), new Face(_local2[3][5], _local2[3][6], _local2[4][6], _local2[4][5]), new Face(_local2[3][7], _local2[3][8], _local2[4][8], _local2[4][7]), new Face(_local2[3][8], _local2[3][9], _local2[4][9], _local2[4][8]), new Face(_local2[3][9], _local2[3][0], _local2[4][0], _local2[4][9]), new Face(_local2[4][1], _local2[4][2], _local2[5][1], _local2[5][0]), new Face(_local2[4][2], _local2[4][3], _local2[5][3], _local2[5][1]), new Face(_local2[4][4], _local2[4][5], _local2[5][1], _local2[5][3]), new Face(_local2[4][5], _local2[4][6], _local2[5][2], _local2[5][1]), new Face(_local2[4][7], _local2[4][8], _local2[5][1], _local2[5][2]), new Face(_local2[4][8], _local2[4][9], _local2[5][1]), new Face(_local2[4][9], _local2[4][0], _local2[5][0], _local2[5][1])];
for each (_local5 in _local4) {
addFace(_local5);
};
frontSide1 = new TextureRenderer(null, wall, specular);
frontSide2 = new TextureRenderer(null, wall, specular);
backSide1 = new TextureRenderer(null, wall, specular);
backSide2 = new TextureRenderer(null, wall, specular);
rightSide1 = new TextureRenderer(null, wall, specular);
rightSide2 = new TextureRenderer(null, wall, specular);
rightSide3 = new TextureRenderer(null, wall, specular);
leftSide = new TextureRenderer(null, wall, specular);
eaves = new TextureRenderer(new RGB(0x666666), null, specular);
roofSide1 = new TextureRenderer(null, roofSide, specular);
roofSide2 = new TextureRenderer(null, roofSide, specular);
roofSide3 = new TextureRenderer(null, roofSide, specular);
roof1 = new TextureRenderer(null, roof, specular);
roof2 = new TextureRenderer(null, roof, specular);
roof3 = new TextureRenderer(null, roof, specular);
roof4 = new TextureRenderer(null, roof, specular);
roof5 = new TextureRenderer(null, roof, specular);
frontSide1.addFace(_local4[0]);
frontSide2.addFace(_local4[2]);
rightSide1.addFace(_local4[1]);
rightSide2.addFace(_local4[3]);
backSide2.addFace(_local4[4]);
rightSide3.addFace(_local4[5]);
backSide1.addFace(_local4[6]);
leftSide.addFace(_local4[7]);
leftSide.addFace(_local4[8]);
leftSide.addFace(_local4[9]);
eaves.addFace(_local4[10]);
eaves.addFace(_local4[11]);
eaves.addFace(_local4[12]);
eaves.addFace(_local4[13]);
eaves.addFace(_local4[14]);
eaves.addFace(_local4[15]);
eaves.addFace(_local4[16]);
eaves.addFace(_local4[17]);
eaves.addFace(_local4[18]);
eaves.addFace(_local4[19]);
roofSide1.addFace(_local4[20]);
roofSide2.addFace(_local4[21]);
roofSide3.addFace(_local4[22]);
roof1.addFace(_local4[23]);
roof1.addFace(_local4[30]);
roof1.addFace(_local4[37]);
roof2.addFace(_local4[24]);
roof2.addFace(_local4[31]);
roof2.addFace(_local4[38]);
roof3.addFace(_local4[25]);
roof3.addFace(_local4[32]);
roof3.addFace(_local4[39]);
roof4.addFace(_local4[26]);
roof4.addFace(_local4[33]);
roof4.addFace(_local4[40]);
roof5.addFace(_local4[27]);
roof5.addFace(_local4[28]);
roof5.addFace(_local4[29]);
roof5.addFace(_local4[34]);
roof5.addFace(_local4[35]);
roof5.addFace(_local4[36]);
roof5.addFace(_local4[41]);
roof5.addFace(_local4[42]);
roof5.addFace(_local4[43]);
addRenderer(frontSide1);
addRenderer(frontSide2);
addRenderer(rightSide1);
addRenderer(rightSide2);
addRenderer(rightSide3);
addRenderer(backSide1);
addRenderer(backSide2);
addRenderer(leftSide);
addRenderer(eaves);
addRenderer(roof1);
addRenderer(roof2);
addRenderer(roof3);
addRenderer(roof4);
addRenderer(roof5);
addRenderer(roofSide1);
addRenderer(roofSide2);
addRenderer(roofSide3);
_local6 = new PolyTextureObject(null, socle, null, [new Point3D(-300, -700, -300), new Point3D(-300, -700, (-250 + socleHeight)), new Point3D(500, 500, (-250 + socleHeight)), new Point3D(500, 500, -300)]);
frontSide1.addTextureObject(_local6);
_local7 = new PolyTextureObject(new RGB(0x1100), null, null, [new Point3D(-300, -700, -300), new Point3D(-300, -700, -220), new Point3D(500, 500, -220), new Point3D(500, 500, -300)]);
_local7.alpha = 0.3;
frontSide1.addTextureObject(_local7, -1, TextureLayer.LIGHT);
frontSide2.addTextureObject(_local6.clone());
frontSide2.addTextureObject(_local7.clone(), -1, TextureLayer.LIGHT);
backSide1.addTextureObject(_local6.clone());
backSide1.addTextureObject(_local7.clone(), -1, TextureLayer.LIGHT);
backSide2.addTextureObject(_local6.clone());
backSide2.addTextureObject(_local7.clone(), -1, TextureLayer.LIGHT);
rightSide1.addTextureObject(_local6.clone());
rightSide1.addTextureObject(_local7.clone(), -1, TextureLayer.LIGHT);
rightSide2.addTextureObject(_local6.clone());
rightSide2.addTextureObject(_local7.clone(), -1, TextureLayer.LIGHT);
rightSide3.addTextureObject(_local6.clone());
rightSide3.addTextureObject(_local7.clone(), -1, TextureLayer.LIGHT);
leftSide.addTextureObject(_local6.clone());
leftSide.addTextureObject(_local7.clone(), -1, TextureLayer.LIGHT);
_local8 = new SpriteData();
_local8.addPhase(doorBmp, null, "off", 0, 0, null, 0, 0);
_local8.addPhase(doorLightBmp, null, "on", 0, 0, null, 0, 0);
door1 = new SpriteTextureObject(_local8, new Point3D(0, -540, -10), null, "off");
doorGlow1 = new PolyTextureObject(new RGB(8355686), null, null, [new Point3D(0, 0, 0), new Point3D(0, 120, 0), new Point3D(0, 120, -150), new Point3D(0, 0, -150)]);
doorGlow1.coords = new Point3D(0, -540, -10);
rightSide1.addTextureObject(door1);
door2 = SpriteTextureObject(door1.clone());
door2.coords = new Point3D(0, 340, -10);
doorGlow2 = PolyTextureObject(doorGlow1.clone());
doorGlow2.coords = new Point3D(0, 220, -10);
leftSide.addTextureObject(door2);
_local9 = new SpriteData();
_local9.addPhase(windowBmp, null, "off", 0, 0, null, 0, 0);
_local9.addPhase(windowLightBmp, null, "on", 0, 0, null, 0, 0);
window1 = new SpriteTextureObject(_local9, new Point3D(-75, 0, -10), null, "off");
windowGlow1 = new PolyTextureObject(new RGB(8355686), null, null, [new Point3D(0, 0, 0), new Point3D(150, 0, 0), new Point3D(150, 0, -150), new Point3D(0, 0, -150)]);
windowGlow1.coords = new Point3D(-75, 0, -10);
frontSide1.addTextureObject(window1);
window2 = SpriteTextureObject(window1.clone());
window2.coords = new Point3D(75, 0, -10);
windowGlow2 = PolyTextureObject(windowGlow1.clone());
backSide1.addTextureObject(window2);
window3 = SpriteTextureObject(window1.clone());
window3.coords = new Point3D(0, -75, -10);
windowGlow3 = PolyTextureObject(windowGlow1.clone());
windowGlow3.points = [new Point3D(0, 0, 0), new Point3D(0, 150, 0), new Point3D(0, 150, -150), new Point3D(0, 0, -150)];
windowGlow3.coords = new Point3D(0, -75, -10);
rightSide2.addTextureObject(window3);
window4 = SpriteTextureObject(window1.clone());
window4.coords = new Point3D(0, 125, -10);
windowGlow4 = PolyTextureObject(windowGlow3.clone());
windowGlow4.coords = new Point3D(0, -25, -10);
leftSide.addTextureObject(window4);
window5 = SpriteTextureObject(window1.clone());
window5.coords = new Point3D(0, -125, -10);
windowGlow5 = PolyTextureObject(windowGlow3.clone());
windowGlow5.coords = new Point3D(0, -275, -10);
leftSide.addTextureObject(window5);
window6 = SpriteTextureObject(window1.clone());
window6.coords = new Point3D(0, -375, -10);
windowGlow6 = PolyTextureObject(windowGlow3.clone());
windowGlow6.coords = new Point3D(0, -525, -10);
leftSide.addTextureObject(window6);
this.shadowLight = _arg1;
addShadows();
omni1 = new Object3D();
omni2 = new Object3D();
_local10 = new Omni(new RGB(8355686), 600, 700);
_local10.coords = new Point3D(0, -450, -85);
omni1.attach(_local10);
_local10 = Omni(_local10.clone());
_local10.coords = new Point3D(0, 150, -85);
omni2.attach(_local10);
}
private function addShadows():void{
var _local1:uint = (_smoothShadows) ? TextureLayer.LIGHT : TextureLayer.DYNAMIC;
frontSide1.addTextureObject(new ShadowTextureObject(shadowLight), 0, _local1);
frontSide2.addTextureObject(new ShadowTextureObject(shadowLight), 0, _local1);
backSide1.addTextureObject(new ShadowTextureObject(shadowLight), 0, _local1);
backSide2.addTextureObject(new ShadowTextureObject(shadowLight), 0, _local1);
leftSide.addTextureObject(new ShadowTextureObject(shadowLight), 0, _local1);
rightSide1.addTextureObject(new ShadowTextureObject(shadowLight), 0, _local1);
rightSide2.addTextureObject(new ShadowTextureObject(shadowLight), 0, _local1);
rightSide3.addTextureObject(new ShadowTextureObject(shadowLight), 0, _local1);
}
public function set smoothShadows(_arg1:Boolean):void{
if (_smoothShadows != _arg1){
removeShadows();
if (_light1){
removeGlow1();
};
if (_light2){
removeGlow2();
};
_smoothShadows = _arg1;
addShadows();
if (_light1){
addGlow1();
};
if (_light2){
addGlow2();
};
};
}
private function removeGlow2():void{
leftSide.removeTextureObject(doorGlow2);
backSide1.removeTextureObject(windowGlow2);
rightSide2.removeTextureObject(windowGlow3);
leftSide.removeTextureObject(windowGlow4);
leftSide.removeTextureObject(windowGlow5);
}
private function addGlow1():void{
var _local1:uint = (_smoothShadows) ? TextureLayer.LIGHT : TextureLayer.DYNAMIC;
doorGlow1.alpha = (_smoothShadows) ? 1 : 0.6;
windowGlow1.alpha = (_smoothShadows) ? 1 : 0.6;
windowGlow6.alpha = (_smoothShadows) ? 1 : 0.6;
doorGlow1.blendMode = (_smoothShadows) ? BlendMode.NORMAL : BlendMode.ADD;
windowGlow1.blendMode = (_smoothShadows) ? BlendMode.NORMAL : BlendMode.ADD;
windowGlow6.blendMode = (_smoothShadows) ? BlendMode.NORMAL : BlendMode.ADD;
rightSide1.addTextureObject(doorGlow1, -1, _local1);
frontSide1.addTextureObject(windowGlow1, -1, _local1);
leftSide.addTextureObject(windowGlow6, -1, _local1);
}
private function removeGlow1():void{
rightSide1.removeTextureObject(doorGlow1);
frontSide1.removeTextureObject(windowGlow1);
leftSide.removeTextureObject(windowGlow6);
}
private function addGlow2():void{
var _local1:uint = (_smoothShadows) ? TextureLayer.LIGHT : TextureLayer.DYNAMIC;
doorGlow2.alpha = (_smoothShadows) ? 1 : 0.6;
windowGlow2.alpha = (_smoothShadows) ? 1 : 0.6;
windowGlow3.alpha = (_smoothShadows) ? 1 : 0.6;
windowGlow4.alpha = (_smoothShadows) ? 1 : 0.6;
windowGlow5.alpha = (_smoothShadows) ? 1 : 0.6;
doorGlow2.blendMode = (_smoothShadows) ? BlendMode.NORMAL : BlendMode.ADD;
windowGlow2.blendMode = (_smoothShadows) ? BlendMode.NORMAL : BlendMode.ADD;
windowGlow3.blendMode = (_smoothShadows) ? BlendMode.NORMAL : BlendMode.ADD;
windowGlow4.blendMode = (_smoothShadows) ? BlendMode.NORMAL : BlendMode.ADD;
windowGlow5.blendMode = (_smoothShadows) ? BlendMode.NORMAL : BlendMode.ADD;
leftSide.addTextureObject(doorGlow2, -1, _local1);
backSide1.addTextureObject(windowGlow2, -1, _local1);
rightSide2.addTextureObject(windowGlow3, -1, _local1);
leftSide.addTextureObject(windowGlow4, -1, _local1);
leftSide.addTextureObject(windowGlow5, -1, _local1);
}
private function removeShadows():void{
var _local1:uint = (_smoothShadows) ? TextureLayer.LIGHT : TextureLayer.DYNAMIC;
frontSide1.removeTextureObject(frontSide1.getTextureObject(0, _local1));
frontSide2.removeTextureObject(frontSide2.getTextureObject(0, _local1));
backSide1.removeTextureObject(backSide1.getTextureObject(0, _local1));
backSide2.removeTextureObject(backSide2.getTextureObject(0, _local1));
leftSide.removeTextureObject(leftSide.getTextureObject(0, _local1));
rightSide1.removeTextureObject(rightSide1.getTextureObject(0, _local1));
rightSide2.removeTextureObject(rightSide2.getTextureObject(0, _local1));
rightSide3.removeTextureObject(rightSide3.getTextureObject(0, _local1));
}
public function get smoothShadows():Boolean{
return (_smoothShadows);
}
public function set light1(_arg1:Boolean):void{
if (_light1 != _arg1){
if (_arg1){
door1.state = "on";
window1.state = "on";
window6.state = "on";
attach(omni1);
addGlow1();
} else {
door1.state = "off";
window1.state = "off";
window6.state = "off";
detach(omni1);
removeGlow1();
};
_light1 = _arg1;
};
}
public function set light2(_arg1:Boolean):void{
if (_light2 != _arg1){
if (_arg1){
door2.state = "on";
window2.state = "on";
window3.state = "on";
window4.state = "on";
window5.state = "on";
attach(omni2);
addGlow2();
} else {
door2.state = "off";
window2.state = "off";
window3.state = "off";
window4.state = "off";
window5.state = "off";
detach(omni2);
removeGlow2();
};
_light2 = _arg1;
};
}
public function get light1():Boolean{
return (_light1);
}
public function get light2():Boolean{
return (_light2);
}
}
}//package com.alternativagame.test
Section 454
//House_bmpDoor (com.alternativagame.test.House_bmpDoor)
package com.alternativagame.test {
import mx.core.*;
public class House_bmpDoor extends BitmapAsset {
}
}//package com.alternativagame.test
Section 455
//House_bmpDoorLight (com.alternativagame.test.House_bmpDoorLight)
package com.alternativagame.test {
import mx.core.*;
public class House_bmpDoorLight extends BitmapAsset {
}
}//package com.alternativagame.test
Section 456
//House_bmpRoof (com.alternativagame.test.House_bmpRoof)
package com.alternativagame.test {
import mx.core.*;
public class House_bmpRoof extends BitmapAsset {
}
}//package com.alternativagame.test
Section 457
//House_bmpRoofSide (com.alternativagame.test.House_bmpRoofSide)
package com.alternativagame.test {
import mx.core.*;
public class House_bmpRoofSide extends BitmapAsset {
}
}//package com.alternativagame.test
Section 458
//House_bmpSocle (com.alternativagame.test.House_bmpSocle)
package com.alternativagame.test {
import mx.core.*;
public class House_bmpSocle extends BitmapAsset {
}
}//package com.alternativagame.test
Section 459
//House_bmpWall (com.alternativagame.test.House_bmpWall)
package com.alternativagame.test {
import mx.core.*;
public class House_bmpWall extends BitmapAsset {
}
}//package com.alternativagame.test
Section 460
//House_bmpWindow (com.alternativagame.test.House_bmpWindow)
package com.alternativagame.test {
import mx.core.*;
public class House_bmpWindow extends BitmapAsset {
}
}//package com.alternativagame.test
Section 461
//House_bmpWindowLight (com.alternativagame.test.House_bmpWindowLight)
package com.alternativagame.test {
import mx.core.*;
public class House_bmpWindowLight extends BitmapAsset {
}
}//package com.alternativagame.test
Section 462
//Male (com.alternativagame.test.Male)
package com.alternativagame.test {
import flash.display.*;
import com.alternativagame.utility.*;
public class Male extends Character {
private static const bmpMale:Class = Male_bmpMale;
private static const bmpMaleAlpha:Class = Male_bmpMaleAlpha;
private static var maleBitmap:BitmapData = BitmapUtility.mergeBitmapAlpha(new bmpMale().bitmapData, new bmpMaleAlpha().bitmapData, true);
public function Male(){
super(maleBitmap);
}
}
}//package com.alternativagame.test
Section 463
//Male_bmpMale (com.alternativagame.test.Male_bmpMale)
package com.alternativagame.test {
import mx.core.*;
public class Male_bmpMale extends BitmapAsset {
}
}//package com.alternativagame.test
Section 464
//Male_bmpMaleAlpha (com.alternativagame.test.Male_bmpMaleAlpha)
package com.alternativagame.test {
import mx.core.*;
public class Male_bmpMaleAlpha extends BitmapAsset {
}
}//package com.alternativagame.test
Section 465
//Stolb (com.alternativagame.test.Stolb)
package com.alternativagame.test {
import flash.geom.*;
import com.alternativagame.engine3d.*;
import com.alternativagame.type.*;
import flash.display.*;
import com.alternativagame.utility.*;
public class Stolb extends Object3D {
private var renderer:SpriteRenderer;
private var _light:Boolean;// = false
private var omni:Omni;
private static const bmpStolb:Class = Stolb_bmpStolb;
private static const bmpStolbAlpha:Class = Stolb_bmpStolbAlpha;
private static var stolbBitmap:BitmapData = BitmapUtility.mergeBitmapAlpha(new bmpStolb().bitmapData, new bmpStolbAlpha().bitmapData, true);
private static var spriteData:SpriteData;
public function Stolb(){
if (spriteData == null){
spriteData = new SpriteData(false, false);
spriteData.addPhase(stolbBitmap, new Rectangle(0, 0, 70, 291), "on", 0, 0, null, 0.5, 1);
spriteData.addPhase(stolbBitmap, new Rectangle(70, 0, 59, 291), "off", 0, 0, null, 0.5, 1);
stolbBitmap.dispose();
};
renderer = new SpriteRenderer(spriteData, "off");
addRenderer(renderer);
omni = new Omni(new RGB(8355686), 300, 500);
omni.z = 280;
}
public function set light(_arg1:Boolean):void{
if (_light != _arg1){
if (_arg1){
renderer.state = "on";
attach(omni);
} else {
renderer.state = "off";
detach(omni);
};
_light = _arg1;
};
}
public function get light():Boolean{
return (_light);
}
}
}//package com.alternativagame.test
Section 466
//Stolb_bmpStolb (com.alternativagame.test.Stolb_bmpStolb)
package com.alternativagame.test {
import mx.core.*;
public class Stolb_bmpStolb extends BitmapAsset {
}
}//package com.alternativagame.test
Section 467
//Stolb_bmpStolbAlpha (com.alternativagame.test.Stolb_bmpStolbAlpha)
package com.alternativagame.test {
import mx.core.*;
public class Stolb_bmpStolbAlpha extends BitmapAsset {
}
}//package com.alternativagame.test
Section 468
//Terrain (com.alternativagame.test.Terrain)
package com.alternativagame.test {
import com.alternativagame.engine3d.*;
import com.alternativagame.type.*;
import com.alternativagame.utility.*;
public class Terrain extends Mesh {
private var _light2:Boolean;// = false
private var renderer:TextureRenderer;
private var _smoothShadows:Boolean;// = true
private var shadowLight:Directional;
private var shadow:ShadowTextureObject;
private var lights1:Set;
private var lights2:Set;
private var lights3:Set;
private var _light1:Boolean;// = false
private var _light3:Boolean;// = false
private static const sand:TextureData = new TextureData(new bmpSand().bitmapData, 1);
private static const bmpRoad:Class = Terrain_bmpRoad;
private static const bmpMaskLeaves:Class = Terrain_bmpMaskLeaves;
private static const bmpMask:Class = Terrain_bmpMask;
private static const maskleaves:TextureData = new TextureData(new bmpMaskLeaves().bitmapData, 1);
private static const maskgrass:TextureData = new TextureData(new bmpMask().bitmapData, 1);
private static const maskgradient:TextureData = new TextureData(new bmpMaskGradient().bitmapData, 1);
private static const bmpTrotuar:Class = Terrain_bmpTrotuar;
private static const road:TextureData = new TextureData(new bmpRoad().bitmapData, 1);
private static const bmpMaskGradient:Class = Terrain_bmpMaskGradient;
private static const trotuar:TextureData = new TextureData(new bmpTrotuar().bitmapData, 1);
private static const bmpGrassLight:Class = Terrain_bmpGrassLight;
private static const grasslight:TextureData = new TextureData(new bmpGrassLight().bitmapData, 1);
private static const bmpSand:Class = Terrain_bmpSand;
private static const bmpGrass:Class = Terrain_bmpGrass;
private static const grass:TextureData = new TextureData(new bmpGrass().bitmapData, 1);
public function Terrain(_arg1:Directional){
var _local2:Array = [new Vertex(1250, 0, 0), new Vertex(-1250, 0, 0), new Vertex(-1250, -100, 10), new Vertex(1250, -100, 10), new Vertex(1250, -300, 10), new Vertex(-1250, -300, 10), new Vertex(1250, -400, 0), new Vertex(-1250, -400, 0), new Vertex(1250, 50, 30), new Vertex(-1250, 50, 30), new Vertex(1250, -450, 30), new Vertex(-1250, -450, 30), new Vertex(1250, -1250, 30), new Vertex(-1250, -1250, 30), new Vertex(-200, 50, 30), new Vertex(-200, 1250, 30), new Vertex(-450, 1250, 30), new Vertex(-450, 50, 30), new Vertex(1250, 50, 30), new Vertex(1250, 250, 30), new Vertex(-200, 250, 30), new Vertex(-850, 1250, 90), new Vertex(-1250, 650, 100), new Vertex(-750, 650, 100), new Vertex(-1250, 1250, 80), new Vertex(1250, 1250, 50), new Vertex(-150, 1250, 50), new Vertex(-150, 300, 50), new Vertex(1250, 300, 50), new Vertex(-850, 300, 90), new Vertex(-450, 0, 0), new Vertex(-200, 0, 0), new Vertex(500, 50, 30), new Vertex(500, 0, 0), new Vertex(-450, 250, 30), new Vertex(500, 250, 30), new Vertex(500, 300, 50), new Vertex(500, 800, 50), new Vertex(-150, 800, 50), new Vertex(-200, 800, 30), new Vertex(-450, 800, 30), new Vertex(500, 1250, 50), new Vertex(1250, 800, 50), new Vertex(-450, -100, 10), new Vertex(-450, -300, 10), new Vertex(-450, -400, 0), new Vertex(-450, -450, 30), new Vertex(-450, -1250, 30), new Vertex(-200, -100, 10), new Vertex(-200, -300, 10), new Vertex(-200, -400, 0), new Vertex(-200, -450, 30), new Vertex(-200, -1250, 30), new Vertex(500, -100, 10), new Vertex(500, -300, 10), new Vertex(500, -400, 0), new Vertex(500, -450, 30), new Vertex(500, -1250, 30)];
var _local3:uint;
while (_local3 < _local2.length) {
addVertex(_local2[_local3]);
_local3++;
};
var _local4:Array = [new Face(_local2[0], _local2[33], _local2[53], _local2[3]), new Face(_local2[33], _local2[31], _local2[48], _local2[53]), new Face(_local2[31], _local2[30], _local2[43], _local2[48]), new Face(_local2[30], _local2[1], _local2[2], _local2[43]), new Face(_local2[3], _local2[53], _local2[54], _local2[4]), new Face(_local2[53], _local2[48], _local2[49], _local2[54]), new Face(_local2[48], _local2[43], _local2[44], _local2[49]), new Face(_local2[43], _local2[2], _local2[5], _local2[44]), new Face(_local2[4], _local2[54], _local2[55], _local2[6]), new Face(_local2[54], _local2[49], _local2[50], _local2[55]), new Face(_local2[49], _local2[44], _local2[45], _local2[50]), new Face(_local2[44], _local2[5], _local2[7], _local2[45]), new Face(_local2[6], _local2[55], _local2[56], _local2[10]), new Face(_local2[55], _local2[50], _local2[51], _local2[56]), new Face(_local2[50], _local2[45], _local2[46], _local2[51]), new Face(_local2[45], _local2[7], _local2[11], _local2[46]), new Face(_local2[10], _local2[56], _local2[57], _local2[12]), new Face(_local2[56], _local2[51], _local2[52], _local2[57]), new Face(_local2[51], _local2[46], _local2[47], _local2[52]), new Face(_local2[46], _local2[11], _local2[13], _local2[47]), new Face(_local2[0], _local2[8], _local2[32], _local2[33]), new Face(_local2[32], _local2[14], _local2[31], _local2[33]), new Face(_local2[14], _local2[17], _local2[30], _local2[31]), new Face(_local2[17], _local2[9], _local2[1], _local2[30]), new Face(_local2[39], _local2[40], _local2[34], _local2[20]), new Face(_local2[15], _local2[16], _local2[40], _local2[39]), new Face(_local2[20], _local2[34], _local2[17], _local2[14]), new Face(_local2[19], _local2[35], _local2[32], _local2[8]), new Face(_local2[35], _local2[20], _local2[14], _local2[32]), new Face(_local2[16], _local2[21], _local2[23]), new Face(_local2[40], _local2[16], _local2[23]), new Face(_local2[21], _local2[24], _local2[22]), new Face(_local2[21], _local2[22], _local2[23]), new Face(_local2[40], _local2[23], _local2[34]), new Face(_local2[23], _local2[29], _local2[34]), new Face(_local2[23], _local2[22], _local2[29]), new Face(_local2[22], _local2[9], _local2[29]), new Face(_local2[34], _local2[29], _local2[17]), new Face(_local2[29], _local2[9], _local2[17]), new Face(_local2[25], _local2[41], _local2[37], _local2[42]), new Face(_local2[41], _local2[26], _local2[38], _local2[37]), new Face(_local2[42], _local2[37], _local2[36], _local2[28]), new Face(_local2[37], _local2[38], _local2[27], _local2[36]), new Face(_local2[28], _local2[36], _local2[35], _local2[19]), new Face(_local2[36], _local2[27], _local2[20], _local2[35]), new Face(_local2[27], _local2[38], _local2[39], _local2[20]), new Face(_local2[38], _local2[26], _local2[15], _local2[39])];
_local3 = 0;
while (_local3 < _local4.length) {
addFace(_local4[_local3]);
_local3++;
};
renderer = new TextureRenderer(null, grass, 2);
addRenderer(renderer);
var _local5:PathTextureObject = new PathTextureObject(null, road, maskgrass);
_local5.points = [new Point3D(-1250, -200, 0), new Point3D(1250, -200, 0)];
var _local6:PathTextureObject = new PathTextureObject(null, sand, maskgradient);
_local6.y = -130;
_local6.points = [new Point3D(-400, 350, 0), new Point3D(-500, 350, 0), new Point3D(-800, 500, 0), new Point3D(-950, 500, 0), new Point3D(-1250, 400, 0)];
var _local7:PathTextureObject = new PathTextureObject(null, trotuar, maskgrass);
_local7.points = [new Point3D(-300, 1250, 0), new Point3D(-300, 60, 0)];
var _local8:PathTextureObject = new PathTextureObject(null, trotuar, maskgrass);
_local8.points = [new Point3D(-250, 150, 0), new Point3D(1250, 150, 0)];
var _local9:PolyTextureObject = new PolyTextureObject(null, grasslight, maskgradient);
_local9.points = [new Point3D(-950, 950, 0), new Point3D(-550, 950, 0), new Point3D(-650, 650, 0), new Point3D(-550, 150, 0), new Point3D(-700, 100, 0), new Point3D(-950, 200, 0)];
var _local10:PolyTextureObject = new PolyTextureObject(null, sand, maskgradient);
_local10.points = [new Point3D(-1300, -1300, 0), new Point3D(-1300, -950, 0), new Point3D(-700, -800, 0), new Point3D(-100, -850, 0), new Point3D(200, -770, 0), new Point3D(450, -820, 0), new Point3D(1300, -950, 0), new Point3D(1300, -1300, 0)];
var _local11:PolyTextureObject = new PolyTextureObject(null, sand, maskgradient);
_local11.points = [new Point3D(0, 150, 0), new Point3D(-200, 250, 0), new Point3D(0, 620, 0)];
renderer.addTextureObject(_local9);
renderer.addTextureObject(_local11);
renderer.addTextureObject(_local10);
renderer.addTextureObject(_local5);
renderer.addTextureObject(_local8);
renderer.addTextureObject(_local6);
renderer.addTextureObject(_local7);
lights1 = new Set(true);
lights2 = new Set(true);
lights3 = new Set(true);
var _local12:LightTextureObject = new LightTextureObject(new RGB(8355686), new Point3D(270, 700, 0), 570, 590, 900, (MathUtility.degree1 * 22), new Point3D(-1, 0, 0));
lights1.add(_local12);
_local12 = LightTextureObject(_local12.clone());
_local12.coords = new Point3D(400, 700, 0);
_local12.direction = new Point3D(1, 0, 0);
lights2.add(_local12);
_local12 = LightTextureObject(_local12.clone());
_local12.coords = new Point3D(470, 700, 0);
_local12.direction = new Point3D(0, -1, 0);
lights2.add(_local12);
_local12 = LightTextureObject(_local12.clone());
_local12.direction = new Point3D(0, 1, 0);
_local12.angle = (MathUtility.degree1 * 19);
_local12.far = 800;
_local12.coords = new Point3D(25, 400, 0);
lights1.add(_local12);
_local12 = LightTextureObject(_local12.clone());
_local12.coords = new Point3D(275, 400, 0);
lights2.add(_local12);
_local12 = LightTextureObject(_local12.clone());
_local12.coords = new Point3D(525, 400, 0);
lights2.add(_local12);
_local12 = LightTextureObject(_local12.clone());
_local12.coords = new Point3D(750, 400, 0);
_local12.angle = (MathUtility.degree1 * 15);
lights2.add(_local12);
_local12 = LightTextureObject(_local12.clone());
_local12.direction = new Point3D(0, -1, 0);
_local12.coords = new Point3D(-10, 1000, 0);
lights1.add(_local12);
_local12 = new LightTextureObject(new RGB(8355686), new Point3D(-460, 0, 0), 20, 60, 400);
lights3.add(_local12);
_local12 = LightTextureObject(_local12.clone());
_local12.coords = new Point3D(1000, 0, 0);
lights3.add(_local12);
this.shadowLight = _arg1;
shadow = new ShadowTextureObject(_arg1);
renderer.addTextureObject(shadow, -1, (_smoothShadows) ? TextureLayer.LIGHT : TextureLayer.DYNAMIC);
}
private function removeLights(_arg1:Set):void{
var _local2:LightTextureObject;
for each (_local2 in _arg1) {
renderer.removeTextureObject(_local2);
};
}
public function get smoothShadows():Boolean{
return (_smoothShadows);
}
public function set light3(_arg1:Boolean):void{
if (_light3 != _arg1){
if (_arg1){
addLights(lights3);
} else {
removeLights(lights3);
};
_light3 = _arg1;
};
}
public function set smoothShadows(_arg1:Boolean):void{
if (_smoothShadows != _arg1){
renderer.removeTextureObject(shadow);
if (_light1){
removeLights(lights1);
};
if (_light2){
removeLights(lights2);
};
if (_light3){
removeLights(lights3);
};
_smoothShadows = _arg1;
renderer.addTextureObject(shadow, -1, (_smoothShadows) ? TextureLayer.LIGHT : TextureLayer.DYNAMIC);
if (_light1){
addLights(lights1);
};
if (_light2){
addLights(lights2);
};
if (_light3){
addLights(lights3);
};
};
}
public function set light1(_arg1:Boolean):void{
if (_light1 != _arg1){
if (_arg1){
addLights(lights1);
} else {
removeLights(lights1);
};
_light1 = _arg1;
};
}
public function get light1():Boolean{
return (_light1);
}
public function get light2():Boolean{
return (_light2);
}
private function addLights(_arg1:Set):void{
var _local2:LightTextureObject;
for each (_local2 in _arg1) {
_local2.alpha = (_smoothShadows) ? 0.7 : 0.4;
renderer.addTextureObject(_local2, -1, (_smoothShadows) ? TextureLayer.LIGHT : TextureLayer.DYNAMIC);
};
}
public function get light3():Boolean{
return (_light3);
}
public function set light2(_arg1:Boolean):void{
if (_light2 != _arg1){
if (_arg1){
addLights(lights2);
} else {
removeLights(lights2);
};
_light2 = _arg1;
};
}
}
}//package com.alternativagame.test
Section 469
//Terrain_bmpGrass (com.alternativagame.test.Terrain_bmpGrass)
package com.alternativagame.test {
import mx.core.*;
public class Terrain_bmpGrass extends BitmapAsset {
}
}//package com.alternativagame.test
Section 470
//Terrain_bmpGrassLight (com.alternativagame.test.Terrain_bmpGrassLight)
package com.alternativagame.test {
import mx.core.*;
public class Terrain_bmpGrassLight extends BitmapAsset {
}
}//package com.alternativagame.test
Section 471
//Terrain_bmpMask (com.alternativagame.test.Terrain_bmpMask)
package com.alternativagame.test {
import mx.core.*;
public class Terrain_bmpMask extends BitmapAsset {
}
}//package com.alternativagame.test
Section 472
//Terrain_bmpMaskGradient (com.alternativagame.test.Terrain_bmpMaskGradient)
package com.alternativagame.test {
import mx.core.*;
public class Terrain_bmpMaskGradient extends BitmapAsset {
}
}//package com.alternativagame.test
Section 473
//Terrain_bmpMaskLeaves (com.alternativagame.test.Terrain_bmpMaskLeaves)
package com.alternativagame.test {
import mx.core.*;
public class Terrain_bmpMaskLeaves extends BitmapAsset {
}
}//package com.alternativagame.test
Section 474
//Terrain_bmpRoad (com.alternativagame.test.Terrain_bmpRoad)
package com.alternativagame.test {
import mx.core.*;
public class Terrain_bmpRoad extends BitmapAsset {
}
}//package com.alternativagame.test
Section 475
//Terrain_bmpSand (com.alternativagame.test.Terrain_bmpSand)
package com.alternativagame.test {
import mx.core.*;
public class Terrain_bmpSand extends BitmapAsset {
}
}//package com.alternativagame.test
Section 476
//Terrain_bmpTrotuar (com.alternativagame.test.Terrain_bmpTrotuar)
package com.alternativagame.test {
import mx.core.*;
public class Terrain_bmpTrotuar extends BitmapAsset {
}
}//package com.alternativagame.test
Section 477
//Tree (com.alternativagame.test.Tree)
package com.alternativagame.test {
import flash.geom.*;
import com.alternativagame.engine3d.*;
import com.alternativagame.type.*;
import flash.display.*;
import com.alternativagame.utility.*;
public class Tree extends Object3D {
private var treeRenderer:SpriteRenderer;
public static const SMALLTREE:String = "smalltree";
public static const SINGLETREE:String = "singletree";
public static const DEADTREE:String = "deadtree";
private static const bmpTreesAlpha:Class = Tree_bmpTreesAlpha;
private static const bmpTrees:Class = Tree_bmpTrees;
public static const KUST:String = "kust";
public static const STONE:String = "stone";
public static const ELKA:String = "elka";
private static var treesBitmap:BitmapData = BitmapUtility.mergeBitmapAlpha(new bmpTrees().bitmapData, new bmpTreesAlpha().bitmapData, true);
private static var treesSpriteData:SpriteData;
public function Tree(_arg1:String){
if (treesSpriteData == null){
treesSpriteData = new SpriteData(true, false);
treesSpriteData.addPhase(treesBitmap, new Rectangle(16, 17, 206, 244), SMALLTREE, 0, 0, null, 0.48, 0.99);
treesSpriteData.addPhase(treesBitmap, new Rectangle(225, 6, 185, 330), ELKA, 0, 0, null, 0.5, 1);
treesSpriteData.addPhase(treesBitmap, new Rectangle(9, 282, 213, 161), KUST, 0, 0, null, 0.5, 0.5);
treesSpriteData.addPhase(treesBitmap, new Rectangle(550, 45, 234, 242), SINGLETREE, 0, 0, null, 0.5, 1);
treesSpriteData.addPhase(treesBitmap, new Rectangle(435, 8, 123, 425), DEADTREE, 0, 0, null, 0.3, 0.99);
treesSpriteData.addPhase(treesBitmap, new Rectangle(313, 332, 106, 98), STONE, 0, 0, null, 0.5, 0.5);
treesBitmap.dispose();
};
treeRenderer = new SpriteRenderer(treesSpriteData, _arg1, 1.5);
addRenderer(treeRenderer);
}
public function get type():String{
return (treeRenderer.state);
}
public function set type(_arg1:String):void{
treeRenderer.state = _arg1;
}
}
}//package com.alternativagame.test
Section 478
//Tree_bmpTrees (com.alternativagame.test.Tree_bmpTrees)
package com.alternativagame.test {
import mx.core.*;
public class Tree_bmpTrees extends BitmapAsset {
}
}//package com.alternativagame.test
Section 479
//Tree_bmpTreesAlpha (com.alternativagame.test.Tree_bmpTreesAlpha)
package com.alternativagame.test {
import mx.core.*;
public class Tree_bmpTreesAlpha extends BitmapAsset {
}
}//package com.alternativagame.test
Section 480
//ConsoleText (com.alternativagame.text.ConsoleText)
package com.alternativagame.text {
public final class ConsoleText {
public static const OBJECT_LOADED:String = "Объект ID:%1 загружен";
public static const RESOURCE_NOT_FOUND:String = "Ресурс ID:%1 не найден";
public static const STORED_SESSION_CLEAR:String = "Сессия очищена";
public static const MODEL_HAS_NO_PARAMS:String = "Модель %1 без параметров";
public static const OBJECT_INFO_NOT_FOUND:String = "Информации об объекте ID:%1 не найдено";
public static const CONSOLE_TYPE_NOT_FOUND:String = "Тип данных с кодом "%1" не существует";
public static const MODEL_NOT_FOUND:String = "Модель с кодом %1 не найдена";
public static const RECIEVE_COMMAND:String = "[%5] <<< ID:%1 %2.%3(%4)";
public static const RESOURCE_LOAD_ERROR:String = "Ошибка загрузки ресурса %1 ID:%2";
public static const STORED_SESSION_NOT_FOUND:String = "Сохранённая сессия не найдена";
public static const CLASS_ALREADY_LOADED:String = "Класс %1 ID:%2 уже загружен";
public static const SERVER_UNAVAILABLE:String = "Сервер не доступен";
public static const CLASS_NOT_FOUND:String = "Класс %1 не найден";
public static const PARSE_PARAMS:String = "Параметры модели %1: %2";
public static const STORED_SESSION_FOUND:String = "Найдена сохранённая сессия %1";
public static const DISCONNECTED:String = "Соединение с сервером завершено";
public static const INVOKED_METHOD:String = "Запуск метода %1 модели %2";
public static const CONSOLE_INITIALIZED:String = "Консоль запущена";
public static const CLASS_LOADED:String = "Класс %1 ID:%2 загружен";
public static const LOADING_RESOURCE:String = "Загружается ресурс %1 ID:%2 версии %3 из %4";
public static const RESOURCE_LOADED:String = "Ресурс %1 ID:%2 загружен";
public static const CONSOLE_LOAD_ERROR:String = "Ошибка загрузки";
public static const CLASS_NOT_LOADED:String = "Класс ID:%1 не найден";
public static const RESOURCE_TYPE_NOT_DESCRIBED:String = "Тип ресурса с кодом %1 не описан";
public static const OBJECT_NOT_FOUND:String = "Объект ID:%1 не найден";
public static const OBJECT_MODEL_INIT_NOT_FOUND:String = "Не найден метод инициализации модели %1 у объекта ID:%2 класса %3";
public static const CONNECTED:String = "Соединение с сервером установлено";
public static const CLASS_UNLOADED:String = "Класс %1 ID:%2 выгружен";
public static const RESOURCE_UNLOADED:String = "Ресурс %1 ID:%2 выгружен";
public static const CONSOLE_LOAD_COMMANDS_FROM_FILE:String = "Загрузка команд из файла %1";
public static const SEND_COMMAND:String = "[%5] >>> ID:%1 %2.%3(%4)";
public static const STORED_SESSION_SET:String = "Установлена сессия %1";
public static const OBJECT_UNLOADED:String = "Объект ID:%1 выгружен";
public static const METHOD_NOT_FOUND:String = "Метод %1 у объекта ID:%2 не найден";
public static const CONSOLE_LOADED_COMMANDS:String = "Загружены команды:
%1";
public static const CONSOLE_SEND_COMMAND:String = "Отправка команды %1";
public static const METHOD_NOT_DESCRIBED:String = "Метод модели %1 с кодом %2 не описан";
}
}//package com.alternativagame.text
Section 481
//TextUtils (com.alternativagame.text.TextUtils)
package com.alternativagame.text {
public final class TextUtils {
public static function insertVars(_arg1:String, ... _args):String{
var _local3:String = _arg1;
var _local4 = 1;
while (_local4 <= _args.length) {
_local3 = _local3.replace(("%" + _local4.toString()), _args[(_local4 - 1)]);
_local4++;
};
return (_local3);
}
}
}//package com.alternativagame.text
Section 482
//Byte (com.alternativagame.type.Byte)
package com.alternativagame.type {
public class Byte {
private var value_int:int;
public static const MIN_VALUE:int = -128;
public static const MAX_VALUE:int = 127;
public function Byte(_arg1:int){
this.value = _arg1;
}
public function get value():int{
return (this.value_int);
}
public function set value(_arg1:int):void{
if ((((_arg1 > MAX_VALUE)) && ((_arg1 < MIN_VALUE)))){
throw (new OverflowError());
};
this.value_int = _arg1;
}
public function toString():String{
return (this.value_int.toString());
}
}
}//package com.alternativagame.type
Section 483
//Double (com.alternativagame.type.Double)
package com.alternativagame.type {
public class Double {
private var _value:Number;
public function Double(_arg1:Number){
this._value = _arg1;
}
public function get value():Number{
return (this._value);
}
public function toString():String{
return (this._value.toString());
}
public function set value(_arg1:Number):void{
this._value = _arg1;
}
}
}//package com.alternativagame.type
Section 484
//Long (com.alternativagame.type.Long)
package com.alternativagame.type {
public class Long {
private var str:String;
private var loint:uint;
private var hiint:int;
public function Long(_arg1:int, _arg2:int):void{
var _local6:String;
var _local13:Number;
var _local14:Number;
var _local15:Number;
super();
this.loint = _arg1;
this.hiint = _arg2;
var _local3:String = ((this.hiint)<0) ? "-" : "";
var _local4:String = Math.abs(this.hiint).toString();
var _local5 = "4294967296";
var _local7:Array = new Array(this.loint.toString());
var _local8:Number = 0;
var _local9:Number = 0;
while (_local9 < _local5.length) {
_local13 = 0;
while (_local13 < _local4.length) {
_local6 = Number((Number(_local5.charAt(((_local5.length - 1) - _local9))) * Number(_local4.charAt(((_local4.length - 1) - _local13))))).toString();
_local14 = 0;
while (_local14 < (_local9 + _local13)) {
_local6 = (_local6 + "0");
_local14++;
};
_local7.push(_local6);
_local8 = ((_local6.length)>_local8) ? _local6.length : _local8;
_local13++;
};
_local9++;
};
var _local10 = "";
var _local11:int;
var _local12:Number = 1;
while (_local12 <= _local8) {
_local15 = 0;
while (_local15 < _local7.length) {
_local6 = _local7[_local15].charAt((_local7[_local15].length - _local12));
_local11 = (_local11 + ((_local6)!="") ? int(_local6) : 0);
_local15++;
};
_local10 = (int((_local11 % 10)).toString() + _local10);
_local11 = (_local11 / 10);
_local12++;
};
if (_local11 > 0){
_local10 = (_local11.toString() + _local10);
};
while ((((_local10.charAt(0) == "0")) && ((_local10.length > 1)))) {
_local10 = _local10.substring(1, _local10.length);
};
str = (_local3 + _local10);
}
public function get hi():int{
return (this.hiint);
}
public function get lo():uint{
return (this.loint);
}
public function toString():String{
return (str);
}
public function equals(_arg1:Long):Boolean{
return ((((_arg1.hi == this.hi)) && ((_arg1.lo == this.lo))));
}
}
}//package com.alternativagame.type
Section 485
//Matrix3D (com.alternativagame.type.Matrix3D)
package com.alternativagame.type {
public final class Matrix3D {
public var a:Number;
public var b:Number;
public var c:Number;
public var d:Number;
public var e:Number;
public var f:Number;
public var g:Number;
public var h:Number;
public var i:Number;
public var j:Number;
public var k:Number;
public var l:Number;
public function Matrix3D(_arg1:Number=1, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0, _arg6:Number=1, _arg7:Number=0, _arg8:Number=0, _arg9:Number=0, _arg10:Number=0, _arg11:Number=1, _arg12:Number=0){
this.a = _arg1;
this.b = _arg2;
this.c = _arg3;
this.d = _arg4;
this.e = _arg5;
this.f = _arg6;
this.g = _arg7;
this.h = _arg8;
this.i = _arg9;
this.j = _arg10;
this.k = _arg11;
this.l = _arg12;
}
public function toString():String{
return (((((((((((((((((((((((("Matrix:\r" + a.toFixed(3)) + "\t") + b.toFixed(3)) + "\t") + c.toFixed(3)) + "\t") + d.toFixed(3)) + "\r") + e.toFixed(3)) + "\t") + f.toFixed(3)) + "\t") + g.toFixed(3)) + "\t") + h.toFixed(3)) + "\r") + i.toFixed(3)) + "\t") + j.toFixed(3)) + "\t") + k.toFixed(3)) + "\t") + l.toFixed(3)));
}
public function inverseTranslate(_arg1:Number, _arg2:Number, _arg3:Number):void{
d = (d - _arg1);
h = (h - _arg2);
l = (l - _arg3);
}
public function scale(_arg1:Number, _arg2:Number, _arg3:Number):void{
a = (a * _arg1);
b = (b * _arg1);
c = (c * _arg1);
d = (d * _arg1);
e = (e * _arg2);
f = (f * _arg2);
g = (g * _arg2);
h = (h * _arg2);
i = (i * _arg3);
j = (j * _arg3);
k = (k * _arg3);
l = (l * _arg3);
}
public function translate(_arg1:Number, _arg2:Number, _arg3:Number):void{
d = (d + _arg1);
h = (h + _arg2);
l = (l + _arg3);
}
public function combine(_arg1:Matrix3D):void{
var _local2:Number = a;
var _local3:Number = b;
var _local4:Number = c;
var _local5:Number = d;
var _local6:Number = e;
var _local7:Number = f;
var _local8:Number = g;
var _local9:Number = h;
var _local10:Number = i;
var _local11:Number = j;
var _local12:Number = k;
var _local13:Number = l;
a = (((_arg1.a * _local2) + (_arg1.b * _local6)) + (_arg1.c * _local10));
b = (((_arg1.a * _local3) + (_arg1.b * _local7)) + (_arg1.c * _local11));
c = (((_arg1.a * _local4) + (_arg1.b * _local8)) + (_arg1.c * _local12));
d = ((((_arg1.a * _local5) + (_arg1.b * _local9)) + (_arg1.c * _local13)) + _arg1.d);
e = (((_arg1.e * _local2) + (_arg1.f * _local6)) + (_arg1.g * _local10));
f = (((_arg1.e * _local3) + (_arg1.f * _local7)) + (_arg1.g * _local11));
g = (((_arg1.e * _local4) + (_arg1.f * _local8)) + (_arg1.g * _local12));
h = ((((_arg1.e * _local5) + (_arg1.f * _local9)) + (_arg1.g * _local13)) + _arg1.h);
i = (((_arg1.i * _local2) + (_arg1.j * _local6)) + (_arg1.k * _local10));
j = (((_arg1.i * _local3) + (_arg1.j * _local7)) + (_arg1.k * _local11));
k = (((_arg1.i * _local4) + (_arg1.j * _local8)) + (_arg1.k * _local12));
l = ((((_arg1.i * _local5) + (_arg1.j * _local9)) + (_arg1.k * _local13)) + _arg1.l);
}
public function inverseConvertToScreen():void{
var _local1:Number = b;
var _local2:Number = f;
var _local3:Number = j;
b = -(c);
f = -(g);
j = -(k);
c = -(_local1);
g = -(_local2);
k = -(_local3);
}
public function convertToScreen():void{
var _local1:Number = e;
var _local2:Number = f;
var _local3:Number = g;
var _local4:Number = h;
e = -(i);
f = -(j);
g = -(k);
h = -(l);
i = -(_local1);
j = -(_local2);
k = -(_local3);
l = -(_local4);
}
public function rotate(_arg1:Number, _arg2:Number, _arg3:Number):void{
var _local4:Number = Math.cos(_arg1);
var _local5:Number = Math.sin(_arg1);
var _local6:Number = Math.cos(_arg2);
var _local7:Number = Math.sin(_arg2);
var _local8:Number = Math.cos(_arg3);
var _local9:Number = Math.sin(_arg3);
var _local10:Number = (_local8 * _local7);
var _local11:Number = (_local9 * _local7);
var _local12:Number = (_local8 * _local6);
var _local13:Number = ((_local10 * _local5) - (_local9 * _local4));
var _local14:Number = ((_local10 * _local4) + (_local9 * _local5));
var _local15:Number = (_local9 * _local6);
var _local16:Number = ((_local11 * _local5) + (_local8 * _local4));
var _local17:Number = ((_local11 * _local4) - (_local8 * _local5));
var _local18:Number = -(_local7);
var _local19:Number = (_local6 * _local5);
var _local20:Number = (_local6 * _local4);
var _local21:Number = a;
var _local22:Number = b;
var _local23:Number = c;
var _local24:Number = d;
var _local25:Number = e;
var _local26:Number = f;
var _local27:Number = g;
var _local28:Number = h;
var _local29:Number = i;
var _local30:Number = j;
var _local31:Number = k;
var _local32:Number = l;
a = (((_local12 * _local21) + (_local13 * _local25)) + (_local14 * _local29));
b = (((_local12 * _local22) + (_local13 * _local26)) + (_local14 * _local30));
c = (((_local12 * _local23) + (_local13 * _local27)) + (_local14 * _local31));
d = (((_local12 * _local24) + (_local13 * _local28)) + (_local14 * _local32));
e = (((_local15 * _local21) + (_local16 * _local25)) + (_local17 * _local29));
f = (((_local15 * _local22) + (_local16 * _local26)) + (_local17 * _local30));
g = (((_local15 * _local23) + (_local16 * _local27)) + (_local17 * _local31));
h = (((_local15 * _local24) + (_local16 * _local28)) + (_local17 * _local32));
i = (((_local18 * _local21) + (_local19 * _local25)) + (_local20 * _local29));
j = (((_local18 * _local22) + (_local19 * _local26)) + (_local20 * _local30));
k = (((_local18 * _local23) + (_local19 * _local27)) + (_local20 * _local31));
l = (((_local18 * _local24) + (_local19 * _local28)) + (_local20 * _local32));
}
public function inverseTransform(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0, _arg6:Number=0, _arg7:Number=1, _arg8:Number=1, _arg9:Number=1):void{
var _local10:Number = Math.cos(-(_arg4));
var _local11:Number = Math.sin(-(_arg4));
var _local12:Number = Math.cos(-(_arg5));
var _local13:Number = Math.sin(-(_arg5));
var _local14:Number = Math.cos(-(_arg6));
var _local15:Number = Math.sin(-(_arg6));
var _local16:Number = (_local11 * _local13);
var _local17:Number = (1 / _arg7);
var _local18:Number = (1 / _arg8);
var _local19:Number = (1 / _arg9);
var _local20:Number = (_local12 * _local17);
var _local21:Number = (_local10 * _local18);
var _local22:Number = (_local11 * _local19);
var _local23:Number = (_local10 * _local19);
var _local24:Number = (_local14 * _local20);
var _local25:Number = (-(_local15) * _local20);
var _local26:Number = (_local13 * _local17);
var _local27:Number = -((((_local24 * _arg1) + (_local25 * _arg2)) + (_local26 * _arg3)));
var _local28:Number = ((_local15 * _local21) + ((_local16 * _local14) * _local18));
var _local29:Number = ((_local14 * _local21) - ((_local16 * _local15) * _local18));
var _local30:Number = ((-(_local11) * _local12) * _local18);
var _local31:Number = -((((_local28 * _arg1) + (_local29 * _arg2)) + (_local30 * _arg3)));
var _local32:Number = ((_local15 * _local22) - ((_local14 * _local13) * _local23));
var _local33:Number = ((_local14 * _local22) + ((_local13 * _local15) * _local23));
var _local34:Number = (_local12 * _local23);
var _local35:Number = -((((_local32 * _arg1) + (_local33 * _arg2)) + (_local34 * _arg3)));
var _local36:Number = a;
var _local37:Number = b;
var _local38:Number = c;
var _local39:Number = d;
var _local40:Number = e;
var _local41:Number = f;
var _local42:Number = g;
var _local43:Number = h;
var _local44:Number = i;
var _local45:Number = j;
var _local46:Number = k;
var _local47:Number = l;
a = (((_local24 * _local36) + (_local25 * _local40)) + (_local26 * _local44));
b = (((_local24 * _local37) + (_local25 * _local41)) + (_local26 * _local45));
c = (((_local24 * _local38) + (_local25 * _local42)) + (_local26 * _local46));
d = ((((_local24 * _local39) + (_local25 * _local43)) + (_local26 * _local47)) + _local27);
e = (((_local28 * _local36) + (_local29 * _local40)) + (_local30 * _local44));
f = (((_local28 * _local37) + (_local29 * _local41)) + (_local30 * _local45));
g = (((_local28 * _local38) + (_local29 * _local42)) + (_local30 * _local46));
h = ((((_local28 * _local39) + (_local29 * _local43)) + (_local30 * _local47)) + _local31);
i = (((_local32 * _local36) + (_local33 * _local40)) + (_local34 * _local44));
j = (((_local32 * _local37) + (_local33 * _local41)) + (_local34 * _local45));
k = (((_local32 * _local38) + (_local33 * _local42)) + (_local34 * _local46));
l = ((((_local32 * _local39) + (_local33 * _local43)) + (_local34 * _local47)) + _local35);
}
public function invert():void{
var _local1:Number = a;
var _local2:Number = b;
var _local3:Number = c;
var _local4:Number = d;
var _local5:Number = e;
var _local6:Number = f;
var _local7:Number = g;
var _local8:Number = h;
var _local9:Number = i;
var _local10:Number = j;
var _local11:Number = k;
var _local12:Number = l;
var _local13:Number = (((((((-(_local3) * _local6) * _local9) + ((_local2 * _local7) * _local9)) + ((_local3 * _local5) * _local10)) - ((_local1 * _local7) * _local10)) - ((_local2 * _local5) * _local11)) + ((_local1 * _local6) * _local11));
a = (((-(_local7) * _local10) + (_local6 * _local11)) / _local13);
b = (((_local3 * _local10) - (_local2 * _local11)) / _local13);
c = (((-(_local3) * _local6) + (_local2 * _local7)) / _local13);
d = ((((((((_local4 * _local7) * _local10) - ((_local3 * _local8) * _local10)) - ((_local4 * _local6) * _local11)) + ((_local2 * _local8) * _local11)) + ((_local3 * _local6) * _local12)) - ((_local2 * _local7) * _local12)) / _local13);
e = (((_local7 * _local9) - (_local5 * _local11)) / _local13);
f = (((-(_local3) * _local9) + (_local1 * _local11)) / _local13);
g = (((_local3 * _local5) - (_local1 * _local7)) / _local13);
h = ((((((((_local3 * _local8) * _local9) - ((_local4 * _local7) * _local9)) + ((_local4 * _local5) * _local11)) - ((_local1 * _local8) * _local11)) - ((_local3 * _local5) * _local12)) + ((_local1 * _local7) * _local12)) / _local13);
i = (((-(_local6) * _local9) + (_local5 * _local10)) / _local13);
j = (((_local2 * _local9) - (_local1 * _local10)) / _local13);
k = (((-(_local2) * _local5) + (_local1 * _local6)) / _local13);
l = ((((((((_local4 * _local6) * _local9) - ((_local2 * _local8) * _local9)) - ((_local4 * _local5) * _local10)) + ((_local1 * _local8) * _local10)) + ((_local2 * _local5) * _local12)) - ((_local1 * _local6) * _local12)) / _local13);
}
public function inverseCombine(_arg1:Matrix3D):void{
var _local2:Number = a;
var _local3:Number = b;
var _local4:Number = c;
var _local5:Number = d;
var _local6:Number = e;
var _local7:Number = f;
var _local8:Number = g;
var _local9:Number = h;
var _local10:Number = i;
var _local11:Number = j;
var _local12:Number = k;
var _local13:Number = l;
a = (((_local2 * _arg1.a) + (_local3 * _arg1.e)) + (_local4 * _arg1.i));
b = (((_local2 * _arg1.b) + (_local3 * _arg1.f)) + (_local4 * _arg1.j));
c = (((_local2 * _arg1.c) + (_local3 * _arg1.g)) + (_local4 * _arg1.k));
d = ((((_local2 * _arg1.d) + (_local3 * _arg1.h)) + (_local4 * _arg1.l)) + _local5);
e = (((_local6 * _arg1.a) + (_local7 * _arg1.e)) + (_local8 * _arg1.i));
f = (((_local6 * _arg1.b) + (_local7 * _arg1.f)) + (_local8 * _arg1.j));
g = (((_local6 * _arg1.c) + (_local7 * _arg1.g)) + (_local8 * _arg1.k));
h = ((((_local6 * _arg1.d) + (_local7 * _arg1.h)) + (_local8 * _arg1.l)) + _local9);
i = (((_local10 * _arg1.a) + (_local11 * _arg1.e)) + (_local12 * _arg1.i));
j = (((_local10 * _arg1.b) + (_local11 * _arg1.f)) + (_local12 * _arg1.j));
k = (((_local10 * _arg1.c) + (_local11 * _arg1.g)) + (_local12 * _arg1.k));
l = ((((_local10 * _arg1.d) + (_local11 * _arg1.h)) + (_local12 * _arg1.l)) + _local13);
}
public function clone():Matrix3D{
return (new Matrix3D(a, b, c, d, e, f, g, h, i, j, k, l));
}
public function inverseRotate(_arg1:Number, _arg2:Number, _arg3:Number):void{
var _local4:Number = Math.cos(-(_arg1));
var _local5:Number = Math.sin(-(_arg1));
var _local6:Number = Math.cos(-(_arg2));
var _local7:Number = Math.sin(-(_arg2));
var _local8:Number = Math.cos(-(_arg3));
var _local9:Number = Math.sin(-(_arg3));
var _local10:Number = (_local5 * _local7);
var _local11:Number = (_local6 * _local8);
var _local12:Number = (-(_local6) * _local9);
var _local13:Number = _local7;
var _local14:Number = ((_local4 * _local9) + (_local10 * _local8));
var _local15:Number = ((_local4 * _local8) - (_local10 * _local9));
var _local16:Number = (-(_local5) * _local6);
var _local17:Number = ((_local5 * _local9) - ((_local4 * _local8) * _local7));
var _local18:Number = ((_local5 * _local8) + ((_local4 * _local7) * _local9));
var _local19:Number = (_local4 * _local6);
var _local20:Number = a;
var _local21:Number = b;
var _local22:Number = c;
var _local23:Number = d;
var _local24:Number = e;
var _local25:Number = f;
var _local26:Number = g;
var _local27:Number = h;
var _local28:Number = i;
var _local29:Number = j;
var _local30:Number = k;
var _local31:Number = l;
a = (((_local11 * _local20) + (_local12 * _local24)) + (_local13 * _local28));
b = (((_local11 * _local21) + (_local12 * _local25)) + (_local13 * _local29));
c = (((_local11 * _local22) + (_local12 * _local26)) + (_local13 * _local30));
d = (((_local11 * _local23) + (_local12 * _local27)) + (_local13 * _local31));
e = (((_local14 * _local20) + (_local15 * _local24)) + (_local16 * _local28));
f = (((_local14 * _local21) + (_local15 * _local25)) + (_local16 * _local29));
g = (((_local14 * _local22) + (_local15 * _local26)) + (_local16 * _local30));
h = (((_local14 * _local23) + (_local15 * _local27)) + (_local16 * _local31));
i = (((_local17 * _local20) + (_local18 * _local24)) + (_local19 * _local28));
j = (((_local17 * _local21) + (_local18 * _local25)) + (_local19 * _local29));
k = (((_local17 * _local22) + (_local18 * _local26)) + (_local19 * _local30));
l = (((_local17 * _local23) + (_local18 * _local27)) + (_local19 * _local31));
}
public function copy(_arg1:Matrix3D):void{
a = _arg1.a;
b = _arg1.b;
c = _arg1.c;
d = _arg1.d;
e = _arg1.e;
f = _arg1.f;
g = _arg1.g;
h = _arg1.h;
i = _arg1.i;
j = _arg1.j;
k = _arg1.k;
l = _arg1.l;
}
public function equals(_arg1:Matrix3D, _arg2:Number=0):Boolean{
var _local3:Number = (a - _arg1.a);
var _local4:Number = (b - _arg1.b);
var _local5:Number = (c - _arg1.c);
var _local6:Number = (d - _arg1.d);
var _local7:Number = (e - _arg1.e);
var _local8:Number = (f - _arg1.f);
var _local9:Number = (g - _arg1.g);
var _local10:Number = (h - _arg1.h);
var _local11:Number = (i - _arg1.i);
var _local12:Number = (j - _arg1.j);
var _local13:Number = (k - _arg1.k);
var _local14:Number = (l - _arg1.l);
_local3 = ((_local3)<0) ? -(_local3) : _local3;
_local4 = ((_local4)<0) ? -(_local4) : _local4;
_local5 = ((_local5)<0) ? -(_local5) : _local5;
_local6 = ((_local6)<0) ? -(_local6) : _local6;
_local7 = ((_local7)<0) ? -(_local7) : _local7;
_local8 = ((_local8)<0) ? -(_local8) : _local8;
_local9 = ((_local9)<0) ? -(_local9) : _local9;
_local10 = ((_local10)<0) ? -(_local10) : _local10;
_local11 = ((_local11)<0) ? -(_local11) : _local11;
_local12 = ((_local12)<0) ? -(_local12) : _local12;
_local13 = ((_local13)<0) ? -(_local13) : _local13;
_local14 = ((_local14)<0) ? -(_local14) : _local14;
return ((((((((((((((((((((((((_local3 <= _arg2)) && ((_local4 <= _arg2)))) && ((_local5 <= _arg2)))) && ((_local6 <= _arg2)))) && ((_local7 <= _arg2)))) && ((_local8 <= _arg2)))) && ((_local9 <= _arg2)))) && ((_local10 <= _arg2)))) && ((_local11 <= _arg2)))) && ((_local12 <= _arg2)))) && ((_local13 <= _arg2)))) && ((_local14 <= _arg2))));
}
public function inverseScale(_arg1:Number, _arg2:Number, _arg3:Number):void{
var _local4:Number = (1 / _arg1);
var _local5:Number = (1 / _arg2);
var _local6:Number = (1 / _arg3);
a = (a * _local4);
b = (b * _local4);
c = (c * _local4);
d = (d * _local4);
e = (e * _local5);
f = (f * _local5);
g = (g * _local5);
h = (h * _local5);
i = (i * _local6);
j = (j * _local6);
k = (k * _local6);
l = (l * _local6);
}
public function transform(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0, _arg6:Number=0, _arg7:Number=1, _arg8:Number=1, _arg9:Number=1):void{
var _local10:Number = Math.cos(_arg4);
var _local11:Number = Math.sin(_arg4);
var _local12:Number = Math.cos(_arg5);
var _local13:Number = Math.sin(_arg5);
var _local14:Number = Math.cos(_arg6);
var _local15:Number = Math.sin(_arg6);
var _local16:Number = (_local14 * _local13);
var _local17:Number = (_local15 * _local13);
var _local18:Number = (_local12 * _arg7);
var _local19:Number = (_local11 * _arg8);
var _local20:Number = (_local10 * _arg8);
var _local21:Number = (_local10 * _arg9);
var _local22:Number = (_local11 * _arg9);
var _local23:Number = (_local14 * _local18);
var _local24:Number = ((_local16 * _local19) - (_local15 * _local20));
var _local25:Number = ((_local16 * _local21) + (_local15 * _local22));
var _local26:Number = _arg1;
var _local27:Number = (_local15 * _local18);
var _local28:Number = ((_local17 * _local19) + (_local14 * _local20));
var _local29:Number = ((_local17 * _local21) - (_local14 * _local22));
var _local30:Number = _arg2;
var _local31:Number = (-(_local13) * _arg7);
var _local32:Number = (_local12 * _local19);
var _local33:Number = (_local12 * _local21);
var _local34:Number = _arg3;
var _local35:Number = a;
var _local36:Number = b;
var _local37:Number = c;
var _local38:Number = d;
var _local39:Number = e;
var _local40:Number = f;
var _local41:Number = g;
var _local42:Number = h;
var _local43:Number = i;
var _local44:Number = j;
var _local45:Number = k;
var _local46:Number = l;
a = (((_local23 * _local35) + (_local24 * _local39)) + (_local25 * _local43));
b = (((_local23 * _local36) + (_local24 * _local40)) + (_local25 * _local44));
c = (((_local23 * _local37) + (_local24 * _local41)) + (_local25 * _local45));
d = ((((_local23 * _local38) + (_local24 * _local42)) + (_local25 * _local46)) + _local26);
e = (((_local27 * _local35) + (_local28 * _local39)) + (_local29 * _local43));
f = (((_local27 * _local36) + (_local28 * _local40)) + (_local29 * _local44));
g = (((_local27 * _local37) + (_local28 * _local41)) + (_local29 * _local45));
h = ((((_local27 * _local38) + (_local28 * _local42)) + (_local29 * _local46)) + _local30);
i = (((_local31 * _local35) + (_local32 * _local39)) + (_local33 * _local43));
j = (((_local31 * _local36) + (_local32 * _local40)) + (_local33 * _local44));
k = (((_local31 * _local37) + (_local32 * _local41)) + (_local33 * _local45));
l = ((((_local31 * _local38) + (_local32 * _local42)) + (_local33 * _local46)) + _local34);
}
public function translateLocal(_arg1:Number, _arg2:Number, _arg3:Number):void{
d = (d + (((a * _arg1) + (b * _arg2)) + (c * _arg3)));
h = (h + (((e * _arg1) + (f * _arg2)) + (g * _arg3)));
l = (l + (((i * _arg1) + (j * _arg2)) + (k * _arg3)));
}
public function identity():void{
a = 1;
b = 0;
c = 0;
d = 0;
e = 0;
f = 1;
g = 0;
h = 0;
i = 0;
j = 0;
k = 1;
l = 0;
}
public function resetTranslate():void{
d = 0;
h = 0;
l = 0;
}
public static function inverseTranslationMatrix(_arg1:Number, _arg2:Number, _arg3:Number):Matrix3D{
return (new Matrix3D(1, 0, 0, -(_arg1), 0, 1, 0, -(_arg2), 0, 0, 1, -(_arg3)));
}
public static function translationMatrix(_arg1:Number, _arg2:Number, _arg3:Number):Matrix3D{
return (new Matrix3D(1, 0, 0, _arg1, 0, 1, 0, _arg2, 0, 0, 1, _arg3));
}
public static function inverseRotationMatrix(_arg1:Number, _arg2:Number, _arg3:Number):Matrix3D{
var _local4:Number = Math.cos(-(_arg1));
var _local5:Number = Math.sin(-(_arg1));
var _local6:Number = Math.cos(-(_arg2));
var _local7:Number = Math.sin(-(_arg2));
var _local8:Number = Math.cos(-(_arg3));
var _local9:Number = Math.sin(-(_arg3));
var _local10:Number = (_local5 * _local7);
return (new Matrix3D((_local6 * _local8), (-(_local6) * _local9), _local7, 0, ((_local4 * _local9) + (_local10 * _local8)), ((_local4 * _local8) - (_local10 * _local9)), (-(_local5) * _local6), 0, ((_local5 * _local9) - ((_local4 * _local8) * _local7)), ((_local5 * _local8) + ((_local4 * _local7) * _local9)), (_local4 * _local6), 0));
}
public static function inverseTransformationMatrix(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0, _arg6:Number=0, _arg7:Number=1, _arg8:Number=1, _arg9:Number=1):Matrix3D{
var _local10:Number = Math.cos(-(_arg4));
var _local11:Number = Math.sin(-(_arg4));
var _local12:Number = Math.cos(-(_arg5));
var _local13:Number = Math.sin(-(_arg5));
var _local14:Number = Math.cos(-(_arg6));
var _local15:Number = Math.sin(-(_arg6));
var _local16:Number = (_local11 * _local13);
var _local17:Number = (1 / _arg7);
var _local18:Number = (1 / _arg8);
var _local19:Number = (1 / _arg9);
var _local20:Number = (_local12 * _local17);
var _local21:Number = (_local10 * _local18);
var _local22:Number = (_local11 * _local19);
var _local23:Number = (_local10 * _local19);
var _local24:Number = (_local14 * _local20);
var _local25:Number = (-(_local15) * _local20);
var _local26:Number = (_local13 * _local17);
var _local27:Number = ((_local15 * _local21) + ((_local16 * _local14) * _local18));
var _local28:Number = ((_local14 * _local21) - ((_local16 * _local15) * _local18));
var _local29:Number = ((-(_local11) * _local12) * _local18);
var _local30:Number = ((_local15 * _local22) - ((_local14 * _local13) * _local23));
var _local31:Number = ((_local14 * _local22) + ((_local13 * _local15) * _local23));
var _local32:Number = (_local12 * _local23);
return (new Matrix3D(_local24, _local25, _local26, -((((_local24 * _arg1) + (_local25 * _arg2)) + (_local26 * _arg3))), _local27, _local28, _local29, -((((_local27 * _arg1) + (_local28 * _arg2)) + (_local29 * _arg3))), _local30, _local31, _local32, -((((_local30 * _arg1) + (_local31 * _arg2)) + (_local32 * _arg3)))));
}
public static function inverseMatrix(_arg1:Matrix3D):Matrix3D{
var _local2:Number = (((((((-(_arg1.c) * _arg1.f) * _arg1.i) + ((_arg1.b * _arg1.g) * _arg1.i)) + ((_arg1.c * _arg1.e) * _arg1.j)) - ((_arg1.a * _arg1.g) * _arg1.j)) - ((_arg1.b * _arg1.e) * _arg1.k)) + ((_arg1.a * _arg1.f) * _arg1.k));
var _local3:Number = (((-(_arg1.g) * _arg1.j) + (_arg1.f * _arg1.k)) / _local2);
var _local4:Number = (((_arg1.c * _arg1.j) - (_arg1.b * _arg1.k)) / _local2);
var _local5:Number = (((-(_arg1.c) * _arg1.f) + (_arg1.b * _arg1.g)) / _local2);
var _local6:Number = ((((((((_arg1.d * _arg1.g) * _arg1.j) - ((_arg1.c * _arg1.h) * _arg1.j)) - ((_arg1.d * _arg1.f) * _arg1.k)) + ((_arg1.b * _arg1.h) * _arg1.k)) + ((_arg1.c * _arg1.f) * _arg1.l)) - ((_arg1.b * _arg1.g) * _arg1.l)) / _local2);
var _local7:Number = (((_arg1.g * _arg1.i) - (_arg1.e * _arg1.k)) / _local2);
var _local8:Number = (((-(_arg1.c) * _arg1.i) + (_arg1.a * _arg1.k)) / _local2);
var _local9:Number = (((_arg1.c * _arg1.e) - (_arg1.a * _arg1.g)) / _local2);
var _local10:Number = ((((((((_arg1.c * _arg1.h) * _arg1.i) - ((_arg1.d * _arg1.g) * _arg1.i)) + ((_arg1.d * _arg1.e) * _arg1.k)) - ((_arg1.a * _arg1.h) * _arg1.k)) - ((_arg1.c * _arg1.e) * _arg1.l)) + ((_arg1.a * _arg1.g) * _arg1.l)) / _local2);
var _local11:Number = (((-(_arg1.f) * _arg1.i) + (_arg1.e * _arg1.j)) / _local2);
var _local12:Number = (((_arg1.b * _arg1.i) - (_arg1.a * _arg1.j)) / _local2);
var _local13:Number = (((-(_arg1.b) * _arg1.e) + (_arg1.a * _arg1.f)) / _local2);
var _local14:Number = ((((((((_arg1.d * _arg1.f) * _arg1.i) - ((_arg1.b * _arg1.h) * _arg1.i)) - ((_arg1.d * _arg1.e) * _arg1.j)) + ((_arg1.a * _arg1.h) * _arg1.j)) + ((_arg1.b * _arg1.e) * _arg1.l)) - ((_arg1.a * _arg1.f) * _arg1.l)) / _local2);
return (new Matrix3D(_local3, _local4, _local5, _local6, _local7, _local8, _local9, _local10, _local11, _local12, _local13, _local14));
}
public static function inverseScaleMatrix(_arg1:Number, _arg2:Number, _arg3:Number):Matrix3D{
return (new Matrix3D((1 / _arg1), 0, 0, 0, 0, (1 / _arg2), 0, 0, 0, 0, (1 / _arg3), 0));
}
public static function scaleMatrix(_arg1:Number, _arg2:Number, _arg3:Number):Matrix3D{
return (new Matrix3D(_arg1, 0, 0, 0, 0, _arg2, 0, 0, 0, 0, _arg3, 0));
}
public static function transformationMatrix(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0, _arg6:Number=0, _arg7:Number=1, _arg8:Number=1, _arg9:Number=1):Matrix3D{
var _local10:Number = Math.cos(_arg4);
var _local11:Number = Math.sin(_arg4);
var _local12:Number = Math.cos(_arg5);
var _local13:Number = Math.sin(_arg5);
var _local14:Number = Math.cos(_arg6);
var _local15:Number = Math.sin(_arg6);
var _local16:Number = (_local14 * _local13);
var _local17:Number = (_local15 * _local13);
var _local18:Number = (_local12 * _arg7);
var _local19:Number = (_local11 * _arg8);
var _local20:Number = (_local10 * _arg8);
var _local21:Number = (_local10 * _arg9);
var _local22:Number = (_local11 * _arg9);
return (new Matrix3D((_local14 * _local18), ((_local16 * _local19) - (_local15 * _local20)), ((_local16 * _local21) + (_local15 * _local22)), _arg1, (_local15 * _local18), ((_local17 * _local19) + (_local14 * _local20)), ((_local17 * _local21) - (_local14 * _local22)), _arg2, (-(_local13) * _arg7), (_local12 * _local19), (_local12 * _local21), _arg3));
}
public static function product(_arg1:Matrix3D, _arg2:Matrix3D):Matrix3D{
return (new Matrix3D((((_arg1.a * _arg2.a) + (_arg1.b * _arg2.e)) + (_arg1.c * _arg2.i)), (((_arg1.a * _arg2.b) + (_arg1.b * _arg2.f)) + (_arg1.c * _arg2.j)), (((_arg1.a * _arg2.c) + (_arg1.b * _arg2.g)) + (_arg1.c * _arg2.k)), ((((_arg1.a * _arg2.d) + (_arg1.b * _arg2.h)) + (_arg1.c * _arg2.l)) + _arg1.d), (((_arg1.e * _arg2.a) + (_arg1.f * _arg2.e)) + (_arg1.g * _arg2.i)), (((_arg1.e * _arg2.b) + (_arg1.f * _arg2.f)) + (_arg1.g * _arg2.j)), (((_arg1.e * _arg2.c) + (_arg1.f * _arg2.g)) + (_arg1.g * _arg2.k)), ((((_arg1.e * _arg2.d) + (_arg1.f * _arg2.h)) + (_arg1.g * _arg2.l)) + _arg1.h), (((_arg1.i * _arg2.a) + (_arg1.j * _arg2.e)) + (_arg1.k * _arg2.i)), (((_arg1.i * _arg2.b) + (_arg1.j * _arg2.f)) + (_arg1.k * _arg2.j)), (((_arg1.i * _arg2.c) + (_arg1.j * _arg2.g)) + (_arg1.k * _arg2.k)), ((((_arg1.i * _arg2.d) + (_arg1.j * _arg2.h)) + (_arg1.k * _arg2.l)) + _arg1.l)));
}
public static function rotationMatrix(_arg1:Number, _arg2:Number, _arg3:Number):Matrix3D{
var _local4:Number = Math.cos(_arg1);
var _local5:Number = Math.sin(_arg1);
var _local6:Number = Math.cos(_arg2);
var _local7:Number = Math.sin(_arg2);
var _local8:Number = Math.cos(_arg3);
var _local9:Number = Math.sin(_arg3);
var _local10:Number = (_local8 * _local7);
var _local11:Number = (_local9 * _local7);
return (new Matrix3D((_local8 * _local6), ((_local10 * _local5) - (_local9 * _local4)), ((_local10 * _local4) + (_local9 * _local5)), 0, (_local9 * _local6), ((_local11 * _local5) + (_local8 * _local4)), ((_local11 * _local4) - (_local8 * _local5)), 0, -(_local7), (_local6 * _local5), (_local6 * _local4), 0));
}
}
}//package com.alternativagame.type
Section 486
//OverflowError (com.alternativagame.type.OverflowError)
package com.alternativagame.type {
public class OverflowError extends Error {
}
}//package com.alternativagame.type
Section 487
//Point3D (com.alternativagame.type.Point3D)
package com.alternativagame.type {
import flash.geom.*;
import com.alternativagame.utility.*;
public final class Point3D {
public var x:Number;
public var y:Number;
public var z:Number;
public function Point3D(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0){
this.x = _arg1;
this.y = _arg2;
this.z = _arg3;
}
public function transform(_arg1:Matrix3D):void{
var _local2:Number = x;
var _local3:Number = y;
var _local4:Number = z;
x = ((((_arg1.a * _local2) + (_arg1.b * _local3)) + (_arg1.c * _local4)) + _arg1.d);
y = ((((_arg1.e * _local2) + (_arg1.f * _local3)) + (_arg1.g * _local4)) + _arg1.h);
z = ((((_arg1.i * _local2) + (_arg1.j * _local3)) + (_arg1.k * _local4)) + _arg1.l);
}
public function add(_arg1:Point3D):void{
x = (x + _arg1.x);
y = (y + _arg1.y);
z = (z + _arg1.z);
}
public function toString():String{
return (((((("X: " + x.toFixed(3)) + " Y:") + y.toFixed(3)) + " Z:") + z.toFixed(3)));
}
public function multiply(_arg1:Number):void{
x = (x * _arg1);
y = (y * _arg1);
z = (z * _arg1);
}
public function floor():void{
x = Math.floor(x);
y = Math.floor(y);
z = Math.floor(z);
}
public function get length():Number{
return (Math.sqrt((((x * x) + (y * y)) + (z * z))));
}
public function set length(_arg1:Number):void{
var _local2:Number = length;
var _local3:Number = ((_local2)!=0) ? (_arg1 / length) : 0;
x = (x * _local3);
y = (y * _local3);
z = (z * _local3);
}
public function normalize():void{
length = 1;
}
public function get lengthSqr():Number{
return ((((x * x) + (y * y)) + (z * z)));
}
public function reset():void{
x = 0;
y = 0;
z = 0;
}
public function round():void{
x = Math.round(x);
y = Math.round(y);
z = Math.round(z);
}
public function invert():void{
x = -(x);
y = -(y);
z = -(z);
}
public function toPoint():Point{
return (new Point(x, y));
}
public function subtract(_arg1:Point3D):void{
x = (x - _arg1.x);
y = (y - _arg1.y);
z = (z - _arg1.z);
}
public function copy(_arg1:Point3D):void{
x = _arg1.x;
y = _arg1.y;
z = _arg1.z;
}
public function clone():Point3D{
return (new Point3D(x, y, z));
}
public function equals(_arg1:Point3D, _arg2:Number=0):Boolean{
var _local3:Number = (x - _arg1.x);
var _local4:Number = (y - _arg1.y);
var _local5:Number = (z - _arg1.z);
_local3 = ((_local3)<0) ? -(_local3) : _local3;
_local4 = ((_local4)<0) ? -(_local4) : _local4;
_local5 = ((_local5)<0) ? -(_local5) : _local5;
return ((((((_local3 <= _arg2)) && ((_local4 <= _arg2)))) && ((_local5 <= _arg2))));
}
public static function cross(_arg1:Point3D, _arg2:Point3D):Point3D{
return (new Point3D(((_arg1.y * _arg2.z) - (_arg1.z * _arg2.y)), ((_arg1.z * _arg2.x) - (_arg1.x * _arg2.z)), ((_arg1.x * _arg2.y) - (_arg1.y * _arg2.x))));
}
public static function cross2D(_arg1:Point3D, _arg2:Point3D):Number{
return (((_arg1.x * _arg2.y) - (_arg1.y * _arg2.x)));
}
public static function angle(_arg1:Point3D, _arg2:Point3D):Number{
var _local3:Number = (_arg1.length * _arg2.length);
var _local4:Number = ((_local3)!=0) ? (dot(_arg1, _arg2) / _local3) : 1;
return (Math.acos(_local4));
}
public static function average(_arg1:Point3D, _arg2:Point3D=null, _arg3:Point3D=null, _arg4:Point3D=null):Point3D{
if (_arg2 == null){
return (_arg1.clone());
};
if (_arg3 == null){
return (new Point3D(((_arg1.x + _arg2.x) / 2), ((_arg1.y + _arg2.y) / 2), ((_arg1.z + _arg2.z) / 2)));
};
if (_arg4 == null){
return (new Point3D((((_arg1.x + _arg2.x) + _arg3.x) / 3), (((_arg1.y + _arg2.y) + _arg3.y) / 3), (((_arg1.z + _arg2.z) + _arg3.z) / 3)));
};
return (new Point3D(((((_arg1.x + _arg2.x) + _arg3.x) + _arg4.x) / 4), ((((_arg1.y + _arg2.y) + _arg3.y) + _arg4.y) / 4), ((((_arg1.z + _arg2.z) + _arg3.z) + _arg4.z) / 4)));
}
public static function random(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):Point3D{
return (new Point3D(MathUtility.random(_arg1, _arg2), MathUtility.random(_arg3, _arg4), MathUtility.random(_arg5, _arg6)));
}
public static function interpolate(_arg1:Point3D, _arg2:Point3D, _arg3:Number=0.5):Point3D{
return (new Point3D((_arg1.x + ((_arg2.x - _arg1.x) * _arg3)), (_arg1.y + ((_arg2.y - _arg1.y) * _arg3)), (_arg1.z + ((_arg2.z - _arg1.z) * _arg3))));
}
public static function dot(_arg1:Point3D, _arg2:Point3D):Number{
return ((((_arg1.x * _arg2.x) + (_arg1.y * _arg2.y)) + (_arg1.z * _arg2.z)));
}
public static function sum(_arg1:Point3D, _arg2:Point3D):Point3D{
return (new Point3D((_arg1.x + _arg2.x), (_arg1.y + _arg2.y), (_arg1.z + _arg2.z)));
}
public static function dot2D(_arg1:Point3D, _arg2:Point3D):Number{
return (((_arg1.x * _arg2.x) + (_arg1.y * _arg2.y)));
}
public static function difference(_arg1:Point3D, _arg2:Point3D):Point3D{
return (new Point3D((_arg1.x - _arg2.x), (_arg1.y - _arg2.y), (_arg1.z - _arg2.z)));
}
public static function angleFast(_arg1:Point3D, _arg2:Point3D):Number{
var _local3:Number = dot(_arg1, _arg2);
if (Math.abs(_local3) > 1){
_local3 = ((_local3)>0) ? 1 : -1;
};
return (Math.acos(_local3));
}
}
}//package com.alternativagame.type
Section 488
//RGB (com.alternativagame.type.RGB)
package com.alternativagame.type {
import com.alternativagame.utility.*;
public final class RGB {
public var green:uint;// = 0
public var red:uint;// = 0
public var blue:uint;// = 0
public function RGB(... _args){
if (_args.length > 0){
if (_args.length > 1){
red = _args[0];
green = _args[1];
blue = _args[2];
} else {
red = ((_args[0] & 0xFF0000) >>> 16);
green = ((_args[0] & 0xFF00) >>> 8);
blue = (_args[0] & 0xFF);
};
};
}
public function add(_arg1:RGB):void{
red = (red + _arg1.red);
green = (green + _arg1.green);
blue = (blue + _arg1.blue);
}
public function multiply(_arg1:Number):void{
red = (red * _arg1);
green = (green * _arg1);
blue = (blue * _arg1);
}
public function subtract(_arg1:RGB):void{
red = ((red)<_arg1.red) ? 0 : (red - _arg1.red);
green = ((green)<_arg1.green) ? 0 : (green - _arg1.green);
blue = ((blue)<_arg1.blue) ? 0 : (blue - _arg1.blue);
}
public function toString():String{
var _local1:String = red.toString(16).toUpperCase();
var _local2:String = green.toString(16).toUpperCase();
var _local3:String = blue.toString(16).toUpperCase();
_local1 = ((_local1.length)==1) ? ("0" + _local1) : _local1;
_local2 = ((_local2.length)==1) ? ("0" + _local2) : _local2;
_local3 = ((_local3.length)==1) ? ("0" + _local3) : _local3;
return ((((("[RGB: " + _local1) + _local2) + _local3) + "]"));
}
public function toInt():uint{
return ((((((red >>> 8)) ? 0xFF : red << 16) + (((green >>> 8)) ? 0xFF : green << 8)) + ((blue >>> 8)) ? 0xFF : blue));
}
public function clone():RGB{
return (new RGB(red, green, blue));
}
public function equals(_arg1:RGB):Boolean{
return ((((((red == _arg1.red)) && ((green == _arg1.green)))) && ((blue == _arg1.blue))));
}
public static function interpolate(_arg1:RGB, _arg2:RGB, _arg3:Number):RGB{
return (new RGB((_arg1.red + ((_arg2.red - _arg1.red) * _arg3)), (_arg1.green + ((_arg2.green - _arg1.green) * _arg3)), (_arg1.blue + ((_arg2.blue - _arg1.blue) * _arg3))));
}
public static function random(_arg1:uint=0, _arg2:uint=0xFF, _arg3:uint=0, _arg4:uint=0xFF, _arg5:uint=0, _arg6:uint=0xFF):RGB{
return (new RGB(MathUtility.random(_arg1, _arg2), MathUtility.random(_arg3, _arg4), MathUtility.random(_arg5, _arg6)));
}
public static function average(_arg1:RGB, _arg2:RGB):RGB{
return (new RGB(((_arg1.red + _arg2.red) >>> 1), ((_arg1.green + _arg2.green) >>> 1), ((_arg1.blue + _arg2.blue) >>> 1)));
}
}
}//package com.alternativagame.type
Section 489
//Set (com.alternativagame.type.Set)
package com.alternativagame.type {
import flash.utils.*;
import com.alternativagame.utility.*;
public final class Set extends Dictionary {
private var weakKeys:Boolean;
public function Set(_arg1:Boolean=false):void{
this.weakKeys = _arg1;
super(_arg1);
}
public function add(_arg1):void{
this[_arg1] = _arg1;
}
public function isEmpty():Boolean{
var _local1:*;
for each (_local1 in this) {
return (false);
};
return (true);
}
public function remove(_arg1):void{
delete this[_arg1];
}
public function get length():uint{
var _local2:*;
var _local1:uint;
for each (_local2 in this) {
_local1++;
};
return (_local1);
}
public function clear():void{
var _local1:*;
for each (_local1 in this) {
delete this[_local1];
};
}
public function toString():String{
var _local2:*;
var _local1 = "";
for each (_local2 in this) {
_local1 = (_local1 + ("," + _local2.toString()));
};
return (_local1.substring(1));
}
public function first(){
var _local1:*;
for each (_local1 in this) {
return (_local1);
};
return (null);
}
public function concat(_arg1:Set):void{
var _local2:*;
for (_local2 in _arg1) {
this[_local2] = _local2;
};
}
public function has(_arg1):Boolean{
return (!((this[_arg1] == undefined)));
}
public function any(){
var _local3:*;
var _local1:uint;
var _local2:uint = MathUtility.random(0, length);
for each (_local3 in this) {
if (_local1 == _local2){
return (_local3);
};
_local1++;
};
return (null);
}
public function clone():Set{
var _local2:*;
var _local1:Set = new Set(weakKeys);
for each (_local2 in this) {
_local1.add(_local2);
};
return (_local1);
}
}
}//package com.alternativagame.type
Section 490
//Short (com.alternativagame.type.Short)
package com.alternativagame.type {
public class Short {
private var value_int:int;
public static const MIN_VALUE:int = -32768;
public static const MAX_VALUE:int = 32767;
public function Short(_arg1:int){
this.value = _arg1;
}
public function get value():int{
return (this.value_int);
}
public function set value(_arg1:int):void{
if ((((_arg1 > MAX_VALUE)) && ((_arg1 < MIN_VALUE)))){
throw (new OverflowError());
};
this.value_int = _arg1;
}
public function toString():String{
return (this.value_int.toString());
}
}
}//package com.alternativagame.type
Section 491
//SpriteData (com.alternativagame.type.SpriteData)
package com.alternativagame.type {
import flash.geom.*;
import flash.display.*;
import com.alternativagame.utility.*;
public class SpriteData {
private var states:Array;
private var _scale:Boolean;
private var _resolution:Number;
private var _rotate:Boolean;
public function SpriteData(_arg1:Boolean=true, _arg2:Boolean=true, _arg3:Number=1){
states = new Array();
_scale = _arg1;
_rotate = _arg2;
_resolution = _arg3;
}
public function addPhase(_arg1:BitmapData, _arg2:Rectangle=null, _arg3:String="default", _arg4:int=0, _arg5:int=0, _arg6:Point=null, _arg7:Number=0.5, _arg8:Number=0.5):void{
var _local9:BitmapData;
var _local16:Point;
var _local18:Set;
if (_arg2 != null){
_local9 = BitmapUtility.getFragment(_arg1, _arg2);
} else {
_local9 = _arg1;
};
var _local10:Rectangle = BitmapUtility.getNonTransparentRect(_local9);
var _local11 = ((_local10.width % 2) == 0);
var _local12 = ((_local10.height % 2) == 0);
var _local13:Boolean;
var _local14:Boolean;
if (((_local11) && (_local12))){
if (_local10.width > _local10.height){
_local10.width++;
_local13 = true;
} else {
_local10.height++;
_local14 = true;
};
};
var _local15:BitmapData = BitmapUtility.getFragment(_local9, _local10);
if (_arg2 != null){
_local9.dispose();
};
if (_local13){
_local15.fillRect(new Rectangle((_local15.width - 1), 0, 1, _local15.height), 0);
};
if (_local14){
_local15.fillRect(new Rectangle(0, (_local15.height - 1), _local15.width, 1), 0);
};
if (_arg6 != null){
_local16 = _arg6.clone();
_arg6.clone().x = (_local16.x - _local10.x);
_local16.y = (_local16.y - _local10.y);
} else {
_local16 = new Point((_local10.width * _arg7), (_local10.height * _arg8));
};
var _local17:Matrix3D = Matrix3D.rotationMatrix(MathUtility.toRadian(_arg4), 0, MathUtility.toRadian(_arg5));
_local17.scale(_resolution, _resolution, _resolution);
if (states[_arg3] == undefined){
_local18 = new Set(true);
states[_arg3] = _local18;
} else {
_local18 = states[_arg3];
};
_local18.add(new SpritePhase(_local15, _local17, _local16));
}
public function getPhase(_arg1:String, _arg2:Point3D):SpritePhase{
var _local3:Set;
var _local4:SpritePhase;
var _local5:Number;
var _local6:SpritePhase;
var _local7:Number;
if (states[_arg1] != undefined){
_local3 = states[_arg1];
_local5 = Math.PI;
for each (_local6 in _local3) {
_local7 = Point3D.angleFast(_local6.direction, _arg2);
if (_local7 <= _local5){
_local5 = _local7;
_local4 = _local6;
};
};
return (_local4);
};
return (null);
}
public function get scale():Boolean{
return (_scale);
}
public function get resolution():Number{
return (_resolution);
}
public function get rotate():Boolean{
return (_rotate);
}
}
}//package com.alternativagame.type
Section 492
//SpritePhase (com.alternativagame.type.SpritePhase)
package com.alternativagame.type {
import flash.geom.*;
import flash.display.*;
public class SpritePhase {
private var _direction:Point3D;
private var _origin:Point;
private var _matrix:Matrix3D;
private var _bitmapData:BitmapData;
public function SpritePhase(_arg1:BitmapData, _arg2:Matrix3D, _arg3:Point){
_bitmapData = _arg1;
_matrix = _arg2;
_direction = new Point3D(_arg2.b, _arg2.f, _arg2.j);
_origin = _arg3;
}
public function get matrix():Matrix3D{
return (_matrix);
}
public function get origin():Point{
return (_origin);
}
public function get bitmapData():BitmapData{
return (_bitmapData);
}
public function get direction():Point3D{
return (_direction);
}
}
}//package com.alternativagame.type
Section 493
//TextureData (com.alternativagame.type.TextureData)
package com.alternativagame.type {
import flash.display.*;
public class TextureData {
private var _bitmapData:BitmapData;
private var _resolution:Number;
public function TextureData(_arg1:BitmapData, _arg2:Number=1){
_bitmapData = _arg1;
_resolution = _arg2;
}
public function toString():String{
return ((((((("[TextureData " + _bitmapData.width) + "x") + _bitmapData.height) + " ") + _resolution.toFixed(1)) + "cm/px]"));
}
public function get bitmapData():BitmapData{
return (_bitmapData);
}
public function get resolution():Number{
return (_resolution);
}
}
}//package com.alternativagame.type
Section 494
//BitmapUtility (com.alternativagame.utility.BitmapUtility)
package com.alternativagame.utility {
import flash.geom.*;
import flash.display.*;
public class BitmapUtility {
public static function getNonTransparentRect(_arg1:BitmapData):Rectangle{
return ((_arg1.transparent) ? _arg1.getColorBoundsRect(4278190080, 0, false) : _arg1.rect);
}
public static function getFragment(_arg1:BitmapData, _arg2:Rectangle):BitmapData{
var _local3:BitmapData = new BitmapData(_arg2.width, _arg2.height, _arg1.transparent);
_local3.copyPixels(_arg1, _arg2, new Point());
return (_local3);
}
public static function mergeBitmapAlpha(_arg1:BitmapData, _arg2:BitmapData, _arg3:Boolean=false):BitmapData{
var _local4:BitmapData = new BitmapData(_arg1.width, _arg1.height);
_local4.copyPixels(_arg1, _arg1.rect, new Point());
_local4.copyChannel(_arg2, _arg2.rect, new Point(), BitmapDataChannel.RED, BitmapDataChannel.ALPHA);
if (_arg3){
_arg1.dispose();
_arg2.dispose();
};
return (_local4);
}
}
}//package com.alternativagame.utility
Section 495
//MathUtility (com.alternativagame.utility.MathUtility)
package com.alternativagame.utility {
import flash.geom.*;
public final class MathUtility {
public static const degree60:Number = (Math.PI / 3);
private static const toDeg:Number = (180 / Math.PI);
public static const degree45:Number = (Math.PI / 4);
private static const toRad:Number = (Math.PI / 180);
public static const degree180:Number = Math.PI;
public static const degree360:Number = (Math.PI + Math.PI);
public static const degree90:Number = (Math.PI / 2);
public static const degree1:Number = toRad;
public static const degree30:Number = (Math.PI / 6);
public static const degree10:Number = (Math.PI / 18);
public static const degree5:Number = (Math.PI / 36);
public static function random(_arg1:Number=0, _arg2:Number=0):Number{
if (arguments.length == 0){
return (Math.random());
};
if (arguments.length == 1){
return ((Math.random() * _arg1));
};
return (((Math.random() * (_arg2 - _arg1)) + _arg1));
}
public static function segmentDistance(_arg1:Point, _arg2:Point, _arg3:Point):Number{
var _local4:Number = (_arg2.x - _arg1.x);
var _local5:Number = (_arg2.y - _arg1.y);
var _local6:Number = (_arg3.x - _arg1.x);
var _local7:Number = (_arg3.y - _arg1.y);
return ((((_local4 * _local7) - (_local5 * _local6)) / Math.sqrt(((_local4 * _local4) + (_local5 * _local5)))));
}
public static function randomAngle():Number{
return ((Math.random() * degree360));
}
public static function vectorAngleFast(_arg1:Point, _arg2:Point):Number{
var _local3:Number = vectorDot(_arg1, _arg2);
if (Math.abs(_local3) > 1){
_local3 = ((_local3)>0) ? 1 : -1;
};
return (Math.acos(_local3));
}
public static function vectorAngle(_arg1:Point, _arg2:Point):Number{
var _local3:Number = (_arg1.length * _arg2.length);
var _local4:Number = ((_local3)!=0) ? (vectorDot(_arg1, _arg2) / _local3) : 1;
return (Math.acos(_local4));
}
public static function limitAngle(_arg1:Number):Number{
var _local2:Number = (_arg1 % degree360);
_local2 = ((_local2)>0) ? ((_local2)>degree180) ? (_local2 - degree360) : _local2 : ((_local2)<-(degree180)) ? (_local2 + degree360) : _local2;
return (_local2);
}
public static function vectorDot(_arg1:Point, _arg2:Point):Number{
return (((_arg1.x * _arg2.x) + (_arg1.y * _arg2.y)));
}
public static function toDegree(_arg1:Number):Number{
return ((_arg1 * toDeg));
}
public static function deltaAngle(_arg1:Number, _arg2:Number):Number{
var _local3:Number = (_arg2 - _arg1);
if (_local3 > degree180){
return ((_local3 - degree360));
};
if (_local3 < -(degree180)){
return ((_local3 + degree360));
};
return (_local3);
}
public static function toRadian(_arg1:Number):Number{
return ((_arg1 * toRad));
}
public static function vectorCross(_arg1:Point, _arg2:Point):Number{
return (((_arg1.x * _arg2.y) - (_arg1.y * _arg2.x)));
}
public static function triangleHasPoint(_arg1:Point, _arg2:Point, _arg3:Point, _arg4:Point):Boolean{
if (vectorCross(_arg3.subtract(_arg1), _arg4.subtract(_arg1)) <= 0){
if (vectorCross(_arg2.subtract(_arg3), _arg4.subtract(_arg3)) <= 0){
if (vectorCross(_arg1.subtract(_arg2), _arg4.subtract(_arg2)) <= 0){
return (true);
};
return (false);
} else {
return (false);
};
//unresolved jump
};
return (false);
}
public static function equals(_arg1:Number, _arg2:Number, _arg3:Number=0):Boolean{
return ((Math.abs((_arg2 - _arg1)) <= _arg3));
}
}
}//package com.alternativagame.utility
Section 496
//MouseUtility (com.alternativagame.utility.MouseUtility)
package com.alternativagame.utility {
import flash.geom.*;
import flash.display.*;
public class MouseUtility {
private static var _stage:Stage = null;
public static function init(_arg1:Stage):void{
_stage = _arg1;
}
public static function localCoords(_arg1:DisplayObject):Point{
return (_arg1.globalToLocal(globalCoords()));
}
public static function globalCoords(_arg1:Boolean=true):Point{
var _local3:int;
var _local4:int;
var _local2:Point;
if (_stage != null){
_local3 = _stage.mouseX;
_local4 = _stage.mouseY;
if (_arg1){
_local3 = ((_local3)<0) ? 0 : ((_local3)>_stage.stageWidth) ? _stage.stageWidth : _local3;
_local4 = ((_local4)<0) ? 0 : ((_local4)>_stage.stageHeight) ? _stage.stageHeight : _local4;
};
_local2 = new Point(_local3, _local4);
} else {
throw (new Error("MouseUtility don't have link to stage. Use MouseUtility.init(stage) before."));
};
return (_local2);
}
}
}//package com.alternativagame.utility
Section 497
//ObjectUtility (com.alternativagame.utility.ObjectUtility)
package com.alternativagame.utility {
import flash.utils.*;
public class ObjectUtility {
public static function getClassTree(_arg1, _arg2:Class=null):Array{
var _local3:Array = new Array();
var _local4:Class = Class(getDefinitionByName(getQualifiedClassName(_arg1)));
_arg2 = ((_arg2)==null) ? Object : _arg2;
while (_local4 != _arg2) {
_local3.push(_local4);
_local4 = Class(getDefinitionByName(getQualifiedSuperclassName(_local4)));
};
_local3.push(_local4);
return (_local3);
}
public static function getClassName(_arg1):String{
var _local2:String = getQualifiedClassName(_arg1);
return (_local2.substring((_local2.indexOf("::") + 2)));
}
}
}//package com.alternativagame.utility
Section 498
//BitmapAsset (mx.core.BitmapAsset)
package mx.core {
import flash.display.*;
public class BitmapAsset extends FlexBitmap implements IFlexAsset, IFlexDisplayObject {
mx_internal static const VERSION:String = "3.0.0.0";
public function BitmapAsset(_arg1:BitmapData=null, _arg2:String="auto", _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
public function get measuredHeight():Number{
if (bitmapData){
return (bitmapData.height);
};
return (0);
}
public function move(_arg1:Number, _arg2:Number):void{
this.x = _arg1;
this.y = _arg2;
}
public function get measuredWidth():Number{
if (bitmapData){
return (bitmapData.width);
};
return (0);
}
public function setActualSize(_arg1:Number, _arg2:Number):void{
width = _arg1;
height = _arg2;
}
}
}//package mx.core
Section 499
//FlexBitmap (mx.core.FlexBitmap)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexBitmap extends Bitmap {
mx_internal static const VERSION:String = "3.0.0.0";
public function FlexBitmap(_arg1:BitmapData=null, _arg2:String="auto", _arg3:Boolean=false){
var bitmapData = _arg1;
var pixelSnapping = _arg2;
var smoothing = _arg3;
super(bitmapData, pixelSnapping, smoothing);
try {
name = NameUtil.createUniqueName(this);
} catch(e:Error) {
};
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 500
//FontAsset (mx.core.FontAsset)
package mx.core {
import flash.text.*;
public class FontAsset extends Font implements IFlexAsset {
mx_internal static const VERSION:String = "3.0.0.0";
}
}//package mx.core
Section 501
//IFlexAsset (mx.core.IFlexAsset)
package mx.core {
public interface IFlexAsset {
}
}//package mx.core
Section 502
//IFlexDisplayObject (mx.core.IFlexDisplayObject)
package mx.core {
import flash.events.*;
import flash.display.*;
public interface IFlexDisplayObject extends IBitmapDrawable, IEventDispatcher {
function get y():Number;
function get width():Number;
function get name():String;
function set width(_arg1:Number):void;
function get measuredHeight():Number;
function get scaleX():Number;
function get scaleY():Number;
function move(_arg1:Number, _arg2:Number):void;
function set height(_arg1:Number):void;
function set name(_arg1:String):void;
function set mask(_arg1:DisplayObject):void;
function set scaleX(_arg1:Number):void;
function set scaleY(_arg1:Number):void;
function get measuredWidth():Number;
function set visible(_arg1:Boolean):void;
function get alpha():Number;
function get height():Number;
function get parent():DisplayObjectContainer;
function get mask():DisplayObject;
function set x(_arg1:Number):void;
function setActualSize(_arg1:Number, _arg2:Number):void;
function get visible():Boolean;
function get x():Number;
function set y(_arg1:Number):void;
function set alpha(_arg1:Number):void;
}
}//package mx.core
Section 503
//IRepeaterClient (mx.core.IRepeaterClient)
package mx.core {
public interface IRepeaterClient {
function get instanceIndices():Array;
function set instanceIndices(_arg1:Array):void;
function get isDocument():Boolean;
function set repeaters(_arg1:Array):void;
function initializeRepeaterArrays(_arg1:IRepeaterClient):void;
function get repeaters():Array;
function set repeaterIndices(_arg1:Array):void;
function get repeaterIndices():Array;
}
}//package mx.core
Section 504
//mx_internal (mx.core.mx_internal)
package mx.core {
public namespace mx_internal = "http://www.adobe.com/2006/flex/mx/internal";
}//package mx.core
Section 505
//NameUtil (mx.utils.NameUtil)
package mx.utils {
import flash.display.*;
import mx.core.*;
import flash.utils.*;
public class NameUtil {
mx_internal static const VERSION:String = "3.0.0.0";
private static var counter:int = 0;
public static function displayObjectToString(_arg1:DisplayObject):String{
var _local2:String;
var _local4:String;
var _local5:Array;
var _local3:DisplayObject = _arg1;
while (_local3 != null) {
if (((((_local3.parent) && (_local3.stage))) && ((_local3.parent == _local3.stage)))){
break;
};
_local4 = _local3.name;
if ((_local3 is IRepeaterClient)){
_local5 = IRepeaterClient(_local3).instanceIndices;
if (_local5){
_local4 = (_local4 + (("[" + _local5.join("][")) + "]"));
};
};
_local2 = ((_local2 == null)) ? _local4 : ((_local4 + ".") + _local2);
_local3 = _local3.parent;
};
return (_local2);
}
public static function createUniqueName(_arg1:Object):String{
if (!_arg1){
return (null);
};
var _local2:String = getQualifiedClassName(_arg1);
var _local3:int = _local2.indexOf("::");
if (_local3 != -1){
_local2 = _local2.substr((_local3 + 2));
};
var _local4:int = _local2.charCodeAt((_local2.length - 1));
if ((((_local4 >= 48)) && ((_local4 <= 57)))){
_local2 = (_local2 + "_");
};
return ((_local2 + counter++));
}
}
}//package mx.utils
Section 506
//Test3D (Test3D)
package {
import flash.geom.*;
import flash.events.*;
import com.alternativagame.engine3d.*;
import com.alternativagame.type.*;
import flash.display.*;
import com.alternativagame.gui.container.*;
import com.alternativagame.test.*;
import flash.text.*;
import com.alternativagame.gui.admin.*;
import com.alternativagame.admin.*;
import com.alternativagame.init.*;
import com.alternativagame.utility.*;
import flash.ui.*;
public class Test3D extends Sprite {
private var _lightnings:Boolean;// = false
private var male:Male;
private var femaleDirection:Point;
private var stolb2:Stolb;
private var ambient:Ambient;
private var maleIterator:uint;
private var stolb1:Stolb;
private var house:House;
private var mode:uint;// = 1
private var renderIterator:uint;// = 100
private var view:View;
private var ambientColors:Array;
private var copyrightText:String;// = "Это демо-версия 3D-движка многопользовательской игры Alternativa. Блог разработчиков: <a href="http://blog.alternativagame.com/ru"><u>http://blog.alternativagame.com/ru</u>. Copyright ООО "Альтернатива Гейм" 2007</a>"
private var terrain:Terrain;
private var drag:Point;
private var copyright:TextField;
private var lightning:uint;// = 0
private var sun:Directional;
private var controlsWindow:DemoControlsWindow;
private var panning:Boolean;// = false
private var female:Female;
private var _charactersTalk:Boolean;// = false
private var cursor:Sprite;
private var lightningIterator:uint;
private var femaleIterator:uint;
private var controlsWindowContainer:WindowContainer;
private var sunColors:Array;
private var phrases:Array;
private var hour:Number;// = 14
private var maleDirection:Point;
private var _charactersMove:Boolean;// = false
private static const bmpLogo:Class = Test3D_bmpLogo;
private static const logoBitmap:BitmapData = new bmpLogo().bitmapData;
public function Test3D(){
var _local5:Tree;
maleDirection = new Point();
femaleDirection = new Point();
phrases = ["Скорее бы игру запустили уже!", "Я бы даже инвестировал в такой проект", "Некоторые компании собираются размещать здесь рекламу!", "Да, онлайновые игры изменятся, говорю тебе", "Кто-нибудь видел подобный движок на Flash?", "Эта Alternativa будет хорошим местом для развлечений :)", "Уже хочу поиграть!", "Кстати, их дневник разработки лежит на http://blog.alternativagame.com/ru/", "А можно лицензировать движок для своего проекта?", "А ты им напиши на team@alternativagame.com!", "Надо бы мне позвонить разработчикам...", "Да, круто!", "Я прямо чувствую себя человеком!", "А, что?", "Чо?", "Не буду я этим заниматься!", "Вот ещё, ерунда какая", "Тьфу!"];
super();
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.frameRate = 100;
mouseEnabled = false;
MouseUtility.init(stage);
view = new View(stage.stageWidth, stage.stageHeight);
view.pitch = -(MathUtility.degree30);
view.yaw = MathUtility.degree30;
view.zoom = 1;
addChild(view);
controlsWindow = new DemoControlsWindow(this);
controlsWindowContainer = new WindowContainer();
controlsWindowContainer.skinManager = new AdminSkinManager();
controlsWindowContainer.addObject(controlsWindow);
addChild(controlsWindowContainer);
controlsWindow.x = 20;
controlsWindow.y = 60;
controlsWindowContainer.repaintCurrentSize();
FPS.init(this);
cursor = new Sprite();
addChild(cursor);
AlternativaFont.init();
GUI.init(cursor);
view.object = new Object3D();
ambient = new Ambient();
sun = new Directional();
view.object.attach(ambient);
view.object.attach(sun);
sunColors = new Array(24);
ambientColors = new Array(24);
sunColors[0] = new RGB(13141);
ambientColors[0] = new RGB(4386);
sunColors[6] = new RGB(0x2222);
ambientColors[6] = new RGB(4386);
sunColors[8] = new RGB(4469538);
ambientColors[8] = new RGB(0x222222);
sunColors[10] = new RGB(8351846);
ambientColors[10] = new RGB(0x333333);
sunColors[13] = new RGB(9470839);
ambientColors[13] = new RGB(0x333333);
sunColors[18] = new RGB(8351846);
ambientColors[18] = new RGB(0x333333);
sunColors[22] = new RGB(8349232);
ambientColors[22] = new RGB(3351057);
sunColors[24] = sunColors[0];
ambientColors[24] = ambientColors[0];
terrain = new Terrain(sun);
view.object.attach(terrain);
house = new House(sun);
house.rotZ = -(MathUtility.degree90);
house.coords = new Point3D(470, 700, 300);
view.object.attach(house);
male = new Male();
male.coords = new Point3D(0, -200, 36);
male.rotZ = MathUtility.degree60;
view.object.attach(male);
female = new Female();
female.coords = new Point3D(-200, -50, 36);
female.rotZ = (MathUtility.degree1 * 230);
view.object.attach(female);
var _local1:Array = [{type:Tree.SMALLTREE, coords:new Point3D(-100, 60, 30), scale:1}, {type:Tree.SMALLTREE, coords:new Point3D(100, (60 + 15), 30), scale:0.9}, {type:Tree.SMALLTREE, coords:new Point3D(300, (60 + 5), 30), scale:1.1}, {type:Tree.SMALLTREE, coords:new Point3D(500, (60 - 15), 30), scale:1.2}, {type:Tree.SMALLTREE, coords:new Point3D(700, (60 - 10), 30), scale:1}, {type:Tree.DEADTREE, coords:new Point3D(-550, -1100, 30), scale:1}, {type:Tree.ELKA, coords:new Point3D(750, -720, 30), scale:1.3}, {type:Tree.ELKA, coords:new Point3D(450, -720, 30), scale:1}, {type:Tree.ELKA, coords:new Point3D(250, -690, 30), scale:1.1}, {type:Tree.ELKA, coords:new Point3D(0, -700, 30), scale:0.8}, {type:Tree.ELKA, coords:new Point3D(-200, -720, 30), scale:0.9}, {type:Tree.ELKA, coords:new Point3D(-800, -700, 30), scale:0.8}, {type:Tree.ELKA, coords:new Point3D(-1100, -670, 30), scale:1.2}, {type:Tree.ELKA, coords:new Point3D(0, 1100, 30), scale:0.9}, {type:Tree.ELKA, coords:new Point3D(200, 1100, 30), scale:1.1}, {type:Tree.ELKA, coords:new Point3D(330, 1100, 30), scale:0.8}, {type:Tree.SINGLETREE, coords:new Point3D(-800, 200, 67), scale:1.3}, {type:Tree.SINGLETREE, coords:new Point3D(1100, 300, 50), scale:1}, {type:Tree.STONE, coords:new Point3D(170, 400, 87), scale:1}, {type:Tree.KUST, coords:new Point3D(-1100, 1100, 175), scale:1.3}, {type:Tree.KUST, coords:new Point3D(-1100, 950, 145), scale:0.9}, {type:Tree.KUST, coords:new Point3D(-1150, 750, 165), scale:1.1}, {type:Tree.KUST, coords:new Point3D(-920, 1050, 160), scale:1.1}, {type:Tree.KUST, coords:new Point3D(-930, 900, 150), scale:0.8}];
var _local2:uint;
while (_local2 < _local1.length) {
_local5 = new Tree(_local1[_local2].type);
_local5.coords = _local1[_local2].coords;
_local5.scaleX = _local1[_local2].scale;
_local5.scaleY = _local1[_local2].scale;
_local5.scaleZ = _local1[_local2].scale;
view.object.attach(_local5);
_local2++;
};
var _local3:Fence = new Fence();
_local3.coords = new Point3D(-130, 1075, 48);
_local3.rotZ = MathUtility.degree90;
view.object.attach(_local3);
_local3 = new Fence();
_local3.coords = new Point3D(1060, 500, 48);
_local3.scaleX = 1.09;
view.object.attach(_local3);
stolb1 = new Stolb();
stolb1.coords = new Point3D(-460, 0, 0);
view.object.attach(stolb1);
stolb2 = new Stolb();
stolb2.coords = new Point3D(1000, 0, 0);
view.object.attach(stolb2);
copyright = new TextField();
copyright.selectable = false;
copyright.embedFonts = true;
copyright.antiAliasType = AntiAliasType.ADVANCED;
copyright.htmlText = copyrightText;
copyright.setTextFormat(new TextFormat("Alternativa", 10, 0xFFFFFF, null, null, null, null, null, TextFormatAlign.CENTER));
copyright.width = stage.stageWidth;
copyright.y = (stage.stageHeight - 18);
addChild(copyright);
var _local4:Bitmap = new Bitmap(logoBitmap);
_local4.x = 7;
_local4.y = 7;
addChild(_local4);
controlsWindow.init();
addEventListener(Event.ENTER_FRAME, onEnterFrame);
view.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
stage.addEventListener(KeyboardEvent.KEY_UP, onKeyUp);
stage.addEventListener(Event.RESIZE, onResize);
}
private function onResize(_arg1:Event):void{
view.width = stage.stageWidth;
view.height = stage.stageHeight;
controlsWindowContainer.repaintCurrentSize();
copyright.width = stage.stageWidth;
copyright.y = (stage.stageHeight - 18);
}
public function get smoothTextures():Boolean{
return (TextureRenderer.smooth);
}
public function get smoothLightEffects():Boolean{
return (house.smoothShadows);
}
public function get renderQuality():String{
return (stage.quality.toLowerCase());
}
public function get textureQuality():int{
return (TextureRenderer.textureResolution);
}
public function set renderQuality(_arg1:String):void{
stage.quality = _arg1;
TextureRenderer.textureResolution = (TextureRenderer.textureResolution + 1);
TextureRenderer.textureResolution = (TextureRenderer.textureResolution - 1);
view.render();
}
public function set smoothLightEffects(_arg1:Boolean):void{
house.smoothShadows = _arg1;
terrain.smoothShadows = _arg1;
}
private function updateTalk():void{
if (_charactersTalk){
if (maleIterator > 0){
maleIterator--;
} else {
if (Math.random() > 0.996){
male.text = phrases[int(MathUtility.random(0, phrases.length))];
maleIterator = (male.text.length * 10);
maleIterator = ((maleIterator)>250) ? 250 : ((maleIterator)<100) ? 100 : maleIterator;
} else {
male.text = null;
};
};
if (femaleIterator > 0){
femaleIterator--;
} else {
if (Math.random() > 0.996){
female.text = phrases[int(MathUtility.random(0, phrases.length))];
femaleIterator = (female.text.length * 10);
femaleIterator = ((femaleIterator)>250) ? 250 : ((femaleIterator)<100) ? 100 : femaleIterator;
} else {
female.text = null;
};
};
} else {
male.text = null;
female.text = null;
};
}
public function set smoothTextures(_arg1:Boolean):void{
TextureRenderer.smooth = _arg1;
SpriteRenderer.smooth = _arg1;
}
public function get lightMapQuality():int{
return (TextureRenderer.lightResolution);
}
public function set zoom(_arg1:Number):void{
view.zoom = _arg1;
}
private function updateMove():void{
if (_charactersMove){
male.x = (male.x + maleDirection.x);
male.y = (male.y + maleDirection.y);
male.rotZ = -(Math.atan2(maleDirection.x, maleDirection.y));
if ((((((((((male.x < -1250)) || ((male.x > 1250)))) || ((male.y < -350)))) || ((male.y > -50)))) || ((Math.random() > 0.99)))){
maleDirection = randomDirection();
male.x = ((male.x)<-1250) ? -1250 : ((male.x)>1250) ? 1250 : male.x;
male.y = ((male.y)<-350) ? -350 : ((male.y)>-50) ? -50 : male.y;
};
female.x = (female.x + femaleDirection.x);
female.y = (female.y + femaleDirection.y);
female.rotZ = -(Math.atan2(femaleDirection.x, femaleDirection.y));
if ((((((((((female.x < -1250)) || ((female.x > 1250)))) || ((female.y < -350)))) || ((female.y > -50)))) || ((Math.random() > 0.99)))){
femaleDirection = randomDirection();
female.x = ((female.x)<-1250) ? -1250 : ((female.x)>1250) ? 1250 : female.x;
female.y = ((female.y)<-350) ? -350 : ((female.y)>-50) ? -50 : female.y;
};
};
}
private function onKeyDown(_arg1:KeyboardEvent):void{
switch (_arg1.keyCode){
case Keyboard.SPACE:
panning = true;
break;
};
}
public function get charactersTalk():Boolean{
return (_charactersTalk);
}
public function set charactersMove(_arg1:Boolean):void{
_charactersMove = _arg1;
male.mobile = _arg1;
female.mobile = _arg1;
if (_arg1){
maleDirection = randomDirection();
femaleDirection = randomDirection();
};
}
public function set daytime(_arg1:Number):void{
hour = _arg1;
}
public function set textureQuality(_arg1:int):void{
TextureRenderer.textureResolution = _arg1;
}
private function onKeyUp(_arg1:KeyboardEvent):void{
switch (_arg1.keyCode){
case Keyboard.SPACE:
panning = false;
break;
};
}
private function updateLights():void{
var _local1:uint;
var _local2:uint;
var _local3:RGB;
sun.enabled = true;
if (_lightnings){
if (lightningIterator > 0){
lightningIterator--;
} else {
if (Math.random() > 0.98){
lightningIterator = MathUtility.random(3, 20);
sun.color = new RGB(26239);
sun.rotX = (MathUtility.random(-(MathUtility.degree60), -(MathUtility.degree10)) - MathUtility.degree90);
sun.rotZ = MathUtility.randomAngle();
} else {
sun.enabled = false;
};
};
} else {
sun.rotZ = (MathUtility.degree180 - ((hour / 12) * MathUtility.degree180));
sun.rotX = ((-(Math.abs((Math.cos((sun.rotZ + 0.8)) + 0.4))) * MathUtility.degree45) - MathUtility.degree90);
_local1 = hour;
_local2 = hour;
while (sunColors[_local1] == undefined) {
_local1--;
};
while (sunColors[_local2] == undefined) {
_local2++;
};
if (_local2 == _local1){
sun.color = sunColors[_local1];
} else {
sun.color = RGB.interpolate(sunColors[_local1], sunColors[_local2], ((hour - _local1) / (_local2 - _local1)));
};
};
_local1 = hour;
_local2 = hour;
while (ambientColors[_local1] == undefined) {
_local1--;
};
while (ambientColors[_local2] == undefined) {
_local2++;
};
if (_local2 == _local1){
ambient.color = ambientColors[_local1];
} else {
ambient.color = RGB.interpolate(ambientColors[_local1], ambientColors[_local2], ((hour - _local1) / (_local2 - _local1)));
};
if (_lightnings){
_local3 = ambient.color.clone();
_local3.multiply(0.7);
ambient.color = _local3;
};
house.light1 = (((hour > 21)) && ((hour < 24)));
house.light2 = (((hour > 23)) || ((hour < 4)));
terrain.light1 = house.light1;
terrain.light2 = house.light2;
terrain.light3 = (((hour > 22)) || ((hour < 7)));
stolb1.light = terrain.light3;
stolb2.light = terrain.light3;
}
private function onMouseDown(_arg1:MouseEvent):void{
drag = MouseUtility.globalCoords(false);
stage.addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
}
public function get zoom():Number{
return (view.zoom);
}
private function onMouseUp(_arg1:MouseEvent):void{
drag = null;
stage.removeEventListener(MouseEvent.MOUSE_UP, onMouseUp);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
}
public function get daytime():Number{
return (hour);
}
public function set charactersTalk(_arg1:Boolean):void{
_charactersTalk = _arg1;
}
private function onEnterFrame(_arg1:Event):void{
updateLights();
updateTalk();
updateMove();
view.render();
}
public function get lightnings():Boolean{
return (_lightnings);
}
public function get charactersMove():Boolean{
return (_charactersMove);
}
private function onMouseMove(_arg1:MouseEvent):void{
var _local2:Point = MouseUtility.globalCoords(false);
var _local3:Point = drag.subtract(_local2);
if (panning){
view.panXY(_local3.x, _local3.y);
} else {
view.yaw = (view.yaw + (_local3.x / 100));
view.pitch = (view.pitch + (_local3.y / 100));
view.pitch = ((view.pitch)>(-(MathUtility.degree1) * 20)) ? (-(MathUtility.degree1) * 20) : ((view.pitch)<-(MathUtility.degree45)) ? -(MathUtility.degree45) : view.pitch;
};
drag = _local2;
}
public function set lightMapQuality(_arg1:int):void{
TextureRenderer.lightResolution = _arg1;
}
private function randomDirection():Point{
var _local1:Point = new Point();
var _local2:Number = MathUtility.randomAngle();
_local1.x = (Math.sin(_local2) * 5);
_local1.y = (Math.cos(_local2) * 5);
return (_local1);
}
public function set lightnings(_arg1:Boolean):void{
_lightnings = _arg1;
}
}
}//package
Section 507
//Test3D_bmpLogo (Test3D_bmpLogo)
package {
import mx.core.*;
public class Test3D_bmpLogo extends BitmapAsset {
}
}//package