Author Topic: [Intrface]  (Read 4583 times)

[Intrface]
« on: February 11, 2018, 12:28:53 am »
Small question - anyone knows the string for this log messagebox in client registration window?
[I point an arrow with mouse to the thing in question]
https://i.imgur.com/HjtkiNe.png

Couldn't find it in default.ini, checked other servers - options is missing as well.
« Last Edit: February 11, 2018, 03:05:26 am by VVish »

Offline Ghosthack

  • Rotator
  • Bytecruncher

Re: [Intrface]
« Reply #2 on: February 11, 2018, 02:53:02 am »
Eh, I meant this lines:

https://i.imgur.com/fsOGWMj.png

from
Code: [Select]
default.ini, which affects the chat window.
I'm afraid that it's hardcoded, just want someone to confirm my suspicions.
« Last Edit: February 11, 2018, 03:00:58 am by VVish »

Offline Ghosthack

  • Rotator
  • Bytecruncher
Re: [Intrface]
« Reply #3 on: February 11, 2018, 03:13:25 am »
Eh, I meant this lines:

https://i.imgur.com/fsOGWMj.png

from
Code: [Select]
default.ini, which affects the chat window.
I'm afraid that it's hardcoded, just want someone to confirm my suspicions.

Oh, ok, my bad. Yes, probably, but I'll defer this question... Lexx or Wipe might know.

Offline Wipe

  • Rotator
  • Random is god
Re: [Intrface]
« Reply #4 on: February 12, 2018, 05:31:44 am »
I'm afraid that it's hardcoded, just want someone to confirm my suspicions.
It was eons ago, buuut... i think there was some trick to change spambox position during registration, but it affected regular interface in a bad way, making whole thing pointless.

Thinking about that now, what you could do is to use custom error reporting, which uses DrawText() at specific position, instead of usual Message() which puts things into spambox. This can end with quite a work in the end for such small detail, but at least you don't have to stick with defaults.
Games are meant to be created, not played...

Re: [Intrface]
« Reply #5 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, 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: [Select]
----
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.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.
« Last Edit: February 12, 2018, 04:10:15 pm by VVish »

Offline Wipe

  • Rotator
  • Random is god
Re: [Intrface]
« Reply #6 on: February 12, 2018, 06:33:45 pm »
That won't solvethe problem, since you can always get some messages to the chat window while playing
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.

log messages will remain in the same position, obscuring user's vision
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.
Games are meant to be created, not played...

Re: [Intrface]
« Reply #7 on: February 12, 2018, 07:33:22 pm »
Quote
Wrong.
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
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".
Now that sounds interesting, I'll be definitely checking this one later. Thanks a lot.

Offline Wipe

  • Rotator
  • Random is god
Re: [Intrface]
« Reply #8 on: February 13, 2018, 05:22:26 am »
https://i.imgur.com/JEInK31.png
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.
« Last Edit: February 13, 2018, 05:25:19 am by Wipe »
Games are meant to be created, not played...

Re: [Intrface]
« Reply #9 on: February 14, 2018, 06:39:28 pm »
God bless empty Message()!

My thanks.