Sun Apr 23, 2017 7:58 am
// Uniform scaling.
void DrawStringScaled(HUDFont font, String string, Vector2 pos, int flags = 0, int translation = Font.CR_UNTRANSLATED, double Alpha = 1., int wrapwidth = -1, int linespacing = 4, double scaling = 1.0)
Vector2 OldScale = BaseSize, TempScale = BaseSize;
Vector2 ScaledPos = pos;
if (scaling == 0.0) //Why draw anything? Also to prevent division by 0.
scaling = abs(scaling);
// Thankfully, scaling up is directly that -- smaller screen coordinates and
// larger texture size which is automatically handled by the engine.
bool sized = (scaling != 1.0);
TempScale /= scaling;
ScaledPos /= scaling;
// Change to the new scale, draw it, and then set it back.
if (sized) SetSize(0, TempScale.X, TempScale.Y);
DrawString(font, string, ScaledPos, flags, translation, Alpha, wrapwidth, linespacing);
if (sized) SetSize(0, OldScale.X, OldScale.Y);
Wed May 10, 2017 8:52 pm
Thu May 11, 2017 1:46 am
Thu May 11, 2017 8:13 am
Fri May 12, 2017 7:54 pm
Sun May 28, 2017 11:50 am
[nch_weaponfound, nch_weaponslot] = CPlayer.weapons.LocateWeapon(CPlayer.ReadyWeapon.GetClass());
Readonly struct on left hand side of LocateWeapon not allowed
Sun May 28, 2017 1:00 pm
int i1, i2;
Class<Weapon> wep = CPlayer.ReadyWeapon.GetClass();
[weaponFound, i1, i2] = w.LocateWeapon(wep);
Sun May 28, 2017 1:52 pm
Major Cooke wrote:Note, this is untested. Chances are it may not work, in which case the only other option is to inject an inventory item into the player that automatically changes its own amount with DoEffect()'s override (performing the LocateWeapon function as needed), grab the amount and go from there. That can be given on WorldSpawned event.
Sun May 28, 2017 2:03 pm
Blue Shadow wrote:I thought we are past the inventory hacks... If this is the only solution, then I might as well stick with the ACS-SBARINFO-DECORATE combo.
Sun May 28, 2017 4:49 pm
Mon Jun 12, 2017 3:27 pm
Wed Jul 26, 2017 5:55 pm
Wed Aug 09, 2017 6:02 pm
Fri Aug 11, 2017 8:42 pm
Fri Aug 11, 2017 9:52 pm
Vaecrius wrote:I found it easier to just recreate everything from scratch without any consideration for preserving the original aesthetic (though keeping most elements generally in more or less the same place), but I was already working with ZScript for a few months by then and was already a lot more comfortable with writing ZScript than even reading SBARINFO.