From 2d648d5c5276fd9fd437a4e4569b209088e849cd Mon Sep 17 00:00:00 2001 From: vE5li Date: Fri, 3 May 2024 13:45:10 +0200 Subject: [PATCH] Fix build --- .../interface/elements/containers/friends.rs | 8 +++--- .../src/interface/windows/friends/list.rs | 6 ++--- korangar/src/main.rs | 25 +++++++++++-------- korangar_networking/src/lib.rs | 2 +- 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/korangar/src/interface/elements/containers/friends.rs b/korangar/src/interface/elements/containers/friends.rs index 92d9a172..83f87685 100644 --- a/korangar/src/interface/elements/containers/friends.rs +++ b/korangar/src/interface/elements/containers/friends.rs @@ -1,21 +1,19 @@ -use std::cell::{RefCell, UnsafeCell}; +use std::cell::RefCell; use std::rc::{Rc, Weak}; -use korangar_interface::elements::{ - ButtonBuilder, ContainerState, Element, ElementCell, ElementState, ElementWrap, Expandable, Focus, WeakElementCell, -}; +use korangar_interface::elements::{ButtonBuilder, ContainerState, Element, ElementCell, ElementState, ElementWrap, Expandable, Focus}; use korangar_interface::event::{ChangeEvent, HoverInformation}; use korangar_interface::layout::PlacementResolver; use korangar_interface::size_bound; use korangar_interface::state::{PlainRemote, Remote}; use ragnarok_packets::Friend; +use crate::current_element::CurrentElement; use crate::graphics::{InterfaceRenderer, Renderer}; use crate::input::{MouseInputMode, UserEvent}; use crate::interface::application::InterfaceSettings; use crate::interface::layout::{ScreenClip, ScreenPosition, ScreenSize}; use crate::interface::theme::InterfaceTheme; -use crate::packet_recorder::CurrentElement; pub struct FriendView { friends: PlainRemote>, diff --git a/korangar/src/interface/windows/friends/list.rs b/korangar/src/interface/windows/friends/list.rs index 63318091..d9c58a89 100644 --- a/korangar/src/interface/windows/friends/list.rs +++ b/korangar/src/interface/windows/friends/list.rs @@ -1,19 +1,17 @@ -use std::cell::UnsafeCell; - use derive_new::new; -use korangar_interface::elements::{ButtonBuilder, ElementWrap, InputFieldBuilder, WeakElementCell}; +use korangar_interface::elements::{ButtonBuilder, ElementWrap, InputFieldBuilder}; use korangar_interface::event::ClickAction; use korangar_interface::state::{PlainRemote, PlainTrackedState, TrackedStateTake}; use korangar_interface::windows::{PrototypeWindow, Window, WindowBuilder}; use korangar_interface::{dimension_bound, size_bound}; use ragnarok_packets::Friend; +use crate::current_element::CurrentElement; use crate::input::UserEvent; use crate::interface::application::InterfaceSettings; use crate::interface::elements::FriendView; use crate::interface::layout::ScreenSize; use crate::interface::windows::WindowCache; -use crate::packet_recorder::CurrentElement; #[derive(new)] pub struct FriendsWindow { diff --git a/korangar/src/main.rs b/korangar/src/main.rs index eba99b39..91160b19 100644 --- a/korangar/src/main.rs +++ b/korangar/src/main.rs @@ -26,7 +26,7 @@ mod inventory; mod loaders; mod world; -use std::cell::{RefCell, UnsafeCell}; +use std::cell::RefCell; use std::io::Cursor; use std::net::{IpAddr, SocketAddr}; use std::rc::Rc; @@ -43,7 +43,6 @@ use korangar_debug::profile_block; #[cfg(feature = "debug")] use korangar_debug::profiling::Profiler; use korangar_interface::application::{Application, FocusState, FontSizeTrait, FontSizeTraitExt, PositionTraitExt}; -use korangar_interface::elements::WeakElementCell; use korangar_interface::state::{PlainTrackedState, Remote, RemoteClone, TrackedState, TrackedStateExt, TrackedStateTake, TrackedStateVec}; use korangar_interface::Interface; use korangar_networking::{DisconnectReason, LoginServerLoginData, MessageColor, NetworkEvent, NetworkingSystem}; @@ -61,6 +60,7 @@ use winit::event::{Event, WindowEvent}; use winit::event_loop::{ControlFlow, EventLoop}; use winit::window::{Icon, WindowBuilder}; +use crate::current_element::CurrentElement; use crate::graphics::*; use crate::input::{InputSystem, UserEvent}; use crate::interface::application::InterfaceSettings; @@ -77,7 +77,6 @@ use crate::interface::windows::{ use crate::interface::windows::{CommandsWindow, MapsWindow, ProfilerWindow, RenderSettingsWindow, TimeWindow}; use crate::inventory::{Hotbar, Inventory, SkillTree}; use crate::loaders::*; -use crate::packet_recorder::CurrentElement; #[cfg(feature = "debug")] use crate::system::vulkan_message_callback; use crate::system::{choose_physical_device, get_device_extensions, get_layers, GameTimer}; @@ -94,18 +93,12 @@ korangar_debug::create_profiler_threads!(threads, { Deferred, }); -#[cfg(feature = "debug")] -mod packet_recorder { +mod current_element { use std::cell::UnsafeCell; - use std::sync::Mutex; - use korangar_debug::profiling::RingBuffer; use korangar_interface::elements::ElementCell; - use ragnarok_packets::handler::{PacketCallback, UnknownPacket}; - use ragnarok_packets::{IncomingPacket, OutgoingPacket, PacketHeader}; use crate::interface::application::InterfaceSettings; - use crate::interface::elements::PacketEntry; #[derive(Debug, Clone, Copy)] enum CurrentElementInner { @@ -143,6 +136,18 @@ mod packet_recorder { } } } +} + +#[cfg(feature = "debug")] +mod packet_recorder { + use std::sync::Mutex; + + use korangar_debug::profiling::RingBuffer; + use ragnarok_packets::handler::{PacketCallback, UnknownPacket}; + use ragnarok_packets::{IncomingPacket, OutgoingPacket, PacketHeader}; + + use crate::current_element::CurrentElement; + use crate::interface::elements::PacketEntry; #[derive(Clone)] pub struct PacketRecorder { diff --git a/korangar_networking/src/lib.rs b/korangar_networking/src/lib.rs index a06c7147..f50900f3 100644 --- a/korangar_networking/src/lib.rs +++ b/korangar_networking/src/lib.rs @@ -1012,7 +1012,7 @@ where #[cfg(test)] mod packet_handlers { - use ragnarok_packets::NoPacketCallback; + use ragnarok_packets::handler::NoPacketCallback; use crate::NetworkingSystem;