MCPcopy Create free account
hub / github.com/demoth/jake2 / DrawField

Method DrawField

client/src/main/java/jake2/client/SCR.java:800–834  ·  view source on GitHub ↗
(int x, int y, int color, int width, int value)

Source from the content-addressed store, hash-verified

798 * ============== SCR_DrawField ==============
799 */
800 private static void DrawField(int x, int y, int color, int width, int value) {
801 char ptr;
802 String num;
803 int l;
804 int frame;
805
806 if (width < 1)
807 return;
808
809 // draw number string
810 if (width > 5)
811 width = 5;
812
813 AddDirtyPoint(x, y);
814 AddDirtyPoint(x + width * CHAR_WIDTH + 2, y + 23);
815
816 num = String.valueOf(value);
817 l = num.length();
818 if (l > width)
819 l = width;
820 x += 2 + CHAR_WIDTH * (width - l);
821
822 ptr = num.charAt(0);
823
824 for (int i = 0; i < l; i++) {
825 ptr = num.charAt(i);
826 if (ptr == '-')
827 frame = STAT_MINUS;
828 else
829 frame = ptr - '0';
830
831 ClientGlobals.re.DrawPic(x, y, sb_nums[color][frame]);
832 x += CHAR_WIDTH;
833 }
834 }
835
836 /*
837 * =============== SCR_TouchPics

Callers 1

ExecuteLayoutStringMethod · 0.95

Calls 2

AddDirtyPointMethod · 0.95
DrawPicMethod · 0.65

Tested by

no test coverage detected