@@ -102,6 +102,30 @@ public final class GameStatsHack extends Hack implements PacketInputListener,
102102 private final CheckboxSetting showAverages =
103103 new CheckboxSetting ("Show Averages" , true );
104104
105+ private final CheckboxSetting showGraph =
106+ new CheckboxSetting ("Show graph" , false );
107+
108+ private final CheckboxSetting separateGraphWindow =
109+ new CheckboxSetting ("Separate graph window" , false );
110+
111+ private final ColorSetting fpsGraphColor =
112+ new ColorSetting ("FPS graph color" , new Color (0x53 , 0xC7 , 0xFF , 0xFF ));
113+
114+ private final ColorSetting tpsGraphColor =
115+ new ColorSetting ("TPS graph color" , new Color (0xFF , 0xB3 , 0x47 , 0xFF ));
116+
117+ private final SliderSetting graphWindowWidth = new SliderSetting (
118+ "Graph width" , 220 , 120 , 1000 , 1 , ValueDisplay .INTEGER );
119+
120+ private final SliderSetting graphWindowHeight = new SliderSetting (
121+ "Graph height" , 120 , 70 , 800 , 1 , ValueDisplay .INTEGER );
122+
123+ private final SliderSetting graphWindowOffsetX = new SliderSetting (
124+ "Graph X offset" , 180 , -2000 , 2000 , 1 , ValueDisplay .INTEGER );
125+
126+ private final SliderSetting graphWindowOffsetY = new SliderSetting (
127+ "Graph Y offset" , 0 , -2000 , 2000 , 1 , ValueDisplay .INTEGER );
128+
105129 private final ArrayDeque <Long > incomingPacketTimes = new ArrayDeque <>();
106130 private final ArrayDeque <Long > outgoingPacketTimes = new ArrayDeque <>();
107131 private final Object packetTimesLock = new Object ();
@@ -135,6 +159,14 @@ public GameStatsHack()
135159 addSetting (hudOffsetY );
136160 addSetting (showPrefixes );
137161 addSetting (showAverages );
162+ addSetting (showGraph );
163+ addSetting (separateGraphWindow );
164+ addSetting (fpsGraphColor );
165+ addSetting (tpsGraphColor );
166+ addSetting (graphWindowWidth );
167+ addSetting (graphWindowHeight );
168+ addSetting (graphWindowOffsetX );
169+ addSetting (graphWindowOffsetY );
138170 }
139171
140172 @ Override
@@ -343,6 +375,98 @@ public boolean showAverages()
343375 return showAverages .isChecked ();
344376 }
345377
378+ public boolean showGraph ()
379+ {
380+ return showGraph .isChecked ();
381+ }
382+
383+ public boolean separateGraphWindow ()
384+ {
385+ return separateGraphWindow .isChecked ();
386+ }
387+
388+ public int getFpsGraphColorI ()
389+ {
390+ return fpsGraphColor .getColorI ();
391+ }
392+
393+ public int getTpsGraphColorI ()
394+ {
395+ return tpsGraphColor .getColorI ();
396+ }
397+
398+ public int getGraphWindowWidth ()
399+ {
400+ return graphWindowWidth .getValueI ();
401+ }
402+
403+ public int getGraphWindowHeight ()
404+ {
405+ return graphWindowHeight .getValueI ();
406+ }
407+
408+ public int getGraphWindowOffsetX ()
409+ {
410+ return graphWindowOffsetX .getValueI ();
411+ }
412+
413+ public int getGraphWindowOffsetY ()
414+ {
415+ return graphWindowOffsetY .getValueI ();
416+ }
417+
418+ public int getGraphWindowMinWidth ()
419+ {
420+ return (int )graphWindowWidth .getMinimum ();
421+ }
422+
423+ public int getGraphWindowMaxWidth ()
424+ {
425+ return (int )graphWindowWidth .getMaximum ();
426+ }
427+
428+ public int getGraphWindowMinHeight ()
429+ {
430+ return (int )graphWindowHeight .getMinimum ();
431+ }
432+
433+ public int getGraphWindowMaxHeight ()
434+ {
435+ return (int )graphWindowHeight .getMaximum ();
436+ }
437+
438+ public int getGraphWindowMinOffsetX ()
439+ {
440+ return (int )graphWindowOffsetX .getMinimum ();
441+ }
442+
443+ public int getGraphWindowMaxOffsetX ()
444+ {
445+ return (int )graphWindowOffsetX .getMaximum ();
446+ }
447+
448+ public int getGraphWindowMinOffsetY ()
449+ {
450+ return (int )graphWindowOffsetY .getMinimum ();
451+ }
452+
453+ public int getGraphWindowMaxOffsetY ()
454+ {
455+ return (int )graphWindowOffsetY .getMaximum ();
456+ }
457+
458+ public void setGraphWindowOffsets (int x , int y )
459+ {
460+ graphWindowOffsetX .setValue (x );
461+ graphWindowOffsetY .setValue (y );
462+ }
463+
464+ public void setGraphWindowSize (int width , int height )
465+ {
466+ graphWindowWidth .setValue (width );
467+ graphWindowHeight .setValue (height );
468+ }
469+
346470 public int getHudOffsetX ()
347471 {
348472 return hudOffsetX .getValueI ();
0 commit comments