Draw keys with a key shape in the minimap to tell them apart from other items.
This commit is contained in:
parent
aa10a38841
commit
6f4b0bb0b4
2 changed files with 20 additions and 3 deletions
|
|
@ -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 )
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue