@@ -23,6 +23,7 @@ namespace GUI {
2323 void drawRotationalVelocity ();
2424 void drawIGT ();
2525 void drawRoomTime ();
26+ void drawLoads ();
2627
2728 void drawMonitorWindow (CFinalInput *inputs) {
2829 if (!SETTINGS.OSD_show ) {
@@ -68,14 +69,67 @@ namespace GUI {
6869 ImGui::End ();
6970 }
7071
72+ if (SETTINGS.OSD_showLoads ) {
73+ drawLoads ();
74+ }
75+
7176 if (SETTINGS.OSD_showInput ) {
7277 drawInput (inputs);
7378 }
7479 }
7580
81+ void drawLoads () {
82+ CGameGlobalObjects *globals = ((CGameGlobalObjects *) 0x80457798 );
83+ CResFactory *resFactory = globals->getResFactory ();
84+ auto list = resFactory->getLoadList ();
85+
86+ u32 count = list->size ;
87+ if (count > 0 ) {
88+ // actually draw
89+ ImGui::SetNextWindowPos (ImVec2 (10 , 450 ), ImGuiCond_None, ImVec2 (0 , 1 ));
90+ ImGui::Begin (
91+ " Loads" , nullptr ,
92+ ImGuiWindowFlags_NoResize |
93+ ImGuiWindowFlags_AlwaysAutoResize |
94+ ImGuiWindowFlags_NoTitleBar |
95+ ImGuiWindowFlags_NoInputs |
96+ ImGuiWindowFlags_NoNavInputs |
97+ ImGuiWindowFlags_NoNavFocus |
98+ ImGuiWindowFlags_NoNav |
99+ ImGuiWindowFlags_NoFocusOnAppearing |
100+ ImGuiWindowFlags_NoMove |
101+ ImGuiWindowFlags_NoDecoration |
102+ // ImGuiWindowFlags_NoBackground |
103+ ImGuiFocusedFlags_None // just for conveneint commenting in/out
104+ );
105+
106+ char sObjTagBuff [14 ];
107+
108+ int shown = 0 ;
109+ auto end = list->end ;
110+ auto current = list->first ;
111+
112+ u32 totalSize = 0 ;
113+ while (end != current) {
114+ u32 size = current->item .getResLen ();
115+ totalSize += size;
116+ if (shown < 5 ) {
117+ current->item .getTag ()->writeToString (sObjTagBuff );
118+ ImGui::Text (" %s %d" , sObjTagBuff , size);
119+ shown++;
120+ }
121+ current = current->next ;
122+ }
123+ ImGui::Text (" %d/%dkb left" , count, totalSize / 1024 );
124+
125+ ImGui::End ();
126+ }
127+
128+ }
129+
76130 void drawIGT () {
77131 CGameGlobalObjects *globals = ((CGameGlobalObjects *) 0x80457798 );
78- CGameState *gameState = globals->x134_gameState ;
132+ CGameState *gameState = globals->getGameState () ;
79133 if (gameState) {
80134 double time = gameState->PlayTime ();
81135 int ms = (int ) (time * 1000.0 ) % 1000 ;
@@ -92,7 +146,7 @@ namespace GUI {
92146
93147 void drawRoomTime () {
94148 CGameGlobalObjects *globals = ((CGameGlobalObjects *) 0x80457798 );
95- CGameState *gameState = globals->x134_gameState ;
149+ CGameState *gameState = globals->getGameState () ;
96150 CStateManager *stateManager = ((CStateManager *) 0x8045A1A8 );
97151 const CWorld *world = stateManager->GetWorld ();
98152
0 commit comments