Bump zscript ver to 4.14.1, plus a whole lot of stuff.

- Try to get rid of all implicit casts from string to name, color or class.
 - Use FindClass where needed.
 - Used a map in a case where a dictionary was unneeded.
 - Use new bounce flags where needed.
 - Replace Legacy of Rust weapons/ammo.
This commit is contained in:
Mari the Deer 2025-03-13 14:45:01 +01:00
commit 80db58b0d0
128 changed files with 3074 additions and 3088 deletions

View file

@ -158,8 +158,8 @@ Class DemolitionistMenu : GenericMenu
tmsg = StringTable.Localize("$SWWM_MAINCONTROLS");
tmsgtic = MenuTime()+50;
lasttuid = Random[TUID]();
hnd = SWWMHandler(EventHandler.Find("SWWMHandler"));
shnd = SWWMStaticHandler(StaticEventHandler.Find("SWWMStaticHandler"));
hnd = SWWMHandler(EventHandler.Find('SWWMHandler'));
shnd = SWWMStaticHandler(StaticEventHandler.Find('SWWMStaticHandler'));
SetClock(c_year,c_month,c_day,c_hour,c_minute,c_tz);
clockstr = CrimeTime(c_year,c_month,c_day,c_hour,c_minute,c_tz);
static const class<DemolitionistMenuTab> deftabs[] =
@ -195,16 +195,12 @@ Class DemolitionistMenu : GenericMenu
t.Ticker();
tabs.Push(t);
}
if ( shnd.menustate )
curtab = -1;
if ( shnd.menustate.CheckKey("LastTab") )
{
Class<DemolitionistMenuTab> saved = shnd.menustate.At("LastTab");
Class<DemolitionistMenuTab> saved = shnd.menustate.Get("LastTab");
if ( saved ) curtab = FindTabType(saved,true);
}
else
{
shnd.menustate = Dictionary.Create();
curtab = -1;
}
if ( curtab == -1 ) curtab = GetFirstTab();
tabs[curtab].OnSelect();
}
@ -546,7 +542,7 @@ Class DemolitionistMenu : GenericMenu
double rox = int(ss.x-rwsx)/2;
double roy = int(ss.y-rwsy)/2;
// copy the menu dim below the window during animations, so the transition looks smoother
Screen.Dim((dimamount<0)?Color("Black"):dimcolor,(dimamount<0)?.5:dimamount,int(rox*hs),int(roy*hs),int(rwsx*hs),int(rwsy*hs));
Screen.Dim((dimamount<0)?0xFF000000:dimcolor,(dimamount<0)?.5:dimamount,int(rox*hs),int(roy*hs),int(rwsx*hs),int(rwsy*hs));
// draw the background and main frame
if ( swwm_fuzz )
{
@ -557,7 +553,7 @@ Class DemolitionistMenu : GenericMenu
Screen.DrawTexture(FancyBg,false,origin.x,origin.y+400.*i,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_LegacyRenderStyle,STYLE_Add,DTA_Alpha,.5);
Screen.ClearClipRect();
}
Screen.Dim("Black",.8,int(rox*hs),int(roy*hs),int(rwsx*hs),int(rwsy*hs));
Screen.Dim(0xFF000000,.8,int(rox*hs),int(roy*hs),int(rwsx*hs),int(rwsy*hs));
DrawFrame(rox-origin.x,roy-origin.y,rwsx,rwsy,true);
return;
}
@ -571,7 +567,7 @@ Class DemolitionistMenu : GenericMenu
Screen.DrawTexture(FancyBg,false,origin.x,origin.y+400.*i,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_LegacyRenderStyle,STYLE_Add,DTA_Alpha,.5);
Screen.ClearClipRect();
}
Screen.Dim("Black",.8,int(origin.x*hs),int(origin.y*hs),int(ws.x*hs),int(ws.y*hs));
Screen.Dim(0xFF000000,.8,int(origin.x*hs),int(origin.y*hs),int(ws.x*hs),int(ws.y*hs));
DrawFrame(0,0,ws.x,ws.y,true);
// draw top and bottom separators
DrawHSeparator(0,14,ws.x);