|
|
|
|
@ -4,10 +4,11 @@
|
|
|
|
|
#include "sdlrender.h" |
|
|
|
|
#include "stubs.h" |
|
|
|
|
|
|
|
|
|
int menu = 0; |
|
|
|
|
int SelectedItem = 1; |
|
|
|
|
int SelectedItemMax = 1; |
|
|
|
|
int MenuItem[10] = { 5, 0, 1, 0, 0, 0, 0, 0, 0, 0 }; |
|
|
|
|
int menu = SPLASH; |
|
|
|
|
int SelectedItem = 0; |
|
|
|
|
int SelectedItemMax = 0; |
|
|
|
|
int MenuItem[11] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; |
|
|
|
|
int PreviousItem[11] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; |
|
|
|
|
|
|
|
|
|
void __cdecl UiDestroy() |
|
|
|
|
{ |
|
|
|
|
@ -44,7 +45,7 @@ void LoadCharNamesintoMemory()
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for (int i = 0; i < MAX_CHARACTERS; i++) { |
|
|
|
|
strcpy(p_hero_names, "32as1d"); |
|
|
|
|
strcpy(p_hero_names, "32as1d"); |
|
|
|
|
p_hero_names += 32; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -84,7 +85,28 @@ BOOL IsInsideRect(int x, int y, SDL_Rect rect)
|
|
|
|
|
return IsInside(x, y, rect.x, rect.y, rect.w, rect.h); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void LoadUiGFX() // I anticipate to move this later.
|
|
|
|
|
void InitHiracy() |
|
|
|
|
{ |
|
|
|
|
MenuItem[MAINMENU] = 5; |
|
|
|
|
MenuItem[SINGLEPLAYER_CLASSES] = 3; |
|
|
|
|
MenuItem[MULTIPLAYER_CONNECTIONS] = 4; |
|
|
|
|
MenuItem[MULTIPLAYER_LOBBY] = 2; |
|
|
|
|
MenuItem[MULTIPLAYER_DIFFICULTY] = 3; |
|
|
|
|
MenuItem[MULTIPLAYER_BNET_GATEWAYS] = 3; |
|
|
|
|
|
|
|
|
|
PreviousItem[SPLASH] = MAINMENU; |
|
|
|
|
PreviousItem[SINGLEPLAYER_LOAD] = MAINMENU; |
|
|
|
|
PreviousItem[SINGLEPLAYER_CLASSES] = SINGLEPLAYER_LOAD; |
|
|
|
|
PreviousItem[SINGLEPLAYER_NAME] = SINGLEPLAYER_CLASSES; |
|
|
|
|
PreviousItem[MULTIPLAYER_CONNECTIONS] = MAINMENU; |
|
|
|
|
PreviousItem[MULTIPLAYER_LOBBY] = MULTIPLAYER_CONNECTIONS; |
|
|
|
|
PreviousItem[MULTIPLAYER_DIFFICULTY] = MULTIPLAYER_LOBBY; |
|
|
|
|
PreviousItem[MULTIPLAYER_BNET_GATEWAYS] = MULTIPLAYER_CONNECTIONS; |
|
|
|
|
PreviousItem[MULTIPLAYER_ERROR] = MAINMENU; |
|
|
|
|
PreviousItem[CREDIT] = MAINMENU; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void LoadUiGFX() |
|
|
|
|
{ |
|
|
|
|
DWORD dwData[2]; |
|
|
|
|
|
|
|
|
|
@ -95,10 +117,15 @@ void LoadUiGFX() // I anticipate to move this later.
|
|
|
|
|
gdwCursorWidth = dwData[0]; |
|
|
|
|
gdwCursorHeight = dwData[1]; |
|
|
|
|
|
|
|
|
|
LoadArtImage("ui_art\\smlogo.pcx", &pPcxLogoImage, 15, dwData); |
|
|
|
|
printf("logo\n"); |
|
|
|
|
LoadArtImage("ui_art\\logo.pcx", &pPcxLogoImage, 15, dwData); |
|
|
|
|
gdwLogoWidth = dwData[0]; |
|
|
|
|
gdwLogoHeight = dwData[1]; |
|
|
|
|
|
|
|
|
|
LoadArtImage("ui_art\\smlogo.pcx", &pPcxLogoSmImage, 15, dwData); |
|
|
|
|
gdwLogoSmWidth = dwData[0]; |
|
|
|
|
gdwLogoSmHeight = dwData[1]; |
|
|
|
|
|
|
|
|
|
LoadArtImage("ui_art\\heros.pcx", &pPcxHeroImage, 4, dwData); |
|
|
|
|
gdwHeroWidth = dwData[0]; |
|
|
|
|
gdwHeroHeight = dwData[1]; |
|
|
|
|
@ -110,6 +137,7 @@ void LoadUiGFX() // I anticipate to move this later.
|
|
|
|
|
gdwFont16Height = dwData[1]; |
|
|
|
|
|
|
|
|
|
pFont24 = LoadFileInMem("ui_art\\font24.bin", 0); |
|
|
|
|
LoadArtImage("ui_art\\font24s.pcx", &pPcxFont24sImage, 256, NULL); |
|
|
|
|
LoadArtImage("ui_art\\font24g.pcx", &pPcxFont24gImage, 256, dwData); |
|
|
|
|
gdwFont24Width = dwData[0]; |
|
|
|
|
gdwFont24Height = dwData[1]; |
|
|
|
|
@ -126,11 +154,13 @@ void LoadUiGFX() // I anticipate to move this later.
|
|
|
|
|
gdwFont42Height = dwData[1]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void UiInitialize() // I anticipate to move this later.
|
|
|
|
|
void UiInitialize() |
|
|
|
|
{ |
|
|
|
|
printf("UiInitialize"); |
|
|
|
|
//SDL_SetRelativeMouseMode(SDL_TRUE);
|
|
|
|
|
// WNDPROC saveProc;
|
|
|
|
|
|
|
|
|
|
InitHiracy(); |
|
|
|
|
LoadUiGFX(); |
|
|
|
|
snd_init(0); |
|
|
|
|
music_start(5); |
|
|
|
|
@ -139,7 +169,7 @@ void UiInitialize() // I anticipate to move this later.
|
|
|
|
|
|
|
|
|
|
signed int NewHeroNameIndex = 0; |
|
|
|
|
|
|
|
|
|
SetMenu(0); |
|
|
|
|
SelectedItemMax = MenuItem[menu]; |
|
|
|
|
SDL_Event event; |
|
|
|
|
int x, y; |
|
|
|
|
bool quit = false; |
|
|
|
|
@ -163,36 +193,39 @@ void UiInitialize() // I anticipate to move this later.
|
|
|
|
|
PaletteFadeIn(32); |
|
|
|
|
|
|
|
|
|
switch (menu) { |
|
|
|
|
case 0: |
|
|
|
|
case SPLASH: |
|
|
|
|
SDL_RenderDiabloSplashPage(); |
|
|
|
|
break; |
|
|
|
|
case MAINMENU: |
|
|
|
|
SDL_RenderDiabloMainPage(); |
|
|
|
|
break; |
|
|
|
|
case 2: |
|
|
|
|
case SINGLEPLAYER_LOAD: |
|
|
|
|
SDL_RenderDiabloSinglePlayerPage(); |
|
|
|
|
gbMaxPlayers = 1; |
|
|
|
|
DrawMouse(); |
|
|
|
|
break; |
|
|
|
|
case 3: |
|
|
|
|
CreateHeroMenu(); |
|
|
|
|
case SINGLEPLAYER_CLASSES: |
|
|
|
|
CreateHeroMenu(); // TODO crashes
|
|
|
|
|
DrawNewHeroImage(HeroPortrait, 1); |
|
|
|
|
DrawMouse(); |
|
|
|
|
break; |
|
|
|
|
case 4: |
|
|
|
|
case SINGLEPLAYER_NAME: |
|
|
|
|
DrawNewHeroImage(HeroPortrait, 0); |
|
|
|
|
RenderDefaultStats(HeroPortrait); |
|
|
|
|
RenderUndecidedHeroName(); |
|
|
|
|
DrawMouse(); |
|
|
|
|
break; |
|
|
|
|
case 5: |
|
|
|
|
case MULTIPLAYER_LOBBY: |
|
|
|
|
DrawPreGameOptions(HeroPortrait, 1); |
|
|
|
|
RenderDefaultStats(HeroPortrait); |
|
|
|
|
DrawMouse(); |
|
|
|
|
break; |
|
|
|
|
case 6: |
|
|
|
|
case MULTIPLAYER_DIFFICULTY: |
|
|
|
|
DrawPreGameDifficultySelection(HeroPortrait, 1); |
|
|
|
|
RenderDefaultStats(HeroPortrait); |
|
|
|
|
DrawMouse(); |
|
|
|
|
break; |
|
|
|
|
case 10: |
|
|
|
|
case CREDIT: |
|
|
|
|
ShowCredts(); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
@ -202,8 +235,8 @@ void UiInitialize() // I anticipate to move this later.
|
|
|
|
|
case SDL_KEYDOWN: |
|
|
|
|
switch (event.key.keysym.sym) { |
|
|
|
|
case SDLK_ESCAPE: |
|
|
|
|
if (menu != 0) { |
|
|
|
|
SetMenu(0); |
|
|
|
|
if (PreviousItem[menu]) { |
|
|
|
|
SetMenu(PreviousItem[menu]); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
quit = true; |
|
|
|
|
@ -234,22 +267,31 @@ void UiInitialize() // I anticipate to move this later.
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
case SDLK_RETURN: |
|
|
|
|
switch (SelectedItem) { |
|
|
|
|
case MAINMENU_SINGLE_PLAYER: |
|
|
|
|
SetMenu(2); // TODO skip to choose class if no valid saves
|
|
|
|
|
break; |
|
|
|
|
case MAINMENU_MULTIPLAYER: |
|
|
|
|
printf("Multi Player\n"); |
|
|
|
|
break; |
|
|
|
|
case MAINMENU_REPLAY_INTRO: |
|
|
|
|
printf("Replay Intro\n"); |
|
|
|
|
break; |
|
|
|
|
case MAINMENU_SHOW_CREDITS: |
|
|
|
|
SetMenu(10); |
|
|
|
|
switch (menu) { |
|
|
|
|
case MAINMENU: |
|
|
|
|
switch (SelectedItem) { |
|
|
|
|
case MAINMENU_SINGLE_PLAYER: |
|
|
|
|
SetMenu(SINGLEPLAYER_LOAD); // TODO skip to choose class if no valid saves
|
|
|
|
|
break; |
|
|
|
|
case MAINMENU_MULTIPLAYER: |
|
|
|
|
printf("Multi Player\n"); |
|
|
|
|
break; |
|
|
|
|
case MAINMENU_REPLAY_INTRO: |
|
|
|
|
printf("Replay Intro\n"); |
|
|
|
|
break; |
|
|
|
|
case MAINMENU_SHOW_CREDITS: |
|
|
|
|
SetMenu(CREDIT); |
|
|
|
|
break; |
|
|
|
|
case MAINMENU_EXIT_DIABLO: |
|
|
|
|
quit = true; |
|
|
|
|
ExitDiablo(); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
case MAINMENU_EXIT_DIABLO: |
|
|
|
|
quit = true; |
|
|
|
|
ExitDiablo(); |
|
|
|
|
case SINGLEPLAYER_LOAD: |
|
|
|
|
if (SelectedItem == SelectedItemMax) { |
|
|
|
|
SetMenu(SINGLEPLAYER_NAME); |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
@ -302,38 +344,38 @@ void UiInitialize() // I anticipate to move this later.
|
|
|
|
|
SDL_Rect SorcerorSelectBox; |
|
|
|
|
SorcerorSelectBox.y = 428; |
|
|
|
|
SorcerorSelectBox.x = 280; |
|
|
|
|
SorcerorSelectBox.w = SorcerorSelectBox.x + 100; |
|
|
|
|
SorcerorSelectBox.h = SorcerorSelectBox.y + 30; |
|
|
|
|
SorcerorSelectBox.w = 100; |
|
|
|
|
SorcerorSelectBox.h = 30; |
|
|
|
|
|
|
|
|
|
SDL_Rect CreateHeroCancelBox; |
|
|
|
|
CreateHeroCancelBox.y = 550; |
|
|
|
|
CreateHeroCancelBox.x = 675; |
|
|
|
|
CreateHeroCancelBox.w = CreateHeroCancelBox.x + 100; |
|
|
|
|
CreateHeroCancelBox.h = CreateHeroCancelBox.y + 30; |
|
|
|
|
CreateHeroCancelBox.w = 100; |
|
|
|
|
CreateHeroCancelBox.h = 30; |
|
|
|
|
|
|
|
|
|
clock_t start, end; |
|
|
|
|
double cpu_time_used; |
|
|
|
|
|
|
|
|
|
switch (menu) { |
|
|
|
|
case 0: |
|
|
|
|
case MAINMENU: |
|
|
|
|
ItemTop = 191; |
|
|
|
|
ItemHeight = 42; |
|
|
|
|
ItemWidth = 515; |
|
|
|
|
ItemLeft = GetCenterOffset(ItemWidth); |
|
|
|
|
if (IsInside(x, y, ItemLeft, ItemTop, ItemWidth, ItemHeight)) { |
|
|
|
|
SetMenu(2); // TODO skip to choose class if no valid saves
|
|
|
|
|
SetMenu(SINGLEPLAYER_LOAD); // TODO skip to choose class if no valid saves
|
|
|
|
|
} else if (IsInside(x, y, ItemLeft, ItemTop + ItemHeight + 1, ItemWidth, ItemHeight)) { |
|
|
|
|
printf("Multi Player\n"); |
|
|
|
|
} else if (IsInside(x, y, ItemLeft, ItemTop + ItemHeight * 2 + 1, ItemWidth, ItemHeight)) { |
|
|
|
|
printf("Replay Intro\n"); |
|
|
|
|
} else if (IsInside(x, y, ItemLeft, ItemTop + ItemHeight * 3 + 2, ItemWidth, ItemHeight)) { |
|
|
|
|
SetMenu(10); |
|
|
|
|
SetMenu(CREDIT); |
|
|
|
|
} else if (IsInside(x, y, ItemLeft, ItemTop + ItemHeight * 4 + 3, ItemWidth, ItemHeight)) { |
|
|
|
|
quit = true; |
|
|
|
|
ExitDiablo(); |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
case 2: |
|
|
|
|
case SINGLEPLAYER_LOAD: |
|
|
|
|
ItemLeft = 440; |
|
|
|
|
ItemTop = 315; |
|
|
|
|
ItemHeight = 30; |
|
|
|
|
@ -346,49 +388,49 @@ void UiInitialize() // I anticipate to move this later.
|
|
|
|
|
if (TotalPlayers >= 1 && IsInside(x, y, ItemLeft, ItemTop, ItemWidth, ItemHeight)) { |
|
|
|
|
strcpy(chr_name_str, hero_names[0]); |
|
|
|
|
printf("Player %s\n", chr_name_str); |
|
|
|
|
SetMenu(5); |
|
|
|
|
SetMenu(MULTIPLAYER_LOBBY); |
|
|
|
|
// break;
|
|
|
|
|
} else if (TotalPlayers >= 2 && IsInside(x, y, ItemLeft, ItemTop + ItemHeight, ItemWidth, ItemHeight)) { |
|
|
|
|
printf("Player 2 Diablo\n"); |
|
|
|
|
strcpy(chr_name_str, hero_names[1]); |
|
|
|
|
printf("Player %s\n", chr_name_str); |
|
|
|
|
SetMenu(5); |
|
|
|
|
SetMenu(MULTIPLAYER_LOBBY); |
|
|
|
|
// break;
|
|
|
|
|
} else if (TotalPlayers >= 3 && IsInside(x, y, ItemLeft, ItemTop + ItemHeight * 2, ItemWidth, ItemHeight)) { |
|
|
|
|
printf("Player 3 Diablo\n"); |
|
|
|
|
strcpy(chr_name_str, hero_names[2]); |
|
|
|
|
printf("Player %s\n", chr_name_str); |
|
|
|
|
SetMenu(5); |
|
|
|
|
SetMenu(MULTIPLAYER_LOBBY); |
|
|
|
|
// break;
|
|
|
|
|
} else if (TotalPlayers >= 4 && IsInside(x, y, ItemLeft, ItemTop + ItemHeight * 3, ItemWidth, ItemHeight)) { |
|
|
|
|
printf("Player 4 Diablo\n"); |
|
|
|
|
strcpy(chr_name_str, hero_names[3]); |
|
|
|
|
printf("Player %s\n", chr_name_str); |
|
|
|
|
SetMenu(5); |
|
|
|
|
SetMenu(MULTIPLAYER_LOBBY); |
|
|
|
|
// break;
|
|
|
|
|
} else if (TotalPlayers >= 5 && IsInside(x, y, ItemLeft, ItemTop + ItemHeight * 4, ItemWidth, ItemHeight)) { |
|
|
|
|
printf("Player 5 Diablo\n"); |
|
|
|
|
strcpy(chr_name_str, hero_names[4]); |
|
|
|
|
printf("Player %s\n", chr_name_str); |
|
|
|
|
SetMenu(5); |
|
|
|
|
SetMenu(MULTIPLAYER_LOBBY); |
|
|
|
|
// break;
|
|
|
|
|
} else if (TotalPlayers >= 6 && IsInside(x, y, ItemLeft, ItemTop + ItemHeight * 5, ItemWidth, ItemHeight)) { |
|
|
|
|
printf("Player 6 Diablo\n"); |
|
|
|
|
strcpy(chr_name_str, hero_names[5]); |
|
|
|
|
printf("Player %s\n", chr_name_str); |
|
|
|
|
SetMenu(5); |
|
|
|
|
SetMenu(MULTIPLAYER_LOBBY); |
|
|
|
|
// break;
|
|
|
|
|
} else if (TotalPlayers >= 6 && IsInsideRect(x, y, CreateHeroCancelBox)) { |
|
|
|
|
HeroPortrait = 3; |
|
|
|
|
|
|
|
|
|
printf("Cancel\n\n\n"); |
|
|
|
|
SetMenu(0); |
|
|
|
|
SetMenu(MAINMENU); |
|
|
|
|
} else if (TotalPlayers >= 6 && IsInside(x, y, CreateHeroX + ItemWidth, CreateHeroY, ItemWidth, ItemHeight)) { |
|
|
|
|
printf("Clicked Create Hero Box\n"); |
|
|
|
|
SetMenu(3); |
|
|
|
|
SetMenu(SINGLEPLAYER_CLASSES); |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
case 3: |
|
|
|
|
case SINGLEPLAYER_CLASSES: |
|
|
|
|
// SinglePlayerMenuItemsLoaded = 0;
|
|
|
|
|
printf("\n\nmenu3 X%d Y%d \n ", x, y); |
|
|
|
|
|
|
|
|
|
@ -407,14 +449,14 @@ void UiInitialize() // I anticipate to move this later.
|
|
|
|
|
SDL_Rect WarriorSelectBox; |
|
|
|
|
WarriorSelectBox.y = 350; |
|
|
|
|
WarriorSelectBox.x = 280; |
|
|
|
|
WarriorSelectBox.w = WarriorSelectBox.x + 100; |
|
|
|
|
WarriorSelectBox.h = WarriorSelectBox.y + 30; |
|
|
|
|
WarriorSelectBox.w = 100; |
|
|
|
|
WarriorSelectBox.h = 30; |
|
|
|
|
|
|
|
|
|
SDL_Rect RogueSelectBox; |
|
|
|
|
RogueSelectBox.y = 392; |
|
|
|
|
RogueSelectBox.x = 280; |
|
|
|
|
RogueSelectBox.w = RogueSelectBox.x + 100; |
|
|
|
|
RogueSelectBox.h = RogueSelectBox.y + 30; |
|
|
|
|
RogueSelectBox.w = 100; |
|
|
|
|
RogueSelectBox.h = 30; |
|
|
|
|
// X450 Y 392 ;
|
|
|
|
|
// X 447 Y 428
|
|
|
|
|
|
|
|
|
|
@ -422,33 +464,32 @@ void UiInitialize() // I anticipate to move this later.
|
|
|
|
|
printf(" warrior I was hit\n\n\n"); |
|
|
|
|
HeroPortrait = 0; |
|
|
|
|
HeroChosen = 0; |
|
|
|
|
SetMenu(4); |
|
|
|
|
SetMenu(SINGLEPLAYER_NAME); |
|
|
|
|
} else if (IsInsideRect(x, y, RogueSelectBox)) { |
|
|
|
|
printf(" rogue I was hit\n\n\n"); |
|
|
|
|
HeroPortrait = 1; |
|
|
|
|
HeroChosen = 1; |
|
|
|
|
SetMenu(4); |
|
|
|
|
SetMenu(SINGLEPLAYER_NAME); |
|
|
|
|
} else if (IsInsideRect(x, y, SorcerorSelectBox)) { |
|
|
|
|
HeroPortrait = 2; |
|
|
|
|
printf("sorceror I was hit\n\n\n"); |
|
|
|
|
HeroChosen = 2; |
|
|
|
|
SetMenu(4); |
|
|
|
|
SetMenu(SINGLEPLAYER_NAME); |
|
|
|
|
} else if (IsInsideRect(x, y, CreateHeroCancelBox)) { |
|
|
|
|
HeroPortrait = 3; |
|
|
|
|
|
|
|
|
|
printf("Cancel\n\n\n"); |
|
|
|
|
SetMenu(3); |
|
|
|
|
SetMenu(SINGLEPLAYER_CLASSES); |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
case 4: |
|
|
|
|
case SINGLEPLAYER_NAME: |
|
|
|
|
printf("Create hero"); |
|
|
|
|
|
|
|
|
|
// X 549 , Y 551
|
|
|
|
|
SDL_Rect ClickOkBox; |
|
|
|
|
ClickOkBox.y = 550; |
|
|
|
|
ClickOkBox.x = 550; |
|
|
|
|
ClickOkBox.w = ClickOkBox.x + 30; |
|
|
|
|
ClickOkBox.h = ClickOkBox.y + 30; |
|
|
|
|
ClickOkBox.x = 324; |
|
|
|
|
ClickOkBox.y = 430; |
|
|
|
|
ClickOkBox.w = 48; |
|
|
|
|
ClickOkBox.h = 30; |
|
|
|
|
|
|
|
|
|
if (IsInsideRect(x, y, CreateHeroCancelBox)) { |
|
|
|
|
memset(HeroUndecidedName, 0, 17); |
|
|
|
|
@ -457,7 +498,7 @@ void UiInitialize() // I anticipate to move this later.
|
|
|
|
|
|
|
|
|
|
printf("Cancel\n\n\n"); |
|
|
|
|
HeroPortrait = 3; |
|
|
|
|
SetMenu(3); |
|
|
|
|
SetMenu(SINGLEPLAYER_CLASSES); |
|
|
|
|
} else if (IsInsideRect(x, y, ClickOkBox)) { |
|
|
|
|
printf("Ok\n"); |
|
|
|
|
CreateSinglePlayerChar = 1; |
|
|
|
|
@ -481,20 +522,20 @@ void UiInitialize() // I anticipate to move this later.
|
|
|
|
|
SDL_Rect NewGameBox; |
|
|
|
|
NewGameBox.y = 350; |
|
|
|
|
NewGameBox.x = 280; |
|
|
|
|
NewGameBox.w = NewGameBox.x + 300; |
|
|
|
|
NewGameBox.h = NewGameBox.y + 30; |
|
|
|
|
NewGameBox.w = 300; |
|
|
|
|
NewGameBox.h = 30; |
|
|
|
|
|
|
|
|
|
SDL_Rect LoadGameBox; |
|
|
|
|
LoadGameBox.y = 392; |
|
|
|
|
LoadGameBox.x = 280; |
|
|
|
|
LoadGameBox.w = LoadGameBox.x + 300; |
|
|
|
|
LoadGameBox.h = LoadGameBox.y + 30; |
|
|
|
|
LoadGameBox.w = 300; |
|
|
|
|
LoadGameBox.h = 30; |
|
|
|
|
// X450 Y 392 ;
|
|
|
|
|
// X 447 Y 428
|
|
|
|
|
|
|
|
|
|
if (cpu_time_used > 0.5 && IsInsideRect(x, y, NewGameBox)) { |
|
|
|
|
printf(" New Game I was hit\n\n\n"); |
|
|
|
|
SetMenu(6); |
|
|
|
|
SetMenu(MULTIPLAYER_DIFFICULTY); |
|
|
|
|
cpu_time_used = 0; |
|
|
|
|
timestart = 0; |
|
|
|
|
start = 0; |
|
|
|
|
@ -512,12 +553,10 @@ void UiInitialize() // I anticipate to move this later.
|
|
|
|
|
|
|
|
|
|
printf("Cancel\n\n\n"); |
|
|
|
|
|
|
|
|
|
SetMenu(2); // TODO skip to main menu if no valid saves
|
|
|
|
|
SetMenu(SINGLEPLAYER_CLASSES); // TODO skip to main menu if no valid saves
|
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
case 6: |
|
|
|
|
// Choose difficulty
|
|
|
|
|
|
|
|
|
|
case MULTIPLAYER_DIFFICULTY: |
|
|
|
|
if (timestart == 0) { |
|
|
|
|
start = clock(); |
|
|
|
|
timestart = 1; |
|
|
|
|
@ -532,21 +571,21 @@ void UiInitialize() // I anticipate to move this later.
|
|
|
|
|
SDL_Rect NormalSelectBox; |
|
|
|
|
NormalSelectBox.y = 350; |
|
|
|
|
NormalSelectBox.x = 280; |
|
|
|
|
NormalSelectBox.w = NormalSelectBox.x + 300; |
|
|
|
|
NormalSelectBox.h = NormalSelectBox.y + 30; |
|
|
|
|
NormalSelectBox.w = 300; |
|
|
|
|
NormalSelectBox.h = 30; |
|
|
|
|
|
|
|
|
|
SDL_Rect NightmareSelectBox; |
|
|
|
|
NightmareSelectBox.y = 392; |
|
|
|
|
NightmareSelectBox.x = 280; |
|
|
|
|
NightmareSelectBox.w = NightmareSelectBox.x + 300; |
|
|
|
|
NightmareSelectBox.h = NightmareSelectBox.y + 30; |
|
|
|
|
NightmareSelectBox.w = 300; |
|
|
|
|
NightmareSelectBox.h = 30; |
|
|
|
|
// X450 Y 392 ;
|
|
|
|
|
|
|
|
|
|
SDL_Rect HellSelectBox; |
|
|
|
|
HellSelectBox.y = 428; |
|
|
|
|
HellSelectBox.x = 280; |
|
|
|
|
HellSelectBox.w = HellSelectBox.x + 300; |
|
|
|
|
HellSelectBox.h = HellSelectBox.y + 30; |
|
|
|
|
HellSelectBox.w = 300; |
|
|
|
|
HellSelectBox.h = 30; |
|
|
|
|
// X 447 Y 428
|
|
|
|
|
|
|
|
|
|
if (cpu_time_used > 0.5 && IsInsideRect(x, y, NormalSelectBox)) { |
|
|
|
|
@ -570,7 +609,7 @@ void UiInitialize() // I anticipate to move this later.
|
|
|
|
|
cpu_time_used = 0; |
|
|
|
|
|
|
|
|
|
printf("Cancel\n\n\n"); |
|
|
|
|
SetMenu(5); |
|
|
|
|
SetMenu(MULTIPLAYER_LOBBY); |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
|