That won't solvethe problem, since you can always get some messages to the chat window while playing, like
- You see nothing extraordinary.
and then - press ESC and go to registration screen, so the log messages will remain in the same position, obscuring user's vision.
For what you propose to work you'll need to
DrawText() of basically anything in the game, which makes this solution only working if client turns on the the game for the first time.
Either that or you just redo the whole Chat section, removing MessageBox completely.
I found another two possible solutions myself without big hardships, though.
#1.
If you want to see the background image, you're fine as long as you keep the positioning of the character registration window in topleft corner. You won't get it centered, still it'll look okay.
That will require changing coordinates of all
Cha and
Reg strings in
default.ini, as well as changing the
character.png picture, since changes for reg window are tied to character window.
#2. (ain't even working one cuz I'm coding amateur)
This will force you to get creative to keep the centered positioning of Register and Character screens.
You can add special client registration button inside the Registration window to add a background image. It will probably look smth like this:
----
import int[]@ GetIniValues4(string& iniKey, int[]@ defaultValues) from "ini_parser"; // so you'll be able to position your button via adding string in default.ini
---
void InitBackgroundButton()
{
GUI_AddScreenElement( CLIENT_SCREEN_INDEX, "regbackground.png", 0, 0 ) // instead of CLINET_SCREEN_INDEX appropriative name must be taken, in our case that must be CLIENT_MAIN_SCREEN_REGISTRATION
.Position( "RegBackground" ); //string name for default.ini, from where coordinates will be taken
RegSwitchButton0 regswitchButton0;
GUI_AddScreenElement( CLIENT_SCREEN_INDEX, "regswitchbutton.png", 0, 0 )
.Position( "RegSwitchButton0" )
.CallbackMouseClick( regswitchButton0)
.DownPic( "regswitchbutton_dn.png" );
}
---
class RegSwitchButton0 : IGUIElementCallbackMouseClick
{
void OnMouseClick( int click )
{
::HideScreen( CLIENT_SCREEN_INDEX, 0, 0, 0 );
::DrawHardcodedScreen( CLIENT_SCREEN_INDEX );
::ShowScreen( CLIENT_SCREEN_INDEX, 0, 0, 0 );
}
}
---
Screenshot of #1:
--
https://i.imgur.com/spbO0LK.pngScreenshot of #2:
--
https://i.imgur.com/oYWfCbu.png--
https://i.imgur.com/LnSZewc.jpgUPD. While digging in the second method, I actually found that it can be smth even easier, though didn't test it.
Basically, this -
https://i.imgur.com/tYzGECo.pngIn
client_gui.fos.