first commit

This commit is contained in:
2026-06-14 01:40:04 +02:00
commit 5511354783
4787 changed files with 103543 additions and 0 deletions
@@ -0,0 +1,39 @@
class CTRL_CONFIG
{
static var configVersion = 0;
static var END_PADDING = 25;
static var LABEL_GAP = 3;
static var tfLabel = new TextFormat("EA05_Body",18);
static var clrTextHightLight = 14474460;
static var clrTextUnhightLight = 13801796;
static var clrTextDisable = 5921370;
static var clrLabelHightLight = 16711680;
static var clrLabelUnhightLight = 13801796;
static var clrLabelDisable = 5921370;
static var textOffsetX = 43;
static var textOffsetY = 0;
static var iconOffsetX = 4;
static var iconOffsetY = -4;
static var stackedLabelOffsetY = -8;
static var labelGap = 3;
static var btnDefaultIcon = "x";
static var btnTextEndPadding = 15;
static var tglLeftArrowOffsetX = 8;
static var tglRightArrowOffsetX = 21;
static var tglSplitLeftArrowOffsetX = 11;
static var tglSplitRightArrowOffsetX = 23;
static var tglIconLeftArrowOffsetX = 37;
static var tglIconRightArrowOffsetX = 50;
static var tglIconTextOffsetX = 63;
static var tglSplitIconLeftArrowOffsetX = 37;
static var tglSplitIconRightArrowOffsetX = 23;
static var sldLeftArrowOffsetX = 8;
static var sldRightArrowOffsetX = 21;
static var sldInternalTextWidth = 30;
static var sldBarEndPadding = 15;
static var itxtEntryOffsetX = 40;
static var itxtEntryOffsetY = 3;
function CTRL_CONFIG()
{
}
}
@@ -0,0 +1,58 @@
class Cafe2_FocusableBody extends MovieClip
{
var m_bodyStyle = "";
function Cafe2_FocusableBody()
{
super();
trace("Cafe2_FocusableBody");
this.stop();
}
static function includeCode()
{
trace("Cafe2_FocusableBody included");
}
function setStyle(bodyStyle)
{
this.m_bodyStyle = bodyStyle;
this.body_le.setStyle(this.m_bodyStyle);
this.body_mid.setStyle(this.m_bodyStyle);
this.body_re.setStyle(this.m_bodyStyle);
}
function highlight()
{
this.body_le.highlight();
this.body_mid.highlight();
this.body_re.highlight();
}
function unhighlight()
{
this.body_le.unhighlight();
this.body_mid.unhighlight();
this.body_re.unhighlight();
}
function disable()
{
this.body_le.disable();
this.body_mid.disable();
this.body_re.disable();
}
function setSize(nWidth, nHeight)
{
if(this.body_le._width > 0 && this.body_mid._width > 0 && this.body_re._width > 0)
{
this.body_mid._x = this.body_le._width;
this.body_mid._width = nWidth - (this.body_le._width + this.body_re._width);
this.body_re._x = nWidth - this.body_re._width;
}
}
function animate(animType)
{
var anim = eval("this.anim" + animType);
anim.animate(this._width);
}
function stopAnimate(animType)
{
var anim = eval("this.anim" + animType);
anim.stopAnimate();
}
}
@@ -0,0 +1,29 @@
class Cafe2_FocusablePart extends MovieClip
{
var m_bodyStyle = "";
function Cafe2_FocusablePart()
{
super();
this.stop();
}
static function includeCode()
{
trace("Cafe2_FocusablePart included");
}
function setStyle(bodyStyle)
{
this.m_bodyStyle = bodyStyle;
}
function highlight()
{
this.gotoAndStop("highlight" + this.m_bodyStyle);
}
function unhighlight()
{
this.gotoAndStop("unhighlight" + this.m_bodyStyle);
}
function disable()
{
this.gotoAndStop("disable" + this.m_bodyStyle);
}
}
@@ -0,0 +1,249 @@
class Cafe2_Imp_BaseControl extends MovieClip
{
var m_isDynamic = false;
static var FOCUS_DIR_LR = "Left/Right";
static var FOCUS_DIR_UD = "Up/Down";
static var FOCUS_DIR_NONE = "None";
function Cafe2_Imp_BaseControl()
{
super();
this._visible = false;
this.m_bHighlighted = false;
this.m_isLoaded = false;
this.m_nAssets = 0;
this.m_nTotalAssets = 0;
this.m_handledInputs = new Object();
this.m_cbParam = new Object();
this.m_soundId = new Object();
_global.gCT.register(this);
this.m_objFM = eval(this.m_refFM);
}
function show()
{
this.m_bVisible = true;
this._visible = true;
}
function hide()
{
this.m_bVisible = false;
this._visible = false;
}
function isVisible()
{
return this.m_bVisible;
}
function enable()
{
this.m_bEnabled = true;
this.enableGUI();
}
function disable()
{
this.m_bEnabled = false;
this.disableGUI();
}
function isEnabled()
{
return this.m_bEnabled;
}
function setFocusManager(refFMObj)
{
if(refFMObj == undefined && (this.m_focusDirs == Cafe2_Imp_BaseControl.FOCUS_DIR_UD || this.m_focusDirs == Cafe2_Imp_BaseControl.FOCUS_DIR_LR))
{
trace("WARNING: Cafe2_Imp_BaseControl - Invalid focus manager this=" + this + ",m_refFM=" + refFMObj);
return undefined;
}
switch(this.m_focusDirs)
{
case Cafe2_Imp_BaseControl.FOCUS_DIR_UD:
this.setOnInput(_global.INPUTCODE.UP,this.bind0(refFMObj,refFMObj.selectPreviousItem));
this.setOnInput(_global.INPUTCODE.DOWN,this.bind0(refFMObj,refFMObj.selectNextItem));
break;
case Cafe2_Imp_BaseControl.FOCUS_DIR_LR:
this.setOnInput(_global.INPUTCODE.LEFT,this.bind0(refFMObj,refFMObj.selectPreviousItem));
this.setOnInput(_global.INPUTCODE.RIGHT,this.bind0(refFMObj,refFMObj.selectNextItem));
break;
case Cafe2_Imp_BaseControl.FOCUS_DIR_NONE:
break;
default:
if(this.m_focusDirs != undefined)
{
trace("WARNING: Cafe2_Imp_BaseControl - Invalid focus direction property this=" + this + ",m_focusDirs=" + this.m_focusDirs);
}
this.m_focusDirs = Cafe2_Imp_BaseControl.FOCUS_DIR_NONE;
}
}
function autoAddToFocusManger()
{
if(this.m_bVisible == true)
{
this._visible = true;
}
if(this.m_tabIndex >= 0)
{
this.m_objFM.addItemAtIndex(this,this.m_tabIndex);
if(this.m_initiallySelected == true)
{
this.m_objFM.selectItemByIdx(this.m_tabIndex);
}
}
}
function isLoaded()
{
return this.m_isLoaded;
}
function setSelected(bSelected)
{
if(bSelected == true && (this.m_bEnabled == false || this.m_bVisible == false))
{
trace("WARNING: Cafe2_Imp_BaseControl::setSelected() component disabled || hidden, this=" + this);
}
this.m_bHighlighted = bSelected;
if(this.m_bEnabled == true)
{
if(this.m_bHighlighted == true)
{
this.highlight();
this.m_onFocusFunc(this);
}
else
{
this.unhighlight();
this.m_onBlurFunc(this);
}
}
}
function isSelected()
{
if(this.m_bHighlighted == true)
{
return true;
}
return false;
}
function setOnChange(fxn)
{
this.m_onChangeFunc = fxn;
}
function setOnFocus(fxn)
{
this.m_onFocusFunc = fxn;
}
function setOnBlur(fxn)
{
this.m_onBlurFunc = fxn;
}
function setOnInput(keyCode, func, param, soundId)
{
this.m_handledInputs["KEY_" + keyCode] = func;
this.m_cbParam["KEY_" + keyCode] = param;
if(soundId != null)
{
this.m_soundId["KEY_" + keyCode] = soundId;
}
else
{
this.m_soundId["KEY_" + keyCode] = null;
}
}
function handleInput(keyCode)
{
if(this.m_bEnabled == false)
{
return false;
}
var _loc3_ = this.m_handledInputs[String("KEY_" + keyCode)];
if(String(_loc3_) == "[function]" || _loc3_ != null)
{
if(this.m_soundId["KEY_" + keyCode] != null)
{
_root.playSound(this.m_soundId["KEY_" + keyCode]);
}
if(this.m_cbParam["KEY_" + keyCode] == null)
{
_loc3_(this);
}
else
{
_loc3_(this.m_cbParam["KEY_" + keyCode]);
}
return true;
}
return false;
}
function clearInputHandlers()
{
this.m_handledInputs = new Object();
this.m_cbParam = new Object();
this.m_soundId = new Object();
}
function assetLoaded(strName)
{
trace("Cafe2ControlBase::assetLoaded");
this.m_nAssets = this.m_nAssets + 1;
if(this.m_nAssets >= this.m_nTotalAssets)
{
this.onAllAssetsLoaded();
}
}
function commonInit()
{
if(this.m_initiallySelected == false)
{
this.unhighlight();
}
if(this.m_bVisible == false)
{
this.hide();
}
if(this.m_bEnabled == false)
{
this.disable();
}
this.m_isLoaded = true;
this.autoAddToFocusManger();
this._parent.onControlLoaded(this);
this.logic_init();
}
static function defaultInitObject()
{
var _loc1_ = new Object();
_loc1_.m_bEnabled = true;
_loc1_.m_bVisible = true;
_loc1_.m_focusDirs = Cafe2_Imp_BaseControl.FOCUS_DIR_NONE;
_loc1_.m_isDynamic = true;
_loc1_.m_refFM = "_root.gFM";
_loc1_.m_tabIndex = -1;
_loc1_.m_initiallySelected = false;
return _loc1_;
}
function getWidth()
{
if(this.m_width != undefined)
{
return this.m_width;
}
return this._width;
}
function setFocusDirs(focusDirs)
{
switch(focusDirs)
{
case Cafe2_Imp_BaseControl.FOCUS_DIR_UD:
case Cafe2_Imp_BaseControl.FOCUS_DIR_LR:
case Cafe2_Imp_BaseControl.FOCUS_DIR_NONE:
this.m_focusDirs = focusDirs;
break;
default:
trace("WARNING: Cafe2_Imp_BaseControl::setFocusDirs() invalid focus direction property this=" + this + ",focusDirs=" + focusDirs);
this.m_focusDirs = Cafe2_Imp_BaseControl.FOCUS_DIR_NONE;
}
}
function bind0(o, f)
{
return function()
{
f.call(o);
};
}
}
@@ -0,0 +1,67 @@
class Cafe2_MouseBaseControl extends Cafe2_Imp_BaseControl
{
function Cafe2_MouseBaseControl()
{
super();
this.m_objFM.addItem(this);
this.m_tabIndex = -1;
this.m_introComplete = false;
this.m_outtroComplete = true;
}
function setIntroCallback(callBackFunc)
{
this.m_animationCompleteCallBackFunc = callBackFunc;
if(this.m_animationCompleteCallBackFunc != null && this.m_introComplete)
{
this.m_animationCompleteCallBackFunc(this);
}
}
function noIntro()
{
this.m_introComplete = true;
this.restoreVisualState();
}
function intro()
{
this.m_introComplete = false;
this.m_contentClip.gotoAndPlay("_intro");
}
function outtro(callBackFunc)
{
this.m_animationCompleteCallBackFunc = callBackFunc;
this.m_outtroComplete = false;
if(this.isEnabled())
{
this.m_contentClip.gotoAndPlay("_outtro");
}
else
{
trace("doing the enterframe thing");
this.onEnterFrame = this.outtroComplete;
}
}
function introComplete()
{
this.m_introComplete = true;
if(this.m_animationCompleteCallBackFunc != null)
{
this.m_animationCompleteCallBackFunc(this);
}
this.restoreVisualState();
}
function isIntroComplete()
{
return this.m_introComplete;
}
function outtroComplete()
{
this.m_outtroComplete = true;
this.m_animationCompleteCallBackFunc(this);
this.onEnterFrame = null;
trace("another outtro done");
}
function isOuttroComplete()
{
return this.m_outtroComplete;
}
}
@@ -0,0 +1,72 @@
class Cafe2_OnOffAnimPart extends MovieClip
{
var m_onStateLength = 300;
var m_intervalId = -1;
var m_isEnabled = true;
function Cafe2_OnOffAnimPart()
{
super();
this.stop();
}
static function includeCode()
{
trace("Cafe2_OnOffAnimPart included");
}
function onUnload(Void)
{
this.stopCallback();
}
function animate()
{
if(this.m_isEnabled == true)
{
this.gotoAndStop("on");
this.startCallback();
}
}
function gotoOffState(Void)
{
this.stopCallback();
if(this.m_isEnabled == true)
{
this.gotoAndStop("off");
}
else
{
this.gotoAndStop("disable");
}
}
function disable()
{
this.m_isEnabled = false;
if(!this.isCallbackStarted())
{
this.gotoAndStop("disable");
}
}
function enable()
{
this.m_isEnabled = true;
if(!this.isCallbackStarted())
{
this.gotoAndStop("off");
}
}
function startCallback(Void)
{
this.stopCallback();
this.m_intervalId = setInterval(this,"gotoOffState",this.m_onStateLength);
}
function stopCallback(Void)
{
if(this.m_intervalId != -1)
{
clearInterval(this.m_intervalId);
this.m_intervalId = -1;
}
}
function isCallbackStarted(Void)
{
return this.m_intervalId != -1;
}
}
@@ -0,0 +1,90 @@
class Cafe2_ScrollbarBody extends MovieClip
{
static var MIN_THUMB_SIZE = 10;
function Cafe2_ScrollbarBody()
{
super();
this.stop();
}
static function includeCode()
{
trace("Cafe2_ScrollbarBody::includeCode()");
}
function highlight()
{
this.body_le.highlight();
this.body_mid.highlight();
this.body_re.highlight();
this.body_thumb.highlight();
}
function unhighlight()
{
this.body_le.unhighlight();
this.body_mid.unhighlight();
this.body_re.unhighlight();
this.body_thumb.unhighlight();
}
function disable()
{
this.body_le.disable();
this.body_mid.disable();
this.body_re.disable();
this.body_thumb.disable();
}
function setLength(nLength)
{
this.body_mid._x = this.body_le._x + this.body_le._width;
this.body_re._x = nLength - this.body_re._width;
this.body_mid._width = this.body_re._x - this.body_mid._x;
}
function setThumb(nWidth, nPos)
{
this.body_thumb._x = this.body_mid._x + nPos * (this.body_mid._width - nWidth);
this.body_thumb._width = nWidth;
}
function setThumbRelative(nPos0, nPos1)
{
this.body_thumb._x = this.body_mid._x + nPos0 * (this.body_mid._width - Cafe2_ScrollbarBody.MIN_THUMB_SIZE);
this.body_thumb._width = Cafe2_ScrollbarBody.MIN_THUMB_SIZE + (nPos1 - nPos0) * (this.body_mid._width - Cafe2_ScrollbarBody.MIN_THUMB_SIZE);
}
function enableNext()
{
this.body_re.arrow.enable();
}
function disableNext()
{
this.body_re.arrow.disable();
}
function animateNext()
{
this.body_re.arrow.animate();
}
function hideNext()
{
this.body_re.arrow._visible = false;
}
function showNext()
{
this.body_re.arrow._visible = true;
}
function enablePrev()
{
this.body_le.arrow.enable();
}
function disablePrev()
{
this.body_le.arrow.disable();
}
function animatePrev()
{
this.body_le.arrow.animate();
}
function hidePrev()
{
this.body_le.arrow._visible = false;
}
function showPrev()
{
this.body_le.arrow._visible = true;
}
}
@@ -0,0 +1,28 @@
class Cafe2_SldBarBody extends Cafe2_FocusableBody
{
function Cafe2_SldBarBody()
{
super();
}
static function includeCode()
{
trace("Cafe2_SldBarBody included");
}
function setBarValue(nPercent)
{
this.barLevel._width = Math.round(nPercent * this.body_mid._width);
}
function setSize(nWidth, nHeight)
{
super.setSize(nWidth,nHeight);
this.barLevel._x = this.body_mid._x;
}
function animatePlus()
{
this.body_re.icon.animate();
}
function animateMinus()
{
this.body_le.icon.animate();
}
}
@@ -0,0 +1,95 @@
class CafeFW_ComponentTracker
{
function CafeFW_ComponentTracker()
{
this.components = new Array();
}
function register(component)
{
if(component == undefined || component == null || component.isLoaded == undefined)
{
trace("WARNING:CafeFW_ComponentTracker::register() invalid param");
return undefined;
}
this.components.push(component);
}
function unregister(component)
{
if(component == undefined || component == null)
{
trace("WARNING:CafeFW_ComponentTracker::unregister() invalid param");
return undefined;
}
var _loc2_ = 0;
while(_loc2_ != this.components.length)
{
if(this.components[_loc2_] == component)
{
this.components[_loc2_] = null;
return undefined;
}
_loc2_ = _loc2_ + 1;
}
trace("WARNING:CafeFW_ComponentTracker::unregister() component not found.");
}
function unregisterFromRoot(root)
{
if(root == undefined || root == null)
{
trace("WARNING:CafeFW_ComponentTracker::unregisterFromRoot() invalid param");
return undefined;
}
var _loc3_ = new Array();
var _loc5_ = String(root);
var _loc2_ = 0;
while(_loc2_ != this.components.length)
{
if(this.components[_loc2_] != null && String(this.components[_loc2_]).indexOf(String(root)) != 0)
{
_loc3_.push(this.components[_loc2_]);
}
_loc2_ = _loc2_ + 1;
}
this.components = _loc3_;
}
function areComponentsLoaded(root)
{
if(root == undefined || root == null)
{
trace("WARNING:CafeFW_ComponentTracker::areComponentsReady() invalid param");
return undefined;
}
var _loc3_ = this.componentsFromRoot(root);
var _loc4_ = true;
var _loc2_ = 0;
while(_loc2_ != _loc3_.length)
{
if(_loc3_[_loc2_].isLoaded() == false)
{
_loc4_ = false;
}
_loc2_ = _loc2_ + 1;
}
return _loc4_;
}
function componentsFromRoot(root)
{
if(root == undefined || root == null)
{
trace("WARNING:CafeFW_ComponentTracker::componentsFromRoot() invalid param");
return undefined;
}
var _loc4_ = new Array();
var _loc5_ = String(root);
var _loc2_ = 0;
while(_loc2_ != this.components.length)
{
if(this.components[_loc2_] != null && String(this.components[_loc2_]).indexOf(String(root)) == 0)
{
_loc4_.push(this.components[_loc2_]);
}
_loc2_ = _loc2_ + 1;
}
return _loc4_;
}
}
@@ -0,0 +1,135 @@
class CafeFW_ControllerManager
{
static var MAX_CONTROLLERS = 8;
static var NUM_STICKS_PER_CONTROLLER = 2;
static var NUM_VALUES_PER_STICK = 2;
static var MAX_STICK_VALUES = CafeFW_ControllerManager.MAX_CONTROLLERS * CafeFW_ControllerManager.NUM_STICKS_PER_CONTROLLER * CafeFW_ControllerManager.NUM_VALUES_PER_STICK;
static var kASZ_UP = 538;
static var kASZ_DOWN = 540;
static var kASZ_LEFT = 537;
static var kASZ_RIGHT = 539;
static var kASZ_NEUTRAL = -1;
static var DEAD_ZONE_SIZE = 0.25;
function CafeFW_ControllerManager()
{
trace("ControllerManager()::ControllerManager()");
this.m_numConnected = 0;
this.m_isConnected = new Array();
this.m_stickValues = new Array();
CafeFW_ControllerManager.m_AnalogStickInZone = new Array();
var _loc2_ = 0;
while(_loc2_ != CafeFW_ControllerManager.MAX_CONTROLLERS)
{
this.m_isConnected[_loc2_] = false;
_loc2_ = _loc2_ + 1;
}
_loc2_ = 0;
while(_loc2_ != CafeFW_ControllerManager.MAX_STICK_VALUES)
{
this.m_stickValues[_loc2_] = 0;
_loc2_ = _loc2_ + 1;
}
CafeFW_ControllerManager.m_AnalogStickInZone[0] = new Array();
CafeFW_ControllerManager.m_AnalogStickInZone[1] = new Array();
_loc2_ = 0;
while(_loc2_ != CafeFW_ControllerManager.MAX_CONTROLLERS)
{
CafeFW_ControllerManager.m_AnalogStickInZone[0][_loc2_] = CafeFW_ControllerManager.kASZ_NEUTRAL;
CafeFW_ControllerManager.m_AnalogStickInZone[1][_loc2_] = CafeFW_ControllerManager.kASZ_NEUTRAL;
_loc2_ = _loc2_ + 1;
}
}
function numConnectedControllers()
{
return this.m_numConnected;
}
function getConnectedControllers()
{
var _loc3_ = new Array();
var _loc2_ = 0;
while(_loc2_ != CafeFW_ControllerManager.MAX_CONTROLLERS)
{
if(this.m_isConnected[_loc2_])
{
_loc3_.push(_loc2_);
}
_loc2_ = _loc2_ + 1;
}
return _loc3_;
}
function setConnectState(id, isConnected)
{
trace("ControllerManager::setConnectState(" + id + "," + isConnected + ")");
if(this.m_isConnected[id] != isConnected)
{
if(this.m_isConnected[id])
{
this.m_numConnected = this.m_numConnected - 1;
this.m_isConnected[id] = false;
}
else
{
this.m_numConnected = this.m_numConnected + 1;
this.m_isConnected[id] = true;
}
}
}
function isConnected(id)
{
return this.m_isConnected[id];
}
function setAnalogValues(controllerId, stickNumber, x, y)
{
var _loc4_ = controllerId * CafeFW_ControllerManager.NUM_STICKS_PER_CONTROLLER + stickNumber;
this.m_stickValues[_loc4_] = x;
this.m_stickValues[_loc4_ + 1] = y;
var _loc2_ = this.calculateAnalogStickZone(x,y);
var _loc3_ = CafeFW_ControllerManager.m_AnalogStickInZone[stickNumber][controllerId];
if(_loc3_ != _loc2_)
{
CafeFW_ControllerManager.m_AnalogStickInZone[stickNumber][controllerId] = _loc2_;
if(stickNumber == 1)
{
if(_loc3_ != CafeFW_ControllerManager.kASZ_NEUTRAL)
{
_loc3_ += 100;
}
if(_loc2_ != CafeFW_ControllerManager.kASZ_NEUTRAL)
{
_loc2_ += 100;
}
}
return new Array(_loc3_,_loc2_);
}
return null;
}
function getAnalogValues(controllerId, stickNumber)
{
var _loc2_ = controllerId * CafeFW_ControllerManager.NUM_STICKS_PER_CONTROLLER + stickNumber;
return new Array(this.m_stickValues[_loc2_],this.m_stickValues[_loc2_ + 1]);
}
function calculateAnalogStickZone(x, y)
{
if(x <= CafeFW_ControllerManager.DEAD_ZONE_SIZE && x >= - CafeFW_ControllerManager.DEAD_ZONE_SIZE && y <= CafeFW_ControllerManager.DEAD_ZONE_SIZE && y >= - CafeFW_ControllerManager.DEAD_ZONE_SIZE)
{
return CafeFW_ControllerManager.kASZ_NEUTRAL;
}
if(x >= 0 && y > 0 && y > x || x <= 0 && y > 0 && y > - x)
{
return CafeFW_ControllerManager.kASZ_UP;
}
if(x >= 0 && y < 0 && y < - x || x <= 0 && y < 0 && y < x)
{
return CafeFW_ControllerManager.kASZ_DOWN;
}
if(x > 0 && y >= 0 && y < x || x > 0 && y <= 0 && - y < x)
{
return CafeFW_ControllerManager.kASZ_RIGHT;
}
if(x < 0 && y >= 0 && - y > x || x < 0 && y <= 0 && y > x)
{
return CafeFW_ControllerManager.kASZ_LEFT;
}
trace("error: analog stick x=" + x + ", y=" + y + " not in any zone.");
}
}
@@ -0,0 +1,291 @@
class CafeFW_EventHandler extends Object
{
static var BASE_PRIORITY = 0;
function CafeFW_EventHandler(containerMovieClip)
{
super();
trace("cafeFW_EventHandler::constructor");
this.m_containerMovieClip = containerMovieClip;
this.m_enabled = true;
this.m_arrLEH = new Array();
this.m_disablePriority = -1;
this.m_currentLEH = null;
this.m_handledInputs = new Object();
this.setActiveController(-1);
}
function onKeyDown()
{
var keyCode = Key.getCode();
var ascii = Key.getAscii();
trace("***** onkeyDown keyCode:" + keyCode);
if(keyCode == -1)
{
return undefined;
}
var aptKey = Key;
var controllerId = aptKey.getController();
if(controllerId == null || controllerId == -1)
{
controllerId = 0;
}
this.m_containerMovieClip.gEHDebugText.txtKey.text = String(keyCode);
this.m_containerMovieClip.gEHDebugText.txtController.text = String(controllerId);
if(keyCode == _root.INPUTCODE.LAS || keyCode == _root.INPUTCODE.RAS)
{
var analogStickInfo = aptKey.getAnalogStickInfo();
controllerId = analogStickInfo.controller;
if(controllerId < 0)
{
controllerId += 2;
}
var stickId = 0;
if(keyCode == _root.INPUTCODE.RAS)
{
stickId = 1;
}
var oldZoneNewZone = _global.gCM.setAnalogValues(controllerId,stickId,analogStickInfo.fXAxisValue,analogStickInfo.fYAxisValue);
if(oldZoneNewZone != null)
{
if(oldZoneNewZone[0] != CafeFW_ControllerManager.kASZ_NEUTRAL)
{
this.handleEvent(oldZoneNewZone[0] + _global.INPUTCODE.BASE_UP,controllerId);
}
if(oldZoneNewZone[1] != CafeFW_ControllerManager.kASZ_NEUTRAL)
{
this.handleEvent(oldZoneNewZone[1],controllerId);
}
}
}
this.handleEvent(keyCode,controllerId,ascii);
}
function onKeyUp()
{
var keyCode = Key.getCode();
var ascii = Key.getAscii();
trace("***** onkeyUP!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! keyCode:" + keyCode);
if(keyCode == -1)
{
return undefined;
}
keyCode += _global.INPUTCODE.BASE_UP;
var aptKey = Key;
var controllerId = aptKey.getController();
if(controllerId == null || controllerId == -1)
{
controllerId = 0;
}
this.m_containerMovieClip.gEHDebugText.txtKey.text = String(keyCode);
this.m_containerMovieClip.gEHDebugText.txtController.text = String(controllerId);
this.handleEvent(keyCode,controllerId,ascii);
}
function handleEvent(keyCode, controllerId, ascii)
{
_root.debugMC.debug.text = "-top-";
if(keyCode == _global.INPUTCODE.CONNECTED || keyCode == _global.INPUTCODE.DISCONNECTED)
{
var _loc8_ = keyCode == _global.INPUTCODE.CONNECTED;
if(_global.gCM.isConnected(controllerId) == _loc8_)
{
return undefined;
}
_global.gCM.setConnectState(controllerId,_loc8_);
}
_root.debugMC.debug.text = "no problems so far";
if(keyCode != _global.INPUTCODE.DISCONNECTED && _global.gCM.isConnected(controllerId) == false)
{
_global.gCM.setConnectState(controllerId,true);
}
var _loc9_ = this.isControllerActive(-1) || this.isControllerActive(controllerId);
var _loc7_ = this.m_handledInputs[String("KEY_" + keyCode)];
if(String(_loc7_) == "[function]" || _loc7_ != null)
{
trace("***** call global handler for keycode: " + keyCode + ", controllerId: " + controllerId);
_loc7_(controllerId);
}
if(this.m_currentLEH != null && this.m_currentLEH.priority > this.m_disablePriority && this.m_enabled == true && _loc9_ == true)
{
trace("***** call local event handler for keycode: " + keyCode + ", controllerId: " + controllerId);
var _loc6_ = _root.debugMC2.debug.text;
_loc6_ += " cleh - mon";
_root.debugMC2.debug.text = _loc6_;
this.m_currentLEH.leh(keyCode,controllerId,ascii);
}
}
function setLocalEventHandler(eventHandler)
{
trace("cafeFW_EventHandler::setLocalEventHandler");
this.m_arrLEH[0] = {leh:eventHandler,priority:CafeFW_EventHandler.BASE_PRIORITY};
if(this.m_arrLEH[0] == this.findTopBaseLEH())
{
this.enableCurrentLocalEventHandler();
}
this.updateTopLEH();
}
function clearAllEventHandlers()
{
this.m_arrLEH = new Array();
this.m_currentLEH = null;
this.m_disablePriority = -1;
}
function getCurrentLocalEventHandler()
{
return this.m_currentLEH.leh;
}
function disable()
{
this.m_enabled = false;
}
function enable()
{
this.m_enabled = true;
}
function disableCurrentLocalEventHandler()
{
this.m_disablePriority = 0;
}
function enableCurrentLocalEventHandler()
{
this.m_disablePriority = -1;
}
function submitKeyEvent(keyCode, controllerId)
{
trace("cafeFW_EventHandler::submitKeyEvent(keycode: " + keyCode + ", controllerId: " + controllerId + ")");
this.handleEvent(keyCode,controllerId,undefined);
}
function addLocalEventHandler(eventHandler)
{
trace("cafeFW_EventHandler::addLocalEventHandler() length=" + this.m_arrLEH.length);
return this.addPriorityLocalEventHandler(eventHandler,CafeFW_EventHandler.BASE_PRIORITY);
}
function addPriorityLocalEventHandler(eventHandler, priority)
{
trace("cafeFW_EventHandler::addPriorityLocalEventHandler() priority=" + priority + ",length=" + this.m_arrLEH.length);
var _loc2_ = this.addLEH(eventHandler,priority);
this.updateTopLEH();
if(priority == this.m_disablePriority)
{
this.enableCurrentLocalEventHandler();
}
return _loc2_;
}
function removeLocalEventHandler(eventHandlerIndex)
{
this.removeLEH(eventHandlerIndex);
this.updateTopLEH();
}
function restoreLocalEventHandler(localEventHandler)
{
trace("cafeFW_EventHandler::restoreLocalEventHandler()");
trace("****************WARNING************");
trace("cafeFW_EventHandler::restoreLocalEventHandler() is deprecated");
trace("use addLocalEventHandler and removeLocalEventHandler");
var _loc2_ = 0;
while(_loc2_ != this.m_arrLEH.length)
{
var _loc3_ = this.m_arrLEH[_loc2_];
if(_loc3_.leh == localEventHandler)
{
this.removeLocalEventHandler(_loc2_);
return undefined;
}
_loc2_ = _loc2_ + 1;
}
}
function setOnInput(key, func)
{
trace("cafeFW_EventHandler::setOnInput(key : " + key + ")");
this.m_handledInputs["KEY_" + key] = func;
}
function setActiveController(nActiveController)
{
this.setActiveControllers([nActiveController]);
}
function addActiveControllers(controllerIds)
{
var _loc2_ = 0;
while(_loc2_ != controllerIds.length)
{
this.m_activeControllers[String(controllerIds[_loc2_])] = true;
_loc2_ = _loc2_ + 1;
}
}
function removeActiveControllers(controllerIds)
{
var _loc2_ = 0;
while(_loc2_ != controllerIds.length)
{
delete this.m_activeControllers[String(controllerIds[_loc2_])];
_loc2_ = _loc2_ + 1;
}
}
function getActiveControllers()
{
var _loc2_ = new Array();
for(var _loc3_ in this.m_activeControllers)
{
_loc2_.push(Number(_loc3_));
}
return _loc2_;
}
function setActiveControllers(controllerIds)
{
this.m_activeControllers = new Object();
this.addActiveControllers(controllerIds);
}
function isControllerActive(controllerId)
{
return this.m_activeControllers[String(controllerId)] != undefined;
}
function addLEH(lehFunction, lehPriority)
{
this.m_arrLEH.push({leh:lehFunction,priority:lehPriority});
return this.m_arrLEH.length - 1;
}
function removeLEH(index)
{
this.m_arrLEH[index] = null;
var _loc2_ = this.m_arrLEH.length - 1;
while(_loc2_ > -1 && this.m_arrLEH[_loc2_] == null)
{
this.m_arrLEH.pop();
_loc2_ = _loc2_ - 1;
}
}
function findTopLEH()
{
var _loc4_ = null;
var _loc3_ = this.m_arrLEH.length - 1;
while(_loc3_ > -1)
{
var _loc2_ = this.m_arrLEH[_loc3_];
if(_loc2_ != null && (_loc4_ == null || _loc2_.priority > _loc4_.priority))
{
_loc4_ = _loc2_;
}
_loc3_ = _loc3_ - 1;
}
return _loc4_;
}
function findTopBaseLEH()
{
var _loc3_ = this.m_arrLEH.length - 1;
while(_loc3_ > -1)
{
var _loc2_ = this.m_arrLEH[_loc3_];
if(_loc2_ != null && _loc2_.priority == CafeFW_EventHandler.BASE_PRIORITY)
{
return _loc2_;
}
_loc3_ = _loc3_ - 1;
}
return null;
}
function updateTopLEH()
{
var _loc2_ = this.findTopLEH();
if(_loc2_ != this.m_currentLEH)
{
this.m_currentLEH = _loc2_;
}
}
}
@@ -0,0 +1,381 @@
class CafeFW_FocusManager
{
function CafeFW_FocusManager(strName)
{
this.m_name = strName;
this.m_nInputs = 0;
this.m_selectedItemIdx = 0;
this.m_arrItems = new Array();
this.m_handledInputs = new Object();
this.m_nSelectionDirecton = -1;
this.m_cbParam = new Object();
this.m_highlightMC = undefined;
cafeTrace("cafeFW_FocusManager constructor");
}
function handleDefaultInputs(keyCode)
{
cafeTrace("cafeFW_FocusManager::handleDefaultInputs");
var _loc2_ = this.m_arrItems[this.m_selectedItemIdx];
cafeTrace("selectedObject._name = " + _loc2_._name);
if(_loc2_ == null || _loc2_.handleInput(keyCode) == false)
{
var _loc3_ = this.m_handledInputs[String("KEY_" + keyCode)];
var _loc5_ = this.m_cbParam[String("KEY_" + keyCode)];
if(String(_loc3_) == "[function]" || _loc3_ != null)
{
_loc3_(_loc5_);
return true;
}
return false;
}
return true;
}
function addItem(obj)
{
cafeTrace("cafeFW_FocusManager::addItem");
var _loc2_ = 0;
while(_loc2_ < this.m_nInputs)
{
if(this.m_arrItems[_loc2_] == obj)
{
return undefined;
}
_loc2_ = _loc2_ + 1;
}
this.m_arrItems[this.m_nInputs] = obj;
obj.setFocusManager(this);
this.m_nInputs = this.m_nInputs + 1;
cafeTrace("m_nInputs=" + this.m_nInputs);
}
function addItemAtIndex(obj, idx)
{
cafeTrace("cafeFW_FocusManager::addItemAtIndex");
this.m_arrItems[idx] = obj;
obj.setFocusManager(this);
this.m_nInputs = this.m_nInputs + 1;
cafeTrace("m_nInputs=" + this.m_nInputs);
}
function clearAllItems()
{
cafeTrace("cafeFW_FocusManager::clearAllItems");
var _loc2_ = 0;
_loc2_ = 0;
while(_loc2_ < this.m_nInputs)
{
this.m_arrItems[_loc2_].clearInputHandlers();
_loc2_ = _loc2_ + 1;
}
this.m_arrItems = new Array();
this.m_nInputs = 0;
this.m_selectedItemIdx = 0;
}
function getNumOfItems()
{
return this.m_nInputs;
}
function getSelectedItem()
{
return this.m_arrItems[this.m_selectedItemIdx];
}
function getSelectedIndex()
{
return this.m_selectedItemIdx;
}
function getSelectionDirection()
{
return this.m_nSelectionDirecton;
}
function selectNextItem()
{
cafeTrace("cafeFW_FocusManager::selectNextItem");
if(this.m_nInputs == 0)
{
return undefined;
}
var _loc3_ = this.m_selectedItemIdx;
this.m_selectedItemIdx = this.m_selectedItemIdx + 1;
var _loc4_ = 0;
while(_loc4_ < this.m_nInputs)
{
if(this.m_selectedItemIdx >= this.m_nInputs)
{
this.m_selectedItemIdx = 0;
}
if(this.m_arrItems[this.m_selectedItemIdx].isEnabled() && this.m_arrItems[this.m_selectedItemIdx].isVisible())
{
if(_loc3_ != this.m_selectedItemIdx)
{
this.m_nSelectionDirecton = 1;
if(this.m_arrItems[_loc3_].isEnabled())
{
this.m_arrItems[_loc3_].setSelected(false);
}
this.m_arrItems[this.m_selectedItemIdx].setSelected(true);
this.refreshHighlight();
if(_global.gShellScreen != undefined && _global.gShellScreen._visible == true)
{
_global.playSound("Gui_GlobalShellScrollDown");
}
}
break;
}
this.m_selectedItemIdx = this.m_selectedItemIdx + 1;
_loc4_ = _loc4_ + 1;
}
}
function selectPreviousItem()
{
cafeTrace("cafeFW_FocusManager::selectPreviousItem");
if(this.m_nInputs == 0)
{
return undefined;
}
var _loc3_ = this.m_selectedItemIdx;
this.m_selectedItemIdx = this.m_selectedItemIdx - 1;
var _loc4_ = 0;
while(_loc4_ < this.m_nInputs)
{
if(this.m_selectedItemIdx < 0)
{
this.m_selectedItemIdx = this.m_nInputs - 1;
}
if(this.m_arrItems[this.m_selectedItemIdx].isEnabled() && this.m_arrItems[this.m_selectedItemIdx].isVisible())
{
if(_loc3_ != this.m_selectedItemIdx)
{
this.m_nSelectionDirecton = 0;
if(this.m_arrItems[_loc3_].isEnabled())
{
this.m_arrItems[_loc3_].setSelected(false);
}
this.m_arrItems[this.m_selectedItemIdx].setSelected(true);
this.refreshHighlight();
if(_global.gShellScreen != undefined && _global.gShellScreen._visible == true)
{
_global.playSound("Gui_GlobalShellScrollUp");
}
}
break;
}
this.m_selectedItemIdx = this.m_selectedItemIdx - 1;
_loc4_ = _loc4_ + 1;
}
}
function selectItemByIdx(idx)
{
if(idx >= this.m_arrItems.length || idx < 0)
{
trace("WARNING: CafeFW_FocusManager::selectItemByIdx() invalid idx=" + idx);
return undefined;
}
if(this.m_arrItems[idx] == undefined)
{
trace("WARNING: CafeFW_FocusManager::selectItemByIdx() no object at idx=" + idx);
}
this.m_nSelectionDirecton = -1;
this.m_arrItems[this.m_selectedItemIdx].setSelected(false);
this.m_selectedItemIdx = idx;
this.m_arrItems[this.m_selectedItemIdx].setSelected(true);
this.refreshHighlight();
}
function selectItemByIndex(idx)
{
this.selectItemByIdx(idx);
}
function selectItemByName(strName)
{
var _loc2_ = 0;
while(_loc2_ < this.m_nInputs)
{
if(this.m_arrItems[_loc2_]._name == strName)
{
this.m_arrItems[this.m_selectedItemIdx].setSelected(false);
this.m_selectedItemIdx = _loc2_;
this.m_nSelectionDirecton = -1;
this.m_arrItems[this.m_selectedItemIdx].setSelected(true);
this.refreshHighlight();
return undefined;
}
_loc2_ = _loc2_ + 1;
}
trace("WARNING: CafeFW_FocusManager::selectItemByName() no object found with name=" + strName);
}
function selectItem(obj)
{
cafeTrace("cafeFW_FocusManager::selectItem");
var _loc2_ = 0;
while(_loc2_ < this.m_nInputs)
{
if(this.m_arrItems[_loc2_] == obj)
{
this.m_arrItems[this.m_selectedItemIdx].setSelected(false);
this.m_selectedItemIdx = _loc2_;
this.m_nSelectionDirecton = -1;
this.m_arrItems[this.m_selectedItemIdx].setSelected(true);
this.refreshHighlight();
return undefined;
}
_loc2_ = _loc2_ + 1;
}
trace("WARNING: CafeFW_FocusManager::selectItem() no object found obj=" + obj);
}
function setFocusToControl(obj)
{
if(obj == this.getSelectedItem())
{
return undefined;
}
var _loc2_ = 0;
while(_loc2_ < this.m_nInputs)
{
if(this.m_arrItems[_loc2_] == obj && this.m_arrItems[_loc2_].isEnabled())
{
this.m_arrItems[this.m_selectedItemIdx].setSelected(false);
this.m_selectedItemIdx = _loc2_;
this.m_nSelectionDirecton = -1;
this.m_arrItems[this.m_selectedItemIdx].setSelected(true);
this.refreshHighlight();
return undefined;
}
_loc2_ = _loc2_ + 1;
}
trace("WARNING: CafeFW_FocusManager::setFocusToControl() no object found obj=" + obj);
}
function deselectFocusedComponent()
{
if(this.m_selectedItemIdx >= 0)
{
this.m_arrItems[this.m_selectedItemIdx].setSelected(false);
}
}
function handleInput(keyCode)
{
cafeTrace("cafeFW_FocusManager::handleInput");
var _loc2_ = this.m_handledInputs[String("KEY_" + keyCode)];
if(_loc2_ != undefined)
{
var _loc3_ = this.m_cbParam[String("KEY_" + keyCode)];
if(_loc3_ != undefined)
{
_loc2_(_loc3_);
}
else
{
_loc2_();
}
}
}
function setOnInput(key, func, param)
{
cafeTrace("cafeFW_FocusManager::setOnInput");
this.m_handledInputs["KEY_" + key] = func;
this.m_cbParam["KEY_" + key] = param;
}
function hideAllControls()
{
trace("cafeFW_FocusManager::hideAllControls()");
var _loc3_ = undefined;
var _loc4_ = this.m_arrItems.length;
var _loc2_ = 0;
while(_loc2_ < _loc4_)
{
_loc3_ = this.m_arrItems[_loc2_];
_loc3_.disable();
_loc3_.hide();
_loc2_ = _loc2_ + 1;
}
}
function showAllControls()
{
trace("cafeFW_FocusManager::hideAllControls()");
var _loc3_ = undefined;
var _loc4_ = this.m_arrItems.length;
var _loc2_ = 0;
while(_loc2_ < _loc4_)
{
_loc3_ = this.m_arrItems[_loc2_];
_loc3_.show();
_loc3_.enable();
this.m_arrItems[_loc2_].setSelected(false);
_loc2_ = _loc2_ + 1;
}
this.selectItemByIdx(this.m_selectedItemIdx);
}
function setHighlightPadding(pPadding)
{
this.m_highlightPadding = pPadding;
}
function setHighlight(pHighlightMC)
{
this.m_highlightMC = pHighlightMC;
}
function clearHighlight()
{
this.m_highlightMC = undefined;
}
function showHighlight()
{
if(this.m_highlightMC != undefined)
{
this.m_highlightMC._visible = true;
}
}
function hideHighlight()
{
if(this.m_highlightMC != undefined)
{
this.m_highlightMC._visible = false;
}
}
function refreshHighlight()
{
trace("CafeFW_FocusManager::refreshHighlight() m_highlightMC == " + this.m_highlightMC + " m_selectedItemIdx == " + this.m_selectedItemIdx + " m_arrItems.length == " + this.m_arrItems.length);
if(this.m_highlightMC != undefined)
{
if(this.m_selectedItemIdx > -1 && this.m_selectedItemIdx < this.m_arrItems.length)
{
this.showHighlight();
this.m_highlightMC._y = this.m_arrItems[this.m_selectedItemIdx]._y - this.m_highlightPadding;
this.m_highlightMC._height = this.m_arrItems[this.m_selectedItemIdx]._height + this.m_highlightPadding * 2;
}
else
{
this.hideHighlight();
}
}
}
function tabNextComponent()
{
var _loc6_ = this.m_selectedItemIdx;
var _loc5_ = this.m_arrItems[_loc6_].m_tabIndex;
var _loc4_ = -1;
var _loc3_ = -1;
var _loc2_ = 0;
while(_loc2_ < this.getNumOfItems())
{
if(this.m_arrItems[_loc2_].m_tabIndex > _loc5_ & (this.m_arrItems[_loc2_].m_tabIndex < _loc4_ || _loc4_ == -1))
{
_loc4_ = _loc2_;
}
else if(_loc3_ == -1 & this.m_arrItems[_loc2_].m_tabIndex >= 0)
{
_loc3_ = _loc2_;
}
else if(_loc3_ != -1 & this.m_arrItems[_loc2_].m_tabIndex < _loc3_ & this.m_arrItems[_loc2_].m_tabIndex >= 0)
{
_loc3_ = _loc2_;
}
_loc2_ = _loc2_ + 1;
}
if(_loc4_ >= 0)
{
this.m_arrItems[_loc6_].setSelected(false);
this.m_arrItems[_loc4_].setSelected(true);
}
else if(_loc3_ >= 0)
{
this.m_arrItems[_loc6_].setSelected(false);
this.m_arrItems[_loc3_].setSelected(true);
}
}
}
@@ -0,0 +1,170 @@
class CafeFW_IndexMgr
{
var mIndex = 0;
var mMinIndex = 0;
var mMaxIndex = 10;
var mStepSize = 1;
var mWrapState = true;
var mSnapState = false;
static var TIBINDEX_CHANGE_NONE = 0;
static var TIBINDEX_CHANGED = 1;
function CafeFW_IndexMgr()
{
}
function Cafe2_IndexMgr(Void)
{
trace("~~TIBTIB~~ CafeFW_IndexMgr::constructor");
}
function SetInfo(curIndex, minIndex, maxIndex, curStep, wrapState, snapState)
{
var _loc2_ = CafeFW_IndexMgr.TIBINDEX_CHANGE_NONE;
if(maxIndex >= minIndex)
{
this.mMinIndex = minIndex;
this.mMaxIndex = maxIndex;
this.SetStep(curStep);
this.SetWrap(wrapState);
this.SetSnap(snapState);
_loc2_ = this.UpdateIndex(curIndex);
}
else
{
trace("ERROR! CafeFW_IndexMgr:SetInfo() MaxIndex is less than MinIndex");
}
return _loc2_;
}
function SetIndex(index)
{
return this.UpdateIndex(index);
}
function SetStep(stepSize)
{
var _loc2_ = CafeFW_IndexMgr.TIBINDEX_CHANGE_NONE;
if(stepSize > 0 && stepSize <= this.mMaxIndex - this.mMinIndex)
{
if(stepSize != this.mStepSize)
{
this.mStepSize = stepSize;
_loc2_ = CafeFW_IndexMgr.TIBINDEX_CHANGED;
}
}
else
{
trace("ERROR! CafeFW_IndexMgr:SetStep() - invalid stepSize");
}
return _loc2_;
}
function SetWrap(wrapState)
{
var _loc2_ = CafeFW_IndexMgr.TIBINDEX_CHANGE_NONE;
if(wrapState != this.mWrapState)
{
this.mWrapState = wrapState;
_loc2_ = CafeFW_IndexMgr.TIBINDEX_CHANGED;
}
return _loc2_;
}
function SetSnap(snapState)
{
var _loc2_ = CafeFW_IndexMgr.TIBINDEX_CHANGE_NONE;
if(snapState != this.mSnapState)
{
this.mSnapState = snapState;
_loc2_ = CafeFW_IndexMgr.TIBINDEX_CHANGED;
}
return _loc2_;
}
function IncIndex(Void)
{
var _loc4_ = CafeFW_IndexMgr.TIBINDEX_CHANGE_NONE;
var _loc2_ = this.mIndex + this.mStepSize;
var _loc3_ = _loc2_ - this.mMaxIndex;
if(_loc3_ > 0)
{
if(this.mWrapState && this.mMinIndex != this.mMaxIndex)
{
_loc2_ = this.mMinIndex + (_loc3_ - this.mStepSize);
}
else
{
_loc2_ = this.mMaxIndex;
}
}
return this.UpdateIndex(_loc2_);
}
function DecIndex(Void)
{
var _loc2_ = this.mIndex - this.mStepSize;
var _loc3_ = _loc2_ - this.mMinIndex;
if(_loc3_ < 0)
{
if(this.mWrapState && this.mMinIndex != this.mMaxIndex)
{
_loc2_ = this.mMaxIndex + (_loc3_ + this.mStepSize);
}
else
{
_loc2_ = this.mMinIndex;
}
}
return this.UpdateIndex(_loc2_);
}
function GetMinIndex(Void)
{
return this.mMinIndex;
}
function GetMaxIndex(Void)
{
return this.mMaxIndex;
}
function GetIndex(Void)
{
return this.mIndex;
}
function GetNumItems(Void)
{
return this.mMaxIndex - this.mMinIndex;
}
function GetStepSize(Void)
{
return this.mStepSize;
}
function Snap(index)
{
if(this.mSnapState && index != this.mMinIndex && index != this.mMaxIndex && this.mStepSize > 1)
{
if(index == this.mMaxIndex - this.mStepSize)
{
index = this.mMaxIndex - (index - this.mMinIndex) % this.mStepSize;
}
else
{
index -= (index - this.mMinIndex) % this.mStepSize;
}
}
return index;
}
function UpdateIndex(newIndex)
{
var _loc3_ = CafeFW_IndexMgr.TIBINDEX_CHANGE_NONE;
if(newIndex < this.mMinIndex)
{
newIndex = this.mMinIndex;
}
if(newIndex > this.mMaxIndex)
{
newIndex = this.mMaxIndex;
}
newIndex = this.Snap(newIndex);
if(newIndex != this.mIndex)
{
this.mIndex = newIndex;
_loc3_ = CafeFW_IndexMgr.TIBINDEX_CHANGED;
}
return _loc3_;
}
static function includeCode()
{
trace("CafeFW_IndexMgr::includeCode()");
}
}
@@ -0,0 +1,106 @@
class CafeFW_MessageHandler extends Object
{
static var MESSAGE_DELIMITER = "&";
static var PRIORITY_GLOBAL = 0;
static var PRIORITY_LOCAL = 1;
function CafeFW_MessageHandler()
{
super();
trace("CafeFW_MessageHandler::CafeFW_MessageHandler()");
this.m_enabled = true;
this.m_arrLMH = new Array();
this.m_arrMessages = new Array();
}
function disable()
{
trace("CafeFW_MessageHandler::disable()");
this.m_enabled = false;
}
function enable()
{
trace("CafeFW_MessageHandler::enable()");
this.m_enabled = true;
}
function addMessageHandler(messageHandler)
{
this.addPriorityMessageHandler(messageHandler,CafeFW_MessageHandler.PRIORITY_LOCAL);
}
function addPriorityMessageHandler(messageHandler, priority)
{
trace("CafeFW_MessageHandler::addPriorityMessageHandler() priority = " + priority);
this.m_arrLMH.push({lmhFunction:messageHandler,lmhPriority:priority});
this.m_arrLMH.sort(this.sortByPriority);
trace("CafeFW_MessageHandler::addPriorityMessageHandler() Message handler count after add = " + this.m_arrLMH.length);
}
function removeMessageHandler(messageHandler)
{
trace("CafeFW_MessageHandler::removeMessageHandler() Message handler count before = " + this.m_arrLMH.length);
var _loc2_ = 0;
while(_loc2_ < this.m_arrLMH.length)
{
if(messageHandler == this.m_arrLMH[_loc2_].lmhFunction)
{
this.removeMessageHandlerByIndex(_loc2_);
return undefined;
}
_loc2_ = _loc2_ + 1;
}
}
function removeMessageHandlerByIndex(messageHandlerIndex)
{
trace("CafeFW_MessageHandler::removeMessageHandlerByIndex() messageHandlerIndex = " + messageHandlerIndex);
this.m_arrLMH.splice(messageHandlerIndex,1);
trace("CafeFW_MessageHandler::removeMessageHandlerByIndex() Message handler count after = " + this.m_arrLMH.length);
return undefined;
}
function sortByPriority(first, second)
{
if(first.lmhPriority == second.lmhPriority)
{
return 0;
}
if(first.lmhPriority < second.lmhPriority)
{
return -1;
}
return 1;
}
function handleStringMessage(theMessage)
{
trace("CafeFW_MessageHandler::handleStringMessage() theMessage = " + theMessage);
if(!this.m_enabled)
{
trace("CafeFW_MessageHandler::handleStringMessage() Message handler is disabled");
return undefined;
}
var _loc4_ = undefined;
var _loc3_ = theMessage.split(CafeFW_MessageHandler.MESSAGE_DELIMITER);
var _loc2_ = 0;
while(_loc2_ < _loc3_.length)
{
_loc4_ = Number(_loc3_[_loc2_]);
this.handleNumberMessage(_loc4_);
_loc2_ = _loc2_ + 1;
}
}
function handleNumberMessage(messageCode)
{
trace("CafeFW_MessageHandler::handleNumberMessage() messageCode = " + messageCode);
if(!this.m_enabled)
{
trace("CafeFW_MessageHandler::handleNumberMessage() Message handler is disabled");
return undefined;
}
var _loc2_ = 0;
while(_loc2_ < this.m_arrLMH.length)
{
if(this.m_arrLMH[_loc2_].lmhFunction(messageCode))
{
trace("CafeFW_MessageHandler::handleNumberMessage() Message consumed by message handler at index " + _loc2_);
return undefined;
}
_loc2_ = _loc2_ + 1;
}
trace("CafeFW_MessageHandler::handleNumberMessage() Message was not consumed by any registered message handlers!");
}
}
@@ -0,0 +1,119 @@
class CafeFW_OverlayManager
{
static var BASE_LEVEL = 200;
var m_nextOverlayLevel = 200;
var m_overlayCount = 0;
var m_intervalId = -1;
function CafeFW_OverlayManager()
{
trace("CafeFW_OverlayManager::constructor");
this.m_overlaysToUnload = new Array();
this.m_userOverlaysToUnload = new Array();
this.m_onExitScreenFuncs = new Object();
}
function loadOverlayScreen(screenFileName, nScreenLevel)
{
_global.gEH.disableCurrentLocalEventHandler();
if(nScreenLevel == undefined || nScreenLevel == null)
{
trace("CafeFW_OverlayManager::loadOverlayScreen loading " + screenFileName + " into level " + this.m_nextOverlayLevel);
_root.createEmptyMovieClip("OVERLAY_" + this.m_nextOverlayLevel,this.m_nextOverlayLevel);
var mc = eval("_root.OVERLAY_" + this.m_nextOverlayLevel);
mc.loadMovie(screenFileName + ".swf");
this.m_nextOverlayLevel = this.m_nextOverlayLevel + 1;
this.m_overlayCount = this.m_overlayCount + 1;
}
else
{
trace("CafeFW_OverlayManager::loadOverlayScreen loading " + screenFileName + " into level " + nScreenLevel);
_root.createEmptyMovieClip("OVERLAY_" + nScreenLevel,nScreenLevel);
var mc = eval("_root.OVERLAY_" + nScreenLevel);
mc.loadMovie(screenFileName + ".swf");
}
}
function unloadOverlayByLevel(nScreenLevel)
{
trace("CafeFW_OverlayManager::unloadOverlayByLevel() screenLevel=" + nScreenLevel);
this.m_overlaysToUnload.push(nScreenLevel);
this.callOnExit(nScreenLevel);
this.queueUnloads();
}
function unloadOverlayByUserLevel(nScreenLevel)
{
trace("CafeFW_OverlayManager::unloadOverlayByUserLevel() screenLevel=" + nScreenLevel);
this.m_userOverlaysToUnload.push(nScreenLevel);
this.callOnExit(nScreenLevel);
this.queueUnloads();
}
function setOnExitScreen(funcObj, nScreenLevel)
{
trace("CafeFW_OverlayManager::setOnExitScreen() screenLevel=" + nScreenLevel);
if(nScreenLevel == undefined)
{
trace("WARNING: no level specified for on exit callback CafeFW_OverlayManager::setOnExitScreen()");
nScreenLevel = this.m_nextOverlayLevel - 1;
}
var _loc3_ = this.m_onExitScreenFuncs[String(nScreenLevel)];
if(_loc3_ != null && _loc3_ != undefined && funcObj != null)
{
trace("WARNING: overwriting callback CafeFW_OverlayManager::setOnExitScreen() screenLevel=" + nScreenLevel);
}
this.m_onExitScreenFuncs[String(nScreenLevel)] = funcObj;
}
function callOnExit(nScreenLevel)
{
trace("CafeFW_OverlayManager::callOnExit() screenLevel=" + nScreenLevel);
var _loc2_ = this.m_onExitScreenFuncs[String(nScreenLevel)];
if(_loc2_ != null && _loc2_ != undefined)
{
_loc2_();
delete this.m_onExitScreenFuncs[String(nScreenLevel)];
}
}
function queueUnloads()
{
if(this.m_intervalId == -1)
{
var callbackThis = this;
this.m_intervalId = setInterval(function()
{
callbackThis.unloadOverlaysCallback();
}
,1);
}
}
function unloadOverlaysCallback()
{
clearInterval(this.m_intervalId);
this.m_intervalId = -1;
var _loc2_ = 0;
while(_loc2_ != this.m_overlaysToUnload.length)
{
this.unloadOverlayFromLevel(this.m_overlaysToUnload[_loc2_]);
this.m_overlayCount = this.m_overlayCount - 1;
_loc2_ = _loc2_ + 1;
}
if(this.m_overlayCount == 0)
{
this.m_nextOverlayLevel = CafeFW_OverlayManager.BASE_LEVEL;
}
_loc2_ = 0;
while(_loc2_ != this.m_userOverlaysToUnload.length)
{
this.unloadOverlayFromLevel(this.m_userOverlaysToUnload[_loc2_]);
_loc2_ = _loc2_ + 1;
}
this.m_overlaysToUnload = new Array();
this.m_userOverlaysToUnload = new Array();
}
function unloadOverlayFromLevel(level)
{
trace("CafeFW_OverlayManager::unloadOverlayFromLevel() level=" + level);
var mc = eval("_root.OVERLAY_" + level);
if(mc != undefined)
{
_global.gCT.unregisterFromRoot(mc);
unloadMovie(mc);
}
}
}
@@ -0,0 +1,209 @@
class CafeFW_ScreenManager
{
var m_screenStack = new Array();
var m_screenMarkers = new Array(10);
var m_screenContextData = new Array();
var maxNumberOnChangeCallbacks = 10;
var m_mainScreenLevel = 10;
var m_intervalId = -1;
function CafeFW_ScreenManager(mainScreenLevel)
{
trace("cafeFW_ScreenManager::constructor");
this.m_arrOnChangeFunc = new Array(this.maxNumberOnChangeCallbacks);
if(mainScreenLevel != NaN)
{
this.m_mainScreenLevel = mainScreenLevel;
}
}
function setOnExitScreen(funcObj)
{
this.m_onExitScreenFunc = funcObj;
}
function setRefToGlobalEventHandler(gEventHandler)
{
this.m_gEventHandler = gEventHandler;
}
function setRefToGlobalFocusManager(gFocusManager)
{
this.m_gFocusManager = gFocusManager;
}
function changeMainScreen(sScreenId)
{
this.m_bgFile = _global.getBackgroundScreenFileName(sScreenId);
this.m_gFocusManager.clearAllItems();
if(String(this.m_onExitScreenFunc) == "[function]" || this.m_onExitScreenFunc != null)
{
this.m_onExitScreenFunc();
}
this.m_onExitScreenFunc = null;
var _loc4_ = 0;
while(_loc4_ < this.maxNumberOnChangeCallbacks)
{
if(String(this.m_arrOnChangeFunc[_loc4_]) == "[function]" || this.m_arrOnChangeFunc[_loc4_] != null)
{
this.m_arrOnChangeFunc.register4(sScreenId);
}
_loc4_ = _loc4_ + 1;
}
_root.gScreenTitle.hide();
this.m_gEventHandler.setLocalEventHandler(this.dummyFunc);
this.pushScreen(sScreenId);
this.m_screenContextData.push(null);
this.m_sCurrentScreenId = sScreenId;
trace("Screen Stack = " + this.m_screenStack);
this.m_file = sScreenId + ".swf";
trace("CAFE Scn Manager :: Changing screen to: " + this.m_file + " : " + _root.gblSMChangeScreen);
if(this.m_intervalId != -1)
{
clearInterval(this.m_intervalId);
}
this.m_intervalId = setInterval(_root.gblSMChangeScreen,30);
}
function goBackScreen()
{
trace("***** cafeFW_ScreenManager::goBackScreen");
trace("m_screenStack.length=" + this.m_screenStack.length);
trace("Screen Stack = " + this.m_screenStack);
if(this.m_screenStack.length <= 1)
{
return undefined;
}
this.m_gFocusManager.clearAllItems();
if(String(this.m_onExitScreenFunc) == "[function]" || this.m_onExitScreenFunc != null)
{
this.m_onExitScreenFunc();
}
this.m_onExitScreenFunc = null;
this.popScreen();
this.m_sCurrentScreenId = this.m_screenStack[this.m_screenStack.length - 1];
var _loc4_ = 0;
while(_loc4_ < this.maxNumberOnChangeCallbacks)
{
if(String(this.m_arrOnChangeFunc[_loc4_]) == "[function]" || this.m_arrOnChangeFunc[_loc4_] != null)
{
this.m_arrOnChangeFunc.register4(this.m_sCurrentScreenId);
}
_loc4_ = _loc4_ + 1;
}
this.m_gEventHandler.setLocalEventHandler(this.dummyFunc);
trace(this.m_screenStack);
this.m_file = this.m_sCurrentScreenId + ".swf";
trace("Back to screen: " + this.m_file);
this.m_bgFile = _global.getBackgroundScreenFileName(this.m_sCurrentScreenId);
// Checked
getUrl("FSCommand:PlaySound", "Gui_LWShellBackCancelButton");
if(this.m_intervalId != -1)
{
clearInterval(this.m_intervalId);
}
this.m_intervalId = setInterval(_root.gblSMChangeScreen,30);
}
function getLastScreenId()
{
if(this.m_screenStack.length <= 1)
{
return -1;
}
return this.m_screenStack[this.m_screenStack.length - 2];
}
function getCurrentScreenId()
{
if(this.m_screenStack.length <= 0)
{
return -1;
}
return this.m_screenStack[this.m_screenStack.length - 1];
}
function pushScreen(screenId)
{
if(screenId != null && screenId != undefined && screenId != "" && this.m_screenStack.length == 0)
{
// Checked
getUrl("FSCommand:CallGameFunction", "%BindKeyboardToShell");
}
this.m_screenStack.push(screenId);
}
function popScreen()
{
if(this.m_screenStack.length <= 1)
{
// Checked
getUrl("FSCommand:CallGameFunction", "%UnbindKeyboardFromShell");
}
this.m_screenStack.pop();
this.m_screenContextData.pop();
}
function markStack(nMarker)
{
this.m_screenMarkers[nMarker] = this.m_screenStack.length;
}
function clearStackToMarker(nMarker)
{
var _loc2_ = this.m_screenMarkers[nMarker];
trace("gblScreenStack.length=" + this.m_screenStack.length);
while(_loc2_ < this.m_screenStack.length)
{
this.popScreen();
}
trace("resetting stack=" + this.m_screenStack);
}
function clearStack()
{
if(this.m_screenStack.length > 1)
{
this.m_screenStack.splice(0,this.m_screenStack.length - 1);
this.m_screenContextData.splice(0,this.m_screenStack.length - 1);
}
// Checked
getUrl("FSCommand:CallGameFunction", "%UnbindKeyboardFromShell");
}
function dummyFunc()
{
}
function setContextDataObject(screenData)
{
this.m_screenContextData[this.m_screenStack.length - 1] = screenData;
}
function getContextDataObject()
{
return this.m_screenContextData[this.m_screenStack.length - 1];
}
function addOnChangeCallback(functionIndex, fxn)
{
if(functionIndex > -1 && functionIndex < this.maxNumberOnChangeCallbacks)
{
this.m_arrOnChangeFunc[functionIndex] = null;
this.m_arrOnChangeFunc[functionIndex] = fxn;
}
else
{
trace("addOnChangeCallback array range out of bounds");
}
}
function removeOnChangeCallback(functionIndex)
{
if(functionIndex > -1 && functionIndex < this.maxNumberOnChangeCallbacks)
{
this.m_arrOnChangeFunc[functionIndex] = null;
}
else
{
trace("addOnChangeCallback array range out of bounds");
}
}
function removeAllOnChangeCallbacks()
{
var _loc2_ = 0;
_loc2_ = 0;
while(_loc2_ < this.maxNumberOnChangeCallbacks)
{
this.m_arrOnChangeFunc[_loc2_] = null;
_loc2_ = _loc2_ + 1;
}
this.m_arrOnChangeFunc = new Array(this.maxNumberOnChangeCallbacks);
}
function displayStackContent()
{
trace("Screen Stack = " + this.m_screenStack);
}
}
@@ -0,0 +1,177 @@
class ChatComponent
{
static var c_gadgetOffset = 3;
static var c_chatModeGlobal = 0;
static var c_chatModeLocal = 1;
static var c_chatModeLan = 2;
function ChatComponent()
{
this.m_localMessageHandlerFunc = _global.bind1DynamicParams(this,this.localMessageHandler);
}
function localMessageHandler(message)
{
var flag = false;
if(message !== _global.MSGCODE.FE_MP_REFRESH_CHAT_TEXTLIST)
{
flag = false;
}
else
{
this.UpdateChatText();
returnVal = false;
}
return flag;
}
function onLoad()
{
switch(this.m_chatMode)
{
case ChatComponent.c_chatModeGlobal:
default:
this.m_chatTokenPrefix = "$CHAT_TEXT_GLOBAL";
break;
case ChatComponent.c_chatModeLocal:
case ChatComponent.c_chatModeLan:
this.m_chatTokenPrefix = "$CHAT_TEXT_LOCAL";
}
this.initGUI();
_global.gMH.addMessageHandler(this.m_localMessageHandlerFunc);
this.UpdateLayout();
}
function onUnload()
{
_global.gMH.removeMessageHandler(this.m_localMessageHandlerFunc);
delete this.m_localMessageHandlerFunc;
}
function UpdateLayout()
{
var uiScrollingTextBoxComponent = this.uiScrollingTextBox;
var inputBoxComponent = this.chatInputBox;
if(!this.m_preservePlacement)
{
inputBoxComponent._x = uiScrollingTextBoxComponent._x;
inputBoxComponent._y = uiScrollingTextBoxComponent.getHeight()
+ uiScrollingTextBoxComponent._y
+ ChatComponent.c_gadgetOffset;
}
var textBoxWidth = uiScrollingTextBoxComponent.getWidth();
var sendButtonWidth = textBoxWidth - this.sendButton.getWidth();
inputBoxComponent.setWidth(sendButtonWidth);
if(!this.m_preservePlacement)
{
this.sendButton._y = inputBoxComponent._y;
this.sendButton._x = inputBoxComponent._x + sendButtonWidth;
}
}
function ClearHistory()
{
// Checked
getURL("FSCommand:CallGameFunction","%ClearChatHistory?ChatMode=" + this.m_chatMode);
this.uiScrollingTextBox.clear();
}
function UpdateChatText()
{
var ret = new Object();
var textRawColumn = new Array();
// Checked
loadVariables("QueryGameEngine?CHAT_HISTORY?ChatMode=" + this.m_chatMode,ret);
if(ret.CHAT_HISTORY_COUNT != undefined)
{
var historyList = new Array();
historyList = ret.CHAT_HISTORY_COLORS.split(",");
var count = Number(ret.CHAT_HISTORY_COUNT);
for(var i = 0; i < count; ++i)
{
textRawColumn.push(this.m_chatTokenPrefix
+ String(i)
+ ","
+ historyList[i]);
}
}
var uiScrollingTextBoxComponent = this.uiScrollingTextBox;
uiScrollingTextBoxComponent.setColumnData(0,textRawColumn);
uiScrollingTextBoxComponent.refreshDisplay();
if(this.uiScrollBar.getValue() > 0.9 * this.uiScrollBar.getMax())
{
uiScrollingTextBoxComponent.moveViewToLast();
}
else
{
uiScrollingTextBoxComponent.refreshScrollbar();
}
if(this.m_isScrollbarVisible != this.uiScrollBar._visible)
{
uiScrollingTextBoxComponent.moveViewToLast();
this.m_isScrollbarVisible = this.uiScrollBar._visible;
}
}
function initGUI()
{
var uiScrollingTextBoxComponent = this.uiScrollingTextBox;
this.m_isScrollbarVisible = false;
this.uiScrollBar.hide();
uiScrollingTextBoxComponent.setNumEntries(this.m_numLines);
uiScrollingTextBoxComponent.setVerticalPadding(1);
uiScrollingTextBoxComponent.disableEntryHitRegion();
var scrollBarWidth = this.uiScrollBar.getWidth();
if(this.m_width != undefined
&& this.m_width > 0
&& this.m_height != undefined
&& this.m_height > 0)
{
uiScrollingTextBoxComponent.setRenderSize(this.m_height,this.m_width);
}
var textColumn = new Array();
textColumn.push({
symbol: "std_mouseListboxEntryTextElementSymbol",
width: this.m_width - scrollBarWidth,
leftMargin: 0,
rightMargin: scrollBarWidth,
useHighlights: false,
isSelectable: false,
useHitRegion: false,
autoSize: true
});
uiScrollingTextBoxComponent.init(textColumn,25);
uiScrollingTextBoxComponent.attachScrollbarController(this.uiScrollBar);
this.UpdateChatText();
this.sendButton.show();
this.sendButton.enable();
this.sendButton.setOnMouseUpFunction(_global.bind0(this,this.sendButtonClicked));
this.chatInputBox.setOnEnterFunction(_global.bind0(this,this.sendButtonClicked));
}
function onScreenExit()
{
this.uiScrollingTextBox.removeListener(this);
this.uiScrollingTextBox.shutdown();
clearData();
delete _global.ChatComponent;
}
function sendButtonClicked()
{
var textRaw = this.chatInputBox.getContents();
// Checked
getURL("FSCommand:CallGameFunction",
"%SendChatMessage?ChatText="
+ textRaw
+ "|ChatMode="
+ this.m_chatMode);
this.chatInputBox.setContents(this.m_focusedChatPrefix);
}
function setFocusedPlayerId(id)
{
if(id == "")
{
this.m_focusedChatPrefix = "";
}
else
{
var ret = new Object();
// Checked
loadVariables("QueryGameEngine?WHISPER_PREFIX?Player=" + id,ret);
this.m_focusedChatPrefix = ret.WHISPER_PREFIX + " ";
this.chatInputBox.takeFocus();
}
this.chatInputBox.setContents(this.m_focusedChatPrefix);
}
}
@@ -0,0 +1,3 @@
interface ICafe2_FWSettings
{
}
@@ -0,0 +1,3 @@
interface ICafe2_FocusableControl
{
}
@@ -0,0 +1,3 @@
interface IListboxEntryElementEventListener
{
}
@@ -0,0 +1,3 @@
interface IListboxEntryEventListener
{
}
@@ -0,0 +1,3 @@
interface IListboxEventListener
{
}
@@ -0,0 +1,3 @@
interface IScrollbarEventListener
{
}
@@ -0,0 +1,27 @@
class MovieComponent extends MovieClip
{
function MovieComponent()
{
super();
trace("MovieComponent::MovieComponent()");
}
function PlayMovie(movieName)
{
trace("MovieComponent::PlayMovie(), movieName is " + movieName);
var _loc2_ = "|left=" + this._x + "|top=" + this._y + "|width=" + this._width + "|height=" + this._height;
var _loc3_ = "%PlayMovie?handle=" + this._handle + "|movie=" + movieName + "|loop=1|preload=0" + _loc2_;
getURL("FSCommand:CallGameFunction",_loc3_);
}
function PlayMovieAtomic(movieName)
{
trace("MovieComponent::PlayMovieAtomic(), movieName is " + movieName);
// Checked
getURL("FSCommand:CallGameFunction", "%PlayMovieAtomic?movie=" + movieName);
}
function StopMovie()
{
trace("MovieComponent::StopMovie()");
// Checked
getURL("FSCommand:CallGameFunction","%StopMovie?handle=" + this._handle);
}
}
@@ -0,0 +1,112 @@
class blimpAnimationFactory
{
var m_blimpIndex = 0;
var m_monitorCycle = 0;
static var FORGROUND_BLIMP_RANGE_BOUNDRY = 2;
static var MIDGROUND_BLIMP_RANGE_BOUNDRY = 6;
static var FOREGROUND = 0;
static var MIDDLEGROUND = 1;
static var BACKGROUND = 2;
static var MAX_MONITOR_CYCLES = 600;
static var MIN_Y_FROM_TOP = 0;
static var RANDOM_OFFSET_MULT = 200;
static var LEVEL_OFFSET = 10;
static var MAX_X_POSITION = 2400;
var m_wallXOrigin = 0;
var m_xOffset = 300;
function blimpAnimationFactory()
{
}
function onLoad()
{
this.init();
}
function init()
{
this.m_blimpArray = new Array();
this.m_monitorCycle = Math.random() * blimpAnimationFactory.MAX_MONITOR_CYCLES;
this.generateBlimp();
this.onEnterFrame = this.monitor;
}
function generateBlimp()
{
var _loc5_ = undefined;
var _loc4_ = undefined;
var _loc2_ = undefined;
switch(this.m_type)
{
case blimpAnimationFactory.FOREGROUND:
_loc2_ = this.frontBlimpMC;
break;
case blimpAnimationFactory.MIDDLEGROUND:
_loc2_ = this.midBlimpMC;
break;
case blimpAnimationFactory.BACKGROUND:
_loc2_ = this.farBlimpMC;
}
this.m_blimpArray[this.m_blimpIndex] = _loc2_.duplicateMovieClip("blimp_" + String(this.m_blimpIndex),blimpAnimationFactory.LEVEL_OFFSET + this.m_maxBlimps - this.m_blimpIndex);
_loc5_ = this.m_blimpArray[this.m_blimpIndex]._width * this.m_scale;
_loc4_ = this.m_blimpArray[this.m_blimpIndex]._height * this.m_scale;
this.m_blimpArray[this.m_blimpIndex]._width = _loc5_;
this.m_blimpArray[this.m_blimpIndex]._height = _loc4_;
this.m_blimpArray[this.m_blimpIndex]._xOrigin = this.m_blimpArray[this.m_blimpIndex]._x;
var _loc3_ = blimpAnimationFactory.MIN_Y_FROM_TOP + blimpAnimationFactory.RANDOM_OFFSET_MULT * Math.random();
this.m_blimpArray[this.m_blimpIndex]._y = _loc3_;
this.m_blimpArray[this.m_blimpIndex]._alpha = 100;
this.m_blimpIndex = this.m_blimpArray.length;
}
function monitor()
{
var _loc4_ = undefined;
if(this.m_blimpIndex < this.m_maxBlimps)
{
if(this.m_monitorCycle < blimpAnimationFactory.MAX_MONITOR_CYCLES)
{
this.m_monitorCycle = this.m_monitorCycle + 1;
}
else if(this.lastBlimpIsClear())
{
this.m_monitorCycle = 0;
this.generateBlimp();
}
}
var _loc2_ = 0;
while(_loc2_ < this.m_blimpIndex)
{
var _loc3_ = this.m_blimpArray[_loc2_]._x;
if(_loc3_ > blimpAnimationFactory.MAX_X_POSITION)
{
_loc3_ = this.m_blimpArray[_loc2_]._xOrigin;
}
else
{
_loc3_ += this.m_stepSize;
}
this.m_blimpArray[_loc2_]._x = _loc3_;
_loc2_ = _loc2_ + 1;
}
}
function lastBlimpIsClear()
{
var _loc2_ = this.m_blimpArray.length - 1;
if(_loc2_ >= 0)
{
var _loc4_ = this.m_blimpArray[_loc2_]._x;
var _loc3_ = this.m_wallXOrigin + 2 * this.m_blimpArray[_loc2_]._width;
if(_loc4_ > _loc3_)
{
return true;
}
return false;
}
return true;
}
function setBaseBlimpSpeed(v)
{
this.m_stepSize = v;
}
function getBaseBlimpSpeed()
{
return this.m_stepSize;
}
}
@@ -0,0 +1,152 @@
class bombAnimationFactory
{
var m_bombIndex = 0;
var m_AngleMax = 45;
static var MIDGROUND_BOMB_RANGE_BOUNDRY = 30;
static var MAX_MONITOR_CYCLES = 10;
static var MAX_Y_FOR_FALL = 860;
function bombAnimationFactory()
{
}
function onLoad()
{
this.init();
}
function init()
{
this.m_bombArray = new Array();
this.m_monitorCycle = 0;
var _loc2_ = 1365;
this.m_widthBase = _loc2_ * 1.5;
this.m_widthOffset = _loc2_ / 2;
this.generateBomb();
this.onEnterFrame = this.monitor;
}
function generateBomb()
{
var mc;
var offset = 0;
var w;
var h;
var len = this.m_bombArray.length;
var clipToDuplicate;
var bombType;
if(this.m_exploding)
{
clipToDuplicate = this.frontBombMC;
}
else
{
clipToDuplicate = eval("this." + this.m_contentMC);
}
mc = clipToDuplicate.duplicateMovieClip("bomb" + String(this.m_bombIndex),100 - this.m_bombIndex);
mc._bombState = "ready";
mc.mID = this.m_bombIndex;
this.m_bombArray[this.m_bombIndex] = mc;
this.m_bombArray[this.m_bombIndex]._x = this.getNewXPos();
this.m_bombArray[this.m_bombIndex]._xOrig = this.m_bombArray[this.m_bombIndex]._x;
w = this.m_bombArray[this.m_bombIndex]._width * this.m_scale;
h = this.m_bombArray[this.m_bombIndex]._height * this.m_scale;
this.m_bombArray[this.m_bombIndex]._width = w;
this.m_bombArray[this.m_bombIndex]._height = h;
this.m_bombArray[this.m_bombIndex]._y = -100 * (1 + Math.random());
this.m_bombArray[this.m_bombIndex]._alpha = 100;
this.m_bombIndex = this.m_bombArray.length;
}
function monitor()
{
if(this.m_bombIndex < this.m_maxBombs)
{
if(this.m_monitorCycle >= bombAnimationFactory.MAX_MONITOR_CYCLES)
{
this.generateBomb();
this.m_monitorCycle = 0;
}
else
{
this.m_monitorCycle = this.m_monitorCycle + 1;
}
}
var _loc2_ = 0;
while(_loc2_ < this.m_bombIndex)
{
var _loc3_ = this.m_bombArray[_loc2_]._y;
if(_loc3_ > bombAnimationFactory.MAX_Y_FOR_FALL && this.m_exploding)
{
switch(this.m_bombArray[_loc2_]._bombState)
{
case "ready":
this.m_bombArray[_loc2_]._bombState = "fire";
this.m_bombArray[_loc2_]._rotation = 0;
this.m_bombArray[_loc2_].gotoAndPlay("_fire");
break;
case "fire":
break;
case "reset":
this.reset(_loc2_);
}
}
else if(_loc3_ < bombAnimationFactory.MAX_Y_FOR_FALL)
{
this.fall(_loc2_);
}
else
{
this.reset(_loc2_);
}
_loc2_ = _loc2_ + 1;
}
}
function fall(bombID)
{
var _loc5_ = this.m_bombArray[bombID]._x;
var _loc4_ = this.m_bombArray[bombID]._y;
var _loc6_ = undefined;
var _loc7_ = undefined;
var _loc3_ = undefined;
_loc6_ = this.m_stepSize;
_loc7_ = _loc6_;
_loc5_ += _loc6_;
_loc4_ += _loc7_;
_loc3_ = this.m_bombArray[bombID]._rotation;
if(_loc3_ < this.m_AngleMax)
{
_loc3_ = _loc3_ + 1;
}
else
{
_loc3_ = this.m_AngleMax;
}
this.m_bombArray[bombID]._x = _loc5_;
this.m_bombArray[bombID]._y = _loc4_;
this.m_bombArray[bombID]._rotation = _loc3_;
}
function setBaseBombSpeed(v)
{
this.m_stepSize = v;
}
function setBombAngel(v)
{
this.m_AngleMax = v;
}
function getBaseBombSpeed()
{
return this.m_stepSize;
}
function getBombAngle()
{
return this.m_AngleMax;
}
function reset(bombID)
{
this.m_bombArray[bombID]._bombState = "ready";
this.m_bombArray[bombID]._x = this.getNewXPos();
this.m_bombArray[bombID]._y = -100 * (1 + Math.random());
this.m_bombArray[bombID]._rotation = 0;
this.m_bombArray[bombID]._alpha = 100;
}
function getNewXPos()
{
return this.m_widthBase * Math.random() - this.m_widthOffset;
}
}
@@ -0,0 +1,153 @@
class buddyListComponent implements IListboxEventListener
{
static var NO_SELECTION = -1;
function buddyListComponent()
{
this.m_localMessageHandlerFunc = _global.bind1DynamicParams(this,this.localMessageHandler);
this.m_listeners = new Array();
this.m_buddyIds = new Array();
this.m_buddyIndex = buddyListComponent.NO_SELECTION;
}
function OnListboxIndexMouseClick(index, previouslySelectedIndex)
{
var _loc5_ = new Object();
// Checked
loadVariables("QueryGameEngine?LASTMOUSEPRESSTYPE",_loc5_);
if(Number(_loc5_.LASTMOUSEPRESSTYPE) == _global.ENUM.MOUSEBUTTONPRESS_LEFT)
{
if(this.m_buddyIndex == index)
{
this.m_buddyIndex = buddyListComponent.NO_SELECTION;
}
else
{
this.m_buddyIndex = index;
}
}
this.listbox.setSelectedIndex(this.m_buddyIndex);
var _loc3_ = 0;
while(_loc3_ < this.m_listeners.length)
{
this.m_listeners.register3(index);
_loc3_ = _loc3_ + 1;
}
}
function OnListboxIndexElementMouseClick(index, element, previouslySelectedIndex)
{
}
function refresh()
{
this.UpdateList();
}
function addListener(fn)
{
this.removeListener(fn);
this.m_listeners.push(fn);
}
function removeListener(fn)
{
var _loc2_ = 0;
while(_loc2_ < this.m_listeners.length)
{
if(this.m_listeners[_loc2_] == fn)
{
this.m_listeners.splice(_loc2_,1);
break;
}
_loc2_ = _loc2_ + 1;
}
}
function getBuddyIdAt(index)
{
if(index >= 0 && index < this.m_buddyIds.length)
{
return this.m_buddyIds[index];
}
return undefined;
}
function onLoad()
{
this.initGUI();
this.UpdateList();
_global.gMH.addMessageHandler(this.m_localMessageHandlerFunc);
}
function onUnload()
{
this.gameListTextBox.removeListener(this);
_global.gMH.removeMessageHandler(this.m_localMessageHandlerFunc);
delete this.m_localMessageHandlerFunc;
}
function initGUI()
{
this.listbox.setNumEntries(this.m_visibleEntries);
this.listbox.setVerticalPadding(this.m_entryPaddingV);
this.listbox.addListener(this);
var _loc2_ = new Array();
_loc2_.push({symbol:"std_mouseListboxEntryTextElementSymbol",width:200,leftMargin:18,rightMargin:0,useHitRegion:false});
_loc2_.push({symbol:"std_mouseListboxEntryTextElementSymbol",width:200,leftMargin:6,rightMargin:0,useHitRegion:false});
if(this.m_listboxHeight > 0 && this.m_listboxWidth > 0)
{
this.listbox.setRenderSize(this.m_listboxHeight,this.m_listboxWidth);
}
this.listbox.init(_loc2_,this.m_entryHeight);
this.listbox.attachScrollbarController(this.scrollbar);
this.listbox.moveViewToFirst();
this.listbox.refreshDisplay();
this.listbox.refreshScrollbar();
}
function localMessageHandler(messageCode)
{
var _loc3_ = true;
switch(messageCode)
{
case _global.MSGCODE.FE_MP_ONLINE_REFRESH_BUDDYLIST:
case _global.MSGCODE.FE_MP_ONLINE_FRIEND_REQUEST_RECEIVED:
case _global.MSGCODE.FE_MP_ONLINE_FRIEND_STATUS_RECEIVED:
this.UpdateList();
_loc3_ = false;
break;
default:
_loc3_ = false;
}
return _loc3_;
}
function UpdateList()
{
var _loc3_ = this.getPlayerID();
var _loc4_ = new Object();
loadVariables("QueryGameEngine?MP_BUDDYLIST",_loc4_);
this.m_buddyIds = _loc4_.MP_BUDDYLIST_IDS.split(",");
var _loc5_ = _loc4_.MP_BUDDYLIST_NAMES.split(",");
var _loc6_ = _loc4_.MP_BUDDYLIST_LOCATIONS.split(",");
this.listbox.setColumnData(0,_loc5_);
this.listbox.setColumnData(1,_loc6_);
this.m_buddyIndex = std_mouseScrollingListbox.NO_SELECTION;
var _loc2_ = 0;
while(_loc2_ < this.m_buddyIds.length)
{
if(this.m_buddyIds[_loc2_] == _loc3_)
{
this.m_buddyIndex = _loc2_;
break;
}
_loc2_ = _loc2_ + 1;
}
this.listbox.setSelectedIndex(this.m_buddyIndex);
this.listbox.refreshDisplay();
this.listbox.refreshScrollbar();
}
function getPlayerID()
{
if(this.m_buddyIndex >= 0 && this.m_buddyIndex < this.m_buddyIds.length)
{
return this.m_buddyIds[this.m_buddyIndex];
}
return "";
}
function clearSelection()
{
this.m_buddyIndex = buddyListComponent.NO_SELECTION;
this.listbox.SetSelectedIndex(this.m_buddyIndex);
this.listbox.RefreshDisplay();
}
}
@@ -0,0 +1,360 @@
class careerStatsComponent
{
var TAB_ONLINE = 0;
var TAB_OVERALL = 1;
var FACTION_ALLIES = 0;
var FACTION_SOVIETS = 1;
var FACTION_JAPANESE = 2;
var FACTION_ALL = 3;
var FLAG_UNRANKED = 1;
var FLAG_RANKED_1V1 = 2;
var FLAG_RANKED_2V2 = 4;
var FLAG_CLAN_1V1 = 8;
var FLAG_CLAN_2V2 = 16;
var FLAG_CAMPAIGN = 32;
var FLAG_SKIRMISH = 64;
var FLAG_NETWORK = 128;
var m_statLabels = new Array();
function careerStatsComponent()
{
trace("careerStatsComponent::careerStatsComponent() screen = " + screen);
}
function onLoad()
{
this.initGUI();
}
function onUnload()
{
delete _global.careerStatsComponent;
}
function initGUI()
{
trace("careerStatsComponent::initGUI()");
var ret = new Object();
// Checked
loadVariables("QueryGameEngine?FE_CURRENT_PROFILE&CAREERSTATS_RANK",ret);
if(ret.FE_CURRENT_PROFILE == undefined)
{
ret.FE_CURRENT_PROFILE = "";
}
trace("careerStatsComponent::initGUI() - Loaded Profile Name: " + ret.FE_CURRENT_PROFILE);
this.tfProfileName.text = ret.FE_CURRENT_PROFILE + "&Outline";
// Checked
getUrl("FSCommand:CallGameFunction", "%CareerStats_InitializeStats");
this.rctlTop.SetSelectedRadioButton(this.radOverall);
this.radOnline.setOnMouseDownFunction(_global.bind0(this,this.onOnlineClicked));
this.radOverall.setOnMouseDownFunction(_global.bind0(this,this.onOverallClicked));
this.initRadioButtons();
this.onOverallClicked();
}
function initRadioButtons()
{
this.tabOverall.lbOverall.setNumEntries(19);
this.tabOverall.lbOverall.setVerticalPadding(0);
this.tabOverall.lbOverall.disableEntryHitRegion();
var textList = new Array();
textList.push({symbol:"std_mouseListboxEntryTextElementSymbol",width:300,leftMargin:0,rightMargin:0,useHitRegion:false,fontSize:14});
textList.push({symbol:"std_mouseListboxEntryTextElementSymbol",width:155,leftMargin:5,rightMargin:0,useHitRegion:false,fontSize:14});
textList.push({symbol:"std_mouseListboxEntryTextElementSymbol",width:155,leftMargin:5,rightMargin:0,useHitRegion:false,fontSize:14});
textList.push({symbol:"std_mouseListboxEntryTextElementSymbol",width:155,leftMargin:5,rightMargin:0,useHitRegion:false,fontSize:14});
textList.push({symbol:"std_mouseListboxEntryTextElementSymbol",width:150,leftMargin:5,rightMargin:0,useHitRegion:false,fontSize:14});
this.tabOverall.lbOverall.init(textList,22);
this.tabOverall.lbOverall.attachScrollbarController(this.tabOverall.sbOverall);
this.tabOverall.lbOverall.moveViewToFirst();
this.tabOnline.radUnranked.setOnMouseDownFunction(_global.bind0(this,this.onUnrankedClicked));
this.tabOnline.radRanked1v1.setOnMouseDownFunction(_global.bind0(this,this.onRanked1v1Clicked));
this.tabOnline.radRanked2v2.setOnMouseDownFunction(_global.bind0(this,this.onRanked2v2Clicked));
this.tabOnline.radClan1v1.setOnMouseDownFunction(_global.bind0(this,this.onClan1v1Clicked));
this.tabOnline.radClan2v2.setOnMouseDownFunction(_global.bind0(this,this.onClan2v2Clicked));
this.tabOnline.radSummary.setOnMouseDownFunction(_global.bind0(this,this.onSummaryClicked));
this.tabOnline.lbOnline.setNumEntries(17);
this.tabOnline.lbOnline.setVerticalPadding(0);
this.tabOnline.lbOnline.disableEntryHitRegion();
textList = new Array();
textList.push({symbol:"std_mouseListboxEntryTextElementSymbol",width:300,leftMargin:0,rightMargin:0,useHitRegion:false,fontSize:14});
textList.push({symbol:"std_mouseListboxEntryTextElementSymbol",width:155,leftMargin:5,rightMargin:0,useHitRegion:false,fontSize:14});
textList.push({symbol:"std_mouseListboxEntryTextElementSymbol",width:155,leftMargin:5,rightMargin:0,useHitRegion:false,fontSize:14});
textList.push({symbol:"std_mouseListboxEntryTextElementSymbol",width:155,leftMargin:5,rightMargin:0,useHitRegion:false,fontSize:14});
textList.push({symbol:"std_mouseListboxEntryTextElementSymbol",width:150,leftMargin:5,rightMargin:0,useHitRegion:false,fontSize:14});
this.tabOnline.lbOnline.init(textList,22);
this.tabOnline.lbOnline.attachScrollbarController(this.tabOnline.sbOnline);
this.tabOnline.lbOnline.moveViewToFirst();
}
function fetchStatLabels(summaryFlags)
{
var ret = new Object();
// Checked
loadVariables("QueryGameEngine?CAREERSTATS_LABELS?StatFlags=" + summaryFlags,ret);
this.m_statLabels = ret.CAREERSTATS_LABELS.split(",");
for(var i = 0; i < this.m_statLabels.length; ++i)
{
this.m_statLabels[i] = "$" + this.m_statLabels[i];
}
}
function onOnlineClicked()
{
this.setTab(this.TAB_ONLINE);
this.tabOnline.rctlOnline.RadioButtonPressed(this.tabOnline.radSummary);
this.tabOnline.lbOnline.moveViewToFirst();
this.onSummaryClicked();
}
function onOverallClicked()
{
this.setTab(this.TAB_OVERALL);
var _loc7_ = new Object();
var _loc3_ = new Array();
var _loc5_ = new Array();
var _loc4_ = new Array();
var _loc6_ = new Array();
var flags = this.FLAG_UNRANKED + this.FLAG_RANKED_1V1 + this.FLAG_RANKED_2V2 + this.FLAG_CLAN_1V1 + this.FLAG_CLAN_2V2 + this.FLAG_CAMPAIGN + this.FLAG_SKIRMISH + this.FLAG_NETWORK;
this.fetchStatLabels(flags);
// Checked
loadVariables("QueryGameEngine?CAREERSTATS_SUMMARY?|Faction=" + this.FACTION_ALLIES + "|StatFlags=" + flags,_loc7_);
_loc3_ = _loc7_.CAREERSTATS_SUMMARY.split(",");
// Checked
loadVariables("QueryGameEngine?CAREERSTATS_SUMMARY?|Faction=" + this.FACTION_SOVIETS + "|StatFlags=" + flags,_loc7_);
_loc5_ = _loc7_.CAREERSTATS_SUMMARY.split(",");
// Checked
loadVariables("QueryGameEngine?CAREERSTATS_SUMMARY?|Faction=" + this.FACTION_JAPANESE + "|StatFlags=" + flags,_loc7_);
_loc4_ = _loc7_.CAREERSTATS_SUMMARY.split(",");
// Checked
loadVariables("QueryGameEngine?CAREERSTATS_SUMMARY?|Faction=" + this.FACTION_ALL + "|StatFlags=" + flags,_loc7_);
_loc6_ = _loc7_.CAREERSTATS_SUMMARY.split(",");
for(var i = 0; i < this.m_statLabels.length; ++i)
{
_loc6_[i] = "$" + _loc6_[i];
_loc5_[i] = "$" + _loc5_[i];
_loc3_[i] = "$" + _loc3_[i];
_loc4_[i] = "$" + _loc4_[i];
}
this.tabOverall.lbOverall.setColumnData(0,this.m_statLabels);
this.tabOverall.lbOverall.setColumnData(1,_loc6_);
this.tabOverall.lbOverall.setColumnData(2,_loc5_);
this.tabOverall.lbOverall.setColumnData(3,_loc3_);
this.tabOverall.lbOverall.setColumnData(4,_loc4_);
this.tabOverall.lbOverall.moveViewToFirst();
this.tabOverall.lbOverall.refreshDisplay();
this.tabOverall.lbOverall.refreshScrollbar();
}
function setTab(tabId)
{
switch(tabId)
{
case this.TAB_ONLINE:
this.tabOnline._visible = true;
this.tabOverall._visible = false;
break;
case this.TAB_OVERALL:
this.tabOnline._visible = false;
this.tabOverall._visible = true;
}
}
function onUnrankedClicked()
{
var _loc7_ = new Object();
var _loc3_ = new Array();
var _loc5_ = new Array();
var _loc4_ = new Array();
var _loc6_ = new Array();
this.fetchStatLabels(this.FLAG_UNRANKED);
// Checked
loadVariables("QueryGameEngine?CAREERSTATS_UNRANKED?Faction=" + this.FACTION_ALLIES,_loc7_);
_loc3_ = _loc7_.CAREERSTATS_UNRANKED.split(",");
// Checked
loadVariables("QueryGameEngine?CAREERSTATS_UNRANKED?Faction=" + this.FACTION_SOVIETS,_loc7_);
_loc5_ = _loc7_.CAREERSTATS_UNRANKED.split(",");
// Checked
loadVariables("QueryGameEngine?CAREERSTATS_UNRANKED?Faction=" + this.FACTION_JAPANESE + "&CAREERSTATS_SUMMARY?|Faction=" + this.FACTION_ALL + "|StatFlags=" + this.FLAG_UNRANKED,_loc7_);
// 吐槽一句,这里怎么突然还合并起来了,EA 真有你的
_loc4_ = _loc7_.CAREERSTATS_UNRANKED.split(",");
_loc6_ = _loc7_.CAREERSTATS_SUMMARY.split(",");
for(var i = 0; i < this.m_statLabels.length; ++i)
{
_loc6_[i] = "$" + _loc6_[i];
_loc5_[i] = "$" + _loc5_[i];
_loc3_[i] = "$" + _loc3_[i];
_loc4_[i] = "$" + _loc4_[i];
}
this.tabOnline.lbOnline.setColumnData(0,this.m_statLabels);
this.tabOnline.lbOnline.setColumnData(1,_loc6_);
this.tabOnline.lbOnline.setColumnData(2,_loc5_);
this.tabOnline.lbOnline.setColumnData(3,_loc3_);
this.tabOnline.lbOnline.setColumnData(4,_loc4_);
this.tabOnline.lbOnline.refreshDisplay();
this.tabOnline.lbOnline.refreshScrollbar();
}
function onRanked1v1Clicked()
{
var _loc7_ = new Object();
var _loc3_ = new Array();
var _loc5_ = new Array();
var _loc4_ = new Array();
var _loc6_ = new Array();
this.fetchStatLabels(this.FLAG_RANKED_1V1);
// Checked
loadVariables("QueryGameEngine?CAREERSTATS_RANKED_1V1?Faction=" + this.FACTION_ALLIES,_loc7_);
_loc3_ = _loc7_.CAREERSTATS_RANKED_1V1.split(",");
// Checked
loadVariables("QueryGameEngine?CAREERSTATS_RANKED_1V1?Faction=" + this.FACTION_SOVIETS,_loc7_);
_loc5_ = _loc7_.CAREERSTATS_RANKED_1V1.split(",");
// Checked
loadVariables("QueryGameEngine?CAREERSTATS_RANKED_1V1?Faction=" + this.FACTION_JAPANESE + "&CAREERSTATS_SUMMARY?|Faction=" + this.FACTION_ALL + "|StatFlags=" + this.FLAG_RANKED_1V1,_loc7_);
_loc4_ = _loc7_.CAREERSTATS_RANKED_1V1.split(",");
_loc6_ = _loc7_.CAREERSTATS_SUMMARY.split(",");
for(var i = 0; i < this.m_statLabels.length; ++i)
{
_loc6_[i] = "$" + _loc6_[i];
_loc5_[i] = "$" + _loc5_[i];
_loc3_[i] = "$" + _loc3_[i];
_loc4_[i] = "$" + _loc4_[i];
}
this.tabOnline.lbOnline.setColumnData(0,this.m_statLabels);
this.tabOnline.lbOnline.setColumnData(1,_loc6_);
this.tabOnline.lbOnline.setColumnData(2,_loc5_);
this.tabOnline.lbOnline.setColumnData(3,_loc3_);
this.tabOnline.lbOnline.setColumnData(4,_loc4_);
this.tabOnline.lbOnline.refreshDisplay();
this.tabOnline.lbOnline.refreshScrollbar();
}
function onRanked2v2Clicked()
{
var _loc7_ = new Object();
var _loc3_ = new Array();
var _loc5_ = new Array();
var _loc4_ = new Array();
var _loc6_ = new Array();
this.fetchStatLabels(this.FLAG_RANKED_2V2);
// Checked
loadVariables("QueryGameEngine?CAREERSTATS_RANKED_2V2?Faction=" + this.FACTION_ALLIES,_loc7_);
_loc3_ = _loc7_.CAREERSTATS_RANKED_2V2.split(",");
// Checked
loadVariables("QueryGameEngine?CAREERSTATS_RANKED_2V2?Faction=" + this.FACTION_SOVIETS,_loc7_);
_loc5_ = _loc7_.CAREERSTATS_RANKED_2V2.split(",");
// Checked
loadVariables("QueryGameEngine?CAREERSTATS_RANKED_2V2?Faction=" + this.FACTION_JAPANESE + "&CAREERSTATS_SUMMARY?|Faction=" + this.FACTION_ALL + "|StatFlags=" + this.FLAG_RANKED_2V2,_loc7_);
_loc4_ = _loc7_.CAREERSTATS_RANKED_2V2.split(",");
_loc6_ = _loc7_.CAREERSTATS_SUMMARY.split(",");
for(var i = 0; i < this.m_statLabels.length; ++i)
{
_loc6_[i] = "$" + _loc6_[i];
_loc5_[i] = "$" + _loc5_[i];
_loc3_[i] = "$" + _loc3_[i];
_loc4_[i] = "$" + _loc4_[i];
}
this.tabOnline.lbOnline.setColumnData(0,this.m_statLabels);
this.tabOnline.lbOnline.setColumnData(1,_loc6_);
this.tabOnline.lbOnline.setColumnData(2,_loc5_);
this.tabOnline.lbOnline.setColumnData(3,_loc3_);
this.tabOnline.lbOnline.setColumnData(4,_loc4_);
this.tabOnline.lbOnline.refreshDisplay();
this.tabOnline.lbOnline.refreshScrollbar();
}
function onClan1v1Clicked()
{
var _loc7_ = new Object();
var _loc3_ = new Array();
var _loc5_ = new Array();
var _loc4_ = new Array();
var _loc6_ = new Array();
this.fetchStatLabels(this.FLAG_CLAN_1V1);
// Checked
loadVariables("QueryGameEngine?CAREERSTATS_CLAN_1V1?Faction=" + this.FACTION_ALLIES,_loc7_);
_loc3_ = _loc7_.CAREERSTATS_CLAN_1V1.split(",");
// Checked
loadVariables("QueryGameEngine?CAREERSTATS_CLAN_1V1?Faction=" + this.FACTION_SOVIETS,_loc7_);
_loc5_ = _loc7_.CAREERSTATS_CLAN_1V1.split(",");
// Checked
loadVariables("QueryGameEngine?CAREERSTATS_CLAN_1V1?Faction=" + this.FACTION_JAPANESE + "&CAREERSTATS_SUMMARY?|Faction=" + this.FACTION_ALL + "|StatFlags=" + this.FLAG_CLAN_1V1,_loc7_);
_loc4_ = _loc7_.CAREERSTATS_CLAN_1V1.split(",");
_loc6_ = _loc7_.CAREERSTATS_SUMMARY.split(",");
var _loc2_ = 0;
while(_loc2_ < this.m_statLabels.length)
{
_loc6_[_loc2_] = "$" + _loc6_[_loc2_];
_loc5_[_loc2_] = "$" + _loc5_[_loc2_];
_loc3_[_loc2_] = "$" + _loc3_[_loc2_];
_loc4_[_loc2_] = "$" + _loc4_[_loc2_];
_loc2_ = _loc2_ + 1;
}
this.tabOnline.lbOnline.setColumnData(0,this.m_statLabels);
this.tabOnline.lbOnline.setColumnData(1,_loc6_);
this.tabOnline.lbOnline.setColumnData(2,_loc5_);
this.tabOnline.lbOnline.setColumnData(3,_loc3_);
this.tabOnline.lbOnline.setColumnData(4,_loc4_);
this.tabOnline.lbOnline.refreshDisplay();
this.tabOnline.lbOnline.refreshScrollbar();
}
function onClan2v2Clicked()
{
trace("careerStatsComponent::onClan2v2Clicked()");
var _loc7_ = new Object();
var _loc3_ = new Array();
var _loc5_ = new Array();
var _loc4_ = new Array();
var _loc6_ = new Array();
this.fetchStatLabels(this.FLAG_CLAN_2V2);
// Checked
loadVariables("QueryGameEngine?CAREERSTATS_CLAN_2V2?Faction=" + this.FACTION_ALLIES,_loc7_);
_loc3_ = _loc7_.CAREERSTATS_CLAN_2V2.split(",");
// Checked
loadVariables("QueryGameEngine?CAREERSTATS_CLAN_2V2?Faction=" + this.FACTION_SOVIETS,_loc7_);
_loc5_ = _loc7_.CAREERSTATS_CLAN_2V2.split(",");
// Checked
loadVariables("QueryGameEngine?CAREERSTATS_CLAN_2V2?Faction=" + this.FACTION_JAPANESE + "&CAREERSTATS_SUMMARY?|Faction=" + this.FACTION_ALL + "|StatFlags=" + this.FLAG_CLAN_2V2,_loc7_);
_loc4_ = _loc7_.CAREERSTATS_CLAN_2V2.split(",");
_loc6_ = _loc7_.CAREERSTATS_SUMMARY.split(",");
var _loc2_ = 0;
while(_loc2_ < this.m_statLabels.length)
{
_loc6_[_loc2_] = "$" + _loc6_[_loc2_];
_loc5_[_loc2_] = "$" + _loc5_[_loc2_];
_loc3_[_loc2_] = "$" + _loc3_[_loc2_];
_loc4_[_loc2_] = "$" + _loc4_[_loc2_];
_loc2_ = _loc2_ + 1;
}
this.tabOnline.lbOnline.setColumnData(0,this.m_statLabels);
this.tabOnline.lbOnline.setColumnData(1,_loc6_);
this.tabOnline.lbOnline.setColumnData(2,_loc5_);
this.tabOnline.lbOnline.setColumnData(3,_loc3_);
this.tabOnline.lbOnline.setColumnData(4,_loc4_);
this.tabOnline.lbOnline.refreshDisplay();
this.tabOnline.lbOnline.refreshScrollbar();
}
function onSummaryClicked()
{
trace("careerStatsComponent::onSummaryClicked()");
var _loc7_ = new Object();
var _loc3_ = new Array();
var _loc5_ = new Array();
var _loc4_ = new Array();
var _loc6_ = new Array();
var flags = this.FLAG_UNRANKED + this.FLAG_RANKED_1V1 + this.FLAG_RANKED_2V2 + this.FLAG_CLAN_1V1 + this.FLAG_CLAN_2V2;
this.fetchStatLabels(flags);
// Checked
loadVariables("QueryGameEngine?CAREERSTATS_SUMMARY?|Faction=" + this.FACTION_ALLIES + "|StatFlags=" + flags,_loc7_);
_loc3_ = _loc7_.CAREERSTATS_SUMMARY.split(",");
// Checked
loadVariables("QueryGameEngine?CAREERSTATS_SUMMARY?|Faction=" + this.FACTION_SOVIETS + "|StatFlags=" + flags,_loc7_);
_loc5_ = _loc7_.CAREERSTATS_SUMMARY.split(",");
// Checked
loadVariables("QueryGameEngine?CAREERSTATS_SUMMARY?|Faction=" + this.FACTION_JAPANESE + "|StatFlags=" + flags,_loc7_);
_loc4_ = _loc7_.CAREERSTATS_SUMMARY.split(",");
// Checked
loadVariables("QueryGameEngine?CAREERSTATS_SUMMARY?|Faction=" + this.FACTION_ALL + "|StatFlags=" + flags,_loc7_);
_loc6_ = _loc7_.CAREERSTATS_SUMMARY.split(",");
for(var i = 0; i < this.m_statLabels.length; ++i)
{
_loc6_[i] = "$" + _loc6_[i];
_loc5_[i] = "$" + _loc5_[i];
_loc3_[i] = "$" + _loc3_[i];
_loc4_[i] = "$" + _loc4_[i];
}
this.tabOnline.lbOnline.setColumnData(0,this.m_statLabels);
this.tabOnline.lbOnline.setColumnData(1,_loc6_);
this.tabOnline.lbOnline.setColumnData(2,_loc5_);
this.tabOnline.lbOnline.setColumnData(3,_loc3_);
this.tabOnline.lbOnline.setColumnData(4,_loc4_);
this.tabOnline.lbOnline.refreshDisplay();
this.tabOnline.lbOnline.refreshScrollbar();
}
}
@@ -0,0 +1,86 @@
class contextMenuEntry extends MovieClip
{
var m_selectCallback = null;
static var COLOR_TEXT_NORMAL = 16036194;
static var COLOR_TEXT_DISABLED = 6710886;
static var COLOR_TEXT_HIGHLIGHT = 16777215;
static var COLOR_TEXT_PRESSED = 10066329;
function contextMenuEntry()
{
super();
this.m_enabled = true;
}
function init()
{
this.setHighlighted(false);
this.hitRegion.onRollOver = _global.bind0(this,this.onMouseEnter);
this.hitRegion.onReleaseOutside = this.hitRegion.onDragOut = this.hitRegion.onRollOut = _global.bind0(this,this.onMouseLeave);
this.hitRegion.onPress = _global.bind0(this,this.onPressed);
this.hitRegion.onRelease = _global.bind0(this,this.onRelease);
this.textfield.textColor = contextMenuEntry.COLOR_TEXT_NORMAL;
}
function setEnabled(enabled)
{
this.m_enabled = enabled;
this.textfield.textColor = !this.m_enabled ? contextMenuEntry.COLOR_TEXT_DISABLED : contextMenuEntry.COLOR_TEXT_NORMAL;
}
function setSelectCallback(f)
{
this.m_selectCallback = f;
}
function setText(s)
{
this.textfield.text = s;
}
function adjustWidth(x)
{
this.textfield._width = x;
this.hitRegion._xscale = x;
this.highlight._xscale = x;
}
function setId(id)
{
this.m_id = id;
}
function getId()
{
return this.m_id;
}
function setHighlighted(highlighted)
{
this.highlight.gotoAndPlay(!highlighted ? "_turnoff" : "_turnon");
this.textfield.textColor = !highlighted ? contextMenuEntry.COLOR_TEXT_NORMAL : contextMenuEntry.COLOR_TEXT_HIGHLIGHT;
}
function onMouseEnter()
{
if(this.m_enabled)
{
this.setHighlighted(true);
}
}
function onMouseLeave()
{
if(this.m_enabled)
{
this.setHighlighted(false);
}
}
function onPressed()
{
if(this.m_enabled)
{
this.textfield.textColor = contextMenuEntry.COLOR_TEXT_PRESSED;
}
}
function onRelease()
{
if(this.m_enabled)
{
this.textfield.textColor = contextMenuEntry.COLOR_TEXT_HIGHLIGHT;
if(this.m_selectCallback != null)
{
this.m_selectCallback(this);
}
}
}
}
@@ -0,0 +1,27 @@
class fe_m_TitleBarComponent
{
function fe_m_TitleBarComponent()
{
this.init();
}
function init()
{
if(this.m_Visible)
{
this.titleTF.text = !this.m_Outline ? this.m_Title : this.m_Title + "&Outline";
this.shadowTF.text = !this.m_DropShadow ? "" : this.m_Title;
}
else
{
this.titleTF._visible = false;
this.shadowTF._visible = false;
}
}
function setTitle(titleStr, dropShadow, outLine)
{
this.m_Title = titleStr;
this.m_DropShadow = dropShadow;
this.m_Outline = outLine;
this.init();
}
}
@@ -0,0 +1,109 @@
class gameListComponent
{
var m_gameID_Array = new Array();
var m_gameName_Array = new Array();
var m_gameIndex = -1;
static var LINE_HEIGHT = 25;
function gameListComponent()
{
trace("gameListComponent::gameListComponent() screen = " + screen);
gameListComponent.m_thisClass = this;
}
function OnListboxIndexMouseClick(index, previouslySelectedIndex)
{
gameListComponent.m_thisClass.m_gameIndex = index;
}
function OnListboxIndexElementMouseClick(index, element, previouslySelectedIndex)
{
}
function onLoad()
{
trace("gameListComponent::onLoad()");
gameListComponent.m_thisClass.uiScrollBar.show();
gameListComponent.m_thisClass.uiScrollBar.enable();
gameListComponent.m_thisClass.refreshGameList(true);
_global.gMH.addMessageHandler(gameListComponent.m_thisClass.localMessageHandler);
}
function onUnload()
{
gameListComponent.m_thisClass.gameListTextBox.removeListener(gameListComponent.m_thisClass);
}
function initGUI()
{
}
function localMessageHandler(messageCode)
{
var flag = true;
trace("gameListComponent::localMessageHandler () message = " + messageCode + " : " + gameListComponent.m_thisClass);
if(messageCode !== _global.MSGCODE.FE_MP_ONLINE_REFRESH_GAMELIST)
{
flag = false;
}
else
{
gameListComponent.m_thisClass.refreshGameList(false);
}
return flag;
}
function scrollBarGotFocus()
{
}
function scrollBarLostFocus()
{
}
function traceData(labelStr, gameListData)
{
trace("-------------------------------------------------------------------------------");
trace("DATA FOR : QueryGameEngine?MP_GAMELIST : " + labelStr);
trace("MP_GAMELIST_IDS " + gameListData.MP_GAMELIST_IDS);
trace("MP_GAMELIST_GAMENAMES " + gameListData.MP_GAMELIST_GAMENAMES);
trace("MP_GAMELIST_MAPNAMES " + gameListData.MP_GAMELIST_MAPNAMES);
trace("MP_GAMELIST_PLAYERS " + gameListData.MP_GAMELIST_PLAYERS);
trace("MP_GAMELIST_CAPACITY " + gameListData.MP_GAMELIST_CAPACITY);
trace("MP_GAMELIST_PINGS " + gameListData.MP_GAMELIST_PINGS);
trace("MP_GAMELIST_OFFICAL " + gameListData.MP_GAMELIST_OFFICAL);
trace("MP_GAMELIST_PASSWORD " + gameListData.MP_GAMELIST_PASSWORD);
trace("MP_GAMELIST_RANKED " + gameListData.MP_GAMELIST_RANKED);
}
function refreshGameList(createNewList)
{
trace("gameListComponent::refreshGameList(), this" + gameListComponent.m_thisClass);
var ret = new Object();
// Checked
loadVariables("QueryGameEngine?MP_GAMELIST",ret);
if(ret.MP_GAMELIST_IDS == undefined)
{
ret.MP_GAMELIST_IDS = "-1";
ret.MP_GAMELIST_GAMENAMES = "No Games Available In This Lobby";
ret.MP_GAMELIST_MAPNAMES = "";
ret.MP_GAMELIST_PLAYERS = "";
ret.MP_GAMELIST_CAPACITY = "";
ret.MP_GAMELIST_PINGS = "";
ret.MP_GAMELIST_OFFICAL = "";
ret.MP_GAMELIST_PASSWORD = "";
ret.MP_GAMELIST_RANKED = "";
}
gameListComponent.m_thisClass.m_gameID_Array = ret.MP_GAMELIST_IDS.split(",");
gameListComponent.m_thisClass.m_gameName_Array = ret.MP_GAMELIST_GAMENAMES.split(",");
if(createNewList)
{
gameListComponent.m_thisClass.gameListTextBox.setNumEntries(gameListComponent.m_thisClass.m_visLines);
gameListComponent.m_thisClass.gameListTextBox.setVerticalPadding(1);
gameListComponent.m_thisClass.gameListTextBox.addListener(gameListComponent.m_thisClass);
var _loc3_ = new Array();
_loc3_.push({symbol:"std_mouseListboxEntryTextElementSymbol",width:this.m_width,leftMargin:0,rightMargin:0});
gameListComponent.m_thisClass.gameListTextBox.init(_loc3_,gameListComponent.LINE_HEIGHT);
gameListComponent.m_thisClass.gameListTextBox.attachScrollbarController(gameListComponent.m_thisClass.uiScrollBar);
gameListComponent.m_thisClass.gameListTextBox.setColumnData(0,gameListComponent.m_thisClass.m_gameName_Array);
gameListComponent.m_thisClass.gameListTextBox.moveViewToFirst();
gameListComponent.m_thisClass.gameListTextBox.refreshDisplay();
gameListComponent.m_thisClass.gameListTextBox.refreshScrollbar();
}
else
{
gameListComponent.m_thisClass.gameListTextBox.setColumnData(0,gameListComponent.m_thisClass.m_gameName_Array);
gameListComponent.m_thisClass.gameListTextBox.refreshDisplay();
gameListComponent.m_thisClass.gameListTextBox.refreshScrollbar();
}
}
}
@@ -0,0 +1,152 @@
class inviteListComponent
{
static var LINE_HEIGHT = 25;
static var INVITE_LISTBOX_SPACE_RESERVED_FOR_NAME = 0.6600000262260437;
function inviteListComponent()
{
this.m_localMessageHandlerFunc = _global.bind1DynamicParams(this,this.localMessageHandler);
this.m_listeners = new Array();
this.m_inviteNames = new Array();
this.m_inviteTypes = new Array();
this.m_inviteIds = new Array();
this.m_inviteIndex = std_mouseScrollingListbox.NO_SELECTION;
}
function OnListboxIndexMouseClick(index, previouslySelectedIndex)
{
this.m_inviteIndex = index;
this.notifyListeners();
}
function OnListboxIndexElementMouseClick(index, element, previouslySelectedIndex)
{
}
function refresh()
{
this.UpdateList();
}
function getSelectedInviteIndex()
{
return this.m_inviteIndex;
}
function getSelectedInviteId()
{
if(this.m_inviteIndex >= 0 && this.m_inviteIndex < this.m_inviteIds.length)
{
return this.m_inviteIds[this.m_inviteIndex];
}
return "";
}
function addListener(fn)
{
this.removeListener(fn);
this.m_listeners.push(fn);
}
function removeListener(fn)
{
var _loc2_ = 0;
while(_loc2_ < this.m_listeners.length)
{
if(this.m_listeners[_loc2_] == fn)
{
this.m_listeners.splice(_loc2_,1);
break;
}
_loc2_ = _loc2_ + 1;
}
}
function onLoad()
{
this.initGUI();
this.UpdateList();
_global.gMH.addMessageHandler(this.m_localMessageHandlerFunc);
}
function onUnload()
{
this.m_listBox.removeListener(this);
this.m_listBox = null;
_global.gMH.removeMessageHandler(this.m_localMessageHandlerFunc);
delete this.m_localMessageHandlerFunc;
}
function initGUI()
{
this.m_listBox = this.ListTextBox;
this.m_listBox.setNumEntries(this.m_visLines);
this.m_listBox.setVerticalPadding(0);
this.m_listBox.addListener(this);
this.m_nameWidth = this.m_width * inviteListComponent.INVITE_LISTBOX_SPACE_RESERVED_FOR_NAME;
this.m_typeWidth = this.m_width * (1 - inviteListComponent.INVITE_LISTBOX_SPACE_RESERVED_FOR_NAME);
var _loc2_ = new Array();
_loc2_.push({symbol:"std_mouseListboxEntryTextElementSymbol",width:this.m_nameWidth,leftMargin:0,rightMargin:0,useHitRegion:false});
_loc2_.push({symbol:"std_mouseListboxEntryTextElementSymbol",width:this.m_typeWidth,leftMargin:0,rightMargin:0,useHitRegion:false});
this.uiScrollBar.show();
this.uiScrollBar.enable();
this.m_listBox.init(_loc2_,inviteListComponent.LINE_HEIGHT);
this.m_listBox.attachScrollbarController(this.uiScrollBar);
this.m_listBox.moveViewToFirst();
this.m_listBox.refreshDisplay();
this.m_listBox.refreshScrollbar();
}
function localMessageHandler(messageCode)
{
var flag = true;
switch(messageCode)
{
case _global.MSGCODE.FE_MP_ONLINE_REFRESH_INVITELIST:
case _global.MSGCODE.FE_MP_ONLINE_INVITE_RECEIVED:
this.UpdateList();
flag = false;
break;
default:
flag = false;
}
return flag;
}
function UpdateList()
{
var _loc4_ = this.getSelectedInviteId();
var ret = new Object();
// Checked
loadVariables("QueryGameEngine?MP_INVITELIST",ret);
if(ret.MP_INVITELIST_NAMES == undefined)
{
this.m_inviteNames = new Array();
this.m_inviteTypes = new Array();
this.m_inviteIds = new Array();
}
else
{
this.m_inviteNames = ret.MP_INVITELIST_NAMES.split(",");
this.m_inviteTypes = ret.MP_INVITELIST_GAMETYPES.split(",");
this.m_inviteIds = ret.MP_INVITELIST_IDS.split(",");
}
this.m_listBox.setColumnData(0,this.m_inviteNames);
this.m_listBox.setColumnData(1,this.m_inviteTypes);
this.m_inviteIndex = std_mouseScrollingListbox.NO_SELECTION;
var _loc2_ = 0;
while(_loc2_ < this.m_inviteIds.length)
{
if(this.m_inviteIds[_loc2_] == _loc4_)
{
m_playerIndex = _loc2_;
break;
}
_loc2_ = _loc2_ + 1;
}
if(this.m_inviteIndex == std_mouseScrollingListbox.NO_SELECTION && this.m_inviteIds.length > 0)
{
this.m_inviteIndex = 0;
}
this.m_listBox.setSelectedIndex(this.m_inviteIndex);
this.notifyListeners();
this.m_listBox.refreshDisplay();
this.m_listBox.refreshScrollbar();
}
function notifyListeners()
{
var _loc2_ = 0;
while(_loc2_ < this.m_listeners.length)
{
this.m_listeners.register2(this.m_inviteIndex);
_loc2_ = _loc2_ + 1;
}
}
}
@@ -0,0 +1,207 @@
class lobbyListComponent implements IListboxEventListener
{
static var RECRUITMENT_UI_CONFIG = 0;
static var COMLINK_UI_CONFIG = 1;
static var CONFIGURATION_3 = 2;
var m_lobbyIDs = new Array();
var m_lobbyNames = new Array();
var m_currentLobby = -1;
var m_numberOfGames = new Array();
var m_numberOfPlayers = new Array();
static var LINE_HEIGHT = 25;
function lobbyListComponent()
{
this.m_localMessageHandlerFunc = _global.bind1DynamicParams(this,this.localMessageHandler);
}
function OnListboxIndexMouseClick(index, previouslySelectedIndex)
{
// Checked
getURL("FSCommand:CallGameFunction","%OnlineJoinLobby?Lobby=" + this.m_lobbyIDs[index]);
}
function OnListboxIndexElementMouseClick(index, element, previouslySelectedIndex)
{
}
function refresh()
{
this.UpdateList();
}
function GetListToggler()
{
switch(this.m_configurationType)
{
case lobbyListComponent.RECRUITMENT_UI_CONFIG:
return this.main_panel_1_MC.showListOfLobbiesButton;
case lobbyListComponent.COMLINK_UI_CONFIG:
return this.main_panel_2_MC.showListOfLobbiesButton;
case lobbyListComponent.CONFIGURATION_3:
return this.main_panel_3_MC.showListOfLobbiesButton;
default:
return null;
}
}
function onLoad()
{
this.onEnterFrame = _global.bind0(this,this.frameDelayedInit);
}
function frameDelayedInit()
{
_global.gMH.addMessageHandler(this.m_localMessageHandlerFunc);
this.m_stepSize = 10;
this.configLayout();
this.initGUI();
this.fitMaskToListSize();
this.UpdateList();
this.onEnterFrame = null;
}
function onUnload()
{
_global.gMH.removeMessageHandler(this.m_localMessageHandlerFunc);
delete this.m_localMessageHandlerFunc;
this.lobbyListPanelMC.lobbyListMC.lobbyListTextBox.removeListener(this);
}
function initGUI()
{
var _loc4_ = this.m_mainPanelMC.showListOfLobbiesButton;
_loc4_.show();
_loc4_.enable();
_loc4_.setOnMouseUpFunction(_global.bind0(this,this.showButtonClicked));
this.closeLobbyList();
var _loc3_ = this.lobbyListPanelMC.lobbyListMC.lobbyListTextBox;
_loc3_.setNumEntries(this.m_visLines);
_loc3_.setVerticalPadding(0);
_loc3_.addListener(this);
var _loc5_ = new Array();
_loc5_.push({symbol:"std_mouseListboxEntryTextElementSymbol",width:this.m_width,leftMargin:0,rightMargin:0,useHitRegion:false});
_loc3_.init(_loc5_,lobbyListComponent.LINE_HEIGHT);
_loc3_.attachScrollbarController(this.lobbyListPanelMC.lobbyListMC.uiScrollBar);
_loc3_.moveViewToFirst();
_loc3_.refreshDisplay();
_loc3_.refreshScrollbar();
}
function localMessageHandler(messageCode)
{
var _loc3_ = true;
if(messageCode !== _global.MSGCODE.FE_MP_ONLINE_REFRESH_LOBBYLIST)
{
_loc3_ = false;
}
else
{
this.UpdateList();
_loc3_ = false;
}
return _loc3_;
}
function showButtonClicked()
{
if(this.m_lobbyListUIActive)
{
this.closeLobbyList();
}
else
{
this.openLobbyList();
}
}
function closeLobbyList()
{
this.m_lobbyListUIActive = false;
this.lobbyListPanelMC._visible = false;
this.m_mainPanelMC.showListOfLobbiesButton.setSelected(true);
}
function openLobbyList()
{
this.m_lobbyListUIActive = true;
this.lobbyListPanelMC._visible = true;
this.m_mainPanelMC.showListOfLobbiesButton.setSelected(false);
}
function fitMaskToListSize()
{
}
function configLayout()
{
this.main_panel_1_MC._visible = false;
this.main_panel_2_MC._visible = false;
this.main_panel_3_MC._visible = false;
this.lobbyListPanelMC.lobbyListLongMC._visible = false;
this.lobbyListPanelMC.lobbyListShortMC._visible = false;
switch(this.m_configurationType)
{
case lobbyListComponent.RECRUITMENT_UI_CONFIG:
this.m_mainPanelMC = this.main_panel_1_MC;
this.m_lobbyListPanelMC = this.lobbyListPanelMC.lobbyListLongMC;
break;
case lobbyListComponent.COMLINK_UI_CONFIG:
this.m_mainPanelMC = this.main_panel_2_MC;
this.m_lobbyListPanelMC = this.lobbyListPanelMC.lobbyListLongMC;
break;
case lobbyListComponent.CONFIGURATION_3:
this.m_mainPanelMC = this.main_panel_3_MC;
this.m_lobbyListPanelMC = this.lobbyListPanelMC.lobbyListShortMC;
}
this.m_listboxPanelOpenedX = this.m_mainPanelMC._x + this.m_mainPanelMC.lobbyListPanelLocatorMC._x;
this.m_listboxPanelClosedX = this.m_listboxPanelOpenedX - this.m_lobbyListPanelMC._width;
this.m_mainPanelMC._visible = true;
this.m_mainPanelMC.maskLocatorMC._visible = false;
this.m_mainPanelMC.lobbyListPanelLocatorMC._visible = false;
this.m_lobbyListPanelMC._visible = true;
this.hideImmediately();
}
function animateClosed()
{
if(this.lobbyListPanelMC._x - this.m_listboxPanelClosedX > this.m_stepSize)
{
this.lobbyListPanelMC._x -= this.m_stepSize;
}
else
{
this.hideImmediately();
this.onEnterFrame = null;
}
}
function animateOpened()
{
if(this.m_listboxPanelOpenedX - this.lobbyListPanelMC._x > this.m_stepSize)
{
this.lobbyListPanelMC._x += this.m_stepSize;
}
else
{
this.lobbyListPanelMC._x = this.m_listboxPanelOpenedX;
this.UpdateList();
this.onEnterFrame = null;
}
}
function hideImmediately()
{
this.m_lobbyListUIActive = false;
this.lobbyListPanelMC._x = this.m_listboxPanelOpenedX;
this.lobbyListPanelMC._visible = false;
}
function updateActiveLobby()
{
if(this.m_currentLobby >= 0 && this.m_currentLobby < this.m_lobbyNames.length)
{
this.m_mainPanelMC.lobbyNameTF.text = this.m_lobbyNames[this.m_currentLobby];
}
else
{
this.m_mainPanelMC.lobbyNameTF.text = "$APT:LOBBYLIST_NOCURRENTLOBBY";
}
}
function UpdateList()
{
var ret = new Object();
loadVariables("QueryGameEngine?MP_LOBBYLIST",ret);
this.m_lobbyIDs = ret.MP_LOBBYLIST_IDS.split(",");
this.m_lobbyNames = ret.MP_LOBBYLIST_NAMES.split(",");
this.m_currentLobby = Number(ret.MP_LOBBYLIST_CURRENT);
this.m_numberOfGames = ret.MP_LOBBYLIST_NUM_GAMES.split(",");
this.m_numberOfPlayers = ret.MP_LOBBYLIST_NUM_PLAYERS.split(",");
var _loc3_ = this.lobbyListPanelMC.lobbyListMC.lobbyListTextBox;
_loc3_.setColumnData(0,this.m_lobbyNames);
_loc3_.refreshDisplay();
_loc3_.refreshScrollbar();
this.updateActiveLobby();
}
}
@@ -0,0 +1,58 @@
class main_mouse_settings implements ICafe2_FWSettings
{
function main_mouse_settings()
{
this.cafeTrace("main_mouse_settings::main_mouse_settings()");
}
function main()
{
this.cafeTrace("main_mouse_settings::main()");
}
function cafeTrace(strMessage)
{
trace("##### cafeFW: " + strMessage);
}
function cafeAssert(bVal)
{
if(bVal != true)
{
_root.loadMovie("cafeFW/assert.swf");
}
}
function ltxt(strId)
{
return strId;
}
function playSound(iSoundId)
{
this.cafeTrace("main_mouse_settings::playSound() soundId=" + iSoundId);
// Checked
getURL("FSCommand:CallGameFunction","PlaySound&" + iSoundId);
}
function stopSound(theSound)
{
if(theSound != "")
{
// Checked
getURL("FSCommand:CallGameFunction","StopSound&" + theSound);
}
}
function getPlatform()
{
var _loc2_ = "FLASH";
this.cafeTrace("main_mouse_settings::getPlatform() Platform = " + _loc2_);
return _loc2_;
}
function getScreenWidth()
{
return 854;
}
function getScreenHeight()
{
return 480;
}
function getLanguage()
{
return "en";
}
}
@@ -0,0 +1,142 @@
class mouse_chapterSelectComponent implements IListboxEventListener
{
function mouse_chapterSelectComponent()
{
this.m_missionNames = new Array();
this.m_mapIds = new Array();
this.m_observers = new Array();
}
function initGUI()
{
this.missionList.setNumEntries(9);
this.missionList.setVerticalPadding(0);
this.missionList.addListener(this);
var _loc6_ = new Array();
_loc6_.push({symbol:"std_mouseListboxEntryTextElementSymbol",width:432,leftMargin:0,rightMargin:0,fontSize:14});
this.missionList.init(_loc6_,22);
this.missionList.attachScrollbarController(this.missionListScrollbar);
this.radioButton_allies.setOnMouseDownFunction(_global.bind1(this,this.setMissionList,_global.ENUM.CAMPAIGN_TYPE_ALLIES));
this.radioButton_soviets.setOnMouseDownFunction(_global.bind1(this,this.setMissionList,_global.ENUM.CAMPAIGN_TYPE_SOVIET));
this.radioButton_japan.setOnMouseDownFunction(_global.bind1(this,this.setMissionList,_global.ENUM.CAMPAIGN_TYPE_RISINGSUN));
var _loc5_ = undefined;
var ret = new Object();
// Checked
loadVariables("QueryGameEngine?CAMPAIGN_MISSION&CURRENT_FACTION",ret);
switch(Number(ret.CURRENT_FACTION))
{
case _global.ENUM.CAMPAIGN_TYPE_ALLIES:
default:
_loc5_ = this.radioButton_allies;
this.setMissionList(_global.ENUM.CAMPAIGN_TYPE_ALLIES);
break;
case _global.ENUM.CAMPAIGN_TYPE_SOVIET:
_loc5_ = this.radioButton_soviets;
this.setMissionList(_global.ENUM.CAMPAIGN_TYPE_SOVIET);
break;
case _global.ENUM.CAMPAIGN_TYPE_RISINGSUN:
_loc5_ = this.radioButton_japan;
this.setMissionList(_global.ENUM.CAMPAIGN_TYPE_RISINGSUN);
}
this.radioController_faction.SetSelectedRadioButton(_loc5_);
var _loc4_ = ret.CAMPAIGN_MISSION;
if(_loc4_ < 0)
{
_loc4_ = 0;
}
this.missionList.setSelectedIndex(_loc4_);
}
function onLoad()
{
this.initGUI();
}
function onUnload()
{
this.missionList.removeListener(this);
this.missionList.shutdown();
delete this.m_missionNames;
}
function getSelectedCampaign()
{
return this.m_selectedCampaign;
}
function getSelectedMission()
{
return this.missionList.getSelectedEntryIndex();
}
function getSelectedMapId()
{
var _loc2_ = this.missionList.getSelectedEntryIndex();
return this.m_mapIds[_loc2_];
}
function getSelectedDifficulty()
{
return this.m_selectedDifficulty;
}
function addObserver(fn)
{
this.removeObserver(fn);
this.m_observers.push(fn);
}
function removeObserver(fn)
{
var _loc2_ = 0;
while(_loc2_ < this.m_observers.length)
{
if(fn == this.m_observers[_loc2_])
{
this.m_observers.splice(_loc2_,1);
break;
}
_loc2_ = _loc2_ + 1;
}
}
function OnListboxIndexMouseClick(index, previouslySelectedIndex)
{
this.notifyObservers();
}
function OnListboxIndexElementMouseClick(index, element, previouslySelectedIndex)
{
}
function setMissionList(campaignIndex)
{
this.m_selectedCampaign = campaignIndex;
// Checked
getURL("FSCommand:CallGameFunction","%Campaign_SetFaction?FactionIndex=" + this.m_selectedCampaign);
this.setMissionListData();
this.notifyObservers();
}
function setMissionListData()
{
var ret = new Object();
// Checked
loadVariables("QueryGameEngine?CHAPTER_LIST?CampaignIndex=" + String(this.m_selectedCampaign),ret);
this.m_missionNames = ret.CHAPTER_LIST_NAMES.split(",");
var _loc2_ = 0;
while(_loc2_ < this.m_missionNames.length)
{
this.m_missionNames[_loc2_] += "&Outline";
_loc2_ = _loc2_ + 1;
}
this.m_mapIds = ret.CHAPTER_LIST_IDS.split(",");
this.missionList.setColumnData(0,this.m_missionNames);
this.missionList.setSelectedIndex(0);
this.missionList.moveViewToFirst();
this.missionList.refreshDisplay();
}
function setDifficulty(difficulty)
{
this.m_selectedDifficulty = difficulty;
// Checked
getURL("FSCommand:CallGameFunction","%Campaign_SetDifficulty?Difficulty=" + difficulty);
this.notifyObservers();
}
function notifyObservers()
{
var _loc2_ = 0;
while(_loc2_ < this.m_observers.length)
{
this.m_observers.register2();
_loc2_ = _loc2_ + 1;
}
}
}
@@ -0,0 +1,155 @@
class movieClip2p5DUIHelper
{
function movieClip2p5DUIHelper()
{
this.m_clipArray = new Array();
}
function init(uiTitle, theClipArray, locX, locY, initScaleValue)
{
this.m_clipArray = theClipArray;
this.titleTF.text = uiTitle;
this._x = locX;
this._y = locY;
this.rotXSliderUI._visible = true;
this.rotXSliderUI.logic_init();
this.rotXSliderUI.setOnChange(this.updateXRotSliderDisplay);
this.rotYSliderUI._visible = true;
this.rotYSliderUI.logic_init();
this.rotYSliderUI.setOnChange(this.updateYRotSliderDisplay);
this.xPosSliderUI._visible = true;
this.xPosSliderUI.logic_init();
this.xPosSliderUI.setOnChange(this.updateXPosSliderDisplay);
this.yPosSliderUI._visible = true;
this.yPosSliderUI.logic_init();
this.yPosSliderUI.setOnChange(this.updateYPosSliderDisplay);
this.zPosSliderUI._visible = true;
this.zPosSliderUI.logic_init();
this.zPosSliderUI.setOnChange(this.updateZPosSliderDisplay);
this.visibleCB._visible = true;
this.visibleCB.enableGUI();
this.visibleCB.setOnMouseDownFunction(this.toggleVisiblity);
this.visibleCB.setIntroCallback(this.introComplete);
}
function introComplete(theComponent)
{
theComponent.visual_unhighlight();
}
function updateXRotSliderDisplay(theComponent)
{
var _loc3_ = theComponent.getValue();
theComponent._parent.xRotValue.text = _loc3_;
var _loc2_ = undefined;
var _loc5_ = theComponent._parent.m_clipArray.length;
var _loc1_ = 0;
while(_loc1_ < _loc5_)
{
_loc2_ = theComponent._parent.m_clipArray[_loc1_];
_loc2_._xrotation = _loc3_;
_loc1_ = _loc1_ + 1;
}
}
function updateYRotSliderDisplay(theComponent)
{
var _loc3_ = theComponent.getValue();
theComponent._parent.yRotValue.text = _loc3_;
var _loc2_ = undefined;
var _loc5_ = theComponent._parent.m_clipArray.length;
var _loc1_ = 0;
while(_loc1_ < _loc5_)
{
_loc2_ = theComponent._parent.m_clipArray[_loc1_];
_loc2_._yrotation = _loc3_;
_loc1_ = _loc1_ + 1;
}
}
function updateYPosSliderDisplay(theComponent)
{
var _loc3_ = theComponent.getValue();
theComponent._parent.yValue.text = _loc3_;
var _loc2_ = undefined;
var _loc5_ = theComponent._parent.m_clipArray.length;
var _loc1_ = 0;
while(_loc1_ < _loc5_)
{
_loc2_ = theComponent._parent.m_clipArray[_loc1_];
_loc2_._y = _loc3_;
_loc1_ = _loc1_ + 1;
}
}
function updateXPosSliderDisplay(theComponent)
{
var _loc3_ = theComponent.getValue();
theComponent._parent.xValue.text = _loc3_;
var _loc2_ = undefined;
var _loc5_ = theComponent._parent.m_clipArray.length;
var _loc1_ = 0;
while(_loc1_ < _loc5_)
{
_loc2_ = theComponent._parent.m_clipArray[_loc1_];
_loc2_._x = _loc3_;
_loc1_ = _loc1_ + 1;
}
}
function updateZPosSliderDisplay(theComponent)
{
var _loc3_ = theComponent.getValue();
theComponent._parent.zValue.text = _loc3_;
var _loc2_ = undefined;
var _loc5_ = theComponent._parent.m_clipArray.length;
var _loc1_ = 0;
while(_loc1_ < _loc5_)
{
_loc2_ = theComponent._parent.m_clipArray[_loc1_];
_loc2_._z = _loc3_;
_loc1_ = _loc1_ + 1;
}
}
function updateScaleSliderDisplay(theComponent)
{
var _loc3_ = theComponent.getValue();
var _loc5_ = undefined;
var _loc4_ = undefined;
theComponent._parent.scaleValue.text = _loc3_;
var _loc1_ = undefined;
var _loc7_ = theComponent._parent.m_clipArray.length;
var _loc2_ = 0;
while(_loc2_ < _loc7_)
{
_loc1_ = theComponent._parent.m_clipArray[_loc2_];
if(_loc1_._stdWidth != undefined)
{
_loc5_ = _loc1_._stdWidth;
_loc4_ = _loc1_._stdHeight;
_loc1_._width = Math.floor(_loc5_ * _loc3_ / 100);
_loc1_._height = Math.floor(_loc4_ * _loc3_ / 100);
}
else
{
trace("movieClip2p5DUIHelper::updateScaleSliderDisplay()--->>>> ERROR : NO _stdWidth " + _loc1_);
}
_loc2_ = _loc2_ + 1;
}
theComponent._parent.widthValue.text = Math.floor(_loc1_._width);
theComponent._parent.heightValue.text = Math.floor(_loc1_._height);
}
function toggleVisiblity(theComponent)
{
var _loc2_ = undefined;
var _loc3_ = theComponent._parent.m_clipArray.length;
var _loc1_ = 0;
while(_loc1_ < _loc3_)
{
_loc2_ = theComponent._parent.m_clipArray[_loc1_];
_loc2_._visible = !_loc2_._visible;
_loc1_ = _loc1_ + 1;
}
}
function update()
{
this.updateXRotSliderDisplay(this.rotXSliderUI);
this.updateYRotSliderDisplay(this.rotYSliderUI);
this.updateXPosSliderDisplay(this.xPosSliderUI);
this.updateYPosSliderDisplay(this.yPosSliderUI);
this.updateZPosSliderDisplay(this.zPosSliderUI);
}
}
@@ -0,0 +1,243 @@
class playerListComponent implements IListboxEntryEventListener, IListboxEventListener
{
static var LINE_HEIGHT = 25;
static var NO_SELECTION = -1;
static var ATTACHMOVIE_BASE_LEVEL = 10000;
function playerListComponent()
{
this.m_localMessageHandlerFunc = _global.bind1DynamicParams(this,this.localMessageHandler);
this.m_listeners = new Array();
this.m_playerIndex = playerListComponent.NO_SELECTION;
}
function OnListboxIndexMouseClick(index, previouslySelectedIndex)
{
var ret = new Object();
// Checked
loadVariables("QueryGameEngine?LASTMOUSEPRESSTYPE",ret);
if(Number(ret.LASTMOUSEPRESSTYPE) == _global.ENUM.MOUSEBUTTONPRESS_LEFT)
{
if(this.m_playerIndex == index)
{
this.m_playerIndex = playerListComponent.NO_SELECTION;
}
else
{
this.m_playerIndex = index;
}
}
this.playerListTextBox.setSelectedIndex(this.m_playerIndex);
var _loc3_ = 0;
while(_loc3_ < this.m_listeners.length)
{
this.m_listeners.register3(index);
_loc3_ = _loc3_ + 1;
}
}
function OnListboxIndexElementMouseClick(index, element, previouslySelectedIndex)
{
}
function OnListboxEntryMouseEnter(entry)
{
if(this.m_playerIDs[entry] == undefined)
{
return undefined;
}
// Checked
getUrl("FSCommand:CallGameFunction", "StartTooltipCountdown");
this.m_tooltipTargetEntry = entry;
this.onEnterFrame = _global.bind0(this,this.checkTooltipTime);
}
function OnListboxEntryMouseExit(entry)
{
this.hideStatsTooltip(entry);
if(entry == this.m_tooltipTargetEntry)
{
this.onEnterFrame = null;
}
}
function OnListboxEntryMouseClick(entry)
{
}
function OnListboxEntryElementMouseClick(entry, element)
{
}
function checkTooltipTime()
{
var _loc3_ = new Object();
// Checked
loadVariables("QueryGameEngine?SHOULD_DISPLAY_STATS_TOOLTIP",_loc3_);
if(_loc3_.SHOULD_DISPLAY_STATS_TOOLTIP == "1")
{
if(!_global.contextMenu.screen.isShowing())
{
this.showStatsTooltip(this.m_tooltipTargetEntry);
}
this.onEnterFrame = null;
}
}
function refresh()
{
this.UpdateList();
}
function addListener(fn)
{
this.removeListener(fn);
this.m_listeners.push(fn);
}
function removeListener(fn)
{
var _loc2_ = 0;
while(_loc2_ < this.m_listeners.length)
{
if(this.m_listeners[_loc2_] == fn)
{
this.m_listeners.splice(_loc2_,1);
break;
}
_loc2_ = _loc2_ + 1;
}
}
function onLoad()
{
this.initGUI();
_global.gMH.addMessageHandler(this.m_localMessageHandlerFunc);
}
function onUnload()
{
this.playerListMC.removeListener(this);
_global.gMH.removeMessageHandler(this.m_localMessageHandlerFunc);
delete this.m_localMessageHandlerFunc;
}
function initGUI()
{
var _loc2_ = this.playerListTextBox;
_loc2_.setNumEntries(this.m_visLines);
_loc2_.setVerticalPadding(0);
_loc2_.addListener(this);
var _loc3_ = new Array();
_loc3_.push({symbol:"std_mouseListboxEntryTextElementSymbol",width:this.m_width,leftMargin:0,rightMargin:0,useHitRegion:false});
_loc2_.init(_loc3_,playerListComponent.LINE_HEIGHT);
_loc2_.attachScrollbarController(this.uiScrollBar);
_loc2_.moveViewToFirst();
_loc2_.refreshDisplay();
_loc2_.refreshScrollbar();
}
function localMessageHandler(messageCode)
{
var _loc3_ = true;
if(messageCode !== _global.MSGCODE.FE_MP_ONLINE_REFRESH_PLAYERLIST)
{
_loc3_ = false;
}
else
{
this.UpdateList();
_loc3_ = false;
}
return _loc3_;
}
function UpdateList()
{
var _loc7_ = this.getPlayerID();
var ret = new Object();
// Checked
loadVariables("QueryGameEngine?MP_PLAYERLIST",ret);
if(ret.MP_PLAYERLIST_IDS == "")
{
this.m_playerIDs = new Array();
this.m_playerNames = new Array();
this.m_playerStats = new Array();
}
else
{
this.m_playerIDs = ret.MP_PLAYERLIST_IDS.split(",");
this.m_playerStats = ret.MP_PLAYERLIST_STATS.split(",");
var _loc6_ = ret.MP_PLAYERLIST_NAMETOKEN;
this.m_playerNames = new Array();
for(var i = 0; i < this.m_playerIDs.length; ++i)
{
var _loc4_ = _loc6_ + this.m_playerIDs[_loc3_];
this.m_playerNames.push(_loc4_);
}
}
var _loc8_ = this.playerListTextBox;
_loc8_.setColumnData(0,this.m_playerNames);
this.m_playerIndex = std_mouseScrollingListbox.NO_SELECTION;
for(var i = 0; i < this.m_playerIDs.length; ++i)
{
if(this.m_playerIDs[_loc2_] == _loc7_)
{
this.m_playerIndex = _loc2_;
break;
}
}
_loc8_.setSelectedIndex(this.m_playerIndex);
_loc8_.refreshDisplay();
_loc8_.refreshScrollbar();
}
function showStatsTooltip(entry)
{
var _loc2_ = this.attachMovie("tooltip","tooltip" + entry,playerListComponent.ATTACHMOVIE_BASE_LEVEL);
var _loc3_ = undefined;
_loc3_ = std_config.listbox_textFormat_highlight;
_loc3_.color = std_config.listbox_textColor_highlight;
this.initTooltipTextfield(_loc2_.m_labelName,_loc3_);
this.initTooltipTextfield(_loc2_.m_labelWins,_loc3_);
this.initTooltipTextfield(_loc2_.m_labelLosses,_loc3_);
this.initTooltipTextfield(_loc2_.m_labelRank1v1,_loc3_);
this.initTooltipTextfield(_loc2_.m_labelRating1v1,_loc3_);
this.initTooltipTextfield(_loc2_.m_valueName,_loc3_);
this.initTooltipTextfield(_loc2_.m_valueWins,_loc3_);
this.initTooltipTextfield(_loc2_.m_valueLosses,_loc3_);
this.initTooltipTextfield(_loc2_.m_valueRank1v1,_loc3_);
this.initTooltipTextfield(_loc2_.m_valueRating1v1,_loc3_);
var playerStatsItem = this.m_playerStats[entry].split("\n");
var _loc4_ = 6;
_loc2_.m_valueName._x = _loc2_.m_labelName._x + _loc2_.m_labelName._width + _loc4_;
_loc2_.m_valueWins._x = _loc2_.m_labelWins._x + _loc2_.m_labelWins._width + _loc4_;
_loc2_.m_valueLosses._x = _loc2_.m_labelLosses._x + _loc2_.m_labelLosses._width + _loc4_;
_loc2_.m_valueRank1v1._x = _loc2_.m_labelRank1v1._x + _loc2_.m_labelRank1v1._width + _loc4_;
_loc2_.m_valueRating1v1._x = _loc2_.m_labelRating1v1._x + _loc2_.m_labelRating1v1._width + _loc4_;
_loc2_.m_valueName.text = this.m_playerNames[entry];
_loc2_.m_valueWins.text = playerStatsItem[0];
_loc2_.m_valueLosses.text = playerStatsItem[1];
_loc2_.m_valueRank1v1.text = playerStatsItem[2];
_loc2_.m_valueRating1v1.text = playerStatsItem[3];
var _loc7_ = Math.max(Math.max(Math.max(Math.max(_loc2_.m_labelName._width + _loc2_.m_valueName._width,_loc2_.m_labelWins._width + _loc2_.m_valueWins._width),_loc2_.m_labelLosses._width + _loc2_.m_valueLosses._width),_loc2_.m_labelRank1v1._width + _loc2_.m_valueRank1v1._width),_loc2_.m_labelRating1v1._width + _loc2_.m_valueRating1v1._width);
_loc2_._x = _loc2_._xmouse;
_loc2_._y = _loc2_._ymouse;
_loc2_.background._xscale = _loc7_ + _loc4_ + 8;
_loc2_.background._yscale = _loc2_.m_labelRating1v1._y + _loc2_.m_labelRating1v1._height - _loc2_.m_labelName._y;
}
function initTooltipTextfield(textField, textFormat)
{
textField.setTextFormat(textFormat);
textField.autoSize = true;
}
function hideStatsTooltip(entry)
{
removeMovieClip(eval("this.tooltip" + entry));
}
function getPlayerID()
{
if(this.m_playerIndex >= 0 && this.m_playerIndex < this.m_playerIDs.length)
{
return this.m_playerIDs[this.m_playerIndex];
}
return "";
}
function getPlayerIdAt(index)
{
if(index >= 0 && index < this.m_playerIDs.length)
{
return this.m_playerIDs[index];
}
return undefined;
}
function clearSelection()
{
this.m_playerIndex = playerListComponent.NO_SELECTION;
this.playerListTextBox.SetSelectedIndex(this.m_playerIndex);
this.playerListTextBox.RefreshDisplay();
}
}
@@ -0,0 +1,311 @@
class std_MouseAccordionButton extends Cafe2_MouseBaseControl implements ICafe2_FocusableControl
{
var MENU_ITEM_BASE_DEPTH = 100;
var m_onOpenChangeStateCallbackFunc = null;
var m_menuOpenState = false;
function std_MouseAccordionButton()
{
super();
trace("std_MouseAccordionButton::std_MouseAccordionButton() this=" + this);
m_moveableFocusLine = false;
this.m_menuItemTextStrings = new Array();
this.m_menuItemValues = new Array();
}
static function defaultInitObject()
{
var _loc1_ = new Cafe2_Imp_BaseControl.defaultInitObject();
return _loc1_;
}
static function createDynamic(container_, name_, level_, initObject_)
{
var _loc1_ = container_.attachMovie("Drop Down Menu",name_,level_,initObject_);
return std_MouseAccordionButton(_loc1_);
}
function setContentClips(menuButtonSymbol, menuItemSymbol)
{
this.m_menuButtonSymbol = menuButtonSymbol;
this.m_menuItemSymbol = menuItemSymbol;
}
function init()
{
trace("std_MouseAccordionButton::init() this=" + this);
this.m_menuItemsMCArray = new Array(this.m_menuItemTextStrings.length);
var _loc3_ = undefined;
var _loc2_ = 0;
_loc3_ = this.attachMovie(this.m_menuButtonSymbol,"menuItem" + _loc2_,this.MENU_ITEM_BASE_DEPTH + _loc2_);
_loc3_.hitRegion.mComponentPtr = this;
_loc3_.hitRegion.m_menuID = _loc2_;
_loc3_.hitRegion._alpha = 0;
_loc3_.hitRegion.onRollOver = this.mouseRolloverEvent;
_loc3_.hitRegion.onRollOut = this.mouseRollOutEvent;
_loc3_.hitRegion.onRelease = this.menuClick;
this.m_menuItemsMCArray[_loc2_] = _loc3_;
this.m_menuItemsMCArray[_loc2_]._y = 0;
this.upDateMenuItemLabel(_loc2_);
this.setBlur(_loc2_);
var _loc4_ = this.m_menuItemsMCArray[_loc2_]._height;
var _loc5_ = this.m_menuItemsMCArray[_loc2_]._x + 30;
this.m_buttonHeight = this.m_menuItemsMCArray[0]._height;
_loc2_ = 1;
while(_loc2_ < this.m_menuItemTextStrings.length)
{
_loc3_ = this.attachMovie(this.m_menuItemSymbol,"menuItem" + _loc2_,this.MENU_ITEM_BASE_DEPTH + _loc2_);
_loc3_.menuItemMC.hitRegion.mComponentPtr = this;
_loc3_.menuItemMC.hitRegion.m_itemID = _loc2_;
_loc3_.menuItemMC.hitRegion.m_menuID = this.m_menuID;
_loc3_.menuItemMC.hitRegion._alpha = 0;
_loc3_.menuItemMC.hitRegion.onRollOver = this.mouseRolloverItemEvent;
_loc3_.menuItemMC.hitRegion.onRollOut = this.mouseRollOutItemEvent;
_loc3_.menuItemMC.hitRegion.onRelease = this.menuItemClick;
this.m_menuItemsMCArray[_loc2_] = _loc3_;
this.m_menuItemsMCArray[_loc2_]._y = _loc4_;
this.m_menuItemsMCArray[_loc2_]._x = _loc5_;
_loc4_ = this.m_menuItemsMCArray[_loc2_]._height + _loc4_;
this.upDateMenuItemLabel(_loc2_);
_loc2_ = _loc2_ + 1;
}
this.configTextLabelFont();
this.refreshDisplay();
}
function addMenuItems(txtLines, values, menuID, componentMC)
{
trace("std_MouseAccordionButton::addMenuItems() " + txtLines);
if(this.m_menuItemTextStrings.length > 0)
{
this.clearMenu();
}
this.m_menuItemTextStrings = txtLines;
this.m_menuItemValues = values;
this.m_menuID = menuID;
this.m_menuComponent = componentMC;
this.init();
}
function clearMenu()
{
var _loc2_ = 0;
while(_loc2_ < this.m_menuItemsMCArray.length)
{
this.m_menuItemsMCArray[_loc2_].removeMovieClip();
_loc2_ = _loc2_ + 1;
}
this.m_menuItemsMCArray = new Array();
this.m_menuItemTextStrings = new Array();
this.m_menuItemValues = new Array();
}
function setPos(yPos)
{
this._y = yPos;
}
function getHeight()
{
var _loc3_ = this.m_buttonHeight;
if(this.m_menuOpenState)
{
var _loc2_ = 1;
while(_loc2_ < this.m_menuItemsMCArray.length)
{
_loc3_ += this.m_menuItemsMCArray[_loc2_]._height;
_loc2_ = _loc2_ + 1;
}
}
return _loc3_;
}
function getRowText(rowIndex)
{
if(rowIndex >= MIN_INDEX && rowIndex < this.m_menuItemTextStrings.length)
{
return this.m_menuItemTextStrings[rowIndex];
}
trace("std_MouseAccordionButton::getRowText() - ERROR - Index out of range");
return "";
}
function setFocus()
{
this.m_menuItemsMCArray[0].gotoAndPlay("_highlight");
this.m_menuItemsMCArray[0].menuItemName.labelTF.textColor = std_config.accordionMenu_labelTop_HLtextColor;
}
function setBlur()
{
this.m_menuItemsMCArray[0].gotoAndPlay("_unhighlight");
this.m_menuItemsMCArray[0].menuItemName.labelTF.textColor = std_config.accordionMenu_labelTop_UHLtextColor;
}
function setItemBlur(menuItemIndex)
{
this.m_menuItemsMCArray[menuItemIndex].menuItemMC.gotoAndPlay("_unhighlight");
this.m_menuItemsMCArray[menuItemIndex].menuItemMC.menuItemName.labelTF.textColor = std_config.accordionMenu_labelTop_UHLtextColor;
}
function setItemFocus(menuItemIndex)
{
this.m_menuItemsMCArray[menuItemIndex].menuItemMC.gotoAndPlay("_highlight");
this.m_menuItemsMCArray[menuItemIndex].menuItemMC.menuItemName.labelTF.textColor = std_config.accordionMenu_labelTop_HLtextColor;
}
function executeFunction(menuIndex, menuItemIndex)
{
if(menuItemIndex == -1 && this.m_menuItemsMCArray.length == 1)
{
_global.playSound("GuiAccordionMenuOpen");
}
else if(menuItemIndex > 0)
{
_global.playSound("GuiAccordionMenuItemSelected");
}
this.m_menuComponent.executeUserSelection(menuIndex,menuItemIndex);
}
function refreshDisplay()
{
this.upDateMenuItemLabel(0);
var _loc2_ = 0;
while(_loc2_ < this.m_menuItemTextStrings.length)
{
var _loc3_ = _loc2_ + 1;
if(this.m_menuItemTextStrings[_loc2_] != undefined)
{
this.upDateMenuItemLabel(_loc2_);
}
this.m_menuItemsMCArray[_loc3_]._visible = this.m_menuOpenState;
_loc2_ = _loc2_ + 1;
}
this.m_menuItemsMCArray[0]._visible = true;
}
function disableGUI()
{
this.m_menuItemsMCArray[0].gotoAndPlay("_unhighlight");
var _loc2_ = 1;
while(_loc2_ < this.m_menuItemsMCArray.length)
{
this.m_menuItemsMCArray[_loc2_].gotoAndPlay("_hide");
_loc2_ = _loc2_ + 1;
}
}
function enableGUI()
{
this.setBlur();
}
function highlight()
{
}
function unhighlight()
{
}
function setOnOpenStateChangeCallback(fn)
{
this.m_onOpenChangeStateCallbackFunc = fn;
}
function toggleOpenState()
{
if(this.m_menuItemsMCArray.length > 1)
{
this.m_menuOpenState = !this.m_menuOpenState;
if(this.m_menuItemTextStrings.length <= 1)
{
this.m_menuOpenState = false;
}
if(this.m_menuOpenState)
{
this.m_onOpenChangeStateCallbackFunc(true);
this.open();
}
else
{
this.close();
this.m_onOpenChangeStateCallbackFunc(false);
}
this.refreshDisplay();
}
}
function isOpen()
{
return this.m_menuOpenState;
}
function close()
{
this.m_menuItemsMCArray[0].gotoAndPlay("_close");
this.setBlur();
}
function open()
{
this.m_menuItemsMCArray[0].gotoAndPlay("_open");
_global.playSound("GuiAccordionMenuOpen");
}
function upDateMenuItemLabel(labelIndex)
{
var _loc3_ = this.m_menuItemTextStrings[labelIndex];
var _loc2_ = this.m_menuItemsMCArray[labelIndex];
if(labelIndex == 0)
{
_loc2_.menuItemName.labelTF.text = _loc3_;
_loc2_.text_underMC.labelTF.text = _loc3_;
_loc2_.text_underMC.labelShadowTF.text = _loc3_;
}
else
{
_loc2_.menuItemMC.menuItemName.labelTF.text = _loc3_;
_loc2_.menuItemMC.menuItemName.shadowTF.text = _loc3_;
}
}
function configTextLabelFont()
{
var _loc2_ = undefined;
var _loc4_ = this.m_menuItemsMCArray.length;
var _loc3_ = 0;
while(_loc3_ < _loc4_)
{
_loc2_ = this.m_menuItemsMCArray[_loc3_];
_loc2_.menuItemName.labelTF.setNewTextFormat(std_config.accordionMenu_textFormat);
_loc2_.text_underMC.labelTF.setNewTextFormat(std_config.accordionMenu_textFormat);
_loc2_.text_underMC.labelShadowTF.setNewTextFormat(std_config.accordionMenu_textFormat);
_loc2_.menuItemName.labelTF.textColor = std_config.accordionMenu_labelTop_UHLtextColor;
_loc2_.text_underMC.labelTF.textColor = std_config.accordionMenu_labelMiddle_textColor;
_loc2_.text_underMC.labelShadowTF.textColor = std_config.accordionMenu_labelShadow;
_loc3_ = _loc3_ + 1;
}
}
function menuClick()
{
this.mComponentPtr.executeFunction(this.mComponentPtr.m_menuID,-1);
this.mComponentPtr.toggleOpenState();
}
function mouseRolloverEvent()
{
if(this.mComponentPtr.m_menuOpenState == false)
{
this.mComponentPtr.setFocus(this.m_menuID);
}
else if(this.m_menuID == 0)
{
this.mComponentPtr.m_menuItemsMCArray[0].menuItemName.labelTF.textColor = std_config.accordionMenu_labelTop_HLtextColor;
}
}
function mouseRollOutEvent()
{
if(this.mComponentPtr.m_menuOpenState == false)
{
this.mComponentPtr.setBlur(this.m_menuID);
}
else if(this.m_menuID == 0)
{
this.mComponentPtr.m_menuItemsMCArray[0].menuItemName.labelTF.textColor = std_config.accordionMenu_labelTop_UHLtextColor;
}
}
function menuItemClick()
{
if(this.mComponentPtr.m_menuOpenState)
{
this.mComponentPtr.executeFunction(this.m_menuID,this.m_itemID);
}
}
function mouseRolloverItemEvent()
{
if(this.mComponentPtr.m_menuOpenState)
{
this.mComponentPtr.setItemFocus(this.m_itemID);
}
}
function mouseRollOutItemEvent()
{
if(this.mComponentPtr.m_menuOpenState)
{
this.mComponentPtr.setItemBlur(this.m_itemID);
}
}
}
@@ -0,0 +1,109 @@
class std_MouseAccordionMenu extends Cafe2_MouseBaseControl implements ICafe2_FocusableControl
{
var MENU_ITEM_BASE_DEPTH = 100;
var m_onSelectionChangeFunc = null;
function std_MouseAccordionMenu()
{
super();
trace("std_MouseAccordionMenu::std_MouseAccordionMenu() this=" + this);
}
static function defaultInitObject()
{
var _loc1_ = new Cafe2_Imp_BaseControl.defaultInitObject();
return _loc1_;
}
static function createDynamic(container_, name_, level_, initObject_)
{
var _loc1_ = container_.attachMovie("Accordion Menu",name_,level_,initObject_);
return std_MouseAccordionMenu(_loc1_);
}
function setContentClips(menuButtonSymbol, menuItemSymbol)
{
this.m_menuButtonSymbol = menuButtonSymbol;
this.m_menuItemSymbol = menuItemSymbol;
}
function setMenuDefinitionParam(menuDefinitionArray)
{
this.m_menuDefinitionArray = menuDefinitionArray;
}
function init()
{
trace("std_MouseAccordionMenu::init() this=" + this);
this.m_menuItemArray = new Array();
var _loc2_ = undefined;
var _loc6_ = this.m_menuDefinitionArray.length;
var _loc4_ = 0;
var _loc5_ = undefined;
var _loc3_ = 0;
while(_loc3_ < _loc6_)
{
_loc2_ = this.attachMovie("std_MouseAccordionButtonSymbol","menuItem" + _loc3_,this.MENU_ITEM_BASE_DEPTH + _loc3_);
_loc2_.setContentClips(this.m_menuButtonSymbol,this.m_menuItemSymbol);
_loc2_._visible = true;
_loc2_.setOnOpenStateChangeCallback(this.menuItemOpenStateChange);
_loc2_.m_menu = this;
_loc5_ = this.m_menuDefinitionArray[_loc3_].split(",");
_loc2_.addMenuItems(_loc5_,[1,2,3],_loc3_,this);
_loc2_.setPos(_loc4_);
_loc2_.disableGUI();
_loc4_ += _loc2_.getHeight();
this.m_menuItemArray[_loc3_] = _loc2_;
_loc3_ = _loc3_ + 1;
}
this.m_contentClip = this.m_menuItemArray[0];
}
function setOnClickCallBack(onClickCallBack)
{
this.m_onClickCallBackFunction = onClickCallBack;
}
function executeUserSelection(menuID, itemID)
{
trace("EXECUTE USER SELECTION: " + itemID);
this.m_onClickCallBackFunction(menuID,itemID);
}
function disableGUI()
{
var _loc3_ = this.m_menuItemArray.length;
var _loc2_ = 0;
while(_loc2_ < _loc3_)
{
this.m_menuItemArray[_loc2_].disableGUI();
_loc2_ = _loc2_ + 1;
}
}
function enableGUI()
{
var _loc3_ = this.m_menuItemArray.length;
var _loc2_ = 0;
while(_loc2_ < _loc3_)
{
this.m_menuItemArray[_loc2_].enableGUI();
_loc2_ = _loc2_ + 1;
}
}
function highlight()
{
}
function unhighlight()
{
}
function menuItemOpenStateChange(aboutToOpen)
{
var _loc5_ = this.m_menu;
var _loc2_ = undefined;
var _loc6_ = _loc5_.m_menuItemArray.length;
var _loc4_ = 0;
var _loc3_ = 0;
while(_loc3_ < _loc6_)
{
_loc2_ = _loc5_.m_menuItemArray[_loc3_];
if(aboutToOpen && _loc2_.isOpen() && this != _loc2_)
{
_loc2_.toggleOpenState();
}
_loc2_.setPos(_loc4_);
_loc4_ = _loc2_.getHeight() + _loc4_;
_loc3_ = _loc3_ + 1;
}
}
}
@@ -0,0 +1,83 @@
class std_Mousebutton_logic extends Cafe2_MouseBaseControl implements ICafe2_FocusableControl
{
function std_Mousebutton_logic()
{
super();
if(this.m_focusDirs == undefined)
{
this.m_focusDirs = Cafe2_Imp_BaseControl.FOCUS_DIR_UD;
}
}
function logic_init()
{
this.setOnInput(_global.INPUTCODE.ENTER,this.bind0(this,this.enterPressEvent));
}
function highlight()
{
if(this.m_introComplete && this.m_outtroComplete && this.isEnabled())
{
this.visual_highlight();
}
}
function unhighlight()
{
if(this.m_introComplete && this.m_outtroComplete && this.isEnabled())
{
this.visual_unhighlight();
}
}
function enableGUI()
{
this.visual_enableGUI();
}
function disableGUI()
{
this.visual_disableGUI();
}
static function defaultInitObject()
{
var _loc1_ = Cafe2_Imp_BaseControl.defaultInitObject();
_loc1_.m_focusDirs = Cafe2_Imp_BaseControl.FOCUS_DIR_UD;
return _loc1_;
}
function enterPressEvent()
{
this.mouseDownEvent();
this.mouseUpEvent();
}
function mouseDownEvent()
{
if(this.isEnabled())
{
this.visual_mouseDownEvent();
this.m_objFM.setFocusToControl(this);
if(this.m_mouseDownFunction != null)
{
this.m_mouseDownFunction();
}
}
else
{
this.m_objFM.deselectFocusedComponent();
}
}
function mouseUpEvent()
{
if(this.isEnabled())
{
this.visual_mouseUpEvent();
if(this.m_mouseUpFunction != null)
{
this.m_mouseUpFunction();
}
}
}
function setOnMouseDownFunction(mouseDownFunction)
{
this.m_mouseDownFunction = mouseDownFunction;
}
function setOnMouseUpFunction(mouseUpFunction)
{
this.m_mouseUpFunction = mouseUpFunction;
}
}
@@ -0,0 +1,243 @@
class std_Mousebutton_visual extends std_Mousebutton_logic
{
static var CONTENT_DEPTH = 100;
function std_Mousebutton_visual()
{
super();
this.m_type = "std_Mousebutton_visual";
this.m_isMouseOver = false;
}
static function defaultInitObject()
{
var _loc1_ = std_Mousebutton_logic.defaultInitObject();
_loc1_.m_label = "";
_loc1_.m_contentSymbol = "buttonContentSymbol";
return _loc1_;
}
static function createDynamic(container_, name_, level_, initObject_)
{
return std_Mousebutton_visual(container_.attachMovie("std_MousebuttonSymbol",name_,level_,initObject_));
}
function setWidth(nWidth)
{
}
function getWidth()
{
if(this.m_contentClip != undefined)
{
return this.m_contentClip._width;
}
trace("ERROR: std_mouseButton_visual::getWidth() Querying width before a valid content clip has been loaded.");
return 0;
}
function setText(newText)
{
var _loc2_ = newText + "&Outline";
this.m_contentClip.labelMC.labelTF.text = _loc2_;
this.m_contentClip.labelShadowTF.labelTF.text = _loc2_;
}
function getText()
{
return this.m_contentClip.labelMC.labelTF.text;
}
function setTextColor(clrUnhighLight, clrHighLight, clrDisable)
{
}
function setLabelColor(clrUnhighLight, clrHighLight, clrDisable)
{
}
function setLabel(str)
{
this.m_label = str;
this.setText(this.m_label);
}
function setLabelPos(x, y)
{
}
function setFontFormat()
{
this.m_contentClip.labelMC.labelTF.setNewTextFormat(std_config.std_Mousebutton_textFormat);
this.m_contentClip.labelShadowTF.labelTF.setNewTextFormat(std_config.std_Mousebutton_textFormat);
}
function setClickSound(sound)
{
this.m_clickSound = sound;
}
function setRolloverSound(sound)
{
this.m_rollOverSound = sound;
}
function onLoad()
{
this.visualReferenceMC._visible = false;
this.loadContentClip();
this.setFontFormat();
this.setText(this.m_label);
this.m_contentClip.hitRegion.onRollOver = _global.bind0(this,this.mouseEventButtonRollover);
this.m_contentClip.hitRegion.onRollOut = _global.bind0(this,this.mouseEventButtonRollOut);
this.m_contentClip.hitRegion.onPress = _global.bind0(this,this.mouseEventButtonPress);
this.m_contentClip.hitRegion.onRelease = _global.bind0(this,this.mouseEventButtonRelease);
this.m_contentClip.hitRegion.onReleaseOutside = _global.bind0(this,this.mouseEventButtonRollOut);
trace("Creating button with content: " + this.m_contentSymbol);
if(this.m_contentSymbol == "buttonContentSymbol")
{
this.setClickSound("GuiShellStandardButtonClick");
this.setRolloverSound("GuiShellStandardButtonRollOver");
}
else if(this.m_contentSymbol == "startPositionButtonContent")
{
trace("Setting sound for start position button.");
this.setClickSound("GuiStartPositionClick");
this.setRolloverSound("");
}
else if(this.m_contentSymbol == "tabButtonContentClip")
{
this.setClickSound("GuiShellMinorSelection");
this.setRolloverSound("");
}
else
{
this.setClickSound("");
this.setRolloverSound("");
}
this.commonInit();
this.logic_init();
}
function loadContentClip()
{
this.m_contentClip = this.attachMovie(this.m_contentSymbol,"contentClip",std_Mousebutton_visual.CONTENT_DEPTH);
this.m_contentClip._x = 0;
this.m_contentClip._y = 0;
}
function visual_highlight()
{
this.doSelect();
}
function visual_unhighlight()
{
this.doUnselect();
}
function doSelect()
{
this.m_contentClip.gotoAndPlay("_selected");
this.m_contentClip.labelMC.labelTF.textColor = std_config.std_Mousebutton_Unselected_textColor;
this.m_contentClip.labelShadowTF.labelTF.textColor = std_config.std_Mousebutton_labelShadow_textColor;
}
function doUnselect()
{
this.m_contentClip.gotoAndPlay("_unselected");
this.m_contentClip.labelMC.labelTF.textColor = std_config.std_Mousebutton_Unselected_textColor;
this.m_contentClip.labelShadowTF.labelTF.textColor = std_config.std_Mousebutton_labelShadow_textColor;
}
function doSelectedRollover()
{
this.m_contentClip.gotoAndPlay("_selectedRollover");
}
function doUnselectedRollover()
{
this.m_contentClip.gotoAndPlay("_unselectedRollover");
this.m_contentClip.labelMC.labelTF.textColor = std_config.std_Mousebutton_Rollover_textColor;
this.m_contentClip.labelShadowTF.labelTF.textColor = std_config.std_Mousebutton_labelShadow_textColor;
}
function doDisable()
{
this.m_contentClip.gotoAndPlay("_disable");
this.m_contentClip.labelMC.labelTF.textColor = std_config.std_Mousebutton_Disabled_textColor;
this.m_contentClip.labelShadowTF.labelTF.textColor = std_config.std_Mousebutton_labelShadow_textColor;
}
function visual_enableGUI()
{
this.restoreVisualState();
}
function visual_disableGUI()
{
this.doDisable();
}
function visual_mouseDownEvent()
{
this.m_contentClip.gotoAndPlay("_downState");
this.m_contentClip.labelMC.labelTF.textColor = std_config.std_Mousebutton_Disabled_textColor;
this.m_contentClip.labelShadowTF.textColor = std_config.std_Mousebutton_labelShadow_textColor;
_global.playSound(this.m_clickSound);
}
function visual_mouseUpEvent()
{
this.restoreVisualState();
}
function isMouseOver()
{
return this.m_isMouseOver;
}
function intro()
{
super.intro();
}
function restoreVisualState()
{
if(this.isEnabled())
{
if(this.isSelected())
{
if(this.isMouseOver())
{
this.doSelectedRollover();
}
else
{
this.doSelect();
}
}
else if(this.isMouseOver())
{
this.doUnselectedRollover();
}
else
{
this.doUnselect();
}
}
else
{
this.doDisable();
}
}
function mouseEventButtonRollover()
{
this.m_isMouseOver = true;
if(this.m_introComplete && this.m_outtroComplete && this.isEnabled())
{
if(this.isSelected())
{
this.doSelectedRollover();
}
else
{
this.doUnselectedRollover();
}
_global.playSound(this.m_rollOverSound);
}
}
function mouseEventButtonRollOut()
{
this.m_isMouseOver = false;
if(this.m_introComplete && this.m_outtroComplete && this.isEnabled())
{
if(this.isSelected())
{
this.visual_highlight();
}
else
{
this.visual_unhighlight();
}
}
}
function mouseEventButtonPress()
{
this.mouseDownEvent();
}
function mouseEventButtonRelease()
{
this.mouseUpEvent();
}
}
@@ -0,0 +1,36 @@
class std_button_logic extends Cafe2_Imp_BaseControl implements ICafe2_FocusableControl
{
function std_button_logic()
{
super();
if(this.m_focusDirs == undefined)
{
this.m_focusDirs = Cafe2_Imp_BaseControl.FOCUS_DIR_UD;
}
}
function logic_init()
{
}
function highlight()
{
this.visual_highlight();
}
function unhighlight()
{
this.visual_unhighlight();
}
function enableGUI()
{
this.visual_enableGUI();
}
function disableGUI()
{
this.visual_disableGUI();
}
static function defaultInitObject()
{
var _loc1_ = Cafe2_Imp_BaseControl.defaultInitObject();
_loc1_.m_focusDirs = Cafe2_Imp_BaseControl.FOCUS_DIR_UD;
return _loc1_;
}
}
@@ -0,0 +1,33 @@
class std_config
{
static var button_textFormat = new TextFormat("Red Alert Extended",24);
static var slider_textFormat = new TextFormat("Red Alert Extended",14);
static var textBox_textFormat_highlight = new TextFormat("Lucida Sans",16);
static var textBox_textFormat_unhighlight = new TextFormat("Lucida Sans",16);
static var textBox_textFormat_disable = new TextFormat("Lucida Sans",16);
static var textBox_textColor_highlight = 15461355;
static var textBox_textColor_unhighlight = 7368816;
static var textBox_textColor_disable = 11974326;
static var listbox_textFormat_highlight = new TextFormat("Lucida Sans",16);
static var listbox_textFormat_unhighlight = new TextFormat("Lucida Sans",16);
static var listbox_textFormat_disable = new TextFormat("Lucida Sans",16);
static var listbox_textColor_highlight = 16777215;
static var listbox_textColor_unhighlight = 16745216;
static var listbox_textColor_disable = 11974326;
static var accordionMenu_textFormat = new TextFormat("Red Alert Extended",46);
static var accordionMenu_labelTop_UHLtextColor = 16745216;
static var accordionMenu_labelTop_HLtextColor = 16777164;
static var accordionMenu_labelMiddle_textColor = 16745216;
static var accordionMenu_labelShadow = 0;
static var std_Mousebutton_textFormat = new TextFormat("Red Alert Extended",24);
static var std_Mousebutton_Unselected_textColor = 16745216;
static var std_Mousebutton_Rollover_textColor = 16777163;
static var std_Mousebutton_Selected_textColor = 16777163;
static var std_Mousebutton_Disabled_textColor = 11974326;
static var std_Mousebutton_labelMiddle_textColor = 16745216;
static var std_Mousebutton_labelShadow_textColor = 0;
static var std_Mousebutton_labelShadow_SHADOW_OFFSET = 10;
function std_config()
{
}
}
@@ -0,0 +1,218 @@
class std_mouseCheckBox_visual extends std_Mousebutton_logic
{
var m_nTruncateType = 0;
var m_isMouseOver = false;
static var OFF_STATE = 0;
static var ON_STATE = 1;
var m_state = std_mouseCheckBox_visual.OFF_STATE;
static var CONTENT_DEPTH = 100;
function std_mouseCheckBox_visual()
{
super();
this.m_type = "std_checkBox_visual";
this.stop();
}
static function defaultInitObject()
{
var _loc1_ = std_button_logic.defaultInitObject();
_loc1_.m_iconType = CTRL_CONFIG.btnDefaultIcon;
_loc1_.m_extLabel = "";
_loc1_.m_label = "";
_loc1_.m_width = 200;
_loc1_.m_textAlign = false;
return _loc1_;
}
static function createDynamic(container_, name_, level_, initObject_)
{
return std_mouseCheckBox_visual(container_.attachMovie("std_button",name_,level_,initObject_));
}
function onUnload()
{
}
function onAllAssetsLoaded()
{
this.onLoad();
}
function onLoad()
{
this.loadContentClip();
this.setFontFormat(std_config.button_textFormat);
this.setWidth(this.m_width);
this.setText(this.m_label,true);
this.m_contentClip.hitRegion.onRollOver = this.bind0(this,this.mouseEventCheckBoxRollover);
this.m_contentClip.hitRegion.onRollOut = this.bind0(this,this.mouseEventCheckBoxRollOut);
this.m_contentClip.hitRegion.onPress = this.bind0(this,this.mouseEventCheckBoxPress);
this.m_contentClip.hitRegion.onReleaseOutside = this.bind0(this,this.mouseEventCheckBoxRollOut);
this.commonInit();
this.logic_init();
super.intro();
}
function loadContentClip()
{
this.m_contentClip = this.attachMovie(this.m_contentSymbol,"contentClip",std_mouseCheckBox_visual.CONTENT_DEPTH);
}
function setWidth(nWidth)
{
this.m_width = nWidth;
}
function setText(str)
{
this.m_contentClip.txtLabel.autoSize = "left";
this.m_label = str;
this.m_displayedText = this.m_label;
this.m_displayedText = this.m_label;
this.m_contentClip.labelMC.labelTF.text = this.m_displayedText;
if(this.m_textAlign == true)
{
this.m_contentClip.labelMC.labelTF._x = (this.m_width - this.m_contentClip.labelMC.labelTF.textWidth) / 2;
}
}
function getText()
{
return this.m_label;
}
function setTextColor(clrUnhighLight, clrHighLight, clrDisable)
{
}
function setLabelColor(clrUnhighLight, clrHighLight, clrDisable)
{
}
function setFontFormat(newTextFormat)
{
this.m_contentClip.labelMC.labelTF.setNewTextFormat(newTextFormat);
this.m_contentClip.labelMC.labelTF.setTextFormat(newTextFormat);
}
function setLabel(str)
{
}
function setLabelPos(x, y)
{
}
function check()
{
if(!this.isChecked())
{
this.m_state = std_mouseCheckBox_visual.ON_STATE;
this.restoreVisualState();
}
}
function unCheck()
{
if(this.isChecked())
{
this.m_state = std_mouseCheckBox_visual.OFF_STATE;
this.restoreVisualState();
}
}
function SetCheck()
{
this.m_state = std_mouseCheckBox_visual.ON_STATE;
this.restoreVisualState();
}
function SetUnCheck()
{
this.m_state = std_mouseCheckBox_visual.OFF_STATE;
this.restoreVisualState();
}
function isChecked()
{
return this.m_state == std_mouseCheckBox_visual.ON_STATE;
}
function isMouseOver()
{
return this.m_isMouseOver;
}
function restoreVisualState()
{
if(this.isEnabled())
{
this.m_contentClip.checkBoxMC.gotoAndPlay(!this.isChecked() ? "_unChecked" : "_checked");
if(this.isSelected())
{
if(this.isMouseOver())
{
this.m_contentClip.gotoAndPlay("_selectedRollover");
}
else
{
this.m_contentClip.gotoAndPlay("_selected");
}
}
else if(this.isMouseOver())
{
this.m_contentClip.gotoAndPlay("_unselectedRollover");
}
else
{
this.m_contentClip.gotoAndPlay("_unselected");
}
}
else
{
this.m_contentClip.gotoAndPlay("_disable");
this.m_contentClip.checkBoxMC.gotoAndPlay(!this.isChecked() ? "_disabledUnChecked" : "_disabledChecked");
}
}
function visual_mouseDownEvent()
{
if(this.isEnabled())
{
trace("std_mouseCheckBox_visual::visual_mouseDownEvent: " + this.m_contentSymbol);
if(this.m_contentSymbol == "SovietFactionButtonContent Symbol")
{
_global.playSound("GuiSovietFactionSelection");
}
else if(this.m_contentSymbol == "AlliedFactionButtonContent Symbol")
{
_global.playSound("GuiAlliedFactionSelection");
}
else if(this.m_contentSymbol == "JapaneseFactionButtonContent Symbol")
{
_global.playSound("GuiJapanFactionSelection");
}
else
{
_global.playSound("GuiShellMinorSelection");
}
if(this.isChecked())
{
this.unCheck();
}
else
{
this.check();
}
this.m_onChangeFunc(this,this.m_state == std_mouseCheckBox_visual.ON_STATE);
}
}
function visual_highlight()
{
this.restoreVisualState();
}
function visual_unhighlight()
{
this.restoreVisualState();
}
function visual_enableGUI()
{
this.restoreVisualState();
}
function visual_disableGUI()
{
this.restoreVisualState();
}
function mouseEventCheckBoxRollover()
{
this.m_isMouseOver = true;
this.restoreVisualState();
}
function mouseEventCheckBoxRollOut()
{
this.m_isMouseOver = false;
this.restoreVisualState();
}
function mouseEventCheckBoxPress()
{
this.mouseDownEvent();
}
}
@@ -0,0 +1,219 @@
class std_mouseDropDownMenu extends Cafe2_MouseBaseControl implements IListboxEntryElementEventListener, IListboxEventListener, ICafe2_FocusableControl
{
var m_isSelecting = false;
static var CONTENT_DEPTH = 100;
function std_mouseDropDownMenu()
{
super();
this.m_type = "std_mouseDropDownMenu";
}
static function defaultInitObject()
{
var _loc1_ = new Cafe2_Imp_BaseControl.defaultInitObject();
_loc1_.m_width = 150;
_loc1_.m_visibleEntryCount = 5;
_loc1_.m_contentClip = "TextDropdownMenuContentSymbol";
_loc1_.m_entrySymbol = "std_mouseListboxEntryTextElementSymbol";
return _loc1_;
}
static function createDynamic(container_, name_, level_, initObject_)
{
var _loc1_ = container_.attachMovie("std_mouseDropdownMenuSymbol",name_,level_,initObject_);
return std_mouseDropDownMenu(_loc1_);
}
function setData(displayData, itemData)
{
if(displayData.length != itemData.length)
{
trace("ERROR: std_mouseDropDownMenu::setData() displayData length: " + displayData.length + " is not the same as itemData length: " + itemData.length);
}
this.m_itemValues = new Array();
var _loc2_ = 0;
while(_loc2_ < itemData.length)
{
this.m_itemValues.push(itemData[_loc2_]);
_loc2_ = _loc2_ + 1;
}
if(displayData.length < this.m_visibleEntryCount)
{
this.m_contentClip.listbox.setNumEntries(displayData.length);
}
else if(this.m_contentClip.listbox.getNumEntries() < this.m_visibleEntryCount)
{
this.m_contentClip.listbox.setNumEntries(this.m_visibleEntryCount);
}
this.m_contentClip.listbox.setColumnData(0,displayData);
if(this.m_isSelecting)
{
this.m_contentClip.listbox.refreshDisplay();
this.m_contentClip.listbox.refreshScrollbar();
}
}
function clear()
{
this.m_contentClip.listbox.clear();
this.m_contentClip.currentSelection.clear();
this.m_itemValues = new Array();
this.hideListbox();
}
function setSelectedIndex(itemIndex)
{
this.m_contentClip.listbox.setSelectedIndex(itemIndex);
var _loc2_ = new Object();
_loc2_.data = this.m_contentClip.listbox.getElementData(0,itemIndex);
this.m_contentClip.currentSelection.setData(_loc2_);
this.m_contentClip.currentSelection.setSelected(false);
}
function getCurrentIndex()
{
return this.m_contentClip.listbox.getSelectedEntryIndex();
}
function getValueAtIndex(itemIndex)
{
return this.m_itemValues[itemIndex];
}
function onLoad()
{
visRefMC._visible = false;
this.m_contentClip = this.attachMovie(this.m_contentSymbol,"contentClip",std_mouseDropDownMenu.CONTENT_DEPTH);
this.init();
}
function init()
{
var _loc3_ = this.m_width;
this.m_contentClip.button.setOnMouseDownFunction(_global.bind0(this,this.toggleListbox));
this.m_contentClip.button.setOnBlur(_global.bind0(this,this.hideListbox));
this.setSize(this.m_width);
var _loc4_ = this.m_contentClip.currentSelection._height;
var _loc5_ = new Array();
_loc5_.push({symbol:this.m_entrySymbol,width:_loc3_,leftMargin:0,rightMargin:0,useHitRegion:false});
this.m_contentClip.listbox.setNumEntries(this.m_visibleEntryCount);
this.m_contentClip.listbox.setVerticalPadding(0);
this.m_contentClip.listbox.init(_loc5_,_loc4_);
this.m_contentClip.listbox.addListener(this);
this.m_contentClip.listbox.attachScrollbarController(this.m_contentClip.scrollbar);
this.m_contentClip.listbox.refreshDisplay();
this.m_contentClip.listbox.moveViewToFirst();
this.m_contentClip.currentSelection.init(0,_loc3_,_loc4_);
this.m_contentClip.currentSelection.addListener(this);
this.m_contentClip.currentSelection.clear();
this.commonInit();
if(this.isEnabled())
{
this.enableGUI();
}
else
{
this.disableGUI();
}
}
function setSize(p_nSize)
{
this.m_contentClip.BGImgMiddle._width = p_nSize - this.m_contentClip.BGImgLeft._width - this.m_contentClip.BGImgRight._width + this.m_ButtonWidth;
this.m_contentClip.BGImgMiddle._x = this.m_contentClip.BGImgLeft._width;
this.m_contentClip.BGImgRight._x = p_nSize + this.m_ButtonWidth - this.m_contentClip.BGImgRight._width;
this.m_contentClip.button._x = p_nSize;
}
function showListbox()
{
this.m_contentClip.button.setSelected(true);
this.m_contentClip.button.restoreVisualState();
this.m_contentClip.listbox.show();
this.m_contentClip.listbox.enable();
this.m_contentClip.scrollbar.show();
this.m_contentClip.scrollbar.enable();
this.m_contentClip.listbox.clearEntryHighlights();
this.m_contentClip.listbox.refreshDisplay();
this.m_contentClip.listbox.refreshScrollbar();
this.m_isSelecting = true;
}
function hideListbox()
{
this.m_contentClip.button.setOnBlur(undefined);
this.m_contentClip.button.setSelected(false);
this.m_contentClip.button.setOnBlur(_global.bind0(this,this.hideListbox));
this.m_contentClip.button.restoreVisualState();
this.m_contentClip.listbox.clearEntryHighlights();
this.m_contentClip.listbox.hide();
this.m_contentClip.listbox.disable();
this.m_contentClip.scrollbar.hide();
this.m_contentClip.scrollbar.disable();
this.m_isSelecting = false;
}
function toggleListbox()
{
if(this.m_isSelecting)
{
this.m_contentClip.button.setSelected(false);
_global.playSound("GuiShellDropdownCloseClick");
}
else
{
this.showListbox();
_global.playSound("GuiShellDropdownOpenClick");
}
}
function disableGUI()
{
this.hideListbox();
this.m_contentClip.button.disable();
this.m_contentClip.gotoAndPlay("_disable");
}
function enableGUI()
{
this.m_contentClip.button.enable();
if(this.isSelected())
{
this.m_contentClip.gotoAndPlay("_selected");
}
else
{
this.m_contentClip.gotoAndPlay("_unselected");
}
}
function highlight()
{
if(this.isEnabled())
{
this.m_contentClip.gotoAndPlay("_selected");
}
}
function unhighlight()
{
if(this.isEnabled())
{
this.m_contentClip.gotoAndPlay("_unselected");
}
}
function OnListboxIndexMouseClick(newIndex, oldIndex)
{
}
function OnListboxIndexElementMouseClick(index, element, previouslySelectedIndex)
{
this.hideListbox();
if(index != previouslySelectedIndex)
{
var _loc2_ = new Object();
_loc2_.data = this.m_contentClip.listbox.getElementData(element,index);
this.m_contentClip.currentSelection.setData(_loc2_);
this.m_onChangeFunc(this);
}
}
function OnListboxEntryElementMouseClick(element)
{
if(this.isEnabled())
{
this.m_contentClip.button.mouseDownEvent();
}
else
{
this.m_objFM.deselectFocusedComponent();
}
}
function OnListboxEntryElementMouseEnter(element)
{
}
function OnListboxEntryElementMouseExit(element)
{
}
}
@@ -0,0 +1,29 @@
class std_mouseListboxEntryColorSwatchElement extends std_mouseListboxEntryElement
{
function std_mouseListboxEntryColorSwatchElement()
{
super();
}
function init(index, width, height)
{
super.init(index,width,height);
}
function clear()
{
this.colorSwatchCustomRender._colorIndex = -1;
}
function setData(data)
{
this.colorSwatchCustomRender._colorIndex = Number(data.data);
this.colorSwatchCustomRender.gotoAndPlay("_reset");
}
function getData()
{
var _loc2_ = new Object();
_loc2_.data = this.colorSwatchCustomRender._colorIndex;
return _loc2_;
}
function setSelected(selected)
{
}
}
@@ -0,0 +1,120 @@
class std_mouseListboxEntryElement extends MovieClip
{
function std_mouseListboxEntryElement()
{
super();
this.m_index = 0;
this.m_eventListeners = new Array();
}
function init(index, width, height, useHitRegion)
{
this.m_index = index;
if(useHitRegion == false)
{
this.hitRegion.removeMovieClip();
}
else
{
this.hitRegion._width = width;
this.hitRegion._height = height;
this.hitRegion.onPress = this.bind0(this,this.OnMouseClick);
this.hitRegion.onRollOver = this.hitRegion.onDragOver = this.bind0(this,this.OnMouseEnter);
this.hitRegion.onRollOut = this.hitRegion.onDragOut = this.bind0(this,this.OnMouseExit);
}
}
function shutdown()
{
}
function clear()
{
trace("std_mouseListboxEntryElement::clear(), Error: subclasses should implement this function.");
}
function setData(data)
{
trace("std_mouseListboxEntryElement::setData(), Error: subclasses should implement this function.");
}
function getData()
{
trace("std_mouseListboxEntryElement::getData(), Error: subclasses should implement this function.");
return undefined;
}
function setVisualProperties(properties)
{
trace("std_mouseListboxEntryElement::setVisualProperties(), Error: subclasses should implement this function.");
}
function setSelected(selected)
{
trace("std_mouseListboxEntryElement::setSelected(), Error: subclasses should implement this function.");
}
function addListener(listener)
{
this.m_eventListeners.push(listener);
}
function removeListener(listener)
{
while(this.removeAllInstancesOfListener(listener))
{
}
}
function removeAllInstancesOfListener(listener)
{
var _loc2_ = 0;
while(_loc2_ < this.m_eventListeners.length)
{
if(this.m_eventListeners[_loc2_] == listener)
{
this.m_eventListeners[_loc2_] = null;
this.m_eventListeners.splice(_loc2_,1);
return true;
}
_loc2_ = _loc2_ + 1;
}
return false;
}
function OnMouseEnter()
{
this.broadcastOnListboxEntryElementMouseEnter(this.m_index);
}
function OnMouseExit()
{
this.broadcastOnListboxEntryElementMouseExit(this.m_index);
}
function OnMouseClick()
{
this.broadcastOnListboxEntryElementMouseClick(this.m_index);
}
function bind0(o, f)
{
return function()
{
f.call(o);
};
}
function broadcastOnListboxEntryElementMouseEnter(id)
{
var _loc2_ = 0;
while(_loc2_ < this.m_eventListeners.length)
{
this.m_eventListeners[_loc2_].OnListboxEntryElementMouseEnter(id);
_loc2_ = _loc2_ + 1;
}
}
function broadcastOnListboxEntryElementMouseExit(id)
{
var _loc2_ = 0;
while(_loc2_ < this.m_eventListeners.length)
{
this.m_eventListeners[_loc2_].OnListboxEntryElementMouseExit(id);
_loc2_ = _loc2_ + 1;
}
}
function broadcastOnListboxEntryElementMouseClick(id)
{
var _loc2_ = 0;
while(_loc2_ < this.m_eventListeners.length)
{
this.m_eventListeners[_loc2_].OnListboxEntryElementMouseClick(id);
_loc2_ = _loc2_ + 1;
}
}
}
@@ -0,0 +1,39 @@
class std_mouseListboxEntryGameStatusElement extends std_mouseListboxEntryElement
{
function std_mouseListboxEntryGameStatusElement()
{
super();
}
function init(index, width, height)
{
super.init(index,width,height);
this.m_clanIcon._visible = false;
this.m_customMapIcon._visible = false;
this.m_voipIcon._visible = false;
this.m_passwordIcon._visible = false;
}
function clear()
{
this.m_clanIcon._visible = false;
this.m_customMapIcon._visible = false;
this.m_voipIcon._visible = false;
this.m_passwordIcon._visible = false;
}
function setData(data)
{
var _loc2_ = data.data;
this.m_clanIcon._visible = _loc2_.charAt(0) == "1";
this.m_customMapIcon._visible = _loc2_.charAt(1) == "1";
this.m_voipIcon._visible = _loc2_.charAt(2) == "1";
this.m_passwordIcon._visible = _loc2_.charAt(3) == "1";
}
function getData()
{
var _loc2_ = new Object();
_loc2_ = !this.m_clanIcon._visible ? (!("0" + this.m_customMapIcon._visible) ? (!("0" + this.m_voipIcon._visible) ? (!("0" + this.m_passwordIcon._visible) ? "0" : "1") : "1") : "1") : "1";
return _loc2_;
}
function setSelected(selected)
{
}
}
@@ -0,0 +1,32 @@
class std_mouseListboxEntryRenderImageElement extends std_mouseListboxEntryElement
{
function std_mouseListboxEntryRenderImageElement()
{
super();
}
function init(index, width, height)
{
trace("std_mouseListboxEntryRenderImageElement::init() ");
super.init(index,width,height);
this.renderImageCustomRender._imageMap = "";
}
function clear()
{
trace("std_mouseListboxEntryRenderImageElement::clear() ");
this.renderImageCustomRender._imageMap = "";
}
function setData(data)
{
this.renderImageCustomRender._imageMap = String(data.data);
this.renderImageCustomRender.gotoAndPlay("_reset");
}
function getData()
{
var _loc2_ = new Object();
_loc2_.data = this.renderImageCustomRender._imageMap;
return _loc2_;
}
function setSelected(selected)
{
}
}
@@ -0,0 +1,73 @@
class std_mouseListboxEntryTextElement extends std_mouseListboxEntryElement
{
function std_mouseListboxEntryTextElement()
{
super();
}
function init(index, width, height, useHitRegion)
{
super.init(index,width,height,useHitRegion);
this.m_textFormat = new TextFormat();
var _loc3_ = std_config.listbox_textFormat_unhighlight;
this.m_textFormat.font = _loc3_.font;
this.m_textFormat.size = _loc3_.size;
this.m_textFormat.color = this.m_unhighlightColor = std_config.listbox_textColor_unhighlight;
this.textClip.setTextFormat(this.m_textFormat);
this.textClip._width = width;
this.textClip._height = height;
this.textClip.autoSize = false;
this.textClip.wordWrap = false;
this.textClip.text = " ";
}
function clear()
{
this.textClip.text = " ";
}
function setData(data)
{
var _loc2_ = undefined;
_loc2_ = data.data.split(",");
this.textClip.text = _loc2_[0];
var _loc3_ = this.textClip.textHeight;
if(_loc2_[1] != undefined && _loc2_[1] != null)
{
this.m_textFormat.color = this.m_unhighlightColor = _loc2_[1];
this.textClip.setTextFormat(this.m_textFormat);
}
}
function getData()
{
var _loc2_ = new Object();
_loc2_.data = this.textClip.text;
return _loc2_;
}
function setSelected(selected)
{
if(selected == true)
{
this.m_textFormat.color = std_config.listbox_textColor_highlight;
}
else
{
this.m_textFormat.color = this.m_unhighlightColor;
}
this.textClip.setTextFormat(this.m_textFormat);
}
function setVisualProperties(properties)
{
if(properties.fontSize != undefined && properties.fontSize > 0)
{
this.m_textFormat.size = properties.fontSize;
}
if(properties.color != undefined)
{
this.m_textFormat.color = this.m_unhighlightColor = properties.color;
}
if(properties.autoSize != undefined)
{
this.textClip.autoSize = properties.autoSize;
this.textClip.wordWrap = properties.autoSize;
}
this.textClip.setTextFormat(this.m_textFormat);
}
}
@@ -0,0 +1,44 @@
class std_mouseRadioButton extends std_mouseCheckBox_visual
{
function std_mouseRadioButton()
{
super();
this.m_type = "std_mouseRadioButton";
this.stop();
}
function onUnload()
{
}
function onAllAssetsLoaded()
{
this.onLoad();
}
function onLoad()
{
var _loc2_ = this._parent[this.m_controller];
_loc2_.AddRadioButton(this);
this.loadContentClip();
this.setFontFormat(std_config.button_textFormat);
this.setWidth(this.m_width);
this.setText(this.m_label,true);
this.m_contentClip.hitRegion.onRollOver = this.bind0(this,this.mouseEventCheckBoxRollover);
this.m_contentClip.hitRegion.onRollOut = this.bind0(this,this.mouseEventCheckBoxRollOut);
this.m_contentClip.hitRegion.onPress = this.bind0(this,this.mouseEventCheckBoxPress);
this.m_contentClip.hitRegion.onReleaseOutside = this.bind0(this,this.mouseEventCheckBoxRollOut);
this.commonInit();
this.logic_init();
this.intro();
}
function loadContentClip()
{
this.m_contentClip = this.attachMovie(this.m_contentSymbol,"contentClip",std_mouseCheckBox_visual.CONTENT_DEPTH);
}
function mouseEventCheckBoxPress()
{
if(this.isEnabled())
{
var _loc2_ = this._parent[this.m_controller];
_loc2_.RadioButtonPressed(this);
}
}
}
@@ -0,0 +1,86 @@
class std_mouseRadioButtonController
{
function std_mouseRadioButtonController()
{
this.m_radioButtons = new Array();
this.m_selectedButtonIndex = -1;
}
function AddRadioButton(radioButton)
{
var _loc3_ = 0;
if(radioButton.radioButton.isChecked())
{
_loc3_ = _loc3_ + 1;
}
var _loc2_ = 0;
while(_loc2_ < this.m_radioButtons.length)
{
if(radioButton == this.m_radioButtons[_loc2_])
{
trace("ERROR: std_mouseRadioButtonController::AddRadioButton() Button already added!");
return _loc2_;
}
if(this.m_radioButtons[_loc2_].isChecked())
{
_loc3_ = _loc3_ + 1;
this.m_selectedButtonIndex = _loc2_;
}
_loc2_ = _loc2_ + 1;
}
var _loc5_ = this.m_radioButtons.length;
this.m_radioButtons.push(radioButton);
if(_loc3_ > 1)
{
trace("std_mouseRadioButtonController::AddRadioButton() ERROR!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
trace(" There are " + _loc3_ + " Radio buttons checked. There should be 1 or less!");
trace("\t Please fix!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
trace("std_mouseRadioButtonController::AddRadioButton() ERROR!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
}
return _loc5_;
}
function RadioButtonPressed(radioButton)
{
if(radioButton.isChecked())
{
return undefined;
}
var _loc2_ = 0;
while(_loc2_ < this.m_radioButtons.length)
{
if(radioButton != this.m_radioButtons[_loc2_])
{
this.m_radioButtons[_loc2_].unCheck();
}
else
{
this.m_selectedButtonIndex = _loc2_;
}
_loc2_ = _loc2_ + 1;
}
radioButton.mouseDownEvent();
}
function GetSelectedRadioButton()
{
if(this.m_selectedButtonIndex >= 0 && this.m_selectedButtonIndex < this.m_radioButtons.length)
{
return this.m_radioButtons[this.m_selectedButtonIndex];
}
trace("ERROR: std_mouseRadioButtonController::GetSelectedRadioButton() Radio button controller has no selected button!");
return undefined;
}
function SetSelectedRadioButton(radioButton)
{
trace("std_mouseRadioButtonController::SetSelectedRadioButton( " + radioButton + " )");
var _loc2_ = 0;
while(_loc2_ < this.m_radioButtons.length)
{
if(radioButton == this.m_radioButtons[_loc2_])
{
this.m_selectedButtonIndex = _loc2_;
this.m_radioButtons[_loc2_].check();
return undefined;
}
_loc2_ = _loc2_ + 1;
}
}
}
@@ -0,0 +1,153 @@
class std_mouseScrollbar_logic extends MovieClip
{
var m_DragThumbToolb = false;
static var CONTROL_THUMB = 0;
static var CONTROL_INCREMENT_ARROW = 1;
static var CONTROL_DECREMENT_ARROW = 2;
function std_mouseScrollbar_logic()
{
super();
if(this.m_nMin == undefined || this.m_nMax == undefined || this.m_nValue == undefined)
{
trace("WARNING: invalid component properties - " + this);
}
this.m_index = new CafeFW_IndexMgr();
this.m_index.SetInfo(this.m_nValue,this.m_nMin,this.m_nMax,1,false,false);
this.m_scrollbarEventListeners = new Array();
}
static function defaultInitObject()
{
var _loc1_ = new Object();
_loc1_.m_nMin = 0;
_loc1_.m_nMax = 10;
_loc1_.m_nValue = 0;
return _loc1_;
}
function getValue()
{
return this.m_index.GetIndex();
}
function setValue(p_nValue)
{
if(this.m_index.SetIndex(p_nValue) != CafeFW_IndexMgr.TIBINDEX_CHANGE_NONE)
{
this.update();
}
}
function nextValue()
{
if(this.m_index.IncIndex() != CafeFW_IndexMgr.TIBINDEX_CHANGE_NONE)
{
this.update();
this.onNext();
}
}
function prevValue()
{
if(this.m_index.DecIndex() != CafeFW_IndexMgr.TIBINDEX_CHANGE_NONE)
{
this.update();
this.onPrev();
}
}
function getMin()
{
return this.m_index.GetMinIndex();
}
function getMax()
{
return this.m_index.GetMaxIndex();
}
function setRange(range)
{
trace("WARNING: Cafe2_Imp_StdScrollbar::setRange() deprecated use setScrollbarInfo");
this.setInfo(0,range,this.getValue());
this.update();
}
function getRange()
{
return this.m_index.GetNumItems();
}
function setInfo(indexMin, indexMax, indexCurrent)
{
this.m_index.SetInfo(indexCurrent,indexMin,indexMax,1,false,false);
this.update();
}
function enable()
{
this.visual_enableGUI();
}
function disable()
{
this.visual_disableGUI();
}
function highlight(id)
{
this.visual_highlight(id);
}
function unhighlight(id)
{
this.visual_unhighlight_clip(id);
}
function addListener(listener)
{
this.m_scrollbarEventListeners.push(listener);
}
function removeListener(listener)
{
while(this.removeAllInstancesOfListener(listener))
{
}
}
function removeAllInstancesOfListener(listener)
{
var _loc2_ = 0;
while(_loc2_ < this.m_scrollbarEventListeners.length)
{
if(this.m_scrollbarEventListeners[_loc2_] == listener)
{
this.m_scrollbarEventListeners[_loc2_] = null;
this.m_scrollbarEventListeners.splice(_loc2_,1);
return true;
}
_loc2_ = _loc2_ + 1;
}
return false;
}
function broadcastOnScrollbarDelta(dir)
{
var _loc2_ = 0;
while(_loc2_ < this.m_scrollbarEventListeners.length)
{
this.m_scrollbarEventListeners[_loc2_].OnScrollbarDelta(dir);
_loc2_ = _loc2_ + 1;
}
}
function broadcastOnScrollbarThumbUpdate(newValue)
{
var _loc2_ = 0;
while(_loc2_ < this.m_scrollbarEventListeners.length)
{
this.m_scrollbarEventListeners[_loc2_].OnScrollbarThumbUpdate(newValue);
_loc2_ = _loc2_ + 1;
}
}
function broadcastOnScrollbarMouseEnter()
{
var _loc2_ = 0;
while(_loc2_ < this.m_scrollbarEventListeners.length)
{
this.m_scrollbarEventListeners[_loc2_].OnScrollbarMouseEnter();
_loc2_ = _loc2_ + 1;
}
}
function broadcastOnScrollbarMouseExit()
{
var _loc2_ = 0;
while(_loc2_ < this.m_scrollbarEventListeners.length)
{
this.m_scrollbarEventListeners[_loc2_].OnScrollbarMouseExit();
_loc2_ = _loc2_ + 1;
}
}
}
@@ -0,0 +1,278 @@
class std_mouseScrollbar_visual extends std_mouseScrollbar_logic
{
var m_scrollDirection = 0;
var m_scrollArrowHeight = 23;
function std_mouseScrollbar_visual()
{
super();
}
static function defaultInitObject()
{
var _loc1_ = std_mouseScrollbar_logic.defaultInitObject();
_loc1_.m_nLength = 100;
return _loc1_;
}
static function createDynamic(container_, name_, level_, initObject_)
{
return std_mouseScrollbar_visual(container_.attachMovie("std_scrollbar",name_,level_,initObject_));
}
function onLoad()
{
this.setSize(this.m_nLength);
this._parent.onControlLoaded(this);
this.m_scrollArrowHeight = this.arrowTopMC._height;
this.arrowBottomMC.hitRegion.mComponentPtr = this;
this.arrowBottomMC.hitRegion.onRollOver = this.mouseEventDecScrollBarRollOver;
this.arrowBottomMC.hitRegion.onRollOut = this.mouseEventDecScrollBarRollOut;
this.arrowBottomMC.hitRegion.onPress = this.downArrowClicked;
this.arrowBottomMC.hitRegion.onRelease = this.stopTrackArrow;
this.arrowBottomMC.hitRegion.onReleaseOutside = this.mouseEventDecScrollBarRollOut;
this.arrowTopMC.hitRegion.mComponentPtr = this;
this.arrowTopMC.hitRegion.onRollOver = this.mouseEventIncScrollBarRollOver;
this.arrowTopMC.hitRegion.onRollOut = this.mouseEventIncScrollBarRollOut;
this.arrowTopMC.hitRegion.onPress = this.upArrowClicked;
this.arrowTopMC.hitRegion.onRelease = this.stopTrackArrow;
this.arrowTopMC.hitRegion.onReleaseOutside = this.mouseEventIncScrollBarRollOut;
this.thumbMC.hitRegion.mComponentPtr = this;
this.thumbMC.hitRegion.onRollOver = this.mouseEventThumbRollOver;
this.thumbMC.hitRegion.onRollOut = this.mouseEventThumbRollOut;
this.thumbMC.hitRegion.onDragOver = this.mouseEventThumbDragOver;
this.thumbMC.hitRegion.onDragOut = this.mouseEventThumbDragOut;
this.thumbMC.hitRegion.onPress = this.mouseEventThumbMouseDown;
this.thumbMC.hitRegion.onRelease = this.mouseEventThumbMouseUp;
this.thumbMC.hitRegion.onReleaseOutside = this.mouseEventThumbMouseUpReset;
this.trackMiddle.hitRegion.mComponentPtr = this;
this.trackMiddle.hitRegion.onPress = this.mouseEventTrackMouseDown;
this.trackMiddle.hitRegion.onRelease = this.mouseEventTrackMouseUp;
this.trackMiddle.hitRegion.onReleaseOutside = this.mouseEventTrackMouseUp;
}
function setSize(p_nSize)
{
this.THUMB_MARGIN = this.arrowTopMC._height;
this.m_nLength = p_nSize;
this.m_thumbZoneLength = this.m_nLength - this.arrowTopMC._height - this.arrowBottomMC._height - 2 * this.THUMB_MARGIN;
this.arrowBottomMC._y = this.m_nLength - this.arrowBottomMC._height;
this.TrackBottom._y = this.arrowBottomMC._y - this.TrackBottom._height;
this.TrackMiddle._y = this.TrackTop._y + this.TrackTop._height;
this.TrackMiddle._height = this.TrackBottom._y - this.TrackTop._y - this.TrackTop._height;
this.m_minThumbCoordinate = this.arrowTopMC._y + this.arrowTopMC._height + this.THUMB_MARGIN;
this.m_maxThumbCoordinate = this.m_minThumbCoordinate + this.m_thumbZoneLength;
this.updateVisuals();
}
function getWidth()
{
return this.TrackMiddle._width;
}
function updateVisuals()
{
var _loc2_ = this.m_index.GetMaxIndex() - this.m_index.GetMinIndex();
var _loc3_ = _loc2_ != 0 ? this.m_thumbZoneLength / _loc2_ : this.m_thumbZoneLength;
this.thumbMC._y = this.m_scrollArrowHeight + this.THUMB_MARGIN + Math.floor(this.m_index.GetIndex() * _loc3_);
}
function update()
{
this.updateVisuals();
}
function updateIndexNormalized(normalizedPct)
{
var _loc2_ = this.m_index.GetMinIndex() + Math.round(this.m_index.GetNumItems() * normalizedPct);
this.m_index.SetIndex(_loc2_);
}
function onNext()
{
this.arrowBottomMC.gotoAndPlay("_toggle");
}
function onPrev()
{
this.arrowTopMC.gotoAndPlay("_toggle");
}
function visual_highlight(id)
{
switch(id)
{
case std_mouseScrollbar_logic.CONTROL_THUMB:
this.thumbMC.gotoAndPlay("_highlight");
break;
case std_mouseScrollbar_logic.CONTROL_INCREMENT_ARROW:
this.arrowTopMC.gotoAndPlay("_highlight");
break;
case std_mouseScrollbar_logic.CONTROL_DECREMENT_ARROW:
this.arrowBottomMC.gotoAndPlay("_highlight");
}
this.lineTopMC.gotoAndPlay("_highlight");
this.lineBottomMC.gotoAndPlay("_highlight");
}
function visual_unhighlight_clip(id)
{
switch(id)
{
case std_mouseScrollbar_logic.CONTROL_THUMB:
this.thumbMC.gotoAndPlay("_unhighlight");
break;
case std_mouseScrollbar_logic.CONTROL_INCREMENT_ARROW:
this.arrowTopMC.gotoAndPlay("_unhighlight");
break;
case std_mouseScrollbar_logic.CONTROL_DECREMENT_ARROW:
this.arrowBottomMC.gotoAndPlay("_unhighlight");
}
}
function visual_unhighlight()
{
this.arrowTopMC.gotoAndPlay("_unhighlight");
this.arrowBottomMC.gotoAndPlay("_unhighlight");
this.thumbMC.gotoAndPlay("_unhighlight");
this.lineTopMC.gotoAndPlay("_unhighlight");
this.lineBottomMC.gotoAndPlay("_unhighlight");
}
function visual_enableGUI()
{
this.visual_unhighlight();
}
function visual_disableGUI()
{
this.arrowTopMC.gotoAndPlay("_disable");
this.arrowBottomMC.gotoAndPlay("_disable");
this.thumbMC.gotoAndPlay("_disable");
this.lineTopMC.gotoAndPlay("_disable");
this.lineBottomMC.gotoAndPlay("_disable");
}
function rollover(id)
{
this.highlight(id);
this.broadcastOnScrollbarMouseEnter();
}
function rollout(id)
{
this.unhighlight(id);
this.broadcastOnScrollbarMouseExit();
}
function dragOver()
{
}
function dragOut()
{
}
function prepareToDragThumbTool()
{
this.m_DragThumbToolb = true;
this.onEnterFrame = this.trackThumbTool;
}
function endToDragThumbTool()
{
this.m_DragThumbToolb = false;
this.onEnterFrame = null;
this.updateVisuals();
}
function trackThumbTool()
{
var _loc2_ = Math.min(Math.max(this._ymouse,this.m_minThumbCoordinate),this.m_maxThumbCoordinate);
if(_loc2_ != this.thumbMC._y)
{
var _loc3_ = (_loc2_ - this.m_minThumbCoordinate) / (this.m_maxThumbCoordinate - this.m_minThumbCoordinate);
var _loc4_ = 100 * _loc3_;
this.thumbMC._y = _loc2_;
this.updateIndexNormalized(_loc3_);
this.broadcastOnScrollbarThumbUpdate(_loc4_);
}
}
function updateData(dataChangeDirection)
{
this.broadcastOnScrollbarDelta(dataChangeDirection);
if(dataChangeDirection == 0)
{
this.prevValue();
}
else
{
this.nextValue();
}
}
function show()
{
this._visible = true;
}
function hide()
{
this._visible = false;
}
function mouseEventDecScrollBarRollOver()
{
this.mComponentPtr.rollover(std_mouseScrollbar_logic.CONTROL_DECREMENT_ARROW);
}
function mouseEventDecScrollBarRollOut()
{
this.mComponentPtr.rollout(std_mouseScrollbar_logic.CONTROL_DECREMENT_ARROW);
}
function mouseEventIncScrollBarRollOver()
{
this.mComponentPtr.rollover(std_mouseScrollbar_logic.CONTROL_INCREMENT_ARROW);
}
function mouseEventIncScrollBarRollOut()
{
this.stopTrackArrow();
this.mComponentPtr.rollout(std_mouseScrollbar_logic.CONTROL_INCREMENT_ARROW);
}
function mouseEventThumbRollOver()
{
this.mComponentPtr.rollover(std_mouseScrollbar_logic.CONTROL_THUMB);
}
function mouseEventThumbRollOut()
{
this.mComponentPtr.rollout(std_mouseScrollbar_logic.CONTROL_THUMB);
}
function mouseEventThumbDragOver()
{
this.mComponentPtr.dragOver();
}
function mouseEventThumbDragOut()
{
this.mComponentPtr.dragOut();
}
function mouseEventThumbMouseDown()
{
this.mComponentPtr.prepareToDragThumbTool();
}
function mouseEventThumbMouseUp()
{
this.mComponentPtr.endToDragThumbTool();
}
function mouseEventThumbMouseUpReset()
{
this.mComponentPtr.endToDragThumbTool();
this.mComponentPtr.rollout(std_mouseScrollbar_logic.CONTROL_THUMB);
}
function mouseEventTrackMouseDown()
{
this.mComponentPtr.prepareToDragThumbTool();
}
function mouseEventTrackMouseUp()
{
this.mComponentPtr.endToDragThumbTool();
}
function upArrowClicked()
{
this.mComponentPtr.prepareArrowClicked(0);
}
function downArrowClicked()
{
this.mComponentPtr.prepareArrowClicked(1);
}
function prepareArrowClicked(direction)
{
this.m_scrollDirection = direction;
this.onEnterFrame = this.trackArrowTool;
}
function endToArrowClicked()
{
this.onEnterFrame = null;
this.updateVisuals();
}
function trackArrowTool()
{
this.updateData(this.m_scrollDirection);
}
function stopTrackArrow()
{
this.mComponentPtr.endToArrowClicked();
}
}
@@ -0,0 +1,639 @@
class std_mouseScrollingListbox extends Cafe2_MouseBaseControl implements IListboxEntryEventListener, IScrollbarEventListener, ICafe2_FocusableControl
{
static var ATTACHMOVIE_BASE_LEVEL = 500;
static var NO_SELECTION = -1;
function std_mouseScrollingListbox()
{
super();
this.m_numTotalEntries = 0;
this.m_contentWidth = 0;
this.m_contentHeight = 0;
this.m_entryHeight = 0;
this.m_dataColumnCount = 0;
this.m_selectedIndex = std_mouseScrollingListbox.NO_SELECTION;
this.m_scrollbarController = null;
this.m_mousePresence = 0;
this.m_eventListeners = new Array();
this.m_eventListenerFns = new Array();
this.m_scrollHeight = 0;
this.m_useEntryHitRegion = true;
}
static function defaultInitObject()
{
var _loc1_ = new Cafe2_Imp_BaseControl.defaultInitObject();
_loc1_.m_vPadding = 0;
_loc1_.m_numVisibleEntries = 10;
_loc1_.m_scrollbarOffset = Array([10,0]);
_loc1_.m_backgroundMargin = 3;
_loc1_.m_renderWidth = 0;
_loc1_.m_renderHeight = 0;
_loc1_.m_useHighlights = true;
_loc1_.m_alternateBackgroundColors = false;
_loc1_.m_backgroundColor1 = 0;
_loc1_.m_backgroundColor2 = 0;
return _loc1_;
}
static function createDynamic(container_, name_, level_, initObject_)
{
var _loc1_ = container_.attachMovie("std_mouseScrollingListboxSymbol",name_,level_,initObject_);
return std_mouseScrollingListbox(_loc1_);
}
function enableGUI()
{
}
function disableGUI()
{
}
function highlight()
{
if(this.isEnabled() && this._visible && this.m_useHighlights)
{
this.background.gotoAndPlay("_highlight");
}
}
function unhighlight()
{
if(this.isEnabled() && this._visible && this.m_useHighlights)
{
this.background.gotoAndPlay("_unhighlight");
}
}
function OnScrollbarDelta(dir)
{
switch(dir)
{
case 0:
this.scrollViewUp();
break;
case 1:
this.scrollViewDown();
}
}
function OnScrollbarThumbUpdate(percentage)
{
if(this.m_contentHeight > this.m_renderHeight)
{
this.m_scrollHeight = percentage / 100 * (this.m_contentHeight - this.m_renderHeight);
this.m_clipAnchor._x = 0;
this.m_clipAnchor._y = - this.m_scrollHeight;
}
}
function OnScrollbarMouseEnter()
{
}
function OnScrollbarMouseExit()
{
}
function OnListboxEntryMouseEnter(entry)
{
if(this.isEnabled())
{
if(entry >= 0 && entry < this.m_numTotalEntries)
{
this.m_entryClips[entry].realizeHighlightState();
}
}
if(this._ymouse < 0 || this._ymouse > this.m_renderHeight || this._xmouse < 0 || this._xmouse > this.m_renderWidth || entry >= this.getGreatestColumnDataCount())
{
return undefined;
}
this.OnChildMouseEnterEvent(entry);
}
function OnListboxEntryMouseExit(entry)
{
if(this.isEnabled())
{
if(entry >= 0 && entry < this.m_numTotalEntries)
{
this.m_entryClips[entry].realizeHighlightState();
}
}
this.OnChildMouseExitEvent(entry);
}
function OnListboxEntryMouseClick(entry)
{
this.m_objFM.setFocusToControl(this);
if(this.isEnabled())
{
var _loc3_ = this.getGreatestColumnDataCount();
if(this._ymouse < 0 || this._ymouse > this.m_renderHeight || this._xmouse < 0 || this._xmouse > this.m_renderWidth || entry >= _loc3_)
{
return undefined;
}
var _loc5_ = this.getSelectedEntryIndex();
this.setSelectedIndex(entry);
this.broadcastOnListboxIndexMouseClick(entry,_loc5_);
_global.playSound("GuiShellListboxClick");
}
else
{
this.m_objFM.deselectFocusedComponent();
}
}
function OnListboxEntryElementMouseClick(entry, element)
{
if(this.isEnabled())
{
var _loc3_ = this.getGreatestColumnDataCount();
if(this._ymouse < 0 || this._ymouse > this.m_renderHeight || this._xmouse < 0 || this._xmouse > this.m_renderWidth || entry >= _loc3_)
{
return undefined;
}
var _loc5_ = this.getSelectedEntryIndex();
this.setSelectedIndex(entry);
this.broadcastOnListboxIndexElementMouseClick(entry,element,_loc5_);
_global.playSound("GuiShellListboxClick");
}
else
{
this.m_objFM.deselectFocusedComponent();
}
}
function onMousewheelScroll(spins)
{
var _loc3_ = Math.abs(spins);
var _loc2_ = 0;
while(_loc2_ < _loc3_)
{
if(spins < 0)
{
this.scrollViewDown();
}
else
{
this.scrollViewUp();
}
_loc2_ = _loc2_ + 1;
}
}
function init(entryElementInfo, entryHeight)
{
if(this.m_numVisibleEntries == undefined || this.m_numVisibleEntries == 0)
{
this.m_numVisibleEntries = 8;
}
this.m_entryClips = new Array();
this.m_scrollHeight = 0;
this.m_contentHeight = this.m_numVisibleEntries * entryHeight;
this.m_contentWidth = 0;
this.m_entryElementInfo = entryElementInfo;
this.m_entryHeight = entryHeight;
var _loc2_ = 0;
while(_loc2_ < entryElementInfo.length)
{
this.m_contentWidth += entryElementInfo[_loc2_].width;
this.m_contentWidth += entryElementInfo[_loc2_].leftMargin;
this.m_contentWidth += entryElementInfo[_loc2_].rightMargin;
_loc2_ = _loc2_ + 1;
}
if(this.m_renderWidth == 0 || this.m_renderWidth == undefined || this.m_renderHeight == 0 || this.m_renderHeight == undefined)
{
trace("ERROR: Bad render sizes specified. Using defaults.");
this.m_renderWidth = this.m_contentWidth;
this.m_renderHeight = this.m_contentHeight;
trace("Render width: " + this.m_renderWidth + " Render height: " + this.m_renderHeight);
}
if(this.m_backgroundMargin == undefined)
{
this.m_backgroundMargin = 3;
}
this.m_dataColumnCount = this.m_entryElementInfo.length;
this.m_dataArrays = new Array(this.m_dataColumnCount);
_loc2_ = 0;
while(_loc2_ < this.m_dataColumnCount)
{
this.m_dataArrays[_loc2_] = new Array();
_loc2_ = _loc2_ + 1;
}
this.configureBackgroundButton();
this.background._visible = this.m_BgVisible;
this.m_listboxMask._width = this.getWidth();
this.m_listboxMask._height = this.getHeight();
this.m_listboxMask.onRollOver = this.m_listboxMask.onDragOver = this.bind0(this,this.OnMouseEnter);
this.m_listboxMask.onRollOut = this.m_listboxMask.onDragOut = this.bind0(this,this.OnMouseExit);
if(this.m_alternateBackgroundColors == true)
{
this.m_contentHeight = 0;
_loc2_ = 0;
while(_loc2_ < this.m_numVisibleEntries)
{
this.m_entryClips[_loc2_] = this.createEntryClip(_loc2_,0,this.m_contentHeight,this.m_entryElementInfo,this.m_entryHeight);
this.m_entryClips[_loc2_]._y = this.m_contentHeight;
this.m_contentHeight += this.m_entryHeight + this.m_vPadding;
_loc2_ = _loc2_ + 1;
}
}
this.realizeHighlightState();
this.commonInit();
}
function refreshDisplay()
{
var _loc6_ = this.getGreatestColumnDataCount();
var _loc7_ = this.m_entryClips.length != undefined ? this.m_entryClips.length : 0;
this.m_numTotalEntries = Math.max(_loc6_,this.m_numVisibleEntries);
var _loc8_ = 100 * this.m_scrollHeight / (this.m_contentHeight - this.m_renderHeight);
this.m_contentHeight = 0;
var _loc2_ = undefined;
_loc2_ = 0;
while(_loc2_ < this.m_numTotalEntries)
{
if(_loc2_ >= _loc7_)
{
this.m_entryClips[_loc2_] = this.createEntryClip(_loc2_,0,this.m_contentHeight,this.m_entryElementInfo,this.m_entryHeight);
}
this.m_entryClips[_loc2_].clear();
var _loc3_ = 0;
while(_loc2_ < _loc6_ && _loc3_ < this.m_dataColumnCount)
{
var _loc5_ = this.m_dataArrays[_loc3_];
var _loc4_ = new Object();
_loc4_.data = _loc5_[_loc2_];
this.m_entryClips[_loc2_].setElementData(_loc3_,_loc4_);
_loc3_ = _loc3_ + 1;
}
this.m_entryClips[_loc2_].setSelected(_loc2_ == this.getSelectedEntryIndex());
this.m_entryClips[_loc2_]._y = this.m_contentHeight;
this.m_contentHeight += this.m_entryClips[_loc2_].getHeight() + this.m_vPadding;
_loc2_ = _loc2_ + 1;
}
_loc2_ = _loc7_ - 1;
while(_loc2_ >= this.m_numTotalEntries)
{
this.m_entryClips[_loc2_].removeMovieClip();
this.m_entryClips.pop();
_loc2_ = _loc2_ - 1;
}
this.OnScrollbarThumbUpdate(_loc8_);
this.m_clipAnchor._x = 0;
this.m_clipAnchor._y = - this.m_scrollHeight;
}
function shutdown()
{
if(this.m_scrollbarController != null)
{
this.m_scrollbarController.removeListener(this);
}
var _loc2_ = 0;
while(_loc2_ < this.m_numTotalEntries)
{
this.m_entryClips[_loc2_].removeListener(this);
this.m_entryClips[_loc2_].shutdown();
_loc2_ = _loc2_ + 1;
}
}
function setColumnData(column, data)
{
if(column >= 0 && column < this.m_dataColumnCount)
{
var _loc4_ = this.m_dataArrays[column];
_loc4_.splice(0,_loc4_.length);
var _loc2_ = 0;
while(_loc2_ < data.length)
{
_loc4_[_loc2_] = data[_loc2_];
_loc2_ = _loc2_ + 1;
}
}
}
function clear()
{
var _loc2_ = 0;
while(_loc2_ < this.m_numTotalEntries)
{
this.m_entryClips[_loc2_].removeListener(this);
this.m_entryClips[_loc2_].clear();
this.m_entryClips[_loc2_].shutdown();
this.m_entryClips[_loc2_].removeMovieClip();
_loc2_ = _loc2_ + 1;
}
this.m_entryClips = new Array();
this.m_numTotalEntries = 0;
this.m_scrollHeight = this.m_contentHeight = 0;
this.refreshScrollbar();
var _loc3_ = 0;
while(_loc3_ < this.m_dataColumnCount)
{
this.m_dataArrays[_loc3_] = new Array();
_loc3_ = _loc3_ + 1;
}
}
function clearEntryHighlights()
{
var _loc2_ = 0;
while(_loc2_ < this.m_numTotalEntries)
{
this.m_entryClips[_loc2_].setHighlighted(false);
_loc2_ = _loc2_ + 1;
}
}
function attachScrollbarController(controller)
{
if(this.m_scrollbarController != null)
{
trace("std_mouseDynamicList::attachScrollbarController(), Warning: trying to attach a scrollbar controller when one is already attached.");
this.m_scrollbarController.removeListener(this);
}
this.m_scrollbarController = std_mouseScrollbar_visual(controller);
this.m_scrollbarController.addListener(this);
this.m_scrollbarController._x = this._x + this.m_renderWidth - this.m_scrollbarController.getWidth();
this.m_scrollbarController._y = this._y;
this.m_scrollbarController.setSize(this.m_renderHeight);
this.m_scrollbarController.enable();
}
function getElementData(column, row)
{
return this.m_dataArrays[column][row];
}
function refreshScrollbar()
{
if(this.m_scrollbarController != undefined)
{
if(this.m_contentHeight <= this.m_renderHeight)
{
this.m_scrollbarController._visible = false;
this.m_scrollbarController.setInfo(0,0,0);
this.m_scrollHeight = 0;
}
else
{
this.m_scrollbarController._visible = true;
this.m_scrollbarController.setInfo(0,this.m_contentHeight - this.m_renderHeight,this.m_scrollHeight);
}
}
}
function setSelectedIndex(index)
{
if(this.isValidIndex(index) || index == std_mouseScrollingListbox.NO_SELECTION)
{
this.m_selectedIndex = index;
this.refreshDisplay();
}
return this.m_selectedIndex;
}
function scrollViewUp()
{
if(this.m_selectedIndex != std_mouseScrollingListbox.NO_SELECTION)
{
this.m_scrollHeight -= this.m_entryClips[this.m_selectedIndex].getHeight() + this.m_vPadding;
}
else
{
this.m_scrollHeight -= 10;
}
if(this.m_scrollHeight < 0)
{
this.m_scrollHeight = 0;
}
this.m_clipAnchor._x = 0;
this.m_clipAnchor._y = - this.m_scrollHeight;
this.refreshScrollbar();
}
function scrollViewDown()
{
if(this.m_scrollHeight == undefined)
{
this.m_scrollHeight = 0;
}
if(this.m_selectedIndex != std_mouseScrollingListbox.NO_SELECTION)
{
this.m_scrollHeight += this.m_entryClips[this.m_selectedIndex].getHeight() + this.m_vPadding;
}
else
{
this.m_scrollHeight += 10;
}
if(this.m_scrollHeight > this.m_contentHeight - this.m_renderHeight)
{
this.m_scrollHeight = this.m_contentHeight - this.m_renderHeight;
}
this.m_clipAnchor._x = 0;
this.m_clipAnchor._y = - this.m_scrollHeight;
this.refreshScrollbar();
}
function moveViewToFirst()
{
this.m_scrollHeight = 0;
this.m_clipAnchor._x = 0;
this.m_clipAnchor._y = - this.m_scrollHeight;
this.refreshScrollbar();
}
function moveViewToLast()
{
if(this.m_contentHeight > this.m_renderHeight)
{
this.m_scrollHeight = this.m_contentHeight - this.m_renderHeight;
this.m_clipAnchor._x = 0;
this.m_clipAnchor._y = - this.m_scrollHeight;
this.refreshScrollbar();
}
}
function setNumEntries(numEntries)
{
this.m_numVisibleEntries = numEntries;
}
function getNumEntries(numEntries)
{
return this.m_numVisibleEntries;
}
function setVerticalPadding(vPadding)
{
this.m_vPadding = vPadding;
}
function getTotalWidth()
{
return this.background._width;
}
function getWidth()
{
return this.m_renderWidth;
}
function getHeight()
{
return this.m_renderHeight;
}
function setRenderSize(renderHeight, renderWidth)
{
this.m_renderHeight = renderHeight;
this.m_renderWidth = renderWidth;
}
function getSelectedEntryIndex()
{
return this.m_selectedIndex;
}
function disableEntryHitRegion()
{
this.m_useEntryHitRegion = false;
}
function addListener(listener)
{
this.m_eventListeners.push(listener);
}
function addListenerFunction(listener)
{
this.m_eventListenerFns.push(listener);
}
function removeListener(listener)
{
while(this.removeAllInstancesOfListener(listener))
{
}
}
function removeListenerFunction(listener)
{
while(this.removeAllInstancesOfListenerFunction(listener))
{
}
}
function createEntryClip(index, xPos, yPos, entryElementInfo, entryHeight)
{
var _loc2_ = this.m_clipAnchor.attachMovie("std_mouseScrollingListboxEntrySymbol","listboxEntity" + String(index),std_mouseScrollingListbox.ATTACHMOVIE_BASE_LEVEL + index);
if(this.m_alternateBackgroundColors)
{
var _loc3_ = undefined;
if(index % 2 == 0)
{
_loc3_ = this.m_backgroundColor1;
}
else
{
_loc3_ = this.m_backgroundColor2;
}
_loc2_.setBackgroundColor(_loc3_);
}
_loc2_.init(index,entryElementInfo,entryHeight,this.m_useEntryHitRegion,this.m_alternateBackgroundColors);
_loc2_._x = xPos;
_loc2_._y = yPos;
_loc2_.addListener(this);
return _loc2_;
}
function OnChildMouseEnterEvent(entry)
{
var _loc2_ = 0;
while(_loc2_ < this.m_eventListeners.length)
{
this.m_eventListeners[_loc2_].OnListboxEntryMouseEnter(entry);
_loc2_ = _loc2_ + 1;
}
}
function OnChildMouseExitEvent(entry)
{
var _loc2_ = 0;
while(_loc2_ < this.m_eventListeners.length)
{
this.m_eventListeners[_loc2_].OnListboxEntryMouseExit(entry);
_loc2_ = _loc2_ + 1;
}
}
function OnMouseEnter()
{
this.m_mousePresence = this.m_mousePresence + 1;
_global.highlightedComponent = this;
this.realizeHighlightState();
}
function OnMouseExit()
{
this.m_mousePresence = this.m_mousePresence - 1;
if(_global.highlightedComponent == this)
{
_global.highlightedComponent = undefined;
}
if(this.m_mousePresence == 0)
{
this.realizeHighlightState();
}
}
function configureBackgroundButton()
{
var _loc2_ = this.m_renderWidth + this.m_backgroundMargin * 2;
var _loc3_ = this.m_renderHeight + this.m_backgroundMargin * 2;
this.background._xscale = _loc2_;
this.background._yscale = _loc3_;
this.background._x = - this.m_backgroundMargin;
this.background._y = - this.m_backgroundMargin;
}
function realizeHighlightState()
{
if(this.m_mousePresence > 0)
{
this.highlight();
}
else
{
this.unhighlight();
this.m_mousePresence = 0;
}
}
function getMaximumIndex()
{
return this.getGreatestColumnDataCount() - 1;
}
function getGreatestColumnDataCount()
{
var _loc3_ = 0;
var _loc2_ = 0;
while(_loc2_ < this.m_dataColumnCount)
{
_loc3_ = Math.max(_loc3_,this.m_dataArrays[_loc2_].length);
_loc2_ = _loc2_ + 1;
}
return _loc3_;
}
function isValidIndex(index)
{
return index >= 0 && index <= this.getMaximumIndex();
}
function removeAllInstancesOfListener(listener)
{
var _loc2_ = 0;
while(_loc2_ < this.m_eventListeners.length)
{
if(this.m_eventListeners[_loc2_] == listener)
{
this.m_eventListeners[_loc2_] = null;
this.m_eventListeners.splice(_loc2_,1);
return true;
}
_loc2_ = _loc2_ + 1;
}
return false;
}
function removeAllInstancesOfListenerFunction(listener)
{
var _loc2_ = 0;
while(_loc2_ < this.m_eventListenerFns.length)
{
if(this.m_eventListenerFns[_loc2_] == listener)
{
this.m_eventListenerFns[_loc2_] = null;
this.m_eventListenerFns.splice(_loc2_,1);
return true;
}
_loc2_ = _loc2_ + 1;
}
return false;
}
function broadcastOnListboxIndexMouseClick(newIndex, previouslySelectedIndex)
{
var _loc2_ = 0;
while(_loc2_ < this.m_eventListeners.length)
{
this.m_eventListeners[_loc2_].OnListboxIndexMouseClick(newIndex,previouslySelectedIndex);
_loc2_ = _loc2_ + 1;
}
_loc2_ = 0;
while(_loc2_ < this.m_eventListenerFns.length)
{
this.m_eventListenerFns.register2(newIndex,previouslySelectedIndex);
_loc2_ = _loc2_ + 1;
}
}
function broadcastOnListboxIndexElementMouseClick(index, element, previouslySelectedIndex)
{
var _loc2_ = 0;
while(_loc2_ < this.m_eventListeners.length)
{
this.m_eventListeners[_loc2_].OnListboxIndexElementMouseClick(index,element,previouslySelectedIndex);
_loc2_ = _loc2_ + 1;
}
}
}
@@ -0,0 +1,271 @@
class std_mouseScrollingListboxEntry extends MovieClip implements IListboxEntryElementEventListener
{
static var ATTACHMOVIE_BASE_LEVEL = 500;
function std_mouseScrollingListboxEntry()
{
super();
this.m_currentWidth = 0;
this.m_mousePresence = 0;
this.m_eventListeners = new Array();
this.m_useHighlights = true;
this.m_isSelectable = true;
this.m_useHitRegion = true;
this.m_useBackgroundColor = false;
}
function OnListboxEntryElementMouseEnter(element)
{
this.OnMouseEnter();
}
function OnListboxEntryElementMouseExit(element)
{
this.OnMouseExit();
}
function OnListboxEntryElementMouseClick(element)
{
this.broadcastOnListboxEntryElementMouseClick(this.m_index,element);
this.broadcastOnListboxEntryMouseClick(this.m_index);
}
function init(index, elementInfo, entryHeight, useHitRegion, useBackgroundColor)
{
this.m_index = index;
this.m_currentHeight = entryHeight;
this.m_currentWidth = 0;
this.m_elementList = new Array(elementInfo.length);
var _loc2_ = 0;
while(_loc2_ < this.m_elementList.length)
{
this.m_currentWidth += elementInfo[_loc2_].leftMargin;
var _loc4_ = this.attachMovie(elementInfo[_loc2_].symbol,"element" + String(_loc2_),std_mouseScrollingListboxEntry.ATTACHMOVIE_BASE_LEVEL + _loc2_);
_loc4_.init(_loc2_,elementInfo[_loc2_].width,entryHeight,elementInfo.useHitRegion);
_loc4_._x = this.m_currentWidth;
_loc4_._y = 0;
_loc4_.addListener(this);
this.m_currentWidth += elementInfo[_loc2_].width + elementInfo[_loc2_].rightMargin;
this.m_elementList[_loc2_] = _loc4_;
this.m_elementList[_loc2_].setVisualProperties(elementInfo[_loc2_]);
if(elementInfo[_loc2_].useHighlights == false)
{
this.m_useHighlights = false;
}
if(elementInfo[_loc2_].isSelectable == false)
{
this.m_isSelectable = false;
}
_loc2_ = _loc2_ + 1;
}
this.setHighlighted(false);
if(useHitRegion == false || this.m_useHighlights == false && this.m_isSelectable == false)
{
this.m_useHitRegion = false;
}
if(this.m_useHitRegion == true)
{
this.hitRegion._width = this.highlightMC._width = this.getWidth();
this.hitRegion._height = this.highlightMC._height = entryHeight;
this.hitRegion.onPress = this.bind0(this,this.OnMouseClick);
this.hitRegion.onRollOver = this.hitRegion.onDragOver = this.bind0(this,this.OnMouseEnter);
this.hitRegion.onRollOut = this.hitRegion.onDragOut = this.bind0(this,this.OnMouseExit);
}
else
{
this.hitRegion.removeMovieClip();
this.highlightMC.removeMovieClip();
}
if(useBackgroundColor == true)
{
this.backgroundMC._width = this.getWidth();
this.backgroundMC._height = entryHeight;
this.m_useBackgroundColor = true;
}
else
{
this.backgroundMC.removeMovieClip();
}
}
function shutdown()
{
var _loc2_ = 0;
while(_loc2_ < this.m_elementList.length)
{
this.m_elementList[_loc2_].removeListener(this);
this.m_elementList[_loc2_].shutdown();
_loc2_ = _loc2_ + 1;
}
}
function clear()
{
var _loc2_ = 0;
while(_loc2_ < this.m_elementList.length)
{
this.m_elementList[_loc2_].clear();
_loc2_ = _loc2_ + 1;
}
if(this.m_useHitRegion == true)
{
this.hitRegion._width = this.highlightMC._width = 0;
this.hitRegion._height = this.highlightMC._height = 0;
}
}
function getWidth()
{
return this.m_currentWidth;
}
function getHeight()
{
return this.m_currentHeight;
}
function setElementData(column, data)
{
if(column >= 0 && column < this.m_elementList.length)
{
this.m_elementList[column].setData(data);
}
var _loc3_ = 0;
var _loc2_ = 0;
while(_loc2_ < this.m_elementList.length)
{
_loc3_ = Math.max(_loc3_,this.m_elementList[_loc2_]._height);
_loc2_ = _loc2_ + 1;
}
this.m_currentHeight = Math.floor(_loc3_);
if(this.m_useHitRegion == true)
{
this.hitRegion._width = this.highlightMC._width = this.getWidth();
this.hitRegion._height = this.highlightMC._height = this.getHeight();
}
if(this.m_useBackgroundColor == true)
{
this.backgroundMC._width = this.getWidth();
this.backgroundMC._height = this.getHeight();
}
}
function setHighlighted(highlighted)
{
if(this.m_useHighlights)
{
if(highlighted)
{
this.highlightMC.gotoAndPlay("_highlight");
}
else
{
this.highlightMC.gotoAndPlay("_unhighlight");
this.m_mousePresence = 0;
}
}
}
function setSelected(selected)
{
if(this.m_isSelectable)
{
var _loc2_ = 0;
while(_loc2_ < this.m_elementList.length)
{
this.m_elementList[_loc2_].setSelected(selected);
_loc2_ = _loc2_ + 1;
}
}
}
function realizeHighlightState()
{
if(this.m_mousePresence > 0)
{
this.setHighlighted(true);
}
else
{
this.setHighlighted(false);
this.m_mousePresence = 0;
}
}
function setBackgroundColor(color)
{
var _loc2_ = new Color(this.backgroundMC);
_loc2_.setRGB(color);
}
function addListener(listener)
{
this.m_eventListeners.push(listener);
}
function removeListener(listener)
{
while(this.removeAllInstancesOfListener(listener))
{
}
}
function OnMouseEnter()
{
this.m_mousePresence = this.m_mousePresence + 1;
this.broadcastOnListboxEntryMouseEnter(this.m_index);
}
function OnMouseExit()
{
this.m_mousePresence = this.m_mousePresence - 1;
if(this.m_mousePresence == 0)
{
this.broadcastOnListboxEntryMouseExit(this.m_index);
}
}
function OnMouseClick()
{
this.broadcastOnListboxEntryMouseClick(this.m_index);
}
function removeAllInstancesOfListener(listener)
{
var _loc2_ = 0;
while(_loc2_ < this.m_eventListeners.length)
{
if(this.m_eventListeners[_loc2_] == listener)
{
this.m_eventListeners[_loc2_] = null;
this.m_eventListeners.splice(_loc2_,1);
return true;
}
_loc2_ = _loc2_ + 1;
}
return false;
}
function bind0(o, f)
{
return function()
{
f.call(o);
};
}
function broadcastOnListboxEntryMouseEnter(entry)
{
var _loc2_ = 0;
while(_loc2_ < this.m_eventListeners.length)
{
this.m_eventListeners[_loc2_].OnListboxEntryMouseEnter(entry);
_loc2_ = _loc2_ + 1;
}
}
function broadcastOnListboxEntryMouseExit(entry)
{
var _loc2_ = 0;
while(_loc2_ < this.m_eventListeners.length)
{
this.m_eventListeners[_loc2_].OnListboxEntryMouseExit(entry);
_loc2_ = _loc2_ + 1;
}
}
function broadcastOnListboxEntryMouseClick(entry)
{
var _loc2_ = 0;
while(_loc2_ < this.m_eventListeners.length)
{
this.m_eventListeners[_loc2_].OnListboxEntryMouseClick(entry);
_loc2_ = _loc2_ + 1;
}
}
function broadcastOnListboxEntryElementMouseClick(entry, element)
{
var _loc2_ = 0;
while(_loc2_ < this.m_eventListeners.length)
{
this.m_eventListeners[_loc2_].OnListboxEntryElementMouseClick(entry,element);
_loc2_ = _loc2_ + 1;
}
}
}
@@ -0,0 +1,125 @@
class std_mouseSlider_logic extends Cafe2_MouseBaseControl implements ICafe2_FocusableControl
{
function std_mouseSlider_logic()
{
super();
trace("std_mouseSlider_logic::std_mouseSlider_logic() this=" + this);
if(this.m_focusDirs == undefined)
{
this.m_focusDirs = Cafe2_Imp_BaseControl.FOCUS_DIR_UD;
}
if(this.m_nMin == undefined || this.m_nMax == undefined || this.m_nValue == undefined || this.m_bWrapEnabled == undefined || this.m_bSnapEnabled == undefined || this.m_nStep == undefined)
{
trace("std_mouseSlider_logic::std_mouseSlider_logic() WARNING: invalid component properties - " + this);
}
this.m_index = new CafeFW_IndexMgr();
this.m_index.SetInfo(this.m_nValue,this.m_nMin,this.m_nMax,this.m_nStep,this.m_bWrapEnabled,this.m_bSnapEnabled);
}
function logic_init()
{
this.setOnInput(INPUTCODE.RIGHT,this.nextValue,this);
this.setOnInput(INPUTCODE.LEFT,this.prevValue,this);
updateDisplay(this.m_index.GetIndex());
}
function setValue(n)
{
trace("std_mouseSlider_logic::setValue() Value: " + String(n));
n = Math.round(n);
var _loc3_ = this.m_index.SetIndex(n) != CafeFW_IndexMgr.TIBINDEX_CHANGE_NONE;
if(_loc3_)
{
this.updateDisplay(this.m_index.GetIndex());
}
return _loc3_;
}
function setValueAndCallback(n)
{
trace("std_mouseSlider_logic::setValueAndCallback() Value: " + String(n));
n = Math.round(n);
var _loc3_ = this.m_index.SetIndex(n) != CafeFW_IndexMgr.TIBINDEX_CHANGE_NONE;
if(_loc3_)
{
this.updateDisplay(this.m_index.GetIndex());
this.m_onChangeFunc(this,this.getValue());
}
return _loc3_;
}
function getValue()
{
return this.m_index.GetIndex();
}
function nextValue(thisMC)
{
trace("std_mouseSlider_logic::nextValue() this=" + this);
if(this.isEnabled() && this.m_index.IncIndex() != CafeFW_IndexMgr.TIBINDEX_CHANGE_NONE)
{
this.updateDisplay(this.m_index.GetIndex());
this.onNext();
this.m_onChangeFunc(this,this.getValue());
}
}
function prevValue()
{
trace("std_mouseSlider_logic::prevValue() this=" + this);
if(this.isEnabled() && this.m_index.DecIndex() != CafeFW_IndexMgr.TIBINDEX_CHANGE_NONE)
{
this.updateDisplay(this.m_index.GetIndex());
this.onPrevious();
this.m_onChangeFunc(this,this.getValue());
}
}
function setIndexRange(min, max, current)
{
trace("std_mouseSlider_logic::setIndexRange() Min: " + min + " Max: " + max + " Current: " + current);
this.m_nMin = min;
this.m_nMax = max;
this.m_index.SetInfo(current,min,max,this.m_nStep,this.m_bWrapEnabled,this.m_bSnapEnabled);
trace("std_mouseSlider_logic::setIndexRange() New Index is: " + this.m_index.GetIndex());
this.updateDisplay(this.m_index.GetIndex());
}
function setIndexInfo(enableWrap, stepSize, enableSnap)
{
this.m_bWrapEnabled = enableWrap;
this.m_nStep = stepSize;
this.m_bSnapEnabled = enableSnap;
this.m_index.SetInfo(this.m_index.GetIndex(),this.m_nMin,this.m_nMax,this.m_nStep,this.m_bWrapEnabled,this.m_bSnapEnabled);
}
static function defaultInitObject()
{
var _loc1_ = Cafe2_Imp_BaseControl.defaultInitObject();
_loc1_.m_focusDirs = Cafe2_Imp_BaseControl.FOCUS_DIR_UD;
_loc1_.m_nMin = 0;
_loc1_.m_nMax = 100;
_loc1_.m_nValue = 0;
_loc1_.m_bWrapEnabled = false;
_loc1_.m_bSnapEnabled = false;
_loc1_.m_nStep = 1;
return _loc1_;
}
function highlight()
{
if(this.isEnabled())
{
this.visual_highlight();
}
}
function unhighlight()
{
if(this.isEnabled())
{
this.visual_unhighlight();
}
}
function enableGUI()
{
this.visual_enableGUI();
}
function disableGUI()
{
this.visual_disableGUI();
}
function setOnDragUpdate(fn)
{
this.m_onDragUpdateFunc = fn;
}
}
@@ -0,0 +1,364 @@
class std_mouseSlider_visual extends std_mouseSlider_logic
{
static var m_tickCount = 23;
var DEC_ARROW = 0;
var INC_ARROW = 1;
var SLIDER_BASE = 2;
var m_audioSFX = "";
static var MAX_TICKS = 24;
static var CONTENT_DEPTH = 100;
function std_mouseSlider_visual()
{
super();
trace("std_mouseSlider_visual::std_mouseSlider_visual() this._name=" + this._name);
this.m_type = "std_mouseSlider_visual";
this.visual_init();
}
static function defaultInitObject()
{
var _loc1_ = std_slider_logic.defaultInitObject();
_loc1_.m_label = "Slider Label";
_loc1_.m_labelOffsetX = 200;
return _loc1_;
}
static function createDynamic(container_, name_, level_, initObject_)
{
return std_mouseSlider_visual(container_.attachMovie("Standard Slider",name_,level_,initObject_));
}
function visual_init()
{
trace("std_mouseSlider_visual::init() this._name=" + this._name);
this.loadContentClip();
this.setFontFormat(std_config.slider_textFormat);
this.setLabelPosition(this.m_labelOffsetX);
this.setLabel(this.m_label);
this.setValue(this.getValue());
this.m_contentClip.decrementArrowHR.onRollOver = this.bind0(this,this.mouseEventDecrementButtonRollOver);
this.m_contentClip.decrementArrowHR.onRollOut = this.bind0(this,this.mouseEventDecrementButtonRollOut);
this.m_contentClip.decrementArrowHR.onPress = this.bind0(this,this.mouseEventDecrementButtonPress);
this.m_contentClip.decrementArrowHR.onReleaseOutside = this.bind0(this,this.mouseEventDecrementButtonRollOut);
this.m_contentClip.incrementArrowHR.onRollOver = this.bind0(this,this.mouseEventIncrementButtonRollOver);
this.m_contentClip.incrementArrowHR.onRollOut = this.bind0(this,this.mouseEventIncrementButtonRollOut);
this.m_contentClip.incrementArrowHR.onPress = this.bind0(this,this.mouseEventIncrementButtonPress);
this.m_contentClip.incrementArrowHR.onReleaseOutside = this.bind0(this,this.mouseEventIncrementButtonRollOut);
this.m_contentClip.center.hitRegion.onRollOver = this.bind0(this,this.mouseEventCenterRollOver);
this.m_contentClip.center.hitRegion.onRollOut = this.bind0(this,this.mouseEventCenterRollOut);
this.m_contentClip.center.hitRegion.onPress = this.bind0(this,this.mouseEventCenterPress);
this.m_contentClip.center.hitRegion.onReleaseOutside = this.bind0(this,this.mouseEventCenterRollOut);
this.m_contentClip.thumb.hitRegion.onReleaseOutside = this.bind0(this,this.mouseEventThumbRelease);
this.m_contentClip.thumb.hitRegion.onPress = this.bind0(this,this.mouseEventThumbPress);
this.m_contentClip.thumb.hitRegion.onRelease = this.bind0(this,this.mouseEventThumbRelease);
this.m_contentClip.sliderBG.onRollOver = this.bind0(this,this.mouseEventBackgroundRollOver);
this.m_contentClip.sliderBG.onRollOut = this.bind0(this,this.mouseEventBackgroundRollOut);
this.commonInit();
}
function loadContentClip()
{
trace("std_mouseSlider_visual::loadContentClip() Make a mc from the following symbol " + this.m_contentSymbol);
trace("std_mouseSlider_visual::loadContentClip() Make a movieclip at the following CONTENT_DEPTH " + std_mouseSlider_visual.CONTENT_DEPTH);
trace("std_mouseSlider_visual::loadContentClip() this: " + this);
this.m_contentClip = this.attachMovie(this.m_contentSymbol,"contentClip",std_mouseSlider_visual.CONTENT_DEPTH);
trace("std_mouseSlider_visual::loadContentClip() Contentclip: " + this.m_contentClip);
}
function audioSFXState(newState)
{
this.m_playAudio = newState;
}
function getAudioSFXState()
{
return this.m_playAudio;
}
function setAudioSFX(newAudioSFX)
{
this.m_audioSFX = newAudioSFX;
}
function setFontFormat(newTextFormat)
{
this.m_contentClip.labelStatesMC.labelMC.labelTF.setNewTextFormat(newTextFormat);
this.m_contentClip.labelStatesMC.labelMC.labelTF.setTextFormat(newTextFormat);
}
function setLabel(str)
{
this.m_label = str;
trace("std_mouseSlider_visual::setLabel() this.m_label=" + this.m_label);
this.m_contentClip.labelStatesMC.labelMC.labelTF.text = this.m_label;
}
function setLabelPosition(nOffsetX)
{
trace("std_mouseSlider_visual::setLabelPosition() nOffsetX == " + nOffsetX);
this.m_labelOffsetX = nOffsetX;
this.m_contentClip.labelStatesMC._x = - Math.abs(this.m_labelOffsetX);
}
function onNext()
{
trace("std_mouseSlider_visual::onNext() m_playAudio == " + this.m_playAudio);
if(this.isEnabled())
{
this.m_contentClip.arrowRightMC.gotoAndPlay("_toggle");
if(this.m_playAudio)
{
_global.playSound(this.m_audioSFX);
}
}
}
function onPrevious()
{
trace("std_mouseSlider_visual::onPrevious() m_playAudio == " + this.m_playAudio);
if(this.isEnabled())
{
this.m_contentClip.arrowLeftMC.gotoAndPlay("_toggle");
if(this.m_playAudio)
{
_global.playSound(this.m_audioSFX);
}
}
}
function updateDisplay(val)
{
trace("std_mouseSlider_visual::updateDisplay() val = " + val);
var _loc2_ = this.updateTicks(val);
_loc2_ = _loc2_ <= 0 ? 1 : _loc2_;
var _loc3_ = this.m_contentClip.center["tick" + String(_loc2_)]._x + this.m_contentClip.center._x;
this.m_contentClip.thumb._x = _loc3_;
}
function updateTicks(val)
{
trace("std_mouseSlider_visual::updateTicks() val = " + val);
var _loc6_ = this.m_index.GetMinIndex();
var _loc8_ = this.m_index.GetMaxIndex();
var _loc5_ = Math.abs(_loc8_ - _loc6_);
if(_loc5_ == 0)
{
_loc5_ = 1;
}
val -= _loc6_;
var _loc4_ = Math.round(val * std_mouseSlider_visual.m_tickCount / _loc5_);
if(_loc4_ > std_mouseSlider_visual.m_tickCount)
{
_loc4_ = std_mouseSlider_visual.m_tickCount;
}
var _loc3_ = 1;
while(_loc3_ < std_mouseSlider_visual.MAX_TICKS)
{
this.m_contentClip.center["tick" + String(_loc3_)].innerMC.gotoAndPlay("_off");
_loc3_ = _loc3_ + 1;
}
var _loc2_ = _loc4_;
while(_loc2_ > 0)
{
this.m_contentClip.center["tick" + String(_loc2_)].innerMC.gotoAndPlay("_on");
_loc2_ = _loc2_ - 1;
}
return _loc4_;
}
function visual_highlight()
{
this.m_contentClip.gotoAndPlay("_selected");
}
function visual_unhighlight()
{
this.m_contentClip.gotoAndPlay("_unselected");
}
function visual_enableGUI()
{
this.restoreVisualState();
}
function visual_disableGUI()
{
this.m_contentClip.gotoAndPlay("_disable");
}
function restoreVisualState()
{
trace("std_mouseSlider_visual::restoreVisualState()");
if(this.isEnabled())
{
if(this.isSelected())
{
this.m_contentClip.gotoAndPlay("_selected");
}
else
{
this.m_contentClip.gotoAndPlay("_unselected");
}
if(this.m_contentClip.arrowLeftHR.m_isMouseOver)
{
this.mouseEventDecrementButtonRollOver();
}
else
{
this.mouseEventDecrementButtonRollOut();
}
if(this.m_contentClip.arrowRightHR.m_isMouseOver)
{
this.mouseEventIncrementButtonRollOver();
}
else
{
this.mouseEventIncrementButtonRollOut();
}
if(this.m_contentClip.center.hitRegion.m_isMouseOver)
{
this.mouseEventCenterRollOver();
}
else
{
this.mouseEventThumbRollOut();
}
this.updateDisplay(this.m_index.GetIndex());
}
else
{
this.visual_disableGUI();
}
}
function positionToValue(position)
{
position = Math.min(this.m_contentClip.center._width,Math.max(0,position));
var _loc2_ = undefined;
_loc2_ = (this.m_nMax - this.m_nMin) / this.m_contentClip.center._width * position + this.m_nMin;
return _loc2_;
}
function trackThumb()
{
var _loc3_ = this.m_contentClip._xmouse;
var _loc4_ = this.m_contentClip.center._x + this.m_contentClip.center._width;
var _loc2_ = this.m_contentClip.center._x;
this.m_contentClip.thumb._x = Math.max(_loc2_,Math.min(_loc3_,_loc4_));
this.updateTicks(this.positionToValue(this.m_contentClip.thumb._x - _loc2_));
this.setValue(this.positionToValue(this.m_contentClip.center._xmouse));
this.m_onDragUpdateFunc(this,this.getValue());
}
function mouseEventDecrementButtonRollOver()
{
trace("std_mouseSlider_visual::mouseEventDecrementButtonRollOver()");
if(this.isEnabled())
{
this.m_contentClip.arrowLeftMC.gotoAndPlay("_rollover");
}
}
function mouseEventDecrementButtonRollOut()
{
trace("std_mouseSlider_visual::mouseEventDecrementButtonRollOut()");
if(this.isEnabled())
{
this.m_contentClip.arrowLeftMC.gotoAndPlay("_rollout");
}
}
function mouseEventDecrementButtonPress()
{
trace("std_mouseSlider_visual::mouseEventDecrementButtonPress()" + this);
this.m_objFM.setFocusToControl(this);
this.prevValue();
}
function mouseEventIncrementButtonRollOver()
{
trace("std_mouseSlider_visual::mouseEventIncrementButtonRollOver() " + this);
if(this.isEnabled())
{
this.m_contentClip.arrowRightMC.gotoAndPlay("_rollover");
}
}
function mouseEventIncrementButtonRollOut()
{
trace("std_mouseSlider_visual::mouseEventIncrementButtonRollOut()" + this);
if(this.isEnabled())
{
this.m_contentClip.arrowRightMC.gotoAndPlay("_rollout");
}
}
function mouseEventIncrementButtonPress()
{
trace("std_mouseSlider_visual::mouseEventIncrementButtonPress()");
this.m_objFM.setFocusToControl(this);
this.nextValue();
}
function mouseEventCenterRollOver()
{
trace("std_mouseSlider_visual::mouseEventCenterRollOver()");
}
function mouseEventCenterRollOut()
{
trace("std_mouseSlider_visual::mouseEventCenterRollOut()");
}
function mouseEventCenterPress()
{
trace("std_mouseSlider_visual::mouseEventCenterPress() ");
var _loc2_ = this.m_contentClip._xmouse - this.m_contentClip.center._x;
var _loc3_ = this.m_contentClip.thumb._x - this.m_contentClip.center._x;
var _loc4_ = this.m_contentClip.center._width * this.mIndex.GetStepSize() / (this.mIndex.GetMaxIndex() - this.mIndex.GetMinIndex());
trace("std_mouseSlider_visual::mouseEventCenterPress() Mouse X: " + _loc2_ + " Thumb X: " + _loc3_);
if(this.isEnabled() && _loc2_ != _loc3_)
{
this.m_objFM.setFocusToControl(this);
newPosition = (_loc2_ - _loc3_) / 2 + _loc3_;
if(Math.abs(newPosition - _loc2_) < _loc4_)
{
newPosition = _loc2_;
}
trace("std_mouseSlider_visual::mouseEventCenterPress() New position: " + newPosition);
this.setValueAndCallback(this.positionToValue(newPosition));
}
}
function mouseEventThumbPress()
{
trace("std_mouseSlider_visual::mouseEventThumbPress() ");
if(this.isEnabled())
{
this.m_objFM.setFocusToControl(this);
var _loc2_ = this.m_contentClip.center._x;
var _loc3_ = this.m_contentClip.center._y;
trace("std_mouseSlider_visual::mouseEventThumbPress() left is: " + _loc2_ + " center._width is: " + this.m_contentClip.center._width);
var _loc5_ = _loc2_ + this.m_contentClip.center._width;
var _loc4_ = _loc3_;
this.onEnterFrame = this.trackThumb;
}
}
function mouseEventThumbRelease()
{
trace("std_mouseSlider_visual::mouseEventThumbRelease() ");
this.onEnterFrame = null;
if(this.isEnabled())
{
if(this.setValue(this.positionToValue(this.m_contentClip.center._xmouse)) == false)
{
this.updateDisplay(this.m_index.GetIndex());
}
this.m_onChangeFunc(this,this.getValue());
}
}
function mouseEventBackgroundRollOver()
{
if(this.isEnabled())
{
_global.highlightedComponent = this;
}
}
function mouseEventBackgroundRollOut()
{
if(_global.highlightedComponent == this)
{
_global.highlightedComponent = undefined;
}
}
function onMousewheelScroll(spins)
{
if(!this.isEnabled())
{
return undefined;
}
var _loc3_ = Math.abs(spins);
var _loc2_ = 0;
while(_loc2_ < _loc3_)
{
if(spins < 0)
{
this.prevValue();
}
else
{
this.nextValue();
}
_loc2_ = _loc2_ + 1;
}
}
}
@@ -0,0 +1,137 @@
class std_mouseTextInputField extends Cafe2_MouseBaseControl implements ICafe2_FocusableControl
{
function std_mouseTextInputField()
{
super();
this.m_type = "std_mouseTextInputField";
}
static function getContentsById(fieldId)
{
var _loc1_ = new Object();
// Checked
loadVariables("QueryGameEngine?TEXT_INPUT_FIELD_CONTENTS?ID=" + String(fieldId),_loc1_);
var _loc2_ = String(_loc1_.TEXT_INPUT_FIELD_CONTENTS);
return _loc2_;
}
static function getNextTextInputFieldID()
{
var _loc1_ = new Object();
// Checked
loadVariables("QueryGameEngine?NEXT_TEXT_INPUT_FIELD_ID",_loc1_);
return Number(_loc1_.NEXT_TEXT_INPUT_FIELD_ID);
}
function setWidth(newWidth)
{
this.TextFieldMC.dataTF._width = newWidth;
this.TextFieldMC.BGImgMiddle._x = this.TextFieldMC.BGImgLeft._width;
this.TextFieldMC.BGImgMiddle._width = newWidth - this.TextFieldMC.BGImgRight._width - this.TextFieldMC.BGImgLeft._width;
this.TextFieldMC.BGImgRight._x = newWidth - this.TextFieldMC.BGImgRight._width;
this.hitRegion._width = newWidth;
}
function onLoad()
{
this.m_textFieldID = std_mouseTextInputField.getNextTextInputFieldID();
var _loc3_ = !this.m_password ? "0" : "1";
var _loc4_ = !m_allowHorzScroll ? "0" : "1";
// Checked
getURL("FSCommand:CallGameFunction","%CreateTextInputField?Name=" + this + "|ID=" + this.m_textFieldID + "|Password=" + _loc3_ + "|CharLimit=" + m_charLimit + "|AllowScroll=" + _loc4_);
this.TextFieldMC.dataTF.text = "$EDITABLE_TEXT_" + this.m_textFieldID;
this.TextFieldMC.dataTF.setTextFormat(_global.std_config.textBox_textFormat_unhighlight);
hitRegion.onRollOver = this.bind0(this,this.mouseEventTextFieldRollover);
hitRegion.onRollOut = this.bind0(this,this.mouseEventTextFieldRollOut);
hitRegion.onPress = this.bind0(this,this.mouseEventTextFieldPress);
hitRegion.onRelease = this.bind0(this,this.mouseEventTextFieldRelease);
hitRegion.onReleaseOutside = this.bind0(this,this.mouseEventTextFieldReleaseOutside);
this.setWidth(m_width);
this.commonInit();
}
function onUnload()
{
// Checked
getURL("FSCommand:CallGameFunction","%BlurTextInputField?ID=" + this.m_textFieldID);
// Checked
getURL("FSCommand:CallGameFunction","%DestroyTextInputField?ID=" + this.m_textFieldID);
}
function getContents()
{
return std_mouseTextInputField.getContentsById(this.m_textFieldID);
}
function setContents(string)
{
// Checked
getURL("FSCommand:CallGameFunction","%SetTextInputFieldContents?ID=" + this.m_textFieldID + "|String=" + string);
}
function takeFocus()
{
this.m_objFM.setFocusToControl(this);
// Checked
getURL("FSCommand:CallGameFunction","%FocusTextInputField?ID=" + this.m_textFieldID);
}
function highlight()
{
this.gotoAndPlay("_highlight");
this.takeFocus();
}
function unhighlight()
{
this.gotoAndPlay("_unhighlight");
// Checked
getURL("FSCommand:CallGameFunction","%BlurTextInputField?ID=" + this.m_textFieldID);
}
function enableGUI()
{
this.gotoAndPlay("_unselect");
}
function disableGUI()
{
this.gotoAndPlay("_disable");
}
function rollover()
{
}
function rollout()
{
}
function setOnEnterFunction(onEnterFunc)
{
this.m_onEnterFunc = onEnterFunc;
}
function executeOnEnterFunction()
{
if(this.m_onEnterFunc != undefined)
{
this.m_onEnterFunc();
}
}
function mouseEventTextFieldRollover()
{
this.rollover();
}
function mouseEventTextFieldRollOut()
{
this.rollout();
}
function mouseEventTextFieldPress()
{
this.m_objFM.setFocusToControl(this);
// Checked
getURL("FSCommand:CallGameFunction","%OnTextInputFieldMouseDown?ID=" + this.m_textFieldID + "|x=" + this._xmouse + "|y=" + this._ymouse);
this.onMouseMove = this.bind0(this,this.mouseEventTextFieldMouseMove);
}
function mouseEventTextFieldRelease()
{
// Checked
getURL("FSCommand:CallGameFunction","%OnTextInputFieldMouseUp?ID=" + this.m_textFieldID + "|x=" + this._xmouse + "|y=" + this._ymouse);
this.onMouseMove = null;
}
function mouseEventTextFieldReleaseOutside()
{
this.mouseEventTextFieldRelease();
this.mouseEventTextFieldRollOut();
}
function mouseEventTextFieldMouseMove()
{
// Checked
getURL("FSCommand:CallGameFunction","%OnTextInputFieldMouseMove?ID=" + this.m_textFieldID + "|x=" + this._xmouse + "|y=" + this._ymouse);
}
}
@@ -0,0 +1,129 @@
class std_slider_logic extends Cafe2_Imp_BaseControl implements ICafe2_FocusableControl
{
function std_slider_logic()
{
super();
trace("std_slider_logic::std_slider_logic() this=" + this);
if(this.m_focusDirs == undefined)
{
this.m_focusDirs = Cafe2_Imp_BaseControl.FOCUS_DIR_UD;
}
if(this.m_nMin == undefined || this.m_nMax == undefined || this.m_nValue == undefined || this.m_bWrapEnabled == undefined || this.m_bSnapEnabled == undefined || this.m_nStep == undefined)
{
trace("WARNING: invalid component properties - " + this);
}
this.m_index = new CafeFW_IndexMgr();
this.m_index.SetInfo(this.m_nValue,this.m_nMin,this.m_nMax,this.m_nStep,this.m_bWrapEnabled,this.m_bSnapEnabled);
}
function logic_init()
{
this.setOnInput(INPUTCODE.RIGHT,this.nextValue,this);
this.setOnInput(INPUTCODE.LEFT,this.prevValue,this);
this.updateDisplay(this);
}
function setValue(n)
{
if(this.m_index.SetIndex(n) != CafeFW_IndexMgr.TIBINDEX_CHANGE_NONE)
{
this.updateDisplay(this);
}
}
function getValue()
{
return this.m_index.GetIndex();
}
function nextValue(thisMC)
{
trace("std_slider_logic::nextValue() this=" + this);
if(thisMC == undefined || thisMC == null)
{
this.nextValue_();
}
else
{
thisMC.nextValue_();
}
}
function nextValue_()
{
trace("std_slider_logic::nextValue_() this=" + this);
if(this.m_index.IncIndex() != CafeFW_IndexMgr.TIBINDEX_CHANGE_NONE)
{
this.updateDisplay(this);
this.onNext();
this.m_onChangeFunc(this,this.getValue());
}
}
function prevValue(thisMC)
{
trace("std_slider_logic::prevValue() this=" + this);
if(thisMC == undefined || thisMC == null)
{
this.prevValue_();
}
else
{
thisMC.prevValue_();
}
}
function prevValue_()
{
trace("std_slider_logic::prevValue_() this=" + this);
if(this.m_index.DecIndex() != CafeFW_IndexMgr.TIBINDEX_CHANGE_NONE)
{
this.updateDisplay(this);
this.onPrevious();
this.m_onChangeFunc(this,this.getValue());
}
}
function setIndexRange(min, max, current)
{
this.m_nMin = min;
this.m_nMax = max;
this.m_index.SetInfo(current,min,max,this.m_nStep,this.m_bWrapEnabled,this.m_bSnapEnabled);
}
function setIndexInfo(enableWrap, stepSize, enableSnap)
{
this.m_bWrapEnabled = enableWrap;
this.m_nStep = stepSize;
this.m_bSnapEnabled = enableSnap;
this.m_index.SetInfo(this.m_index.GetIndex(),this.m_nMin,this.m_nMax,this.m_nStep,this.m_bWrapEnabled,this.m_bSnapEnabled);
}
static function defaultInitObject()
{
var _loc1_ = Cafe2_Imp_BaseControl.defaultInitObject();
_loc1_.m_focusDirs = Cafe2_Imp_BaseControl.FOCUS_DIR_UD;
_loc1_.m_nMin = 0;
_loc1_.m_nMax = 100;
_loc1_.m_nValue = 0;
_loc1_.m_bWrapEnabled = false;
_loc1_.m_bSnapEnabled = false;
_loc1_.m_nStep = 1;
return _loc1_;
}
function updateDisplay(thisMC)
{
trace("ERROR: std_slider_logic::updateDisplay() needs to be implemented in child.");
}
function highlight()
{
this.visual_highlight();
}
function unhighlight()
{
this.visual_unhighlight();
}
function enableGUI()
{
this.visual_enableGUI();
}
function disableGUI()
{
this.visual_disableGUI();
}
function setRange(n)
{
trace("WARNING: std_slider_logic::setRange() deprecated use setIndexRange()");
this.updateDisplay(this);
}
}
@@ -0,0 +1,851 @@
// 这部分代码应该是整个 APT 的入口了,就算不是入口也八九不离十了。
// 这里初始化了各种全局常量、全局事件侦听器与事先制作好的 Cafe2 UI 界面框架,然后也逐个加载了其它的全部其余模块。
// 可以说,不留别的,这个模块肯定是不留不行的。
function gblSMChangeScreen()
{
trace("main_mouse::gblSMChangeScreen()");
if(gSM.m_intervalId != -1)
{
clearInterval(gSM.m_intervalId);
gSM.m_intervalId = -1;
}
_global.gShellScreen.screen.changeScreen();
}
function initGlobalVariables()
{
trace("main_mouse_functions::initGlobalVariables()");
if(_root.gFWS == undefined)
{
trace("***** WARNING: gFWS not defined! ");
trace("***** Cafe 2.0 Framework requires var gFWS to be set to an object implementing ICafe2_FWSettings in configs.as");
}
_root.PLATFORM = gFWS.getPlatform();
_root.SCREEN_WIDTH = gFWS.getScreenWidth();
_root.SCREEN_HEIGHT = gFWS.getScreenHeight();
_root.LANGUAGE = gFWS.getLanguage();
_root.ltxt = gFWS.ltxt;
_root.cafeTrace = gFWS.cafeTrace;
_root.playSound = gFWS.playSound;
_root.stopSound = gFWS.stopSound;
trace("PLATFORM = " + PLATFORM);
trace("SCREEN_WIDTH = " + SCREEN_WIDTH);
trace("SCREEN_HEIGHT = " + SCREEN_HEIGHT);
if(PLATFORM == "FLASH")
{
trace("Resetting the PLATFORM to PC while in Flash");
PLATFORM = "PC";
}
_global.PLATFORM = _root.PLATFORM;
_global.SCREEN_WIDTH = _root.SCREEN_WIDTH;
_global.SCREEN_HEIGHT = _root.SCREEN_HEIGHT;
_global.LANGUAGE = _root.LANGUAGE;
_global.ltxt = _root.gFWS.ltxt;
_global.cafeTrace = _root.gFWS.cafeTrace;
_global.playSound = _root.gFWS.playSound;
_global.stopSound = _root.gFWS.stopSound;
var _loc3_ = System.capabilities.os;
if(_loc3_.length > 0)
{
_global.IS_FLASH = true;
}
else
{
_global.IS_FLASH = false;
}
}
function gotoShellScreen(sScreenId, screenStack)
{
_global.gSM.changeMainScreen(_global.SCREEN.NONE);
_global.gSM.clearStack();
_global.gSM.popScreen();
var _loc2_ = 0;
while(_loc2_ < screenStack.length)
{
_global.gSM.changeMainScreen(screenStack[_loc2_]);
_loc2_ = _loc2_ + 1;
}
_global.gSM.changeMainScreen(sScreenId);
_global.showFEBackgroundMovie();
_global.gShellScreen._visible = true;
}
function globalMessageHandler(messageCode)
{
var _loc2_ = false;
switch(messageCode)
{
case _global.MSGCODE.FE_HIDE:
trace("main_mouse::globalMessageHandler() handling message _global.MSGCODE.FE_HIDE = \'" + _global.MSGCODE.FE_HIDE + "\'");
_global.gSM.clearStack();
_global.gSM.changeMainScreen(_global.SCREEN.NONE);
_global.gShellScreen.screen.unloadContent();
_global.gShellScreen._visible = false;
_global.hideFEBackgroundMovie();
_loc2_ = true;
break;
case _global.MSGCODE.FE_SHOW_MAIN_MENU:
trace("main_mouse::globalMessageHandler() handling message _global.MSGCODE.FE_SHOW_MAIN_MENU = \'" + _global.MSGCODE.FE_SHOW_MAIN_MENU + "\'");
gotoShellScreen(_global.SCREEN.FEG_MAIN_MENU,[]);
_loc2_ = true;
break;
case _global.MSGCODE.FE_SHOW_SAVE_MENU:
trace("main_mouse::globalMessageHandler() handling message _global.MSGCODE.FE_SHOW_SAVE_MENU = \'" + _global.MSGCODE.FE_SHOW_SAVE_MENU + "\'");
gotoShellScreen(_global.SCREEN.FEG_SAVELOAD,[]);
_global.GAME.SAVELOADSCREEN_TYPE = _global.ENUM.SAVELOADSCREEN_SAVE;
_loc2_ = true;
break;
case _global.MSGCODE.FE_SHOW_LOAD_MENU:
trace("main_mouse::globalMessageHandler() handling message _global.MSGCODE.FE_SHOW_LOAD_MENU = \'" + _global.MSGCODE.FE_SHOW_LOAD_MENU + "\'");
gotoShellScreen(_global.SCREEN.FEG_SAVELOAD,[]);
_global.GAME.SAVELOADSCREEN_TYPE = _global.ENUM.SAVELOADSCREEN_LOAD;
_loc2_ = true;
break;
case _global.MSGCODE.FE_SHOW_LOADSCREEN:
trace("main_mouse::globalMessageHandler() handling message _global.MSGCODE.FE_SHOW_LOADSCREEN = \'" + _global.MSGCODE.FE_SHOW_LOADSCREEN + "\'");
gotoShellScreen(_global.SCREEN.FEG_LOADSCREEN,[]);
_loc2_ = true;
break;
case _global.MSGCODE.FE_SHOW_MP_LOADSCREEN:
trace("main_mouse::globalMessageHandler() handling message _global.MSGCODE.FE_SHOW_MP_LOADSCREEN = \'" + _global.MSGCODE.FE_SHOW_MP_LOADSCREEN + "\'");
gotoShellScreen(_global.SCREEN.FEG_MP_LOADSCREEN,[]);
_loc2_ = true;
break;
case _global.MSGCODE.FE_SHOW_MISSION_BRIEFING:
trace("main_mouse::globalMessageHandler() handling message _global.MSGCODE.FE_SHOW_MISSION_BRIEFING = \'" + _global.MSGCODE.FE_SHOW_MISSION_BRIEFING + "\'");
// Checked
getUrl("FSCommand:CallGameFunction", "%Campaign_Initialize");
_global.GAME.COOPMODE = _global.ENUM.GAME_COOPMODE_CHOOSER;
_global.GAME.PLAY_MISSION_INTRO_MOVIE = true;
gotoShellScreen(_global.SCREEN.FES_COOP_MISSION_BRIEFING,[]);
_loc2_ = true;
break;
case _global.MSGCODE.IGM_OPEN_SHELL_ROOT:
trace("main_mouse::globalMessageHandler() handling message _global.MSGCODE.IGM_OPEN_SHELL_ROOT = \'" + _global.MSGCODE.IGM_OPEN_SHELL_ROOT + "\'");
gotoShellScreen(_global.SCREEN.IGM_SHELL_ROOT,[]);
_loc2_ = true;
break;
case _global.MSGCODE.FE_SHOW_MP_GAME_SETUP:
trace("main_mouse::globalMessageHandler() handling message _global.MSGCODE.FE_SHOW_MP_GAME_SETUP = \'" + _global.MSGCODE.FE_SHOW_MP_GAME_SETUP + "\'");
gotoShellScreen(_global.SCREEN.FEM_MP_SETUP,[_global.SCREEN.FEG_MAIN_MENU,_global.SCREEN.FEM_MP_ONLINE_MULTIPLAYER]);
_loc2_ = true;
break;
case _global.MSGCODE.FE_SHOW_SKIRMISH_RESULTS:
trace("main_mouse::globalMessageHandler() handling message _global.MSGCODE.FE_SHOW_SKIRMISH_RESULTS = \'" + _global.MSGCODE.FE_SHOW_SKIRMISH_RESULTS + "\'");
gotoShellScreen(_global.SCREEN.FEM_MP_POSTGAME_ROUNDUP,[]);
_loc2_ = true;
break;
case _global.MSGCODE.FE_SHOW_CAMPAIGN_RESULTS:
trace("main_mouse::globalMessageHandler() handling message _global.MSGCODE.FE_SHOW_CAMPAIGN_RESULTS= \'" + _global.MSGCODE.FE_SHOW_CAMPAIGN_RESULTS + "\'");
gotoShellScreen(_global.SCREEN.FES_COOP_POSTGAME_ROUNDUP,[]);
_loc2_ = true;
break;
case _global.MSGCODE.FE_SHOW_LAN_RESULTS:
trace("main_mouse::globalMessageHandler() handling message _global.MSGCODE.FE_SHOW_LAN_RESULTS= \'" + _global.MSGCODE.FE_SHOW_LAN_RESULTS + "\'");
gotoShellScreen(_global.SCREEN.FEM_MP_POSTGAME_ROUNDUP,[]);
_loc2_ = true;
break;
case _global.MSGCODE.FE_SHOW_ONLINE_RESULTS:
trace("main_mouse::globalMessageHandler() handling message _global.MSGCODE.FE_SHOW_ONLINE_RESULTS= \'" + _global.MSGCODE.FE_SHOW_ONLINE_RESULTS + "\'");
gotoShellScreen(_global.SCREEN.FEM_MP_POSTGAME_ROUNDUP,[]);
_loc2_ = true;
break;
case _global.MSGCODE.FE_SHOW_AUTO_MATCH_RESULTS:
trace("main_mouse::globalMessageHandler() handling message _global.MSGCODE.FE_SHOW_AUTO_MATCH_RESULTS= \'" + _global.MSGCODE.FE_SHOW_AUTO_MATCH_RESULTS + "\'");
gotoShellScreen(_global.SCREEN.FEM_MP_POSTGAME_ROUNDUP,[]);
_loc2_ = true;
break;
case _global.MSGCODE.FE_SHOW_TUTORIAL_RESULTS:
trace("main_mouse::globalMessageHandler() handling message _global.MSGCODE.FE_SHOW_TUTORIAL= \'" + _global.MSGCODE.FE_SHOW_TUTORIAL + "\'");
gotoShellScreen(_global.SCREEN.FEG_TUTORIALMENU,[_global.SCREEN.FEG_MAIN_MENU]);
_loc2_ = true;
break;
case _global.MSGCODE.FE_MP_ONLINE_GAME_JOINED_SUCCESS:
_global.comLink.screen.close();
if(_global.GAME.MODE == _global.ENUM.GAME_MODE_SKIRMISH)
{
// Checked
getUrl("FSCommand:CallGameFunction", "%SetGameSetupMode?Mode=None");
}
else if(_global.GAME.MODE == _global.ENUM.GAME_MODE_CAMPAIGN)
{
// Checked
getUrl("FSCommand:CallGameFunction", "%Campaign_ExitGame");
// Checked
getUrl("FSCommand:CallGameFunction", "%SetGameSetupMode?Mode=None|DontExitGame=1");
}
else if(_global.GAME.MODE == _global.ENUM.GAME_MODE_MULTIPLAYER)
{
// Checked
getUrl("FSCommand:CallGameFunction", "%SetGameSetupMode?Mode=None|DontExitGame=1");
}
_global.GAME.MODE = _global.ENUM.GAME_MODE_MULTIPLAYER;
gotoShellScreen(_global.SCREEN.FEM_MP_SETUP,[_global.SCREEN.FEG_MAIN_MENU,_global.SCREEN.FEM_MP_ONLINE_MULTIPLAYER]);
_loc2_ = true;
break;
case _global.MSGCODE.FE_MP_ONLINE_GAME_CONNECT_SUCCESS:
_global.comLink.screen.close();
_global.GAME.MODE = _global.ENUM.GAME_MODE_MULTIPLAYER;
gotoShellScreen(_global.SCREEN.FEM_MP_SETUP,[_global.SCREEN.FEG_MAIN_MENU,_global.SCREEN.FEM_MP_ONLINE_MULTIPLAYER]);
_loc2_ = true;
break;
case _global.MSGCODE.FE_COOP_ONLINE_GAME_JOINED_SUCCESS:
_global.comLink.screen.close();
if(_global.GAME.MODE == _global.ENUM.GAME_MODE_SKIRMISH)
{
// Checked
getUrl("FSCommand:CallGameFunction", "%SetGameSetupMode?Mode=None");
}
else if(_global.GAME.MODE == _global.ENUM.GAME_MODE_MULTIPLAYER || _global.GAME.MODE == _global.ENUM.GAME_MODE_CAMPAIGN)
{
// Checked
getUrl("FSCommand:CallGameFunction", "%SetGameSetupMode?Mode=None|DontExitGame=1");
}
_global.GAME.COOPMODE = _global.ENUM.GAME_COOPMODE_CLIENT;
_global.GAME.MODE = _global.ENUM.GAME_MODE_CAMPAIGN;
gotoShellScreen(_global.SCREEN.FEM_COOPSTAGING,[_global.SCREEN.FEG_MAIN_MENU]);
// Checked
getUrl("FSCommand:CallGameFunction", "%SetGameSetupMode?Mode=Online");
_loc2_ = true;
break;
case _global.MSGCODE.FE_TEAM2v2_ONLINE_GAME_CONNECT_SUCCESS:
trace("main_mouse_functions::globalMessageHandler() handling message _global.MSGCODE.FE_TEAM2v2_ONLINE_GAME_CONNECT_SUCCESS = \'" + _global.MSGCODE.FE_TEAM2v2_ONLINE_GAME_CONNECT_SUCCESS + "\'");
if(_global.GAME.MODE == _global.ENUM.GAME_MODE_SKIRMISH || _global.GAME.MODE == _global.ENUM.GAME_MODE_LAN_MP)
{
// Checked
getUrl("FSCommand:CallGameFunction", "%SetGameSetupMode?Mode=None");
}
var _loc3_ = new Object();
// Checked
loadVariables("QueryGameEngine?IsPcGameHost",_loc3_);
if(_loc3_.IsPcGameHost == "0")
{
if(_global.GAME.MODE == _global.ENUM.GAME_MODE_MULTIPLAYER || _global.GAME.MODE == _global.ENUM.GAME_MODE_CAMPAIGN)
{
// Checked
getUrl("FSCommand:CallGameFunction", "%SetGameSetupMode?Mode=None|DontExitGame=1");
}
_global.comLink.screen.close();
_global.SHELL.INVITED_TO_TEAM_AUTOMATCH = true;
gotoShellScreen(_global.SCREEN.FEM_MP_ONLINE_MULTIPLAYER,[_global.SCREEN.FEG_MAIN_MENU]);
_loc2_ = true;
}
else
{
_global.comLink.screen.openForAutoMatchInvite();
_loc2_ = false;
}
// Checked
getUrl("FSCommand:CallGameFunction", "%SetGameSetupMode?Mode=Online");
_global.GAME.MODE = _global.ENUM.GAME_MODE_MULTIPLAYER;
break;
case _global.MSGCODE.FE_MP_ONLINE_SIGN_IN_FAILURE:
if(_global.GAME.MODE == _global.ENUM.GAME_MODE_MULTIPLAYER || _global.GAME.MODE == _global.ENUM.GAME_MODE_CAMPAIGN)
{
_global.GAME.MODE = _global.ENUM.GAME_MODE_NONE;
// Checked
getUrl("FSCommand:CallGameFunction", "%SetGameSetupMode?Mode=None");
gotoShellScreen(_global.SCREEN.FEG_MAIN_MENU,[]);
}
_loc2_ = false;
break;
case _global.MSGCODE.FE_MP_ONLINE_SIGN_OUT_SUCCESS:
case _global.MSGCODE.FE_MP_ONLINE_DISCONNECTED:
var _loc4_ = _global.GAME.MODE == _global.ENUM.GAME_MODE_CAMPAIGN && (_global.GAME.COOPMODE == _global.ENUM.GAME_COOPMODE_HOST || _global.GAME.COOPMODE == _global.ENUM.GAME_COOPMODE_CLIENT);
if(_global.GAME.MODE == _global.ENUM.GAME_MODE_MULTIPLAYER || _loc4_)
{
_global.GAME.MODE = _global.ENUM.GAME_MODE_NONE;
// Checked
getUrl("FSCommand:CallGameFunction", "%SetGameSetupMode?Mode=None");
gotoShellScreen(_global.SCREEN.FEG_MAIN_MENU,[]);
_global.comLink.screen.close();
}
_loc2_ = false;
break;
case _global.MSGCODE.FE_MP_ONLINE_GAME_CONNECT_FAILURE:
_global.GAME.MODE = _global.ENUM.GAME_MODE_NONE;
// Checked
getUrl("FSCommand:CallGameFunction", "%SetGameSetupMode?Mode=None");
gotoShellScreen(_global.SCREEN.FEG_MAIN_MENU,[]);
break;
case _global.MSGCODE.FE_MP_HOST_LEFT_GAME:
case _global.MSGCODE.FE_MP_KICKED_FROM_MULTIPLAYER_GAME:
case _global.MSGCODE.FE_MP_KICKED_FROM_COOP_GAME:
if(_global.GAME.MODE == _global.ENUM.GAME_MODE_MULTIPLAYER)
{
_global.GAME.MODE = _global.ENUM.GAME_MODE_NONE;
gotoShellScreen(_global.SCREEN.FEM_MP_ONLINE_MULTIPLAYER,[_global.SCREEN.FEG_MAIN_MENU]);
}
else
{
_global.GAME.MODE = _global.ENUM.GAME_MODE_NONE;
// Checked
getUrl("FSCommand:CallGameFunction", "%SetGameSetupMode?Mode=None");
gotoShellScreen(_global.SCREEN.FEG_MAIN_MENU,[]);
}
_loc2_ = true;
break;
case _global.MSGCODE.FE_LAN_HOST_LEFT_GAME:
gotoShellScreen(_global.SCREEN.FEM_LAN_LOBBY,[_global.SCREEN.FEG_MAIN_MENU]);
_loc2_ = true;
break;
case _global.MSGCODE.FE_NEXT_COMPONENT:
_global.gFM.selectNextItem();
_loc2_ = true;
break;
case _global.MSGCODE.FE_PREVIOUS_COMPONENT:
_global.gFM.selectPreviousItem();
_loc2_ = true;
break;
case _global.MSGCODE.FE_UNHANDLED_MOUSE_CLICK:
_global.gFM.deselectFocusedComponent();
_loc2_ = true;
break;
case _global.MSGCODE.FE_KEYBOARD_UP:
case _global.MSGCODE.FE_KEYBOARD_DOWN:
case _global.MSGCODE.FE_KEYBOARD_LEFT:
case _global.MSGCODE.FE_KEYBOARD_RIGHT:
case _global.MSGCODE.FE_KEYBOARD_ENTER:
break;
case _global.MSGCODE.FE_LOST_COCOMMANDER:
gotoShellScreen(_global.SCREEN.FEG_RECRUITMENT_UI,[_global.SCREEN.FEG_MAIN_MENU]);
_loc2_ = true;
}
return _loc2_;
}
function onMousewheelScroll(spins)
{
if(_global.highlightedComponent != undefined)
{
_global.highlightedComponent.onMousewheelScroll(spins);
}
}
getTimer();
_global.Util = new Object();
_global.Util.Truncate = function(nLength, sString)
{
if(sString.length >= nLength)
{
return sString.substring(0,nLength);
}
return sString;
};
_global.Util.TruncateEllipse = function(nLength, sString)
{
if(sString.length >= nLength)
{
return sString.substring(0,nLength) + "...";
}
return sString;
};
_global.Util.TruncateFieldEllipse = function(oTextField, nMaxWidth)
{
var _loc3_ = oTextField.textWidth;
if(_loc3_ >= nMaxWidth)
{
var _loc5_ = oTextField.text;
var _loc1_ = oTextField.text.length;
nMaxWidth -= 16;
if(nMaxWidth <= 0)
{
nMaxWidth = 1;
}
while(_loc1_ > 0 && _loc3_ > nMaxWidth)
{
_loc1_ = _loc1_ - 1;
oTextField.text = _loc5_.substr(0,_loc1_);
_loc3_ = oTextField.textWidth;
}
oTextField.text += "...";
}
};
_global.Util.TruncateField = function(oTextField, nMaxWidth)
{
var _loc3_ = oTextField.textWidth;
if(_loc3_ >= nMaxWidth)
{
var _loc5_ = oTextField.text;
var _loc1_ = oTextField.text.length;
if(nMaxWidth <= 0)
{
nMaxWidth = 1;
}
while(_loc1_ > 0 && _loc3_ > nMaxWidth)
{
_loc1_ = _loc1_ - 1;
oTextField.text = _loc5_.substr(0,_loc1_);
_loc3_ = oTextField.textWidth;
}
}
};
_global.Util.loadCafeIcon = function(iconToLoad, mcToLoadInto)
{
mcToLoadInto.loadMovie("../cafe/artAssets/" + _global.PLATFORM + "/icons/" + iconToLoad + ".swf");
};
var INPUTCODE = new Object();
_global.INPUTCODE = INPUTCODE;
INPUTCODE.ALL = -100;
INPUTCODE.BASE_UP = 1000;
INPUTCODE.ENTER = 13;
INPUTCODE.ESCAPE = 27;
INPUTCODE.UP = 38;
INPUTCODE.DOWN = 40;
INPUTCODE.LEFT = 37;
INPUTCODE.RIGHT = 39;
INPUTCODE.SELECT = 300;
INPUTCODE.START = 301;
INPUTCODE.CROSS = 302;
INPUTCODE.TRIANGLE = 304;
INPUTCODE.CIRCLE = 303;
INPUTCODE.SQUARE = 305;
INPUTCODE.L1 = 306;
INPUTCODE.R1 = 307;
INPUTCODE.L2 = 308;
INPUTCODE.R2 = 309;
INPUTCODE.L3 = 310;
INPUTCODE.R3 = 311;
INPUTCODE.LAS = 501;
INPUTCODE.RAS = 502;
INPUTCODE.CONNECTED = 400;
INPUTCODE.DISCONNECTED = 401;
INPUTCODE.LAS_UP = 538;
INPUTCODE.LAS_DOWN = 540;
INPUTCODE.LAS_LEFT = 537;
INPUTCODE.LAS_RIGHT = 539;
INPUTCODE.RAS_UP = 638;
INPUTCODE.RAS_DOWN = 640;
INPUTCODE.RAS_LEFT = 637;
INPUTCODE.RAS_RIGHT = 639;
var sys = System.capabilities.os;
var externStr = "extern";
var externObj = eval(externStr);
if(sys.length > 0 || externObj.gPlatform == "PC")
{
trace("running in pc flash");
INPUTCODE.UP = 38;
INPUTCODE.DOWN = 40;
INPUTCODE.LEFT = 37;
INPUTCODE.RIGHT = 39;
INPUTCODE.CROSS = 88;
INPUTCODE.TRIANGLE = 84;
INPUTCODE.CIRCLE = 79;
INPUTCODE.SQUARE = 83;
INPUTCODE.L1 = 75;
INPUTCODE.R1 = 76;
INPUTCODE.L2 = 78;
INPUTCODE.R2 = 77;
INPUTCODE.START = 71;
}
INPUTCODE.ENTER_U = INPUTCODE.ENTER + INPUTCODE.BASE_UP;
INPUTCODE.UP_U = INPUTCODE.UP + INPUTCODE.BASE_UP;
INPUTCODE.DOWN_U = INPUTCODE.DOWN + INPUTCODE.BASE_UP;
INPUTCODE.LEFT_U = INPUTCODE.LEFT + INPUTCODE.BASE_UP;
INPUTCODE.RIGHT_U = INPUTCODE.RIGHT + INPUTCODE.BASE_UP;
INPUTCODE.SELECT_U = INPUTCODE.SELECT + INPUTCODE.BASE_UP;
INPUTCODE.START_U = INPUTCODE.START + INPUTCODE.BASE_UP;
INPUTCODE.CROSS_U = INPUTCODE.CROSS + INPUTCODE.BASE_UP;
INPUTCODE.TRIANGLE_U = INPUTCODE.TRIANGLE + INPUTCODE.BASE_UP;
INPUTCODE.CIRCLE_U = INPUTCODE.CIRCLE + INPUTCODE.BASE_UP;
INPUTCODE.SQUARE_U = INPUTCODE.SQUARE + INPUTCODE.BASE_UP;
INPUTCODE.L1_U = INPUTCODE.L1 + INPUTCODE.BASE_UP;
INPUTCODE.R1_U = INPUTCODE.R1 + INPUTCODE.BASE_UP;
INPUTCODE.L2_U = INPUTCODE.L2 + INPUTCODE.BASE_UP;
INPUTCODE.R2_U = INPUTCODE.R2 + INPUTCODE.BASE_UP;
INPUTCODE.L3_U = INPUTCODE.L3 + INPUTCODE.BASE_UP;
INPUTCODE.R3_U = INPUTCODE.R3 + INPUTCODE.BASE_UP;
INPUTCODE.LAS_UP_U = INPUTCODE.LAS_UP + INPUTCODE.BASE_UP;
INPUTCODE.LAS_DOWN_U = INPUTCODE.LAS_DOWN + INPUTCODE.BASE_UP;
INPUTCODE.LAS_LEFT_U = INPUTCODE.LAS_LEFT + INPUTCODE.BASE_UP;
INPUTCODE.LAS_RIGHT_U = INPUTCODE.LAS_RIGHT + INPUTCODE.BASE_UP;
INPUTCODE.RAS_UP_U = INPUTCODE.RAS_UP + INPUTCODE.BASE_UP;
INPUTCODE.RAS_DOWN_U = INPUTCODE.RAS_DOWN + INPUTCODE.BASE_UP;
INPUTCODE.RAS_LEFT_U = INPUTCODE.RAS_LEFT + INPUTCODE.BASE_UP;
INPUTCODE.RAS_RIGHT_U = INPUTCODE.RAS_RIGHT + INPUTCODE.BASE_UP;
var gFWS = new main_mouse_settings();
var gSM = new CafeFW_ScreenManager();
var gOM = new CafeFW_OverlayManager();
var gFM = new CafeFW_FocusManager("gFM");
var gCM = new CafeFW_ControllerManager();
var gCT = new CafeFW_ComponentTracker();
var gMH = new CafeFW_MessageHandler();
var gEH = new CafeFW_EventHandler(this);
Key.addListener(gEH);
gSM.setRefToGlobalEventHandler(gEH);
gSM.setRefToGlobalFocusManager(gFM);
_global.gFWS = _root.gFWS;
_global.gFM = _root.gFM;
_global.gEH = _root.gEH;
_global.gSM = _root.gSM;
_global.gOM = _root.gOM;
_global.gCM = _root.gCM;
_global.gCT = _root.gCT;
_global.gMH = _root.gMH;
_global.bind0 = function(o, f)
{
return function()
{
return f.call(o);
};
};
_global.bind1 = function(o, f, p1)
{
return function()
{
return f.call(o,p1);
};
};
_global.bind2 = function(o, f, p1, p2)
{
return function()
{
return f.call(o,p1,p2);
};
};
_global.bind3 = function(o, f, p1, p2, p3)
{
return function()
{
return f.call(o,p1,p2,p3);
};
};
_global.bind1DynamicParams = function(o, f)
{
return function(p1)
{
return f.call(o,p1);
};
};
_global.bind2DynamicParams = function(o, f)
{
return function(p1, p2)
{
return f.call(o,p1,p2);
};
};
_global.bind3DynamicParams = function(o, f)
{
return function(p1, p2, p3)
{
return f.call(o,p1,p2,p3);
};
};
_global.PlayShellMusic = function(audioAlias)
{
trace("main_functions::_global.PlayShellMusic() audioAlias = " + audioAlias);
// Checked
getURL("FSCommand:CallGameFunction","%Shell_PlayMusic?Value=" + audioAlias);
};
UISystemMessage = function(sysMessage)
{
trace("UISystemMessage() sysMessage = " + sysMessage);
gMH.handleStringMessage(sysMessage);
};
_global.gotoShellScreen = gotoShellScreen;
_global.showFEBackgroundMovie = function()
{
_global.gShellScreen.screen.showBackgroundMovie();
};
_global.hideFEBackgroundMovie = function()
{
_global.gShellScreen.screen.hideBackgroundMovie();
};
_global.getAbsoluteMouseLocation = function()
{
var _loc2_ = new Array();
_loc2_.push(_global.gShellScreen._xmouse);
_loc2_.push(_global.gShellScreen._ymouse);
return _loc2_;
};
gMH.addPriorityMessageHandler(globalMessageHandler,CafeFW_MessageHandler.PRIORITY_GLOBAL);
Cafe2_FocusableBody.includeCode();
Cafe2_FocusablePart.includeCode();
Cafe2_SldBarBody.includeCode();
Cafe2_OnOffAnimPart.includeCode();
Cafe2_ScrollbarBody.includeCode();
CafeFW_IndexMgr.includeCode();
var errCode = false;
errCode = Object.registerClass("std_mouseSliderSymbol",std_mouseSlider_visual);
trace("main_mouse_components: registerClass on std_mouseSliderSymbol returned " + errCode);
errCode = Object.registerClass("std_MousebuttonSymbol",std_Mousebutton_visual);
trace("main_mouse_components: registerClass on std_Mousebutton_visual returned " + errCode);
errCode = Object.registerClass("std_mouseScrollbarSymbol",std_mouseScrollbar_visual);
trace("main_mouse_components: registerClass on std_mouseScrollbar_visual returned " + errCode);
errCode = Object.registerClass("std_MouseCheckBoxSymbol",std_mouseCheckBox_visual);
trace("main_mouse_components: registerClass on std_mouseCheckBox_visual returned " + errCode);
errCode = Object.registerClass("std_mouseScrollingListboxSymbol",std_mouseScrollingListbox);
trace("main_mouse_components: registerClass on std_mouseScrollingListbox returned " + errCode);
errCode = Object.registerClass("std_mouseScrollingListboxEntrySymbol",std_mouseScrollingListboxEntry);
trace("main_mouse_components: registerClass on std_mouseScrollingListboxEntry returned " + errCode);
errCode = Object.registerClass("std_mouseListboxEntryTextElementSymbol",std_mouseListboxEntryTextElement);
trace("main_mouse_components: registerClass on std_mouseListboxEntryTextElement returned " + errCode);
errCode = Object.registerClass("std_mouseListboxEntryColorSwatchElementSymbol",std_mouseListboxEntryColorSwatchElement);
trace("main_mouse_components: registerClass on std_mouseListboxEntryColorSwatchElement returned " + errCode);
errCode = Object.registerClass("std_mouseListboxEntryRenderImageElementSymbol",std_mouseListboxEntryRenderImageElement);
trace("main_mouse_components: registerClass on std_mouseListboxEntryRenderImageElement returned " + errCode);
errCode = Object.registerClass("std_mouseListboxEntryGameStatusElementSymbol",std_mouseListboxEntryGameStatusElement);
trace("main_mouse_components: registerClass on std_mouseListboxEntryGameStatusElement returned " + errCode);
errCode = Object.registerClass("std_mouseDropDownMenuSymbol",std_mouseDropDownMenu);
trace("main_mouse_components: registerClass on std_mouseDropDownMenu returned " + errCode);
errCode = Object.registerClass("std_mouseTextInputFieldSymbol",std_mouseTextInputField);
trace("main_mouse_components: registerClass on std_mouseTextInputField returned " + errCode);
errCode = Object.registerClass("std_MouseAccordionButtonSymbol",std_MouseAccordionButton);
trace("main_mouse_components: registerClass on std_MouseAccordionButton returned " + errCode);
errCode = Object.registerClass("std_AccordionMenuSymbol",std_MouseAccordionMenu);
trace("main_mouse_components: registerClass on std_MouseAccordionMenu returned " + errCode);
errCode = Object.registerClass("2p5D_UISymbol",movieClip2p5DUIHelper);
trace("main_mouse_components: registerClass on movieClip2p5DUIHelper returned " + errCode);
errCode = Object.registerClass("blimpFactorySymbol",blimpAnimationFactory);
trace("main_mouse_components: registerClass on blimpAnimationFactory returned " + errCode);
errCode = Object.registerClass("bombFactorySymbol",bombAnimationFactory);
trace("main_mouse_components: registerClass on bombAnimationFactory returned " + errCode);
errCode = Object.registerClass("MovieComponentSymbol",MovieComponent);
trace("main_mouse_components: register MovieComponentSymbol " + errCode);
errCode = Object.registerClass("chatComponentSymbol",ChatComponent);
trace("register charComponentSymbol" + errCode);
errCode = Object.registerClass("careerStatsComponentSymbol",careerStatsComponent);
trace("register careerStatsComponentSymbol " + errCode);
errCode = Object.registerClass("std_mouseRadioButtonSymbol",std_mouseRadioButton);
trace("register std_mouseRadioButtonSymbol" + errCode);
errCode = Object.registerClass("std_mouseRadioButtonControllerSymbol",std_mouseRadioButtonController);
trace("register std_mouseRadioButtonControllerSymbol" + errCode);
errCode = Object.registerClass("LobbyListComponentSymbol",lobbyListComponent);
trace("main_mouse_components: registerClass on lobbyListComponent returned " + errCode);
errCode = Object.registerClass("GameListComponentSymbol",gameListComponent);
trace("main_mouse_components: registerClass on gobbyListComponent returned " + errCode);
errCode = Object.registerClass("playerListComponentSymbol",playerListComponent);
trace("main_mouse_components: registerClass on playerListComponent returned " + errCode);
errCode = Object.registerClass("inviteListComponentSymbol",inviteListComponent);
trace("main_mouse_components: registerClass on inviteListComponent returned " + errCode);
errCode = Object.registerClass("BuddyListComponentSymbol",buddyListComponent);
trace("main_mouse_components: registerClass on buddyListComponent returned " + errCode);
errCode = Object.registerClass("chapterSelectComponentSymbol",mouse_chapterSelectComponent);
trace("main_mouse_components: registerClass on chapterSelectComponent returned " + errCode);
errCode = Object.registerClass("contextMenuEntrySymbol",contextMenuEntry);
trace("main_mouse_components: registerClass on contextMenuEntry returned " + errCode);
errCode = Object.registerClass("ScreenTitleBarSymbol",fe_m_TitleBarComponent);
trace("main_mouse_components: registerClass on fe_m_TitleBarComponent returned " + errCode);
if(_global.SCREEN == undefined)
{
_global.SCREEN = new Object();
}
_global.SCREEN.NONE = "";
_global.SCREEN.FEG_MAIN = "screens/feg_m_main.swf";
_global.SCREEN.FEG_BACKGROUND = "screens/feg_m_background";
_global.SCREEN.FEG_COMLINK = "screens/feg_m_comLink";
_global.SCREEN.FEG_CAFE_UI_WIDGET_TEST_SCREEN = "screens/testCafeUI";
_global.SCREEN.FEG_MAIN_MENU = "screens/feg_m_mainMenu3D";
_global.SCREEN.FEG_OPTIONS = "screens/feg_m_optionsSettings";
_global.SCREEN.FEG_LOADSCREEN = "screens/feg_m_load";
_global.SCREEN.FEG_MP_LOADSCREEN = "screens/fem_m_load";
_global.SCREEN.FEG_MESSAGE_BOX = "screens/feg_m_messageBox.swf";
_global.SCREEN.FEG_DISCONNECT = "screens/feg_m_disconnect.swf";
_global.SCREEN.FEG_CONTEXTMENU = "screens/feg_m_contextMenu";
_global.SCREEN.FEG_PROFILE_MANAGER = "screens/feg_m_profileManager";
_global.SCREEN.FEG_PROFILE_STATS = "screens/feg_m_profileStats";
_global.SCREEN.FEG_RECRUITMENT_UI = "screens/feg_m_recruitChooser";
_global.SCREEN.FEG_SAVELOAD = "screens/feg_m_saveLoadMenu";
_global.SCREEN.FEG_CREDITS = "screens/feg_m_credits";
_global.SCREEN.FEG_TUTORIALMENU = "screens/feg_m_tutorialMenu";
_global.SCREEN.FEG_FILMARCHIVE = "screens/feg_m_filmArchiveTheatre";
_global.SCREEN.FEM_MP_SETUP = "screens/fem_m_gameSetup";
_global.SCREEN.FEM_MP_ONLINE_MULTIPLAYER = "screens/fem_m_onlineMultiplayer";
_global.SCREEN.FEM_COOPSTAGING = "screens/fem_m_coopStaging";
_global.SCREEN.FEM_MP_POSTGAME_ROUNDUP = "screens/fem_m_postgameRoundup";
_global.SCREEN.FEM_LAN_LOBBY = "screens/fem_m_lanLobby";
_global.SCREEN.FEM_LAN_SETUP = "screens/fem_m_lanGameSetup";
_global.SCREEN.FES_SINGLE_PLAYER_MENU = "screens/fes_m_singleplayerMenu";
_global.SCREEN.FES_COOP_MISSION_BRIEFING = "screens/fes_m_missionBriefing";
_global.SCREEN.FES_COOP_OBJECTIVES_BRIEFING = "screens/fes_m_objectivesBriefing";
_global.SCREEN.FES_COOP_POSTGAME_ROUNDUP = "screens/fes_m_postgameRoundup";
_global.SCREEN.FES_SKIRMISH_SETUP = "screens/fes_m_skirmishGameSetup";
_global.SCREEN.FES_CHAPTER_SELECT = "screens/fes_m_chapterSelect";
_global.SCREEN.FES_FACTION_SELECT_MENU = "screens/fes_m_factionMenu";
_global.SCREEN.IGM_SHELL_ROOT = "InGameUI/igm_shellRoot";
_global.SCREEN.IGM_PAUSE_MENU = "InGameUI/igm_pauseMenu";
if(_global.MSGCODE == undefined)
{
_global.MSGCODE = new Object();
}
_global.MSGCODE.FE_HIDE = 0;
_global.MSGCODE.FE_SHOW_LOADSCREEN = 100;
_global.MSGCODE.FE_UPDATE_LOADSCREEN = 101;
_global.MSGCODE.FE_LOADING_COMPLETE = 102;
_global.MSGCODE.FE_MESSAGE_SHOW = 103;
_global.MSGCODE.FE_MESSAGE_HIDE = 104;
_global.MSGCODE.FE_MOVIE_CANCELLED = 105;
_global.MSGCODE.FE_MOVIE_COMPLETED = 106;
_global.MSGCODE.FE_SHOW_MISSION_BRIEFING = 107;
_global.MSGCODE.FE_SHOW_MP_LOADSCREEN = 108;
_global.MSGCODE.FE_SHOW_MP_DISCONNECT = 109;
_global.MSGCODE.FE_HIDE_MP_DISCONNECT = 110;
_global.MSGCODE.FE_CANCEL_OPTIONS_SETTINGS_CONFIRMED = 201;
_global.MSGCODE.FE_PROCEED_TO_TUTORIAL = 305;
_global.MSGCODE.IG_PAUSE_MENU_REFRESH_OBJECTIVES = 1000;
_global.MSGCODE.IG_PAUSE_MENU_SUBMIT_MISSION_MAP = 1001;
_global.MSGCODE.IG_PAUSE_MENU_SELECT_OBJECTIVE = 1002;
_global.MSGCODE.IG_PAUSE_MENU_REFRESH_PLAYER_MUTED = 1003;
_global.MSGCODE.IG_PAUSE_MENU_REFRESH_PLAYER_STATUS = 1004;
if(_global.MSGCODE == undefined)
{
_global.MSGCODE = new Object();
}
_global.MSGCODE.FE_LOAD_SHELL = 20000;
_global.MSGCODE.FE_SHOW_MAIN_MENU = 20001;
_global.MSGCODE.FE_SHOW_MP_GAME_SETUP = 20010;
_global.MSGCODE.FE_SHOW_SAVE_MENU = 20020;
_global.MSGCODE.FE_SHOW_LOAD_MENU = 20021;
_global.MSGCODE.FE_SAVEGAMES_UPDATE = 20022;
_global.MSGCODE.FE_CLOSE_SAVELOAD = 20023;
_global.MSGCODE.IGM_OPEN_SHELL_ROOT = 20100;
_global.MSGCODE.IGM_CLOSE_PAUSE_MENU = 20101;
_global.MSGCODE.FE_SHOW_SKIRMISH_RESULTS = 20200;
_global.MSGCODE.FE_SHOW_CAMPAIGN_RESULTS = 20201;
_global.MSGCODE.FE_SHOW_LAN_RESULTS = 20202;
_global.MSGCODE.FE_SHOW_ONLINE_RESULTS = 20203;
_global.MSGCODE.FE_SHOW_AUTO_MATCH_RESULTS = 20204;
_global.MSGCODE.FE_SHOW_TUTORIAL_RESULTS = 20205;
_global.MSGCODE.FE_MP_UPDATE_GAME_SETTINGS = 21200;
_global.MSGCODE.FE_MP_AUTOMATCH_SEARCH_FAILED = 21250;
_global.MSGCODE.FE_MP_AUTOMATCH_SEARCH_CANCELED = 21275;
_global.MSGCODE.FE_MP_ONLINE_SIGN_IN_SUCCESS = 21300;
_global.MSGCODE.FE_MP_ONLINE_SIGN_IN_FAILURE = 21301;
_global.MSGCODE.FE_MP_ONLINE_GAME_ENUMERATION_COMPLETE = 21302;
_global.MSGCODE.FE_MP_ONLINE_GAME_CONNECT_SUCCESS = 21303;
_global.MSGCODE.FE_MP_ONLINE_GAME_CONNECT_FAILURE = 21304;
_global.MSGCODE.FE_MP_ONLINE_REFRESH_GAMELIST = 21305;
_global.MSGCODE.FE_MP_ONLINE_REFRESH_LOBBYLIST = 21306;
_global.MSGCODE.FE_MP_ONLINE_REFRESH_PLAYERLIST = 21307;
_global.MSGCODE.FE_MP_ONLINE_REFRESH_INVITELIST = 21308;
_global.MSGCODE.FE_MP_ONLINE_INVITE_RECEIVED = 21309;
_global.MSGCODE.FE_MP_ONLINE_REFRESH_GAMEPLAYERS = 21310;
_global.MSGCODE.FE_COOP_ONLINE_GAME_CONNECT_SUCCESS = 21311;
_global.MSGCODE.FE_COOP_ONLINE_GAME_CONNECT_FAILURE = 21312;
_global.MSGCODE.FE_MP_ONLINE_LOBBY_JOINED = 21313;
_global.MSGCODE.FE_MP_REFRESH_CHAT_TEXTLIST = 21314;
_global.MSGCODE.FE_LOST_COCOMMANDER = 21315;
_global.MSGCODE.FE_MP_ONLINE_FRIEND_REQUEST_RECEIVED = 21316;
_global.MSGCODE.FE_MP_ONLINE_FRIEND_STATUS_RECEIVED = 21317;
_global.MSGCODE.FE_COOP_ONLINE_GAME_JOINED_SUCCESS = 21318;
_global.MSGCODE.FE_MP_ONLINE_CAN_HOST_JOIN_CHANGE = 21319;
_global.MSGCODE.FE_MP_ONLINE_SIGN_OUT_SUCCESS = 21320;
_global.MSGCODE.FE_MP_ONLINE_REFRESH_BUDDYLIST = 21321;
_global.MSGCODE.FE_MP_ONLINE_GAME_JOINED_SUCCESS = 21322;
_global.MSGCODE.FE_MP_ONLINE_GAME_COUNTDOWN_START = 21323;
_global.MSGCODE.FE_MP_ONLINE_GAME_COUNTDOWN_STOP = 21324;
_global.MSGCODE.FE_MP_ONLINE_GAME_JOINED_FAILURE = 21325;
_global.MSGCODE.FE_MP_ONLINE_GAME_CREATE_FAILURE = 21326;
_global.MSGCODE.FE_MP_ONLINE_GAME_INCORRECT_PASSWORD = 21327;
_global.MSGCODE.FE_MP_ONLINE_DISCONNECTED = 21330;
_global.MSGCODE.FE_MP_KICKED_FROM_MULTIPLAYER_GAME = 21331;
_global.MSGCODE.FE_MP_KICKED_FROM_COOP_GAME = 21332;
_global.MSGCODE.FE_MP_ONLINE_TOS_SHOW = 21333;
_global.MSGCODE.FE_MP_HOST_LEFT_GAME = 21334;
_global.MSGCODE.FE_COOP_CAMPAIGN_STAGING_STEP_MISSION_INTRO = 21340;
_global.MSGCODE.FE_COOP_CAMPAIGN_STAGING_STEP_RECRUITMENT = 21341;
_global.MSGCODE.FE_COOP_CAMPAIGN_STAGING_STEP_STAGING = 21342;
_global.MSGCODE.FE_COOP_CAMPAIGN_STAGING_STEP_MISSION_BRIEFING = 21343;
_global.MSGCODE.FE_COOP_CAMPAIGN_STAGING_STEP_OBJECTIVE_BRIEFING = 21344;
_global.MSGCODE.FE_COOP_CAMPAIGN_STAGING_START_COUNT_DOWN = 21345;
_global.MSGCODE.FE_COOP_CAMPAIGN_COCOMMANDER_READY = 21346;
_global.MSGCODE.FE_COOP_CAMPAIGN_COMMANDER_READY = 21347;
_global.MSGCODE.FE_TEAM2V2_ONLINE_GAME_CONNECT_SUCCESS = 21360;
_global.MSGCODE.FE_TEAM2v2_ONLINE_GAME_CONNECT_FAILURE = 21361;
_global.MSGCODE.FE_MP_AUTOMATCH_PLAYER_JOINED = 21362;
_global.MSGCODE.FE_MP_AUTOMATCH_HOST_STARTED_SEARCH = 21363;
_global.MSGCODE.FE_MP_AUTOMATCH_PLAYER_LEFT = 21364;
_global.MSGCODE.FE_MP_COUNTDOWN_PAST_POINT_OF_NO_RETURN = 21365;
_global.MSGCODE.FE_NEXT_COMPONENT = 21400;
_global.MSGCODE.FE_PREVIOUS_COMPONENT = 21401;
_global.MSGCODE.FE_UNHANDLED_MOUSE_CLICK = 21600;
_global.MSGCODE.FE_LAN_REFRESH_GAMELIST = 22000;
_global.MSGCODE.FE_LAN_REFRESH_PLAYERLIST = 22001;
_global.MSGCODE.FE_LAN_HOST_GAME_CREATED = 22002;
_global.MSGCODE.FE_LAN_CLIENT_GAME_JOINED = 22003;
_global.MSGCODE.FE_LAN_HOST_LEFT_GAME = 22004;
_global.MSGCODE.FE_MP_LAN_LOBBY_STATE_CHANGE = 22005;
_global.MSGCODE.FE_OPTIONS_REFRESH_AUDIO_CONTROLS = 25000;
_global.MSGCODE.FE_OPTIONS_REFRESH_GENERAL_CONTROLS = 25001;
_global.MSGCODE.FE_OPTIONS_REFRESH_GRAPHICS_CONTROLS = 25002;
_global.MSGCODE.FE_OPTIONS_REFRESH_HOTKEYS_CONTROLS = 25003;
_global.MSGCODE.FE_OPTIONS_REFRESH_NETWORK_CONTROLS = 25004;
_global.MSGCODE.FE_PROFILE_CREATE_SUCCESS = 25100;
_global.MSGCODE.FE_PROFILE_CREATE_FAIL = 25101;
_global.MSGCODE.FE_PROFILE_REFRESH_LIST = 25102;
if(_global.SOUND == undefined)
{
_global.SOUND = new Object();
}
_global.SOUND.SHELL_NONE = "";
_global.SOUND.SHELL_MAIN = "MenuTrack";
_global.SOUND.BRIEFING = "BriefingTrack";
_global.SOUND.CREDITS = "CreditsTrack";
_global.SOUND.STATS_LOSE = "StatsLoseTrack";
_global.SOUND.STATS_WIN = "StatsWinTrack";
_global.SOUND.LAST_VO_PLAYED = "";
if(_global.ENUM == undefined)
{
_global.ENUM = new Object();
}
_global.ENUM.GAME_MODE_NONE = 0;
_global.ENUM.GAME_MODE_CAMPAIGN = 1;
_global.ENUM.GAME_MODE_SKIRMISH = 2;
_global.ENUM.GAME_MODE_TUTORIAL = 3;
_global.ENUM.GAME_MODE_MULTIPLAYER = 4;
_global.ENUM.GAME_MODE_SHELL = 5;
_global.ENUM.GAME_MODE_LAN_MP = 6;
_global.ENUM.GAME_COOPMODE_CHOOSER = -1;
_global.ENUM.GAME_COOPMODE_HOST = 0;
_global.ENUM.GAME_COOPMODE_CLIENT = 1;
_global.ENUM.GAME_COOPMODE_AI = 2;
_global.ENUM.SAVELOADSCREEN_SAVE = 0;
_global.ENUM.SAVELOADSCREEN_LOAD = 1;
_global.ENUM.CAMPAIGN_TYPE_ALLIES = 0;
_global.ENUM.CAMPAIGN_TYPE_SOVIET = 1;
_global.ENUM.CAMPAIGN_TYPE_RISINGSUN = 2;
_global.ENUM.MOUSEBUTTONPRESS_LEFT = 0;
_global.ENUM.MOUSEBUTTONPRESS_MIDDLE = 1;
_global.ENUM.MOUSEBUTTONPRESS_RIGHT = 2;
_global.ENUM.CONTEXTMENU_INVALID_SELECTION = -1;
_global.ENUM.CONTEXTMENU_ADD_AS_FRIEND = 0;
_global.ENUM.CONTEXTMENU_INVITE_TO_GAME = 1;
_global.ENUM.CONTEXTMENU_WHISPER = 2;
_global.ENUM.CONTEXTMENU_PRIVATE_CHAT = 3;
_global.ENUM.CONTEXTMENU_IGNORE = 4;
_global.ENUM.CONTEXTMENU_REMOVE_FROM_FRIENDS = 5;
_global.ENUM.CONTEXTMENU_REMOVE_FROM_IGNORE = 6;
if(_global.GAME == undefined)
{
_global.GAME = new Object();
}
_global.GAME.MODE = _global.ENUM.GAME_MODE_NONE;
_global.GAME.COOPMODE = _global.ENUM.GAME_COOPMODE_AI;
_global.GAME.SAVELOADSCREEN_TYPE = _global.ENUM.SAVELOADSCREEN_LOAD;
_global.GAME.CAMPAIGN_TYPE = _global.ENUM.CAMPAIGN_TYPE_SOVIET;
_global.GAME.PLAY_MISSION_INTRO_MOVIE = false;
if(_global.SHELL == undefined)
{
_global.SHELL = new Object();
}
_global.SHELL.COMLINK_PROMPT_SEEN = false;
_global.SHELL.INVITED_TO_TEAM_AUTOMATCH = false;
this.createEmptyMovieClip("gShellScreen",20);
_global.gShellScreen = _root.gShellScreen;
_global.gShellScreen.loadMovie(_global.SCREEN.FEG_MAIN);
_global.gShellScreen._visible = true;
var hudMC = this.createEmptyMovieClip("hud",10);
hudMC.loadMovie("../common/hud/ig_HUD.swf");
this.createEmptyMovieClip("gMessageBox",900);
_global.gMessageBox = _root.gMessageBox;
_global.gMessageBox.loadMovie(_global.SCREEN.FEG_MESSAGE_BOX);
_global.gMessageBox._visible = true;
this.createEmptyMovieClip("gDisconnect",910);
_global.gDisconnect = _root.gDisconnect;
_global.gDisconnect.loadMovie(_global.SCREEN.FEG_DISCONNECT);
_global.gDisconnect._visible = true;
initGlobalVariables();
_root.main = _global.gFWS.main;
delayMainCall(5);
if(!initialized)
{
initialized = true;
fscommand("OnMainInitialized");
}
@@ -0,0 +1,60 @@
1;__Packages.Cafe2_Imp_BaseControl
2;__Packages.Cafe2_MouseBaseControl
3;__Packages.ICafe2_FocusableControl
4;__Packages.std_Mousebutton_logic
5;__Packages.std_mouseCheckBox_visual
6;__Packages.std_button_logic
7;__Packages.CTRL_CONFIG
8;__Packages.std_config
9;__Packages.std_mouseRadioButton
10;__Packages.careerStatsComponent
11;__Packages.bombAnimationFactory
12;__Packages.blimpAnimationFactory
13;__Packages.movieClip2p5DUIHelper
14;__Packages.std_mouseScrollbar_logic
15;__Packages.CafeFW_IndexMgr
16;__Packages.IScrollbarEventListener
17;__Packages.std_mouseScrollbar_visual
18;__Packages.Cafe2_FocusableBody
19;__Packages.Cafe2_SldBarBody
20;__Packages.std_mouseTextInputField
21;__Packages.IListboxEntryElementEventListener
22;__Packages.std_mouseScrollingListboxEntry
23;__Packages.IListboxEntryEventListener
24;__Packages.CafeFW_ComponentTracker
25;__Packages.IListboxEventListener
26;__Packages.lobbyListComponent
27;__Packages.CafeFW_FocusManager
28;__Packages.std_mouseRadioButtonController
29;__Packages.fe_m_TitleBarComponent
30;__Packages.ChatComponent
31;__Packages.std_Mousebutton_visual
32;__Packages.inviteListComponent
33;__Packages.std_mouseScrollingListbox
34;__Packages.CafeFW_ControllerManager
35;__Packages.gameListComponent
36;__Packages.Cafe2_FocusablePart
37;__Packages.contextMenuEntry
38;__Packages.CafeFW_MessageHandler
39;__Packages.ICafe2_FWSettings
40;__Packages.main_mouse_settings
41;__Packages.std_mouseSlider_logic
42;__Packages.std_mouseSlider_visual
43;__Packages.std_slider_logic
44;__Packages.MovieComponent
45;__Packages.buddyListComponent
46;__Packages.std_mouseDropDownMenu
47;__Packages.Cafe2_ScrollbarBody
48;__Packages.CafeFW_EventHandler
49;__Packages.CafeFW_OverlayManager
50;__Packages.std_MouseAccordionButton
51;__Packages.std_mouseListboxEntryElement
52;__Packages.std_mouseListboxEntryColorSwatchElement
53;__Packages.std_mouseListboxEntryRenderImageElement
54;__Packages.std_mouseListboxEntryTextElement
55;__Packages.mouse_chapterSelectComponent
56;__Packages.playerListComponent
57;__Packages.std_MouseAccordionMenu
58;__Packages.std_mouseListboxEntryGameStatusElement
59;__Packages.Cafe2_OnOffAnimPart
60;__Packages.CafeFW_ScreenManager
1 1 __Packages.Cafe2_Imp_BaseControl
2 2 __Packages.Cafe2_MouseBaseControl
3 3 __Packages.ICafe2_FocusableControl
4 4 __Packages.std_Mousebutton_logic
5 5 __Packages.std_mouseCheckBox_visual
6 6 __Packages.std_button_logic
7 7 __Packages.CTRL_CONFIG
8 8 __Packages.std_config
9 9 __Packages.std_mouseRadioButton
10 10 __Packages.careerStatsComponent
11 11 __Packages.bombAnimationFactory
12 12 __Packages.blimpAnimationFactory
13 13 __Packages.movieClip2p5DUIHelper
14 14 __Packages.std_mouseScrollbar_logic
15 15 __Packages.CafeFW_IndexMgr
16 16 __Packages.IScrollbarEventListener
17 17 __Packages.std_mouseScrollbar_visual
18 18 __Packages.Cafe2_FocusableBody
19 19 __Packages.Cafe2_SldBarBody
20 20 __Packages.std_mouseTextInputField
21 21 __Packages.IListboxEntryElementEventListener
22 22 __Packages.std_mouseScrollingListboxEntry
23 23 __Packages.IListboxEntryEventListener
24 24 __Packages.CafeFW_ComponentTracker
25 25 __Packages.IListboxEventListener
26 26 __Packages.lobbyListComponent
27 27 __Packages.CafeFW_FocusManager
28 28 __Packages.std_mouseRadioButtonController
29 29 __Packages.fe_m_TitleBarComponent
30 30 __Packages.ChatComponent
31 31 __Packages.std_Mousebutton_visual
32 32 __Packages.inviteListComponent
33 33 __Packages.std_mouseScrollingListbox
34 34 __Packages.CafeFW_ControllerManager
35 35 __Packages.gameListComponent
36 36 __Packages.Cafe2_FocusablePart
37 37 __Packages.contextMenuEntry
38 38 __Packages.CafeFW_MessageHandler
39 39 __Packages.ICafe2_FWSettings
40 40 __Packages.main_mouse_settings
41 41 __Packages.std_mouseSlider_logic
42 42 __Packages.std_mouseSlider_visual
43 43 __Packages.std_slider_logic
44 44 __Packages.MovieComponent
45 45 __Packages.buddyListComponent
46 46 __Packages.std_mouseDropDownMenu
47 47 __Packages.Cafe2_ScrollbarBody
48 48 __Packages.CafeFW_EventHandler
49 49 __Packages.CafeFW_OverlayManager
50 50 __Packages.std_MouseAccordionButton
51 51 __Packages.std_mouseListboxEntryElement
52 52 __Packages.std_mouseListboxEntryColorSwatchElement
53 53 __Packages.std_mouseListboxEntryRenderImageElement
54 54 __Packages.std_mouseListboxEntryTextElement
55 55 __Packages.mouse_chapterSelectComponent
56 56 __Packages.playerListComponent
57 57 __Packages.std_MouseAccordionMenu
58 58 __Packages.std_mouseListboxEntryGameStatusElement
59 59 __Packages.Cafe2_OnOffAnimPart
60 60 __Packages.CafeFW_ScreenManager