Editor selection refactor pt1
This commit is contained in:
@@ -52,7 +52,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
ModData = modData;
|
||||
World = world;
|
||||
WorldRenderer = worldRenderer;
|
||||
Editor = widget.Parent.Get<EditorViewportControllerWidget>("MAP_EDITOR");
|
||||
Editor = widget.Parent.Parent.Get<EditorViewportControllerWidget>("MAP_EDITOR");
|
||||
Panel = widget.Get<ScrollPanelWidget>(templateListId);
|
||||
ItemTemplate = Panel.Get<ScrollItemWidget>(previewTemplateId);
|
||||
Panel.Layout = new GridLayout(Panel);
|
||||
@@ -71,6 +71,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
return true;
|
||||
};
|
||||
|
||||
Editor.DefaultBrush.SelectionChanged += HandleSelectionChanged;
|
||||
|
||||
var none = TranslationProvider.GetString(None);
|
||||
var searchResults = TranslationProvider.GetString(SearchResults);
|
||||
var all = TranslationProvider.GetString(All);
|
||||
@@ -103,6 +105,18 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
};
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
Editor.DefaultBrush.SelectionChanged -= HandleSelectionChanged;
|
||||
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
void HandleSelectionChanged()
|
||||
{
|
||||
SearchTextField.YieldKeyboardFocus();
|
||||
}
|
||||
|
||||
protected Widget CreateCategoriesPanel(ScrollPanelWidget panel)
|
||||
{
|
||||
var categoriesPanel = Ui.LoadWidget("CATEGORY_FILTER_PANEL", null, new WidgetArgs());
|
||||
|
||||
Reference in New Issue
Block a user