first commit
This commit is contained in:
+83
@@ -0,0 +1,83 @@
|
||||
class Cafe2_BaseUIScreen
|
||||
{
|
||||
var m_changeToScreen = null;
|
||||
var m_uiComponentArray = new Array();
|
||||
function Cafe2_BaseUIScreen()
|
||||
{
|
||||
}
|
||||
function outtroComplete(theComponent)
|
||||
{
|
||||
trace("Cafe2_BaseUIScreen::OUTTRO COMPLETE " + 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 isIntroComplete()
|
||||
{
|
||||
var _loc2_ = 0;
|
||||
while(_loc2_ < this.m_uiComponentArray.length)
|
||||
{
|
||||
if(this.m_uiComponentArray[_loc2_].isIntroComplete() == false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
_loc2_ = _loc2_ + 1;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
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 menuButtonClicked(newScreen)
|
||||
{
|
||||
trace("Cafe2_BaseUIScreen::menuButtonClicked");
|
||||
this.m_changeToScreen = newScreen;
|
||||
var _loc3_ = Cafe2_BaseUIScreen.m_thisClass.m_uiComponentArray.length;
|
||||
var _loc2_ = 0;
|
||||
while(_loc2_ < _loc3_)
|
||||
{
|
||||
Cafe2_BaseUIScreen.m_thisClass.m_uiComponentArray[_loc2_].outtro(this.outtroComplete);
|
||||
_loc2_ = _loc2_ + 1;
|
||||
}
|
||||
}
|
||||
function backButtonClicked()
|
||||
{
|
||||
trace("Cafe2_BaseUIScreen::Back button selected (clicked)");
|
||||
var _loc2_ = Cafe2_BaseUIScreen.m_thisClass.m_uiComponentArray.length;
|
||||
var _loc1_ = 0;
|
||||
while(_loc1_ < _loc2_)
|
||||
{
|
||||
Cafe2_BaseUIScreen.m_thisClass.m_uiComponentArray[_loc1_].outtro(Cafe2_BaseUIScreen.m_thisClass.executeBackFunction);
|
||||
_loc1_ = _loc1_ + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
class fem_m_battleCast extends Cafe2_BaseUIScreen
|
||||
{
|
||||
var m_names = new Array();
|
||||
var m_values = new Array();
|
||||
function fem_m_battleCast(screen)
|
||||
{
|
||||
super();
|
||||
trace("fem_m_battleCast::fem_m_battleCast() screen = " + screen);
|
||||
Cafe2_BaseUIScreen.m_screen = screen;
|
||||
Cafe2_BaseUIScreen.m_thisClass = this;
|
||||
Cafe2_BaseUIScreen.m_thisClass.initGUI();
|
||||
}
|
||||
function initGUI()
|
||||
{
|
||||
trace("fem_m_battleCast::initGUI() " + _global.gEH);
|
||||
trace("fem_m_battleCast::initGUI() " + this.localEventHandler);
|
||||
Cafe2_BaseUIScreen.m_screen.acceptButton._visible = true;
|
||||
Cafe2_BaseUIScreen.m_screen.acceptButton.enableGUI();
|
||||
Cafe2_BaseUIScreen.m_screen.acceptButton.setOnFocus(Cafe2_BaseUIScreen.m_thisClass.acceptButtonGotFocus);
|
||||
Cafe2_BaseUIScreen.m_screen.acceptButton.setOnBlur(Cafe2_BaseUIScreen.m_thisClass.acceptButtonLostFocus);
|
||||
Cafe2_BaseUIScreen.m_screen.acceptButton.setOnMouseUpFunction(Cafe2_BaseUIScreen.m_thisClass.acceptButtonClicked);
|
||||
Cafe2_BaseUIScreen.m_screen.acceptButton.setIntroCallback(this.introComplete);
|
||||
Cafe2_BaseUIScreen.m_screen.backButton._visible = true;
|
||||
Cafe2_BaseUIScreen.m_screen.backButton.enableGUI();
|
||||
Cafe2_BaseUIScreen.m_screen.backButton.setOnFocus(Cafe2_BaseUIScreen.m_thisClass.backButtonGotFocus);
|
||||
Cafe2_BaseUIScreen.m_screen.backButton.setOnBlur(Cafe2_BaseUIScreen.m_thisClass.backButtonLostFocus);
|
||||
Cafe2_BaseUIScreen.m_screen.backButton.setOnMouseUpFunction(Cafe2_BaseUIScreen.m_thisClass.backButtonClicked);
|
||||
Cafe2_BaseUIScreen.m_screen.backButton.setIntroCallback(this.introComplete);
|
||||
this.m_uiComponentArray = [Cafe2_BaseUIScreen.m_screen.acceptButton,Cafe2_BaseUIScreen.m_screen.backButton];
|
||||
_global.gSM.setOnExitScreen(this.onScreenExit);
|
||||
_global.gEH.setLocalEventHandler(this.localEventHandler);
|
||||
_global.gEH.enableLocalEventHandler();
|
||||
}
|
||||
function introComplete(theComponent)
|
||||
{
|
||||
theComponent.unhighlight();
|
||||
}
|
||||
function onScreenExit()
|
||||
{
|
||||
trace("fem_m_battleCast::onScreenExit()");
|
||||
delete _global.fem_m_battleCast;
|
||||
}
|
||||
function localEventHandler(keyCode, controller)
|
||||
{
|
||||
trace("fem_m_battleCast::localEventHandler() keyCode == " + keyCode);
|
||||
Cafe2_BaseUIScreen.m_screen.debug.text = "kc = " + String(keyCode);
|
||||
gFM.handleDefaultInputs(keyCode);
|
||||
}
|
||||
function backButtonGotFocus()
|
||||
{
|
||||
trace("fem_m_battleCast::Back button got focus");
|
||||
}
|
||||
function backButtonLostFocus()
|
||||
{
|
||||
trace("fem_m_battleCast::Back button lost focus");
|
||||
}
|
||||
function acceptButtonGotFocus()
|
||||
{
|
||||
trace("fem_m_battleCast::accept button got focus");
|
||||
}
|
||||
function acceptButtonLostFocus()
|
||||
{
|
||||
trace("fem_m_battleCast::accept button lost focus");
|
||||
}
|
||||
function acceptButtonClicked()
|
||||
{
|
||||
trace("fem_m_battleCast::accept button selected (clicked)");
|
||||
Cafe2_BaseUIScreen.m_thisClass.menuButtonClicked(_global.SCREEN.FEM_MP_LOBBY);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
var screen = new fem_m_battleCast(this);
|
||||
stop();
|
||||
+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 = "_global.gFM";
|
||||
m_initiallySelected = false;
|
||||
m_tabIndex = 0;
|
||||
m_bVisible = true;
|
||||
m_contentSymbol = "buttonContentSymbol";
|
||||
}
|
||||
+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 = "Accept";
|
||||
m_bEnabled = true;
|
||||
m_refFM = "_global.gFM";
|
||||
m_initiallySelected = false;
|
||||
m_tabIndex = 1;
|
||||
m_bVisible = true;
|
||||
m_contentSymbol = "buttonContentSymbol";
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
4;__Packages.Cafe2_BaseUIScreen
|
||||
5;__Packages.fem_m_battleCast
|
||||
|
@@ -0,0 +1 @@
|
||||
RA 3 - Battle Cast UI
|
||||
Reference in New Issue
Block a user