mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-02 18:17:09 +02:00
1. Add XAML namespaces https://spacestation14.io with Avalonia hacks. 2. Make markup extensions work with Avalonia hacks. 3. Add LocExtension for localized strings. 4. Add Vector2 parsing type converter to XAML compilation. 5. Make SS14Window better thanks to these improvements.
24 lines
540 B
C#
24 lines
540 B
C#
using JetBrains.Annotations;
|
|
using Robust.Shared.Localization;
|
|
|
|
namespace Robust.Client.UserInterface
|
|
{
|
|
// TODO: Code a XAML compiler transformer to remove references to this type at compile time.
|
|
// And just replace them with the Loc.GetString() call.
|
|
[PublicAPI]
|
|
public class LocExtension
|
|
{
|
|
public string Key { get; }
|
|
|
|
public LocExtension(string key)
|
|
{
|
|
Key = key;
|
|
}
|
|
|
|
public object ProvideValue()
|
|
{
|
|
return Loc.GetString(Key);
|
|
}
|
|
}
|
|
}
|