Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Zharay/KanColleViewer int…
Browse files Browse the repository at this point in the history
…o master-horizontal
  • Loading branch information
Zharay committed Apr 23, 2014
2 parents 9ed81e5 + 1725cd8 commit 1b8861c
Show file tree
Hide file tree
Showing 49 changed files with 1,639 additions and 109 deletions.
24 changes: 24 additions & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,30 @@
KCV Change Log
========================

v2.6.0 β r426 - 4/23/2014 The Spring Time Youth
* Direct fix from the main man himself, @Grabacr07.
* Back end - All it was is just file name changes and a few additional packets.
The following has changed from how things worked previously:
* **Fatigue values only update when you advance or withdraw from battle, not after battle.**
* Rearrangement of the fleets will only update when you return to homeport (main menu).

v2.5.0 r420 - 4/22/2014 The Spring Event
Note: Setting have been reset with this version! Please review them.
* *New* Custom sound alerts. Works on all versions of windows. Will randomly pick
an appropriate sound file under the "Sounds" folder. Acceptable formats are wav
and mp3. There are also options to change it's playback volume.
* *New* Fatigue notifications. When your fleet is suppose to recover their fatigue, you
are notified. This is not 100% accurate and off by default.
* Status bar now shows the information that is normally found in the fleet tab on the
overview tab as well.
* Line of Sight calculation is shown in the status bar in both fleet and overview.
* You can now sort the ship catalog by the extra stats.
* There is no longer a minimum height set in vertical KCV. Scrollbars will only appear if
you cover content in the window.
* There is now a button in the update menu that takes you directly to the latest found
version of KCV. The hyperlinks still work of course.
* Translations will come as they are found/needed. Auto-update is our friend!

v2.4.0 r403 - 4/12/2014 "To die for"
Note: Setting have been reset with this version! Please review them.
* *New* Flash quality select option - Choose from Low to Best and anything inbetween.
Expand Down
10 changes: 10 additions & 0 deletions Grabacr07.Desktop.Metro/Desktop.Metro.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@
<Prefer32Bit>false</Prefer32Bit>
<DocumentationFile>bin\Release\Desktop.Metro.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release %28beta%29|AnyCPU'">
<OutputPath>bin\Release %28beta%29\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<DocumentationFile>bin\Release\Desktop.Metro.xml</DocumentationFile>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="Livet">
<HintPath>..\packages\LivetCask.1.1.0.0\lib\net45\Livet.dll</HintPath>
Expand Down
2 changes: 1 addition & 1 deletion Grabacr07.KanColleViewer/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
}

#flashWrap {
position:fixed;
position:free;
z-index:1;
margin:0;
}
Expand Down
10 changes: 10 additions & 0 deletions Grabacr07.KanColleViewer/KanColleViewer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@
<PropertyGroup>
<ApplicationIcon>Assets\app.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release %28beta%29|AnyCPU'">
<OutputPath>bin\Release %28beta%29\</OutputPath>
<DefineConstants>TRACE;BETA</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="CoreAudioApi, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand Down
4 changes: 4 additions & 0 deletions Grabacr07.KanColleViewer/Models/ProductInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ public Version Version

public string VersionString
{
#if BETA
get { return this.Version.ToString() + " β"; }
#else
get { return this.Version.ToString(); }
#endif
}

public IReadOnlyCollection<Library> Libraries
Expand Down
6 changes: 3 additions & 3 deletions Grabacr07.KanColleViewer/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
// アセンブリに関連付けられている情報を変更するには、
// これらの属性値を変更してください。
[assembly: AssemblyTitle("KanColleViewer!")]
[assembly: AssemblyDescription("KanColleViewer!")]
[assembly: AssemblyDescription("KanColleViewer! β")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("grabacr.net")]
[assembly: AssemblyProduct("KanColleViewer!")]
[assembly: AssemblyProduct("KanColleViewer! β")]
[assembly: AssemblyCopyright("Copyright © 2013 Grabacr07")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
Expand Down Expand Up @@ -51,4 +51,4 @@
// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を
// 既定値にすることができます:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.5.0.0")]
[assembly: AssemblyVersion("2.6.0.426")]
2 changes: 1 addition & 1 deletion Grabacr07.KanColleViewer/Properties/Settings.Designer.cs

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

2 changes: 1 addition & 1 deletion Grabacr07.KanColleViewer/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
}

#flashWrap {
position:fixed;
position:free;
z-index:1;
margin:0;
}
Expand Down
6 changes: 3 additions & 3 deletions Grabacr07.KanColleViewer/ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ public Mode Mode
// 今後の実装にご期待ください
ThemeService.Current.ChangeAccent(Accent.Orange);
break;
case Mode.CriticalCondition:
ThemeService.Current.ChangeAccent(Accent.Orange);
break;
case Mode.CriticalCondition:
ThemeService.Current.ChangeAccent(Accent.Orange);
break;
}

this.RaisePropertyChanged();
Expand Down
51 changes: 41 additions & 10 deletions Grabacr07.KanColleWrapper/Homeport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,16 +175,39 @@ public MemberTable<UseItem> UseItems

internal Homeport(KanColleProxy proxy)
{
this.Ships = new MemberTable<Ship>();
this.Fleets = new MemberTable<Fleet>();
this.SlotItems = new MemberTable<SlotItem>();
this.UseItems = new MemberTable<UseItem>();
this.Dockyard = new Dockyard(proxy);
this.Repairyard = new Repairyard(this, proxy);
this.Logger = new Logger(proxy);
this.Quests = new Quests(proxy);

// ToDo: カオスってるので、あとで整理する

proxy.ApiSessionSource.Where(x => x.PathAndQuery == "/kcsapi/api_get_member/basic")
.TryParse<kcsapi_basic>()
.Subscribe(x => this.Admiral = new Admiral(x));

proxy.ApiSessionSource.Where(x => x.PathAndQuery == "/kcsapi/api_port/port")
.TryParse<kcsapi_port>()
.Subscribe(x =>
{
this.Ships = new MemberTable<Ship>(x.api_ship.Select(s => new Ship(this, s)));
this.Materials = new Materials(x.api_material.Select(m => new Material(m)).ToArray());
this.Repairyard.Update(x.api_ndock);
this.UpdateFleets(x.api_deck_port);
});

proxy.ApiSessionSource.Where(x => x.PathAndQuery == "/kcsapi/api_req_hokyu/charge")
.TryParse<kcsapi_charge>()
.Subscribe(this.Charge);

proxy.ApiSessionSource.Where(x => x.PathAndQuery == "/kcsapi/api_get_member/material")
.TryParse<kcsapi_material[]>()
.Subscribe(x => this.Materials = new Materials(x.Select(m => new Material(m)).ToArray()));

this.Ships = new MemberTable<Ship>();
this.Fleets = new MemberTable<Fleet>();
proxy.ApiSessionSource.Where(x => x.PathAndQuery == "/kcsapi/api_get_member/ship")
.Select(x => { SvData<kcsapi_ship2[]> result; return SvData.TryParse(x, out result) ? result : null; })
.Where(x => x != null && x.IsSuccess)
Expand All @@ -206,12 +229,10 @@ internal Homeport(KanColleProxy proxy)
this.UpdateFleets(x.api_deck_data);
});

this.SlotItems = new MemberTable<SlotItem>();
proxy.ApiSessionSource.Where(x => x.PathAndQuery == "/kcsapi/api_get_member/slotitem")
proxy.ApiSessionSource.Where(x => x.PathAndQuery == "/kcsapi/api_get_member/slot_item")
.TryParse<kcsapi_slotitem[]>()
.Subscribe(x => this.SlotItems = new MemberTable<SlotItem>(x.Select(s => new SlotItem(s))));

this.UseItems = new MemberTable<UseItem>();
proxy.ApiSessionSource.Where(x => x.PathAndQuery == "/kcsapi/api_get_member/useitem")
.TryParse<kcsapi_useitem[]>()
.Subscribe(x => this.UseItems = new MemberTable<UseItem>(x.Select(s => new UseItem(s))));
Expand All @@ -223,11 +244,6 @@ internal Homeport(KanColleProxy proxy)
proxy.ApiSessionSource.Where(x => x.PathAndQuery == "/kcsapi/api_get_member/deck_port")
.TryParse<kcsapi_deck[]>()
.Subscribe(this.UpdateFleets);

this.Dockyard = new Dockyard(proxy);
this.Repairyard = new Repairyard(this, proxy);
this.Logger = new Logger(proxy);
this.Quests = new Quests(proxy);
this.Rankings = new Rankings(proxy);
this.Logger = new Logger(proxy);
this.Translations = new Translations();
Expand All @@ -250,5 +266,20 @@ private void UpdateFleets(kcsapi_deck[] source)
this.Fleets = new MemberTable<Fleet>(source.Select(x => new Fleet(this, x)));
}
}

private void Charge(kcsapi_charge charge)
{
if (charge == null) return;

foreach (var ship in charge.api_ship)
{
var target = this.Ships[ship.api_id];
if (target == null) continue;

target.Charge(ship.api_fuel, ship.api_bull, ship.api_onslot);
}

foreach (var f in Fleets.Values) f.UpdateShips();
}
}
}
24 changes: 15 additions & 9 deletions Grabacr07.KanColleWrapper/KanColleClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Text;
using System.Threading.Tasks;
using Grabacr07.KanColleWrapper.Internal;
using Grabacr07.KanColleWrapper.Models.Raw;
using Livet;

namespace Grabacr07.KanColleWrapper
Expand Down Expand Up @@ -42,10 +43,10 @@ public static KanColleClient Current
/// </summary>
public ObservableSynchronizedCollection<KanColleError> Errors { get; private set; }

/// <summary>
/// Application update notifications and downloads.
/// </summary>
public Updater Updater { get; private set; }
/// <summary>
/// Application update notifications and downloads.
/// </summary>
public Updater Updater { get; private set; }

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

Expand Down Expand Up @@ -74,13 +75,18 @@ private KanColleClient()
this.Errors = new ObservableSynchronizedCollection<KanColleError>();

this.Proxy = new KanColleProxy();
this.Master = new Master(this.Proxy);
//this.Master = new Master(this.Proxy);
this.Homeport = new Homeport(this.Proxy);
this.Updater = new Updater();
this.Updater = new Updater();

this.Proxy.ApiSessionSource.Where(x => x.PathAndQuery == "/kcsapi/api_start")
.TryParse()
.Subscribe(x => this.IsStarted = x.IsSuccess);
this.Proxy.ApiSessionSource.Where(x => x.PathAndQuery == "/kcsapi/api_start2")
.TryParse<kcsapi_start2>()
.Select(x => new Master(x))
.Subscribe(x =>
{
this.Master = x;
this.IsStarted = true;
});
}
}
}
20 changes: 16 additions & 4 deletions Grabacr07.KanColleWrapper/KanColleWrapper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release %28beta%29|AnyCPU'">
<OutputPath>bin\Release %28beta%29\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="FiddlerCore4, Version=4.4.5.3, Culture=neutral, PublicKeyToken=67cb91587178ac5a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand Down Expand Up @@ -100,15 +109,18 @@
<Compile Include="Models\QuestState.cs" />
<Compile Include="Models\QuestType.cs" />
<Compile Include="Models\Ranking.cs" />
<Compile Include="Models\Raw\kcsapi_charge.cs" />
<Compile Include="Models\Raw\kcsapi_battleresult.cs" />
<Compile Include="Models\Raw\kcsapi_createitem.cs" />
<Compile Include="Models\Raw\kcsapi_createship.cs" />
<Compile Include="Models\Raw\kcsapi_port.cs" />
<Compile Include="Models\Raw\kcsapi_quest.cs" />
<Compile Include="Models\Raw\kcsapi_questlist.cs" />
<Compile Include="Models\Raw\kcsapi_ranking.cs" />
<Compile Include="Models\Raw\kcsapi_ranking_getlist.cs" />
<Compile Include="Models\Raw\kcsapi_ship3.cs" />
<Compile Include="Models\Raw\kcsapi_slot_data.cs" />
<Compile Include="Models\Raw\kcsapi_start2.cs" />
<Compile Include="Models\RepairingCompletedEventArgs.cs" />
<Compile Include="Models\BuildingCompletedEventArgs.cs" />
<Compile Include="Models\ConditionType.cs" />
Expand All @@ -125,7 +137,7 @@
<Compile Include="Models\Raw\kcsapi_material.cs" />
<Compile Include="Models\Raw\kcsapi_ndock.cs" />
<Compile Include="Models\Raw\kcsapi_start.cs" />
<Compile Include="Models\Raw\kcsapi_stype.cs" />
<Compile Include="Models\Raw\kcsapi_mst_stype.cs" />
<Compile Include="Models\RepairingDock.cs" />
<Compile Include="Models\RepairingDockState.cs" />
<Compile Include="Models\ShipCriticalConditionEventArgs.cs" />
Expand All @@ -145,11 +157,11 @@
<Compile Include="Models\Rank.cs" />
<Compile Include="Models\Raw\kcsapi_deck.cs" />
<Compile Include="Models\Raw\kcsapi_ship.cs" />
<Compile Include="Models\Raw\kcsapi_master_ship.cs" />
<Compile Include="Models\Raw\kcsapi_mst_ship.cs" />
<Compile Include="Models\Raw\kcsapi_slotitem.cs" />
<Compile Include="Models\Raw\kcsapi_master_slotitem.cs" />
<Compile Include="Models\Raw\kcsapi_mst_slotitem.cs" />
<Compile Include="Models\Raw\kcsapi_useitem.cs" />
<Compile Include="Models\Raw\kcsapi_master_useitem.cs" />
<Compile Include="Models\Raw\kcsapi_mst_useitem.cs" />
<Compile Include="Models\Ship.cs" />
<Compile Include="Models\ShipInfo.cs" />
<Compile Include="Models\SlotItem.cs" />
Expand Down
25 changes: 5 additions & 20 deletions Grabacr07.KanColleWrapper/Master.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,27 +35,12 @@ public class Master
public MasterTable<ShipType> ShipTypes { get; private set; }


internal Master(KanColleProxy proxy)
internal Master(kcsapi_start2 start2)
{
this.Ships = new MasterTable<ShipInfo>();
proxy.ApiSessionSource.Where(x => x.PathAndQuery == "/kcsapi/api_get_master/ship")
.TryParse<kcsapi_master_ship[]>()
.Subscribe(x => this.Ships = new MasterTable<ShipInfo>(x.Select(s => new ShipInfo(s))));

this.SlotItems = new MasterTable<SlotItemInfo>();
proxy.ApiSessionSource.Where(x => x.PathAndQuery == "/kcsapi/api_get_master/slotitem")
.TryParse<kcsapi_master_slotitem[]>()
.Subscribe(x => this.SlotItems = new MasterTable<SlotItemInfo>(x.Select(s => new SlotItemInfo(s))));

this.UseItems = new MasterTable<UseItemInfo>();
proxy.ApiSessionSource.Where(x => x.PathAndQuery == "/kcsapi/api_get_master/useitem")
.TryParse<kcsapi_master_useitem[]>()
.Subscribe(x => this.UseItems = new MasterTable<UseItemInfo>(x.Select(s => new UseItemInfo(s))));

this.ShipTypes = new MasterTable<ShipType>();
proxy.ApiSessionSource.Where(x => x.PathAndQuery == "/kcsapi/api_get_master/stype")
.TryParse<kcsapi_stype[]>()
.Subscribe(x => this.ShipTypes = new MasterTable<ShipType>(x.Select(s => new ShipType(s))));
this.ShipTypes = new MasterTable<ShipType>(start2.api_mst_stype.Select(x => new ShipType(x)));
this.Ships = new MasterTable<ShipInfo>(start2.api_mst_ship.Select(x => new ShipInfo(x)));
this.SlotItems = new MasterTable<SlotItemInfo>(start2.api_mst_slotitem.Select(x => new SlotItemInfo(x)));
this.UseItems = new MasterTable<UseItemInfo>(start2.api_mst_useitem.Select(x => new UseItemInfo(x)));
}
}
}
7 changes: 7 additions & 0 deletions Grabacr07.KanColleWrapper/Models/Fleet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,13 @@ internal void UpdateStatus()
else this.State = FleetState.Ready;
}

internal void UpdateShips()
{
this.RaisePropertyChanged("Ships");
this.ReSortie.Update(this.Ships, this.homeport.Repairyard);
this.UpdateStatus();
}

public override string ToString()
{
return string.Format("ID = {0}, Name = \"{1}\", Ships = {2}", this.Id, this.Name, this.GetShips().Select(s => "\"" + s.Info.Name + "\"").ToString(","));
Expand Down
5 changes: 5 additions & 0 deletions Grabacr07.KanColleWrapper/Models/LimitedValue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ public LimitedValue(int current, int maximum, int minimum)
this.Maximum = maximum;
this.Minimum = minimum;
}

public LimitedValue Update(int current)
{
return new LimitedValue(current, this.Maximum, this.Minimum);
}
}

/// <summary>
Expand Down
Loading

0 comments on commit 1b8861c

Please sign in to comment.