first commit
This commit is contained in:
BIN
Binary file not shown.
|
After Width: | Height: | Size: 260 B |
+128
@@ -0,0 +1,128 @@
|
||||
class Cafe2_BaseUIScreen
|
||||
{
|
||||
var m_changeToScreen = null;
|
||||
var m_uiComponentArray = new Array();
|
||||
function Cafe2_BaseUIScreen()
|
||||
{
|
||||
}
|
||||
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 backButtonClicked()
|
||||
{
|
||||
trace("Cafe2_BaseUIScreen::backButtonClicked()");
|
||||
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;
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
class feg_m_mainMenu extends Cafe2_BaseUIScreen
|
||||
{
|
||||
var m_names = new Array();
|
||||
var m_values = new Array();
|
||||
function feg_m_mainMenu(screen)
|
||||
{
|
||||
super();
|
||||
trace("feg_m_mainMenu::feg_m_mainMenu() screen = " + screen);
|
||||
Cafe2_BaseUIScreen.m_screen = screen;
|
||||
Cafe2_BaseUIScreen.m_thisClass = this;
|
||||
Cafe2_BaseUIScreen.m_thisClass.initGUI();
|
||||
}
|
||||
function initGUI()
|
||||
{
|
||||
trace("feg_m_mainMenu::initGUI() " + _global.gEH);
|
||||
Cafe2_BaseUIScreen.m_screen.singlePlayerButton._visible = true;
|
||||
Cafe2_BaseUIScreen.m_screen.singlePlayerButton.enable();
|
||||
Cafe2_BaseUIScreen.m_screen.singlePlayerButton.setOnFocus(Cafe2_BaseUIScreen.m_thisClass.singlePlayerGotFocus);
|
||||
Cafe2_BaseUIScreen.m_screen.singlePlayerButton.setOnBlur(Cafe2_BaseUIScreen.m_thisClass.singlePlayerLostFocus);
|
||||
Cafe2_BaseUIScreen.m_screen.singlePlayerButton.setOnMouseUpFunction(Cafe2_BaseUIScreen.m_thisClass.singlePlayerSelected);
|
||||
Cafe2_BaseUIScreen.m_screen.multiPlayerButton._visible = true;
|
||||
Cafe2_BaseUIScreen.m_screen.multiPlayerButton.enable();
|
||||
Cafe2_BaseUIScreen.m_screen.multiPlayerButton.setOnFocus(Cafe2_BaseUIScreen.m_thisClass.multiPlayerGotFocus);
|
||||
Cafe2_BaseUIScreen.m_screen.multiPlayerButton.setOnBlur(Cafe2_BaseUIScreen.m_thisClass.multiPlayerLostFocus);
|
||||
Cafe2_BaseUIScreen.m_screen.multiPlayerButton.setOnMouseUpFunction(Cafe2_BaseUIScreen.m_thisClass.multiPlayerSelected);
|
||||
Cafe2_BaseUIScreen.m_screen.optionsButton._visible = true;
|
||||
Cafe2_BaseUIScreen.m_screen.optionsButton.enable();
|
||||
Cafe2_BaseUIScreen.m_screen.optionsButton.setOnFocus(Cafe2_BaseUIScreen.m_thisClass.optionsGotFocus);
|
||||
Cafe2_BaseUIScreen.m_screen.optionsButton.setOnBlur(Cafe2_BaseUIScreen.m_thisClass.optionsLostFocus);
|
||||
Cafe2_BaseUIScreen.m_screen.optionsButton.setOnMouseUpFunction(Cafe2_BaseUIScreen.m_thisClass.optionsSelected);
|
||||
Cafe2_BaseUIScreen.m_screen.quitButton._visible = true;
|
||||
Cafe2_BaseUIScreen.m_screen.quitButton.enable();
|
||||
Cafe2_BaseUIScreen.m_screen.quitButton.setOnFocus(Cafe2_BaseUIScreen.m_thisClass.quitGotFocus);
|
||||
Cafe2_BaseUIScreen.m_screen.quitButton.setOnBlur(Cafe2_BaseUIScreen.m_thisClass.quitLostFocus);
|
||||
Cafe2_BaseUIScreen.m_screen.quitButton.setOnMouseUpFunction(Cafe2_BaseUIScreen.m_thisClass.quitSelected);
|
||||
Cafe2_BaseUIScreen.m_screen.uiComponentsTestButton._visible = true;
|
||||
Cafe2_BaseUIScreen.m_screen.uiComponentsTestButton.enable();
|
||||
Cafe2_BaseUIScreen.m_screen.uiComponentsTestButton.setOnFocus(Cafe2_BaseUIScreen.m_thisClass.testComponentsGotFocus);
|
||||
Cafe2_BaseUIScreen.m_screen.uiComponentsTestButton.setOnBlur(Cafe2_BaseUIScreen.m_thisClass.testComponentsLostFocus);
|
||||
Cafe2_BaseUIScreen.m_screen.uiComponentsTestButton.setOnMouseUpFunction(Cafe2_BaseUIScreen.m_thisClass.testComponentsSelected);
|
||||
Cafe2_BaseUIScreen.m_screen.mmPrototype._visible = true;
|
||||
Cafe2_BaseUIScreen.m_screen.mmPrototype.enable();
|
||||
Cafe2_BaseUIScreen.m_screen.mmPrototype.setOnFocus(Cafe2_BaseUIScreen.m_thisClass.mmPrototypeGotFocus);
|
||||
Cafe2_BaseUIScreen.m_screen.mmPrototype.setOnBlur(Cafe2_BaseUIScreen.m_thisClass.mmPrototypeLostFocus);
|
||||
Cafe2_BaseUIScreen.m_screen.mmPrototype.setOnMouseUpFunction(Cafe2_BaseUIScreen.m_thisClass.mmPrototypeSelected);
|
||||
this.registerIntroOuttroComponents([singlePlayerButton,multiPlayerButton,optionsButton,quitButton]);
|
||||
this.startIntro();
|
||||
_global.gSM.setOnExitScreen(Cafe2_BaseUIScreen.m_thisClass.onScreenExit);
|
||||
}
|
||||
function onScreenExit()
|
||||
{
|
||||
trace("feg_m_mainMenu::onScreenExit()");
|
||||
_global.gMH.removeMessageHandler(Cafe2_BaseUIScreen.m_thisClass.localMessageHandler);
|
||||
this.clearData();
|
||||
Cafe2_BaseUIScreen.m_screen = null;
|
||||
Cafe2_BaseUIScreen.m_thisClass = null;
|
||||
delete _global.feg_m_mainMenu;
|
||||
delete _global.Cafe2_BaseUIScreen;
|
||||
}
|
||||
function localMessageHandler(messageCode)
|
||||
{
|
||||
trace("feg_m_mainMenu::localMessageHandler() messageCode = \'" + messageCode + "\'");
|
||||
var _loc1_ = false;
|
||||
return _loc1_;
|
||||
}
|
||||
function singlePlayerGotFocus()
|
||||
{
|
||||
trace("feg_m_mainMenu::button 1 got focus");
|
||||
}
|
||||
function singlePlayerLostFocus()
|
||||
{
|
||||
trace("feg_m_mainMenu::button lost focus");
|
||||
}
|
||||
function singlePlayerSelected()
|
||||
{
|
||||
trace("feg_m_mainMenu::GO TO SINGLE PLAYER MENU");
|
||||
Cafe2_BaseUIScreen.m_thisClass.startOuttro(_global.SCREEN.FES_SINGLE_PLAYER_MENU);
|
||||
}
|
||||
function multiPlayerGotFocus()
|
||||
{
|
||||
trace("feg_m_mainMenu::button 2 got focus");
|
||||
}
|
||||
function multiPlayerLostFocus()
|
||||
{
|
||||
trace("feg_m_mainMenu::button 2 lost focus");
|
||||
}
|
||||
function multiPlayerSelected()
|
||||
{
|
||||
trace("feg_m_mainMenu::GO TO MULTI PLAYER MENU");
|
||||
Cafe2_BaseUIScreen.m_thisClass.startOuttro(_global.SCREEN.FEM_MULTI_PLAYER_MENU);
|
||||
}
|
||||
function optionsGotFocus()
|
||||
{
|
||||
trace("feg_m_mainMenu::button 3 got focus");
|
||||
}
|
||||
function optionsLostFocus()
|
||||
{
|
||||
trace("feg_m_mainMenu::button 3 lost focus");
|
||||
}
|
||||
function optionsSelected()
|
||||
{
|
||||
trace("feg_m_mainMenu::GO TO OPTIONS MENU");
|
||||
Cafe2_BaseUIScreen.m_thisClass.startOuttro(_global.SCREEN.FEG_BB_OPTIONS);
|
||||
}
|
||||
function quitGotFocus()
|
||||
{
|
||||
trace("feg_m_mainMenu::quitGotFocus()");
|
||||
}
|
||||
function quitLostFocus()
|
||||
{
|
||||
trace("feg_m_mainMenu::quitLostFocus()");
|
||||
}
|
||||
function quitSelected()
|
||||
{
|
||||
trace("feg_m_mainMenu::quitSelected() ");
|
||||
getUrl("FSCommand:CallGameFunction", "%ExitApplication");
|
||||
}
|
||||
function testComponentsGotFocus()
|
||||
{
|
||||
trace("feg_m_mainMenu::testComponentsButtonGotFocus");
|
||||
}
|
||||
function testComponentsLostFocus()
|
||||
{
|
||||
trace("feg_m_mainMenu::testComponentsButtonLostFocus");
|
||||
}
|
||||
function testComponentsSelected()
|
||||
{
|
||||
trace("feg_m_mainMenu::testComponentsSelected" + Cafe2_BaseUIScreen.m_thisClass);
|
||||
Cafe2_BaseUIScreen.m_thisClass.startOuttro(_global.SCREEN.FEG_CAFE_UI_WIDGET_TEST_SCREEN);
|
||||
}
|
||||
function mmPrototypeGotFocus()
|
||||
{
|
||||
trace("feg_m_mainMenu::mmPrototypeGotFocus");
|
||||
}
|
||||
function mmPrototypeLostFocus()
|
||||
{
|
||||
trace("feg_m_mainMenu::mmPrototypeLostFocus");
|
||||
}
|
||||
function mmPrototypeSelected()
|
||||
{
|
||||
trace("feg_m_mainMenu::mmPrototypeSelected" + Cafe2_BaseUIScreen.m_thisClass);
|
||||
Cafe2_BaseUIScreen.m_thisClass.startOuttro(_global.SCREEN.FEG_MAINMENU_TEST_SCREEN);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
var screen = new feg_m_mainMenu(this);
|
||||
stop();
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
on(construct){
|
||||
m_width = 200;
|
||||
m_textAlign = true;
|
||||
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 = "Single Player Maps";
|
||||
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 = true;
|
||||
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 = "Multiplayer";
|
||||
m_bEnabled = true;
|
||||
m_refFM = "_global.gFM";
|
||||
m_initiallySelected = false;
|
||||
m_tabIndex = 1;
|
||||
m_bVisible = true;
|
||||
m_contentSymbol = "buttonContentSymbol";
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
on(construct){
|
||||
m_width = 200;
|
||||
m_textAlign = true;
|
||||
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 = "Options";
|
||||
m_bEnabled = true;
|
||||
m_refFM = "_global.gFM";
|
||||
m_initiallySelected = false;
|
||||
m_tabIndex = 2;
|
||||
m_bVisible = true;
|
||||
m_contentSymbol = "buttonContentSymbol";
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
on(construct){
|
||||
m_width = 200;
|
||||
m_textAlign = true;
|
||||
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 = "Quit";
|
||||
m_bEnabled = true;
|
||||
m_refFM = "_global.gFM";
|
||||
m_initiallySelected = false;
|
||||
m_tabIndex = 3;
|
||||
m_bVisible = true;
|
||||
m_contentSymbol = "buttonContentSymbol";
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
2;screenAreaButtonSymbol
|
||||
6;__Packages.Cafe2_BaseUIScreen
|
||||
7;__Packages.feg_m_mainMenu
|
||||
|
@@ -0,0 +1 @@
|
||||
RA3 - Main Menu
|
||||
Reference in New Issue
Block a user