Skip to content

Commit

Permalink
feat(locale): add ik rig editor localizations
Browse files Browse the repository at this point in the history
  • Loading branch information
Silverlan committed Mar 10, 2023
1 parent 988bea9 commit 758c199
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 7 deletions.
16 changes: 9 additions & 7 deletions lua/gui/ik_rig_editor.lua
Expand Up @@ -8,6 +8,8 @@

include("pfm/controls_menu.lua")

locale.load("pfm_ik_rig_editor.txt")

local Element = util.register_class("gui.IkRigEditor",gui.Base)

local function get_bones_in_hierarchical_order(mdl)
Expand Down Expand Up @@ -276,8 +278,8 @@ end
function Element:InitializeBoneControls(mdl)
local options = {}
table.insert(options,{"none","-"})
table.insert(options,{"hinge",locale.get_text("pfm_constraint_hinge")})
table.insert(options,{"ballsocket",locale.get_text("pfm_constraint_ball_socket")})
table.insert(options,{"hinge",locale.get_text("pfm_hinge_constraint")})
table.insert(options,{"ballsocket",locale.get_text("pfm_ball_socket_constraint")})

util.remove(self.m_skelTreeSubMenu)
local subMenu = self.m_boneControlMenu:AddSubMenu()
Expand Down Expand Up @@ -374,7 +376,7 @@ function Element:AddConstraint(item,boneName,type,constraint)
self:AddBone(boneName)
self:AddBone(parent:GetName())

local child = item:AddItem(locale.get_text("pfm_" .. type .. "_constraint"))
local child = item:AddItem(locale.get_text("pfm_" .. string.camel_case_to_snake_case(type) .. "_constraint"))
child:AddCallback("OnMouseEvent",function(wrapper,button,state,mods)
if(button == input.MOUSE_BUTTON_RIGHT and state == input.STATE_PRESS) then
local pContext = gui.open_context_menu()
Expand Down Expand Up @@ -404,7 +406,7 @@ function Element:AddConstraint(item,boneName,type,constraint)
local includeUnidirectionalLimit = false
local twistAxis = math.AXIS_Z
if(type == "ballSocket") then twistAxis = ents.IkSolverComponent.find_forward_axis(mdl,parent:GetID(),boneId) or twistAxis end
local function add_rotation_axis_slider(ctrl,id,name,axisId,min,defVal)
local function add_rotation_axis_slider(ctrl,name,id,axisId,min,defVal)
return ctrl:AddSliderControl(locale.get_text(name),id,defVal,-180.0,180.0,function(el,value)
local animatedC = ent:GetComponent(ents.COMPONENT_ANIMATED)
if(animatedC ~= nil) then
Expand Down Expand Up @@ -597,9 +599,9 @@ function Element:AddConstraint(item,boneName,type,constraint)
elseif(type == "hinge") then
singleAxis = 0
ctrl:AddDropDownMenu(locale.get_text("pfm_ik_axis"),"axis",{
{"x",locale.get_text("x")},
{"y",locale.get_text("y")},
{"z",locale.get_text("z")}
{"x","X"},
{"y","Y"},
{"z","Z"}
},0,function(el,option)
singleAxis = el:GetSelectedOption()
constraint.axis = singleAxis
Expand Down
23 changes: 23 additions & 0 deletions scripts/localization/de/texts/pfm_ik_rig_editor.txt
@@ -0,0 +1,23 @@
pfm_add_ball_socket_constraint = "Kugelgelenkbeschränkung hinzufügen"
pfm_add_bone = "Knochen hinzufügen"
pfm_add_drag_control = "Ziehsteuerung hinzufügen"
pfm_add_fixed_constraint = "Feste Beschränkung hinzufügen"
pfm_add_hinge_constraint = "Scharnierbeschränkung hinzufügen"
pfm_add_state_control = "Zustandssteuerung hinzufügen"
pfm_ball_socket_constraint = "Kugelgelenkbeschränkung"
pfm_fixed_constraint = "Feste Beschränkung"
pfm_hinge_constraint = "Scharnierbeschränkung"
pfm_ik_axis = "Achse"
pfm_ik_rot_pitch_max = "Max. Pitch"
pfm_ik_rot_pitch_min = "Min. Pitch"
pfm_ik_rot_roll_max = "Max. Roll"
pfm_ik_rot_roll_min = "Min. Roll"
pfm_ik_rot_yaw_max = "Max. Gier"
pfm_ik_rot_yaw_min = "Min. Gier"
pfm_ik_twist_axis = "Twist-Achse"
pfm_ik_rig_file = "IK-Rig-Datei"
pfm_ik_rig_reference_model = "Referenzmodell"
pfm_lock_bone = "Knochen sperren"
pfm_remove_bone = "Knochen entfernen"
pfm_remove_control = "Steuerung entfernen"
pfm_unlock_bone = "Knochen entsperren"
1 change: 1 addition & 0 deletions scripts/localization/de/texts/pfm_user_interface.txt
Expand Up @@ -123,6 +123,7 @@ pfm_generate_ambient_occlusion = "Umgebungsokklusion generieren"
pfm_generate_ambient_occlusion_maps = "Umgebungsokklusionstexturen generieren"
pfm_getting_started = "Erste Schritte"
pfm_graph_editor = "Grapheditor ({0})"
pfm_ik_rig_editor = "IK-Rig-Editor"
pfm_inner_cone_angle = "Innerer Kegelwinkel"
pfm_light_intensity_factor = "Lichtintensit�tsfaktor"
pfm_light_intensity_factor_desc = "Die Lichtintensit�t aller Lichtquellen in der Szene wird vor dem Rendern mit diesem Faktor multipliziert."
Expand Down
23 changes: 23 additions & 0 deletions scripts/localization/en/texts/pfm_ik_rig_editor.txt
@@ -0,0 +1,23 @@
pfm_add_ball_socket_constraint = "Add Ballsocket Constraint"
pfm_add_bone = "Add Bone"
pfm_add_drag_control = "Add Drag Control"
pfm_add_fixed_constraint = "Add Fixed Constraint"
pfm_add_hinge_constraint = "Add Hinge Constraint"
pfm_add_state_control = "Add State Control"
pfm_ball_socket_constraint = "Ballsocket Constraint"
pfm_fixed_constraint = "Fixed Constraint"
pfm_hinge_constraint = "Hinge Constraint"
pfm_ik_axis = "Axis"
pfm_ik_rot_pitch_max = "Max Pitch"
pfm_ik_rot_pitch_min = "Min Pitch"
pfm_ik_rot_roll_max = "Roll Pitch"
pfm_ik_rot_roll_min = "Roll Pitch"
pfm_ik_rot_yaw_max = "Yaw Pitch"
pfm_ik_rot_yaw_min = "Yaw Pitch"
pfm_ik_twist_axis = "Twist Axis"
pfm_ik_rig_file = "Ik Rig File"
pfm_ik_rig_reference_model = "Reference Model"
pfm_lock_bone = "Lock Bone"
pfm_remove_bone = "Remove Bone"
pfm_remove_control = "Remove Control"
pfm_unlock_bone = "Unlock Bone"
1 change: 1 addition & 0 deletions scripts/localization/en/texts/pfm_user_interface.txt
Expand Up @@ -124,6 +124,7 @@ pfm_generate_ambient_occlusion = "Generate ambient occlusion"
pfm_generate_ambient_occlusion_maps = "Generate ambient occlusion maps"
pfm_getting_started = "Getting started"
pfm_graph_editor = "Graph Editor ({0})"
pfm_ik_rig_editor = "Ik Rig Editor"
pfm_inner_cone_angle = "Inner cone angle"
pfm_light_intensity_factor = "Light intensity factor"
pfm_light_intensity_factor_desc = "The light intensity of all light sources in the scene will be multiplied with this value before rendering."
Expand Down
23 changes: 23 additions & 0 deletions scripts/localization/jp/texts/pfm_ik_rig_editor.txt
@@ -0,0 +1,23 @@
pfm_add_ball_socket_constraint = "ボールソケット制約を追加"
pfm_add_bone = "ボーンを追加"
pfm_add_drag_control = "ドラッグコントロールを追加"
pfm_add_fixed_constraint = "固定制約を追加"
pfm_add_hinge_constraint = "ヒンジ制約を追加"
pfm_add_state_control = "ステートコントロールを追加"
pfm_ball_socket_constraint = "ボールソケット制約"
pfm_fixed_constraint = "固定制約"
pfm_hinge_constraint = "ヒンジ制約"
pfm_ik_axis = "軸"
pfm_ik_rot_pitch_max = "最大ピッチ"
pfm_ik_rot_pitch_min = "最小ピッチ"
pfm_ik_rot_roll_max = "ロールピッチ最大"
pfm_ik_rot_roll_min = "ロールピッチ最小"
pfm_ik_rot_yaw_max = "ヨーピッチ最大"
pfm_ik_rot_yaw_min = "ヨーピッチ最小"
pfm_ik_twist_axis = "ツイスト軸"
pfm_ik_rig_file = "IKリグファイル"
pfm_ik_rig_reference_model = "リファレンスモデル"
pfm_lock_bone = "ボーンをロック"
pfm_remove_bone = "ボーンを削除"
pfm_remove_control = "コントロールを削除"
pfm_unlock_bone = "ボーンのロックを解除"
1 change: 1 addition & 0 deletions scripts/localization/jp/texts/pfm_user_interface.txt
Expand Up @@ -124,6 +124,7 @@ pfm_generate_ambient_occlusion = "環境光遮蔽を生成"
pfm_generate_ambient_occlusion_maps = "環境光遮蔽マップを生成"
pfm_getting_started = "はじめに"
pfm_graph_editor = "グラフエディター ({0})"
pfm_ik_rig_editor = "IKリグエディター"
pfm_inner_cone_angle = "内部コーン角度"
pfm_light_intensity_factor = "ライト強度係数"
pfm_light_intensity_factor_desc = "シーン内のすべてのライトの源の強度がこの値で乗算される前にレンダリングされます。"
Expand Down

0 comments on commit 758c199

Please sign in to comment.