diff options
Diffstat (limited to 'release/scripts/startup/bl_ui/properties_game.py')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_game.py | 139 |
1 files changed, 70 insertions, 69 deletions
diff --git a/release/scripts/startup/bl_ui/properties_game.py b/release/scripts/startup/bl_ui/properties_game.py index 161e4b10cff..123abdfe54a 100644 --- a/release/scripts/startup/bl_ui/properties_game.py +++ b/release/scripts/startup/bl_ui/properties_game.py @@ -19,7 +19,7 @@ # <pep8 compliant> import bpy from bpy.types import Panel - +from blf import gettext as _ class PhysicsButtonsPanel(): bl_space_type = 'PROPERTIES' @@ -28,7 +28,7 @@ class PhysicsButtonsPanel(): class PHYSICS_PT_game_physics(PhysicsButtonsPanel, Panel): - bl_label = "Physics" + bl_label = _("Physics") COMPAT_ENGINES = {'BLENDER_GAME'} @classmethod @@ -54,7 +54,7 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel, Panel): col = split.column() col.prop(game, "use_actor") col.prop(game, "use_ghost") - col.prop(ob, "hide_render", text="Invisible") # out of place but useful + col.prop(ob, "hide_render", text=_("Invisible")) # out of place but useful col = split.column() col.prop(game, "use_material_physics_fh") @@ -66,7 +66,7 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel, Panel): split = layout.split() col = split.column() - col.label(text="Attributes:") + col.label(text=_("Attributes:")) col.prop(game, "mass") col.prop(game, "radius") col.prop(game, "form_factor") @@ -81,29 +81,29 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel, Panel): split = layout.split() col = split.column() - col.label(text="Velocity:") + col.label(text=_("Velocity:")) sub = col.column(align=True) - sub.prop(game, "velocity_min", text="Minimum") - sub.prop(game, "velocity_max", text="Maximum") + sub.prop(game, "velocity_min", text=_("Minimum")) + sub.prop(game, "velocity_max", text=_("Maximum")) col = split.column() - col.label(text="Damping:") + col.label(text=_("Damping:")) sub = col.column(align=True) - sub.prop(game, "damping", text="Translation", slider=True) - sub.prop(game, "rotation_damping", text="Rotation", slider=True) + sub.prop(game, "damping", text=_("Translation"), slider=True) + sub.prop(game, "rotation_damping", text=_("Rotation"), slider=True) layout.separator() split = layout.split() col = split.column() - col.label(text="Lock Translation:") + col.label(text=_("Lock Translation:")) col.prop(game, "lock_location_x", text="X") col.prop(game, "lock_location_y", text="Y") col.prop(game, "lock_location_z", text="Z") col = split.column() - col.label(text="Lock Rotation:") + col.label(text=_("Lock Rotation:")) col.prop(game, "lock_rotation_x", text="X") col.prop(game, "lock_rotation_y", text="Y") col.prop(game, "lock_rotation_z", text="Z") @@ -112,21 +112,21 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel, Panel): col = layout.column() col.prop(game, "use_actor") col.prop(game, "use_ghost") - col.prop(ob, "hide_render", text="Invisible") + col.prop(ob, "hide_render", text=_("Invisible")) layout.separator() split = layout.split() col = split.column() - col.label(text="Attributes:") + col.label(text=_("Attributes:")) col.prop(game, "mass") col.prop(soft, "weld_threshold") col.prop(soft, "location_iterations") col.prop(soft, "linear_stiffness", slider=True) col.prop(soft, "dynamic_friction", slider=True) col.prop(soft, "collision_margin", slider=True) - col.prop(soft, "use_bending_constraints", text="Bending Constraints") + col.prop(soft, "use_bending_constraints", text=_("Bending Constraints")) col = split.column() col.prop(soft, "use_shape_match") @@ -136,25 +136,25 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel, Panel): col.separator() - col.label(text="Cluster Collision:") + col.label(text=_("Cluster Collision:")) col.prop(soft, "use_cluster_rigid_to_softbody") col.prop(soft, "use_cluster_soft_to_softbody") sub = col.column() sub.active = (soft.use_cluster_rigid_to_softbody or soft.use_cluster_soft_to_softbody) - sub.prop(soft, "cluster_iterations", text="Iterations") + sub.prop(soft, "cluster_iterations", text=_("Iterations")) elif game.physics_type == 'STATIC': col = layout.column() col.prop(game, "use_actor") col.prop(game, "use_ghost") - col.prop(ob, "hide_render", text="Invisible") + col.prop(ob, "hide_render", text=_("Invisible")) layout.separator() split = layout.split() col = split.column() - col.label(text="Attributes:") + col.label(text=_("Attributes:")) col.prop(game, "radius") col = split.column() @@ -165,11 +165,11 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel, Panel): subsub.prop(game, "friction_coefficients", text="", slider=True) elif game.physics_type in {'SENSOR', 'INVISIBLE', 'NO_COLLISION', 'OCCLUDE'}: - layout.prop(ob, "hide_render", text="Invisible") + layout.prop(ob, "hide_render", text=_("Invisible")) class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel, Panel): - bl_label = "Collision Bounds" + bl_label = _("Collision Bounds") COMPAT_ENGINES = {'BLENDER_GAME'} @classmethod @@ -189,11 +189,11 @@ class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel, Panel): game = context.active_object.game layout.active = game.use_collision_bounds - layout.prop(game, "collision_bounds_type", text="Bounds") + layout.prop(game, "collision_bounds_type", text=_("Bounds")) row = layout.row() - row.prop(game, "collision_margin", text="Margin", slider=True) - row.prop(game, "use_collision_compound", text="Compound") + row.prop(game, "collision_margin", text=_("Margin"), slider=True) + row.prop(game, "use_collision_compound", text=_("Compound")) class RenderButtonsPanel(): @@ -208,19 +208,19 @@ class RenderButtonsPanel(): class RENDER_PT_game(RenderButtonsPanel, Panel): - bl_label = "Game" + bl_label = _("Game") COMPAT_ENGINES = {'BLENDER_GAME'} def draw(self, context): layout = self.layout row = layout.row() - row.operator("view3d.game_start", text="Start") + row.operator("view3d.game_start", text=_("Start")) row.label() class RENDER_PT_game_player(RenderButtonsPanel, Panel): - bl_label = "Standalone Player" + bl_label = _("Standalone Player") COMPAT_ENGINES = {'BLENDER_GAME'} def draw(self, context): @@ -233,27 +233,27 @@ class RENDER_PT_game_player(RenderButtonsPanel, Panel): split = layout.split() col = split.column() - col.label(text="Resolution:") + col.label(text=_("Resolution:")) sub = col.column(align=True) sub.prop(gs, "resolution_x", slider=False, text="X") sub.prop(gs, "resolution_y", slider=False, text="Y") col = split.column() - col.label(text="Quality:") + col.label(text=_("Quality:")) sub = col.column(align=True) - sub.prop(gs, "depth", text="Bit Depth", slider=False) - sub.prop(gs, "frequency", text="FPS", slider=False) + sub.prop(gs, "depth", text=_("Bit Depth"), slider=False) + sub.prop(gs, "frequency", text=_("FPS"), slider=False) # framing: col = layout.column() - col.label(text="Framing:") + col.label(text=_("Framing:")) col.row().prop(gs, "frame_type", expand=True) if gs.frame_type == 'LETTERBOX': col.prop(gs, "frame_color", text="") class RENDER_PT_game_stereo(RenderButtonsPanel, Panel): - bl_label = "Stereo" + bl_label = _("Stereo") COMPAT_ENGINES = {'BLENDER_GAME'} def draw(self, context): @@ -272,7 +272,7 @@ class RENDER_PT_game_stereo(RenderButtonsPanel, Panel): # dome: elif stereo_mode == 'DOME': - layout.prop(gs, "dome_mode", text="Dome Type") + layout.prop(gs, "dome_mode", text=_("Dome Type")) dome_type = gs.dome_mode @@ -283,23 +283,23 @@ class RENDER_PT_game_stereo(RenderButtonsPanel, Panel): dome_type == 'TRUNCATED_FRONT': col = split.column() - col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True) + col.prop(gs, "dome_buffer_resolution", text=_("Resolution"), slider=True) col.prop(gs, "dome_angle", slider=True) col = split.column() - col.prop(gs, "dome_tesselation", text="Tesselation") + col.prop(gs, "dome_tesselation", text=_("Tesselation")) col.prop(gs, "dome_tilt") elif dome_type == 'PANORAM_SPH': col = split.column() - col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True) + col.prop(gs, "dome_buffer_resolution", text=_("Resolution"), slider=True) col = split.column() - col.prop(gs, "dome_tesselation", text="Tesselation") + col.prop(gs, "dome_tesselation", text=_("Tesselation")) else: # cube map col = split.column() - col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True) + col.prop(gs, "dome_buffer_resolution", text=_("Resolution"), slider=True) col = split.column() @@ -307,7 +307,7 @@ class RENDER_PT_game_stereo(RenderButtonsPanel, Panel): class RENDER_PT_game_shading(RenderButtonsPanel, Panel): - bl_label = "Shading" + bl_label = _("Shading") COMPAT_ENGINES = {'BLENDER_GAME'} def draw(self, context): @@ -321,19 +321,19 @@ class RENDER_PT_game_shading(RenderButtonsPanel, Panel): split = layout.split() col = split.column() - col.prop(gs, "use_glsl_lights", text="Lights") - col.prop(gs, "use_glsl_shaders", text="Shaders") - col.prop(gs, "use_glsl_shadows", text="Shadows") - col.prop(gs, "use_glsl_color_management", text="Color Management") + col.prop(gs, "use_glsl_lights", text=_("Lights")) + col.prop(gs, "use_glsl_shaders", text=_("Shaders")) + col.prop(gs, "use_glsl_shadows", text=_("Shadows")) + col.prop(gs, "use_glsl_color_management", text=_("Color Management")) col = split.column() - col.prop(gs, "use_glsl_ramps", text="Ramps") - col.prop(gs, "use_glsl_nodes", text="Nodes") - col.prop(gs, "use_glsl_extra_textures", text="Extra Textures") + col.prop(gs, "use_glsl_ramps", text=_("Ramps")) + col.prop(gs, "use_glsl_nodes", text=_("Nodes")) + col.prop(gs, "use_glsl_extra_textures", text=_("Extra Textures")) class RENDER_PT_game_performance(RenderButtonsPanel, Panel): - bl_label = "Performance" + bl_label = _("Performance") COMPAT_ENGINES = {'BLENDER_GAME'} def draw(self, context): @@ -349,7 +349,7 @@ class RENDER_PT_game_performance(RenderButtonsPanel, Panel): class RENDER_PT_game_display(RenderButtonsPanel, Panel): - bl_label = "Display" + bl_label = _("Display") COMPAT_ENGINES = {'BLENDER_GAME'} def draw(self, context): @@ -357,11 +357,12 @@ class RENDER_PT_game_display(RenderButtonsPanel, Panel): gs = context.scene.game_settings flow = layout.column_flow() - flow.prop(gs, "show_debug_properties", text="Debug Properties") - flow.prop(gs, "show_framerate_profile", text="Framerate and Profile") - flow.prop(gs, "show_physics_visualization", text="Physics Visualization") + flow.prop(gs, "show_debug_properties", text=_("Debug Properties")) + flow.prop(gs, "show_framerate_profile", text=_("Framerate and Profile")) + flow.prop(gs, "show_physics_visualization", text=_("Physics Visualization")) flow.prop(gs, "use_deprecation_warnings") - flow.prop(gs, "show_mouse", text="Mouse Cursor") + flow.prop(gs, "show_mouse", text=_("Mouse Cursor")) + class WorldButtonsPanel(): @@ -395,7 +396,7 @@ class WORLD_PT_game_context_world(WorldButtonsPanel, Panel): class WORLD_PT_game_world(WorldButtonsPanel, Panel): - bl_label = "World" + bl_label = _("World") COMPAT_ENGINES = {'BLENDER_GAME'} @classmethod @@ -414,7 +415,7 @@ class WORLD_PT_game_world(WorldButtonsPanel, Panel): class WORLD_PT_game_mist(WorldButtonsPanel, Panel): - bl_label = "Mist" + bl_label = _("Mist") COMPAT_ENGINES = {'BLENDER_GAME'} @classmethod @@ -440,7 +441,7 @@ class WORLD_PT_game_mist(WorldButtonsPanel, Panel): class WORLD_PT_game_physics(WorldButtonsPanel, Panel): - bl_label = "Physics" + bl_label = _("Physics") COMPAT_ENGINES = {'BLENDER_GAME'} @classmethod @@ -455,37 +456,37 @@ class WORLD_PT_game_physics(WorldButtonsPanel, Panel): layout.prop(gs, "physics_engine") if gs.physics_engine != 'NONE': - layout.prop(gs, "physics_gravity", text="Gravity") + layout.prop(gs, "physics_gravity", text=_("Gravity")) split = layout.split() col = split.column() - col.label(text="Physics Steps:") + col.label(text=_("Physics Steps:")) sub = col.column(align=True) - sub.prop(gs, "physics_step_max", text="Max") - sub.prop(gs, "physics_step_sub", text="Substeps") - col.prop(gs, "fps", text="FPS") + sub.prop(gs, "physics_step_max", text=_("Max")) + sub.prop(gs, "physics_step_sub", text=_("Substeps")) + col.prop(gs, "fps", text=_("FPS")) col = split.column() - col.label(text="Logic Steps:") - col.prop(gs, "logic_step_max", text="Max") + col.label(text=_("Logic Steps:")) + col.prop(gs, "logic_step_max", text=_("Max")) col = layout.column() - col.prop(gs, "use_occlusion_culling", text="Occlusion Culling") + col.prop(gs, "use_occlusion_culling", text=_("Occlusion Culling")) sub = col.column() sub.active = gs.use_occlusion_culling - sub.prop(gs, "occlusion_culling_resolution", text="Resolution") + sub.prop(gs, "occlusion_culling_resolution", text=_("Resolution")) else: split = layout.split() col = split.column() - col.label(text="Physics Steps:") - col.prop(gs, "fps", text="FPS") + col.label(text=_("Physics Steps:")) + col.prop(gs, "fps", text=_("FPS")) col = split.column() - col.label(text="Logic Steps:") - col.prop(gs, "logic_step_max", text="Max") + col.label(text=_("Logic Steps:")) + col.prop(gs, "logic_step_max", text=_("Max")) if __name__ == "__main__": # only for live edit. bpy.utils.register_module(__name__) |