Browse Source

Replace gbSpawned with gbIsSpawn

pull/3662/head
obligaron 4 years ago committed by Anders Jenbo
parent
commit
b5ab9758d0
  1. 1
      Source/DiabloUI/diabloui.cpp
  2. 2
      Source/DiabloUI/diabloui.h
  3. 4
      Source/DiabloUI/mainmenu.cpp
  4. 2
      Source/DiabloUI/selhero.cpp
  5. 2
      Source/DiabloUI/selok.cpp
  6. 1
      Source/DiabloUI/settingsmenu.cpp
  7. 5
      Source/DiabloUI/title.cpp
  8. 1
      Source/diablo.cpp

1
Source/DiabloUI/diabloui.cpp

@ -47,7 +47,6 @@ Art ArtBackgroundWidescreen;
Art ArtBackground;
Art ArtCursor;
Art ArtHero;
bool gbSpawned;
void (*gfnSoundFunction)(const char *file);
bool textInputActive = true;

2
Source/DiabloUI/diabloui.h

@ -72,7 +72,6 @@ extern Art ArtBackground;
extern Art ArtBackgroundWidescreen;
extern Art ArtCursor;
extern Art ArtHero;
extern bool gbSpawned;
extern void (*gfnSoundFunction)(const char *file);
extern bool (*gfnHeroInfo)(bool (*fninfofunc)(_uiheroinfo *));
@ -95,7 +94,6 @@ inline SDL_Surface *DiabloUiSurface()
void UiDestroy();
void UiTitleDialog();
void UiSetSpawned(bool bSpawned);
void UiInitialize();
bool UiValidPlayerName(const char *name); /* check */
void UiSelHeroMultDialog(bool (*fninfo)(bool (*fninfofunc)(_uiheroinfo *)), bool (*fncreate)(_uiheroinfo *), bool (*fnremove)(_uiheroinfo *), void (*fnstats)(unsigned int, _uidefaultstats *), _selhero_selections *dlgresult, uint32_t *saveNumber);

4
Source/DiabloUI/mainmenu.cpp

@ -40,7 +40,7 @@ void MainmenuLoad(const char *name, void (*fnSound)(const char *file))
vecMenuItems.push_back(std::make_unique<UiListItem>(_("Show Credits"), MAINMENU_SHOW_CREDITS));
vecMenuItems.push_back(std::make_unique<UiListItem>(gbIsHellfire ? _("Exit Hellfire") : _("Exit Diablo"), MAINMENU_EXIT_DIABLO));
if (!gbSpawned || gbIsHellfire) {
if (!gbIsSpawn || gbIsHellfire) {
if (gbIsHellfire)
LoadArt("ui_art\\mainmenuw.pcx", &ArtBackgroundWidescreen);
LoadBackgroundArt("ui_art\\mainmenu.pcx");
@ -51,7 +51,7 @@ void MainmenuLoad(const char *name, void (*fnSound)(const char *file))
UiAddBackground(&vecMainMenuDialog);
UiAddLogo(&vecMainMenuDialog);
if (gbSpawned && gbIsHellfire) {
if (gbIsSpawn && gbIsHellfire) {
SDL_Rect rect1 = { (Sint16)(PANEL_LEFT), (Sint16)(UI_OFFSET_Y + 145), 640, 30 };
vecMainMenuDialog.push_back(std::make_unique<UiArtText>(_("Shareware"), rect1, UiFlags::FontSize30 | UiFlags::ColorUiSilver | UiFlags::AlignCenter, 8));
}

2
Source/DiabloUI/selhero.cpp

@ -224,7 +224,7 @@ bool ShouldPrefillHeroName()
void SelheroClassSelectorSelect(int value)
{
auto hClass = static_cast<HeroClass>(vecSelHeroDlgItems[value]->m_value);
if (gbSpawned && (hClass == HeroClass::Rogue || hClass == HeroClass::Sorcerer || (hClass == HeroClass::Bard && !hfbard_mpq))) {
if (gbIsSpawn && (hClass == HeroClass::Rogue || hClass == HeroClass::Sorcerer || (hClass == HeroClass::Bard && !hfbard_mpq))) {
ArtBackground.Unload();
UiSelOkDialog(nullptr, _("The Rogue and Sorcerer are only available in the full retail version of Diablo. Visit https://www.gog.com/game/diablo to purchase."), false);
LoadBackgroundArt("ui_art\\selhero.pcx");

2
Source/DiabloUI/selok.cpp

@ -44,7 +44,7 @@ void UiSelOkDialog(const char *title, const char *body, bool background)
if (!background) {
LoadBackgroundArt("ui_art\\black.pcx");
} else {
if (!gbSpawned) {
if (!gbIsSpawn) {
LoadBackgroundArt("ui_art\\mainmenu.pcx");
} else {
LoadBackgroundArt("ui_art\\swmmenu.pcx");

1
Source/DiabloUI/settingsmenu.cpp

@ -72,7 +72,6 @@ void ItemSelected(int value)
break;
case SpecialMenuEntry::ToggleSpawn:
gbIsSpawn = !gbIsSpawn;
UiSetSpawned(gbIsSpawn);
endMenu = true;
recreateUI = true;
break;

5
Source/DiabloUI/title.cpp

@ -71,9 +71,4 @@ void UiTitleDialog()
TitleFree();
}
void UiSetSpawned(bool bSpawned)
{
gbSpawned = bSpawned;
}
} // namespace devilution

1
Source/diablo.cpp

@ -939,7 +939,6 @@ void DiabloInit()
#endif
UiInitialize();
UiSetSpawned(gbIsSpawn);
was_ui_init = true;
ReadOnlyTest();

Loading…
Cancel
Save