Promote map generators to stand-alone editor tools.
This commit is contained in:
committed by
Gustas Kažukauskas
parent
78f660124c
commit
b2acc653a0
@@ -21,22 +21,25 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
{
|
{
|
||||||
[TraitLocation(SystemActors.EditorWorld)]
|
[TraitLocation(SystemActors.EditorWorld)]
|
||||||
[Desc("A map generator that clears a map.")]
|
[Desc("A map generator that clears a map.")]
|
||||||
public sealed class ClearMapGeneratorInfo : TraitInfo<ClearMapGenerator>, IMapGeneratorInfo
|
public sealed class ClearMapGeneratorInfo : TraitInfo<ClearMapGenerator>, IMapGeneratorInfo, IEditorToolInfo
|
||||||
{
|
{
|
||||||
[FieldLoader.Require]
|
[FieldLoader.Require]
|
||||||
[Desc("Human-readable name this generator uses.")]
|
[Desc("Human-readable name this generator uses.")]
|
||||||
[FluentReference]
|
[FluentReference]
|
||||||
public readonly string Name = null;
|
public readonly string Name = null;
|
||||||
|
|
||||||
|
[FieldLoader.Require]
|
||||||
|
[Desc("Internal id for this map generator.")]
|
||||||
|
public readonly string Type = null;
|
||||||
|
|
||||||
|
[Desc("The widget tree to open when the tool is selected.")]
|
||||||
|
public readonly string PanelWidget = "MAP_GENERATOR_TOOL_PANEL";
|
||||||
|
|
||||||
// This is purely of interest to the linter.
|
// This is purely of interest to the linter.
|
||||||
[FieldLoader.LoadUsing(nameof(FluentReferencesLoader))]
|
[FieldLoader.LoadUsing(nameof(FluentReferencesLoader))]
|
||||||
[FluentReference]
|
[FluentReference]
|
||||||
public readonly List<string> FluentReferences = null;
|
public readonly List<string> FluentReferences = null;
|
||||||
|
|
||||||
[FieldLoader.Require]
|
|
||||||
[Desc("Internal id for this map generator.")]
|
|
||||||
public readonly string Type = null;
|
|
||||||
|
|
||||||
[FieldLoader.LoadUsing(nameof(SettingsLoader))]
|
[FieldLoader.LoadUsing(nameof(SettingsLoader))]
|
||||||
public readonly MiniYaml Settings;
|
public readonly MiniYaml Settings;
|
||||||
|
|
||||||
@@ -98,6 +101,9 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
map.PlayerDefinitions = new MapPlayers(map.Rules, 0).ToMiniYaml();
|
map.PlayerDefinitions = new MapPlayers(map.Rules, 0).ToMiniYaml();
|
||||||
map.ActorDefinitions = [];
|
map.ActorDefinitions = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string IEditorToolInfo.Label => Name;
|
||||||
|
string IEditorToolInfo.PanelWidget => PanelWidget;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ClearMapGenerator { /* we're only interested in the Info */ }
|
public class ClearMapGenerator { /* we're only interested in the Info */ }
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ using static OpenRA.Mods.Common.Traits.ResourceLayerInfo;
|
|||||||
namespace OpenRA.Mods.Common.Traits
|
namespace OpenRA.Mods.Common.Traits
|
||||||
{
|
{
|
||||||
[TraitLocation(SystemActors.EditorWorld)]
|
[TraitLocation(SystemActors.EditorWorld)]
|
||||||
public sealed class ExperimentalMapGeneratorInfo : TraitInfo<ExperimentalMapGenerator>, IMapGeneratorInfo
|
public sealed class ExperimentalMapGeneratorInfo : TraitInfo<ExperimentalMapGenerator>, IMapGeneratorInfo, IEditorToolInfo
|
||||||
{
|
{
|
||||||
[FieldLoader.Require]
|
[FieldLoader.Require]
|
||||||
public readonly string Type = null;
|
public readonly string Type = null;
|
||||||
@@ -32,6 +32,9 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
[FluentReference]
|
[FluentReference]
|
||||||
public readonly string Name = null;
|
public readonly string Name = null;
|
||||||
|
|
||||||
|
[Desc("The widget tree to open when the tool is selected.")]
|
||||||
|
public readonly string PanelWidget = "MAP_GENERATOR_TOOL_PANEL";
|
||||||
|
|
||||||
// This is purely of interest to the linter.
|
// This is purely of interest to the linter.
|
||||||
[FieldLoader.LoadUsing(nameof(FluentReferencesLoader))]
|
[FieldLoader.LoadUsing(nameof(FluentReferencesLoader))]
|
||||||
[FluentReference]
|
[FluentReference]
|
||||||
@@ -1821,6 +1824,9 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
amplitude = Exts.ISqrt(amplitude);
|
amplitude = Exts.ISqrt(amplitude);
|
||||||
return amplitude;
|
return amplitude;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string IEditorToolInfo.Label => Name;
|
||||||
|
string IEditorToolInfo.PanelWidget => PanelWidget;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ExperimentalMapGenerator { /* we're only interested in the Info */ }
|
public class ExperimentalMapGenerator { /* we're only interested in the Info */ }
|
||||||
|
|||||||
@@ -22,8 +22,15 @@ using Color = OpenRA.Primitives.Color;
|
|||||||
namespace OpenRA.Mods.Common.Traits
|
namespace OpenRA.Mods.Common.Traits
|
||||||
{
|
{
|
||||||
[TraitLocation(SystemActors.EditorWorld)]
|
[TraitLocation(SystemActors.EditorWorld)]
|
||||||
public class MarkerLayerOverlayInfo : TraitInfo
|
public class MarkerLayerOverlayInfo : TraitInfo, IEditorToolInfo
|
||||||
{
|
{
|
||||||
|
[FluentReference]
|
||||||
|
[Desc("The label to show in the tools menu.")]
|
||||||
|
public readonly string Label = "label-tool-marker-tiles";
|
||||||
|
|
||||||
|
[Desc("The widget tree to open when the tool is selected.")]
|
||||||
|
public readonly string PanelWidget = "MARKER_TOOL_PANEL";
|
||||||
|
|
||||||
[Desc("A list of colors to be used for drawing.")]
|
[Desc("A list of colors to be used for drawing.")]
|
||||||
public readonly Color[] Colors =
|
public readonly Color[] Colors =
|
||||||
[
|
[
|
||||||
@@ -47,6 +54,9 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
{
|
{
|
||||||
return new MarkerLayerOverlay(init.Self, this);
|
return new MarkerLayerOverlay(init.Self, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string IEditorToolInfo.Label => Label;
|
||||||
|
string IEditorToolInfo.PanelWidget => PanelWidget;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class MarkerLayerOverlay : IRenderAnnotations, INotifyActorDisposing, IWorldLoaded
|
public class MarkerLayerOverlay : IRenderAnnotations, INotifyActorDisposing, IWorldLoaded
|
||||||
|
|||||||
@@ -961,6 +961,12 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
bool PathMightExistForLocomotorBlockedByImmovable(Locomotor locomotor, CPos source, CPos target);
|
bool PathMightExistForLocomotorBlockedByImmovable(Locomotor locomotor, CPos source, CPos target);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public interface IEditorToolInfo : ITraitInfoInterface
|
||||||
|
{
|
||||||
|
string Label { get; }
|
||||||
|
string PanelWidget { get; }
|
||||||
|
}
|
||||||
|
|
||||||
public class MapGenerationException : Exception
|
public class MapGenerationException : Exception
|
||||||
{
|
{
|
||||||
public MapGenerationException(string message)
|
public MapGenerationException(string message)
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
*/
|
*/
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
using OpenRA.Mods.Common.Traits;
|
||||||
using OpenRA.Widgets;
|
using OpenRA.Widgets;
|
||||||
|
|
||||||
namespace OpenRA.Mods.Common.Widgets.Logic
|
namespace OpenRA.Mods.Common.Widgets.Logic
|
||||||
@@ -17,6 +18,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
{
|
{
|
||||||
enum MenuType { Select, Tiles, Layers, Actors, Tools, History }
|
enum MenuType { Select, Tiles, Layers, Actors, Tools, History }
|
||||||
|
|
||||||
|
readonly World world;
|
||||||
readonly Widget panelContainer;
|
readonly Widget panelContainer;
|
||||||
readonly Widget tabContainer;
|
readonly Widget tabContainer;
|
||||||
readonly EditorViewportControllerWidget editor;
|
readonly EditorViewportControllerWidget editor;
|
||||||
@@ -25,8 +27,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
MenuType lastSelectedTab = MenuType.Tiles;
|
MenuType lastSelectedTab = MenuType.Tiles;
|
||||||
|
|
||||||
[ObjectCreator.UseCtor]
|
[ObjectCreator.UseCtor]
|
||||||
public MapEditorTabsLogic(Widget widget)
|
public MapEditorTabsLogic(Widget widget, World world)
|
||||||
{
|
{
|
||||||
|
this.world = world;
|
||||||
panelContainer = widget.Parent;
|
panelContainer = widget.Parent;
|
||||||
tabContainer = widget.Get("MAP_EDITOR_TAB_CONTAINER");
|
tabContainer = widget.Get("MAP_EDITOR_TAB_CONTAINER");
|
||||||
|
|
||||||
@@ -67,6 +70,12 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
if (tabType == MenuType.Select)
|
if (tabType == MenuType.Select)
|
||||||
tab.IsDisabled = () => !editor.DefaultBrush.Selection.HasSelection;
|
tab.IsDisabled = () => !editor.DefaultBrush.Selection.HasSelection;
|
||||||
|
|
||||||
|
if (tabType == MenuType.Tools)
|
||||||
|
{
|
||||||
|
var toolsAvailable = world.Map.Rules.Actors[SystemActors.EditorWorld].HasTraitInfo<IEditorToolInfo>();
|
||||||
|
tab.IsDisabled = () => !toolsAvailable;
|
||||||
|
}
|
||||||
|
|
||||||
var container = panelContainer.Get<ContainerWidget>(tabId);
|
var container = panelContainer.Get<ContainerWidget>(tabId);
|
||||||
container.IsVisible = () => menuType == tabType;
|
container.IsVisible = () => menuType == tabType;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,10 +35,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
readonly World world;
|
readonly World world;
|
||||||
readonly WorldRenderer worldRenderer;
|
readonly WorldRenderer worldRenderer;
|
||||||
readonly ModData modData;
|
readonly ModData modData;
|
||||||
|
readonly IMapGeneratorInfo generator;
|
||||||
// nullable
|
readonly IMapGeneratorSettings settings;
|
||||||
IMapGeneratorInfo selectedGenerator;
|
|
||||||
IMapGeneratorSettings selectedSettings;
|
|
||||||
|
|
||||||
readonly ScrollPanelWidget settingsPanel;
|
readonly ScrollPanelWidget settingsPanel;
|
||||||
readonly Widget checkboxSettingTemplate;
|
readonly Widget checkboxSettingTemplate;
|
||||||
@@ -46,13 +44,16 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
readonly Widget dropDownSettingTemplate;
|
readonly Widget dropDownSettingTemplate;
|
||||||
|
|
||||||
[ObjectCreator.UseCtor]
|
[ObjectCreator.UseCtor]
|
||||||
public MapGeneratorToolLogic(Widget widget, World world, WorldRenderer worldRenderer, ModData modData)
|
public MapGeneratorToolLogic(Widget widget, World world, WorldRenderer worldRenderer, ModData modData,
|
||||||
|
IMapGeneratorInfo tool)
|
||||||
{
|
{
|
||||||
editorActionManager = world.WorldActor.Trait<EditorActionManager>();
|
editorActionManager = world.WorldActor.Trait<EditorActionManager>();
|
||||||
|
|
||||||
this.world = world;
|
this.world = world;
|
||||||
this.worldRenderer = worldRenderer;
|
this.worldRenderer = worldRenderer;
|
||||||
this.modData = modData;
|
this.modData = modData;
|
||||||
|
generator = tool;
|
||||||
|
settings = generator.GetSettings();
|
||||||
|
|
||||||
settingsPanel = widget.Get<ScrollPanelWidget>("SETTINGS_PANEL");
|
settingsPanel = widget.Get<ScrollPanelWidget>("SETTINGS_PANEL");
|
||||||
checkboxSettingTemplate = settingsPanel.Get<Widget>("CHECKBOX_TEMPLATE");
|
checkboxSettingTemplate = settingsPanel.Get<Widget>("CHECKBOX_TEMPLATE");
|
||||||
@@ -65,40 +66,12 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var generateRandomButtonWidget = widget.Get<ButtonWidget>("GENERATE_RANDOM_BUTTON");
|
var generateRandomButtonWidget = widget.Get<ButtonWidget>("GENERATE_RANDOM_BUTTON");
|
||||||
generateRandomButtonWidget.OnClick = () =>
|
generateRandomButtonWidget.OnClick = () =>
|
||||||
{
|
{
|
||||||
selectedSettings?.Randomize(world.LocalRandom);
|
settings?.Randomize(world.LocalRandom);
|
||||||
UpdateSettingsUi();
|
UpdateSettingsUi();
|
||||||
GenerateMap();
|
GenerateMap();
|
||||||
};
|
};
|
||||||
|
|
||||||
var generatorDropDown = widget.Get<DropDownButtonWidget>("GENERATOR");
|
UpdateSettingsUi();
|
||||||
var mapGenerators = world.Map.Rules.Actors[SystemActors.EditorWorld].TraitInfos<IMapGeneratorInfo>();
|
|
||||||
if (mapGenerators.Count > 0)
|
|
||||||
{
|
|
||||||
var label = new CachedTransform<IMapGeneratorInfo, string>(g => FluentProvider.GetMessage(g.Name));
|
|
||||||
generatorDropDown.GetText = () => label.Update(selectedGenerator);
|
|
||||||
generatorDropDown.OnMouseDown = _ =>
|
|
||||||
{
|
|
||||||
ScrollItemWidget SetupItem(IMapGeneratorInfo g, ScrollItemWidget template)
|
|
||||||
{
|
|
||||||
bool IsSelected() => g.Type == selectedGenerator.Type;
|
|
||||||
void OnClick() => ChangeGenerator(g);
|
|
||||||
var item = ScrollItemWidget.Setup(template, IsSelected, OnClick);
|
|
||||||
var label = FluentProvider.GetMessage(g.Name);
|
|
||||||
item.Get<LabelWidget>("LABEL").GetText = () => label;
|
|
||||||
return item;
|
|
||||||
}
|
|
||||||
|
|
||||||
generatorDropDown.ShowDropDown("LABEL_DROPDOWN_TEMPLATE", mapGenerators.Count * 30, mapGenerators, SetupItem);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
generateButtonWidget.IsDisabled = () => true;
|
|
||||||
generateRandomButtonWidget.IsDisabled = () => true;
|
|
||||||
generatorDropDown.IsDisabled = () => true;
|
|
||||||
}
|
|
||||||
|
|
||||||
ChangeGenerator(mapGenerators.FirstOrDefault());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sealed class RandomMapEditorAction : IEditorAction
|
sealed class RandomMapEditorAction : IEditorAction
|
||||||
@@ -130,23 +103,14 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// newGenerator may be null.
|
|
||||||
void ChangeGenerator(IMapGeneratorInfo newGenerator)
|
|
||||||
{
|
|
||||||
selectedGenerator = newGenerator;
|
|
||||||
selectedSettings = newGenerator?.GetSettings();
|
|
||||||
|
|
||||||
UpdateSettingsUi();
|
|
||||||
}
|
|
||||||
|
|
||||||
void UpdateSettingsUi()
|
void UpdateSettingsUi()
|
||||||
{
|
{
|
||||||
settingsPanel.RemoveChildren();
|
settingsPanel.RemoveChildren();
|
||||||
settingsPanel.ContentHeight = 0;
|
settingsPanel.ContentHeight = 0;
|
||||||
if (selectedGenerator == null)
|
if (generator == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
foreach (var o in selectedSettings.Options)
|
foreach (var o in settings.Options)
|
||||||
{
|
{
|
||||||
Widget settingWidget = null;
|
Widget settingWidget = null;
|
||||||
switch (o)
|
switch (o)
|
||||||
@@ -296,12 +260,12 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var bounds = map.Bounds;
|
var bounds = map.Bounds;
|
||||||
generatedMap.SetBounds(new PPos(bounds.Left, bounds.Top), new PPos(bounds.Right - 1, bounds.Bottom - 1));
|
generatedMap.SetBounds(new PPos(bounds.Left, bounds.Top), new PPos(bounds.Right - 1, bounds.Bottom - 1));
|
||||||
|
|
||||||
var settings = selectedSettings.Compile(terrainInfo);
|
var settings = this.settings.Compile(terrainInfo);
|
||||||
|
|
||||||
// Run main generator logic. May throw.
|
// Run main generator logic. May throw.
|
||||||
var generateStopwatch = Stopwatch.StartNew();
|
var generateStopwatch = Stopwatch.StartNew();
|
||||||
Log.Write("debug", $"Running '{selectedGenerator.Type}' map generator with settings:\n{MiniYamlExts.WriteToString(settings.Nodes)}\n\n");
|
Log.Write("debug", $"Running '{generator.Type}' map generator with settings:\n{MiniYamlExts.WriteToString(settings.Nodes)}\n\n");
|
||||||
selectedGenerator.Generate(generatedMap, settings);
|
generator.Generate(generatedMap, settings);
|
||||||
Log.Write("debug", $"Generator finished, taking {generateStopwatch.ElapsedMilliseconds}ms");
|
Log.Write("debug", $"Generator finished, taking {generateStopwatch.ElapsedMilliseconds}ms");
|
||||||
|
|
||||||
var editorActorLayer = world.WorldActor.Trait<EditorActorLayer>();
|
var editorActorLayer = world.WorldActor.Trait<EditorActorLayer>();
|
||||||
@@ -347,7 +311,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
false);
|
false);
|
||||||
|
|
||||||
var description = FluentProvider.GetMessage(StrGenerated,
|
var description = FluentProvider.GetMessage(StrGenerated,
|
||||||
"name", FluentProvider.GetMessage(selectedGenerator.Name));
|
"name", FluentProvider.GetMessage(generator.Name));
|
||||||
var action = new RandomMapEditorAction(editorBlit, description);
|
var action = new RandomMapEditorAction(editorBlit, description);
|
||||||
editorActionManager.Add(action);
|
editorActionManager.Add(action);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using OpenRA.Graphics;
|
using System.Linq;
|
||||||
using OpenRA.Mods.Common.Traits;
|
using OpenRA.Mods.Common.Traits;
|
||||||
using OpenRA.Widgets;
|
using OpenRA.Widgets;
|
||||||
|
|
||||||
@@ -18,77 +18,53 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
{
|
{
|
||||||
public class MapToolsLogic : ChromeLogic
|
public class MapToolsLogic : ChromeLogic
|
||||||
{
|
{
|
||||||
[FluentReference]
|
readonly List<Widget> toolPanels = [];
|
||||||
const string MarkerTiles = "label-tool-marker-tiles";
|
readonly Dictionary<Widget, string> toolLabels = [];
|
||||||
[FluentReference]
|
Widget selectedPanel;
|
||||||
const string MapGenerator = "label-tool-map-generator";
|
|
||||||
|
|
||||||
enum MapTool
|
|
||||||
{
|
|
||||||
MarkerTiles,
|
|
||||||
MapGenerator
|
|
||||||
}
|
|
||||||
|
|
||||||
readonly DropDownButtonWidget toolsDropdown;
|
|
||||||
readonly Dictionary<MapTool, string> toolNames = new()
|
|
||||||
{
|
|
||||||
{ MapTool.MarkerTiles, MarkerTiles },
|
|
||||||
{ MapTool.MapGenerator, MapGenerator }
|
|
||||||
};
|
|
||||||
|
|
||||||
readonly Dictionary<MapTool, Widget> toolPanels = [];
|
|
||||||
|
|
||||||
MapTool selectedTool = MapTool.MarkerTiles;
|
|
||||||
|
|
||||||
[ObjectCreator.UseCtor]
|
[ObjectCreator.UseCtor]
|
||||||
public MapToolsLogic(Widget widget, World world, ModData modData, WorldRenderer worldRenderer, Dictionary<string, MiniYaml> logicArgs)
|
public MapToolsLogic(Widget widget, World world)
|
||||||
{
|
{
|
||||||
toolsDropdown = widget.Get<DropDownButtonWidget>("TOOLS_DROPDOWN");
|
var toolDropdownWidget = widget.Get<DropDownButtonWidget>("TOOLS_DROPDOWN");
|
||||||
|
var tools = world.Map.Rules.Actors[SystemActors.EditorWorld].TraitInfos<IEditorToolInfo>();
|
||||||
var markerToolPanel = widget.Get("MARKER_TOOL_PANEL");
|
foreach (var tool in tools)
|
||||||
toolPanels.Add(MapTool.MarkerTiles, markerToolPanel);
|
|
||||||
if (world.Map.Rules.Actors[SystemActors.EditorWorld].HasTraitInfo<IMapGeneratorInfo>())
|
|
||||||
{
|
{
|
||||||
var mapGeneratorToolPanel = widget.GetOrNull("MAP_GENERATOR_TOOL_PANEL");
|
var panel = Game.LoadWidget(world, tool.PanelWidget, widget, new WidgetArgs() { { "tool", tool } });
|
||||||
if (mapGeneratorToolPanel != null)
|
toolPanels.Add(panel);
|
||||||
toolPanels.Add(MapTool.MapGenerator, mapGeneratorToolPanel);
|
toolLabels.Add(panel, FluentProvider.GetMessage(tool.Label));
|
||||||
}
|
}
|
||||||
|
|
||||||
toolsDropdown.OnMouseDown = _ => ShowToolsDropDown(toolsDropdown);
|
SelectTool(toolPanels.FirstOrDefault());
|
||||||
toolsDropdown.GetText = () => FluentProvider.GetMessage(toolNames[selectedTool]);
|
toolDropdownWidget.OnMouseDown = _ => ShowToolsDropDown(toolDropdownWidget);
|
||||||
if (toolPanels.Count <= 1)
|
toolDropdownWidget.GetText = () => toolLabels[selectedPanel];
|
||||||
toolsDropdown.Disabled = true;
|
if (toolPanels.Count == 1)
|
||||||
|
toolDropdownWidget.Disabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShowToolsDropDown(DropDownButtonWidget dropdown)
|
void ShowToolsDropDown(DropDownButtonWidget dropdown)
|
||||||
{
|
{
|
||||||
ScrollItemWidget SetupItem(MapTool tool, ScrollItemWidget itemTemplate)
|
ScrollItemWidget SetupItem(Widget panel, ScrollItemWidget itemTemplate)
|
||||||
{
|
{
|
||||||
var item = ScrollItemWidget.Setup(itemTemplate,
|
var item = ScrollItemWidget.Setup(itemTemplate,
|
||||||
() => selectedTool == tool,
|
() => selectedPanel == panel,
|
||||||
() => SelectTool(tool));
|
() => SelectTool(panel));
|
||||||
|
|
||||||
item.Get<LabelWidget>("LABEL").GetText = () => FluentProvider.GetMessage(toolNames[tool]);
|
item.Get<LabelWidget>("LABEL").GetText = () => toolLabels[panel];
|
||||||
|
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
var options = new[] { MapTool.MarkerTiles, MapTool.MapGenerator };
|
dropdown.ShowDropDown("LABEL_DROPDOWN_TEMPLATE", 150, toolPanels, SetupItem);
|
||||||
dropdown.ShowDropDown("LABEL_DROPDOWN_TEMPLATE", 150, options, SetupItem);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SelectTool(MapTool tool)
|
void SelectTool(Widget panel)
|
||||||
{
|
{
|
||||||
if (tool != selectedTool)
|
if (panel != selectedPanel && selectedPanel != null)
|
||||||
{
|
selectedPanel.Visible = false;
|
||||||
var currentToolPanel = toolPanels[selectedTool];
|
|
||||||
currentToolPanel.Visible = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
selectedTool = tool;
|
selectedPanel = panel;
|
||||||
|
if (panel != null)
|
||||||
var toolPanel = toolPanels[selectedTool];
|
selectedPanel.Visible = true;
|
||||||
toolPanel.Visible = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -447,218 +447,6 @@ Container@EDITOR_WORLD_ROOT:
|
|||||||
Width: PARENT_WIDTH - 60
|
Width: PARENT_WIDTH - 60
|
||||||
Height: 25
|
Height: 25
|
||||||
Font: Bold
|
Font: Bold
|
||||||
Background@MARKER_TOOL_PANEL:
|
|
||||||
Y: 25
|
|
||||||
Width: PARENT_WIDTH
|
|
||||||
Height: PARENT_HEIGHT - 25
|
|
||||||
Background: scrollpanel-bg
|
|
||||||
Logic: MapMarkerTilesLogic
|
|
||||||
Children:
|
|
||||||
ScrollPanel@TILE_COLOR_PANEL:
|
|
||||||
X: 6
|
|
||||||
Y: 6
|
|
||||||
Width: PARENT_WIDTH - 19
|
|
||||||
Height: 31
|
|
||||||
TopBottomSpacing: 1
|
|
||||||
ItemSpacing: 1
|
|
||||||
ScrollBar: Hidden
|
|
||||||
ScrollbarWidth: 0
|
|
||||||
ContentHeight: 31
|
|
||||||
Children:
|
|
||||||
ScrollItem@TILE_COLOR_TEMPLATE:
|
|
||||||
Visible: false
|
|
||||||
Height: 29
|
|
||||||
Width: 29
|
|
||||||
IgnoreChildMouseOver: true
|
|
||||||
Children:
|
|
||||||
ColorBlock@TILE_PREVIEW:
|
|
||||||
X: 2
|
|
||||||
Y: 2
|
|
||||||
Width: 26
|
|
||||||
Height: 26
|
|
||||||
ScrollItem@TILE_ICON_TEMPLATE:
|
|
||||||
Visible: false
|
|
||||||
Height: 29
|
|
||||||
Width: 29
|
|
||||||
IgnoreChildMouseOver: true
|
|
||||||
Children:
|
|
||||||
Image@TILE_ERASE:
|
|
||||||
X: 6
|
|
||||||
Y: 6
|
|
||||||
Width: 26
|
|
||||||
Height: 26
|
|
||||||
ImageCollection: editor
|
|
||||||
ImageName: erase
|
|
||||||
Button@CLEAR_CURRENT_BUTTON:
|
|
||||||
X: 6
|
|
||||||
Y: 42
|
|
||||||
Width: 100
|
|
||||||
Height: 25
|
|
||||||
Text: button-marker-tiles-clear-current
|
|
||||||
Font: Bold
|
|
||||||
Button@CLEAR_ALL_BUTTON:
|
|
||||||
X: 111
|
|
||||||
Y: 42
|
|
||||||
Width: 75
|
|
||||||
Height: 25
|
|
||||||
Text: button-marker-tiles-clear-all
|
|
||||||
Font: Bold
|
|
||||||
Label@ALPHA_LABEL:
|
|
||||||
X: 6
|
|
||||||
Y: 72
|
|
||||||
Width: 265
|
|
||||||
Height: 25
|
|
||||||
Align: Left
|
|
||||||
Text: label-marker-alpha
|
|
||||||
Slider@ALPHA_SLIDER:
|
|
||||||
X: 130
|
|
||||||
Y: 72
|
|
||||||
Width: 128
|
|
||||||
Height: 25
|
|
||||||
Label@ALPHA_VALUE:
|
|
||||||
X: 260
|
|
||||||
Y: 72
|
|
||||||
Width: 30
|
|
||||||
Height: 25
|
|
||||||
Align: Left
|
|
||||||
Label@MODE_LABEL:
|
|
||||||
X: 6
|
|
||||||
Y: 102
|
|
||||||
Width: 260
|
|
||||||
Height: 25
|
|
||||||
Align: Left
|
|
||||||
Text: label-marker-mirror-mode
|
|
||||||
DropDownButton@MODE_DROPDOWN:
|
|
||||||
X: 129
|
|
||||||
Y: 102
|
|
||||||
Width: 157
|
|
||||||
Height: 25
|
|
||||||
Label@NUM_SIDES_LABEL:
|
|
||||||
X: 6
|
|
||||||
Y: 132
|
|
||||||
Width: 256
|
|
||||||
Height: 25
|
|
||||||
Align: Left
|
|
||||||
Text: label-marker-layer-num-sides
|
|
||||||
Slider@ROTATE_NUM_SIDES_SLIDER:
|
|
||||||
X: 130
|
|
||||||
Y: 132
|
|
||||||
Width: 128
|
|
||||||
Height: 25
|
|
||||||
Visible: false
|
|
||||||
Label@ROTATE_NUM_SIDES_VALUE:
|
|
||||||
X: 260
|
|
||||||
Y: 132
|
|
||||||
Width: 30
|
|
||||||
Height: 25
|
|
||||||
Align: Left
|
|
||||||
Visible: false
|
|
||||||
DropDownButton@FLIP_NUM_SIDES_DROPDOWN:
|
|
||||||
X: 129
|
|
||||||
Y: 132
|
|
||||||
Width: 157
|
|
||||||
Height: 25
|
|
||||||
Label@AXIS_ANGLE_LABEL:
|
|
||||||
X: 6
|
|
||||||
Y: 162
|
|
||||||
Width: 256
|
|
||||||
Height: 25
|
|
||||||
Align: Left
|
|
||||||
Text: label-marker-axis-angle
|
|
||||||
Visible: false
|
|
||||||
Slider@AXIS_ANGLE_SLIDER:
|
|
||||||
X: 130
|
|
||||||
Y: 162
|
|
||||||
Width: 128
|
|
||||||
Height: 25
|
|
||||||
Visible: false
|
|
||||||
Label@AXIS_ANGLE_VALUE:
|
|
||||||
X: 260
|
|
||||||
Y: 162
|
|
||||||
Width: 30
|
|
||||||
Height: 25
|
|
||||||
Align: Left
|
|
||||||
Visible: false
|
|
||||||
ScrollPanel@MAP_GENERATOR_TOOL_PANEL:
|
|
||||||
Y: 25
|
|
||||||
Width: PARENT_WIDTH
|
|
||||||
Height: PARENT_HEIGHT - 25
|
|
||||||
Visible: false
|
|
||||||
ScrollBar: Hidden
|
|
||||||
ScrollbarWidth: 0
|
|
||||||
Logic: MapGeneratorToolLogic
|
|
||||||
Children:
|
|
||||||
LabelForInput@GENERATOR_LABEL:
|
|
||||||
Y: 5
|
|
||||||
Width: 65
|
|
||||||
Height: 25
|
|
||||||
Align: Right
|
|
||||||
Font: TinyBold
|
|
||||||
Text: label-map-generator-generator
|
|
||||||
For: GENERATOR
|
|
||||||
DropDownButton@GENERATOR:
|
|
||||||
X: 70
|
|
||||||
Y: 5
|
|
||||||
Width: PARENT_WIDTH - 75
|
|
||||||
Height: 25
|
|
||||||
Font: Bold
|
|
||||||
Button@GENERATE_BUTTON:
|
|
||||||
X: 5
|
|
||||||
Y: 45
|
|
||||||
Width: 95
|
|
||||||
Height: 25
|
|
||||||
Text: button-map-generator-generate
|
|
||||||
Font: Bold
|
|
||||||
Button@GENERATE_RANDOM_BUTTON:
|
|
||||||
X: 105
|
|
||||||
Y: 45
|
|
||||||
Width: 180
|
|
||||||
Height: 25
|
|
||||||
Text: button-map-generator-generate-random
|
|
||||||
Font: Bold
|
|
||||||
ScrollPanel@SETTINGS_PANEL:
|
|
||||||
X: 0
|
|
||||||
Y: 85
|
|
||||||
Width: PARENT_WIDTH
|
|
||||||
Height: PARENT_HEIGHT - 85
|
|
||||||
Children:
|
|
||||||
Container@CHECKBOX_TEMPLATE:
|
|
||||||
X: 5
|
|
||||||
Width: PARENT_WIDTH - 35
|
|
||||||
Height: 30
|
|
||||||
Children:
|
|
||||||
Checkbox@CHECKBOX:
|
|
||||||
Width: PARENT_WIDTH
|
|
||||||
Height: 25
|
|
||||||
Container@TEXT_TEMPLATE:
|
|
||||||
X: 5
|
|
||||||
Width: PARENT_WIDTH - 35
|
|
||||||
Height: 50
|
|
||||||
Children:
|
|
||||||
LabelForInput@LABEL:
|
|
||||||
Y: 0
|
|
||||||
Width: PARENT_WIDTH
|
|
||||||
Height: 20
|
|
||||||
For: INPUT
|
|
||||||
TextField@INPUT:
|
|
||||||
Y: 20
|
|
||||||
Width: PARENT_WIDTH
|
|
||||||
Height: 25
|
|
||||||
Container@DROPDOWN_TEMPLATE:
|
|
||||||
X: 5
|
|
||||||
Width: PARENT_WIDTH - 35
|
|
||||||
Height: 50
|
|
||||||
Children:
|
|
||||||
LabelForInput@LABEL:
|
|
||||||
Y: 0
|
|
||||||
Width: PARENT_WIDTH
|
|
||||||
Height: 20
|
|
||||||
For: DROPDOWN
|
|
||||||
DropDownButton@DROPDOWN:
|
|
||||||
Y: 20
|
|
||||||
Width: PARENT_WIDTH
|
|
||||||
Height: 25
|
|
||||||
PanelRoot: EDITOR_WORLD_ROOT
|
|
||||||
Container@HISTORY_WIDGETS:
|
Container@HISTORY_WIDGETS:
|
||||||
X: WINDOW_WIDTH - 295
|
X: WINDOW_WIDTH - 295
|
||||||
Y: 318
|
Y: 318
|
||||||
@@ -1085,3 +873,207 @@ ScrollPanel@OVERLAY_PANEL:
|
|||||||
Width: PARENT_WIDTH - 29
|
Width: PARENT_WIDTH - 29
|
||||||
Height: 20
|
Height: 20
|
||||||
Visible: false
|
Visible: false
|
||||||
|
|
||||||
|
Background@MARKER_TOOL_PANEL:
|
||||||
|
Logic: MapMarkerTilesLogic
|
||||||
|
Y: 24
|
||||||
|
Width: PARENT_WIDTH
|
||||||
|
Height: PARENT_HEIGHT - 25
|
||||||
|
Background: scrollpanel-bg
|
||||||
|
Visible: false
|
||||||
|
Children:
|
||||||
|
ScrollPanel@TILE_COLOR_PANEL:
|
||||||
|
X: 6
|
||||||
|
Y: 6
|
||||||
|
Width: PARENT_WIDTH - 19
|
||||||
|
Height: 31
|
||||||
|
TopBottomSpacing: 1
|
||||||
|
ItemSpacing: 1
|
||||||
|
ScrollBar: Hidden
|
||||||
|
ScrollbarWidth: 0
|
||||||
|
ContentHeight: 31
|
||||||
|
Children:
|
||||||
|
ScrollItem@TILE_COLOR_TEMPLATE:
|
||||||
|
Visible: false
|
||||||
|
Height: 29
|
||||||
|
Width: 29
|
||||||
|
IgnoreChildMouseOver: true
|
||||||
|
Children:
|
||||||
|
ColorBlock@TILE_PREVIEW:
|
||||||
|
X: 2
|
||||||
|
Y: 2
|
||||||
|
Width: 26
|
||||||
|
Height: 26
|
||||||
|
ScrollItem@TILE_ICON_TEMPLATE:
|
||||||
|
Visible: false
|
||||||
|
Height: 29
|
||||||
|
Width: 29
|
||||||
|
IgnoreChildMouseOver: true
|
||||||
|
Children:
|
||||||
|
Image@TILE_ERASE:
|
||||||
|
X: 6
|
||||||
|
Y: 6
|
||||||
|
Width: 26
|
||||||
|
Height: 26
|
||||||
|
ImageCollection: editor
|
||||||
|
ImageName: erase
|
||||||
|
Button@CLEAR_CURRENT_BUTTON:
|
||||||
|
X: 6
|
||||||
|
Y: 42
|
||||||
|
Width: 100
|
||||||
|
Height: 25
|
||||||
|
Text: button-marker-tiles-clear-current
|
||||||
|
Font: Bold
|
||||||
|
Button@CLEAR_ALL_BUTTON:
|
||||||
|
X: 111
|
||||||
|
Y: 42
|
||||||
|
Width: 75
|
||||||
|
Height: 25
|
||||||
|
Text: button-marker-tiles-clear-all
|
||||||
|
Font: Bold
|
||||||
|
Label@ALPHA_LABEL:
|
||||||
|
X: 6
|
||||||
|
Y: 72
|
||||||
|
Width: 265
|
||||||
|
Height: 25
|
||||||
|
Align: Left
|
||||||
|
Text: label-marker-alpha
|
||||||
|
Slider@ALPHA_SLIDER:
|
||||||
|
X: 130
|
||||||
|
Y: 72
|
||||||
|
Width: 128
|
||||||
|
Height: 25
|
||||||
|
Label@ALPHA_VALUE:
|
||||||
|
X: 260
|
||||||
|
Y: 72
|
||||||
|
Width: 30
|
||||||
|
Height: 25
|
||||||
|
Align: Left
|
||||||
|
Label@MODE_LABEL:
|
||||||
|
X: 6
|
||||||
|
Y: 102
|
||||||
|
Width: 260
|
||||||
|
Height: 25
|
||||||
|
Align: Left
|
||||||
|
Text: label-marker-mirror-mode
|
||||||
|
DropDownButton@MODE_DROPDOWN:
|
||||||
|
X: 129
|
||||||
|
Y: 102
|
||||||
|
Width: 157
|
||||||
|
Height: 25
|
||||||
|
Label@NUM_SIDES_LABEL:
|
||||||
|
X: 6
|
||||||
|
Y: 132
|
||||||
|
Width: 256
|
||||||
|
Height: 25
|
||||||
|
Align: Left
|
||||||
|
Text: label-marker-layer-num-sides
|
||||||
|
Slider@ROTATE_NUM_SIDES_SLIDER:
|
||||||
|
X: 130
|
||||||
|
Y: 132
|
||||||
|
Width: 128
|
||||||
|
Height: 25
|
||||||
|
Visible: false
|
||||||
|
Label@ROTATE_NUM_SIDES_VALUE:
|
||||||
|
X: 260
|
||||||
|
Y: 132
|
||||||
|
Width: 30
|
||||||
|
Height: 25
|
||||||
|
Align: Left
|
||||||
|
Visible: false
|
||||||
|
DropDownButton@FLIP_NUM_SIDES_DROPDOWN:
|
||||||
|
X: 129
|
||||||
|
Y: 132
|
||||||
|
Width: 157
|
||||||
|
Height: 25
|
||||||
|
Label@AXIS_ANGLE_LABEL:
|
||||||
|
X: 6
|
||||||
|
Y: 162
|
||||||
|
Width: 256
|
||||||
|
Height: 25
|
||||||
|
Align: Left
|
||||||
|
Text: label-marker-axis-angle
|
||||||
|
Visible: false
|
||||||
|
Slider@AXIS_ANGLE_SLIDER:
|
||||||
|
X: 130
|
||||||
|
Y: 162
|
||||||
|
Width: 128
|
||||||
|
Height: 25
|
||||||
|
Visible: false
|
||||||
|
Label@AXIS_ANGLE_VALUE:
|
||||||
|
X: 260
|
||||||
|
Y: 162
|
||||||
|
Width: 30
|
||||||
|
Height: 25
|
||||||
|
Align: Left
|
||||||
|
Visible: false
|
||||||
|
|
||||||
|
Container@MAP_GENERATOR_TOOL_PANEL:
|
||||||
|
Logic: MapGeneratorToolLogic
|
||||||
|
Y: 24
|
||||||
|
Width: PARENT_WIDTH
|
||||||
|
Height: PARENT_HEIGHT - 25
|
||||||
|
Visible: false
|
||||||
|
Children:
|
||||||
|
Background@BUTTON_BG:
|
||||||
|
Background: panel-black
|
||||||
|
Width: PARENT_WIDTH
|
||||||
|
Height: 35
|
||||||
|
Children:
|
||||||
|
Button@GENERATE_BUTTON:
|
||||||
|
X: 5
|
||||||
|
Y: 5
|
||||||
|
Width: 95
|
||||||
|
Height: 25
|
||||||
|
Text: button-map-generator-generate
|
||||||
|
Font: Bold
|
||||||
|
Button@GENERATE_RANDOM_BUTTON:
|
||||||
|
X: 105
|
||||||
|
Y: 5
|
||||||
|
Width: 180
|
||||||
|
Height: 25
|
||||||
|
Text: button-map-generator-generate-random
|
||||||
|
Font: Bold
|
||||||
|
ScrollPanel@SETTINGS_PANEL:
|
||||||
|
X: 0
|
||||||
|
Y: 34
|
||||||
|
Width: PARENT_WIDTH
|
||||||
|
Height: PARENT_HEIGHT - 35
|
||||||
|
Children:
|
||||||
|
Container@CHECKBOX_TEMPLATE:
|
||||||
|
X: 5
|
||||||
|
Width: PARENT_WIDTH - 35
|
||||||
|
Height: 30
|
||||||
|
Children:
|
||||||
|
Checkbox@CHECKBOX:
|
||||||
|
Width: PARENT_WIDTH
|
||||||
|
Height: 25
|
||||||
|
Container@TEXT_TEMPLATE:
|
||||||
|
X: 5
|
||||||
|
Width: PARENT_WIDTH - 35
|
||||||
|
Height: 50
|
||||||
|
Children:
|
||||||
|
LabelForInput@LABEL:
|
||||||
|
Y: 0
|
||||||
|
Width: PARENT_WIDTH
|
||||||
|
Height: 20
|
||||||
|
For: INPUT
|
||||||
|
TextField@INPUT:
|
||||||
|
Y: 20
|
||||||
|
Width: PARENT_WIDTH
|
||||||
|
Height: 25
|
||||||
|
Container@DROPDOWN_TEMPLATE:
|
||||||
|
X: 5
|
||||||
|
Width: PARENT_WIDTH - 35
|
||||||
|
Height: 50
|
||||||
|
Children:
|
||||||
|
LabelForInput@LABEL:
|
||||||
|
Y: 0
|
||||||
|
Width: PARENT_WIDTH
|
||||||
|
Height: 20
|
||||||
|
For: DROPDOWN
|
||||||
|
DropDownButton@DROPDOWN:
|
||||||
|
Y: 20
|
||||||
|
Width: PARENT_WIDTH
|
||||||
|
Height: 25
|
||||||
|
PanelRoot: EDITOR_WORLD_ROOT
|
||||||
|
|||||||
@@ -76,7 +76,6 @@ label-marker-layer-num-sides = Number of Sides
|
|||||||
label-marker-alpha = Tile Alpha
|
label-marker-alpha = Tile Alpha
|
||||||
label-marker-mirror-mode = Mirror Mode
|
label-marker-mirror-mode = Mirror Mode
|
||||||
label-marker-axis-angle = Axis Angle
|
label-marker-axis-angle = Axis Angle
|
||||||
label-map-generator-generator = Generator
|
|
||||||
button-map-generator-generate = Generate
|
button-map-generator-generate = Generate
|
||||||
button-map-generator-generate-random = Generate Random
|
button-map-generator-generate-random = Generate Random
|
||||||
|
|
||||||
@@ -116,7 +115,6 @@ button-select-categories-buttons-all = All
|
|||||||
button-select-categories-buttons-none = None
|
button-select-categories-buttons-none = None
|
||||||
|
|
||||||
label-tool-marker-tiles = Marker Tiles
|
label-tool-marker-tiles = Marker Tiles
|
||||||
label-tool-map-generator = Map Generator
|
|
||||||
|
|
||||||
## encyclopedia.yaml, mainmenu.yaml
|
## encyclopedia.yaml, mainmenu.yaml
|
||||||
label-encyclopedia-title = EVA Database
|
label-encyclopedia-title = EVA Database
|
||||||
|
|||||||
@@ -51,8 +51,8 @@ faction-nod =
|
|||||||
and the alien substance Tiberium. They use stealth technology
|
and the alien substance Tiberium. They use stealth technology
|
||||||
and guerilla tactics to defeat those who oppose them.
|
and guerilla tactics to defeat those who oppose them.
|
||||||
|
|
||||||
map-generator-experimental = Experimental
|
map-generator-experimental = Experimental RMG
|
||||||
map-generator-clear = Clear
|
map-generator-clear = Clear Terrain
|
||||||
|
|
||||||
## defaults.yaml
|
## defaults.yaml
|
||||||
notification-unit-lost = Unit lost.
|
notification-unit-lost = Unit lost.
|
||||||
|
|||||||
@@ -281,7 +281,6 @@ World:
|
|||||||
|
|
||||||
EditorWorld:
|
EditorWorld:
|
||||||
Inherits: ^BaseWorld
|
Inherits: ^BaseWorld
|
||||||
Inherits@MapGenerators: ^MapGenerators
|
|
||||||
EditorActorLayer:
|
EditorActorLayer:
|
||||||
EditorCursorLayer:
|
EditorCursorLayer:
|
||||||
EditorResourceLayer:
|
EditorResourceLayer:
|
||||||
@@ -302,3 +301,4 @@ EditorWorld:
|
|||||||
BuildableTerrainOverlay:
|
BuildableTerrainOverlay:
|
||||||
AllowedTerrainTypes: Clear, Road
|
AllowedTerrainTypes: Clear, Road
|
||||||
MarkerLayerOverlay:
|
MarkerLayerOverlay:
|
||||||
|
Inherits@MapGenerators: ^MapGenerators
|
||||||
|
|||||||
@@ -408,220 +408,6 @@ Container@EDITOR_WORLD_ROOT:
|
|||||||
Width: PARENT_WIDTH - 70
|
Width: PARENT_WIDTH - 70
|
||||||
Height: 25
|
Height: 25
|
||||||
Font: Bold
|
Font: Bold
|
||||||
Background@MARKER_TOOL_PANEL:
|
|
||||||
X: 10
|
|
||||||
Y: 35
|
|
||||||
Width: PARENT_WIDTH - 20
|
|
||||||
Height: WINDOW_HEIGHT - 490
|
|
||||||
Background: scrollpanel-bg
|
|
||||||
Logic: MapMarkerTilesLogic
|
|
||||||
Children:
|
|
||||||
ScrollPanel@TILE_COLOR_PANEL:
|
|
||||||
X: 6
|
|
||||||
Y: 6
|
|
||||||
Width: PARENT_WIDTH - 19
|
|
||||||
Height: 31
|
|
||||||
TopBottomSpacing: 1
|
|
||||||
ItemSpacing: 1
|
|
||||||
ScrollBar: Hidden
|
|
||||||
ScrollbarWidth: 0
|
|
||||||
ContentHeight: 31
|
|
||||||
Children:
|
|
||||||
ScrollItem@TILE_COLOR_TEMPLATE:
|
|
||||||
Visible: false
|
|
||||||
Height: 29
|
|
||||||
Width: 29
|
|
||||||
IgnoreChildMouseOver: true
|
|
||||||
Children:
|
|
||||||
ColorBlock@TILE_PREVIEW:
|
|
||||||
X: 2
|
|
||||||
Y: 2
|
|
||||||
Width: 26
|
|
||||||
Height: 26
|
|
||||||
ScrollItem@TILE_ICON_TEMPLATE:
|
|
||||||
Visible: false
|
|
||||||
Height: 29
|
|
||||||
Width: 29
|
|
||||||
IgnoreChildMouseOver: true
|
|
||||||
Children:
|
|
||||||
Image@TILE_ERASE:
|
|
||||||
X: 6
|
|
||||||
Y: 6
|
|
||||||
Width: 26
|
|
||||||
Height: 26
|
|
||||||
ImageCollection: editor
|
|
||||||
ImageName: erase
|
|
||||||
Button@CLEAR_CURRENT_BUTTON:
|
|
||||||
X: 6
|
|
||||||
Y: 42
|
|
||||||
Width: 100
|
|
||||||
Height: 25
|
|
||||||
Text: button-marker-tiles-clear-current
|
|
||||||
Font: Bold
|
|
||||||
Button@CLEAR_ALL_BUTTON:
|
|
||||||
X: 111
|
|
||||||
Y: 42
|
|
||||||
Width: 75
|
|
||||||
Height: 25
|
|
||||||
Text: button-marker-tiles-clear-all
|
|
||||||
Font: Bold
|
|
||||||
Label@ALPHA_LABEL:
|
|
||||||
X: 6
|
|
||||||
Y: 72
|
|
||||||
Width: 265
|
|
||||||
Height: 25
|
|
||||||
Align: Left
|
|
||||||
Text: label-marker-alpha
|
|
||||||
Slider@ALPHA_SLIDER:
|
|
||||||
X: 130
|
|
||||||
Y: 72
|
|
||||||
Width: 128
|
|
||||||
Height: 25
|
|
||||||
Label@ALPHA_VALUE:
|
|
||||||
X: 260
|
|
||||||
Y: 72
|
|
||||||
Width: 30
|
|
||||||
Height: 25
|
|
||||||
Align: Left
|
|
||||||
Label@MODE_LABEL:
|
|
||||||
X: 6
|
|
||||||
Y: 102
|
|
||||||
Width: 260
|
|
||||||
Height: 25
|
|
||||||
Align: Left
|
|
||||||
Text: label-marker-mirror-mode
|
|
||||||
DropDownButton@MODE_DROPDOWN:
|
|
||||||
X: 129
|
|
||||||
Y: 102
|
|
||||||
Width: 157
|
|
||||||
Height: 25
|
|
||||||
Label@NUM_SIDES_LABEL:
|
|
||||||
X: 6
|
|
||||||
Y: 132
|
|
||||||
Width: 256
|
|
||||||
Height: 25
|
|
||||||
Align: Left
|
|
||||||
Text: label-marker-layer-num-sides
|
|
||||||
Slider@ROTATE_NUM_SIDES_SLIDER:
|
|
||||||
X: 130
|
|
||||||
Y: 132
|
|
||||||
Width: 128
|
|
||||||
Height: 25
|
|
||||||
Visible: false
|
|
||||||
Label@ROTATE_NUM_SIDES_VALUE:
|
|
||||||
X: 260
|
|
||||||
Y: 132
|
|
||||||
Width: 30
|
|
||||||
Height: 25
|
|
||||||
Align: Left
|
|
||||||
Visible: false
|
|
||||||
DropDownButton@FLIP_NUM_SIDES_DROPDOWN:
|
|
||||||
X: 129
|
|
||||||
Y: 132
|
|
||||||
Width: 157
|
|
||||||
Height: 25
|
|
||||||
Label@AXIS_ANGLE_LABEL:
|
|
||||||
X: 6
|
|
||||||
Y: 162
|
|
||||||
Width: 256
|
|
||||||
Height: 25
|
|
||||||
Align: Left
|
|
||||||
Text: label-marker-axis-angle
|
|
||||||
Visible: false
|
|
||||||
Slider@AXIS_ANGLE_SLIDER:
|
|
||||||
X: 130
|
|
||||||
Y: 162
|
|
||||||
Width: 128
|
|
||||||
Height: 25
|
|
||||||
Visible: false
|
|
||||||
Label@AXIS_ANGLE_VALUE:
|
|
||||||
X: 260
|
|
||||||
Y: 162
|
|
||||||
Width: 30
|
|
||||||
Height: 25
|
|
||||||
Align: Left
|
|
||||||
Visible: false
|
|
||||||
ScrollPanel@MAP_GENERATOR_TOOL_PANEL:
|
|
||||||
X: 9
|
|
||||||
Y: 35
|
|
||||||
Width: 290
|
|
||||||
Height: WINDOW_HEIGHT - 490
|
|
||||||
Visible: false
|
|
||||||
ScrollBar: Hidden
|
|
||||||
ScrollbarWidth: 0
|
|
||||||
Logic: MapGeneratorToolLogic
|
|
||||||
Children:
|
|
||||||
LabelForInput@GENERATOR_LABEL:
|
|
||||||
Y: 5
|
|
||||||
Width: 65
|
|
||||||
Height: 25
|
|
||||||
Align: Right
|
|
||||||
Font: TinyBold
|
|
||||||
Text: label-map-generator-generator
|
|
||||||
For: GENERATOR
|
|
||||||
DropDownButton@GENERATOR:
|
|
||||||
X: 70
|
|
||||||
Y: 5
|
|
||||||
Width: PARENT_WIDTH - 75
|
|
||||||
Height: 25
|
|
||||||
Font: Bold
|
|
||||||
Button@GENERATE_BUTTON:
|
|
||||||
X: 5
|
|
||||||
Y: 45
|
|
||||||
Width: 95
|
|
||||||
Height: 25
|
|
||||||
Text: button-map-generator-generate
|
|
||||||
Font: Bold
|
|
||||||
Button@GENERATE_RANDOM_BUTTON:
|
|
||||||
X: 105
|
|
||||||
Y: 45
|
|
||||||
Width: 180
|
|
||||||
Height: 25
|
|
||||||
Text: button-map-generator-generate-random
|
|
||||||
Font: Bold
|
|
||||||
ScrollPanel@SETTINGS_PANEL:
|
|
||||||
X: 0
|
|
||||||
Y: 85
|
|
||||||
Width: PARENT_WIDTH
|
|
||||||
Height: PARENT_HEIGHT - 85
|
|
||||||
Children:
|
|
||||||
Container@CHECKBOX_TEMPLATE:
|
|
||||||
X: 5
|
|
||||||
Width: PARENT_WIDTH - 35
|
|
||||||
Height: 30
|
|
||||||
Children:
|
|
||||||
Checkbox@CHECKBOX:
|
|
||||||
Width: PARENT_WIDTH
|
|
||||||
Height: 25
|
|
||||||
Container@TEXT_TEMPLATE:
|
|
||||||
X: 5
|
|
||||||
Width: PARENT_WIDTH - 35
|
|
||||||
Height: 50
|
|
||||||
Children:
|
|
||||||
LabelForInput@LABEL:
|
|
||||||
Y: 0
|
|
||||||
Width: PARENT_WIDTH
|
|
||||||
Height: 20
|
|
||||||
For: INPUT
|
|
||||||
TextField@INPUT:
|
|
||||||
Y: 20
|
|
||||||
Width: PARENT_WIDTH
|
|
||||||
Height: 25
|
|
||||||
Container@DROPDOWN_TEMPLATE:
|
|
||||||
X: 5
|
|
||||||
Width: PARENT_WIDTH - 35
|
|
||||||
Height: 50
|
|
||||||
Children:
|
|
||||||
LabelForInput@LABEL:
|
|
||||||
Y: 0
|
|
||||||
Width: PARENT_WIDTH
|
|
||||||
Height: 20
|
|
||||||
For: DROPDOWN
|
|
||||||
DropDownButton@DROPDOWN:
|
|
||||||
Y: 20
|
|
||||||
Width: PARENT_WIDTH
|
|
||||||
Height: 25
|
|
||||||
PanelRoot: EDITOR_WORLD_ROOT
|
|
||||||
Container@HISTORY_WIDGETS:
|
Container@HISTORY_WIDGETS:
|
||||||
X: WINDOW_WIDTH - 320
|
X: WINDOW_WIDTH - 320
|
||||||
Y: 354
|
Y: 354
|
||||||
@@ -1062,3 +848,205 @@ ScrollPanel@OVERLAY_PANEL:
|
|||||||
Width: PARENT_WIDTH - 29
|
Width: PARENT_WIDTH - 29
|
||||||
Height: 20
|
Height: 20
|
||||||
Visible: false
|
Visible: false
|
||||||
|
|
||||||
|
Background@MARKER_TOOL_PANEL:
|
||||||
|
X: 10
|
||||||
|
Y: 35
|
||||||
|
Width: PARENT_WIDTH - 20
|
||||||
|
Height: WINDOW_HEIGHT - 490
|
||||||
|
Background: scrollpanel-bg
|
||||||
|
Logic: MapMarkerTilesLogic
|
||||||
|
Children:
|
||||||
|
ScrollPanel@TILE_COLOR_PANEL:
|
||||||
|
X: 6
|
||||||
|
Y: 6
|
||||||
|
Width: PARENT_WIDTH - 19
|
||||||
|
Height: 31
|
||||||
|
TopBottomSpacing: 1
|
||||||
|
ItemSpacing: 1
|
||||||
|
ScrollBar: Hidden
|
||||||
|
ScrollbarWidth: 0
|
||||||
|
ContentHeight: 31
|
||||||
|
Children:
|
||||||
|
ScrollItem@TILE_COLOR_TEMPLATE:
|
||||||
|
Visible: false
|
||||||
|
Height: 29
|
||||||
|
Width: 29
|
||||||
|
IgnoreChildMouseOver: true
|
||||||
|
Children:
|
||||||
|
ColorBlock@TILE_PREVIEW:
|
||||||
|
X: 2
|
||||||
|
Y: 2
|
||||||
|
Width: 26
|
||||||
|
Height: 26
|
||||||
|
ScrollItem@TILE_ICON_TEMPLATE:
|
||||||
|
Visible: false
|
||||||
|
Height: 29
|
||||||
|
Width: 29
|
||||||
|
IgnoreChildMouseOver: true
|
||||||
|
Children:
|
||||||
|
Image@TILE_ERASE:
|
||||||
|
X: 6
|
||||||
|
Y: 6
|
||||||
|
Width: 26
|
||||||
|
Height: 26
|
||||||
|
ImageCollection: editor
|
||||||
|
ImageName: erase
|
||||||
|
Button@CLEAR_CURRENT_BUTTON:
|
||||||
|
X: 6
|
||||||
|
Y: 42
|
||||||
|
Width: 100
|
||||||
|
Height: 25
|
||||||
|
Text: button-marker-tiles-clear-current
|
||||||
|
Font: Bold
|
||||||
|
Button@CLEAR_ALL_BUTTON:
|
||||||
|
X: 111
|
||||||
|
Y: 42
|
||||||
|
Width: 75
|
||||||
|
Height: 25
|
||||||
|
Text: button-marker-tiles-clear-all
|
||||||
|
Font: Bold
|
||||||
|
Label@ALPHA_LABEL:
|
||||||
|
X: 6
|
||||||
|
Y: 72
|
||||||
|
Width: 265
|
||||||
|
Height: 25
|
||||||
|
Align: Left
|
||||||
|
Text: label-marker-alpha
|
||||||
|
Slider@ALPHA_SLIDER:
|
||||||
|
X: 130
|
||||||
|
Y: 72
|
||||||
|
Width: 128
|
||||||
|
Height: 25
|
||||||
|
Label@ALPHA_VALUE:
|
||||||
|
X: 260
|
||||||
|
Y: 72
|
||||||
|
Width: 30
|
||||||
|
Height: 25
|
||||||
|
Align: Left
|
||||||
|
Label@MODE_LABEL:
|
||||||
|
X: 6
|
||||||
|
Y: 102
|
||||||
|
Width: 260
|
||||||
|
Height: 25
|
||||||
|
Align: Left
|
||||||
|
Text: label-marker-mirror-mode
|
||||||
|
DropDownButton@MODE_DROPDOWN:
|
||||||
|
X: 129
|
||||||
|
Y: 102
|
||||||
|
Width: 157
|
||||||
|
Height: 25
|
||||||
|
Label@NUM_SIDES_LABEL:
|
||||||
|
X: 6
|
||||||
|
Y: 132
|
||||||
|
Width: 256
|
||||||
|
Height: 25
|
||||||
|
Align: Left
|
||||||
|
Text: label-marker-layer-num-sides
|
||||||
|
Slider@ROTATE_NUM_SIDES_SLIDER:
|
||||||
|
X: 130
|
||||||
|
Y: 132
|
||||||
|
Width: 128
|
||||||
|
Height: 25
|
||||||
|
Visible: false
|
||||||
|
Label@ROTATE_NUM_SIDES_VALUE:
|
||||||
|
X: 260
|
||||||
|
Y: 132
|
||||||
|
Width: 30
|
||||||
|
Height: 25
|
||||||
|
Align: Left
|
||||||
|
Visible: false
|
||||||
|
DropDownButton@FLIP_NUM_SIDES_DROPDOWN:
|
||||||
|
X: 129
|
||||||
|
Y: 132
|
||||||
|
Width: 157
|
||||||
|
Height: 25
|
||||||
|
Label@AXIS_ANGLE_LABEL:
|
||||||
|
X: 6
|
||||||
|
Y: 162
|
||||||
|
Width: 256
|
||||||
|
Height: 25
|
||||||
|
Align: Left
|
||||||
|
Text: label-marker-axis-angle
|
||||||
|
Visible: false
|
||||||
|
Slider@AXIS_ANGLE_SLIDER:
|
||||||
|
X: 130
|
||||||
|
Y: 162
|
||||||
|
Width: 128
|
||||||
|
Height: 25
|
||||||
|
Visible: false
|
||||||
|
Label@AXIS_ANGLE_VALUE:
|
||||||
|
X: 260
|
||||||
|
Y: 162
|
||||||
|
Width: 30
|
||||||
|
Height: 25
|
||||||
|
Align: Left
|
||||||
|
Visible: false
|
||||||
|
|
||||||
|
ScrollPanel@MAP_GENERATOR_TOOL_PANEL:
|
||||||
|
X: 9
|
||||||
|
Y: 35
|
||||||
|
Width: 290
|
||||||
|
Height: WINDOW_HEIGHT - 490
|
||||||
|
Visible: false
|
||||||
|
ScrollBar: Hidden
|
||||||
|
ScrollbarWidth: 0
|
||||||
|
Logic: MapGeneratorToolLogic
|
||||||
|
Children:
|
||||||
|
Button@GENERATE_BUTTON:
|
||||||
|
X: 5
|
||||||
|
Y: 5
|
||||||
|
Width: 95
|
||||||
|
Height: 25
|
||||||
|
Text: button-map-generator-generate
|
||||||
|
Font: Bold
|
||||||
|
Button@GENERATE_RANDOM_BUTTON:
|
||||||
|
X: 105
|
||||||
|
Y: 5
|
||||||
|
Width: 180
|
||||||
|
Height: 25
|
||||||
|
Text: button-map-generator-generate-random
|
||||||
|
Font: Bold
|
||||||
|
ScrollPanel@SETTINGS_PANEL:
|
||||||
|
X: 0
|
||||||
|
Y: 35
|
||||||
|
Width: PARENT_WIDTH
|
||||||
|
Height: PARENT_HEIGHT - 35
|
||||||
|
Children:
|
||||||
|
Container@CHECKBOX_TEMPLATE:
|
||||||
|
X: 5
|
||||||
|
Width: PARENT_WIDTH - 35
|
||||||
|
Height: 30
|
||||||
|
Children:
|
||||||
|
Checkbox@CHECKBOX:
|
||||||
|
Width: PARENT_WIDTH
|
||||||
|
Height: 25
|
||||||
|
Container@TEXT_TEMPLATE:
|
||||||
|
X: 5
|
||||||
|
Width: PARENT_WIDTH - 35
|
||||||
|
Height: 50
|
||||||
|
Children:
|
||||||
|
LabelForInput@LABEL:
|
||||||
|
Y: 0
|
||||||
|
Width: PARENT_WIDTH
|
||||||
|
Height: 20
|
||||||
|
For: INPUT
|
||||||
|
TextField@INPUT:
|
||||||
|
Y: 20
|
||||||
|
Width: PARENT_WIDTH
|
||||||
|
Height: 25
|
||||||
|
Container@DROPDOWN_TEMPLATE:
|
||||||
|
X: 5
|
||||||
|
Width: PARENT_WIDTH - 35
|
||||||
|
Height: 50
|
||||||
|
Children:
|
||||||
|
LabelForInput@LABEL:
|
||||||
|
Y: 0
|
||||||
|
Width: PARENT_WIDTH
|
||||||
|
Height: 20
|
||||||
|
For: DROPDOWN
|
||||||
|
DropDownButton@DROPDOWN:
|
||||||
|
Y: 20
|
||||||
|
Width: PARENT_WIDTH
|
||||||
|
Height: 25
|
||||||
|
PanelRoot: EDITOR_WORLD_ROOT
|
||||||
@@ -72,7 +72,6 @@ label-marker-layer-num-sides = Number of Sides
|
|||||||
label-marker-alpha = Tile Alpha
|
label-marker-alpha = Tile Alpha
|
||||||
label-marker-mirror-mode = Mirror Mode
|
label-marker-mirror-mode = Mirror Mode
|
||||||
label-marker-axis-angle = Axis Angle
|
label-marker-axis-angle = Axis Angle
|
||||||
label-map-generator-generator = Generator
|
|
||||||
button-map-generator-generate = Generate
|
button-map-generator-generate = Generate
|
||||||
button-map-generator-generate-random = Generate Random
|
button-map-generator-generate-random = Generate Random
|
||||||
|
|
||||||
@@ -116,7 +115,6 @@ button-select-categories-buttons-all = All
|
|||||||
button-select-categories-buttons-none = None
|
button-select-categories-buttons-none = None
|
||||||
|
|
||||||
label-tool-marker-tiles = Marker Tiles
|
label-tool-marker-tiles = Marker Tiles
|
||||||
label-tool-map-generator = Map Generator
|
|
||||||
|
|
||||||
## gamesave-browser.yaml
|
## gamesave-browser.yaml
|
||||||
label-gamesave-browser-panel-load-title = Load game
|
label-gamesave-browser-panel-load-title = Load game
|
||||||
|
|||||||
@@ -34,8 +34,8 @@ options-starting-units =
|
|||||||
|
|
||||||
resource-minerals = Valuable Minerals
|
resource-minerals = Valuable Minerals
|
||||||
|
|
||||||
map-generator-experimental = Experimental
|
map-generator-experimental = Experimental RMG
|
||||||
map-generator-clear = Clear
|
map-generator-clear = Clear Terrain
|
||||||
|
|
||||||
## Faction
|
## Faction
|
||||||
faction-allies =
|
faction-allies =
|
||||||
|
|||||||
@@ -299,7 +299,6 @@ World:
|
|||||||
|
|
||||||
EditorWorld:
|
EditorWorld:
|
||||||
Inherits: ^BaseWorld
|
Inherits: ^BaseWorld
|
||||||
Inherits@MapGenerators: ^MapGenerators
|
|
||||||
EditorActorLayer:
|
EditorActorLayer:
|
||||||
EditorCursorLayer:
|
EditorCursorLayer:
|
||||||
EditorResourceLayer:
|
EditorResourceLayer:
|
||||||
@@ -320,3 +319,4 @@ EditorWorld:
|
|||||||
BuildableTerrainOverlay:
|
BuildableTerrainOverlay:
|
||||||
AllowedTerrainTypes: Clear, Road
|
AllowedTerrainTypes: Clear, Road
|
||||||
MarkerLayerOverlay:
|
MarkerLayerOverlay:
|
||||||
|
Inherits@MapGenerators: ^MapGenerators
|
||||||
|
|||||||
Reference in New Issue
Block a user