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

Method ExecuteLayoutString

client/src/main/java/jake2/client/SCR.java:868–1125  ·  view source on GitHub ↗
(String s)

Source from the content-addressed store, hash-verified

866 * ================
867 */
868 private static void ExecuteLayoutString(String s) {
869
870 if (cls.state != ca_active || !ClientGlobals.cl.refresh_prepped)
871 return;
872
873 if (s == null || s.length() == 0)
874 return;
875
876 int x = 0;
877 int y = 0;
878 int width = 3;
879 int value;
880
881 LayoutParser parser = layoutParser;
882 parser.init(s);
883
884 while (parser.hasNext()) {
885 parser.next();
886 if (parser.tokenEquals("xl")) {
887 parser.next();
888 x = parser.tokenAsInt();
889 continue;
890 }
891 if (parser.tokenEquals("xr")) {
892 parser.next();
893 x = ClientGlobals.viddef.getWidth() + parser.tokenAsInt();
894 continue;
895 }
896 if (parser.tokenEquals("xv")) {
897 parser.next();
898 x = ClientGlobals.viddef.getWidth() / 2 - 160 + parser.tokenAsInt();
899 continue;
900 }
901
902 if (parser.tokenEquals("yt")) {
903 parser.next();
904 y = parser.tokenAsInt();
905 continue;
906 }
907 if (parser.tokenEquals("yb")) {
908 parser.next();
909 y = ClientGlobals.viddef.getHeight() + parser.tokenAsInt();
910 continue;
911 }
912 if (parser.tokenEquals("yv")) {
913 parser.next();
914 y = ClientGlobals.viddef.getHeight() / 2 - 120 + parser.tokenAsInt();
915 continue;
916 }
917
918 if (parser.tokenEquals("pic")) { // draw a pic from a stat number
919 parser.next();
920 value = ClientGlobals.cl.frame.playerstate.stats[parser.tokenAsInt()];
921 if (value >= MAX_IMAGES)
922 Com.Error(ERR_DROP, "Pic >= MAX_IMAGES");
923 if (ClientGlobals.cl.configstrings[CS_IMAGES + value] != null) {
924 AddDirtyPoint(x, y);
925 AddDirtyPoint(x + 23, y + 23);

Callers 2

DrawStatsMethod · 0.95
DrawLayoutMethod · 0.95

Calls 15

initMethod · 0.95
hasNextMethod · 0.95
nextMethod · 0.95
tokenEqualsMethod · 0.95
tokenAsIntMethod · 0.95
ErrorMethod · 0.95
AddDirtyPointMethod · 0.95
DrawAltStringMethod · 0.95
DrawStringMethod · 0.95
sprintfMethod · 0.95
tokenMethod · 0.95
DrawFieldMethod · 0.95

Tested by

no test coverage detected