Make DoPopupWindow() work over faded out screens.
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3235 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
Changes towards version 0.7:
|
Changes towards version 0.7:
|
||||||
|
- Make DoPopupWindow() work over faded out screens. - SvdB
|
||||||
- Trackplayer rewrite; fixed many bugs - Alex
|
- Trackplayer rewrite; fixed many bugs - Alex
|
||||||
- Source tree reorg: libs/ moved out of sc2code/, msvc++/ moved to
|
- Source tree reorg: libs/ moved out of sc2code/, msvc++/ moved to
|
||||||
build/msvc6/, src/sc2code/ renamed to src/uqm/ - Coredev
|
build/msvc6/, src/sc2code/ renamed to src/uqm/ - Coredev
|
||||||
|
|||||||
@@ -246,7 +246,7 @@ extern void FlushColorXForms (void);
|
|||||||
#define GetColorMapAddress GetStringAddress
|
#define GetColorMapAddress GetStringAddress
|
||||||
#define GetColorMapContents GetStringContents
|
#define GetColorMapContents GetStringContents
|
||||||
|
|
||||||
void SetSystemRect (RECT *pRect);
|
void SetSystemRect (const RECT *pRect);
|
||||||
void ClearSystemRect (void);
|
void ClearSystemRect (void);
|
||||||
|
|
||||||
#endif /* _GFXLIB_H */
|
#endif /* _GFXLIB_H */
|
||||||
|
|||||||
@@ -221,7 +221,7 @@ static BOOLEAN system_box_active = 0;
|
|||||||
static SDL_Rect system_box;
|
static SDL_Rect system_box;
|
||||||
|
|
||||||
void
|
void
|
||||||
SetSystemRect (RECT *r)
|
SetSystemRect (const RECT *r)
|
||||||
{
|
{
|
||||||
system_box_active = TRUE;
|
system_box_active = TRUE;
|
||||||
system_box.x = r->corner.x;
|
system_box.x = r->corner.x;
|
||||||
|
|||||||
@@ -79,8 +79,10 @@ DrawShadowedBox (RECT *r, COLOR bg, COLOR dark, COLOR medium)
|
|||||||
UnbatchGraphics ();
|
UnbatchGraphics ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// windowRect, if not NULL, will be filled with the dimensions of the
|
||||||
|
// window drawn.
|
||||||
void
|
void
|
||||||
DrawLabelAsWindow (WIDGET_LABEL *label)
|
DrawLabelAsWindow (WIDGET_LABEL *label, RECT *windowRect)
|
||||||
{
|
{
|
||||||
COLOR oldfg = SetContextForeGroundColor (WIDGET_DIALOG_TEXT_COLOR);
|
COLOR oldfg = SetContextForeGroundColor (WIDGET_DIALOG_TEXT_COLOR);
|
||||||
FONT oldfont = 0;
|
FONT oldfont = 0;
|
||||||
@@ -129,6 +131,16 @@ DrawLabelAsWindow (WIDGET_LABEL *label)
|
|||||||
if (oldfont)
|
if (oldfont)
|
||||||
SetContextFont (oldfont);
|
SetContextFont (oldfont);
|
||||||
SetContextForeGroundColor (oldfg);
|
SetContextForeGroundColor (oldfg);
|
||||||
|
|
||||||
|
if (windowRect != NULL) {
|
||||||
|
// Add the outer border added by DrawShadowedBox.
|
||||||
|
// XXX: It may be nicer to add a border size parameter to
|
||||||
|
// DrawShadowedBox, instead of assuming 2 here.
|
||||||
|
windowRect->corner.x = r.corner.x - 2;
|
||||||
|
windowRect->corner.y = r.corner.y - 2;
|
||||||
|
windowRect->extent.width = r.extent.width + 4;
|
||||||
|
windowRect->extent.height = r.extent.height + 4;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ typedef struct _widget_controlentry {
|
|||||||
} WIDGET_CONTROLENTRY;
|
} WIDGET_CONTROLENTRY;
|
||||||
|
|
||||||
void DrawShadowedBox (RECT *r, COLOR bg, COLOR dark, COLOR medium);
|
void DrawShadowedBox (RECT *r, COLOR bg, COLOR dark, COLOR medium);
|
||||||
void DrawLabelAsWindow (WIDGET_LABEL *label);
|
void DrawLabelAsWindow (WIDGET_LABEL *label, RECT *windowRect);
|
||||||
void Widget_SetWindowColors (COLOR bg, COLOR dark, COLOR medium);
|
void Widget_SetWindowColors (COLOR bg, COLOR dark, COLOR medium);
|
||||||
FONT Widget_SetFont (FONT newFont);
|
FONT Widget_SetFont (FONT newFont);
|
||||||
|
|
||||||
|
|||||||
@@ -211,6 +211,7 @@ DoPopupWindow (const char *msg)
|
|||||||
FRAME F;
|
FRAME F;
|
||||||
CONTEXT oldContext;
|
CONTEXT oldContext;
|
||||||
RECT oldRect;
|
RECT oldRect;
|
||||||
|
RECT windowRect;
|
||||||
POPUP_STATE state;
|
POPUP_STATE state;
|
||||||
MENU_SOUND_FLAGS s0, s1;
|
MENU_SOUND_FLAGS s0, s1;
|
||||||
|
|
||||||
@@ -250,7 +251,8 @@ DoPopupWindow (const char *msg)
|
|||||||
Widget_SetFont (StarConFont);
|
Widget_SetFont (StarConFont);
|
||||||
Widget_SetWindowColors (SHADOWBOX_BACKGROUND_COLOR, SHADOWBOX_DARK_COLOR,
|
Widget_SetWindowColors (SHADOWBOX_BACKGROUND_COLOR, SHADOWBOX_DARK_COLOR,
|
||||||
SHADOWBOX_MEDIUM_COLOR);
|
SHADOWBOX_MEDIUM_COLOR);
|
||||||
DrawLabelAsWindow (&label);
|
DrawLabelAsWindow (&label, &windowRect);
|
||||||
|
SetSystemRect (&windowRect);
|
||||||
|
|
||||||
GetMenuSounds (&s0, &s1);
|
GetMenuSounds (&s0, &s1);
|
||||||
SetMenuSounds (MENU_SOUND_NONE, MENU_SOUND_NONE);
|
SetMenuSounds (MENU_SOUND_NONE, MENU_SOUND_NONE);
|
||||||
@@ -258,6 +260,7 @@ DoPopupWindow (const char *msg)
|
|||||||
state.InputFunc = DoPopup;
|
state.InputFunc = DoPopup;
|
||||||
DoInput (&state, TRUE);
|
DoInput (&state, TRUE);
|
||||||
|
|
||||||
|
ClearSystemRect ();
|
||||||
DrawStamp (&s);
|
DrawStamp (&s);
|
||||||
DestroyDrawable (ReleaseDrawable (s.frame));
|
DestroyDrawable (ReleaseDrawable (s.frame));
|
||||||
SetContextClipRect (&oldRect);
|
SetContextClipRect (&oldRect);
|
||||||
|
|||||||
@@ -586,7 +586,7 @@ rebind_control (WIDGET_CONTROLENTRY *widget)
|
|||||||
int index = widget->highlighted;
|
int index = widget->highlighted;
|
||||||
|
|
||||||
FlushInput ();
|
FlushInput ();
|
||||||
DrawLabelAsWindow (&labels[3]);
|
DrawLabelAsWindow (&labels[3], NULL);
|
||||||
RebindInputState (template, control, index);
|
RebindInputState (template, control, index);
|
||||||
populate_editkeys (template);
|
populate_editkeys (template);
|
||||||
FlushInput ();
|
FlushInput ();
|
||||||
|
|||||||
Reference in New Issue
Block a user