-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
0x19 MessageBox #15
Comments
Great! |
Can you check if you can see the Caption field in WC3 and D2. I don't believe that SC supports the Caption field considering that there's no space for it |
In regards to the 0x19 SID_MESSAGEBOX packet, I believe I can be of some help here. It is indeed true that the packet structure mimics that of the WinAPI MessageBox (http://msdn.microsoft.com/en-us/library/windows/desktop/ms645505(v=vs.85).aspx) and therefore can be passed directly to it. The way Starcraft works, at least as far as I remember, is it will pass the packet directly to the WinAPI MessageBox function. It will then catch any MessageBox message sent in the message queue (read: http://msdn.microsoft.com/en-us/library/windows/desktop/ms632590(v=vs.85).aspx) and pass it to its own handler. Its handler will present that modal that @HarpyWar talked about. However, in catching this MessageBox message itself rather than letting Windows handle it, it also means it's responsible for what gets displayed to the user and how. One of the things that it ignores is that Caption field, and it won't relay button clicks back to Battle.net either. If I still remember correctly, Battle.net will simply send Also, windowed mode was never official from Blizzard, so it's likely that the windowed mode hack you're using isn't handling native Windows modal dialogs properly (that is what it is after all, just with a different user design). Here's some more reading on the |
Ok the code is ready to be committed now |
I have an idea, maybe wrap this messagebox code inside a function, something like |
@Jailout2000, thanks for the research. It appears that all other games have a similar messagebox implementation - there is also no caption. @xboi209, I will add your code soon, after merge with a code from another branch. Now it is not very convenient to switch between branches for me. |
It works fine in Starcraft, Diablo 1, Warcraft 2. But it doesn't work in Warcraft 3 and Diablo 2 :(. |
I have done a lot of testing and have found next patterns for message box.
|
Nice job, earlier I expected text to just cut off if there were too many. |
what is the program used by HarpyWar in this SS ? |
StarCraft: Brood War |
|
Successful implementation of packet 0x19 for MessageBox
In
bn_int_set(&rpacket->u.server_messagebox.style, SERVER_MESSAGEBOX_OK);
SERVER_MESSAGEBOX_OK
creates anOk
button whileSERVER_MESSAGEBOX_OK_CANCEL
creates anOk
andCancel
button for the client.There is no purpose in having both
Ok
andCancel
buttons because the server will not know which button the user has pressed(and from my testing, you can ignore the messagebox and click other buttons such asJoin
andCreate
) so I've hardcodedSERVER_MESSAGEBOX_OK
as the value.The text was updated successfully, but these errors were encountered: