Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 19 additions & 16 deletions BulldozeIt/ModInfo.cs
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
using ICities;
using System;
using System.Reflection;

/*
中文翻译支持
2024.04.03 by`TacKana
*/
namespace BulldozeIt
{
public class ModInfo : IUserMod
{
public string Name => "Bulldoze It!";
public string Description => "Allows to automate the bulldozing of buildings.";
public string Name => "自动化推土机!";
public string Description => "自动推平废弃建筑物功能!~by github:TacKana";

private static readonly string[] IntervalLabels =
{
"End of Day",
"End of Month",
"End of Year",
"Every 5 seconds",
"Every 10 seconds",
"Every 30 seconds"
"一天一次",
"一月一次",
"一年一次",
"5秒一次",
"10秒一次",
"30秒/半分钟一次"
};

private static readonly int[] IntervalValues =
Expand All @@ -43,43 +46,43 @@ public void OnSettingsUI(UIHelperBase helper)
int result;

selectedIndex = GetSelectedOptionIndex(IntervalValues, ModConfig.Instance.Interval);
group.AddDropdown("Interval", IntervalLabels, selectedIndex, sel =>
group.AddDropdown("自动化推土机工作时间", IntervalLabels, selectedIndex, sel =>
{
ModConfig.Instance.Interval = IntervalValues[sel];
ModConfig.Instance.Save();
});

selectedValue = ModConfig.Instance.MaxBuildingsPerInterval;
group.AddTextfield("Max Buildings (per interval)", selectedValue.ToString(), sel =>
group.AddTextfield("每次最大铲除多少废弃建筑物?", selectedValue.ToString(), sel =>
{
int.TryParse(sel, out result);
ModConfig.Instance.MaxBuildingsPerInterval = result;
ModConfig.Instance.Save();
});

selected = ModConfig.Instance.PreserveHistoricalBuildings;
group.AddCheckbox("Preserve Historical Buildings", selected, sel =>
group.AddCheckbox("是否排除历史建筑物?", selected, sel =>
{
ModConfig.Instance.PreserveHistoricalBuildings = sel;
ModConfig.Instance.Save();
});

selected = ModConfig.Instance.IgnoreSearchingForSurvivors;
group.AddCheckbox("Ignore Searching For Survivors", selected, sel =>
group.AddCheckbox("忽略搜索幸存者(机翻的不太理解意思)", selected, sel =>
{
ModConfig.Instance.IgnoreSearchingForSurvivors = sel;
ModConfig.Instance.Save();
});

selected = ModConfig.Instance.ShowCounters;
group.AddCheckbox("Show Counters in Bulldozer Bar", selected, sel =>
group.AddCheckbox("是否显示已经铲除建筑数量?", selected, sel =>
{
ModConfig.Instance.ShowCounters = sel;
ModConfig.Instance.Save();
});

selected = ModConfig.Instance.ShowStatistics;
group.AddCheckbox("Show Statistics in Info Panel", selected, sel =>
group.AddCheckbox("是否在日志面板中显示统计信息?", selected, sel =>
{
ModConfig.Instance.ShowStatistics = sel;
ModConfig.Instance.Save();
Expand All @@ -94,4 +97,4 @@ private int GetSelectedOptionIndex(int[] option, int value)
return index;
}
}
}
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
为天际线自动化推土机mod添加中文支持