Skip to main content

rustapi/editor_tools/
tile_select.rs

1use crate::prelude::*;
2
3pub struct TileSelectTool {
4    id: TheId,
5}
6
7impl EditorTool for TileSelectTool {
8    fn new() -> Self
9    where
10        Self: Sized,
11    {
12        Self {
13            id: TheId::named_with_id("Tile Select Tool", Uuid::new_v4()),
14        }
15    }
16
17    fn id(&self) -> TheId {
18        self.id.clone()
19    }
20
21    fn info(&self) -> String {
22        "Select Tool (S). Drag to replace selection, Shift-drag to add, Alt-drag to subtract; supports cut/copy/paste on selected pixels.".to_string()
23    }
24
25    fn icon_name(&self) -> String {
26        "selection".to_string()
27    }
28
29    fn rgba_view_mode(&self) -> Option<TheRGBAViewMode> {
30        Some(TheRGBAViewMode::TileSelection)
31    }
32
33    fn accel(&self) -> Option<char> {
34        Some('S')
35    }
36}