mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Added missing #includes Added LUA scripting and console Changed the way tracers are visualized, so they work more like real tracers instead of a light fountain Fixed signedness of many grid variables used in GetMouseMapPos calls Fixed enemy weapon choosing: Sometimes a mortar is chosen but later rejected, but the grenade class was not reset. Caused assertion failure Added checks so enemies don't try to chuck RPG grenades with their hands Now possible to shoot a someone in the head if he's in water Fixed InitSightArrays to also clear soldier interrupt duel points. This was causing an assertion failure elsewhere in the code because the interrupt list still had soldiers on it sometimes when this function was called. Soldiers are much less willing to forfeit their turn over an attempt to use more APs than they have Removed early setting of muzzle flash. This would allow enemies to get an interrupt before you even fired. Fixed item dropping by AI. If AI tried to drop something while standing it would cause deadlock Change to greatly speed up closing the sector inventory window in an unloaded sector Added conditional compile flag to always give robot weapon ready advantage, even for 360 degree sighting Check builddefines.h for the conditional flags. Of greatest interest might be LUA_CONSOLE. This will cause the game to bring up a command console when run. However this console is severely lacking in many areas. If anybody knows of an open-source terminal/console that could be used instead, it would be appreciated. The existing console does bad things when you try to close it, and since it counts as a separate app, it pauses the game while it has focus. LUA scripting is very limited, basically just proof of concept. There is one global variable, the Soldiers array. An array index gives you the soldier in that slot in the currently loaded sector. The soldier has a few things that can be accessed: name (short name); fullname (long name); grid (current grid #, can be changed); walkto(grid) (function to walk to another grid); runto(grid) (function to run to another grid) git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@924 3b4a5df2-a311-0410-b5c6-a8a6f20db521
789 lines
29 KiB
C++
789 lines
29 KiB
C++
#ifdef PRECOMPILEDHEADERS
|
|
#include "Tactical All.h"
|
|
#else
|
|
#include <stdio.h>
|
|
#include <stdarg.h>
|
|
#include <time.h>
|
|
#include "sgp.h"
|
|
#include "mousesystem.h"
|
|
#include "vsurface.h"
|
|
#include "wcheck.h"
|
|
#include "input.h"
|
|
#include "Handle UI.h"
|
|
#include "cursors.h"
|
|
#include "worlddef.h"
|
|
#include "worldman.h"
|
|
#include "render dirty.h"
|
|
#include "Interface Cursors.h"
|
|
#include "interface.h"
|
|
#include "Isometric utils.h"
|
|
#include "cursors.h"
|
|
#include "sys globals.h"
|
|
#include "overhead.h"
|
|
#include "interface items.h"
|
|
#include "GameSettings.h"
|
|
#endif
|
|
|
|
#define DISPLAY_AP_INDEX MOCKFLOOR1
|
|
|
|
#define SNAPCURSOR_AP_X_STARTVAL 18
|
|
#define SNAPCURSOR_AP_Y_STARTVAL 9
|
|
|
|
|
|
#define LOOSE_CURSOR_DELAY 300
|
|
static BOOLEAN gfLooseCursorOn = FALSE;
|
|
static INT16 gsLooseCursorGridNo = NOWHERE;
|
|
static UINT32 guiLooseCursorID = 0;
|
|
static UINT32 guiLooseCursorTimeOfLastUpdate = 0;
|
|
|
|
|
|
void HandleLooseCursorDraw( );
|
|
void HandleLooseCursorHide( );
|
|
|
|
|
|
UICursor gUICursors[ NUM_UI_CURSORS ] =
|
|
{
|
|
NO_UICURSOR, 0, 0, 0,
|
|
NORMAL_FREEUICURSOR, UICURSOR_FREEFLOWING , CURSOR_NORMAL, 0,
|
|
NORMAL_SNAPUICURSOR, UICURSOR_SNAPPING, 0, 0,
|
|
MOVE_RUN_UICURSOR, UICURSOR_FREEFLOWING | UICURSOR_SHOWTILEAPDEPENDENT | UICURSOR_DONTSHOW2NDLEVEL, CURSOR_RUN1, FIRSTPOINTERS2,
|
|
MOVE_WALK_UICURSOR, UICURSOR_FREEFLOWING | UICURSOR_SHOWTILEAPDEPENDENT | UICURSOR_DONTSHOW2NDLEVEL | UICURSOR_CENTERAPS, CURSOR_WALK1, FIRSTPOINTERS2,
|
|
MOVE_SWAT_UICURSOR, UICURSOR_FREEFLOWING | UICURSOR_SHOWTILEAPDEPENDENT | UICURSOR_DONTSHOW2NDLEVEL, CURSOR_SWAT1, FIRSTPOINTERS2,
|
|
MOVE_PRONE_UICURSOR, UICURSOR_FREEFLOWING | UICURSOR_SHOWTILEAPDEPENDENT | UICURSOR_DONTSHOW2NDLEVEL, CURSOR_PRONE1, FIRSTPOINTERS2,
|
|
MOVE_VEHICLE_UICURSOR, UICURSOR_FREEFLOWING | UICURSOR_SHOWTILEAPDEPENDENT | UICURSOR_DONTSHOW2NDLEVEL, CURSOR_DRIVEV, FIRSTPOINTERS2,
|
|
|
|
|
|
CONFIRM_MOVE_RUN_UICURSOR, UICURSOR_SNAPPING | UICURSOR_SHOWTILE | UICURSOR_DONTSHOW2NDLEVEL, 0, FIRSTPOINTERS4,
|
|
CONFIRM_MOVE_WALK_UICURSOR, UICURSOR_SNAPPING | UICURSOR_SHOWTILE | UICURSOR_DONTSHOW2NDLEVEL, 0, FIRSTPOINTERS4,
|
|
CONFIRM_MOVE_SWAT_UICURSOR, UICURSOR_SNAPPING | UICURSOR_SHOWTILE | UICURSOR_DONTSHOW2NDLEVEL, 0, FIRSTPOINTERS4,
|
|
CONFIRM_MOVE_PRONE_UICURSOR, UICURSOR_SNAPPING | UICURSOR_SHOWTILE | UICURSOR_DONTSHOW2NDLEVEL, 0, FIRSTPOINTERS4,
|
|
CONFIRM_MOVE_VEHICLE_UICURSOR, UICURSOR_SNAPPING | UICURSOR_SHOWTILE | UICURSOR_DONTSHOW2NDLEVEL, 0, FIRSTPOINTERS4,
|
|
|
|
ALL_MOVE_RUN_UICURSOR, UICURSOR_SNAPPING | UICURSOR_SHOWTILE | UICURSOR_DONTSHOW2NDLEVEL, 0, FIRSTPOINTERS5,
|
|
ALL_MOVE_WALK_UICURSOR, UICURSOR_SNAPPING | UICURSOR_SHOWTILE | UICURSOR_DONTSHOW2NDLEVEL, 0, FIRSTPOINTERS5,
|
|
ALL_MOVE_SWAT_UICURSOR, UICURSOR_SNAPPING | UICURSOR_SHOWTILE | UICURSOR_DONTSHOW2NDLEVEL, 0, FIRSTPOINTERS5,
|
|
ALL_MOVE_PRONE_UICURSOR, UICURSOR_SNAPPING | UICURSOR_SHOWTILE | UICURSOR_DONTSHOW2NDLEVEL, 0, FIRSTPOINTERS5,
|
|
ALL_MOVE_VEHICLE_UICURSOR, UICURSOR_SNAPPING | UICURSOR_SHOWTILE | UICURSOR_DONTSHOW2NDLEVEL, 0, FIRSTPOINTERS5,
|
|
|
|
MOVE_REALTIME_UICURSOR, UICURSOR_FREEFLOWING | UICURSOR_SHOWTILEAPDEPENDENT | UICURSOR_DONTSHOW2NDLEVEL, VIDEO_NO_CURSOR, FIRSTPOINTERS2,
|
|
MOVE_RUN_REALTIME_UICURSOR, UICURSOR_FREEFLOWING | UICURSOR_SHOWTILE | UICURSOR_DONTSHOW2NDLEVEL, VIDEO_NO_CURSOR, FIRSTPOINTERS7,
|
|
|
|
CONFIRM_MOVE_REALTIME_UICURSOR, UICURSOR_FREEFLOWING | UICURSOR_SHOWTILE | UICURSOR_DONTSHOW2NDLEVEL, VIDEO_NO_CURSOR, FIRSTPOINTERS4,
|
|
ALL_MOVE_REALTIME_UICURSOR, UICURSOR_FREEFLOWING | UICURSOR_SHOWTILE | UICURSOR_DONTSHOW2NDLEVEL, VIDEO_NO_CURSOR, FIRSTPOINTERS5,
|
|
|
|
ON_OWNED_MERC_UICURSOR, UICURSOR_SNAPPING, 0, 0,
|
|
ON_OWNED_SELMERC_UICURSOR, UICURSOR_SNAPPING, 0, 0,
|
|
ACTION_SHOOT_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_TARGET, 0,
|
|
ACTION_NOCHANCE_SHOOT_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_TARGETDKBLACK, 0,
|
|
ACTION_NOCHANCE_BURST_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_TARGETBURSTDKBLACK, 0,
|
|
|
|
ACTION_FLASH_TOSS_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_TARGET, 0,
|
|
ACTION_TOSS_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_TARGET, 0,
|
|
ACTION_RED_TOSS_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_TARGETRED, 0,
|
|
|
|
ACTION_FLASH_SHOOT_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_FLASH_TARGET, 0,
|
|
ACTION_FLASH_BURST_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_FLASH_TARGETBURST, 0,
|
|
ACTION_TARGETAIM1_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_TARGETON1, 0,
|
|
ACTION_TARGETAIM2_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_TARGETON2, 0,
|
|
ACTION_TARGETAIM3_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_TARGETON3, 0,
|
|
ACTION_TARGETAIM4_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_TARGETON4, 0,
|
|
ACTION_TARGETAIM5_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_TARGETON5, 0,
|
|
ACTION_TARGETAIM6_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_TARGETON6, 0,
|
|
ACTION_TARGETAIM7_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_TARGETON7, 0,
|
|
ACTION_TARGETAIM8_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_TARGETON8, 0,
|
|
ACTION_TARGETAIM8_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_TARGETON9, 0,
|
|
ACTION_TARGETAIMCANT1_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_TARGETW1, 0,
|
|
ACTION_TARGETAIMCANT2_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_TARGETW2, 0,
|
|
ACTION_TARGETAIMCANT3_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_TARGETW3, 0,
|
|
ACTION_TARGETAIMCANT4_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_TARGETW4, 0,
|
|
ACTION_TARGETAIMCANT5_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_TARGETW5, 0,
|
|
ACTION_TARGETRED_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_TARGETRED, 0,
|
|
ACTION_TARGETBURST_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_TARGETBURST, 0,
|
|
ACTION_TARGETREDBURST_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_TARGETBURSTRED, 0,
|
|
ACTION_TARGETCONFIRMBURST_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_TARGETBURSTCONFIRM, 0,
|
|
|
|
ACTION_TARGETAIMFULL_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_TARGETWR1, 0,
|
|
ACTION_TARGETAIMYELLOW1_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_TARGETYELLOW1, 0,
|
|
ACTION_TARGETAIMYELLOW2_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_TARGETYELLOW2, 0,
|
|
ACTION_TARGETAIMYELLOW3_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_TARGETYELLOW3, 0,
|
|
ACTION_TARGETAIMYELLOW4_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_TARGETYELLOW4, 0,
|
|
|
|
|
|
ACTION_TARGET_RELOADING, UICURSOR_FREEFLOWING, CURSOR_TARGETBLACK, 0,
|
|
ACTION_PUNCH_GRAY, UICURSOR_FREEFLOWING, CURSOR_PUNCHGRAY, 0,
|
|
ACTION_PUNCH_RED, UICURSOR_FREEFLOWING, CURSOR_PUNCHRED, 0,
|
|
ACTION_PUNCH_RED_AIM1_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_PUNCHRED_ON1, 0,
|
|
ACTION_PUNCH_RED_AIM2_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_PUNCHRED_ON2, 0,
|
|
ACTION_PUNCH_YELLOW_AIM1_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_PUNCHYELLOW_ON1, 0,
|
|
ACTION_PUNCH_YELLOW_AIM2_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_PUNCHYELLOW_ON2, 0,
|
|
ACTION_PUNCH_NOGO_AIM1_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_PUNCHNOGO_ON1, 0,
|
|
ACTION_PUNCH_NOGO_AIM2_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_PUNCHNOGO_ON2, 0,
|
|
ACTION_FIRSTAID_GRAY, UICURSOR_FREEFLOWING, CURSOR_CROSS_REG, 0,
|
|
ACTION_FIRSTAID_RED, UICURSOR_FREEFLOWING, CURSOR_CROSS_ACTIVE, 0,
|
|
ACTION_OPEN, UICURSOR_FREEFLOWING, CURSOR_HANDGRAB, 0,
|
|
CANNOT_MOVE_UICURSOR, UICURSOR_SNAPPING, 0, 0,
|
|
NORMALHANDCURSOR_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_NORMGRAB, 0,
|
|
OKHANDCURSOR_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_HANDGRAB, 0,
|
|
KNIFE_REG_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_KNIFE_REG, 0,
|
|
KNIFE_HIT_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_KNIFE_HIT, 0,
|
|
KNIFE_HIT_AIM1_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_KNIFE_HIT_ON1, 0,
|
|
KNIFE_HIT_AIM2_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_KNIFE_HIT_ON2, 0,
|
|
KNIFE_YELLOW_AIM1_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_KNIFE_YELLOW_ON1, 0,
|
|
KNIFE_YELLOW_AIM2_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_KNIFE_YELLOW_ON2, 0,
|
|
KNIFE_NOGO_AIM1_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_KNIFE_NOGO_ON1, 0,
|
|
KNIFE_NOGO_AIM2_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_KNIFE_NOGO_ON2, 0,
|
|
|
|
LOOK_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_LOOK, 0,
|
|
TALK_NA_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_TALK, 0,
|
|
TALK_A_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_REDTALK, 0,
|
|
TALK_OUT_RANGE_NA_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_FLASH_TALK, CURSOR_BLACKTALK,
|
|
TALK_OUT_RANGE_A_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_FLASH_REDTALK, CURSOR_BLACKTALK,
|
|
EXIT_NORTH_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_EXIT_NORTH, 0,
|
|
EXIT_SOUTH_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_EXIT_SOUTH, 0,
|
|
EXIT_EAST_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_EXIT_EAST, 0,
|
|
EXIT_WEST_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_EXIT_WEST, 0,
|
|
EXIT_GRID_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_EXIT_GRID, 0,
|
|
NOEXIT_NORTH_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_NOEXIT_NORTH, 0,
|
|
NOEXIT_SOUTH_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_NOEXIT_SOUTH, 0,
|
|
NOEXIT_EAST_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_NOEXIT_EAST, 0,
|
|
NOEXIT_WEST_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_NOEXIT_WEST, 0,
|
|
NOEXIT_GRID_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_NOEXIT_GRID, 0,
|
|
CONFIRM_EXIT_NORTH_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_CONEXIT_NORTH, 0,
|
|
CONFIRM_EXIT_SOUTH_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_CONEXIT_SOUTH, 0,
|
|
CONFIRM_EXIT_EAST_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_CONEXIT_EAST, 0,
|
|
CONFIRM_EXIT_WEST_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_CONEXIT_WEST, 0,
|
|
CONFIRM_EXIT_GRID_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_CONEXIT_GRID, 0,
|
|
|
|
GOOD_WIRECUTTER_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_GOOD_WIRECUT, 0,
|
|
BAD_WIRECUTTER_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_BAD_WIRECUT, 0,
|
|
GOOD_REPAIR_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_REPAIR, 0,
|
|
BAD_REPAIR_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_REPAIRRED, 0,
|
|
GOOD_RELOAD_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_GOOD_RELOAD, 0,
|
|
BAD_RELOAD_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_BAD_RELOAD, 0,
|
|
GOOD_JAR_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_JARRED, 0,
|
|
BAD_JAR_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_JAR, 0,
|
|
|
|
|
|
GOOD_THROW_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_GOOD_THROW, 0,
|
|
BAD_THROW_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_BAD_THROW, 0,
|
|
RED_THROW_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_RED_THROW, 0,
|
|
FLASH_THROW_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_FLASH_THROW, 0,
|
|
ACTION_THROWAIM1_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_THROWKON1, 0,
|
|
ACTION_THROWAIM2_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_THROWKON2, 0,
|
|
ACTION_THROWAIM3_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_THROWKON3, 0,
|
|
ACTION_THROWAIM4_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_THROWKON4, 0,
|
|
ACTION_THROWAIM5_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_THROWKON5, 0,
|
|
ACTION_THROWAIM6_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_THROWKON6, 0,
|
|
ACTION_THROWAIM7_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_THROWKON7, 0,
|
|
ACTION_THROWAIM8_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_THROWKON8, 0,
|
|
ACTION_THROWAIM8_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_THROWKON9, 0,
|
|
ACTION_THROWAIMCANT1_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_THROWKW1, 0,
|
|
ACTION_THROWAIMCANT2_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_THROWKW2, 0,
|
|
ACTION_THROWAIMCANT3_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_THROWKW3, 0,
|
|
ACTION_THROWAIMCANT4_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_THROWKW4, 0,
|
|
ACTION_THROWAIMCANT5_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_THROWKW5, 0,
|
|
ACTION_THROWAIMFULL_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_THROWKWR1, 0,
|
|
ACTION_THROWAIMYELLOW1_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_THROWKYELLOW1, 0,
|
|
ACTION_THROWAIMYELLOW2_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_THROWKYELLOW2, 0,
|
|
ACTION_THROWAIMYELLOW3_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_THROWKYELLOW3, 0,
|
|
ACTION_THROWAIMYELLOW4_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_THROWKYELLOW4, 0,
|
|
|
|
THROW_ITEM_GOOD_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_ITEM_GOOD_THROW, 0,
|
|
THROW_ITEM_BAD_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_ITEM_BAD_THROW, 0,
|
|
THROW_ITEM_RED_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_ITEM_RED_THROW, 0,
|
|
THROW_ITEM_FLASH_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_ITEM_FLASH_THROW, 0,
|
|
|
|
PLACE_BOMB_GREY_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_BOMB_GRAY, 0,
|
|
PLACE_BOMB_RED_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_BOMB_RED, 0,
|
|
PLACE_REMOTE_GREY_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_REMOTE_GRAY, 0,
|
|
PLACE_REMOTE_RED_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_REMOTE_RED, 0,
|
|
PLACE_TINCAN_GREY_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_CAN, 0,
|
|
PLACE_TINCAN_RED_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_CANRED, 0,
|
|
|
|
ENTER_VEHICLE_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_ENTERV, 0,
|
|
|
|
INVALID_ACTION_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_INVALID_ACTION, 0,
|
|
|
|
FLOATING_X_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_X, 0,
|
|
|
|
EXCHANGE_PLACES_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_EXCHANGE_PLACES, 0,
|
|
JUMP_OVER_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_JUMP_OVER, 0,
|
|
|
|
REFUEL_GREY_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_FUEL, 0,
|
|
REFUEL_RED_UICURSOR, UICURSOR_FREEFLOWING, CURSOR_FUEL_RED, 0,
|
|
|
|
};
|
|
|
|
|
|
UINT32 guiCurUICursor = NO_UICURSOR;
|
|
UINT32 guiOldUICursor = NO_UICURSOR;
|
|
UINT16 gusCurMousePos;
|
|
UINT16 gusTargetDropPos;
|
|
BOOLEAN gfTargetDropPos = FALSE;
|
|
|
|
// LOCAL FUNCTIONS
|
|
void EraseSnappingCursor( );
|
|
void DrawSnappingCursor( );
|
|
|
|
|
|
BOOLEAN SetUICursor( UINT32 uiNewCursor )
|
|
{
|
|
guiOldUICursor = guiCurUICursor;
|
|
guiCurUICursor = uiNewCursor;
|
|
|
|
return( TRUE );
|
|
}
|
|
|
|
BOOLEAN DrawUICursor( )
|
|
{
|
|
UINT16 usMapPos;
|
|
static BOOLEAN fHideCursor = FALSE;
|
|
LEVELNODE *pNode;
|
|
UINT16 usTileCursor;
|
|
|
|
//RaiseMouseToLevel( (INT8)gsInterfaceLevel );
|
|
|
|
HandleLooseCursorDraw( );
|
|
|
|
|
|
// OK, WE OVERRIDE HERE CURSOR DRAWING FOR THINGS LIKE
|
|
if ( gpItemPointer != NULL )
|
|
{
|
|
MSYS_ChangeRegionCursor( &gViewportRegion , VIDEO_NO_CURSOR );
|
|
|
|
// Check if we are in the viewport region...
|
|
if ( gViewportRegion.uiFlags & MSYS_MOUSE_IN_AREA )
|
|
{
|
|
DrawItemTileCursor( );
|
|
}
|
|
else
|
|
{
|
|
DrawItemFreeCursor( );
|
|
}
|
|
return( TRUE );
|
|
}
|
|
|
|
if (GetMouseMapPos( &usMapPos) )
|
|
{
|
|
gusCurMousePos = usMapPos;
|
|
|
|
if ( guiCurUICursor == NO_UICURSOR )
|
|
{
|
|
MSYS_ChangeRegionCursor( &gViewportRegion , VIDEO_NO_CURSOR );
|
|
return( TRUE );
|
|
}
|
|
|
|
if ( gUICursors[ guiCurUICursor ].uiFlags & UICURSOR_SHOWTILE )
|
|
{
|
|
if ( gsInterfaceLevel == I_ROOF_LEVEL )
|
|
{
|
|
pNode = AddTopmostToTail( gusCurMousePos, GetSnapCursorIndex( FIRSTPOINTERS3 ) );
|
|
}
|
|
else
|
|
{
|
|
pNode = AddTopmostToTail( gusCurMousePos, GetSnapCursorIndex( gUICursors[ guiCurUICursor ].usAdditionalData ) );
|
|
}
|
|
pNode->ubShadeLevel=DEFAULT_SHADE_LEVEL;
|
|
pNode->ubNaturalShadeLevel=DEFAULT_SHADE_LEVEL;
|
|
|
|
if ( gsInterfaceLevel == I_ROOF_LEVEL )
|
|
{
|
|
// Put one on the roof as well
|
|
AddOnRoofToHead( gusCurMousePos, GetSnapCursorIndex( gUICursors[ guiCurUICursor ].usAdditionalData ) );
|
|
gpWorldLevelData[gusCurMousePos].pOnRoofHead->ubShadeLevel=DEFAULT_SHADE_LEVEL;
|
|
gpWorldLevelData[gusCurMousePos].pOnRoofHead->ubNaturalShadeLevel=DEFAULT_SHADE_LEVEL;
|
|
}
|
|
}
|
|
|
|
gfTargetDropPos = FALSE;
|
|
|
|
if ( gUICursors[ guiCurUICursor ].uiFlags & UICURSOR_FREEFLOWING && !( gUICursors[ guiCurUICursor ].uiFlags & UICURSOR_DONTSHOW2NDLEVEL ) )
|
|
{
|
|
gfTargetDropPos = TRUE;
|
|
gusTargetDropPos = gusCurMousePos;
|
|
|
|
if ( gsInterfaceLevel == I_ROOF_LEVEL )
|
|
{
|
|
// If we are over a target, jump to that....
|
|
if ( gfUIFullTargetFound )
|
|
{
|
|
gusTargetDropPos = MercPtrs[ gusUIFullTargetID ]->sGridNo;
|
|
}
|
|
|
|
// Put tile on the floor
|
|
AddTopmostToTail( gusTargetDropPos, FIRSTPOINTERS14 );
|
|
gpWorldLevelData[ gusTargetDropPos ].pTopmostHead->ubShadeLevel=DEFAULT_SHADE_LEVEL;
|
|
gpWorldLevelData[ gusTargetDropPos ].pTopmostHead->ubNaturalShadeLevel=DEFAULT_SHADE_LEVEL;
|
|
|
|
}
|
|
}
|
|
|
|
if ( gUICursors[ guiCurUICursor ].uiFlags & UICURSOR_SHOWTILEAPDEPENDENT )
|
|
{
|
|
// Add depending on AP status
|
|
usTileCursor = gUICursors[ guiCurUICursor ].usAdditionalData;
|
|
|
|
// ATE; Is the current guy in steath mode?
|
|
if ( gusSelectedSoldier != NOBODY )
|
|
{
|
|
if ( MercPtrs[ gusSelectedSoldier ]->bStealthMode )
|
|
{
|
|
usTileCursor = FIRSTPOINTERS9;
|
|
}
|
|
}
|
|
|
|
if ( gfUIDisplayActionPointsInvalid || gsCurrentActionPoints == 0 )
|
|
{
|
|
usTileCursor = FIRSTPOINTERS6;
|
|
|
|
// ATE; Is the current guy in steath mode?
|
|
if ( gusSelectedSoldier != NOBODY )
|
|
{
|
|
if ( MercPtrs[ gusSelectedSoldier ]->bStealthMode )
|
|
{
|
|
usTileCursor = FIRSTPOINTERS10;
|
|
}
|
|
}
|
|
}
|
|
|
|
if ( gsInterfaceLevel == I_ROOF_LEVEL )
|
|
{
|
|
pNode = AddTopmostToTail( gusCurMousePos, GetSnapCursorIndex( FIRSTPOINTERS14 ) );
|
|
}
|
|
else
|
|
{
|
|
pNode = AddTopmostToTail( gusCurMousePos, GetSnapCursorIndex( usTileCursor ) );
|
|
}
|
|
|
|
pNode->ubShadeLevel=DEFAULT_SHADE_LEVEL;
|
|
pNode->ubNaturalShadeLevel=DEFAULT_SHADE_LEVEL;
|
|
|
|
if ( gsInterfaceLevel == I_ROOF_LEVEL )
|
|
{
|
|
// Put one on the roof as well
|
|
AddOnRoofToHead( gusCurMousePos, GetSnapCursorIndex( usTileCursor ) );
|
|
gpWorldLevelData[gusCurMousePos].pOnRoofHead->ubShadeLevel=DEFAULT_SHADE_LEVEL;
|
|
gpWorldLevelData[gusCurMousePos].pOnRoofHead->ubNaturalShadeLevel=DEFAULT_SHADE_LEVEL;
|
|
}
|
|
}
|
|
|
|
|
|
// If snapping - remove from main viewport
|
|
if ( gUICursors[ guiCurUICursor ].uiFlags & UICURSOR_SNAPPING )
|
|
{
|
|
// Hide mouse region cursor
|
|
MSYS_ChangeRegionCursor( &gViewportRegion , VIDEO_NO_CURSOR );
|
|
|
|
// Set Snapping Cursor
|
|
DrawSnappingCursor( );
|
|
}
|
|
|
|
|
|
if ( gUICursors[ guiCurUICursor ].uiFlags & UICURSOR_FREEFLOWING )
|
|
{
|
|
switch( guiCurUICursor )
|
|
{
|
|
case MOVE_VEHICLE_UICURSOR:
|
|
|
|
// Set position for APS
|
|
gfUIDisplayActionPointsCenter = FALSE;
|
|
gUIDisplayActionPointsOffX = 16;
|
|
gUIDisplayActionPointsOffY = 14;
|
|
break;
|
|
|
|
case MOVE_WALK_UICURSOR:
|
|
case MOVE_RUN_UICURSOR:
|
|
|
|
// Set position for APS
|
|
gfUIDisplayActionPointsCenter = FALSE;
|
|
gUIDisplayActionPointsOffX = 16;
|
|
gUIDisplayActionPointsOffY = 14;
|
|
break;
|
|
|
|
case MOVE_SWAT_UICURSOR:
|
|
|
|
// Set position for APS
|
|
gfUIDisplayActionPointsCenter = FALSE;
|
|
gUIDisplayActionPointsOffX = 16;
|
|
gUIDisplayActionPointsOffY = 10;
|
|
break;
|
|
|
|
case MOVE_PRONE_UICURSOR:
|
|
|
|
// Set position for APS
|
|
gfUIDisplayActionPointsCenter = FALSE;
|
|
gUIDisplayActionPointsOffX = 16;
|
|
gUIDisplayActionPointsOffY = 9;
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
fHideCursor = FALSE;
|
|
|
|
if ( !fHideCursor )
|
|
{
|
|
MSYS_ChangeRegionCursor( &gViewportRegion , gUICursors[ guiCurUICursor ].usFreeCursorName );
|
|
|
|
}
|
|
else
|
|
{
|
|
// Hide
|
|
MSYS_ChangeRegionCursor( &gViewportRegion , VIDEO_NO_CURSOR );
|
|
}
|
|
|
|
}
|
|
|
|
if ( gUICursors[ guiCurUICursor ].uiFlags & UICURSOR_CENTERAPS )
|
|
{
|
|
gfUIDisplayActionPointsCenter = TRUE;
|
|
}
|
|
}
|
|
return( TRUE );
|
|
}
|
|
|
|
BOOLEAN HideUICursor( )
|
|
{
|
|
HandleLooseCursorHide( );
|
|
|
|
// OK, WE OVERRIDE HERE CURSOR DRAWING FOR THINGS LIKE
|
|
if ( gpItemPointer != NULL )
|
|
{
|
|
// Check if we are in the viewport region...
|
|
if ( gViewportRegion.uiFlags & MSYS_MOUSE_IN_AREA )
|
|
{
|
|
HideItemTileCursor( );
|
|
return( TRUE );
|
|
}
|
|
}
|
|
|
|
if ( guiCurUICursor == NO_UICURSOR )
|
|
{
|
|
//Do nothing here
|
|
return( TRUE );
|
|
}
|
|
|
|
if ( gUICursors[ guiCurUICursor ].uiFlags & ( UICURSOR_SHOWTILE | UICURSOR_SHOWTILEAPDEPENDENT ) )
|
|
{
|
|
RemoveAllTopmostsOfTypeRange( gusCurMousePos, FIRSTPOINTERS, FIRSTPOINTERS );
|
|
RemoveAllOnRoofsOfTypeRange( gusCurMousePos, FIRSTPOINTERS, FIRSTPOINTERS );
|
|
}
|
|
|
|
|
|
if ( gUICursors[ guiCurUICursor ].uiFlags & UICURSOR_FREEFLOWING && !( gUICursors[ guiCurUICursor ].uiFlags & UICURSOR_DONTSHOW2NDLEVEL ) )
|
|
{
|
|
if ( gsInterfaceLevel == I_ROOF_LEVEL )
|
|
{
|
|
RemoveTopmost( gusCurMousePos, FIRSTPOINTERS14 );
|
|
RemoveTopmost( gusCurMousePos, FIRSTPOINTERS9 );
|
|
|
|
if ( gfTargetDropPos )
|
|
{
|
|
RemoveTopmost( gusTargetDropPos, FIRSTPOINTERS14 );
|
|
RemoveTopmost( gusTargetDropPos, FIRSTPOINTERS9 );
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
|
|
// If snapping - remove from main viewport
|
|
if ( ( gUICursors[ guiCurUICursor ].uiFlags & UICURSOR_SNAPPING ) )
|
|
{
|
|
// hide Snapping Cursor
|
|
EraseSnappingCursor( );
|
|
}
|
|
|
|
if ( gUICursors[ guiCurUICursor ].uiFlags & UICURSOR_FREEFLOWING )
|
|
{
|
|
// Nothing special here...
|
|
}
|
|
|
|
return( TRUE );
|
|
}
|
|
|
|
|
|
void DrawSnappingCursor( )
|
|
{
|
|
LEVELNODE *pNewUIElem;
|
|
SOLDIERTYPE *pSoldier;
|
|
static BOOLEAN fShowAP = TRUE;
|
|
|
|
if ( gusSelectedSoldier != NO_SOLDIER )
|
|
{
|
|
GetSoldier( &pSoldier, gusSelectedSoldier );
|
|
|
|
}
|
|
|
|
// If we are in draw item mode, do nothing here but call the fuctiuon
|
|
switch ( guiCurUICursor )
|
|
{
|
|
case NO_UICURSOR:
|
|
break;
|
|
|
|
case NORMAL_SNAPUICURSOR:
|
|
|
|
AddTopmostToHead( gusCurMousePos, FIRSTPOINTERS1 );
|
|
gpWorldLevelData[gusCurMousePos].pTopmostHead->ubShadeLevel=DEFAULT_SHADE_LEVEL;
|
|
gpWorldLevelData[gusCurMousePos].pTopmostHead->ubNaturalShadeLevel=DEFAULT_SHADE_LEVEL;
|
|
break;
|
|
|
|
case ALL_MOVE_RUN_UICURSOR:
|
|
case CONFIRM_MOVE_RUN_UICURSOR:
|
|
if ( gsInterfaceLevel > 0 )
|
|
{
|
|
AddUIElem( gusCurMousePos, GOODRUN1, 0, -WALL_HEIGHT - 8, &pNewUIElem );
|
|
}
|
|
else
|
|
{
|
|
AddUIElem( gusCurMousePos, GOODRUN1, 0, 0, &pNewUIElem );
|
|
}
|
|
pNewUIElem->ubShadeLevel=DEFAULT_SHADE_LEVEL;
|
|
pNewUIElem->ubNaturalShadeLevel=DEFAULT_SHADE_LEVEL;
|
|
break;
|
|
|
|
case ALL_MOVE_WALK_UICURSOR:
|
|
case CONFIRM_MOVE_WALK_UICURSOR:
|
|
if ( gsInterfaceLevel > 0 )
|
|
{
|
|
AddUIElem( gusCurMousePos, GOODWALK1, 0, -WALL_HEIGHT - 8, &pNewUIElem );
|
|
}
|
|
else
|
|
{
|
|
AddUIElem( gusCurMousePos, GOODWALK1, 0, 0, &pNewUIElem );
|
|
}
|
|
pNewUIElem->ubShadeLevel=DEFAULT_SHADE_LEVEL;
|
|
pNewUIElem->ubNaturalShadeLevel=DEFAULT_SHADE_LEVEL;
|
|
break;
|
|
|
|
case ALL_MOVE_SWAT_UICURSOR:
|
|
case CONFIRM_MOVE_SWAT_UICURSOR:
|
|
if ( gsInterfaceLevel > 0 )
|
|
{
|
|
AddUIElem( gusCurMousePos, GOODSWAT1, 0, -WALL_HEIGHT - 8, &pNewUIElem );
|
|
}
|
|
else
|
|
{
|
|
AddUIElem( gusCurMousePos, GOODSWAT1, 0, 0, &pNewUIElem );
|
|
}
|
|
pNewUIElem->ubShadeLevel=DEFAULT_SHADE_LEVEL;
|
|
pNewUIElem->ubNaturalShadeLevel=DEFAULT_SHADE_LEVEL;
|
|
break;
|
|
|
|
case ALL_MOVE_PRONE_UICURSOR:
|
|
case CONFIRM_MOVE_PRONE_UICURSOR:
|
|
if ( gsInterfaceLevel > 0 )
|
|
{
|
|
AddUIElem( gusCurMousePos, GOODPRONE1, 0, -WALL_HEIGHT - 8 - 6, &pNewUIElem );
|
|
}
|
|
else
|
|
{
|
|
AddUIElem( gusCurMousePos, GOODPRONE1, 0, -6, &pNewUIElem );
|
|
}
|
|
pNewUIElem->ubShadeLevel=DEFAULT_SHADE_LEVEL;
|
|
pNewUIElem->ubNaturalShadeLevel=DEFAULT_SHADE_LEVEL;
|
|
break;
|
|
|
|
case ALL_MOVE_VEHICLE_UICURSOR:
|
|
case CONFIRM_MOVE_VEHICLE_UICURSOR:
|
|
if ( gsInterfaceLevel > 0 )
|
|
{
|
|
AddUIElem( gusCurMousePos, VEHICLEMOVE1, 0, -WALL_HEIGHT - 8, &pNewUIElem );
|
|
}
|
|
else
|
|
{
|
|
AddUIElem( gusCurMousePos, VEHICLEMOVE1, 0, 0, &pNewUIElem );
|
|
}
|
|
pNewUIElem->ubShadeLevel=DEFAULT_SHADE_LEVEL;
|
|
pNewUIElem->ubNaturalShadeLevel=DEFAULT_SHADE_LEVEL;
|
|
break;
|
|
|
|
case MOVE_REALTIME_UICURSOR:
|
|
break;
|
|
|
|
case CANNOT_MOVE_UICURSOR:
|
|
|
|
if ( gsInterfaceLevel > 0 )
|
|
{
|
|
AddUIElem( gusCurMousePos, BADMARKER1, 0, -WALL_HEIGHT - 8, &pNewUIElem );
|
|
pNewUIElem->ubShadeLevel=DEFAULT_SHADE_LEVEL;
|
|
pNewUIElem->ubNaturalShadeLevel=DEFAULT_SHADE_LEVEL;
|
|
|
|
if ( gGameSettings.fOptions[ TOPTION_3D_CURSOR ] )
|
|
{
|
|
AddTopmostToHead( gusCurMousePos, FIRSTPOINTERS13 );
|
|
gpWorldLevelData[gusCurMousePos].pTopmostHead->ubShadeLevel=DEFAULT_SHADE_LEVEL;
|
|
gpWorldLevelData[gusCurMousePos].pTopmostHead->ubNaturalShadeLevel=DEFAULT_SHADE_LEVEL;
|
|
}
|
|
|
|
AddOnRoofToHead( gusCurMousePos, FIRSTPOINTERS14 );
|
|
gpWorldLevelData[gusCurMousePos].pOnRoofHead->ubShadeLevel=DEFAULT_SHADE_LEVEL;
|
|
gpWorldLevelData[gusCurMousePos].pOnRoofHead->ubNaturalShadeLevel=DEFAULT_SHADE_LEVEL;
|
|
|
|
}
|
|
else
|
|
{
|
|
AddTopmostToHead( gusCurMousePos, BADMARKER1 );
|
|
gpWorldLevelData[gusCurMousePos].pTopmostHead->ubShadeLevel=DEFAULT_SHADE_LEVEL;
|
|
gpWorldLevelData[gusCurMousePos].pTopmostHead->ubNaturalShadeLevel=DEFAULT_SHADE_LEVEL;
|
|
|
|
if ( gGameSettings.fOptions[ TOPTION_3D_CURSOR ] )
|
|
{
|
|
AddTopmostToHead( gusCurMousePos, FIRSTPOINTERS13 );
|
|
gpWorldLevelData[gusCurMousePos].pTopmostHead->ubShadeLevel=DEFAULT_SHADE_LEVEL;
|
|
gpWorldLevelData[gusCurMousePos].pTopmostHead->ubNaturalShadeLevel=DEFAULT_SHADE_LEVEL;
|
|
}
|
|
}
|
|
break;
|
|
|
|
}
|
|
|
|
// Add action points
|
|
if ( gfUIDisplayActionPoints )
|
|
{
|
|
|
|
if ( gfUIDisplayActionPointsInvalid )
|
|
{
|
|
if ( COUNTERDONE( CURSORFLASH ) )
|
|
{
|
|
RESETCOUNTER( CURSORFLASH );
|
|
|
|
fShowAP = !fShowAP;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
fShowAP = TRUE;
|
|
}
|
|
|
|
if ( gsInterfaceLevel > 0 )
|
|
{
|
|
AddUIElem( gusCurMousePos, DISPLAY_AP_INDEX, SNAPCURSOR_AP_X_STARTVAL, SNAPCURSOR_AP_Y_STARTVAL - WALL_HEIGHT - 10, &pNewUIElem );
|
|
}
|
|
else
|
|
{
|
|
AddUIElem( gusCurMousePos, DISPLAY_AP_INDEX, SNAPCURSOR_AP_X_STARTVAL, SNAPCURSOR_AP_Y_STARTVAL, &pNewUIElem );
|
|
}
|
|
pNewUIElem->uiFlags |= LEVELNODE_DISPLAY_AP;
|
|
pNewUIElem->uiAPCost = gsCurrentActionPoints;
|
|
pNewUIElem->ubShadeLevel=DEFAULT_SHADE_LEVEL;
|
|
pNewUIElem->ubNaturalShadeLevel=DEFAULT_SHADE_LEVEL;
|
|
|
|
if ( !fShowAP )
|
|
{
|
|
gfUIDisplayActionPointsBlack = TRUE;
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
|
|
void EraseSnappingCursor( )
|
|
{
|
|
RemoveAllTopmostsOfTypeRange( gusCurMousePos, MOCKFLOOR, MOCKFLOOR );
|
|
RemoveAllTopmostsOfTypeRange( gusCurMousePos, FIRSTPOINTERS, LASTPOINTERS );
|
|
RemoveAllObjectsOfTypeRange( gusCurMousePos, FIRSTPOINTERS, LASTPOINTERS );
|
|
RemoveAllOnRoofsOfTypeRange( gusCurMousePos, FIRSTPOINTERS, LASTPOINTERS );
|
|
RemoveAllOnRoofsOfTypeRange( gusCurMousePos, MOCKFLOOR, MOCKFLOOR );
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void StartLooseCursor( INT16 sGridNo, UINT32 uiCursorID )
|
|
{
|
|
gfLooseCursorOn = TRUE;
|
|
|
|
guiLooseCursorID = uiCursorID;
|
|
|
|
guiLooseCursorTimeOfLastUpdate = GetJA2Clock( );
|
|
|
|
gsLooseCursorGridNo = sGridNo;
|
|
}
|
|
|
|
|
|
void HandleLooseCursorDraw( )
|
|
{
|
|
LEVELNODE *pNewUIElem;
|
|
|
|
if ( ( GetJA2Clock( ) - guiLooseCursorTimeOfLastUpdate ) > LOOSE_CURSOR_DELAY )
|
|
{
|
|
gfLooseCursorOn = FALSE;
|
|
}
|
|
|
|
if ( gfLooseCursorOn )
|
|
{
|
|
AddUIElem( gsLooseCursorGridNo, FIRSTPOINTERS4, 0, 0, &pNewUIElem );
|
|
pNewUIElem->ubShadeLevel=DEFAULT_SHADE_LEVEL;
|
|
pNewUIElem->ubNaturalShadeLevel=DEFAULT_SHADE_LEVEL;
|
|
}
|
|
}
|
|
|
|
|
|
void HandleLooseCursorHide( )
|
|
{
|
|
if ( gfLooseCursorOn )
|
|
{
|
|
RemoveTopmost( gsLooseCursorGridNo, FIRSTPOINTERS4 );
|
|
}
|
|
}
|
|
|
|
|
|
UINT16 GetSnapCursorIndex( UINT16 usAdditionalData )
|
|
{
|
|
// OK, this function will get the 'true' index for drawing the cursor....
|
|
if ( gGameSettings.fOptions[ TOPTION_3D_CURSOR ] )
|
|
{
|
|
switch( usAdditionalData )
|
|
{
|
|
case FIRSTPOINTERS2:
|
|
|
|
return( FIRSTPOINTERS13 );
|
|
break;
|
|
|
|
case FIRSTPOINTERS3:
|
|
|
|
return( FIRSTPOINTERS14 );
|
|
break;
|
|
|
|
case FIRSTPOINTERS4:
|
|
|
|
return( FIRSTPOINTERS15 );
|
|
break;
|
|
|
|
case FIRSTPOINTERS5:
|
|
|
|
return( FIRSTPOINTERS16 );
|
|
break;
|
|
|
|
case FIRSTPOINTERS6:
|
|
|
|
return( FIRSTPOINTERS17 );
|
|
break;
|
|
|
|
case FIRSTPOINTERS7:
|
|
|
|
return( FIRSTPOINTERS18 );
|
|
break;
|
|
|
|
case FIRSTPOINTERS9:
|
|
|
|
return( FIRSTPOINTERS19 );
|
|
break;
|
|
|
|
case FIRSTPOINTERS10:
|
|
|
|
return( FIRSTPOINTERS20 );
|
|
break;
|
|
|
|
default:
|
|
|
|
return( usAdditionalData );
|
|
}
|
|
}
|
|
else
|
|
{
|
|
return( usAdditionalData );
|
|
}
|
|
} |