Support for Nested combat messages and JSPatch Notify from files #2

Merged
xeon merged 10 commits from nested-msgs into master 2024-09-14 09:05:18 +00:00
2 changed files with 15 additions and 0 deletions
Showing only changes of commit bea9c0e9e4 - Show all commits

View file

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