Closed ihsinme closed 3 years ago
you cant simply add a case 5:
because the if (width > 5)
is for values 6, 7, 8, etc... not for 5.
also the switch
case is to set the limits of value
based on current width
. the if (width > 5)
is to set the limit for width
, same with the if (width < 1)
that is on top, both are to set the limits of width
before enter the the switch
case, then the switch
case perform other actions based on width
.
good day.
thanks for the answer.
it clarifies the meaning a little.
but if if (width < 1)
then processing does not go further. but if if (width > 5)
, then the processing is going on but no restrictions are set on value
.
it looks strange.
the restrictions for value
are inside each case
in the switch
using ternary operators like value = value > x ? x : value
absolutely right.
but there is no limit for case width >= 5
. since there is no such сase
.
thats because the value
just need to be adjusted only if the width
is less than 5, so if width
is 5 thats enough to show the amount of numbers in value
.
for example if the width
is 3, and the value
is 5230, this contains more than 3 digits, so the switch
case proceed to limit the digits only to 3 numbers, replacing it the value
with 999 to not overflow the number container on the user interface.
thanks for your time.
good day. if the extreme size is 5. why is it not in the
switch
processing.you don't think you need to either limit yourself to 4 or add a
case
block for 5https://github.com/TriForceX/JediKnightPlus/blob/caa3a5df01b0fb347a9ab2c18ca634972a740174/code/cgame/cg_drawtools.c#L503