missile-green-cross available in a global variable.
This commit is contained in:
parent
003392b4b2
commit
5333b3568d
3 changed files with 12 additions and 13 deletions
src
|
@ -117,6 +117,7 @@ typedef struct _missile_ {
|
|||
extern MissileType MissileTypes[]; /// all missile types
|
||||
extern MissileType* MissileTypeSmallFire; /// Small fire missile type
|
||||
extern MissileType* MissileTypeBigFire; /// Big fire missile type
|
||||
extern MissileType* MissileTypeGreenCross; /// Green cross missile type
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
-- Functions
|
||||
|
|
|
@ -442,6 +442,7 @@ global MissileType MissileTypes[MissileTypeMax] = {
|
|||
*/
|
||||
global MissileType* MissileTypeSmallFire; /// Small fire missile type
|
||||
global MissileType* MissileTypeBigFire; /// Big fire missile type
|
||||
global MissileType* MissileTypeGreenCross; /// Green cross missile type
|
||||
|
||||
#define MAX_MISSILES 1800 /// maximum number of missiles
|
||||
|
||||
|
@ -497,6 +498,7 @@ global void LoadMissileSprites(void)
|
|||
// FIXME: FIXME: FIXME: very diry hack
|
||||
MissileTypeSmallFire->Sprite->NumFrames=6;
|
||||
MissileTypeBigFire=MissileTypeByIdent("missile-big-fire");
|
||||
MissileTypeGreenCross=MissileTypeByIdent("missile-green-cross");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -899,8 +899,7 @@ global void UIHandleButtonDown(int b)
|
|||
CurrentButtonLevel = 0; // reset unit buttons to normal
|
||||
UpdateButtonPanel();
|
||||
MustRedraw|=RedrawButtonPanel|RedrawCursor;
|
||||
// FIXME: slow slow slow slow....
|
||||
MakeMissile(MissileTypeByIdent("missile-green-cross")
|
||||
MakeMissile(MissileTypeGreenCross
|
||||
,Minimap2MapX(CursorX)*TileSizeX+TileSizeX/2
|
||||
,Minimap2MapY(CursorY)*TileSizeY+TileSizeY/2,0,0);
|
||||
SendCommand(Minimap2MapX(CursorX),Minimap2MapY(CursorY));
|
||||
|
@ -974,18 +973,16 @@ global void UIHandleButtonDown(int b)
|
|||
DebugLevel3("Cursor middle down %d,%d\n",CursorX,CursorY);
|
||||
MustRedraw|=RedrawCursor;
|
||||
} else if( MouseButtons&RightButton ) {
|
||||
Unit* unit = UnitOnMapTile(Screen2MapX(CursorX),Screen2MapY(CursorY));
|
||||
if ( unit )
|
||||
{ // if right click on building -- blink
|
||||
Unit* unit;
|
||||
|
||||
unit = UnitOnMapTile(Screen2MapX(CursorX),Screen2MapY(CursorY));
|
||||
if ( unit ) { // if right click on building -- blink
|
||||
unit->Blink=3;
|
||||
}
|
||||
else
|
||||
{ // if not not click on building -- green cross
|
||||
// FIXME: slow slow slow slow....
|
||||
MakeMissile(MissileTypeByIdent("missile-green-cross")
|
||||
} else { // if not not click on building -- green cross
|
||||
MakeMissile(MissileTypeGreenCross
|
||||
,MapX*TileSizeX+CursorX-TheUI.MapX
|
||||
,MapY*TileSizeY+CursorY-TheUI.MapY,0,0);
|
||||
}
|
||||
}
|
||||
DoRightButton(Screen2MapX(CursorX),Screen2MapY(CursorY));
|
||||
}
|
||||
} else if( CursorOn==CursorOnMinimap ) {
|
||||
|
@ -993,8 +990,7 @@ global void UIHandleButtonDown(int b)
|
|||
MapSetViewpoint(Minimap2MapX(CursorX)-MapWidth/2
|
||||
,Minimap2MapY(CursorY)-MapHeight/2);
|
||||
} else if( MouseButtons&RightButton ) {
|
||||
// FIXME: slow slow slow slow....
|
||||
MakeMissile(MissileTypeByIdent("missile-green-cross")
|
||||
MakeMissile(MissileTypeGreenCross
|
||||
,Minimap2MapX(CursorX)*TileSizeX+TileSizeX/2
|
||||
,Minimap2MapY(CursorY)*TileSizeY+TileSizeY/2,0,0);
|
||||
DoRightButton(Minimap2MapX(CursorX),Minimap2MapY(CursorY));
|
||||
|
|
Loading…
Add table
Reference in a new issue