henpemaz / Rain-Meadow

Rain World multiplayer engine and custom game mode
134 stars 19 forks source link

Story: Prototype username displays in-game #63

Closed 6fears7 closed 8 months ago

6fears7 commented 9 months ago

Steam allows up to 32 characters, which can be a lot on screen.

One example, perhaps could be toggleable:

image

Perhaps if someone hits tab, we could show this: image

6fears7 commented 9 months ago

Working on adding a hook into the OptionsMenu. May need to do IL

6fears7 commented 9 months ago

Instead of hooking IL original menu, just created the Remix options menu for Rain Meadow to add a bind key.

image

Next steps:

  1. Determine what layer the username display needs to occur in

  2. Grab every player's current position

  3. Create some kind of object that can act as a container for the username text

  4. If specific key is pressed, draw the usernames on screen above all player heads only for the player who asked. No network syncing.

  5. Update the drawn username over each player as they are moving.

  6. The username color should be the same as that player's body color.

  7. Delete the username text if key is pressed again.

6fears7 commented 9 months ago

After hating myself for a bit, I see two paths forward:

  1. Make a custom HUD component, hook into main HUD to add it in

  2. Hook Jolly's HUD arrow and do some dirty work

TBD

6fears7 commented 9 months ago

Definitely not going to hook anything with Jolly. There's too many side effects (like camera hijacking), so I'll just hook the InitSinglePlayerHud setup with a new HUD part to add that uses the code from Jolly without the same exact logic

6fears7 commented 9 months ago

image

On holding food button currently, brings up the playerIcon and username display

TODO:

6fears7 commented 9 months ago

image

Nearly to something workable. A few oddities:

The expectation is that Player 2 clicks food button (or whatever button I choose) and then views all players, but DOES NOT draw that data on-screen to the other players.

6fears7 commented 9 months ago

image

Ok, found the section that lets me update when other players join. My most recent commit now adds the username to the second player.

At this point, I'm convinced that OnlineManager.players.isMe is being shunted to the front of the list which is causing some of the issues.

6fears7 commented 8 months ago

image

Boom, baby.

TODO: