fn adjust_tile_usage(&mut self, asset: &Asset, context: &ScreenContext) {
        if let Some(tile_id) = context.curr_tile {
            let tile = asset.get_tile(&(asset.tileset.maps_ids[context.curr_tileset_index], tile_id.0, tile_id.1));
            match tile.usage {
                TileUsage::Unused => self.widgets[0].curr_item_index = 0,
                TileUsage::Environment => self.widgets[0].curr_item_index = 1,
                TileUsage::EnvRoad => self.widgets[0].curr_item_index = 2,
                TileUsage::EnvBlocking => self.widgets[0].curr_item_index = 3,
                TileUsage::Character => self.widgets[0].curr_item_index = 4,
                TileUsage::UtilityChar => self.widgets[0].curr_item_index = 5,
                TileUsage::Water => self.widgets[0].curr_item_index = 6,
                TileUsage::Effect => self.widgets[0].curr_item_index = 7,
                TileUsage::Icon => self.widgets[0].curr_item_index = 8,
                TileUsage::UIElement => self.widgets[0].curr_item_index = 9,
            }
            self.widgets[1].text[0] = tile.tags;
        } else {
            self.widgets[0].curr_item_index = 0;
            self.widgets[1].text[0] = "".to_string();
        }
        self.widgets[0].dirty = true;
        self.widgets[1].dirty = true;
    }
/// Updates the group widget based on the selected tile
Updates the group widget based on the selected tile
Updates the group widget based on the selected tile
fn adjust_tile_usage(&mut self, asset: &Asset, context: &ScreenContext) {
        if let Some(tile_id) = context.curr_tile {
            let tile = asset.get_tile(&(asset.tileset.maps_ids[context.curr_tileset_index], tile_id.0, tile_id.1));
            match tile.usage {
                TileUsage::Unused => self.widgets[0].curr_item_index = 0,
                TileUsage::Environment => self.widgets[0].curr_item_index = 1,
                TileUsage::EnvRoad => self.widgets[0].curr_item_index = 2,
                TileUsage::EnvBlocking => self.widgets[0].curr_item_index = 3,
                TileUsage::Character => self.widgets[0].curr_item_index = 4,
                TileUsage::UtilityChar => self.widgets[0].curr_item_index = 5,
                TileUsage::Water => self.widgets[0].curr_item_index = 6,
                TileUsage::Effect => self.widgets[0].curr_item_index = 7,
                TileUsage::Icon => self.widgets[0].curr_item_index = 8,
                TileUsage::UIElement => self.widgets[0].curr_item_index = 9,
            }
            self.widgets[1].text[0] = tile.tags;
        } else {
            self.widgets[0].curr_item_index = 0;
            self.widgets[1].text[0] = "".to_string();
        }
        self.widgets[0].dirty = true;
        self.widgets[1].dirty = true;
    }
fn adjust_tile_usage ( & mut self , asset : & Asset , context : & ScreenContext ) { if let Some ( tile_id ) = context . curr_tile { let tile = asset . get_tile ( & ( asset . tileset . maps_ids [ context . curr_tileset_index ] , tile_id . 0 , tile_id . 1 ) ) ; match tile . usage { TileUsage :: Unused => self . widgets [ 0 ] . curr_item_index = 0 , TileUsage :: Environment => self . widgets [ 0 ] . curr_item_index = 1 , TileUsage :: EnvRoad => self . widgets [ 0 ] . curr_item_index = 2 , TileUsage :: EnvBlocking => self . widgets [ 0 ] . curr_item_index = 3 , TileUsage :: Character => self . widgets [ 0 ] . curr_item_index = 4 , TileUsage :: UtilityChar => self . widgets [ 0 ] . curr_item_index = 5 , TileUsage :: Water => self . widgets [ 0 ] . curr_item_index = 6 , TileUsage :: Effect => self . widgets [ 0 ] . curr_item_index = 7 , TileUsage :: Icon => self . widgets [ 0 ] . curr_item_index = 8 , TileUsage :: UIElement => self . widgets [ 0 ] . curr_item_index = 9 , } self . widgets [ 1 ] . text [ 0 ] = tile . tags ; } else { self . widgets [ 0 ] . curr_item_index = 0 ; self . widgets [ 1 ] . text [ 0 ] = " " . to_string ( ) ; } self . widgets [ 0 ] . dirty = true ; self . widgets [ 1 ] . dirty = true ; }
Updates the group widget based on the selected tile
Updates the group widget based on the selected tile
&mut self
asset
&Asset
context
&ScreenContext
&mut self
asset
&Asset
context
&ScreenContext