void ChkListPalettes_ItemCheck(object sender, ItemCheckEventArgs e) { var asset = _core.SelectedObject; if (asset == null) { return; } var palette = (AlbionPalette)chkListPalettes.Items[e.Index]; if (e.NewValue == CheckState.Checked) { if (!asset.PaletteHints.Contains(palette.Id)) { asset.PaletteHints.Add(palette.Id); } } else { asset.PaletteHints.Remove(palette.Id); } _core.TriggerAssetChanged(asset); }
void ChkListPalettes_ItemCheck(object sender, ItemCheckEventArgs e) { var asset = _core.SelectedObject; if (asset == null) { return; } var palette = (AlbionPalette)chkListPalettes.Items[e.Index]; var paletteId = PaletteId.FromUInt32(palette.Id); if (e.NewValue == CheckState.Checked) { asset.Set(AssetProperty.PaletteId, paletteId.Id); // TODO: Uncheck all others } else { if (asset.Get(AssetProperty.PaletteId, 0) == paletteId.Id) { asset.Set <object>(AssetProperty.PaletteId, null); } } _core.TriggerAssetChanged(asset); }