Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Tails8521 committed Aug 9, 2022
1 parent 0653861 commit 7c8e3f9
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 17 deletions.
22 changes: 17 additions & 5 deletions src/demo_player.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,26 @@ use std::{num::NonZeroU32, str::FromStr};

use coldmaps::heatmap_analyser::{handle_to_entity_index, Class, HeatmapAnalyser, HeatmapAnalysis, PlayerState, Spawn, Team, UserId, UserInfo};
use serde::Serialize;
use std::borrow::Borrow;
use tf_demo_parser::{
demo::gamevent::GameEvent, demo::header::Header, demo::message::packetentities::EntityId, demo::message::packetentities::PacketEntity, demo::{message::packetentities::PVS, sendprop::SendPropIdentifier},
demo::message::Message, demo::packet::datatable::{ParseSendTable, SendTableName}, demo::{packet::datatable::ServerClass, sendprop::SendPropName}, demo::packet::datatable::ServerClassName,
demo::packet::stringtable::StringTableEntry, demo::parser::handler::BorrowMessageHandler, demo::parser::DemoTicker, demo::parser::MessageHandler, demo::vector::Vector,
demo::vector::VectorXY, Demo, DemoParser, MessageType, ParseError, ParserState, ReadResult, Stream,
demo::gamevent::GameEvent,
demo::header::Header,
demo::message::packetentities::EntityId,
demo::message::packetentities::PacketEntity,
demo::message::Message,
demo::packet::datatable::ServerClassName,
demo::packet::datatable::{ParseSendTable, SendTableName},
demo::packet::stringtable::StringTableEntry,
demo::parser::handler::BorrowMessageHandler,
demo::parser::DemoTicker,
demo::parser::MessageHandler,
demo::vector::Vector,
demo::vector::VectorXY,
demo::{message::packetentities::PVS, sendprop::SendPropIdentifier},
demo::{packet::datatable::ServerClass, sendprop::SendPropName},
Demo, DemoParser, MessageType, ParseError, ParserState, ReadResult, Stream,
};
use weapons::Weapon;
use std::borrow::Borrow;

const SECTION_SIZE: usize = 1024;
const SHOW_UNKNOWN_ENTITIES: bool = false;
Expand Down
2 changes: 1 addition & 1 deletion src/gui_filters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use coldmaps::{
},
heatmap_analyser::Team,
};
use iced::{button, pick_list, scrollable, text_input, Button, Column, Container, Element, Font, alignment, Length, PickList, Row, Scrollable, Text, TextInput};
use iced::{alignment, button, pick_list, scrollable, text_input, Button, Column, Container, Element, Font, Length, PickList, Row, Scrollable, Text, TextInput};
use std::fmt::Display;
use style::ActiveButtonHighlight;

Expand Down
11 changes: 4 additions & 7 deletions src/heatmap_analyser.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use fnv::FnvHashMap;
use num_enum::TryFromPrimitive;
use serde::{Deserialize, Serialize};
use tf_demo_parser::demo::packet::datatable::SendTableName;
use tf_demo_parser::demo::sendprop::{SendPropIdentifier, SendPropName};
use std::borrow::Borrow;
use std::convert::TryFrom;
use std::str::FromStr;
use std::{
Expand All @@ -12,10 +11,12 @@ use std::{
use tf_demo_parser::demo::message::packetentities::{EntityId, PacketEntity};
use tf_demo_parser::demo::message::usermessage::{ChatMessageKind, SayText2Message, UserMessage};
use tf_demo_parser::demo::message::{Message, MessageType};
use tf_demo_parser::demo::packet::datatable::SendTableName;
use tf_demo_parser::demo::packet::{
datatable::{ParseSendTable, ServerClass, ServerClassName},
stringtable::StringTableEntry,
};
use tf_demo_parser::demo::sendprop::{SendPropIdentifier, SendPropName};
use tf_demo_parser::demo::{
gameevent_gen::{GameEvent, PlayerDeathEvent, PlayerSpawnEvent, TeamPlayRoundWinEvent},
message::packetentities::PVS,
Expand All @@ -26,7 +27,6 @@ use tf_demo_parser::demo::{
vector::{Vector, VectorXY},
};
use tf_demo_parser::{ParserState, ReadResult, Stream};
use std::borrow::Borrow;

const MAX_PLAYER_ENTITY: u32 = 34;

Expand Down Expand Up @@ -328,10 +328,7 @@ impl MessageHandler for HeatmapAnalyser {

for table in tables {
for prop_def in &table.props {
self.prop_names.insert(
prop_def.identifier(),
(table.name.clone(), prop_def.name.clone()),
);
self.prop_names.insert(prop_def.identifier(), (table.name.clone(), prop_def.name.clone()));
}
}
}
Expand Down
7 changes: 3 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ use gui_filters::{FilterType, FiltersPane};
use heatmap::{CoordsType, HeatmapType};
use heatmap_analyser::{HeatmapAnalysis, Team};
use iced::{
button, executor, image::Handle, pane_grid, scrollable, slider, text_input, window, Application, Button, Checkbox, Column, Command, Container, Element, Font,
Image, Length, Point, Radio, Rectangle, Row, Scrollable, Settings, Size, Slider, Subscription, Text, TextInput, alignment,
alignment, button, executor, image::Handle, pane_grid, scrollable, slider, text_input, window, Application, Button, Checkbox, Column, Command, Container, Element, Font, Image,
Length, Point, Radio, Rectangle, Row, Scrollable, Settings, Size, Slider, Subscription, Text, TextInput,
};
use image::{io::Reader, ImageBuffer, Pixel, Rgb, RgbImage};
use pane_grid::{Axis, Pane};
Expand Down Expand Up @@ -744,8 +744,7 @@ impl Application for App {
}

fn view(&mut self) -> Element<Message> {
let pane_grid: pane_grid::PaneGrid<Message> =
pane_grid::PaneGrid::new(&mut self.pane_grid_state, |_pane, state| state.view().into()).on_resize(10, Message::PaneResized);
let pane_grid: pane_grid::PaneGrid<Message> = pane_grid::PaneGrid::new(&mut self.pane_grid_state, |_pane, state| state.view().into()).on_resize(10, Message::PaneResized);

let content = Column::new().align_items(iced::Alignment::Center).spacing(20).push(pane_grid);

Expand Down

0 comments on commit 7c8e3f9

Please sign in to comment.