Added hiding of the palette picker in the AssetBrowser

This commit is contained in:
penev92
2022-01-06 03:17:47 +02:00
committed by Matthias Mailänder
parent 495faea96b
commit c6dacb50e8

View File

@@ -131,6 +131,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
{
paletteDropDown.OnMouseDown = _ => ShowPaletteDropdown(paletteDropDown, world);
paletteDropDown.GetText = () => currentPalette;
paletteDropDown.IsVisible = () => currentSprites != null || currentVoxel != null;
panel.GetOrNull<LabelWidget>("PALETTE_DESC").IsVisible = () => currentSprites != null || currentVoxel != null;
}
var colorManager = modData.DefaultRules.Actors[SystemActors.World].TraitInfo<ColorPickerManagerInfo>();
@@ -141,6 +143,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
{
colorDropdown.IsDisabled = () => !colorPickerPalettes.Contains(currentPalette);
colorDropdown.OnMouseDown = _ => ColorPickerLogic.ShowColorDropDown(colorDropdown, colorManager, worldRenderer);
colorDropdown.IsVisible = () => currentSprites != null || currentVoxel != null;
panel.Get<ColorBlockWidget>("COLORBLOCK").GetColor = () => colorManager.Color;
}