Cleanups minor glitch fixes.
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2499 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
+37
-21
@@ -34,6 +34,7 @@
|
|||||||
# include "netplay/netmelee.h"
|
# include "netplay/netmelee.h"
|
||||||
# include "netplay/notify.h"
|
# include "netplay/notify.h"
|
||||||
# include "libs/graphics/widgets.h"
|
# include "libs/graphics/widgets.h"
|
||||||
|
# include "cnctdlg.h"
|
||||||
#endif
|
#endif
|
||||||
#include "options.h"
|
#include "options.h"
|
||||||
#include "races.h"
|
#include "races.h"
|
||||||
@@ -422,6 +423,18 @@ RepairMeleeFrame (PRECT pRect)
|
|||||||
SetContext (OldContext);
|
SetContext (OldContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
RedrawMeleeFrame (void)
|
||||||
|
{
|
||||||
|
RECT r;
|
||||||
|
|
||||||
|
r.corner.x = r.corner.y = 0;
|
||||||
|
r.extent.width = SCREEN_WIDTH;
|
||||||
|
r.extent.height = SCREEN_HEIGHT;
|
||||||
|
|
||||||
|
RepairMeleeFrame (&r);
|
||||||
|
}
|
||||||
|
|
||||||
static BOOLEAN
|
static BOOLEAN
|
||||||
DrawTeamString (PMELEE_STATE pMS, COUNT side, COUNT HiLiteState)
|
DrawTeamString (PMELEE_STATE pMS, COUNT side, COUNT HiLiteState)
|
||||||
{
|
{
|
||||||
@@ -856,7 +869,7 @@ InitMelee (PMELEE_STATE pMS)
|
|||||||
SetContextClipRect (&r);
|
SetContextClipRect (&r);
|
||||||
|
|
||||||
r.corner.x = r.corner.y = 0;
|
r.corner.x = r.corner.y = 0;
|
||||||
RepairMeleeFrame (&r);
|
RedrawMeleeFrame ();
|
||||||
|
|
||||||
pMS->flash_task = AssignTask (flash_selection_func, 2048,
|
pMS->flash_task = AssignTask (flash_selection_func, 2048,
|
||||||
"flash melee selection");
|
"flash melee selection");
|
||||||
@@ -2212,12 +2225,6 @@ DoConnectingDialog (PMELEE_STATE pMS)
|
|||||||
COLOR oldcolor;
|
COLOR oldcolor;
|
||||||
TEXT t;
|
TEXT t;
|
||||||
|
|
||||||
if (pMS->flash_task)
|
|
||||||
{
|
|
||||||
ConcludeTask (pMS->flash_task);
|
|
||||||
pMS->flash_task = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Build a network connection.
|
// Build a network connection.
|
||||||
if (netConnections[which_side] != NULL)
|
if (netConnections[which_side] != NULL)
|
||||||
closePlayerNetworkConnection(which_side);
|
closePlayerNetworkConnection(which_side);
|
||||||
@@ -2269,18 +2276,12 @@ DoConnectingDialog (PMELEE_STATE pMS)
|
|||||||
if (PulsedInputState.menu[KEY_MENU_CANCEL])
|
if (PulsedInputState.menu[KEY_MENU_CANCEL])
|
||||||
{
|
{
|
||||||
// Terminate a network connection.
|
// Terminate a network connection.
|
||||||
RECT r;
|
|
||||||
if (netConnections[which_side] != NULL) {
|
if (netConnections[which_side] != NULL) {
|
||||||
closePlayerNetworkConnection (which_side);
|
closePlayerNetworkConnection (which_side);
|
||||||
UpdateMeleeStatusMessage (which_side);
|
UpdateMeleeStatusMessage (which_side);
|
||||||
}
|
}
|
||||||
r.corner.x = 0;
|
RedrawMeleeFrame ();
|
||||||
r.corner.y = 0;
|
|
||||||
r.extent.width = SCREEN_WIDTH - (SAFE_X * 2);
|
|
||||||
r.extent.height = SCREEN_HEIGHT - (SAFE_Y * 2);
|
|
||||||
RepairMeleeFrame (&r);
|
|
||||||
pMS->InputFunc = DoMelee;
|
pMS->InputFunc = DoMelee;
|
||||||
|
|
||||||
if (!pMS->flash_task)
|
if (!pMS->flash_task)
|
||||||
{
|
{
|
||||||
pMS->flash_task = AssignTask (flash_selection_func, 2048,
|
pMS->flash_task = AssignTask (flash_selection_func, 2048,
|
||||||
@@ -2305,11 +2306,7 @@ DoConnectingDialog (PMELEE_STATE pMS)
|
|||||||
SetPlayerInput ();
|
SetPlayerInput ();
|
||||||
DrawControls (which_side, TRUE);
|
DrawControls (which_side, TRUE);
|
||||||
|
|
||||||
r.corner.x = 0;
|
RedrawMeleeFrame ();
|
||||||
r.corner.y = 0;
|
|
||||||
r.extent.width = SCREEN_WIDTH - (SAFE_X * 2);
|
|
||||||
r.extent.height = SCREEN_HEIGHT - (SAFE_Y * 2);
|
|
||||||
RepairMeleeFrame (&r);
|
|
||||||
|
|
||||||
UpdateMeleeStatusMessage (which_side);
|
UpdateMeleeStatusMessage (which_side);
|
||||||
pMS->InputFunc = DoMelee;
|
pMS->InputFunc = DoMelee;
|
||||||
@@ -2349,7 +2346,7 @@ check_for_disconnections (PMELEE_STATE pMS)
|
|||||||
{
|
{
|
||||||
PlayerControl[player] = HUMAN_CONTROL & STANDARD_RATING;
|
PlayerControl[player] = HUMAN_CONTROL & STANDARD_RATING;
|
||||||
DrawControls (player, FALSE);
|
DrawControls (player, FALSE);
|
||||||
log_add (log_User, "Player %d has disconnected; shifting controls\n");
|
log_add (log_User, "Player %d has disconnected; shifting controls\n", player);
|
||||||
changed = TRUE;
|
changed = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2505,12 +2502,31 @@ DoMelee (PMELEE_STATE pMS)
|
|||||||
case NET_BOT:
|
case NET_BOT:
|
||||||
{
|
{
|
||||||
COUNT which_side;
|
COUNT which_side;
|
||||||
|
BOOLEAN confirmed;
|
||||||
|
|
||||||
|
if (pMS->flash_task)
|
||||||
|
{
|
||||||
|
ConcludeTask (pMS->flash_task);
|
||||||
|
pMS->flash_task = 0;
|
||||||
|
}
|
||||||
|
|
||||||
which_side = pMS->MeleeOption == NET_TOP ? 1 : 0;
|
which_side = pMS->MeleeOption == NET_TOP ? 1 : 0;
|
||||||
if (MeleeConnectDialog (which_side))
|
confirmed = MeleeConnectDialog (which_side);
|
||||||
|
RedrawMeleeFrame ();
|
||||||
|
if (confirmed)
|
||||||
{
|
{
|
||||||
pMS->Initialized = FALSE;
|
pMS->Initialized = FALSE;
|
||||||
pMS->InputFunc = DoConnectingDialog;
|
pMS->InputFunc = DoConnectingDialog;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!pMS->flash_task)
|
||||||
|
{
|
||||||
|
pMS->flash_task = AssignTask (flash_selection_func, 2048,
|
||||||
|
"flash melee selection");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user