Skip to content
This repository has been archived by the owner on Mar 31, 2021. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into grabacr-3.6
Browse files Browse the repository at this point in the history
Conflicts:
	Grabacr07.KanColleViewer/Models/ProductInfo.cs
	Grabacr07.KanColleViewer/Properties/AssemblyInfo.cs
	Grabacr07.KanColleViewer/ViewModels/Catalogs/ShipCatalogSortWorker.cs
	Grabacr07.KanColleViewer/ViewModels/Catalogs/SlotItemViewModel.cs
	Grabacr07.KanColleViewer/ViewModels/SettingsViewModel.cs
	Grabacr07.KanColleViewer/Views/Catalogs/ShipCatalogWindow.xaml
	Grabacr07.KanColleViewer/Views/Settings/Operation.xaml
	Grabacr07.KanColleWrapper/Homeport.cs
	Grabacr07.KanColleWrapper/KanColleClient.cs
	Grabacr07.KanColleWrapper/Models/Admiral.cs
	Grabacr07.KanColleWrapper/Models/Quest.cs
	Grabacr07.KanColleWrapper/Models/Ship.cs
	Grabacr07.KanColleWrapper/Models/ShipInfo.cs
	Grabacr07.KanColleWrapper/Models/ShipType.cs
	Grabacr07.KanColleWrapper/Models/SlotItem.cs
	Grabacr07.KanColleWrapper/Models/SlotItemInfo.cs
  • Loading branch information
Yuubari committed Feb 15, 2015
2 parents 81884b1 + be313f6 commit 64c8973
Show file tree
Hide file tree
Showing 76 changed files with 1,908 additions and 959 deletions.
1 change: 1 addition & 0 deletions Grabacr07.KanColleViewer/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ protected override void OnStartup(StartupEventArgs e)
PluginHost.Instance.Initialize();
NotifierHost.Instance.Initialize(KanColleClient.Current);
Helper.SetRegistryFeatureBrowserEmulation();
Helper.SetMMCSSTask();

KanColleClient.Current.Proxy.Startup(AppSettings.Default.LocalProxyPort);
KanColleClient.Current.Proxy.UpstreamProxySettings = Settings.Current.ProxySettings;
Expand Down
12 changes: 10 additions & 2 deletions Grabacr07.KanColleViewer/Composition/PluginHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@ public class PluginHost : IDisposable
/// <see cref="PluginHost"/> のインスタンスを取得します。
/// </summary>
/// <value><see cref="PluginHost"/> のインスタンス。</value>
public static PluginHost Instance => instance;
public static PluginHost Instance
{
get { return instance; }
}

#endregion
#endregion

private readonly CompositionContainer container;

Expand Down Expand Up @@ -71,6 +74,11 @@ private PluginHost()
this.container = new CompositionContainer(catalog);
}

static PluginHost()
{

}

public void Dispose()
{
this.container.Dispose();
Expand Down
13 changes: 11 additions & 2 deletions Grabacr07.KanColleViewer/Models/Helper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,13 @@ static Helper()
/// <summary>
/// デザイナーのコンテキストで実行されているかどうかを取得します。
/// </summary>
public static bool IsInDesignMode => DesignerProperties.GetIsInDesignMode(new DependencyObject());
public static bool IsInDesignMode
{
get { return DesignerProperties.GetIsInDesignMode(new DependencyObject()); }
}


public static string CreateScreenshotFilePath()
public static string CreateScreenshotFilePath()
{
var filePath = Path.Combine(
Settings.Current.ScreenshotFolder,
Expand Down Expand Up @@ -72,6 +75,12 @@ public static void SetRegistryFeatureBrowserEmulation()
}
}

public static void SetMMCSSTask()
{
var index = 0u;
NativeMethods.AvSetMmThreadCharacteristics("Games", ref index);
}


/// <summary>
/// キャッシュを削除します。
Expand Down
11 changes: 7 additions & 4 deletions Grabacr07.KanColleViewer/Models/NotifierHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ public class NotifierHost : NotificationObject

private static readonly NotifierHost instance = new NotifierHost();

public static NotifierHost Instance => instance;
public static NotifierHost Instance
{
get { return instance; }
}

#endregion
#endregion

private NotifierHost() { }

Expand Down Expand Up @@ -77,8 +80,8 @@ private static void UpdateDockyard(Dockyard dockyard)
{
if (Settings.Current.NotifyBuildingCompleted)
{
var shipName = Settings.Current.CanDisplayBuildingShipName
? args.Ship.Name
var shipName = Settings.Current.CanDisplayBuildingShipName
? args.Ship.Name
: Resources.Common_ShipGirl;

PluginHost.Instance.GetNotifier().Show(
Expand Down
67 changes: 50 additions & 17 deletions Grabacr07.KanColleViewer/Models/ProductInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,34 +20,67 @@ public class ProductInfo
private string _VersionString;
private IReadOnlyCollection<Library> _Libraries;

public string Title => this._Title ?? (this._Title = ((AssemblyTitleAttribute)Attribute.GetCustomAttribute(this.assembly, typeof(AssemblyTitleAttribute))).Title);
public string Title
{
get { return this._Title ?? (this._Title = ((AssemblyTitleAttribute)Attribute.GetCustomAttribute(this.assembly, typeof(AssemblyTitleAttribute))).Title); }
}

public string Description => this._Description ?? (this._Description = ((AssemblyDescriptionAttribute)Attribute.GetCustomAttribute(this.assembly, typeof(AssemblyDescriptionAttribute))).Description);
public string Description
{
get { return this._Description ?? (this._Description = ((AssemblyDescriptionAttribute)Attribute.GetCustomAttribute(this.assembly, typeof(AssemblyDescriptionAttribute))).Description); }
}

public string Company => this._Company ?? (this._Company = ((AssemblyCompanyAttribute)Attribute.GetCustomAttribute(this.assembly, typeof(AssemblyCompanyAttribute))).Company);
public string Company
{
get { return this._Company ?? (this._Company = ((AssemblyCompanyAttribute)Attribute.GetCustomAttribute(this.assembly, typeof(AssemblyCompanyAttribute))).Company); }
}

public string Product => this._Product ?? (this._Product = ((AssemblyProductAttribute)Attribute.GetCustomAttribute(this.assembly, typeof(AssemblyProductAttribute))).Product);
public string Product
{
get { return this._Product ?? (this._Product = ((AssemblyProductAttribute)Attribute.GetCustomAttribute(this.assembly, typeof(AssemblyProductAttribute))).Product); }
}

public string Copyright => this._Copyright ?? (this._Copyright = ((AssemblyCopyrightAttribute)Attribute.GetCustomAttribute(this.assembly, typeof(AssemblyCopyrightAttribute))).Copyright);
public string Copyright
{
get { return this._Copyright ?? (this._Copyright = ((AssemblyCopyrightAttribute)Attribute.GetCustomAttribute(this.assembly, typeof(AssemblyCopyrightAttribute))).Copyright); }
}

public string Trademark => this._Trademark ?? (this._Trademark = ((AssemblyTrademarkAttribute)Attribute.GetCustomAttribute(this.assembly, typeof(AssemblyTrademarkAttribute))).Trademark);
public string Trademark
{
get { return this._Trademark ?? (this._Trademark = ((AssemblyTrademarkAttribute)Attribute.GetCustomAttribute(this.assembly, typeof(AssemblyTrademarkAttribute))).Trademark); }
}

public Version Version => this._Version ?? (this._Version = this.assembly.GetName().Version);
public Version Version
{
get { return this._Version ?? (this._Version = this.assembly.GetName().Version); }
}

public string VersionString => this._VersionString ?? (this._VersionString = string.Format("{0}{1}{2}", this.Version.ToString(3), this.IsBetaRelease ? " β" : "", this.Version.Revision == 0 ? "" : " rev." + this.Version.Revision));
public string VersionString
{
get { return this._VersionString ?? (this._VersionString = string.Format("{0}{1}{2}", this.Version.ToString(3), this.IsBetaRelease ? " β" : "", this.Version.Revision == 0 ? "" : " rev." + this.Version.Revision)); }
}

public bool IsBetaRelease => false;
public bool IsBetaRelease
{
get { return false; }
}


public IReadOnlyCollection<Library> Libraries => this._Libraries ?? (this._Libraries = new List<Library>
public IReadOnlyCollection<Library> Libraries
{
new Library("Reactive Extensions", new Uri("http://rx.codeplex.com/")),
new Library("Interactive Extensions", new Uri("http://rx.codeplex.com/")),
new Library("Windows API Code Pack", new Uri("http://archive.msdn.microsoft.com/WindowsAPICodePack")),
new Library("Livet", new Uri("http://ugaya40.net/livet")),
new Library("DynamicJson", new Uri("http://dynamicjson.codeplex.com/")),
new Library("FiddlerCore", new Uri("http://fiddler2.com/fiddlercore")),
});
get
{
return this._Libraries ?? (this._Libraries = new List<Library>
{
new Library("Reactive Extensions", new Uri("http://rx.codeplex.com/")),
new Library("Interactive Extensions", new Uri("http://rx.codeplex.com/")),
new Library("Windows API Code Pack", new Uri("http://archive.msdn.microsoft.com/WindowsAPICodePack")),
new Library("Livet", new Uri("http://ugaya40.net/livet")),
new Library("DynamicJson", new Uri("http://dynamicjson.codeplex.com/")),
new Library("FiddlerCore", new Uri("http://fiddler2.com/fiddlercore")),
});
}
}
}

public class Library
Expand Down
21 changes: 11 additions & 10 deletions Grabacr07.KanColleViewer/Models/ResourceService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ public class ResourceService : NotificationObject

private static readonly ResourceService current = new ResourceService();

public static ResourceService Current => current;
public static ResourceService Current
{
get { return current; }
}

#endregion
#endregion

/// <summary>
/// サポートされているカルチャの名前。
Expand All @@ -33,22 +36,20 @@ public class ResourceService : NotificationObject
"ko-KR",
};

private readonly Resources _Resources = new Resources();
private readonly IReadOnlyCollection<CultureInfo> _SupportedCultures;

/// <summary>
/// 多言語化されたリソースを取得します。
/// </summary>
public Resources Resources => this._Resources;
public Resources Resources { get; private set; }

/// <summary>
/// <summary>
/// サポートされているカルチャを取得します。
/// </summary>
public IReadOnlyCollection<CultureInfo> SupportedCultures => this._SupportedCultures;
public IReadOnlyCollection<CultureInfo> SupportedCultures { get; private set; }

private ResourceService()
private ResourceService()
{
this._SupportedCultures = this.supportedCultureNames
this.Resources = new Resources();
this.SupportedCultures = this.supportedCultureNames
.Select(x =>
{
try
Expand Down
3 changes: 2 additions & 1 deletion Grabacr07.KanColleViewer/Models/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Xml.Serialization;
using Grabacr07.KanColleViewer.Models.Data.Xml;
using Grabacr07.KanColleWrapper;
using Grabacr07.KanColleWrapper.Models;
using Livet;

namespace Grabacr07.KanColleViewer.Models
Expand Down Expand Up @@ -413,7 +414,7 @@ public KanColleClientSettings KanColleClientSettings
}

#endregion


#region EnableTranslations 変更通知プロパティ

Expand Down
8 changes: 6 additions & 2 deletions Grabacr07.KanColleViewer/Models/StatusService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@ public class StatusService : NotificationObject
#region static members

private static readonly StatusService current = new StatusService();
public static StatusService Current => current;

#endregion
public static StatusService Current
{
get { return current; }
}

#endregion

private readonly Subject<string> notifier;
private string persisitentMessage = "";
Expand Down
2 changes: 1 addition & 1 deletion Grabacr07.KanColleViewer/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@
// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を
// 既定値にすることができます:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.5.0.3")]
[assembly: AssemblyVersion("3.6.1.4")]
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ public class ShipCatalogSortWorker
private readonly NoneColumnViewModel noneColumn = new NoneColumnViewModel();
private SortableColumnViewModel currentSortTarget;

public IdColumnViewModel IdColumn { get; }
public TypeColumnViewModel TypeColumn { get; }
public NameColumnViewModel NameColumn { get; }
public LevelColumnViewModel LevelColumn { get; }
public ConditionColumnViewModel ConditionColumn { get; }
public FirepowerColumnViewModel FirepowerColumn { get; }
public TorpedoColumnViewModel TorpedoColumn { get; }
public AntiAirColumnViewModel AntiAirColumn { get; }
public ArmorColumnViewModel ArmorColumn { get; }
public LuckColumnViewModel LuckColumn { get; }
public ViewRangeColumnViewModel ViewRangeColumn { get; }
public EvasionColumnViewModel EvasionColumn { get; }
public AntiSubColumnViewModel AntiSubColumn { get; }
public IdColumnViewModel IdColumn { get; private set; }
public TypeColumnViewModel TypeColumn { get; private set; }
public NameColumnViewModel NameColumn { get; private set; }
public LevelColumnViewModel LevelColumn { get; private set; }
public ConditionColumnViewModel ConditionColumn { get; private set; }
public FirepowerColumnViewModel FirepowerColumn { get; private set; }
public TorpedoColumnViewModel TorpedoColumn { get; private set; }
public AntiAirColumnViewModel AntiAirColumn { get; private set; }
public ArmorColumnViewModel ArmorColumn { get; private set; }
public LuckColumnViewModel LuckColumn { get; private set; }
public ViewRangeColumnViewModel ViewRangeColumn { get; private set; }
public EvasionColumnViewModel EvasionColumn { get; private set; }
public AntiSubColumnViewModel AntiSubColumn { get; private set; }

public ShipCatalogSortWorker()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ public class ShipCatalogWindowViewModel : WindowViewModel
private readonly Subject<Unit> updateSource = new Subject<Unit>();
private readonly Homeport homeport = KanColleClient.Current.Homeport;

public ShipCatalogSortWorker SortWorker { get; }
public IReadOnlyCollection<ShipTypeViewModel> ShipTypes { get; }

public ShipLevelFilter ShipLevelFilter { get; }
public ShipLockFilter ShipLockFilter { get; }
public ShipSpeedFilter ShipSpeedFilter { get; }
public ShipModernizeFilter ShipModernizeFilter { get; }
public ShipRemodelingFilter ShipRemodelingFilter { get; }
public ShipExpeditionFilter ShipExpeditionFilter { get; }
public ShipSallyAreaFilter ShipSallyAreaFilter { get; }
public ShipCatalogSortWorker SortWorker { get; private set; }
public IReadOnlyCollection<ShipTypeViewModel> ShipTypes { get; private set; }

public ShipLevelFilter ShipLevelFilter { get; private set; }
public ShipLockFilter ShipLockFilter { get; private set; }
public ShipSpeedFilter ShipSpeedFilter { get; private set; }
public ShipModernizeFilter ShipModernizeFilter { get; private set; }
public ShipRemodelingFilter ShipRemodelingFilter { get; private set; }
public ShipExpeditionFilter ShipExpeditionFilter { get; private set; }
public ShipSallyAreaFilter ShipSallyAreaFilter { get; private set; }

public bool CheckAllShipTypes
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public ShipViewModel(int index, Ship ship)
{
this.Index = index;
this.Ship = ship;
this.SlotItems = ship.SlotItems.Select(i => new SlotItemViewModel(i.Info)).ToList();
// this.SlotItems = ship.SlotItems.Select(i => new SlotItemViewModel(i.Info)).ToList();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ private static Task<List<SlotItemViewModel>> UpdateCore()

foreach (var ship in ships.Values)
{
foreach (var target in ship.SlotItems.Where(x => x != null).Select(item => dic[item.Info.Id]))
foreach (var target in ship.EquippedSlots.Select(slot => dic[slot.Item.Info.Id]))
{
target.AddShip(ship);
}
Expand Down
19 changes: 14 additions & 5 deletions Grabacr07.KanColleViewer/ViewModels/Catalogs/SlotItemViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,22 @@ namespace Grabacr07.KanColleViewer.ViewModels.Catalogs
public class SlotItemViewModel : ViewModel
{
private int count;
public List<Counter> Ships { get; }
public List<Counter> Ships { get; private set; }

public class Counter
{
public Ship Ship { get; set; }
public int Count { get; set; }

public string ShipName => this.Ship.Info.Name;

public string ShipLevel => "Lv." + this.Ship.Level;
public string ShipName
{
get { return this.Ship.Info.Name; }
}

public string CountString => this.Count == 1 ? "" : " x " + this.Count + " ";
public string ShipLevel
{
get { return "Lv." + this.Ship.Level; }
}

public string StatsToolTip
{
Expand All @@ -42,6 +46,11 @@ public string StatsToolTip
return AddDetail;
}
}

public string CountString
{
get { return this.Count == 1 ? "" : " x " + this.Count + " "; }
}
}


Expand Down
Loading

0 comments on commit 64c8973

Please sign in to comment.