Move default form colours into external palette file.

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@10457 4a71c877-e1ca-e34f-864e-861f7616d084
master
Per Inge Mathisen 2010-04-03 12:37:00 +00:00 committed by Git SVN Gateway
parent f1e1417353
commit 806268790f
4 changed files with 26 additions and 45 deletions

View File

@ -57,3 +57,11 @@ A0,70,00,ff // team2 - orange
20,30,60,ff // team6 - blue
90,00,70,ff // team7 - purple
00,80,80,ff // team8 - teal
7f,7f,7f,ff // default form background
ff,ff,ff,ff // default form text
ff,ff,ff,ff // default form light
00,00,00,ff // default form dark
40,40,40,ff // default form hilite
ff,0,0,ff // default form cursor
30,30,30,ff // default form tip background
bf,bf,bf,ff // default form disabled

View File

@ -81,8 +81,16 @@
#define WZCOL_TEAM6 psPalette[56]
#define WZCOL_TEAM7 psPalette[57]
#define WZCOL_TEAM8 psPalette[58]
#define WZCOL_FORM_BACKGROUND psPalette[59]
#define WZCOL_FORM_TEXT psPalette[60]
#define WZCOL_FORM_LIGHT psPalette[61]
#define WZCOL_FORM_DARK psPalette[62]
#define WZCOL_FORM_HILITE psPalette[63]
#define WZCOL_FORM_CURSOR psPalette[64]
#define WZCOL_FORM_TIP_BACKGROUND psPalette[65]
#define WZCOL_FORM_DISABLE psPalette[66]
#define WZCOL_MAX 59
#define WZCOL_MAX 67
//*************************************************************************

View File

@ -49,49 +49,14 @@ typedef struct _tab_pos
/* Set default colours for a form */
static void formSetDefaultColours(W_FORM *psForm)
{
static BOOL bDefaultsSet = false;
static PIELIGHT wcol_bkgrnd;
static PIELIGHT wcol_text;
static PIELIGHT wcol_light;
static PIELIGHT wcol_dark;
static PIELIGHT wcol_hilite;
static PIELIGHT wcol_cursor;
static PIELIGHT wcol_tipbkgrnd;
static PIELIGHT wcol_disable;
if (bDefaultsSet)
{
psForm->aColours[WCOL_BKGRND] = wcol_bkgrnd;
psForm->aColours[WCOL_TEXT] = wcol_text;
psForm->aColours[WCOL_LIGHT] = wcol_light;
psForm->aColours[WCOL_DARK] = wcol_dark;
psForm->aColours[WCOL_HILITE] = wcol_hilite;
psForm->aColours[WCOL_CURSOR] = wcol_cursor;
psForm->aColours[WCOL_TIPBKGRND] = wcol_tipbkgrnd;
psForm->aColours[WCOL_DISABLE] = wcol_disable;
}
else
{
wcol_bkgrnd = pal_Colour(0x7f, 0x7f, 0x7f);
wcol_text = WZCOL_WHITE;
wcol_light = WZCOL_WHITE;
wcol_dark = WZCOL_BLACK;
wcol_hilite = pal_Colour(0x40, 0x40, 0x40);
wcol_cursor = pal_Colour(0xff, 0x00, 0x00);
wcol_tipbkgrnd = pal_Colour(0x30, 0x30, 0x60);
wcol_disable = pal_Colour(0xbf, 0xbf, 0xbf);
bDefaultsSet = true;
psForm->aColours[WCOL_BKGRND] = wcol_bkgrnd;
psForm->aColours[WCOL_TEXT] = wcol_text;
psForm->aColours[WCOL_LIGHT] = wcol_light;
psForm->aColours[WCOL_DARK] = wcol_dark;
psForm->aColours[WCOL_HILITE] = wcol_hilite;
psForm->aColours[WCOL_CURSOR] = wcol_cursor;
psForm->aColours[WCOL_TIPBKGRND] = wcol_tipbkgrnd;
psForm->aColours[WCOL_DISABLE] = wcol_disable;
}
psForm->aColours[WCOL_BKGRND] = WZCOL_FORM_BACKGROUND;
psForm->aColours[WCOL_TEXT] = WZCOL_FORM_TEXT;
psForm->aColours[WCOL_LIGHT] = WZCOL_FORM_LIGHT;
psForm->aColours[WCOL_DARK] = WZCOL_FORM_DARK;
psForm->aColours[WCOL_HILITE] = WZCOL_FORM_HILITE;
psForm->aColours[WCOL_CURSOR] = WZCOL_FORM_CURSOR;
psForm->aColours[WCOL_TIPBKGRND] = WZCOL_FORM_TIP_BACKGROUND;
psForm->aColours[WCOL_DISABLE] = WZCOL_FORM_DISABLE;
}
/* Create a plain form widget */

View File

@ -39,7 +39,7 @@ extern "C"
UWORD Ax0,Ay0,Ax1,Ay1; /* Working coords for animations. */ \
UDWORD animCount; /* Animation counter. */ \
UDWORD startTime; /* Animation start time */ \
PIELIGHT aColours[WCOL_MAX]; /* Colours for the form and its widgets. signed since aColours -1 means use bitmap. */ \
PIELIGHT aColours[WCOL_MAX]; /* Colours for the form and its widgets */ \
WIDGET *psLastHiLite; /* The last widget to be hilited */ \
/* This is used to track when the mouse moves */ \
/* off something */ \