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,6 @@
on(construct){
m_nLength = 100;
m_nMax = 10;
m_nMin = 0;
m_nValue = 0;
}
@@ -0,0 +1,18 @@
on(construct){
m_width = 150;
m_textAlign = true;
m_labelPosition = "top center";
m_label_x = 0;
m_label_y = 0;
m_focusDirs = "Up/Down";
m_iconType = "default";
m_extLabel = "";
m_nTruncateType = 0;
m_label = "$new";
m_bEnabled = true;
m_refFM = "_global.gFM";
m_initiallySelected = false;
m_tabIndex = -1;
m_bVisible = true;
m_contentSymbol = "buttonContentSymbol";
}
@@ -0,0 +1,18 @@
on(construct){
m_width = 150;
m_textAlign = true;
m_labelPosition = "top center";
m_label_x = 0;
m_label_y = 0;
m_focusDirs = "Up/Down";
m_iconType = "default";
m_extLabel = "";
m_nTruncateType = 0;
m_label = "$delete";
m_bEnabled = false;
m_refFM = "_global.gFM";
m_initiallySelected = false;
m_tabIndex = -1;
m_bVisible = true;
m_contentSymbol = "buttonContentSymbol";
}
@@ -0,0 +1,18 @@
on(construct){
m_width = 150;
m_textAlign = true;
m_labelPosition = "top center";
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 = false;
m_refFM = "_global.gFM";
m_initiallySelected = false;
m_tabIndex = -1;
m_bVisible = true;
m_contentSymbol = "buttonContentSymbol";
}
@@ -0,0 +1,21 @@
on(construct){
m_focusDirs = "Up/Down";
m_numEntries = 10;
m_vPadding = 5;
m_bEnabled = true;
m_refFM = "_root.gFM";
m_initiallySelected = false;
m_tabIndex = -1;
m_bVisible = true;
m_scrollbarOffset = [];
m_scrollbarOffset[0] = 10;
m_scrollbarOffset[1] = 0;
m_BgVisible = true;
m_renderWidth = 525;
m_renderHeight = 162;
m_backgroundMargin = 2;
m_useHighlights = true;
m_alternateBackgroundColors = true;
m_backgroundColor1 = 0;
m_backgroundColor2 = 3737609;
}
@@ -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);
};
}
}
@@ -0,0 +1,3 @@
interface IListboxEventListener
{
}
@@ -0,0 +1,193 @@
class feg_m_profileManager extends Cafe2_BaseUIScreen implements IListboxEventListener
{
var m_profiles = new Array();
var m_profileTokens = new Array();
function feg_m_profileManager(screen)
{
super(screen);
Cafe2_BaseUIScreen.m_screen = screen;
Cafe2_BaseUIScreen.m_thisClass = this;
Cafe2_BaseUIScreen.m_screen.newProfileMC._visible = false;
}
function frameDelayedInit()
{
trace("feg_m_profileManager::frameDelayedInit()");
this.m_localMessageHandler = _global.bind1DynamicParams(this,this.localMessageHandler);
_global.gMH.addMessageHandler(this.m_localMessageHandler);
_global.gSM.setOnExitScreen(_global.bind0(this,this.onScreenExit));
this.initGUI();
this.startIntro();
}
function OnListboxIndexMouseClick(index, previouslySelectedIndex)
{
}
function OnListboxIndexElementMouseClick(index, element, previouslySelectedIndex)
{
this.OnProfileClicked(index);
}
function initGUI()
{
var _loc3_ = new Array();
_loc3_.push(this.configureButton(Cafe2_BaseUIScreen.m_screen.profileMC.btnNewProfile,_global.bind0(this,this.onNewProfile)));
_loc3_.push(this.configureButton(Cafe2_BaseUIScreen.m_screen.profileMC.btnDeleteProfile,_global.bind0(this,this.onDeleteProfile)));
_loc3_.push(this.configureButton(Cafe2_BaseUIScreen.m_screen.profileMC.btnAcceptProfile,_global.bind0(this,this.onSetProfile)));
_loc3_.push(this.configureButton(Cafe2_BaseUIScreen.m_screen.newProfileMC.btnNewCancel,_global.bind0(this,this.onNewProfileCancel)));
_loc3_.push(this.configureButton(Cafe2_BaseUIScreen.m_screen.newProfileMC.btnNewConfirm,_global.bind0(this,this.onNewProfileConfirm)));
_loc3_.push(this.configureButton(Cafe2_BaseUIScreen.m_screen.btnMainMenu,_global.bind0(this,this.onMainMenuClicked)));
Cafe2_BaseUIScreen.m_screen.newProfileMC.newProfileName.setOnEnterFunction(_global.bind0(this,this.onNewProfileConfirm));
Cafe2_BaseUIScreen.m_screen.profileMC.txtProfileList.setNumEntries(6);
Cafe2_BaseUIScreen.m_screen.profileMC.txtProfileList.setVerticalPadding(0);
Cafe2_BaseUIScreen.m_screen.profileMC.txtProfileList.addListener(this);
var _loc4_ = new Array();
_loc4_.push({symbol:"std_mouseListboxEntryTextElementSymbol",width:523,leftMargin:2,rightMargin:0,useHitRegion:false});
Cafe2_BaseUIScreen.m_screen.profileMC.txtProfileList.init(_loc4_,27);
Cafe2_BaseUIScreen.m_screen.profileMC.txtProfileList.attachScrollbarController(Cafe2_BaseUIScreen.m_screen.profileMC.sldrProfiles);
Cafe2_BaseUIScreen.m_screen.profileMC.btnAcceptProfile.disable();
Cafe2_BaseUIScreen.m_screen.profileMC.btnDeleteProfile.disable();
this.updateProfileList();
this.updateCurrentProfile();
this.highlightCurrentProfile();
Cafe2_BaseUIScreen.m_screen.profileMC.txtProfileList.moveViewToFirst();
Cafe2_BaseUIScreen.m_screen.profileMC.txtProfileList.refreshDisplay();
Cafe2_BaseUIScreen.m_screen.profileMC.txtProfileList.refreshScrollbar();
Cafe2_BaseUIScreen.m_screen.profileMC._visible = true;
Cafe2_BaseUIScreen.m_screen.newProfileMC._visible = false;
this.registerIntroOuttroComponents(_loc3_);
}
function configureButton(button, callback)
{
button.show();
button.enable();
button.setOnMouseUpFunction(callback);
return button;
}
function localMessageHandler(messageCode)
{
var _loc3_ = false;
switch(messageCode)
{
case _global.MSGCODE.FE_PROFILE_CREATE_SUCCESS:
Cafe2_BaseUIScreen.m_screen.newProfileMC._visible = false;
Cafe2_BaseUIScreen.m_screen.profileMC._visible = true;
this.updateProfileList();
this.updateCurrentProfile();
this.highlightCurrentProfile();
_loc3_ = true;
break;
case _global.MSGCODE.FE_PROFILE_CREATE_FAIL:
_loc3_ = true;
break;
case _global.MSGCODE.FE_PROFILE_REFRESH_LIST:
this.updateProfileList();
this.highlightCurrentProfile();
_loc3_ = true;
}
return _loc3_;
}
function updateProfileList()
{
var ret = new Object();
// Checked
loadVariables("QueryGameEngine?FE_PROFILE_LIST",ret);
this.m_profiles = ret.FE_PROFILE_LIST.split(",");
this.m_profileTokens.splice(0,this.m_profileTokens.length);
for(var i = 0; i < this.m_profiles.length; ++i)
{
this.m_profileTokens.push(this.m_profiles[_loc2_] + "&Outline");
}
Cafe2_BaseUIScreen.m_screen.profileMC.txtProfileList.setColumnData(0,this.m_profileTokens);
Cafe2_BaseUIScreen.m_screen.profileMC.txtProfileList.refreshDisplay();
Cafe2_BaseUIScreen.m_screen.profileMC.txtProfileList.refreshScrollbar();
}
function updateCurrentProfile()
{
var ret = new Object();
// Checked
loadVariables("QueryGameEngine?FE_CURRENT_PROFILE",ret);
Cafe2_BaseUIScreen.m_screen.profileMC.txtProfileName.text = ret.FE_CURRENT_PROFILE;
}
function highlightCurrentProfile()
{
var ret = new Object();
// Checked
loadVariables("QueryGameEngine?FE_CURRENT_PROFILE_INDEX",ret);
var index = ret.FE_CURRENT_PROFILE_INDEX;
Cafe2_BaseUIScreen.m_screen.profileMC.txtProfileList.setSelectedIndex(index);
Cafe2_BaseUIScreen.m_screen.profileMC.btnAcceptProfile.disable();
Cafe2_BaseUIScreen.m_screen.profileMC.btnDeleteProfile.disable();
}
function onMainMenuClicked()
{
trace("feg_m_profileManager::onMainMenuClicked()");
this.backButtonClicked();
}
function onScreenExit()
{
_global.gMH.removeMessageHandler(this.m_localMessageHandler);
delete this.m_localMessageHandler;
Cafe2_BaseUIScreen.m_screen.txtProfileList.removeListener(this);
Cafe2_BaseUIScreen.m_screen.txtProfileList.shutdown();
this.clearData();
delete _global.feg_m_profileManager;
delete _global.Cafe2_BaseUIScreen;
}
function onNewProfile()
{
Cafe2_BaseUIScreen.m_screen.profileMC._visible = false;
Cafe2_BaseUIScreen.m_screen.newProfileMC._visible = true;
Cafe2_BaseUIScreen.m_screen.newProfileMC.newProfileName.takeFocus();
}
function onDeleteProfile()
{
var index = Cafe2_BaseUIScreen.m_screen.profileMC.txtProfileList.getSelectedEntryIndex();
var deletedProfileName = this.m_profiles[index].slice(1);
// Checked
getURL("FSCommand:CallGameFunction","%DeleteProfile?ProfileName=" + deletedProfileName);
}
function onSetProfile()
{
var index = Cafe2_BaseUIScreen.m_screen.profileMC.txtProfileList.getSelectedEntryIndex();
var token = this.m_profiles[index].slice(1);
// Checked
getURL("FSCommand:CallGameFunction","%SetProfileByToken?ProfileToken=" + token);
this.updateProfileList();
this.updateCurrentProfile();
Cafe2_BaseUIScreen.m_screen.profileMC._visible = false;
_global.gSM.goBackScreen();
}
function onNewProfileCancel()
{
this.m_newProfileName = "";
Cafe2_BaseUIScreen.m_screen.newProfileMC._visible = false;
Cafe2_BaseUIScreen.m_screen.newProfileMC.newProfileName.setContents("");
Cafe2_BaseUIScreen.m_screen.profileMC._visible = true;
}
function onNewProfileConfirm()
{
this.m_newProfileName = Cafe2_BaseUIScreen.m_screen.newProfileMC.newProfileName.getContents();
// Checked
getURL("FSCommand:CallGameFunction","%AddProfile?ProfileName=" + this.m_newProfileName);
Cafe2_BaseUIScreen.m_screen.newProfileMC.newProfileName.setContents("");
}
function OnProfileClicked(index)
{
var _loc1_ = new Object();
// Checked
loadVariables("QueryGameEngine?FE_CURRENT_PROFILE_INDEX&FE_PROFILE_COUNT",_loc1_);
if(index >= _loc1_.FE_PROFILE_COUNT)
{
return undefined;
}
var _loc2_ = _loc1_.FE_CURRENT_PROFILE_INDEX;
if(index == _loc2_)
{
Cafe2_BaseUIScreen.m_screen.profileMC.btnAcceptProfile.disable();
Cafe2_BaseUIScreen.m_screen.profileMC.btnDeleteProfile.disable();
}
else
{
Cafe2_BaseUIScreen.m_screen.profileMC.btnAcceptProfile.enable();
Cafe2_BaseUIScreen.m_screen.profileMC.btnDeleteProfile.enable();
}
}
}
@@ -0,0 +1,2 @@
var screen = new feg_m_profileManager(this);
stop();
@@ -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 = "_root.gFM";
m_initiallySelected = false;
m_tabIndex = -1;
m_bVisible = true;
m_contentSymbol = "buttonContentSymbol";
}
@@ -0,0 +1,6 @@
on(construct){
m_title = "$PROFILE_MANAGER_SCREEN_TITLE";
m_DropShadow = true;
m_Outline = true;
m_visible = true;
}