From 94faf0d81dc0cafe58222ad9d44c73f7fbe8611a Mon Sep 17 00:00:00 2001 From: nehalmistry <> Date: Thu, 20 Mar 2003 18:57:49 +0000 Subject: [PATCH] use correct background for showstats --- src/game/intro.cpp | 6 +++++- src/include/ui.h | 3 +++ src/ui/script_ui.cpp | 18 ++++++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/game/intro.cpp b/src/game/intro.cpp index a7224129f..19f49aadb 100644 --- a/src/game/intro.cpp +++ b/src/game/intro.cpp @@ -1251,7 +1251,11 @@ global void ShowStats(void) callbacks.NetworkEvent=NetworkEvent; callbacks.SoundReady=WriteSound; - background=LoadGraphic(MenuBackground); + if (GameResult==GameVictory) { + background=LoadGraphic(TheUI.VictoryBackground.File); + } else { + background=LoadGraphic(TheUI.DefeatBackground.File); + } ResizeGraphic(background,VideoWidth,VideoHeight); #ifdef USE_OPENGL MakeTexture(background,background->Width,background->Height); diff --git a/src/include/ui.h b/src/include/ui.h index 8d90f0126..7127b9040 100644 --- a/src/include/ui.h +++ b/src/include/ui.h @@ -303,6 +303,9 @@ typedef struct _ui_ { GraphicConfig Menue2Panel; /// Panel 384 x 256 GraphicConfig VictoryPanel; /// Panel 288 x 128 GraphicConfig ScenarioPanel; /// Panel 352 x 352 + + GraphicConfig VictoryBackground; + GraphicConfig DefeatBackground; } UI; /*---------------------------------------------------------------------------- diff --git a/src/ui/script_ui.cpp b/src/ui/script_ui.cpp index 62071f867..070c455bd 100644 --- a/src/ui/script_ui.cpp +++ b/src/ui/script_ui.cpp @@ -1225,6 +1225,24 @@ local SCM CclDefineUI(SCM list) free(ui->ScenarioPanel.File); ui->ScenarioPanel.File=str; + temp=gh_car(list); + list=gh_cdr(list); + + value=gh_car(temp); + temp=gh_cdr(temp); + str=gh_scm2newstr(value,NULL); + free(ui->VictoryBackground.File); + ui->VictoryBackground.File=str; + + temp=gh_car(list); + list=gh_cdr(list); + + value=gh_car(temp); + temp=gh_cdr(temp); + str=gh_scm2newstr(value,NULL); + free(ui->DefeatBackground.File); + ui->DefeatBackground.File=str; + return SCM_UNSPECIFIED; }