abbreviate the user support folder as in mod.yaml

This commit is contained in:
Matthias Mailänder
2013-11-17 17:22:20 +01:00
parent 6171ea7cf3
commit d9ac907315

View File

@@ -41,7 +41,8 @@ namespace OpenRA.Mods.RA.Widgets.Logic
sourceDropdown.OnMouseDown = _ => ShowSourceDropdown(sourceDropdown); sourceDropdown.OnMouseDown = _ => ShowSourceDropdown(sourceDropdown);
sourceDropdown.GetText = () => sourceDropdown.GetText = () =>
{ {
var name = assetSource != null ? assetSource.Name : "All Packages"; var name = assetSource != null ? assetSource.Name.Replace(Platform.SupportDir, "^") : "All Packages";
if (name.Length > 15) if (name.Length > 15)
name = "..." + name.Substring(name.Length - 15); name = "..." + name.Substring(name.Length - 15);
@@ -220,7 +221,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
var item = ScrollItemWidget.Setup(itemTemplate, var item = ScrollItemWidget.Setup(itemTemplate,
() => assetSource == source, () => assetSource == source,
() => { assetSource = source; PopulateAssetList(); }); () => { assetSource = source; PopulateAssetList(); });
item.Get<LabelWidget>("LABEL").GetText = () => source != null ? source.Name : "All Packages"; item.Get<LabelWidget>("LABEL").GetText = () => source != null ? source.Name.Replace(Platform.SupportDir, "^") : "All Packages";
return item; return item;
}; };