MechJeb2

MechJeb2

4M Downloads

Toolbar icon texture issue when using localization

Duck1998 opened this issue · 3 comments

commented

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平衡器)

String name = GetCleanName(module.GetName());
String TexturePath = "MechJeb2/Icons/" + name;

public override string GetName()
{
return Localizer.Format("#MechJeb_RCSBalancer_title");//"RCS Balancer"
}

#MechJeb_RCSBalancer_title = RCS平衡器

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

en-US
en-us
zh-CN
zh-cn

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 自动对接

commented

I never use the toolbar so this probably needs to be a user-submitted PR

commented

And........ the PR comes.

commented

closed by #1241

thank you!