diff --git a/Assets/GameScripts.cs b/Assets/GameScripts.cs index a4b97ac2..ef616133 100644 --- a/Assets/GameScripts.cs +++ b/Assets/GameScripts.cs @@ -73,11 +73,9 @@ public static PropertiesObjectType FindTypeWithName(PropertiesObjectType[] types DelaySensor.objectType }; - public static string[] sensorTabNames = new string[] { "Detect", "Logic" }; - public static PropertiesObjectType[][] sensorTabs = new PropertiesObjectType[][] { - new PropertiesObjectType[] + new PropertiesObjectType[] // Detect { PropertiesObjectType.NONE, TouchSensor.objectType, @@ -87,7 +85,7 @@ public static PropertiesObjectType FindTypeWithName(PropertiesObjectType[] types InCameraSensor.objectType, CheckScoreSensor.objectType, }, - new PropertiesObjectType[] + new PropertiesObjectType[] // Logic { InputThresholdSensor.objectType, ToggleSensor.objectType, @@ -127,7 +125,15 @@ public static PropertiesObjectType FindTypeWithName(PropertiesObjectType[] types Sound3DBehavior.objectType }; - public static string[] behaviorTabNames = new string[] { "Motion", "Graphics", "Life", "Physics", "Sound" }; + public static string[] BehaviorTabNames(GUIStringSet s) => + new string[] + { + s.BehaviorsMotion, + s.BehaviorsGraphics, + s.BehaviorsLife, + s.BehaviorsPhysics, + s.BehaviorsSound, + }; public static BehaviorType[][] behaviorTabs = new BehaviorType[][] { diff --git a/Assets/VoxelEditor/GUI/FilterGUI.cs b/Assets/VoxelEditor/GUI/FilterGUI.cs index bd87539a..bb7c1241 100644 --- a/Assets/VoxelEditor/GUI/FilterGUI.cs +++ b/Assets/VoxelEditor/GUI/FilterGUI.cs @@ -52,7 +52,7 @@ public override void WindowGUI() { TypePickerGUI picker = gameObject.AddComponent(); picker.title = StringSet.FilterActiveBehaviorTitle; - picker.categoryNames = GameScripts.behaviorTabNames; + picker.categoryNames = GameScripts.BehaviorTabNames(StringSet); picker.categories = GameScripts.behaviorTabs; picker.handler = (PropertiesObjectType type) => { diff --git a/Assets/VoxelEditor/GUI/PropertiesGUI.cs b/Assets/VoxelEditor/GUI/PropertiesGUI.cs index a952042b..02b122c9 100644 --- a/Assets/VoxelEditor/GUI/PropertiesGUI.cs +++ b/Assets/VoxelEditor/GUI/PropertiesGUI.cs @@ -372,7 +372,8 @@ private void EntityPropertiesGUI() { TypePickerGUI sensorMenu = gameObject.AddComponent(); sensorMenu.title = StringSet.ChangeSensor; - sensorMenu.categoryNames = GameScripts.sensorTabNames; + sensorMenu.categoryNames = + new string[] { StringSet.SensorsDetect, StringSet.SensorsLogic }; sensorMenu.categories = GameScripts.sensorTabs; sensorMenu.handler = (PropertiesObjectType type) => { @@ -552,7 +553,7 @@ public override Rect GetRect(Rect safeRect, Rect screenRect) void Start() { typePicker = gameObject.AddComponent(); - typePicker.categoryNames = GameScripts.behaviorTabNames; + typePicker.categoryNames = GameScripts.BehaviorTabNames(StringSet); UpdateBehaviorList(); typePicker.handler = (PropertiesObjectType type) => { diff --git a/Assets/VoxelEditor/GUI/localization/GUIStringSet.cs b/Assets/VoxelEditor/GUI/localization/GUIStringSet.cs index ee1847c9..588734e4 100644 --- a/Assets/VoxelEditor/GUI/localization/GUIStringSet.cs +++ b/Assets/VoxelEditor/GUI/localization/GUIStringSet.cs @@ -144,12 +144,26 @@ public virtual string UntitledWorldName(System.DateTime date) => public virtual string PickObjectCount(int count) => $"{count} objects selected"; - // Type names + // Categories public virtual string Substance => "Substance"; public virtual string Object => "Object"; - + public virtual string SensorsDetect => + "Detect"; + public virtual string SensorsLogic => + "Logic"; + public virtual string BehaviorsMotion => + "Motion"; + public virtual string BehaviorsGraphics => + "Graphics"; + public virtual string BehaviorsLife => + "Life"; + public virtual string BehaviorsPhysics => + "Physics"; + public virtual string BehaviorsSound => + "Sound"; + // Bevel public virtual string BevelSelectEdgesInstruction => "Select edges to bevel...";