Staredit Network > Forums > Modding Assistance > Topic: Remove slide-in animation of menu windows
Remove slide-in animation of menu windows
Oct 3 2023, 10:41 am
By: Netbek  

Oct 3 2023, 10:41 am Netbek Post #1



Hello.
In the main menu clicking Singleplayer and then Broodwar or Original will bring you to a submenu. This submenu will not let you click buttons instantly. You have to wait a short moment until the menu's windows have finished sliding in from the sides.
I want the windows to instantly be in their end position, no sliding-in at all.
IMAGE




Oct 8 2023, 8:50 am Heinermann Post #2

SDE, BWAPI owner, hacker.

These were hardcoded as structures in the exe for 1.16.1, I don't know if it's changed for remastered. BWAPI overwrites these for 1.16.1 here offsets here.

For remastered maybe someone else knows more.




Oct 9 2023, 8:51 am Netbek Post #3



Quote from Heinermann
BWAPI

I never used BWAPI. I only use GPTP.
Can I somehow carry over that code into GPTP?
And how? Can you talk me through this like I'm an idiot? I only partially understand .cpp, never properly learned it, only used it in the context of GPTP.




Oct 10 2023, 7:30 am Heinermann Post #4

SDE, BWAPI owner, hacker.

Yeah you can copy over the code to GPTP. You'll have to copy the offsets shown in the link from offsets.h and set the values on game start (as early as possible) as shown in the link in CodePatch.cpp.




Oct 10 2023, 2:58 pm Netbek Post #5



Ok, I downloaded BWAPI and found the 2 code snippets.
But I honestly have no idea where to put them in GPTP (I use GPTP-for-VS2019).
Or do I have to create new .cpp and .h files? I never did that. Only modified what was there. Have no idea how to set which one fires when.

Post has been edited 1 time(s), last time on Oct 10 2023, 3:12 pm by Netbek.




Oct 13 2023, 8:07 am Heinermann Post #6

SDE, BWAPI owner, hacker.

I don't know GPTP so maybe someone who knows it will know where to put it. It only needs to run once on startup somewhere.




Oct 13 2023, 3:26 pm UndeadStar Post #7



The best place to put those would probably be initialize.cpp, it should be the right timing since it's also where the hack to make sc1 campaign playable is.

edit:
Note: as a remain of the former GPTP for VS2008, GPTP for VS2019 still avoid C++ objects in favor of C types, and don't use the for_each (that only use the keyword for and was introduced in VS2011), but that should not be a problem for an individual mod, since the compatibility is based on VS 2019.




Oct 17 2023, 7:49 pm Heinermann Post #8

SDE, BWAPI owner, hacker.

You'll have the following outside of the function:
Code
#include <array>

struct swishTimer
{
 u16 wIndex;
 u16 wType;
};

std::array<swishTimer, 43> &commonSwishControllers = *((std::array<swishTimer, 43>*)0x005129EC);
std::array<swishTimer, 5> &gluCustmSwishController = *((std::array<swishTimer, 5>*)0x0051A9F0);
std::array<swishTimer, 2> &gluCmpgnSwishController = *((std::array<swishTimer, 2>*)0x00512B10);
std::array<swishTimer, 1> &gluScoreSwishController = *((std::array<swishTimer, 1>*)0x0051A844);
std::array<swishTimer, 5> &gluChatSwishController = *((std::array<swishTimer, 5>*)0x0051A490);


And in that function,

Code
   for (auto &it : commonSwishControllers) it.wType = 4;
   for (auto &it : gluCustmSwishController) it.wType = 4;
   for (auto &it : gluCmpgnSwishController) it.wType = 4;
   for (auto &it : gluScoreSwishController) it.wType = 4;
   for (auto &it : gluChatSwishController) it.wType = 4;


Assuming you're using VS2019. We can modify it if it doesn't work.

Post has been edited 1 time(s), last time on Oct 19 2023, 6:59 am by Heinermann.




Oct 18 2023, 3:04 pm Netbek Post #9



I added the 2 code blocks into initialize.cpp.
This is what it looks like:
IMAGE 1
IMAGE 2
I hope I put them in the correct places?

BUT, as you can see there is still a problem. Apparently it's about the "BW::". I must admit that I don't know what to do.


Quote from Heinermann
[...] Assuming you're using VS2019. [...]
I do. I use GPTP 2019




Oct 18 2023, 4:48 pm UndeadStar Post #10



You can remove BW::BWDATA:: since things are declared in the file.




Oct 19 2023, 7:00 am Heinermann Post #11

SDE, BWAPI owner, hacker.

Yes I forgot to remove that, I edited my post.




Oct 23 2023, 10:21 am Netbek Post #12



Quote from UndeadStar
You can remove BW::BWDATA:: since things are declared in the file.
I tried this but apparently there still is a problem.
It says: "this range-based 'for' statement requires a suitable "begin" function and none was found"
IMAGE




Oct 23 2023, 12:09 pm UndeadStar Post #13



Urg, I'm glad I rejected advanced c++ mess.
I don't really understand what we're working with here, but I would try changing like this.
Maybe
Code
std::array<swishTimer, 43>* commonSwishControllers = (std::array<swishTimer, 43>*)0x005129EC;
std::array<swishTimer, 5>* gluCustmSwishController = (std::array<swishTimer, 5>*)0x0051A9F0;
std::array<swishTimer, 2>* gluCmpgnSwishController = (std::array<swishTimer, 2>*)0x00512B10;
std::array<swishTimer, 1>* gluScoreSwishController = (std::array<swishTimer, 1>*0x0051A844;
std::array<swishTimer, 5>* gluChatSwishController = (std::array<swishTimer, 5>*0x0051A490;

Then
Code
for (auto &it : *commonSwishControllers) it.wType = 4;
for (auto &it : *gluCustmSwishController) it.wType = 4;
for (auto &it : *gluCmpgnSwishController) it.wType = 4;
for (auto &it : *gluScoreSwishController) it.wType = 4;
for (auto &it : *gluChatSwishController) it.wType = 4;

Or maybe
Code
for (auto it : *commonSwishControllers) it.wType = 4;
for (auto it : *gluCustmSwishController) it.wType = 4;
for (auto it : *gluCmpgnSwishController) it.wType = 4;
for (auto it : *gluScoreSwishController) it.wType = 4;
for (auto it : *gluChatSwishController) it.wType = 4;

I would recommend waiting for the next answer of Heinermann though.




Nov 1 2023, 2:36 pm Netbek Post #14



Quote from UndeadStar
Then
Code
for (auto &it : *commonSwishControllers) it.wType = 4;
for (auto &it : *gluCustmSwishController) it.wType = 4;
for (auto &it : *gluCmpgnSwishController) it.wType = 4;
for (auto &it : *gluScoreSwishController) it.wType = 4;
for (auto &it : *gluChatSwishController) it.wType = 4;

Or maybe
Code
for (auto it : *commonSwishControllers) it.wType = 4;
for (auto it : *gluCustmSwishController) it.wType = 4;
for (auto it : *gluCmpgnSwishController) it.wType = 4;
for (auto it : *gluScoreSwishController) it.wType = 4;
for (auto it : *gluChatSwishController) it.wType = 4;

I did this and now it says:
"no operator "*" matches these operands. operand types are: * std::array<swishTimer, 43U>"
SEE IMAGE

I hope this can be solved here because I don't think I will have the time to further dive into C and C++.




Nov 6 2023, 10:38 pm Heinermann Post #15

SDE, BWAPI owner, hacker.

What is your definition of `commonSwishControllers` etc? Share the entire file.

Quote
Urg, I'm glad I rejected advanced c++ mess.
This is not advanced. This is very basic C++, from a decade ago.




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[12:30 am]
ClansAreForGays -- When you join a pub lobby because you see 7/8 players, but then realize host is bating you with computers. :flamer: :flamer:
[2024-10-30. : 11:48 pm]
O)FaRTy1billion[MM] -- :wob:
[2024-10-30. : 6:24 pm]
Ultraviolet -- :wob:
[2024-10-29. : 4:33 pm]
Vrael -- :wob:
[2024-10-29. : 1:32 pm]
Zoan -- :wob:
[2024-10-28. : 5:21 pm]
Ultraviolet -- :wob:
[2024-10-27. : 4:34 pm]
jjf28 -- :wob:
[2024-10-27. : 9:01 am]
Zycorax -- :wob:
[2024-10-27. : 3:31 am]
RIVE -- :wob:
[2024-10-26. : 7:12 pm]
Ultraviolet -- :wob:
Please log in to shout.


Members Online: Roy, RIVE