From bea9c0e9e43d9140427d0d265ced7b719c205299 Mon Sep 17 00:00:00 2001 From: xavo95 Date: Fri, 13 Sep 2024 12:01:15 +0200 Subject: [PATCH] JSPatch Notify --- game-server/src/logic/thread_mgr.rs | 6 ++++++ game-server/uidfix.js | 9 +++++++++ 2 files changed, 15 insertions(+) create mode 100644 game-server/uidfix.js diff --git a/game-server/src/logic/thread_mgr.rs b/game-server/src/logic/thread_mgr.rs index 5b1ca87..9393c93 100644 --- a/game-server/src/logic/thread_mgr.rs +++ b/game-server/src/logic/thread_mgr.rs @@ -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()); diff --git a/game-server/uidfix.js b/game-server/uidfix.js new file mode 100644 index 0000000..48d15c0 --- /dev/null +++ b/game-server/uidfix.js @@ -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); \ No newline at end of file