Cap minimap zoom like in sidemods. Removes need for a CVar.
This commit is contained in:
parent
a483d45fca
commit
eb3cae5d43
8 changed files with 13 additions and 28 deletions
|
|
@ -86,7 +86,6 @@ nosave int swwm_hudscale2 = 0; // force the "two minus" scale of the HUD (used
|
|||
|
||||
// minimap settings
|
||||
nosave bool swwm_mm_enable = true; // show a minimap below the score counter
|
||||
nosave noarchive float swwm_mm_zoom = 1; // zoom level of minimap
|
||||
nosave bool swwm_mm_missiles = true; // show projectiles (how revolutionary)
|
||||
nosave bool swwm_mm_usecanvas = false; // use a canvas to draw the minimap, so its pixel density is consistent with the rest of the HUD
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
[default]
|
||||
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r978 \cu(Tue 10 Oct 18:06:14 CEST 2023)\c-";
|
||||
SWWM_SHORTVER="\cw1.3pre r978 \cu(2023-10-10 18:06:14)\c-";
|
||||
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r979 \cu(Fri 13 Oct 12:11:13 CEST 2023)\c-";
|
||||
SWWM_SHORTVER="\cw1.3pre r979 \cu(2023-10-13 12:11:13)\c-";
|
||||
|
|
|
|||
|
|
@ -22,20 +22,17 @@ extend Class SWWMHandler
|
|||
{
|
||||
if ( (gamestate != GS_LEVEL) || (players[consoleplayer].Health <= 0) || !(players[consoleplayer].mo is 'Demolitionist') )
|
||||
return;
|
||||
double val = swwm_mm_zoom;
|
||||
if ( val > 1. ) val = max(1.,val-.5);
|
||||
else val = max(.5,val-.25);
|
||||
CVar.FindCVar('swwm_mm_zoom').SetFloat(val);
|
||||
let bar = SWWMStatusBar(StatusBar);
|
||||
if ( !bar ) return;
|
||||
bar.mm_zoom = max(.5,bar.mm_zoom-.25);
|
||||
}
|
||||
else if ( e.Name ~== "swwmzoomout" )
|
||||
{
|
||||
if ( (gamestate != GS_LEVEL) || (players[consoleplayer].Health <= 0) || !(players[consoleplayer].mo is 'Demolitionist') )
|
||||
return;
|
||||
double maxval = level.allmap?2.:1.;
|
||||
double val = swwm_mm_zoom;
|
||||
if ( val >= 1. ) val = min(maxval,val+.5);
|
||||
else val = min(1.,val+.25);
|
||||
CVar.FindCVar('swwm_mm_zoom').SetFloat(val);
|
||||
let bar = SWWMStatusBar(StatusBar);
|
||||
if ( !bar ) return;
|
||||
bar.mm_zoom = min(1.,bar.mm_zoom+.25);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -276,7 +276,7 @@ extend Class SWWMHandler
|
|||
return;
|
||||
}
|
||||
// update trackers for anything around the player
|
||||
double viewdist = SWWMStatusBar.MAPVIEWDIST*swwm_mm_zoom;
|
||||
double viewdist = SWWMStatusBar.MAPVIEWDIST;
|
||||
// still about as expensive as using a BlockThingsIterator, but without the need to allocate one every tic
|
||||
int thisgroup = players[consoleplayer].Camera.CurSector.portalgroup;
|
||||
foreach ( s:level.Sectors ) for ( Actor a=s.thinglist; a; a=a.snext )
|
||||
|
|
|
|||
|
|
@ -97,12 +97,6 @@ Class SWWMStaticHandler : StaticEventHandler
|
|||
}
|
||||
SWWMHandler.ClearAllShaders();
|
||||
EventHandler.SendInterfaceEvent(consoleplayer,"swwmflushhud");
|
||||
// force a reset of the minimap zoom in case it's set beyond safe levels
|
||||
double mmz = swwm_mm_zoom;
|
||||
if ( level.allmap && (mmz >= 2.) ) mmz = 2.;
|
||||
else if ( mmz >= 1. ) mmz = 1.;
|
||||
else mmz = .5;
|
||||
CVar.FindCVar('swwm_mm_zoom').SetFloat(mmz);
|
||||
EventHandler.SendInterfaceEvent(consoleplayer,"swwmaprcheck");
|
||||
if ( !e.IsSaveGame ) return;
|
||||
// save version checker
|
||||
|
|
|
|||
|
|
@ -141,6 +141,7 @@ Class SWWMStatusBar : BaseStatusBar
|
|||
|
||||
SWWMWeaponTooltip ctip;
|
||||
|
||||
double mm_zoom;
|
||||
transient ThinkerIterator mi; // for map markers
|
||||
double minimapzoom, oldminimapzoom;
|
||||
// minimap constants
|
||||
|
|
@ -367,7 +368,7 @@ Class SWWMStatusBar : BaseStatusBar
|
|||
tcsucks = mhudfontcol[MCR_RED];
|
||||
tclabel_s = "[MiniCyanblu]";
|
||||
tcextra_s = "[MiniIbukiHUD]";
|
||||
minimapzoom = oldminimapzoom = 1.;
|
||||
mm_zoom = minimapzoom = oldminimapzoom = 1.;
|
||||
LastHealth = CPlayer?CPlayer.health:100;
|
||||
let d = Demolitionist(CPlayer?CPlayer.mo:null);
|
||||
HealthInter = SmoothDynamicValueInterpolator.Create(LastHealth,.5);
|
||||
|
|
|
|||
|
|
@ -96,8 +96,8 @@ extend Class SWWMStatusBar
|
|||
keyflash.Delete(i--);
|
||||
}
|
||||
// minimap zoom interpolation
|
||||
double desiredzoom = clamp(swwm_mm_zoom,.5,level.allmap?2.:1.);
|
||||
if ( (minimapzoom != swwm_mm_zoom) || (oldminimapzoom != swwm_mm_zoom) )
|
||||
double desiredzoom = clamp(mm_zoom,.5,1.);
|
||||
if ( (minimapzoom != mm_zoom) || (oldminimapzoom != mm_zoom) )
|
||||
{
|
||||
oldminimapzoom = minimapzoom;
|
||||
double diff = .1*(desiredzoom-minimapzoom);
|
||||
|
|
|
|||
|
|
@ -15,11 +15,7 @@ Class Omnisight : Inventory
|
|||
Actor rt = toucher;
|
||||
if ( toucher.player ) rt = toucher.player.mo;
|
||||
if ( rt.player == players[consoleplayer] )
|
||||
{
|
||||
rt.A_StartSound("powerup/omnisight",CHAN_ITEMEXTRA,CHANF_OVERLAP);
|
||||
// automatically zoom out so the player can know how far this goes
|
||||
CVar.FindCVar('swwm_mm_zoom').SetFloat(2.);
|
||||
}
|
||||
if ( rt is 'Demolitionist' )
|
||||
Demolitionist(rt).lastbump *= 1.1;
|
||||
level.allmap = true;
|
||||
|
|
@ -35,8 +31,6 @@ Class Omnisight : Inventory
|
|||
{
|
||||
Console.Printf(StringTable.Localize("$D_OMNISHARE"),rt.player.GetUserName());
|
||||
players[i].mo.A_StartSound("powerup/omnisight",CHAN_ITEMEXTRA,CHANF_OVERLAP);
|
||||
// automatically zoom out so the player can know how far this goes
|
||||
CVar.FindCVar('swwm_mm_zoom').SetFloat(2.);
|
||||
}
|
||||
if ( players[i].mo is 'Demolitionist' )
|
||||
Demolitionist(players[i].mo).lastbump *= 1.1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue