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,135 @@
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;
}
function bind0(obj, func)
{
return function()
{
func.call(obj);
};
}
}
@@ -0,0 +1,9 @@
class autoMatchSearch extends Cafe2_BaseUIScreen
{
function autoMatchSearch(screen)
{
super();
Cafe2_BaseUIScreen.m_screen = screen;
Cafe2_BaseUIScreen.m_thisClass = this;
}
}
@@ -0,0 +1,65 @@
class fem_m_autoMatchSearch extends autoMatchSearch
{
function fem_m_autoMatchSearch(screen)
{
super(screen);
Cafe2_BaseUIScreen.m_screen = screen;
Cafe2_BaseUIScreen.m_thisClass = this;
_global.gMH.addMessageHandler(Cafe2_BaseUIScreen.m_thisClass.localMessageHandler);
this.initGUI();
this.startAutoMatchSearch();
}
function initGUI()
{
this.initButtons();
this.registerIntroOuttroComponents([Cafe2_BaseUIScreen.m_screen.backButton]);
_global.gSM.setOnExitScreen(Cafe2_BaseUIScreen.m_thisClass.onScreenExit);
this.startIntro();
}
function onScreenExit()
{
_global.gMH.removeMessageHandler(Cafe2_BaseUIScreen.m_thisClass.localMessageHandler);
Cafe2_BaseUIScreen.m_thisClass.clearData();
Cafe2_BaseUIScreen.m_screen = null;
Cafe2_BaseUIScreen.m_thisClass = null;
delete _global.fem_m_autoMatchSearch;
delete _global.autoMatchSearch;
delete _global.Cafe2_BaseUIScreen;
}
function initButtons()
{
var _loc1_ = Cafe2_BaseUIScreen.m_screen.backButton;
_loc1_.show();
_loc1_.enable();
_loc1_.setOnMouseUpFunction(Cafe2_BaseUIScreen.m_thisClass.cancelAutoMatchSearch);
}
function startAutoMatchSearch()
{
// Checked
getUrl("FSCommand:CallGameFunction", "STARTAUTOMATCHSEARCH");
}
function cancelAutoMatchSearch()
{
// Checked
getUrl("FSCommand:CallGameFunction", "CANCELAUTOMATCHSEARCH");
Cafe2_BaseUIScreen.m_thisClass.backButtonClicked();
}
function localMessageHandler(messageCode)
{
var _loc2_ = true;
if(messageCode !== _global.MSGCODE.FE_MP_AUTOMATCH_SEARCH_FAILED)
{
_loc2_ = false;
}
else
{
Cafe2_BaseUIScreen.m_thisClass.failedAutoMatchSearch();
}
return _loc2_;
}
function failedAutoMatchSearch()
{
trace("fem_m_autoMatchSearch::failedAutoMatchSearch()");
Cafe2_BaseUIScreen.m_thisClass.backButtonClicked();
}
}
@@ -0,0 +1 @@
var screen = new fem_m_autoMatchSearch(this);
@@ -0,0 +1,10 @@
on(construct){
m_focusDirs = "Up/Down";
m_bEnabled = true;
m_refFM = "_root.gFM";
m_initiallySelected = false;
m_tabIndex = 0;
m_bVisible = true;
m_label = "$Back";
m_contentSymbol = "buttonContentSymbol";
}
@@ -0,0 +1,2 @@
gotoAndStop("_start");
play();