1010
1111#include " ../PSO2CameraTool.hpp"
1212
13-
1413typedef HRESULT (__stdcall* pso2hDoLua)(const char * a1);
1514static pso2hDoLua _executeLua = 0 ;
1615
@@ -76,13 +75,13 @@ static void draw_menu(bool* status)
7675 ImGui::GetIO ().MouseDrawCursor = true ;
7776
7877 ImGui::SetNextWindowPos (ImVec2 (ImGui::GetWindowSize ().x / 2 , ImGui::GetWindowSize ().y / 2 ), ImGuiCond_Appearing);
79- ImGui::SetNextWindowSize (ImVec2 (480 .0f , 245 .f ), ImGuiCond_Appearing);
78+ ImGui::SetNextWindowSize (ImVec2 (480 .0f , 200 .f ), ImGuiCond_Appearing);
8079
8180 ImGuiWindowFlags window_flags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoScrollbar;
8281
8382 ImGui::Begin (" PIG PSO2" , status, window_flags);
8483
85-
84+
8685 switch (currTab) {
8786 case 0 :
8887 {
@@ -93,10 +92,10 @@ static void draw_menu(bool* status)
9392
9493 ImGui::Text ((" Zoom " ));
9594 ImGui::SameLine (50.0 , ImGui::GetStyle ().ItemSpacing .y );
96- ImGui::SliderInt ((" ##zoomslider" ), &Camera::cameraBase.Offset .Dist , 6 , 14 );
95+ ImGui::SliderInt ((" ##zoomslider" ), &Camera::cameraBase.Offset .Dist , 6 , 25 );
9796 ImGui::Text ((" Fovy " ));
9897 ImGui::SameLine (50.0 , ImGui::GetStyle ().ItemSpacing .y );
99- ImGui::SliderInt ((" ##fovslider" ), &Camera::cameraBase.Fovy , 40 , 58 );
98+ ImGui::SliderInt ((" ##fovslider" ), &Camera::cameraBase.Fovy , 40 , 90 );
10099
101100 ImGui::NextColumn ();
102101 if (ImGui::Button (" Set Zoom" , ImVec2 (ImGui::GetContentRegionAvail ().x , 0 ))) {
@@ -111,11 +110,7 @@ static void draw_menu(bool* status)
111110 ImGui::Separator ();
112111
113112 ImGui::Columns (2 );
114- ImGui::Text (" Disable Terrain Far Culling " );
115- ImGui::Spacing ();// meme alignment
116- ImGui::Text (" Disable Object Far Culling " );
117- ImGui::Spacing ();
118- ImGui::Text (" Disable Object Near Culling " );
113+ ImGui::Text (" Culling Patches" );
119114 ImGui::Spacing ();
120115 ImGui::Spacing ();
121116
@@ -124,7 +119,7 @@ static void draw_menu(bool* status)
124119 ImGui::InputText (" ##BGM" , bgmbuf, sizeof (bgmbuf));
125120
126121 ImGui::NextColumn ();
127- if (ImGui::Checkbox (" ##farcullcheck " , &farCullDisabled))
122+ if (ImGui::Checkbox (" ##cullcheck " , &farCullDisabled))
128123 {
129124 BYTE b = 0x76 ; // original conditional jmp byte
130125 if (farCullDisabled)
@@ -133,39 +128,37 @@ static void draw_menu(bool* status)
133128 uintptr_t tFarCull = getTerrainFarCullAddy ();
134129 if (tFarCull)
135130 *(BYTE*)(tFarCull) = b;
136- }
137-
138- if (ImGui::Checkbox (" ##farcullcheckobjects" , &farCullObjectsDisabled))
139- {
140- uintptr_t tFarCull = getObjectFarCullAddy ();
141- if (tFarCull)
131+
132+ // if (ImGui::Checkbox("##farcullcheckobjects", &farCullObjectsDisabled))
133+
134+ uintptr_t tFarCullObj = getObjectFarCullAddy ();
135+ if (tFarCullObj)
142136 {
143- BYTE b = 0x0F ;
144- if (farCullObjectsDisabled)
137+ BYTE c = 0x0F ;
138+ if (farCullDisabled)
145139 {
146- b = 0xE9 ;
140+ c = 0xE9 ;
147141
148- *(BYTE*)(tFarCull ) = 0x90 ;
149- *(BYTE*)(tFarCull+ 1 ) = b ;
142+ *(BYTE*)(tFarCullObj ) = 0x90 ;
143+ *(BYTE*)(tFarCullObj + 1 ) = c ;
150144 }
151145 else
152146 {
153- *(BYTE*)(tFarCull ) = b;
154- *(BYTE*)(tFarCull + 1 ) = 0x84 ;
147+ *(BYTE*)(tFarCullObj ) = b;
148+ *(BYTE*)(tFarCullObj + 1 ) = 0x84 ;
155149 }
156150 }
157- }
158151
159- if (ImGui::Checkbox (" ##nearcullcheck" , &nearCullDisabled))
160- {
152+ // if (ImGui::Checkbox("##nearcullcheck", &nearCullDisabled))
153+
161154 uintptr_t tNearCull = getCameraNearCullAddy ();
162155 if (tNearCull) {
163-
156+
164157 if (oNearCullBytes == 0x0 )
165158 oNearCullBytes = *(DWORD*)(tNearCull);
166159
167160 // meme
168- if (nearCullDisabled )
161+ if (farCullDisabled )
169162 *(DWORD*)(tNearCull) = (DWORD)(0x90909090 );
170163 else
171164 *(DWORD*)(tNearCull) = (DWORD)(oNearCullBytes);
@@ -176,6 +169,11 @@ static void draw_menu(bool* status)
176169 std::string s (" Skit.Sound.BGM.Play('" +std::string (bgmbuf)+" ')" );
177170 runLuaAsync (s);
178171 }
172+ ImGui::SetCursorPosY (ImGui::GetCursorPosY () + 5 );
173+ if (ImGui::Button (" Get BGM" , ImVec2 (ImGui::GetContentRegionAvail ().x , 0 ))) {
174+ std::string s (" Window.ShowError(Skit.Sound.BGM.Get('" + std::string (bgmbuf) + " '))" );
175+ runLuaAsync (s);
176+ }
179177 ImGui::EndColumns ();
180178
181179
@@ -187,7 +185,7 @@ static void draw_menu(bool* status)
187185
188186 std::string pig (" pig" );
189187 ImVec2 txt = ImGui::CalcTextSize (pig.c_str ());
190- ImGui::SetCursorPosY (ImGui::GetWindowSize ().y * .90f );
188+ ImGui::SetCursorPosY (ImGui::GetWindowSize ().y * .87f );
191189 // ImGui::SetCursorPosY(ImGui::GetContentRegionAvail().y * 0.94f);
192190 ImGui::Separator ();
193191
0 commit comments