FOnline Development > Questions and Answers
[Intrface]
VVish:
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:
--- Code: -------
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 );
}
}
---
--- End code ---
Screenshot of #1:
-- https://i.imgur.com/spbO0LK.png
Screenshot of #2:
-- https://i.imgur.com/oYWfCbu.png
-- https://i.imgur.com/LnSZewc.jpg
UPD. 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.png
In client_gui.fos.
Wipe:
--- Quote from: VVish on February 12, 2018, 03:13:27 pm ---That won't solvethe problem, since you can always get some messages to the chat window while playing
--- End quote ---
Wrong.
Messages crated during registration are very specific and very few - and if you check link in my previous post, you'll see they all come from single function. Function which checks if character is properly set; called before sending new char to server and not used for anything else. If something is wrong - and only then - message is added. Client doesn't and shouldn't ever verify character once it's created, as it would end in mountain of corrections. Just think about classic radiation penalties for a second.
--- Quote from: VVish on February 12, 2018, 03:13:27 pm ---log messages will remain in the same position, obscuring user's vision
--- End quote ---
Then attach you custom area for DrawText(). I believe every server have a way to add scripted controls to hardcoded screens, even if their devs don't know that :P If you need inspiration, turn on 2238 and check "ONLINE" button on character screen. Go on, touch it! It's a simple control (IControl@, to be precise) attached to char screen. Screen closes, button disappears. And you can go exactly same route with custom log area. Registration screen closes, custom log disappears. You don't have to worry about it as handling child controls is part of gui code already. All you have to do is attach your control and that's it. Maybe add clearing your log area if in_message() receives "Registration success".
At least that what i would do.
VVish:
--- Quote ---Wrong.
--- End quote ---
Maybe I was wrong at describing the case of why the proposed method won't solve the problem.
Yeah, indeed, messages during server connect and registration can be easily moved elsewhere, but this:
https://i.imgur.com/JEInK31.png
you kinda can't simply DrawText() elsewhere as single entity without making custom log aren to display messages to client.
--- Quote ---I believe every server have a way to add scripted controls to hardcoded screens, even if their devs don't know that
--- End quote ---
Yep, that's what I'm digging now according to client_gui.fos.
--- Quote ---All you have to do is attach your control and that's it. Maybe add clearing your log area if in_message() receives "Registration success".
--- End quote ---
Now that sounds interesting, I'll be definitely checking this one later. Thanks a lot.
Wipe:
--- Quote from: VVish on February 12, 2018, 07:33:22 pm ---https://i.imgur.com/JEInK31.png
--- End quote ---
Hmm. How about adding bunch of empty Message()s when registration screen is open? ;D
That would finally create illusion that hardcoded log area doesn't exists at all. And then you use custom log area for any registration errors - just to not ruin that illusion; as a bonus, you have now full control about log position and size.
VVish:
God bless empty Message()!
My thanks.
Navigation
[0] Message Index
[*] Previous page
Go to full version