generated from ElnuDev/rust-project
Use event system instead of direct commands
This commit is contained in:
parent
0319f3d630
commit
38948883e4
2 changed files with 31 additions and 4 deletions
|
@ -3,7 +3,7 @@ use std::thread;
|
|||
use std::time::Duration;
|
||||
|
||||
use eframe::egui;
|
||||
use renrs::{State, Command};
|
||||
use renrs::State;
|
||||
|
||||
use sfml::{
|
||||
graphics::{Color, RenderTarget, RenderWindow, RectangleShape, Transformable},
|
||||
|
@ -41,7 +41,7 @@ impl App {
|
|||
}
|
||||
|
||||
fn next(&mut self) {
|
||||
if let Some(Command::Say { name, text }) = self.state.next_command() {
|
||||
if let Some(renrs::Event::Say { name, text }) = self.state.next() {
|
||||
self.text = match name {
|
||||
Some(name) => format!("{name}: {text}"),
|
||||
None => text,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue