Open UndeadZeratul opened 8 months ago
Currently trying to implement this... but i'm starting to regret my design decisions in HUDCore lol
Is it fine if I make the new override completely separate from HUDItemOverride and HCItemOverride? I kind of want to try to go for more composition over inheritance (in a sense), as it probably isn't a good idea to shove a bunch of stuff into one class.
I'll leave the existing override classes as is, though I might consider separating their functionality into their own classes in the future. (if i have the time to do so lol)
I'm all for composition over inheritance, so if you'd prefer to make a separate override in the interim that's totally fine. There's not really any pressure to implement this anyways, it's mostly to make sure it was noted down somewhere and not forgotten.
@UndeadZeratul
Quick update:
I've begun working on this, albeit at a very slow pace.
So far I'm currently thinking about how to turn the HUDItemOverride
into a helper class instead (maybe it'll be HCOverrideHandler
instead?)
As for HCItemOverride
, instead of using a variable to check what type of override it is, I've decided to split the types into their own classes, along with their own draw method respective to what the class is overriding:
class IHCOverride ui abstract
{
abstract void Init(HCStatusbar sb); // for initializing anything you need
abstract int GetPriority(); // the bigger the number you return, the higher the priority
abstract bool CheckItem(Inventory item); // Check if it's the correct item
abstract void Tick(HCStatusbar sb); // use this for CVars and stuff, basically things that shouldn't be updated on every draw update
// draw method is contained in their respective override
}
// item
class IHCItemOverride : IHCOverride ui abstract
{
abstract void DrawHUDStuff(HCStatusbar sb, Inventory item, int hdFlags, int gzFlags);
}
// item overlay
class IHCOverlayOverride : IHCOverride ui abstract
{
abstract void DisplayOverlay(HCStatusbar sb, HDPlayerPawn hpl);
}
// weapon
class IHCWeaponOverride : IHCOverride ui abstract
{
abstract void DrawHUDStuff(HCStatusbar sb, HDWeapon wp, HDPlayerPawn hpl);
}
// weapon crosshair/sight
class IHCCrosshairOverride : IHCOverride ui abstract
{
abstract void DrawSightPicture(
HCStatusbar sb,
HDWeapon hdw,
HDPlayerPawn hpl,
bool sightBob,
vector2 bob,
double fov,
bool scopeView,
actor hpc
);
}
I did think about merging IHCItemOverride
with IHCOverlayOverride
, and IHCWeaponOverride
with IHCCrosshairOverride
, but I think it's probably better to leave them separate in case you just want to override one part of an item/weapon.
Oh yeah, regarding the Crosshair override system, that might take a bit of time to implement, because I realised that I will have to copy the contents of DrawHDXHair()
to properly override stuff. (that and also remembering how the script works lol)
Ooh, nice; I like the idea of having them split up, and keeping their scope small should help modularize them a bit. This way I can have a CVAR to disable crosshair tweaks but keep the Statusbar tweaks, or vice-versa.
Similar to overriding the weapon status, would a new Crosshair override type make sense to allow picking a weapon to override and replacing its Crosshair logic?
Personally, with my reskin, being able to alter the position of the ZM/Liberator scopes to match the skin would be neat, but also being able to replace the HERP/DERP cameras would also be a nice bit of configurability.