Update the 'current selection' icon after deleting or inserting ships in a

fleet in SuperMelee.


git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2557 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
meep-eep
2006-11-29 04:22:13 +00:00
parent 618ef6175e
commit 976a4bfb6e
2 changed files with 16 additions and 11 deletions
+2
View File
@@ -1,4 +1,6 @@
Changes towards version 0.6: Changes towards version 0.6:
- Update the 'current selection' icon after deleting or inserting ships
in a fleet in SuperMelee - SvdB
- Correct top two lines of melebkgd.25.png - SvdB - Correct top two lines of melebkgd.25.png - SvdB
- Unix build scripts improvements. - SvdB - Unix build scripts improvements. - SvdB
- Build fixes for MacOS X (with thanks to Nic) - SvdB - Build fixes for MacOS X (with thanks to Nic) - SvdB
+14 -11
View File
@@ -945,6 +945,17 @@ DrawMeleeShipStrings (PMELEE_STATE pMS, BYTE NewStarShip)
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
} }
static void
UpdateCurrentShip (PMELEE_STATE pMS)
{
FleetShipIndex fleetShipIndex = GetShipIndex (pMS->row, pMS->col);
if (pMS->row == NUM_MELEE_ROWS)
pMS->CurIndex = MELEE_NONE;
else
pMS->CurIndex = pMS->TeamImage[pMS->side].ShipList[fleetShipIndex];
DrawMeleeShipStrings (pMS, (BYTE)(pMS->CurIndex));
}
// returns (COUNT) ~0 for an invalid ship. // returns (COUNT) ~0 for an invalid ship.
static COUNT static COUNT
GetShipValue (BYTE StarShip) GetShipValue (BYTE StarShip)
@@ -1505,6 +1516,7 @@ DoEdit (PMELEE_STATE pMS)
fleetShipIndex = GetShipIndex (pMS->row, pMS->col); fleetShipIndex = GetShipIndex (pMS->row, pMS->col);
fleetShipChanged (pMS, pMS->side, fleetShipIndex); fleetShipChanged (pMS, pMS->side, fleetShipIndex);
AdvanceCursor (pMS); AdvanceCursor (pMS);
UpdateCurrentShip(pMS);
} }
else else
{ {
@@ -1598,17 +1610,9 @@ DoEdit (PMELEE_STATE pMS)
pMS->side = side; pMS->side = side;
pMS->row = row; pMS->row = row;
pMS->col = col; pMS->col = col;
if (row == NUM_MELEE_ROWS)
pMS->CurIndex = MELEE_NONE;
else
{
FleetShipIndex fleetShipIndex = GetShipIndex (row, col);
pMS->CurIndex =
pMS->TeamImage[side].ShipList[fleetShipIndex];
}
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
DrawMeleeShipStrings (pMS, (BYTE)(pMS->CurIndex)); UpdateCurrentShip(pMS);
} }
} }
@@ -1696,8 +1700,7 @@ DoPickShip (PMELEE_STATE pMS)
UnlockMutex (GraphicsLock); UnlockMutex (GraphicsLock);
} }
pMS->CurIndex = pMS->TeamImage[pMS->side].ShipList[index]; UpdateCurrentShip(pMS);
DrawMeleeShipStrings (pMS, (BYTE)pMS->CurIndex);
pMS->InputFunc = DoEdit; pMS->InputFunc = DoEdit;