Skip to content

Commit

Permalink
LoS formulae selection localisation
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuubari committed Nov 17, 2015
1 parent d0378eb commit 1258cbf
Show file tree
Hide file tree
Showing 5 changed files with 132 additions and 4 deletions.
57 changes: 57 additions & 0 deletions source/Grabacr07.KanColleViewer/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 25 additions & 1 deletion source/Grabacr07.KanColleViewer/Properties/Resources.en.resx
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ GPU: Slow! GPU optimization for tablets.</value>
<value>Give a notification for ships in critical condition</value>
</data>
<data name="Settings_Operation_LoSCalculation" xml:space="preserve">
<value>Settings_Plugins_PluginInfo_Features</value>
<value>Line of Sight Formula</value>
</data>
<data name="Settings_Operation_LoS_CarrierBasedRecon" xml:space="preserve">
<value>Carrier-based Recon Aircraft</value>
Expand Down Expand Up @@ -1369,4 +1369,28 @@ HTTP proxy settings are applied immediately. Settings for all other protocols ar
<data name="Settings_Plugins_PluginSettingsTitle" xml:space="preserve">
<value>Settings for {0}</value>
</data>
<data name="ViewRangeLogic_Type1_Desc" xml:space="preserve">
<value>Simple sum of ship and equipment LoS</value>
</data>
<data name="ViewRangeLogic_Type1_Name" xml:space="preserve">
<value>Simple sum</value>
</data>
<data name="ViewRangeLogic_Type2_Desc" xml:space="preserve">
<value>(Recon planes × 2) + (Radar) +
√(Total LoS with equip LoS included - Recon planes - Radar)</value>
</data>
<data name="ViewRangeLogic_Type2_Name" xml:space="preserve">
<value>2-5 formula (old)</value>
</data>
<data name="ViewRangeLogic_Type3_Desc" xml:space="preserve">
<value>Dive Bomber LoS × (1.04) + Torpedo Bomber LoS × (1.37) +
Carrier-based Recon LoS × (1.66) + Recon Seaplane LoS × (2.00) +
Seaplane Bomber LoS × (1.78) + Searchlight LoS × (0.91) +
Small Radar LoS × (1.00) + Large Radar LoS × (0.99) +
√(base LoS of each ship) × (1.69) +
(HQ Lv. rounded up to the next multiple of 5) × (-0.61)</value>
</data>
<data name="ViewRangeLogic_Type3_Name" xml:space="preserve">
<value>2-5 formula (new)</value>
</data>
</root>
21 changes: 21 additions & 0 deletions source/Grabacr07.KanColleViewer/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1376,4 +1376,25 @@ HTTP プロトコルの通信は自動構成も含め「インターネット
<data name="SlotItemCatalog_AttackRange_VeryLong" xml:space="preserve">
<value>短</value>
</data>
<data name="ViewRangeLogic_Type1_Desc" xml:space="preserve">
<value>艦娘と装備の索敵値の単純な合計値</value>
</data>
<data name="ViewRangeLogic_Type1_Name" xml:space="preserve">
<value>単純計算</value>
</data>
<data name="ViewRangeLogic_Type2_Desc" xml:space="preserve">
<value>(偵察機 × 2) + (電探) + √(装備込みの艦隊索敵値合計 - 偵察機 - 電探)</value>
</data>
<data name="ViewRangeLogic_Type2_Name" xml:space="preserve">
<value>2-5 式 (旧)</value>
</data>
<data name="ViewRangeLogic_Type3_Desc" xml:space="preserve">
<value>(艦上爆撃機 × 1.04) + (艦上攻撃機 × 1.37) + (艦上偵察機 × 1.66)
+ (水上偵察機 × 2.00) + (水上爆撃機 × 1.78) + (探照灯 × 0.91)
+ (小型電探 × 1.00) + (大型電探 × 0.99) + (√各艦毎の素索敵 × 1.69)
+ (司令部レベルを 5 の倍数に切り上げ × -0.61)</value>
</data>
<data name="ViewRangeLogic_Type3_Name" xml:space="preserve">
<value>2-5 式 (秋)</value>
</data>
</root>
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.Eventing.Reader;
using System.Linq;
using System.Threading.Tasks;
using Grabacr07.KanColleViewer.Composition;
Expand All @@ -9,6 +10,7 @@
using Grabacr07.KanColleViewer.ViewModels.Composition;
using Grabacr07.KanColleWrapper;
using Grabacr07.KanColleWrapper.Models;
using Livet;
using Livet.EventListeners;
using MetroTrilithon.Mvvm;

Expand Down Expand Up @@ -119,12 +121,16 @@ public void Initialize()
}


public class ViewRangeSettingsViewModel
public class ViewRangeSettingsViewModel : ViewModel
{
private bool selected;

public ICalcViewRange Logic { get; set; }

public string Name => GetLocalisedStrings(Logic.Id);

public string Description => GetLocalisedStrings(Logic.Id, true);

public bool Selected
{
get { return this.selected; }
Expand All @@ -142,6 +148,26 @@ public ViewRangeSettingsViewModel(ICalcViewRange logic)
{
this.Logic = logic;
this.selected = KanColleSettings.ViewRangeCalcType == logic.Id;
ResourceService.Current.Subscribe(x =>
{
this.RaisePropertyChanged(nameof(Name));
this.RaisePropertyChanged(nameof(Description));
});
}

private string GetLocalisedStrings(string type, bool desc = false)
{
switch (type)
{
case "KanColleViewer.Type1":
return !desc ? Resources.ViewRangeLogic_Type1_Name : Resources.ViewRangeLogic_Type1_Desc;
case "KanColleViewer.Type2":
return !desc ? Resources.ViewRangeLogic_Type2_Name : Resources.ViewRangeLogic_Type2_Desc;
case "KanColleViewer.Type3":
return !desc ? Resources.ViewRangeLogic_Type3_Name : Resources.ViewRangeLogic_Type3_Desc;
}

return !desc ? Logic.Name : Logic.Description;
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions source/Grabacr07.KanColleViewer/Views/Settings/Operation.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@
GroupName="ViewRangeCalcLogicSelection">
<TextBlock Style="{DynamicResource DefaultTextStyleKey}"
LineHeight="18">
<Run Text="{Binding Logic.Name, Mode=OneWay}"
<Run Text="{Binding Name, Mode=OneWay}"
Foreground="{Binding RelativeSource={RelativeSource AncestorType={x:Type RadioButton}}, Path=Foreground}" />
<LineBreak />
<Run Text="{Binding Logic.Description, Mode=OneWay}" />
<Run Text="{Binding Description, Mode=OneWay}" />
</TextBlock>
</RadioButton>
</DataTemplate>
Expand Down

0 comments on commit 1258cbf

Please sign in to comment.