first commit
This commit is contained in:
+4
@@ -0,0 +1,4 @@
|
||||
on(press){
|
||||
gotoAndStop("_down");
|
||||
play();
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
on(release){
|
||||
gotoAndStop("_over");
|
||||
play();
|
||||
onClicked();
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
on(rollOut){
|
||||
gotoAndStop("_up");
|
||||
play();
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
on(rollOver){
|
||||
gotoAndStop("_over");
|
||||
play();
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
stop();
|
||||
+1
@@ -0,0 +1 @@
|
||||
stop();
|
||||
+1
@@ -0,0 +1 @@
|
||||
stop();
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
onClipEvent(load){
|
||||
_visible = false;
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
on(construct){
|
||||
m_nLength = 100;
|
||||
m_nMax = 19;
|
||||
m_nMin = 0;
|
||||
m_nValue = 0;
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
stop();
|
||||
+1
@@ -0,0 +1 @@
|
||||
stop();
|
||||
+1
@@ -0,0 +1 @@
|
||||
stop();
|
||||
+1
@@ -0,0 +1 @@
|
||||
stop();
|
||||
+1
@@ -0,0 +1 @@
|
||||
stop();
|
||||
+1
@@ -0,0 +1 @@
|
||||
stop();
|
||||
+1
@@ -0,0 +1 @@
|
||||
stop();
|
||||
+1
@@ -0,0 +1 @@
|
||||
stop();
|
||||
@@ -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);
|
||||
};
|
||||
}
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
interface IScrollbarEventListener
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,418 @@
|
||||
class igm_pauseMenu extends Cafe2_BaseUIScreen implements IScrollbarEventListener
|
||||
{
|
||||
var m_objectiveLines = new Array();
|
||||
var m_selectedObjectiveLineIndex = -1;
|
||||
var m_playerCount = 0;
|
||||
static var MAX_PLAYERS = 6;
|
||||
function igm_pauseMenu(screen)
|
||||
{
|
||||
super();
|
||||
trace("igm_pauseMenu::igm_pauseMenu() screen = " + screen);
|
||||
Cafe2_BaseUIScreen.m_screen = screen;
|
||||
Cafe2_BaseUIScreen.m_thisClass = this;
|
||||
this.m_objectiveListVisibleHeight = Cafe2_BaseUIScreen.m_screen.campaignMC.objectiveListMC.maskMC._height;
|
||||
this.initGUI();
|
||||
}
|
||||
function OnScrollbarDelta(dir)
|
||||
{
|
||||
trace("igm_pauseMenu::OnScrollbarDelta( " + String(dir) + " )");
|
||||
}
|
||||
function OnScrollbarThumbUpdate(percentage)
|
||||
{
|
||||
trace("igm_pauseMenu::OnScrollbarThumbUpdate( " + String(percentage) + " )");
|
||||
var height = this.m_campaignMC.objectiveListMC.linesMC._height;
|
||||
if(height > this.m_objectiveListVisibleHeight)
|
||||
{
|
||||
this.scrollObjectiveListBox(percentage * 0.01 * (height - this.m_objectiveListVisibleHeight));
|
||||
}
|
||||
}
|
||||
function OnScrollbarMouseEnter()
|
||||
{
|
||||
trace("igm_pauseMenu::OnScrollbarMouseEnter()");
|
||||
}
|
||||
function OnScrollbarMouseExit()
|
||||
{
|
||||
trace("igm_pauseMenu::OnScrollbarMouseExit()");
|
||||
}
|
||||
function initMode()
|
||||
{
|
||||
var ret = new Object();
|
||||
// Checked
|
||||
loadVariables("QueryGameEngine?PauseMenu_mode",ret);
|
||||
trace("igm_pauseMenu: data.PauseMenu_mode = \"" + ret.PauseMenu_mode + "\"");
|
||||
this.m_mode = ret.PauseMenu_mode;
|
||||
}
|
||||
function initButton(bttn, enable, onClickFn)
|
||||
{
|
||||
bttn._visible = true;
|
||||
if(enable)
|
||||
{
|
||||
bttn.enable();
|
||||
}
|
||||
else
|
||||
{
|
||||
bttn.disable();
|
||||
}
|
||||
bttn.setOnMouseUpFunction(onClickFn);
|
||||
}
|
||||
function initButtons()
|
||||
{
|
||||
var ret = new Object();
|
||||
// Checked
|
||||
loadVariables("QueryGameEngine?igm_pauseMenu_enableSave",ret);
|
||||
var isPauseMenuEnableSave = ret.igm_pauseMenu_enableSave != "0";
|
||||
// Checked
|
||||
loadVariables("QueryGameEngine?igm_pauseMenu_enableLoad",ret);
|
||||
var isPauseMenuEnableLoad = ret.igm_pauseMenu_enableLoad != "0";
|
||||
this.initButton(Cafe2_BaseUIScreen.m_screen.exitButton,true,_global.bind0(this,this.onExitButtonClicked));
|
||||
this.initButton(Cafe2_BaseUIScreen.m_screen.settingsButton,true,_global.bind0(this,this.onSettingsButtonClicked));
|
||||
this.initButton(Cafe2_BaseUIScreen.m_screen.loadButton,isPauseMenuEnableLoad,_global.bind0(this,this.onLoadButtonClicked));
|
||||
this.initButton(Cafe2_BaseUIScreen.m_screen.saveButton,isPauseMenuEnableSave,_global.bind0(this,this.onSaveButtonClicked));
|
||||
this.initButton(Cafe2_BaseUIScreen.m_screen.resumeButton,true,_global.bind0(this,this.backButtonClicked));
|
||||
}
|
||||
function getObjectiveLineColor(isBonus)
|
||||
{
|
||||
// #00ff00 65280 Green
|
||||
// #ffcc00 16763904 Yellow
|
||||
return !isBonus ? 65280 : 16763904;
|
||||
}
|
||||
function clearObjectiveListBox()
|
||||
{
|
||||
trace("igm_pauseMenu::clearObjectiveListBox()");
|
||||
while(this.m_objectiveLines.length > 0)
|
||||
{
|
||||
var lastLine = this.m_objectiveLines.pop();
|
||||
delete lastLine.hitRegionMC.bttn.onRelease;
|
||||
lastLine.removeMovieClip();
|
||||
}
|
||||
this.m_selectedObjectiveLineIndex = -1;
|
||||
this.m_campaignMC.objectiveDescTF.text = "";
|
||||
}
|
||||
static function colorizeMovieClip(clip, clr)
|
||||
{
|
||||
var colorClip = new Color(clip);
|
||||
colorClip.setRGB(clr);
|
||||
}
|
||||
function populateObjectiveListBox()
|
||||
{
|
||||
trace("igm_pauseMenu::populateObjectiveListBox()");
|
||||
this.clearObjectiveListBox();
|
||||
var ret = new Object();
|
||||
// Checked
|
||||
loadVariables("QueryGameEngine?PauseMenu_missionObjectiveId&PauseMenu_missionObjectiveStatus&PauseMenu_missionObjectiveBonusness",ret);
|
||||
trace("igm_pauseMenu: PauseMenu_missionObjectiveId = \"" + ret.PauseMenu_missionObjectiveId + "\"");
|
||||
trace("igm_pauseMenu: PauseMenu_missionObjectiveStatus = \"" + ret.PauseMenu_missionObjectiveStatus + "\"");
|
||||
trace("igm_pauseMenu: PauseMenu_missionObjectiveBonusness = \"" + ret.PauseMenu_missionObjectiveBonusness + "\"");
|
||||
var objectiveIdList = ret.PauseMenu_missionObjectiveId.split(",");
|
||||
var objectiveStatusList = ret.PauseMenu_missionObjectiveStatus.split(",");
|
||||
var objectiveBonusnessStateList = ret.PauseMenu_missionObjectiveBonusness.split(",");
|
||||
var tempHeightSum = 0;
|
||||
var objectiveCount = objectiveIdList.length;
|
||||
for(var i = 0; i < objectiveCount; ++i)
|
||||
{
|
||||
var objectiveId = Number(objectiveIdList[i]);
|
||||
var objectiveStatus = objectiveStatusList[i];
|
||||
var objectiveIsBonusness = Number(objectiveBonusnessStateList[i]) != 0;
|
||||
var movieClip = this.m_campaignMC.objectiveListMC.linesMC.attachMovie("ObjectiveLine",String(i),i);
|
||||
movieClip.objectiveId = objectiveId;
|
||||
var textFieldHeight = movieClip.textTF._height;
|
||||
movieClip.textTF.text = "$PauseMenu_objectiveTitle" + objectiveId + "&outline";
|
||||
movieClip.textTF.autoSize = "left";
|
||||
var textFieldHeight = movieClip.textTF._height;
|
||||
if(textFieldHeight >= textFieldHeight)
|
||||
{
|
||||
var extraHeight = textFieldHeight - textFieldHeight;
|
||||
movieClip.spacerMC._height += extraHeight;
|
||||
movieClip.selectionMC._height += extraHeight;
|
||||
movieClip.hitRegionMC._height += extraHeight;
|
||||
}
|
||||
else
|
||||
{
|
||||
movieClip.textTF._y += (textFieldHeight - textFieldHeight) * 0.5;
|
||||
}
|
||||
var color = this.getObjectiveLineColor(objectiveIsBonusness);
|
||||
movieClip.textTF.textColor = color;
|
||||
movieClip.checkboxMC.gotoAndPlay(objectiveStatus);
|
||||
igm_pauseMenu.colorizeMovieClip(movieClip.checkboxMC.frameMC,color);
|
||||
igm_pauseMenu.colorizeMovieClip(movieClip.checkboxMC.checkMC,color);
|
||||
movieClip.selectionMC._visible = false;
|
||||
movieClip.hitRegionMC.bttn.onRelease = _global.bind1(this,this.onObjectiveLineClicked,objectiveId);
|
||||
movieClip._y = tempHeightSum;
|
||||
tempHeightSum += movieClip._height;
|
||||
this.m_objectiveLines.push(movieClip);
|
||||
}
|
||||
var linesHeight = this.m_campaignMC.objectiveListMC.linesMC._height;
|
||||
if(linesHeight > this.m_objectiveListVisibleHeight)
|
||||
{
|
||||
this.m_campaignMC.objectiveListScrollBarMC.enable();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.m_campaignMC.objectiveListScrollBarMC.disable();
|
||||
}
|
||||
this.selectObjectiveListBoxEntry();
|
||||
}
|
||||
function scrollObjectiveListBox(minVisibleY)
|
||||
{
|
||||
trace("igm_pauseMenu::scrollObjectiveListBox( " + String(minVisibleY) + " )");
|
||||
var linesHeight = this.m_campaignMC.objectiveListMC.linesMC._height;
|
||||
this.m_campaignMC.objectiveListMC.linesMC._y = - minVisibleY;
|
||||
var height = minVisibleY + this.m_objectiveListVisibleHeight;
|
||||
var lineCount = this.m_objectiveLines.length;
|
||||
for(var i = 0; i < lineCount; ++i)
|
||||
{
|
||||
var line = this.m_objectiveLines[i];
|
||||
line._visible = line._y < height && line._y + line._height > minVisibleY;
|
||||
}
|
||||
if(linesHeight > visibleHeight)
|
||||
{
|
||||
this.m_campaignMC.objectiveListScrollBarMC.setInfo(0,linesHeight - this.m_objectiveListVisibleHeight,minVisibleY);
|
||||
}
|
||||
}
|
||||
function ensureObjectiveLineVisibility(lineIndex)
|
||||
{
|
||||
trace("igm_pauseMenu::ensureObjectiveLineVisibility( " + String(lineIndex) + " )");
|
||||
var lineY = - this.m_campaignMC.objectiveListMC.linesMC._y;
|
||||
var visibleHeight = lineY + this.m_objectiveListVisibleHeight;
|
||||
var lineComponent = this.m_objectiveLines[lineIndex];
|
||||
if(lineComponent._y < lineY)
|
||||
{
|
||||
this.scrollObjectiveListBox(lineComponent._y);
|
||||
}
|
||||
else
|
||||
{
|
||||
var maximumHeight = lineComponent._y + lineComponent._height;
|
||||
if(maximumHeight > visibleHeight)
|
||||
{
|
||||
this.scrollObjectiveListBox(lineY + (maximumHeight - visibleHeight));
|
||||
}
|
||||
}
|
||||
}
|
||||
function refreshPlayerStatus()
|
||||
{
|
||||
for(var i = 0; i < igm_pauseMenu.MAX_PLAYERS; ++i)
|
||||
{
|
||||
var movieClip = MovieClip(this.m_playerLineMCs[i]);
|
||||
movieClip.statusMC.statusTF.text = "$PauseMenu_playerStatus" + String(i) + "&outline";
|
||||
}
|
||||
}
|
||||
function selectObjectiveListBoxEntry()
|
||||
{
|
||||
trace("igm_pauseMenu::selectObjectiveListBoxEntry()");
|
||||
if(this.m_selectedObjectiveLineIndex >= 0)
|
||||
{
|
||||
var selectedLine = this.m_objectiveLines[this.m_selectedObjectiveLineIndex];
|
||||
selectedLine.selectionMC._visible = false;
|
||||
this.m_selectedObjectiveLineIndex = -1;
|
||||
}
|
||||
var ret = new Object();
|
||||
// Checked
|
||||
loadVariables("QueryGameEngine?PauseMenu_selectedMissionObjectiveId",ret);
|
||||
trace("igm_pauseMenu: PauseMenu_selectedMissionObjectiveId = \"" + ret.PauseMenu_selectedMissionObjectiveId + "\"");
|
||||
var selectedMissionObjectiveId = Number(ret.PauseMenu_selectedMissionObjectiveId);
|
||||
var lineCount = this.m_objectiveLines.length;
|
||||
for(var i = 0; i < lineCount; ++i)
|
||||
{
|
||||
line = this.m_objectiveLines[i];
|
||||
if(line.objectiveId == selectedMissionObjectiveId)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(i < lineCount)
|
||||
{
|
||||
this.ensureObjectiveLineVisibility(i);
|
||||
line = this.m_objectiveLines[i];
|
||||
line.selectionMC._visible = true;
|
||||
this.m_campaignMC.objectiveDescTF.text = "$PauseMenu_objectiveDesc" + selectedMissionObjectiveId + "&outline";
|
||||
this.m_selectedObjectiveLineIndex = i;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.scrollObjectiveListBox(0);
|
||||
}
|
||||
}
|
||||
function submitMissionMap()
|
||||
{
|
||||
trace("igm_pauseMenu::submitMissionMap()");
|
||||
// Checked
|
||||
getURL("FSCommand:CallGameFunction",
|
||||
"%PauseMenu_receiveMissionMap?missionMap="
|
||||
+ Pointer.encode(Cafe2_BaseUIScreen.m_screen.missionMap));
|
||||
Cafe2_BaseUIScreen.m_screen.missionMap.OnBound();
|
||||
}
|
||||
function refreshPlayerMuted()
|
||||
{
|
||||
trace("igm_pauseMenu::refreshPlayerMuted()");
|
||||
var ret = new Object();
|
||||
// Checked
|
||||
loadVariables("QueryGameEngine?PauseMenu_playerMuted",ret);
|
||||
trace("igm_pauseMenu: PauseMenu_playerMuted = \"" + ret.PauseMenu_playerMuted + "\"");
|
||||
var playerMutedMap = ret.PauseMenu_playerMuted.split(",");
|
||||
for(var i = 0; i < this.m_playerCount; ++i)
|
||||
{
|
||||
var movieClip = MovieClip(this.m_playerLineMCs[i]);
|
||||
movieClip.muteButtonMC.muteMC._visible = Number(playerMutedMap[i]) != 0;
|
||||
}
|
||||
}
|
||||
function initPlayerList()
|
||||
{
|
||||
trace("igm_pauseMenu::initPlayerList()");
|
||||
this.m_playerLineMCs = new Array(igm_pauseMenu.MAX_PLAYERS);
|
||||
for(var i = 0; i < igm_pauseMenu.MAX_PLAYERS; ++i)
|
||||
{
|
||||
var movieClip = MovieClip(this.m_skirmishMC.playerListMC[String(i)]);
|
||||
this.m_playerLineMCs[i] = movieClip;
|
||||
movieClip.nameMC.nameTF.text = "$PauseMenu_playerName" + String(i) + "&outline";
|
||||
movieClip.statusMC.statusTF.text = "$PauseMenu_playerStatus" + String(i) + "&outline";
|
||||
movieClip.muteButtonMC.onClicked = _global.bind1(this,this.onPlayerMuteButtonClicked,i);
|
||||
movieClip._visible = false;
|
||||
}
|
||||
var ret = new Object();
|
||||
// Checked
|
||||
loadVariables("QueryGameEngine?PauseMenu_playerFaction&PauseMenu_playerColor&PauseMenu_playerIsNonLocalHuman&PauseMenu_playerMuted",ret);
|
||||
trace("igm_pauseMenu: PauseMenu_playerFaction = \"" + ret.PauseMenu_playerFaction + "\"");
|
||||
trace("igm_pauseMenu: PauseMenu_playerColor = \"" + ret.PauseMenu_playerColor + "\"");
|
||||
trace("igm_pauseMenu: PauseMenu_playerIsNonLocalHuman = \"" + ret.PauseMenu_playerIsNonLocalHuman + "\"");
|
||||
trace("igm_pauseMenu: PauseMenu_playerMuted = \"" + ret.PauseMenu_playerMuted + "\"");
|
||||
var playerFactionList = ret.PauseMenu_playerFaction.split(",");
|
||||
var playerColorList = ret.PauseMenu_playerColor.split(",");
|
||||
var playerIsNonLocalHumanList = ret.PauseMenu_playerIsNonLocalHuman.split(",");
|
||||
var playerMutedStatus = ret.PauseMenu_playerMuted.split(",");
|
||||
this.m_playerCount = Math.min(playerFactionList.length,igm_pauseMenu.MAX_PLAYERS);
|
||||
for(i = 0; i < this.m_playerCount; ++i)
|
||||
{
|
||||
movieClip = MovieClip(this.m_playerLineMCs[i]);
|
||||
movieClip._visible = true;
|
||||
movieClip.factionMC.gotoAndPlay(playerFactionList[i]);
|
||||
var colorClip = new Color(movieClip.colorMC.colorMC);
|
||||
colorClip.setRGB(Number(playerColorList[i]));
|
||||
var isMute = Number(playerIsNonLocalHumanList[i]) != 0;
|
||||
movieClip.muteButtonMC.gotoAndPlay(!isMute ? "_disabled" : "_up");
|
||||
movieClip.muteButtonMC.muteMC._visible = Number(playerMutedStatus[i]) != 0;
|
||||
}
|
||||
}
|
||||
function initGUI()
|
||||
{
|
||||
trace("igm_pauseMenu::initGUI()");
|
||||
this.initMode();
|
||||
this.initButtons();
|
||||
Cafe2_BaseUIScreen.m_screen.missionMap.loadMovie("../../common/ig_missionMap.swf");
|
||||
this.submitMissionMap();
|
||||
this.m_campaignMC = Cafe2_BaseUIScreen.m_screen.campaignMC;
|
||||
this.m_campaignMC._visible = false;
|
||||
this.m_skirmishMC = Cafe2_BaseUIScreen.m_screen.skirmishMC;
|
||||
this.m_skirmishMC._visible = false;
|
||||
switch(this.m_mode)
|
||||
{
|
||||
case "Campaign":
|
||||
this.m_campaignMC._visible = true;
|
||||
this.m_campaignMC.objectiveListScrollBarMC.addListener(this);
|
||||
this.m_campaignMC.objectiveListScrollBarMC.setSize(this.m_objectiveListVisibleHeight);
|
||||
this.populateObjectiveListBox();
|
||||
break;
|
||||
case "Skirmish":
|
||||
this.m_skirmishMC._visible = true;
|
||||
this.initPlayerList();
|
||||
break;
|
||||
default:
|
||||
trace("igm_pauseMenu: unrecognized mode \"" + this.m_mode + "\"");
|
||||
}
|
||||
this.m_localMessageHandlerFunc = _global.bind1DynamicParams(this,this.localMessageHandler);
|
||||
_global.gMH.addMessageHandler(this.m_localMessageHandlerFunc);
|
||||
this.m_localEventHandlerIndex = _global.gEH.addLocalEventHandler(_global.bind2DynamicParams(this,this.localEventHandler));
|
||||
this.registerIntroOuttroComponents([Cafe2_BaseUIScreen.m_screen.exitButton,Cafe2_BaseUIScreen.m_screen.settingsButton,Cafe2_BaseUIScreen.m_screen.loadButton,Cafe2_BaseUIScreen.m_screen.saveButton,Cafe2_BaseUIScreen.m_screen.resumeButton]);
|
||||
this.startIntro();
|
||||
_global.gSM.setOnExitScreen(_global.bind0(this,this.onScreenExit));
|
||||
}
|
||||
function onScreenExit()
|
||||
{
|
||||
trace("igm_pauseMenu::onScreenExit()");
|
||||
Cafe2_BaseUIScreen.m_screen.missionMap.OnDestroying();
|
||||
_global.gEH.removeLocalEventHandler(this.m_localEventHandlerIndex);
|
||||
_global.gMH.removeMessageHandler(this.m_localMessageHandlerFunc);
|
||||
delete this.m_localMessageHandlerFunc;
|
||||
this.clearObjectiveListBox();
|
||||
this.clearData();
|
||||
Cafe2_BaseUIScreen.m_screen = null;
|
||||
Cafe2_BaseUIScreen.m_thisClass = null;
|
||||
delete _global.igm_pauseMenu;
|
||||
delete _global.Cafe2_BaseUIScreen;
|
||||
}
|
||||
function localMessageHandler(messageCode)
|
||||
{
|
||||
trace("igm_pauseMenu::localMessageHandler() messageCode = \'" + messageCode + "\'");
|
||||
switch(messageCode)
|
||||
{
|
||||
case _global.MSGCODE.IGM_CLOSE_PAUSE_MENU:
|
||||
this.backButtonClicked();
|
||||
return true;
|
||||
case _global.MSGCODE.IG_PAUSE_MENU_REFRESH_OBJECTIVES:
|
||||
this.populateObjectiveListBox();
|
||||
return true;
|
||||
case _global.MSGCODE.IG_PAUSE_MENU_SUBMIT_MISSION_MAP:
|
||||
this.submitMissionMap();
|
||||
return true;
|
||||
case _global.MSGCODE.IG_PAUSE_MENU_SELECT_OBJECTIVE:
|
||||
this.selectObjectiveListBoxEntry();
|
||||
return true;
|
||||
case _global.MSGCODE.IG_PAUSE_MENU_REFRESH_PLAYER_MUTED:
|
||||
this.refreshPlayerMuted();
|
||||
return true;
|
||||
case _global.MSGCODE.IG_PAUSE_MENU_REFRESH_PLAYER_STATUS:
|
||||
this.refreshPlayerStatus();
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function localEventHandler(keyCode, controller)
|
||||
{
|
||||
trace("igm_pauseMenu::localEventHandler() keyCode == " + keyCode);
|
||||
if(keyCode !== INPUTCODE.ESCAPE)
|
||||
{
|
||||
_global.gFM.handleDefaultInputs(keyCode);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.backButtonClicked();
|
||||
}
|
||||
}
|
||||
function onExitButtonClicked()
|
||||
{
|
||||
trace("igm_pauseMenu::onExitButtonClicked()");
|
||||
// Checked
|
||||
getUrl("FSCommand:CallGameFunction", "%igm_pauseMenu_onExitClicked");
|
||||
}
|
||||
function onSettingsButtonClicked()
|
||||
{
|
||||
trace("igm_pauseMenu::onSettingsButtonClicked()");
|
||||
this.startOuttro(_global.SCREEN.FEG_OPTIONS);
|
||||
}
|
||||
function onLoadButtonClicked()
|
||||
{
|
||||
trace("igm_pauseMenu::onLoadButtonClicked()");
|
||||
_global.GAME.SAVELOADSCREEN_TYPE = _global.ENUM.SAVELOADSCREEN_LOAD;
|
||||
this.startOuttro(_global.SCREEN.FEG_SAVELOAD);
|
||||
}
|
||||
function onSaveButtonClicked()
|
||||
{
|
||||
trace("igm_pauseMenu::onSaveButtonClicked()");
|
||||
// Checked
|
||||
getUrl("FSCommand:CallGameFunction", "%igm_pauseMenu.OnSaveClicked");
|
||||
_global.GAME.SAVELOADSCREEN_TYPE = _global.ENUM.SAVELOADSCREEN_SAVE;
|
||||
this.startOuttro(_global.SCREEN.FEG_SAVELOAD);
|
||||
}
|
||||
function onObjectiveLineClicked(objectiveId)
|
||||
{
|
||||
trace("igm_pauseMenu::onObjectiveLineClicked( " + String(objectiveId) + " )");
|
||||
// Checked
|
||||
getURL("FSCommand:CallGameFunction","%PauseMenu_onMissionObjectiveClicked?objectiveId=" + objectiveId);
|
||||
}
|
||||
function onPlayerMuteButtonClicked(playerNum)
|
||||
{
|
||||
trace("igm_pauseMenu::onPlayerMuteButtonClicked( " + String(playerNum) + " )");
|
||||
// Checked
|
||||
getURL("FSCommand:CallGameFunction","%PauseMenu_onPlayerMuteClicked?playerNum=" + String(playerNum));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
var screen = new igm_pauseMenu(this);
|
||||
stop();
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
on(construct){
|
||||
m_focusDirs = "Left/Right";
|
||||
m_bEnabled = true;
|
||||
m_refFM = "_root.gFM";
|
||||
m_initiallySelected = false;
|
||||
m_tabIndex = 2;
|
||||
m_bVisible = true;
|
||||
m_label = "$GUI:TacticalPauseDialogLoadButton";
|
||||
m_contentSymbol = "buttonContentSymbol";
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
on(construct){
|
||||
m_focusDirs = "Left/Right";
|
||||
m_bEnabled = true;
|
||||
m_refFM = "_root.gFM";
|
||||
m_initiallySelected = false;
|
||||
m_tabIndex = 1;
|
||||
m_bVisible = true;
|
||||
m_label = "$GUI:TacticalPauseDialogSaveButton";
|
||||
m_contentSymbol = "buttonContentSymbol";
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
on(construct){
|
||||
m_focusDirs = "Left/Right";
|
||||
m_bEnabled = true;
|
||||
m_refFM = "_root.gFM";
|
||||
m_initiallySelected = false;
|
||||
m_tabIndex = 0;
|
||||
m_bVisible = true;
|
||||
m_label = "$GUI:TacticalPauseDialogExitMissionButton";
|
||||
m_contentSymbol = "buttonContentSymbol";
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
on(construct){
|
||||
m_focusDirs = "Left/Right";
|
||||
m_bEnabled = true;
|
||||
m_refFM = "_root.gFM";
|
||||
m_initiallySelected = true;
|
||||
m_tabIndex = 4;
|
||||
m_bVisible = true;
|
||||
m_label = "$GUI:TacticalPauseDialogResumeButton";
|
||||
m_contentSymbol = "buttonContentSymbol";
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
on(construct){
|
||||
m_focusDirs = "Left/Right";
|
||||
m_bEnabled = true;
|
||||
m_refFM = "_root.gFM";
|
||||
m_initiallySelected = false;
|
||||
m_tabIndex = 3;
|
||||
m_bVisible = true;
|
||||
m_label = "$GUI:TacticalPauseDialogOptionsButton";
|
||||
m_contentSymbol = "buttonContentSymbol";
|
||||
}
|
||||
Reference in New Issue
Block a user