Draw keys with a key shape in the minimap to tell them apart from other items.

This commit is contained in:
Mari the Deer 2023-09-30 20:44:18 +02:00
commit 6f4b0bb0b4
2 changed files with 20 additions and 3 deletions

View file

@ -1,3 +1,3 @@
[default]
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r968 \cu(Sat 30 Sep 00:08:15 CEST 2023)\c-";
SWWM_SHORTVER="\cw1.3pre r968 \cu(2023-09-30 00:08:15)\c-";
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r969 \cu(Sat 30 Sep 20:44:18 CEST 2023)\c-";
SWWM_SHORTVER="\cw1.3pre r969 \cu(2023-09-30 20:44:18)\c-";

View file

@ -620,14 +620,30 @@ extend Class SWWMStatusBar
}
if ( (((radius+zoomview)-abs(rv.x)) <= 0) || (((radius+zoomview)-abs(rv.y)) <= 0) )
continue;
Vector2 tv[4];
Vector2 tv[8];
int nidx;
bool closeshape = true;
if ( t.isbeam )
{
// oriented line
nidx = 2;
tv[0] = rv;
tv[1] = rv+Actor.RotateVector((radius,0),angle);
closeshape = false;
}
else if ( t.iskey )
{
// key shape (a rhombus and an L, basically)
nidx = 8;
double crad = min(radius,10);
// head (pointing north)
for ( int i=0; i<5; i++ )
tv[i] = rv+(0,crad*.5)-Actor.RotateVector((0,crad*.5),i*90);
// tail (pointing east)
tv[5] = rv;
tv[6] = rv+(0,-crad);
tv[7] = rv+(crad*.5,-crad);
closeshape = false;
}
else if ( isitem )
{
@ -663,6 +679,7 @@ extend Class SWWMStatusBar
// clip to frame
for ( int j=0; j<nidx; j++ )
{
if ( !closeshape && (j == nidx-1) ) break;
[visible, x0, x1] = SWWMUtility.LiangBarsky((-1,-1)*zoomclip,(1,1)*zoomclip,tv[j],tv[(j+1)%nidx]);
if ( visible )
{