Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
IonAgorria committed Apr 10, 2024
1 parent 5863a15 commit 88eba31
Show file tree
Hide file tree
Showing 10 changed files with 372 additions and 336 deletions.
419 changes: 199 additions & 220 deletions Source/Game/Scripts/InterfaceScriptExport.cppi

Large diffs are not rendered by default.

32 changes: 19 additions & 13 deletions Source/Scripts/InterfaceScriptExport.prm
Original file line number Diff line number Diff line change
Expand Up @@ -4473,8 +4473,7 @@ sqshControlContainer _sqsh_controls[int _sqsh_control_count] = {
{type = SQSH_PUSH_BUTTON_TYPE; id = SQSH_MM_LOAD_IN_GAME_DEL_BTN; x=341/1024; y=511/768; sx=131/1024; sy=41/768; text="DELETE"; font_group=2; txt_dy = 11/768; sound = "mainmenu_button"; state = SQSH_ENABLED; },

{type = SQSH_SCALE_BUTTON_TYPE; id = SQSH_MM_RAMKA; x=(350+80)/1024; y=230/768; sx=497/1024; sy=272/768; image={texture=""; }; ystart=272/768; hitTestMode = HITTEST_NONE; },
{type = SQSH_SCALE_BUTTON_TYPE; id = SQSH_MM_RAMKA; x=(423+80)/1024; y=70/768; sx=351/1024; sy=160/768; image={texture=""; }; ystart=-160/768; hitTestMode = HITTEST_NONE; },
{type = SQSH_MAPWINDOW; id = SQSH_MM_LOAD_IN_GAME_MAP; x=(611+150)/1024; y=(200+16)/768; sx=128/1024; sy=128/768; image={texture="";ix = 1; iy = 1;}; },
{type = SQSH_MAPWINDOW; id = SQSH_MM_LOAD_IN_GAME_MAP; x=(611+150)/1024; y=(200+16)/768; sx=128/1024; sy=128/768; image={texture="";ix = 1; iy = 1;};image_h={texture="resource\\icons\\MainMenu\\tv.avi";_ix = 0; _iy = 0; ix = 120; iy = 120;hasResolutionVersion=0;}; },
{type = SQSH_TEXT_WINDOW_TYPE; id = SQSH_MM_LOAD_IN_GAME_MAP_DESCR_TXT; x=(350+137)/1024; y=(330+17)/768; sx=402/1024; sy=128/768; txt_align=SHELL_ALIGN_LEFT; image={texture="";};},


Expand Down Expand Up @@ -4519,8 +4518,7 @@ sqshControlContainer _sqsh_controls[int _sqsh_control_count] = {
{type = SQSH_PUSH_BUTTON_TYPE; id = SQSH_MM_SAVE_REPLAY_DEL_BTN; x=341/1024; y=511/768; sx=131/1024; sy=41/768; text="DELETE"; font_group=2; txt_dy = 11/768; sound = "mainmenu_button"; state = SQSH_ENABLED; },

{type = SQSH_SCALE_BUTTON_TYPE; id = SQSH_MM_RAMKA; x=(350+80)/1024; y=230/768; sx=497/1024; sy=272/768; image={texture=""; }; ystart=272/768; hitTestMode = HITTEST_NONE; },
{type = SQSH_SCALE_BUTTON_TYPE; id = SQSH_MM_RAMKA; x=(423+80)/1024; y=70/768; sx=351/1024; sy=160/768; image={texture=""; }; ystart=-160/768; hitTestMode = HITTEST_NONE; },
{type = SQSH_MAPWINDOW; id = SQSH_MM_SAVE_REPLAY_MAP; x=(611+150)/1024; y=(200+16)/768; sx=128/1024; sy=128/768; image={texture="";ix = 1; iy = 1;}; },
{type = SQSH_MAPWINDOW; id = SQSH_MM_SAVE_REPLAY_MAP; x=(611+150)/1024; y=(200+16)/768; sx=128/1024; sy=128/768; image={texture="";ix = 1; iy = 1;};image_h={texture="resource\\icons\\MainMenu\\tv.avi";_ix = 0; _iy = 0; ix = 120; iy = 120;hasResolutionVersion=0;}; },
{type = SQSH_TEXT_WINDOW_TYPE; id = SQSH_MM_SAVE_REPLAY_DESCR_TXT; x=(350+137)/1024; y=(330+17)/768; sx=402/1024; sy=128/768; txt_align=SHELL_ALIGN_LEFT; image={texture="";};},


Expand Down Expand Up @@ -4563,8 +4561,7 @@ sqshControlContainer _sqsh_controls[int _sqsh_control_count] = {
{type = SQSH_PUSH_BUTTON_TYPE; id = SQSH_MM_SAVE_GAME_DEL_BTN; x=341/1024; y=511/768; sx=131/1024; sy=41/768; text="DELETE"; font_group=2; txt_dy = 11/768; sound = "mainmenu_button"; state = SQSH_ENABLED; },

{type = SQSH_SCALE_BUTTON_TYPE; id = SQSH_MM_RAMKA; x=(350+80)/1024; y=230/768; sx=497/1024; sy=272/768; image={texture=""; }; ystart=272/768; hitTestMode = HITTEST_NONE; },
{type = SQSH_SCALE_BUTTON_TYPE; id = SQSH_MM_RAMKA; x=(423+80)/1024; y=70/768; sx=351/1024; sy=160/768; image={texture=""; }; ystart=-160/768; hitTestMode = HITTEST_NONE; },
{type = SQSH_MAPWINDOW; id = SQSH_MM_SAVE_GAME_MAP; x=(611+150)/1024; y=(200+16)/768; sx=128/1024; sy=128/768; image={texture="";ix = 1; iy = 1;}; },
{type = SQSH_MAPWINDOW; id = SQSH_MM_SAVE_GAME_MAP; x=(611+150)/1024; y=(200+16)/768; sx=128/1024; sy=128/768; image={texture="";ix = 1; iy = 1;};image_h={texture="resource\\icons\\MainMenu\\tv.avi";_ix = 0; _iy = 0; ix = 120; iy = 120;hasResolutionVersion=0;}; },
{type = SQSH_TEXT_WINDOW_TYPE; id = SQSH_MM_SAVE_GAME_MAP_DESCR_TXT; x=(350+137)/1024; y=(330+17)/768; sx=402/1024; sy=128/768; txt_align=SHELL_ALIGN_LEFT; image={texture="";};},


Expand Down Expand Up @@ -5564,20 +5561,29 @@ sqshControlContainer _sqsh_controls[int _sqsh_control_count] = {
{
id = SQSH_MM_SUBMIT_DIALOG_SCR;
load_group = SHELL_LOAD_GROUP_GAME|SHELL_LOAD_GROUP_MENU;
// x=341;
// y=161;
// sx=339;
// sy=466;
x = 0;
y = 0;
sx = 1024;
sy = 768;
type = SQSH_MULTITEX_WINDOW;
// image = {texture="resource\\icons\\MainMenu\\t.avi";hasResolutionVersion=0;};
// image2 = {texture="resource\\icons\\MainMenu\\new_black.tga";hasBelligerentVersion = 1;};
image = {texture="resource\\icons\\MainMenu\\t.avi";hasResolutionVersion=0;};
image2 = {texture="resource\\icons\\MainMenu\\il.tga";};
// image2 = {texture="resource\\icons\\MainMenu\\il.tga";};
controls = new sqshControl[] {
//Screen bg
{
id = SQSH_MM_SUBMIT_BACKGROUND;
x = 0;
y = 0;
sx = 1024;
sy = 768;
type = SQSH_MULTITEX_WINDOW;
image = {texture="resource\\icons\\MainMenu\\t.avi";hasResolutionVersion=0;};
image2 = {texture="resource\\icons\\MainMenu\\il.tga";};
state = SQSH_ENABLED;
hitTestMode = HITTEST_NONE;
},

//Dialog UI bg
{type = SQSH_MOVE_BUTTON_TYPE; id = SQSH_MM_RAMKA; x=339/1024; y=0/768; sx=330/1024; sy=527/768;image={texture="resource\\icons\\MainMenu\\new_menu.tga";_ix = 0; _iy = 0; ix = 330; iy = 527; };state = SQSH_ENABLED; xstart=359; ystart=-768; },
// {type = SQSH_TEXT_WINDOW_TYPE; id = SQSH_MM_SUBMIT_TXT; x=(359+23)/1024; y=280/768; sx=245/1024; sy=150/768; image={texture="";};},
{type = SQSH_TEXT_WINDOW_TYPE; id = SQSH_MM_SUBMIT_TXT; x=(359+25)/1024; y=140/768; sx=241/1024; sy=150/768; image={texture="";};},
Expand Down
1 change: 1 addition & 0 deletions Source/Scripts/SquadShellEnums.inl
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,7 @@ enum ShellControlID
SQSH_MM_BACK_FROM_SOUND_BTN,

//submit dialog
SQSH_MM_SUBMIT_BACKGROUND,
SQSH_MM_SUBMIT_TXT,
SQSH_MM_SUBMIT_YES_BTN,
SQSH_MM_SUBMIT_YES_BORDER,
Expand Down
161 changes: 82 additions & 79 deletions Source/UserInterface/MainMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1611,83 +1611,91 @@ void OnSplashScreenKeyLast(CShellWindow* pWnd, InterfaceEventCode code, int para

//-----------------------------------
//general
void onMMBackButton(CShellWindow* pWnd, InterfaceEventCode code, int param) {
if( code == EVENT_UNPRESSED && intfCanHandleInput() ) {
int nShow;
switch ( pWnd->m_pParent->ID ) {
case SQSH_MM_SINGLE_SCR:
case SQSH_MM_MULTIPLAYER_LIST_SCR:
case SQSH_MM_COMMUNITY_SCR:
case SQSH_MM_OPTIONS_SCR:
case SQSH_MM_CREDITS_SCR:
nShow = SQSH_MM_START_SCR;
break;
case SQSH_MM_ADDONS_SCR:
nShow = SQSH_MM_COMMUNITY_SCR;
break;
case SQSH_MM_GAME_SCR:
case SQSH_MM_SOUND_SCR:
nShow = SQSH_MM_OPTIONS_SCR;
break;
case SQSH_MM_GRAPHICS_SCR:
GraphOptionsManager::getInstance().reset();
nShow = SQSH_MM_OPTIONS_SCR;
break;
case SQSH_MM_MULTIPLAYER_JOIN_SCR:
case SQSH_MM_MULTIPLAYER_LOBBY_SCR:
case SQSH_MM_MULTIPLAYER_PASSWORD_SCR:
nShow = SQSH_MM_MULTIPLAYER_LIST_SCR;
break;
case SQSH_MM_MULTIPLAYER_HOST_SCR:
nShow = SQSH_MM_MULTIPLAYER_LOBBY_SCR;
break;
case SQSH_MM_SCENARIO_SCR:
case SQSH_MM_BATTLE_SCR:
case SQSH_MM_LOAD_SCR:
case SQSH_MM_LOAD_REPLAY_SCR:
case SQSH_MM_CONTENT_CHOOSER_SCR:
nShow = SQSH_MM_SINGLE_SCR;
break;
case SQSH_MM_LOAD_IN_GAME_SCR:
case SQSH_MM_SAVE_GAME_SCR:
nShow = SQSH_MM_INMISSION_SCR;
break;
case SQSH_MM_SAVE_REPLAY_SCR:
nShow = SQSH_MM_STATS_SCR;
break;
case SQSH_MM_PROFILE_SCR:
showSingleMenu(pWnd);
return;
case SQSH_MM_MISSION_TASK_SCR:
nShow = RESUME_GAME;
break;
case SQSH_MM_CUSTOM_SCR:
OnComboGraphicsSettings(_shellIconManager.GetWnd(SQSH_MM_SETTINGS_COMBO), EVENT_CREATEWND, -1);
nShow = SQSH_MM_GRAPHICS_SCR;
break;
case SQSH_MM_SCREEN_OPTIONS:

void goToPreviousScreen(CShellWindow* pWnd, int current_screen_id) {
int nShow = 0;
switch (current_screen_id) {
case SQSH_MM_SINGLE_SCR:
case SQSH_MM_MULTIPLAYER_LIST_SCR:
case SQSH_MM_COMMUNITY_SCR:
case SQSH_MM_OPTIONS_SCR:
case SQSH_MM_CREDITS_SCR:
nShow = SQSH_MM_START_SCR;
break;
case SQSH_MM_ADDONS_SCR:
nShow = SQSH_MM_COMMUNITY_SCR;
break;
case SQSH_MM_GAME_SCR:
case SQSH_MM_SOUND_SCR:
nShow = SQSH_MM_OPTIONS_SCR;
break;
case SQSH_MM_GRAPHICS_SCR:
GraphOptionsManager::getInstance().reset();
nShow = SQSH_MM_OPTIONS_SCR;
break;
case SQSH_MM_MULTIPLAYER_JOIN_SCR:
case SQSH_MM_MULTIPLAYER_LOBBY_SCR:
case SQSH_MM_MULTIPLAYER_PASSWORD_SCR:
nShow = SQSH_MM_MULTIPLAYER_LIST_SCR;
break;
case SQSH_MM_MULTIPLAYER_HOST_SCR:
nShow = SQSH_MM_MULTIPLAYER_LOBBY_SCR;
break;
case SQSH_MM_SCENARIO_SCR:
case SQSH_MM_BATTLE_SCR:
case SQSH_MM_LOAD_SCR:
case SQSH_MM_LOAD_REPLAY_SCR:
case SQSH_MM_CONTENT_CHOOSER_SCR:
nShow = SQSH_MM_SINGLE_SCR;
break;
case SQSH_MM_LOAD_IN_GAME_SCR:
case SQSH_MM_SAVE_GAME_SCR:
nShow = SQSH_MM_INMISSION_SCR;
break;
case SQSH_MM_SAVE_REPLAY_SCR:
nShow = SQSH_MM_STATS_SCR;
break;
case SQSH_MM_PROFILE_SCR:
showSingleMenu(pWnd);
return;
case SQSH_MM_INMISSION_SCR:
case SQSH_MM_MISSION_TASK_SCR:
nShow = RESUME_GAME;
break;
case SQSH_MM_CUSTOM_SCR:
OnComboGraphicsSettings(_shellIconManager.GetWnd(SQSH_MM_SETTINGS_COMBO), EVENT_CREATEWND, -1);
nShow = SQSH_MM_GRAPHICS_SCR;
break;
case SQSH_MM_SCREEN_OPTIONS:
// GraphOptionsManager::getInstance().reset();
// extern void PerimeterDataChannelSave();
// PerimeterDataChannelSave();
nShow = SQSH_MM_INMISSION_SCR;
break;
case SQSH_MM_SCREEN_GAME:
case SQSH_MM_SCREEN_SOUND:
nShow = SQSH_MM_SCREEN_OPTIONS;
break;
case SQSH_MM_INGAME_CUSTOM_SCR:
OnComboGraphicsSettings(_shellIconManager.GetWnd(SQSH_MM_SETTINGS_COMBO), EVENT_CREATEWND, -1);
nShow = SQSH_MM_SCREEN_GRAPHICS;
break;
case SQSH_MM_SCREEN_GRAPHICS:
GraphOptionsManager::getInstance().reset();
nShow = SQSH_MM_SCREEN_OPTIONS;
break;
default:
return;
}
_shellIconManager.SwitchMenuScreens( pWnd->m_pParent->ID, nShow );
}
nShow = SQSH_MM_INMISSION_SCR;
break;
case SQSH_MM_SCREEN_GAME:
case SQSH_MM_SCREEN_SOUND:
nShow = SQSH_MM_SCREEN_OPTIONS;
break;
case SQSH_MM_INGAME_CUSTOM_SCR:
OnComboGraphicsSettings(_shellIconManager.GetWnd(SQSH_MM_SETTINGS_COMBO), EVENT_CREATEWND, -1);
nShow = SQSH_MM_SCREEN_GRAPHICS;
break;
case SQSH_MM_SCREEN_GRAPHICS:
GraphOptionsManager::getInstance().reset();
nShow = SQSH_MM_SCREEN_OPTIONS;
break;
default:
return;
}
if (nShow != 0) {
_shellIconManager.SwitchMenuScreens(current_screen_id, nShow);
}
}

void onMMBackButton(CShellWindow* pWnd, InterfaceEventCode code, int param) {
if( code == EVENT_UNPRESSED && intfCanHandleInput() ) {
goToPreviousScreen(pWnd, pWnd->m_pParent->ID);
}
}

//start menu
Expand Down Expand Up @@ -1860,11 +1868,6 @@ void onMMInMissRestartButton(CShellWindow* pWnd, InterfaceEventCode code, int pa
showMessageBox();
}
}
void onMMInMissResumeButton(CShellWindow* pWnd, InterfaceEventCode code, int param) {
if( code == EVENT_UNPRESSED && intfCanHandleInput() ) {
_shellIconManager.SwitchMenuScreens( pWnd->m_pParent->ID, RESUME_GAME );
}
}
void exitToInterfaceMessage(CShellWindow* pWnd) {
int id_off = pWnd ? pWnd->m_pParent->ID : -1;
switch(gameShell->currentSingleProfile.getLastGameType()) {
Expand Down
18 changes: 18 additions & 0 deletions Source/UserInterface/MessageBox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,24 @@ void hideMessageBox() {
_shellIconManager.SwitchMenuScreens( SQSH_MM_SUBMIT_DIALOG_SCR, FAKE );
}

//background control
void onMMSubmitDialogBackground(CShellWindow* pWnd, InterfaceEventCode code, int param) {
if( code == EVENT_SHOWWND ) {
//Pick the current active screen if any, if is a CMultiTexWindow check if it has any bg and if it has then
// not show one from dialog to avoid duplicate bg's
bool showBackground = true;
int id = _shellIconManager.getVisibleMenuScr();
CMultiTexWindow* current_scr = 0 < id ? dynamic_cast<CMultiTexWindow*>(_shellIconManager.GetWnd(id)) : nullptr;
if (current_scr) {
showBackground = current_scr->m_hTexture2 == nullptr
&& current_scr->m_hTexture3 == nullptr;
}
if (!showBackground) {
pWnd->Show(false);
}
}
}

//submit dialog
void onMMSubmitYesButton(CShellWindow* pWnd, InterfaceEventCode code, int param) {
if( code == EVENT_UNPRESSED ) {
Expand Down
3 changes: 2 additions & 1 deletion Source/UserInterface/PerimeterShellDisp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ _handlertbl[] = {
{SQSH_MM_INMISSION_LOAD_BTN, onMMInMissLoadButton},
{SQSH_MM_INMISSION_OPTIONS_BTN, onMMInMissOptionsButton},
{SQSH_MM_INMISSION_RESTART_BTN, onMMInMissRestartButton},
{SQSH_MM_INMISSION_RESUME_BTN, onMMInMissResumeButton},
{SQSH_MM_INMISSION_RESUME_BTN, onMMBackButton},
{SQSH_MM_INMISSION_QUIT_BTN, onMMInMissQuitButton},

//battle
Expand Down Expand Up @@ -323,6 +323,7 @@ _handlertbl[] = {
{SQSH_MM_BACK_FROM_SOUND_BTN, onMMBackButton},

//submit dialog
{SQSH_MM_SUBMIT_BACKGROUND, onMMSubmitDialogBackground},
{SQSH_MM_SUBMIT_YES_BTN, onMMSubmitYesButton},
{SQSH_MM_SUBMIT_NO_BTN, onMMSubmitNoButton},
{SQSH_MM_SUBMIT_OK_BTN, onMMSubmitYesButton},
Expand Down
Loading

0 comments on commit 88eba31

Please sign in to comment.