@ -19,6 +19,7 @@ int selgame_selectedGame;
bool selgame_endMenu ;
int * gdwPlayerId ;
int gbDifficulty ;
int gbTickRate ;
int heroLevel ;
static _SNETPROGRAMDATA * m_client_info ;
@ -170,7 +171,7 @@ void selgame_GameSelection_Select(int value)
UiInitList ( 0 , NUM_DIFFICULTIES - 1 , selgame_Diff_Focus , selgame_Diff_Select , selgame_Diff_Esc , vecSelGameDialog , true ) ;
break ;
}
case 1 :
case 1 : {
strncpy ( title , " Join TCP Games " , sizeof ( title ) - 1 ) ;
SDL_Rect rect4 = { PANEL_LEFT + 305 , ( UI_OFFSET_Y + 211 ) , 285 , 33 } ;
@ -188,6 +189,7 @@ void selgame_GameSelection_Select(int value)
UiInitList ( 0 , 0 , NULL , selgame_Password_Init , selgame_GameSelection_Init , vecSelGameDialog ) ;
break ;
}
}
}
void selgame_GameSelection_Esc ( )
@ -248,12 +250,7 @@ void selgame_Diff_Select(int value)
return ;
}
if ( provider = = SELCONN_LOOPBACK ) {
selgame_Password_Select ( 0 ) ;
return ;
}
selgame_Password_Init ( 0 ) ;
selgame_GameSpeedSelection ( ) ;
}
void selgame_Diff_Esc ( )
@ -274,6 +271,83 @@ void selgame_Diff_Esc()
selgame_GameSelection_Init ( ) ;
}
void selgame_GameSpeedSelection ( )
{
gfnHeroInfo ( UpdateHeroLevel ) ;
selgame_FreeVectors ( ) ;
UiAddBackground ( & vecSelGameDialog ) ;
UiAddLogo ( & vecSelGameDialog ) ;
SDL_Rect rect1 = { PANEL_LEFT + 24 , ( UI_OFFSET_Y + 161 ) , 590 , 35 } ;
vecSelGameDialog . push_back ( new UiArtText ( " Create Game " , rect1 , UIS_CENTER | UIS_BIG ) ) ;
SDL_Rect rect2 = { PANEL_LEFT + 34 , ( UI_OFFSET_Y + 211 ) , 205 , 33 } ;
vecSelGameDialog . push_back ( new UiArtText ( selgame_Label , rect2 , UIS_CENTER | UIS_BIG ) ) ;
SDL_Rect rect3 = { PANEL_LEFT + 35 , ( UI_OFFSET_Y + 256 ) , DESCRIPTION_WIDTH , 192 } ;
vecSelGameDialog . push_back ( new UiArtText ( selgame_Description , rect3 ) ) ;
SDL_Rect rect4 = { PANEL_LEFT + 299 , ( UI_OFFSET_Y + 211 ) , 295 , 35 } ;
vecSelGameDialog . push_back ( new UiArtText ( " Select Game Speed " , rect4 , UIS_CENTER | UIS_BIG ) ) ;
vecSelGameDlgItems . push_back ( new UiListItem ( " Normal " , 0 ) ) ;
vecSelGameDlgItems . push_back ( new UiListItem ( " Fast " , 1 ) ) ;
vecSelGameDlgItems . push_back ( new UiListItem ( " Faster " , 2 ) ) ;
vecSelGameDlgItems . push_back ( new UiListItem ( " Fastest " , 3 ) ) ;
vecSelGameDialog . push_back ( new UiList ( vecSelGameDlgItems , PANEL_LEFT + 300 , ( UI_OFFSET_Y + 279 ) , 295 , 26 , UIS_CENTER | UIS_MED | UIS_GOLD ) ) ;
SDL_Rect rect5 = { PANEL_LEFT + 299 , ( UI_OFFSET_Y + 427 ) , 140 , 35 } ;
vecSelGameDialog . push_back ( new UiArtTextButton ( " OK " , & UiFocusNavigationSelect , rect5 , UIS_CENTER | UIS_VCENTER | UIS_BIG | UIS_GOLD ) ) ;
SDL_Rect rect6 = { PANEL_LEFT + 449 , ( UI_OFFSET_Y + 427 ) , 140 , 35 } ;
vecSelGameDialog . push_back ( new UiArtTextButton ( " CANCEL " , & UiFocusNavigationEsc , rect6 , UIS_CENTER | UIS_VCENTER | UIS_BIG | UIS_GOLD ) ) ;
UiInitList ( 0 , 3 , selgame_Speed_Focus , selgame_Speed_Select , selgame_Speed_Esc , vecSelGameDialog , true ) ;
}
void selgame_Speed_Focus ( int value )
{
switch ( value ) {
case 0 :
strncpy ( selgame_Label , " Normal " , sizeof ( selgame_Label ) - 1 ) ;
strncpy ( selgame_Description , " Normal Speed \n This is where a starting character should begin the quest to defeat Diablo. " , sizeof ( selgame_Description ) - 1 ) ;
break ;
case 1 :
strncpy ( selgame_Label , " Fast " , sizeof ( selgame_Label ) - 1 ) ;
strncpy ( selgame_Description , " Fast Speed \n The denizens of the Labyrinth have been hastened and will prove to be a greater challenge. This is recommended for experienced characters only. " , sizeof ( selgame_Description ) - 1 ) ;
break ;
case 2 :
strncpy ( selgame_Label , " Faster " , sizeof ( selgame_Label ) - 1 ) ;
strncpy ( selgame_Description , " Faster Speed \n Most monsters of the dungeon will seek you out quicker than ever before. Only an experienced champion should try their luck at this speed. " , sizeof ( selgame_Description ) - 1 ) ;
break ;
case 3 :
strncpy ( selgame_Label , " Faster " , sizeof ( selgame_Label ) - 1 ) ;
strncpy ( selgame_Description , " Fastest Speed \n The minions of the underworld will rush to attack with out hesitation. Only a true speed deamon should enter at this pace. " , sizeof ( selgame_Description ) - 1 ) ;
break ;
}
WordWrapArtStr ( selgame_Description , DESCRIPTION_WIDTH ) ;
}
void selgame_Speed_Esc ( )
{
selgame_GameSelection_Select ( 0 ) ;
}
void selgame_Speed_Select ( int value )
{
gbTickRate = 20 + 10 * value ;
if ( provider = = SELCONN_LOOPBACK ) {
selgame_Password_Select ( 0 ) ;
return ;
}
selgame_Password_Init ( 0 ) ;
}
void selgame_Password_Init ( int value )
{
memset ( & selgame_Password , 0 , sizeof ( selgame_Password ) ) ;
@ -330,6 +404,7 @@ void selgame_Password_Select(int value)
_gamedata * info = m_client_info - > initdata ;
info - > bDiff = gbDifficulty ;
info - > bRate = gbTickRate ;
if ( SNetCreateGame ( NULL , selgame_Password , NULL , 0 , ( char * ) info , sizeof ( _gamedata ) , MAX_PLRS , NULL , NULL , gdwPlayerId ) ) {
UiInitList_clear ( ) ;
@ -344,7 +419,10 @@ void selgame_Password_Select(int value)
void selgame_Password_Esc ( )
{
selgame_GameSelection_Select ( selgame_selectedGame ) ;
if ( selgame_selectedGame = = 1 )
selgame_GameSelection_Select ( 1 ) ;
else
selgame_GameSpeedSelection ( ) ;
}
int UiSelectGame ( int a1 , _SNETPROGRAMDATA * client_info , _SNETPLAYERDATA * user_info , _SNETUIDATA * ui_info ,