Use event system instead of direct commands

This commit is contained in:
Elnu 2023-05-24 09:05:51 -07:00
parent 0319f3d630
commit 38948883e4
2 changed files with 31 additions and 4 deletions

View file

@ -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,