first commit
This commit is contained in:
+193
@@ -0,0 +1,193 @@
|
||||
class Cafe2_BaseUIScreen
|
||||
{
|
||||
var m_changeToScreen = null;
|
||||
var m_executeOuttroCallBack = null;
|
||||
var m_uiComponentArray = new Array();
|
||||
function Cafe2_BaseUIScreen(screen)
|
||||
{
|
||||
Cafe2_BaseUIScreen.m_screen = screen;
|
||||
Cafe2_BaseUIScreen.m_screen.onEnterFrame = _global.bind0(this,this.frameDelayedInitCallback);
|
||||
}
|
||||
function frameDelayedInit()
|
||||
{
|
||||
trace("\n\nCafe2_BaseUIScreen::frameDelayedInitCallback() :");
|
||||
var _loc1_ = new Array("N.B. You *must* override frameDelayedInit() in your","\nscreens and move the call to initGUI() to frameDelayedInit().\n");
|
||||
trace(_loc1_[0] + _loc1_[1]);
|
||||
}
|
||||
function frameDelayedInitCallback()
|
||||
{
|
||||
Cafe2_BaseUIScreen.m_screen.onEnterFrame = null;
|
||||
this.frameDelayedInit();
|
||||
}
|
||||
function outtroComplete(theComponent)
|
||||
{
|
||||
trace("Cafe2_BaseUIScreen::outtroComplete() " + theComponent);
|
||||
var _loc2_ = 0;
|
||||
while(_loc2_ < Cafe2_BaseUIScreen.m_thisClass.m_uiComponentArray.length)
|
||||
{
|
||||
if(theComponent == Cafe2_BaseUIScreen.m_thisClass.m_uiComponentArray[_loc2_])
|
||||
{
|
||||
break;
|
||||
}
|
||||
_loc2_ = _loc2_ + 1;
|
||||
}
|
||||
Cafe2_BaseUIScreen.m_thisClass.m_uiComponentArray.splice(_loc2_,1);
|
||||
if(Cafe2_BaseUIScreen.m_thisClass.m_uiComponentArray.length <= 0)
|
||||
{
|
||||
if(Cafe2_BaseUIScreen.m_thisClass.m_changeToScreen != null)
|
||||
{
|
||||
_global.gSM.changeMainScreen(Cafe2_BaseUIScreen.m_thisClass.m_changeToScreen);
|
||||
}
|
||||
}
|
||||
}
|
||||
function introComplete(theComponent)
|
||||
{
|
||||
trace("Cafe2_BaseUIScreen::introComplete()");
|
||||
theComponent.restoreVisualState();
|
||||
Cafe2_BaseUIScreen.m_thisClass.m_introCount--;
|
||||
if(Cafe2_BaseUIScreen.m_thisClass.m_introCount <= 0)
|
||||
{
|
||||
Cafe2_BaseUIScreen.m_thisClass.onIntrosComplete();
|
||||
}
|
||||
}
|
||||
function onIntrosComplete()
|
||||
{
|
||||
trace("Cafe2_BaseUIScreen::onIntrosComplete()");
|
||||
_global.gEH.setLocalEventHandler(this.localEventHandler);
|
||||
_global.gEH.enableCurrentLocalEventHandler();
|
||||
}
|
||||
function registerIntroOuttroComponents(components)
|
||||
{
|
||||
trace("Cafe2_BaseUIScreen::registerIntroOuttroComponents()");
|
||||
this.m_uiComponentArray = components;
|
||||
this.m_introCount = this.m_uiComponentArray.length;
|
||||
var _loc2_ = 0;
|
||||
while(_loc2_ < this.m_introCount)
|
||||
{
|
||||
this.m_uiComponentArray[_loc2_].setIntroCallback(this.introComplete);
|
||||
_loc2_ = _loc2_ + 1;
|
||||
}
|
||||
}
|
||||
function executeBackFunction(theComponent)
|
||||
{
|
||||
trace("Cafe2_BaseUIScreen::executeBackFunction" + theComponent);
|
||||
var _loc2_ = 0;
|
||||
while(_loc2_ < Cafe2_BaseUIScreen.m_thisClass.m_uiComponentArray.length)
|
||||
{
|
||||
if(theComponent == Cafe2_BaseUIScreen.m_thisClass.m_uiComponentArray[_loc2_])
|
||||
{
|
||||
break;
|
||||
}
|
||||
_loc2_ = _loc2_ + 1;
|
||||
}
|
||||
Cafe2_BaseUIScreen.m_thisClass.m_uiComponentArray.splice(_loc2_,1);
|
||||
if(Cafe2_BaseUIScreen.m_thisClass.m_uiComponentArray.length <= 0)
|
||||
{
|
||||
_global.gSM.goBackScreen();
|
||||
}
|
||||
}
|
||||
function startIntro()
|
||||
{
|
||||
trace("Cafe2_BaseUIScreen::startIntro()");
|
||||
var _loc3_ = this.m_uiComponentArray.length;
|
||||
var _loc2_ = 0;
|
||||
while(_loc2_ < _loc3_)
|
||||
{
|
||||
this.m_uiComponentArray[_loc2_].intro();
|
||||
_loc2_ = _loc2_ + 1;
|
||||
}
|
||||
}
|
||||
function startOuttro(newScreen)
|
||||
{
|
||||
trace("Cafe2_BaseUIScreen::startOuttro");
|
||||
this.m_changeToScreen = newScreen;
|
||||
var _loc3_ = Cafe2_BaseUIScreen.m_thisClass.m_uiComponentArray.length;
|
||||
if(_loc3_ > 0)
|
||||
{
|
||||
var _loc2_ = 0;
|
||||
while(_loc2_ < _loc3_)
|
||||
{
|
||||
Cafe2_BaseUIScreen.m_thisClass.m_uiComponentArray[_loc2_].outtro(this.outtroComplete);
|
||||
_loc2_ = _loc2_ + 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.outtroComplete(null);
|
||||
}
|
||||
}
|
||||
function startOuttroAndCallBack(doAfterOuttroComplete)
|
||||
{
|
||||
trace("Cafe2_BaseUIScreen::startOuttro");
|
||||
this.m_executeOuttroCallBack = doAfterOuttroComplete;
|
||||
var _loc3_ = Cafe2_BaseUIScreen.m_thisClass.m_uiComponentArray.length;
|
||||
if(_loc3_ > 0)
|
||||
{
|
||||
var _loc2_ = 0;
|
||||
while(_loc2_ < _loc3_)
|
||||
{
|
||||
Cafe2_BaseUIScreen.m_thisClass.m_uiComponentArray[_loc2_].outtro(this.outtroAndCallBackComplete);
|
||||
_loc2_ = _loc2_ + 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.outtroAndCallBackComplete(null);
|
||||
}
|
||||
}
|
||||
function outtroAndCallBackComplete(theComponent)
|
||||
{
|
||||
trace("Cafe2_BaseUIScreen::outtroComplete() " + theComponent);
|
||||
var _loc1_ = 0;
|
||||
while(_loc1_ < Cafe2_BaseUIScreen.m_thisClass.m_uiComponentArray.length)
|
||||
{
|
||||
if(theComponent == Cafe2_BaseUIScreen.m_thisClass.m_uiComponentArray[_loc1_])
|
||||
{
|
||||
break;
|
||||
}
|
||||
_loc1_ = _loc1_ + 1;
|
||||
}
|
||||
Cafe2_BaseUIScreen.m_thisClass.m_uiComponentArray.splice(_loc1_,1);
|
||||
if(Cafe2_BaseUIScreen.m_thisClass.m_uiComponentArray.length <= 0)
|
||||
{
|
||||
Cafe2_BaseUIScreen.m_thisClass.m_executeOuttroCallBack();
|
||||
}
|
||||
}
|
||||
function backButtonClicked()
|
||||
{
|
||||
trace("Cafe2_BaseUIScreen::backButtonClicked()");
|
||||
var _loc3_ = Cafe2_BaseUIScreen.m_thisClass.m_uiComponentArray.length;
|
||||
if(_loc3_ > 0)
|
||||
{
|
||||
var _loc2_ = 0;
|
||||
while(_loc2_ < _loc3_)
|
||||
{
|
||||
Cafe2_BaseUIScreen.m_thisClass.m_uiComponentArray[_loc2_].outtro(Cafe2_BaseUIScreen.m_thisClass.executeBackFunction);
|
||||
_loc2_ = _loc2_ + 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_global.gSM.goBackScreen();
|
||||
}
|
||||
}
|
||||
function localEventHandler(keyCode, controller)
|
||||
{
|
||||
trace("Cafe2_BaseUIScreen::localEventHandler() keyCode == " + keyCode);
|
||||
_global.gFM.handleDefaultInputs(keyCode);
|
||||
}
|
||||
function clearData()
|
||||
{
|
||||
Cafe2_BaseUIScreen.m_screen = null;
|
||||
Cafe2_BaseUIScreen.m_thisClass = null;
|
||||
this.m_changeToScreen = null;
|
||||
this.m_uiComponentArray = null;
|
||||
}
|
||||
function bind0(obj, func)
|
||||
{
|
||||
return function()
|
||||
{
|
||||
func.call(obj);
|
||||
};
|
||||
}
|
||||
}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
class feg_m_profileStats extends Cafe2_BaseUIScreen
|
||||
{
|
||||
function feg_m_profileStats(screen)
|
||||
{
|
||||
super(screen);
|
||||
Cafe2_BaseUIScreen.m_thisClass = this;
|
||||
trace("------------------------------------------------------------------");
|
||||
trace("feg_m_profileStats::feg_m_profileStats()");
|
||||
}
|
||||
function frameDelayedInit()
|
||||
{
|
||||
trace("feg_m_profileStats::frameDelayedInit()");
|
||||
this.initGUI();
|
||||
this.startIntro();
|
||||
}
|
||||
function initGUI()
|
||||
{
|
||||
trace("feg_m_profileStats::initGUI()");
|
||||
Cafe2_BaseUIScreen.m_screen.btnMainMenu.show();
|
||||
Cafe2_BaseUIScreen.m_screen.btnMainMenu.enable();
|
||||
Cafe2_BaseUIScreen.m_screen.btnMainMenu.setOnMouseUpFunction(_global.bind0(this,this.onMainMenuClicked));
|
||||
this.registerIntroOuttroComponents([Cafe2_BaseUIScreen.m_screen.btnMainMenu]);
|
||||
_global.gSM.setOnExitScreen(_global.bind0(this,this.onScreenExit));
|
||||
}
|
||||
function onScreenExit()
|
||||
{
|
||||
trace("feg_m_profileStats::onScreenExit()");
|
||||
this.clearData();
|
||||
delete _global.feg_m_profileStats;
|
||||
delete _global.Cafe2_BaseUIScreen;
|
||||
}
|
||||
function onMainMenuClicked()
|
||||
{
|
||||
trace("feg_m_profileStats::onMainMenuClicked()");
|
||||
this.backButtonClicked();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
var screen = new feg_m_profileStats(this);
|
||||
stop();
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
on(construct){
|
||||
m_title = "$PROFILESTATS";
|
||||
m_DropShadow = true;
|
||||
m_Outline = true;
|
||||
m_visible = true;
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
on(construct){
|
||||
m_numLines = 0;
|
||||
m_width = 0;
|
||||
m_chatMode = 0;
|
||||
m_preservePlacement = false;
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
on(construct){
|
||||
m_width = 200;
|
||||
m_textAlign = false;
|
||||
m_labelPosition = "right align";
|
||||
m_label_x = 0;
|
||||
m_label_y = 0;
|
||||
m_focusDirs = "Up/Down";
|
||||
m_iconType = "default";
|
||||
m_extLabel = "";
|
||||
m_nTruncateType = 0;
|
||||
m_label = "$BACK";
|
||||
m_bEnabled = true;
|
||||
m_refFM = "_root.gFM";
|
||||
m_initiallySelected = false;
|
||||
m_tabIndex = 0;
|
||||
m_bVisible = true;
|
||||
m_contentSymbol = "buttonContentSymbol";
|
||||
}
|
||||
Reference in New Issue
Block a user