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,52 @@
class igm_shellRoot extends Cafe2_BaseUIScreen
{
function igm_shellRoot(screen)
{
super();
trace("igm_shellRoot::igm_shellRoot() screen = " + screen);
Cafe2_BaseUIScreen.m_screen = screen;
Cafe2_BaseUIScreen.m_thisClass = this;
_global.gSM.setOnExitScreen(igm_shellRoot.bind0(this.onScreenExit,this));
var ret = new Object();
// Checked
loadVariables("QueryGameEngine?igm_shellRoot_mode",ret);
var flag = undefined;
switch(ret.igm_shellRoot_mode)
{
case "PauseMenu":
flag = _global.SCREEN.IGM_PAUSE_MENU;
break;
case "LoadMenu":
_global.GAME.SAVELOADSCREEN_TYPE = _global.ENUM.SAVELOADSCREEN_LOAD;
flag = _global.SCREEN.FEG_SAVELOAD;
break;
case "SaveMenu":
_global.GAME.SAVELOADSCREEN_TYPE = _global.ENUM.SAVELOADSCREEN_SAVE;
flag = _global.SCREEN.FEG_SAVELOAD;
break;
default:
// Checked
getUrl("FSCommand:CallGameFunction", "%igm_shellRoot_onClosed");
return undefined;
}
// Checked
getUrl("FSCommand:CallGameFunction", "%igm_shellRoot_onChildLoaded");
_global.gSM.changeMainScreen(flag);
}
static function bind0(fn, obj)
{
return function(arg0)
{
return fn.call(obj,arg0);
};
}
function onScreenExit()
{
trace("igm_shellRoot::onScreenExit()");
this.clearData();
Cafe2_BaseUIScreen.m_thisClass = null;
Cafe2_BaseUIScreen.m_screen = null;
delete _global.igm_shellRoot;
delete _global.Cafe2_BaseUIScreen;
}
}
@@ -0,0 +1,2 @@
var screen = new igm_shellRoot(this);
stop();