bincode gaming
This commit is contained in:
@@ -3,7 +3,10 @@ use len_fns::*;
|
||||
|
||||
use crate::{
|
||||
client::{Client, app::AppHandle},
|
||||
net::client::{NetCmd, NetSender, connect},
|
||||
net::{
|
||||
ClientMsg,
|
||||
client::{NetSender, connect},
|
||||
},
|
||||
};
|
||||
|
||||
#[derive(Eq, PartialEq, Hash, Clone)]
|
||||
@@ -117,7 +120,11 @@ pub fn msg_panel(ui: &mut Ui, network: NetSender) -> impl WidgetFn<Stack> + use<
|
||||
.clone()
|
||||
.id_on(Submit, move |id, client: &mut Client, _| {
|
||||
let content = client.ui.text(id).take();
|
||||
network.send(NetCmd::SendMsg(content.clone())).unwrap();
|
||||
network
|
||||
.send(ClientMsg::SendMsg {
|
||||
content: content.clone(),
|
||||
})
|
||||
.unwrap();
|
||||
let msg = msg_widget(content).add(&mut client.ui);
|
||||
client.ui[&msg_area].children.push(msg.any());
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user