Toolbar icon texture issue when using localization
Duck1998 opened this issue · 3 comments
MechJeb Version
Dev 946
KSP Version
1.9.1 zh-CN
Description
When using any localization other than en-US, toolbar icons fail to load.
Mechjeb looks for "localized version" of module name for texture, but texture name is still in English.
e.g. RCS Balancer (RCS平衡器)
MechJeb2/MechJeb2/MechJebModuleMenu.cs
Lines 264 to 266 in c1f493b
MechJeb2/MechJeb2/MechJebModuleRCSBalancerWindow.cs
Lines 120 to 123 in c1f493b
MechJeb2/Localization/zh-cn.cfg
Line 603 in c1f493b
Then mechjeb looks for
MechJeb2/Icons/RCS平衡器
, which does not exist.Can be fixed by implementing a new way to identify module, rather than name.
Replication Case
KSP.log
[LOG 14:44:56.213] [MechJeb2] Loading Mechjeb Dev #946 Sarbian
[LOG 14:44:56.318] ScaleModList: listSize 164 maxListSize 1403
[LOG 14:44:56.326] Create button for module RCS平衡器
[LOG 14:44:56.327] [MechJeb2] No icon for RCS平衡器
[LOG 14:44:56.328] Create button for module 交会规划
[LOG 14:44:56.328] [MechJeb2] No icon for 交会规划
[LOG 14:44:56.328] Create button for module 加速助手
[LOG 14:44:56.329] [MechJeb2] No icon for 加速助手
[LOG 14:44:56.329] Create button for module 姿态调整
[LOG 14:44:56.329] [MechJeb2] No icon for 姿态调整
[LOG 14:44:56.329] Create button for module 实用工具
[LOG 14:44:56.329] [MechJeb2] No icon for 实用工具
[LOG 14:44:56.329] Create button for module 平动控制
[LOG 14:44:56.330] [MechJeb2] No icon for 平动控制
[LOG 14:44:56.330] Create button for module 智能A.S.S.
[LOG 14:44:56.330] [MechJeb2] No icon for 智能A_S_S_
[LOG 14:44:56.330] Create button for module 智能RCS
[LOG 14:44:56.330] [MechJeb2] No icon for 智能RCS
[LOG 14:44:56.330] Create button for module 机动节点编辑
[LOG 14:44:56.330] [MechJeb2] No icon for 机动节点编辑
[LOG 14:44:56.330] Create button for module 机动节点规划
[LOG 14:44:56.330] [MechJeb2] No icon for 机动节点规划
[LOG 14:44:56.331] Create button for module 脚本模块
[LOG 14:44:56.331] [MechJeb2] No icon for 脚本模块
[LOG 14:44:56.331] Create button for module 自动交会
[LOG 14:44:56.331] [MechJeb2] No icon for 自动交会
[LOG 14:44:56.331] Create button for module 自动发射
[LOG 14:44:56.331] [MechJeb2] No icon for 自动发射
[LOG 14:44:56.331] Create button for module 自动对接
[LOG 14:44:56.331] [MechJeb2] No icon for 自动对接
closed by #1241
thank you!