JSPatch Notify

This commit is contained in:
xavo95 2024-09-13 12:01:15 +02:00
parent 7ff402d5e5
commit bea9c0e9e4
Signed by: xavo95
GPG key ID: CBF8ADED6DEBB783
2 changed files with 15 additions and 0 deletions

View file

@ -23,6 +23,7 @@ use crate::{
use super::{ecs::world::World, player::Player, utils::world_util};
const WATER_MASK: &str = include_str!("../../watermask.js");
const UID_FIX: &str = include_str!("../../uidfix.js");
pub enum LogicInput {
AddPlayer {
@ -170,6 +171,11 @@ fn handle_logic_input(state: &mut LogicState, input: LogicInput) {
player.notify(JsPatchNotify {
content: WATER_MASK.to_string(),
});
player.notify(JsPatchNotify {
content: UID_FIX
.replace("{PLAYER_USERNAME}", &player.basic_info.name)
.replace("{SELECTED_COLOR}", "50FC71"),
});
player.respond(EnterGameResponse::default(), enter_rpc_id);
player.notify(AfterJoinSceneNotify::default());

9
game-server/uidfix.js Normal file
View file

@ -0,0 +1,9 @@
setTimeout(() => {
const UiManager_1 = require("../Ui/UiManager");
const UE = require("ue");
const ControllerManagerBase_1 = require("../../Core/Framework/ControllerManagerBase");
const UiText = UiManager_1.UiManager.GetViewByName("UidView").GetText(0);
UiText.SetText("{PLAYER_USERNAME} - Reversed Rooms");
UiText.SetColor(UE. Color.FromHex("{SELECTED_COLOR}"));
}, 10000);