├── .gitignore
├── .gitmodules
├── KcvPlugins
├── BattleLog
│ ├── Converters
│ │ └── SimpleShipConverter.cs
│ ├── Data
│ │ ├── ResourceService.cs
│ │ └── Settings.cs
│ ├── Entrance.cs
│ ├── Enums
│ │ ├── BattleSortTarget.cs
│ │ └── BattleType.cs
│ ├── Extensions
│ │ └── ViewRangeEx.cs
│ ├── Helper
│ │ ├── AdmiralInfoHelper.cs
│ │ ├── BattleLogsHelper.cs
│ │ ├── LogsHelperBase.cs
│ │ └── LogsHelperBase_Analysis.cs
│ ├── Logger.csproj
│ ├── Modes
│ │ ├── AdmiralInfo.cs
│ │ ├── AdmiralInfoChangeEventArgs.cs
│ │ ├── AdmiralInfoList.cs
│ │ ├── BattleEndEventArgs.cs
│ │ ├── BattleResult.cs
│ │ ├── BattleResultLists.cs
│ │ ├── CombinedBattleEndEventArgs.cs
│ │ ├── ILogsList.cs
│ │ ├── IResult.cs
│ │ ├── SimpleAdmiral.cs
│ │ └── SimpleShip.cs
│ ├── Modules
│ │ ├── InitModules.cs
│ │ └── LoggerModules.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── TextResource.Designer.cs
│ ├── TextResource.resx
│ ├── ViewModels
│ │ ├── BattleLogViewModel.cs
│ │ ├── Item
│ │ │ ├── BattleResultViewModel.cs
│ │ │ ├── MissionViewModel.cs
│ │ │ └── SimpleShipViewModel.cs
│ │ ├── LoggerViewModel.cs
│ │ ├── SettingsViewModel.cs
│ │ └── Sortable
│ │ │ ├── BattleFilter.cs
│ │ │ ├── BattleSortWorker.cs
│ │ │ └── SortableColumnViewModel.cs
│ ├── Views
│ │ ├── BattleLogWindow.xaml
│ │ ├── BattleLogWindow.xaml.cs
│ │ ├── SettingsControl.xaml
│ │ └── SettingsControl.xaml.cs
│ ├── mome.txt
│ └── packages.config
├── DebugExtensions
│ ├── Data
│ │ └── ResourceService.cs
│ ├── DebugExtensions.csproj
│ ├── Entrance.cs
│ ├── Helper
│ │ ├── ErrorLogHelper.cs
│ │ ├── LogHelper.cs
│ │ └── MessageLogHelper.cs
│ ├── Modules
│ │ ├── InitModules.cs
│ │ └── LogsModules.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── TextResource.Designer.cs
│ ├── TextResource.resx
│ ├── ViewModels
│ │ └── SettingsViewModel.cs
│ ├── Views
│ │ ├── SettingsControl.xaml
│ │ └── SettingsControl.xaml.cs
│ └── packages.config
├── KcvPlugins.sln
├── KcvPlugins
│ ├── App.config
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── KcvPlugins.csproj
│ ├── KcvSimulationWindow.xaml
│ ├── KcvSimulationWindow.xaml.cs
│ ├── MainWindow.xaml
│ ├── MainWindow.xaml.cs
│ ├── OpenToastWindow.xaml
│ ├── OpenToastWindow.xaml.cs
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
│ ├── ToastItemControl.xaml
│ ├── ToastItemControl.xaml.cs
│ ├── ToastWindow.xaml
│ ├── ToastWindow.xaml.cs
│ ├── Window1.xaml
│ ├── Window1.xaml.cs
│ ├── img
│ │ └── 17.ico
│ └── sounds
│ │ └── notify.wav
├── Plugins.Core
│ ├── Backup
│ │ ├── propex.snippet
│ │ └── propsetting.snippet
│ ├── Collections
│ │ └── Generic.cs
│ ├── Enums
│ │ ├── MessageType.cs
│ │ ├── ModulesChangeEventArgsType.cs
│ │ ├── ModulesType.cs
│ │ └── ShipStatus.cs
│ ├── Extensions
│ │ ├── ArrayEx.cs
│ │ ├── DistinctExtensions.cs
│ │ ├── EnumEx.cs
│ │ ├── IEnumerableEx.cs
│ │ ├── LimitedValueEx.cs
│ │ └── ReflectionEx.cs
│ ├── GenericMessager.cs
│ ├── Helper
│ │ ├── JsonHelper.cs
│ │ ├── KcvMainWindowControlHelper.cs
│ │ ├── MessageBoxDialog.cs
│ │ ├── PenetrateHelper.cs
│ │ ├── TextFileHelper.cs
│ │ ├── ThreadHelper.cs
│ │ ├── ToolWindowHelper.cs
│ │ └── UIHelper.cs
│ ├── Models
│ │ ├── MessageAction.cs
│ │ ├── MessageItem.cs
│ │ ├── ModulesChangeEventArgs.cs
│ │ └── ModulesItem.cs
│ ├── Modules
│ │ ├── InitModules.cs
│ │ ├── MessagerModules.cs
│ │ ├── ModulesBase.cs
│ │ └── PublicModules.cs
│ ├── Plugins.Core.csproj
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── StaticData.cs
│ ├── Styles
│ │ ├── Controls.xaml
│ │ ├── Generic.xaml
│ │ └── Slider.Metro.xaml
│ ├── TextResource.Designer.cs
│ ├── TextResource.resx
│ ├── ViewModels
│ │ └── ViewModelEx.cs
│ ├── Views
│ │ ├── MessageBoxDialog.xaml
│ │ └── MessageBoxDialog.xaml.cs
│ ├── Win32
│ │ ├── ToolWindow.cs
│ │ └── Window.cs
│ ├── logs.txt
│ └── packages.config
├── QuestsExtensions
│ ├── Converters
│ │ └── QuestConverter.cs
│ ├── Data
│ │ ├── LocalQuests.cs
│ │ ├── LocalQuestsSettings.cs
│ │ ├── ResourceService.cs
│ │ └── Settings.cs
│ ├── Entrance.cs
│ ├── EntranceSettings.cs
│ ├── Extensions
│ │ └── QuestEx.cs
│ ├── Helper
│ │ └── QuestHelper.cs
│ ├── Models
│ │ ├── Quest.cs
│ │ └── QuestsResource.cs
│ ├── Modules
│ │ ├── InitModules.cs
│ │ ├── ModulesBase.cs
│ │ └── QuestsModules.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── QuestsExtensions.csproj
│ ├── TextResource.Designer.cs
│ ├── TextResource.resx
│ ├── ViewModels
│ │ ├── QuestViewModelEx.cs
│ │ ├── QuestsViewModelEx.cs
│ │ └── SettingsViewModel.cs
│ ├── Views
│ │ ├── QuestControl.xaml
│ │ ├── QuestControl.xaml.cs
│ │ ├── SettingsControl.xaml
│ │ └── SettingsControl.xaml.cs
│ ├── XmlFile
│ │ ├── QuestsResource.zh-cn.xml
│ │ └── Settings.xml
│ └── packages.config
├── SettingsExtensions
│ ├── Controls
│ │ ├── AppendProperty.cs
│ │ ├── ConditionDataTemplateSelector.cs
│ │ ├── FeetStyleTypeDataTemplateSelector.cs
│ │ └── WindowViewTypeDataTemplateSelector.cs
│ ├── Converters
│ │ ├── ArcLimitedValueConverter.cs
│ │ ├── FleetsColorConverter.cs
│ │ ├── FleetsConverter.cs
│ │ ├── FuelColorConverter.cs
│ │ ├── KeySettingNameConverter.cs
│ │ ├── KeySettingTypeConverter.cs
│ │ └── WarningColorConverter.cs
│ ├── Data
│ │ ├── KeySetting.cs
│ │ ├── ResourceService.cs
│ │ └── Settings.cs
│ ├── Entrance.cs
│ ├── Entrance_Hotkey.cs
│ ├── Enums
│ │ ├── FeetStyleType.cs
│ │ ├── KeyType.cs
│ │ └── WindowViewType.cs
│ ├── Extensions
│ │ └── KanColleHostEx.cs
│ ├── Helper
│ │ ├── HotKeyHelper.cs
│ │ ├── KeysHelper.cs
│ │ ├── ThemeHelper.cs
│ │ ├── WindowStateHelper.cs
│ │ └── WindowViewHelper.cs
│ ├── Models
│ │ ├── KeyModulesItem.cs
│ │ ├── KeySetting.cs
│ │ ├── MessageAction.cs.bak
│ │ ├── SetMessage.cs.bak
│ │ └── ThemeItem.cs
│ ├── Modules
│ │ ├── ExitTipModules.cs
│ │ ├── Generic
│ │ │ ├── HotKeyHelper.cs
│ │ │ └── MessagerHelper.cs.bak
│ │ ├── InitModules.cs
│ │ ├── KeysModules.cs
│ │ ├── MainWindowModules.cs
│ │ ├── NotifyIconModules.cs
│ │ ├── PublicModulesKeys.cs
│ │ ├── SimpleFleetModules.cs
│ │ ├── ThemeModules.cs
│ │ └── WindowViewModules.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── SampleData
│ │ ├── FleetViewModelSampleData.xaml
│ │ └── FleetsViewModelSampleData.xaml
│ ├── SettingsExtensions.csproj
│ ├── TextResource.Designer.cs
│ ├── TextResource.en.resx
│ ├── TextResource.resx
│ ├── ViewModels
│ │ ├── Collections
│ │ │ ├── ListViewModels.cs
│ │ │ └── ThemeListViewModels.cs
│ │ ├── Items
│ │ │ ├── FeetStyleTypeViewModel.cs
│ │ │ ├── KeyModulesItemViewModel.cs
│ │ │ ├── SelectedItemViewModel.cs
│ │ │ ├── ThemeItemViewModel.cs
│ │ │ └── WindowViewTypeViewModel.cs
│ │ ├── KeysSettingsViewModel.cs
│ │ ├── SettingsViewModel.cs
│ │ └── SimpleFleetViewModel.cs.bak
│ ├── Views
│ │ ├── ContainerWindow.xaml
│ │ ├── ContainerWindow.xaml.cs
│ │ ├── KeysSettingsControl.xaml
│ │ ├── KeysSettingsControl.xaml.cs
│ │ ├── MessageBoxDialog.xaml
│ │ ├── MessageBoxDialog.xaml.cs
│ │ ├── SettingsControl.xaml
│ │ ├── SettingsControl.xaml.cs
│ │ ├── Simple
│ │ │ ├── ExpeditionsControl.xaml
│ │ │ ├── ExpeditionsControl.xaml.cs
│ │ │ ├── FleetControl.xaml
│ │ │ ├── FleetControl.xaml.cs
│ │ │ ├── QuestsControl.xaml
│ │ │ ├── QuestsControl.xaml.cs
│ │ │ ├── ShipyardControl.xaml
│ │ │ └── ShipyardControl.xaml.cs
│ │ ├── SimpleFleetWindow.xaml
│ │ ├── SimpleFleetWindow.xaml.cs
│ │ ├── SplitWindowButton.xaml
│ │ ├── SplitWindowButton.xaml.cs
│ │ ├── TabsWindowButton.xaml
│ │ └── TabsWindowButton.xaml.cs
│ ├── Win32
│ │ └── HotKey.cs
│ ├── memo.txt
│ ├── packages.config
│ └── readme.SettingsExtensions.txt
├── SoundNotifier
│ ├── Modules
│ │ ├── InitModules.cs
│ │ └── SoundsModules.cs
│ ├── Notifier.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── SoundNotifier.csproj
│ ├── readme.SoundNotifier.txt
│ └── sounds
│ │ ├── notify.wav
│ │ └── warning.wav
├── ViewRange
│ ├── Converters
│ │ └── ViewRangeConverter.cs
│ ├── Data
│ │ ├── ResourceService.cs
│ │ └── Settings.cs
│ ├── Entrance.cs
│ ├── Enums
│ │ └── MessageType.cs
│ ├── Extensions
│ │ └── ViewRangeEx.cs
│ ├── Helper
│ │ └── CalcFleetViewRange.cs
│ ├── Modules
│ │ ├── InitModules.cs
│ │ └── ViewRangeModules.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── TextResource.Designer.cs
│ ├── TextResource.resx
│ ├── ViewModels
│ │ └── SettingsViewModel.cs
│ ├── ViewRange.csproj
│ ├── Views
│ │ ├── ResourceDictionary.xaml
│ │ ├── SettingsControl.xaml
│ │ └── SettingsControl.xaml.cs
│ └── packages.config
├── Warning
│ ├── Data
│ │ ├── ResourceService.cs
│ │ └── Settings.cs
│ ├── Entrance.cs
│ ├── Modules
│ │ ├── InitModules.cs
│ │ └── WarningModules.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Readme.Warning.txt
│ ├── TextResource.Designer.cs
│ ├── TextResource.resx
│ ├── Themes
│ │ ├── Accents
│ │ │ └── Red.xaml
│ │ ├── ThemeServiceEx.cs
│ │ └── ThemeServiceEx.cs.bak
│ ├── ViewModels
│ │ ├── SettingsViewModel.cs
│ │ └── ShipStatusViewModel.cs
│ ├── Views
│ │ ├── SettingsControl.xaml
│ │ ├── SettingsControl.xaml.cs
│ │ ├── StatusItemControl.xaml
│ │ ├── StatusItemControl.xaml.cs
│ │ ├── StatusWindow.xaml
│ │ └── StatusWindow.xaml.cs
│ ├── Warning.csproj
│ ├── app.config
│ ├── memo.txt
│ └── packages.config
└── WindowsNotifierForWin7
│ ├── Enums
│ └── ToastType.cs
│ ├── Modules
│ ├── InitModules.cs
│ └── NotifierModules.cs
│ ├── Properties
│ └── AssemblyInfo.cs
│ ├── Readme.WindowsNotifierEx.txt
│ ├── ToastItemControl.xaml
│ ├── ToastItemControl.xaml.cs
│ ├── ToastMessage.cs
│ ├── ToastWindow.xaml
│ ├── ToastWindow.xaml.cs
│ ├── WindowsNotifier.cs
│ ├── WindowsNotifierEx.csproj
│ └── memo.txt
├── LICENSE
└── README.md
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "KanColleViewer"]
2 | path = KanColleViewer
3 | url = https://github.com/Grabacr07/KanColleViewer
4 | [submodule "WebSitePage"]
5 | path = WebSitePage
6 | url = https://github.com/AMMing/KcvPluginsPage.git
7 |
--------------------------------------------------------------------------------
/KcvPlugins/BattleLog/Converters/SimpleShipConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Globalization;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows.Data;
8 | using System.Windows.Media;
9 | using Grabacr07.KanColleViewer.ViewModels.Contents.Fleets;
10 | using Grabacr07.KanColleWrapper.Models;
11 | using AMing.Plugins.Core.Extensions;
12 | using AMing.Logger.ViewModels.Item;
13 |
14 | namespace AMing.Logger.Converters
15 | {
16 | public class SimpleShipConverter : IValueConverter
17 | {
18 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
19 | {
20 | if (value is SimpleShipViewModel)
21 | {
22 | var ship = value as SimpleShipViewModel;
23 | if (ship != null)
24 | {
25 | return string.Format("[Id {0}] {1} [Lv.{2}{3}][HP {4}/{5}]",
26 | ship.Id,
27 | ship.Name,
28 | ship.Level,
29 | ship.LevelUpCount > 0 ?
30 | string.Format("→{0}", ship.Level + ship.LevelUpCount) :
31 | string.Empty,
32 |
33 | ship.HP_After != ship.HP_Before ?
34 | string.Format("{0}→{1}", ship.HP_Before, ship.HP_After) :
35 | string.Format("{0}", ship.HP_After),
36 | ship.HP_Max
37 | );
38 | }
39 | }
40 |
41 | return value;
42 | }
43 |
44 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
45 | {
46 | throw new NotImplementedException();
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/KcvPlugins/BattleLog/Data/ResourceService.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Globalization;
4 | using System.Linq;
5 | using System.Threading.Tasks;
6 | using Livet;
7 |
8 | namespace AMing.Logger.Data
9 | {
10 | ///
11 | /// 多言語化されたリソースへのアクセスを提供します。
12 | ///
13 | public class ResourceService : NotificationObject
14 | {
15 | #region static members
16 |
17 | private static readonly ResourceService current = new ResourceService();
18 |
19 | public static ResourceService Current
20 | {
21 | get { return current; }
22 | }
23 |
24 | #endregion
25 |
26 | ///
27 | /// サポートされているカルチャの名前。
28 | ///
29 | private readonly string[] supportedCultureNames =
30 | {
31 | //"ja", // Resources.resx
32 | "en",
33 | "zh-CN"//,
34 | //"ko-KR",
35 | };
36 |
37 | private readonly TextResource _TextResource = new TextResource();
38 | private readonly IReadOnlyCollection _SupportedCultures;
39 |
40 | ///
41 | /// 多言語化されたリソースを取得します。
42 | ///
43 | public TextResource TextResource
44 | {
45 | get { return this._TextResource; }
46 | }
47 |
48 | ///
49 | /// サポートされているカルチャを取得します。
50 | ///
51 | public IReadOnlyCollection SupportedCultures
52 | {
53 | get { return this._SupportedCultures; }
54 | }
55 |
56 | private ResourceService()
57 | {
58 | this._SupportedCultures = this.supportedCultureNames
59 | .Select(x =>
60 | {
61 | try
62 | {
63 | return CultureInfo.GetCultureInfo(x);
64 | }
65 | catch (CultureNotFoundException)
66 | {
67 | return null;
68 | }
69 | })
70 | .Where(x => x != null)
71 | .ToList();
72 | }
73 |
74 | ///
75 | /// 指定されたカルチャ名を使用して、リソースのカルチャを変更します。
76 | ///
77 | /// カルチャの名前。
78 | public void ChangeCulture(string name)
79 | {
80 | TextResource.Culture = this.SupportedCultures.SingleOrDefault(x => x.Name == name);
81 |
82 | this.RaisePropertyChanged("Resources");
83 | }
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/KcvPlugins/BattleLog/Data/Settings.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Threading.Tasks;
6 | using System.Xml.Serialization;
7 | using Grabacr07.KanColleViewer.Models.Data.Xml;
8 | using Grabacr07.KanColleWrapper;
9 | using Livet;
10 | using Grabacr07.KanColleViewer.Models;
11 | using System.Windows.Input;
12 | using MetroRadiance;
13 |
14 | namespace AMing.Logger.Data
15 | {
16 | [Serializable]
17 | public class Settings
18 | {
19 | #region static members
20 |
21 | #if DEBUG
22 | private static readonly string filePath = Path.Combine(
23 | Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
24 | "y2443.com",
25 | "Logger.Debug",
26 | "Settings.xml");
27 | #else
28 | private static readonly string filePath = Path.Combine(
29 | Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
30 | "y2443.com",
31 | "Logger",
32 | "Settings.xml");
33 | #endif
34 |
35 | public static Settings Current { get; set; }
36 |
37 | public static void Load()
38 | {
39 | try
40 | {
41 | Current = filePath.ReadXml();
42 | }
43 | catch (Exception ex)
44 | {
45 | Current = GetInitialSettings();
46 | System.Diagnostics.Debug.WriteLine(ex);
47 | }
48 | }
49 |
50 | public static Settings GetInitialSettings()
51 | {
52 | return new Settings
53 | {
54 | };
55 | }
56 |
57 | #endregion
58 |
59 | #region member
60 |
61 |
62 |
63 | #endregion
64 |
65 | public void Save()
66 | {
67 | try
68 | {
69 | this.WriteXml(filePath);
70 | }
71 | catch (Exception ex)
72 | {
73 | System.Diagnostics.Debug.WriteLine(ex);
74 | }
75 | }
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/KcvPlugins/BattleLog/Entrance.cs:
--------------------------------------------------------------------------------
1 | using Grabacr07.KanColleViewer.Composition;
2 | using Grabacr07.KanColleWrapper;
3 | using Grabacr07.KanColleWrapper.Models.Raw;
4 | using MetroRadiance;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.ComponentModel.Composition;
8 | using System.Linq;
9 | using System.Text;
10 | using System.Threading.Tasks;
11 | using System.Windows.Controls;
12 | using kcv = Grabacr07.KanColleViewer;
13 |
14 | namespace AMing.Logger
15 | {
16 | [Export(typeof(IToolPlugin))]
17 | [ExportMetadata("Title", "Logger")]
18 | [ExportMetadata("Description", "Logger")]
19 | [ExportMetadata("Version", Entrance.IToolPluginVersion)]
20 | [ExportMetadata("Author", "@AMing")]
21 | public class Entrance : IToolPlugin
22 | {
23 | private readonly ViewModels.SettingsViewModel settingsViewModel = new ViewModels.SettingsViewModel();
24 |
25 |
26 | public const string IToolPluginVersion = "1.0";
27 | public string ToolName
28 | {
29 | get
30 | {
31 | return TextResource.Plugin_ToolName;
32 | }
33 | }
34 |
35 | public object GetToolView()
36 | {
37 | return new Views.SettingsControl { DataContext = this.settingsViewModel };
38 | }
39 |
40 | public object GetSettingsView()
41 | {
42 | return null;
43 | }
44 |
45 | public Entrance()
46 | {
47 | Init();
48 | }
49 |
50 | ~Entrance()
51 | {
52 | Exit();
53 | }
54 |
55 | Modules.InitModules initModules;
56 | private void Init()
57 | {
58 | initModules = new Modules.InitModules();
59 | initModules.Initialize();
60 | Modules.LoggerModules.Current.SettingsViewModel = this.settingsViewModel;
61 |
62 | Data.Settings.Load();
63 | }
64 |
65 | private void Exit()
66 | {
67 | Data.Settings.Current.Save();
68 | }
69 | }
70 |
71 | }
72 |
--------------------------------------------------------------------------------
/KcvPlugins/BattleLog/Enums/BattleSortTarget.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace AMing.Logger.Enums
8 | {
9 | public enum BattleSortTarget
10 | {
11 | None,
12 | Date,
13 | Mvp,
14 | Flagship,
15 | GetShip,
16 | WinRank,
17 | QuestName
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/KcvPlugins/BattleLog/Enums/BattleType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace AMing.Logger.Enums
8 | {
9 | public enum BattleType
10 | {
11 | ///
12 | /// 普通舰队
13 | ///
14 | Normal = 0,
15 | ///
16 | /// 联合舰队
17 | ///
18 | Combined = 1
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/KcvPlugins/BattleLog/Extensions/ViewRangeEx.cs:
--------------------------------------------------------------------------------
1 | using Grabacr07.KanColleWrapper.Models;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Reflection;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 | using AMing.Plugins.Core.Extensions;
9 | using Grabacr07.KanColleViewer.ViewModels.Contents.Fleets;
10 |
11 | namespace AMing.Logger.Extensions
12 | {
13 | public static class ViewRangeEx
14 | {
15 | public static Fleet GetFleet(this FleetViewModel data)
16 | {
17 | return data.GetField("source");
18 | }
19 | public static T GetRawData(this RawDataWrapper data)
20 | {
21 | return data.GetField("RawData");
22 | }
23 | public static int? Get(this int[] array, int index)
24 | {
25 | return array.Length > index ? (int?)array[index] : null;
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/KcvPlugins/BattleLog/Helper/AdmiralInfoHelper.cs:
--------------------------------------------------------------------------------
1 | using Grabacr07.KanColleWrapper;
2 | using Grabacr07.KanColleWrapper.Models.Raw;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.IO;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 |
10 | namespace AMing.Logger.Helper
11 | {
12 | public class AdmiralInfoHelper : LogsHelperBase
13 | {
14 | #region Current
15 |
16 | private static AdmiralInfoHelper _current = new AdmiralInfoHelper();
17 |
18 | public static AdmiralInfoHelper Current
19 | {
20 | get { return _current; }
21 | set { _current = value; }
22 | }
23 |
24 | #endregion
25 | protected override int MaxSaveCount { get { return 1000; } }
26 | protected override string FolderName { get { return "AdmiralInfo"; } }
27 |
28 | protected readonly static TimeSpan Interval = TimeSpan.FromHours(1);
29 |
30 | public void Append(KanColleClient kanColleClient, Action isAppend)
31 | {
32 | base.Append(list =>
33 | {
34 | var admiralInfo = new Modes.AdmiralInfo(KanColleClient.Current.Homeport.Admiral, KanColleClient.Current.Homeport.Materials);
35 |
36 | if (list.UpdateDate.Add(Interval) > DateTime.Now || (
37 | admiralInfo.Fuel == 0 &&
38 | admiralInfo.Ammunition == 0 &&
39 | admiralInfo.Steel == 0 &&
40 | admiralInfo.Bauxite == 0
41 | ))
42 | {
43 | isAppend(false);
44 | return false;
45 | }
46 | var newlist = list.List.ToList();
47 | newlist.Add(admiralInfo);
48 | list.List = newlist.ToArray();
49 |
50 | isAppend(true);
51 | return true;
52 | });
53 | }
54 |
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/KcvPlugins/BattleLog/Helper/LogsHelperBase_Analysis.cs:
--------------------------------------------------------------------------------
1 | using AMing.Logger.Modes;
2 | using AMing.Plugins.Core.Helper;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.IO;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using AMing.Plugins.Core.Extensions;
10 | using System.Collections;
11 |
12 | namespace AMing.Logger.Helper
13 | {
14 |
15 | public partial class LogsHelperBase
16 | {
17 | ///
18 | /// 获取全部日志文件路径
19 | ///
20 | ///
21 | protected virtual IList GetAllFilePath()
22 | {
23 | var list = new List
24 | {
25 | this.LastFilePath
26 | };
27 | var dirInfo = new DirectoryInfo(this.BackupFolderPath);
28 | if (dirInfo.Exists)
29 | {
30 | var backuplist = dirInfo.GetFiles(string.Format("*.{0}", this.logFormat)).Select(x => x.FullName);
31 | list.AddRange(backuplist);
32 | }
33 | return list;
34 | }
35 | ///
36 | /// 获取全部列表
37 | ///
38 | ///
39 | protected virtual IList GetAllList()
40 | {
41 | return GetAllFilePath().Select(x => GetList(x)).ToList();
42 | }
43 | ///
44 | /// 获取所有的项(通过id移除重复项)
45 | ///
46 | ///
47 | protected virtual IList GetAllItem(IList allList)
48 | {
49 | var result = allList.SelectMany(x => x.List).Distinct(x => x.Id);
50 |
51 | return result.ToList();
52 | }
53 |
54 | public virtual IList GetInfo(out IList list, out DateTime lastUpdateDate)
55 | {
56 | var allList = GetAllList();
57 |
58 | list = GetAllItem(allList);
59 | lastUpdateDate = allList.Select(x => x.UpdateDate).OrderByDescending(x => x).FirstOrDefault();
60 |
61 | return allList;
62 | }
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/KcvPlugins/BattleLog/Modes/AdmiralInfoChangeEventArgs.cs:
--------------------------------------------------------------------------------
1 | using Grabacr07.KanColleWrapper;
2 | using Grabacr07.KanColleWrapper.Models.Raw;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace AMing.Logger.Modes
10 | {
11 | public class AdmiralInfoChangeEventArgs : EventArgs
12 | {
13 | public KanColleClient KanColleClient { get; set; }
14 |
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/KcvPlugins/BattleLog/Modes/AdmiralInfoList.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace AMing.Logger.Modes
8 | {
9 | public class AdmiralInfoList : ILogsList
10 | {
11 | public DateTime UpdateDate { get; set; }
12 |
13 | public AdmiralInfo[] List { get; set; }
14 |
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/KcvPlugins/BattleLog/Modes/BattleEndEventArgs.cs:
--------------------------------------------------------------------------------
1 | using Grabacr07.KanColleWrapper;
2 | using Grabacr07.KanColleWrapper.Models.Raw;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace AMing.Logger.Modes
10 | {
11 | public class BattleEndEventArgs : EventArgs
12 | {
13 | public KanColleClient KanColleClient { get; set; }
14 | public kcsapi_battleresult BattleResult { get; set; }
15 | public bool IsFirstBattle { get; set; }
16 |
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/KcvPlugins/BattleLog/Modes/BattleResultLists.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace AMing.Logger.Modes
8 | {
9 | public class BattleResultList : ILogsList
10 | {
11 | public DateTime UpdateDate { get; set; }
12 |
13 | public SimpleAdmiral[] AdmiralList { get; set; }
14 |
15 | public BattleResult[] List { get; set; }
16 |
17 | public BattleResultList() { }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/KcvPlugins/BattleLog/Modes/CombinedBattleEndEventArgs.cs:
--------------------------------------------------------------------------------
1 | using Grabacr07.KanColleWrapper;
2 | using Grabacr07.KanColleWrapper.Models.Raw;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace AMing.Logger.Modes
10 | {
11 | public class CombinedBattleEndEventArgs : EventArgs
12 | {
13 | public KanColleClient KanColleClient { get; set; }
14 | public kcsapi_combined_battle_battleresult BattleResult { get; set; }
15 | public bool IsFirstBattle { get; set; }
16 |
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/KcvPlugins/BattleLog/Modes/ILogsList.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace AMing.Logger.Modes
8 | {
9 | public interface ILogsList
10 | {
11 | DateTime UpdateDate { get; set; }
12 |
13 | T[] List { get; set; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/KcvPlugins/BattleLog/Modes/IResult.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace AMing.Logger.Modes
8 | {
9 | public interface IResult
10 | {
11 | string Id { get; set; }
12 | DateTime CreateDate { get; set; }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/KcvPlugins/BattleLog/Modes/SimpleAdmiral.cs:
--------------------------------------------------------------------------------
1 | using Grabacr07.KanColleWrapper;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace AMing.Logger.Modes
9 | {
10 | public class SimpleAdmiral
11 | {
12 | public string Id { get; set; }
13 |
14 | public string Nickname { get; set; }
15 |
16 | public int Level { get; set; }
17 |
18 | public SimpleAdmiral() { }
19 | public SimpleAdmiral(KanColleClient kanColleClient)
20 | {
21 | this.Id = kanColleClient.Homeport.Admiral.MemberId;
22 | this.Nickname = kanColleClient.Homeport.Admiral.Nickname;
23 | this.Level = kanColleClient.Homeport.Admiral.Level;
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/KcvPlugins/BattleLog/Modes/SimpleShip.cs:
--------------------------------------------------------------------------------
1 | using Grabacr07.KanColleWrapper.Models;
2 | using Grabacr07.KanColleWrapper.Models.Raw;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace AMing.Logger.Modes
10 | {
11 | public class SimpleShip
12 | {
13 | public int Id { get; set; }
14 |
15 | public string Name { get; set; }
16 |
17 | public int Level { get; set; }
18 |
19 | public int HP_Before { get; set; }
20 | public int HP_After { get; set; }
21 | public int HP_Max { get; set; }
22 |
23 |
24 | public SimpleShip() { }
25 |
26 | public SimpleShip(kcsapi_battleresult_getship ship)
27 | {
28 | this.Id = ship.api_ship_id;
29 | this.Name = ship.api_ship_name;
30 | this.Level = 1;
31 | }
32 | public SimpleShip(Api_Get_Ship ship)
33 | {
34 | this.Id = ship.api_ship_id;
35 | this.Name = ship.api_ship_name;
36 | this.Level = 1;
37 | }
38 | public SimpleShip(Ship ship)
39 | {
40 | this.Id = ship.Id;
41 | this.Name = ship.Info.Name;
42 | this.Level = ship.Level;
43 | this.HP_Before = ship.HP.Current;
44 | this.HP_Max = ship.HP.Maximum;
45 | }
46 |
47 | ///
48 | /// 是否是战斗之后的HP
49 | ///
50 | ///
51 | ///
52 | public bool IsAfterHP(Ship ship)
53 | {
54 | return ship.Id == this.Id && this.HP_After == 0 && ship.HP.Current <= this.HP_Before;
55 | }
56 |
57 | ///
58 | /// 设置战斗之后的HP
59 | ///
60 | ///
61 | ///
62 | public bool SetAfterHP(Ship ship)
63 | {
64 | if (IsAfterHP(ship))
65 | {
66 | this.HP_After = ship.HP.Current;
67 |
68 | return true;
69 | }
70 |
71 | return false;
72 | }
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/KcvPlugins/BattleLog/Modules/InitModules.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace AMing.Logger.Modules
8 | {
9 | public class InitModules : AMing.Plugins.Core.Modules.InitModules
10 | {
11 | public override void SetModules()
12 | {
13 | base.SetModules();
14 |
15 | ModulesList.Add(Modules.LoggerModules.Current);
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/KcvPlugins/BattleLog/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过以下
6 | // 特性集控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("Logger")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Logger")]
13 | [assembly: AssemblyCopyright("Copyright © 2015")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("8dcbbe55-d909-4156-9205-42c55b293a4a")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 生成号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.*")]
36 | [assembly: AssemblyFileVersion("1.0.*")]
37 |
--------------------------------------------------------------------------------
/KcvPlugins/BattleLog/ViewModels/Item/MissionViewModel.cs:
--------------------------------------------------------------------------------
1 | using AMing.Logger.Modes;
2 | using Livet;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 | using AMing.Plugins.Core.Extensions;
9 |
10 | namespace AMing.Logger.ViewModels.Item
11 | {
12 | public class MissionViewModel : ViewModel
13 | {
14 | public int Index { get; set; }
15 | ///
16 | /// 地图名称
17 | ///
18 | public string MapName { get; set; }
19 | ///
20 | /// 结果
21 | ///
22 | public string Result { get; set; }
23 | ///
24 | /// 航行路线
25 | ///
26 | public string Route { get; set; }
27 |
28 | ///
29 | /// 捞到的舰娘
30 | ///
31 | public List GetShips { get; set; }
32 | ///
33 | /// 第一次战斗时间
34 | ///
35 | public DateTime FirstBattleDate { get; set; }
36 | ///
37 | /// 最后一次战斗时间
38 | ///
39 | public DateTime LastBattleDate { get; set; }
40 |
41 | ///
42 | /// 每个地址图的详情
43 | ///
44 | public List BattleResults { get; set; }
45 |
46 | public MissionViewModel(List list)
47 | {
48 | if(list==null ||list.Count==0)return ;
49 |
50 | this.BattleResults = list.Select(x => new BattleResultViewModel(x)).OrderBy(x => x.ResultData.CreateDate).ToList();
51 | var first = this.BattleResults.FirstOrDefault();
52 |
53 | this.FirstBattleDate = first.ResultData.CreateDate;
54 | this.LastBattleDate = this.BattleResults.LastOrDefault().ResultData.CreateDate;
55 | this.GetShips = this.BattleResults.Where(x => x.ResultData.GetShip != null).Select(x => x.ResultData.GetShip.Name).ToList();
56 |
57 | this.MapName = first.ResultData.QuestName;
58 | this.Route = this.BattleResults.Select(x => x.ResultData.DeckName).ToString();
59 | }
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/KcvPlugins/BattleLog/ViewModels/Item/SimpleShipViewModel.cs:
--------------------------------------------------------------------------------
1 | using AMing.Logger.Modes;
2 | using Livet;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace AMing.Logger.ViewModels.Item
10 | {
11 | public class SimpleShipViewModel : ViewModel
12 | {
13 | public int Id { get; set; }
14 |
15 | public string Name { get; set; }
16 |
17 | public int Level { get; set; }
18 |
19 | public int LevelUpCount { get; set; }
20 | public int HP_Before { get; set; }
21 | public int HP_After { get; set; }
22 | public int HP_Max { get; set; }
23 |
24 | public SimpleShipViewModel(SimpleShip ship, int lvup)
25 | {
26 | this.Id = ship.Id;
27 | this.Name = ship.Name;
28 | this.Level = ship.Level;
29 | this.HP_Before = ship.HP_Before;
30 | this.HP_After = ship.HP_After;
31 | this.HP_Max = ship.HP_Max;
32 | this.LevelUpCount = lvup;
33 | }
34 |
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/KcvPlugins/BattleLog/Views/BattleLogWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using Grabacr07.KanColleViewer.Views;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Windows;
6 |
7 | namespace AMing.Logger.Views
8 | {
9 | partial class BattleLogWindow
10 | {
11 | public BattleLogWindow()
12 | {
13 | this.InitializeComponent();
14 |
15 | Application.Current.MainWindow.Closed += (sender, args) => this.Close();
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/KcvPlugins/BattleLog/Views/SettingsControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace AMing.Logger.Views
17 | {
18 | ///
19 | /// SettingsControl.xaml 的交互逻辑
20 | ///
21 | public partial class SettingsControl : UserControl
22 | {
23 | public SettingsControl()
24 | {
25 | InitializeComponent();
26 | }
27 |
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/KcvPlugins/BattleLog/mome.txt:
--------------------------------------------------------------------------------
1 | 每次保存都重新读取数据写完立即保存,如果数量超过100(假定)就将数据存到下一个目录下,里面全部都是旧档以时间作为文件名,然后本地数据清空重新开始累积
--------------------------------------------------------------------------------
/KcvPlugins/BattleLog/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/KcvPlugins/DebugExtensions/Data/ResourceService.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Globalization;
4 | using System.Linq;
5 | using System.Threading.Tasks;
6 | using Livet;
7 |
8 | namespace AMing.DebugExtensions.Data
9 | {
10 | ///
11 | /// 多言語化されたリソースへのアクセスを提供します。
12 | ///
13 | public class ResourceService : NotificationObject
14 | {
15 | #region static members
16 |
17 | private static readonly ResourceService current = new ResourceService();
18 |
19 | public static ResourceService Current
20 | {
21 | get { return current; }
22 | }
23 |
24 | #endregion
25 |
26 | ///
27 | /// サポートされているカルチャの名前。
28 | ///
29 | private readonly string[] supportedCultureNames =
30 | {
31 | //"ja", // Resources.resx
32 | "en",
33 | "zh-CN"//,
34 | //"ko-KR",
35 | };
36 |
37 | private readonly TextResource _TextResource = new TextResource();
38 | private readonly IReadOnlyCollection _SupportedCultures;
39 |
40 | ///
41 | /// 多言語化されたリソースを取得します。
42 | ///
43 | public TextResource TextResource
44 | {
45 | get { return this._TextResource; }
46 | }
47 |
48 | ///
49 | /// サポートされているカルチャを取得します。
50 | ///
51 | public IReadOnlyCollection SupportedCultures
52 | {
53 | get { return this._SupportedCultures; }
54 | }
55 |
56 | private ResourceService()
57 | {
58 | this._SupportedCultures = this.supportedCultureNames
59 | .Select(x =>
60 | {
61 | try
62 | {
63 | return CultureInfo.GetCultureInfo(x);
64 | }
65 | catch (CultureNotFoundException)
66 | {
67 | return null;
68 | }
69 | })
70 | .Where(x => x != null)
71 | .ToList();
72 | }
73 |
74 | ///
75 | /// 指定されたカルチャ名を使用して、リソースのカルチャを変更します。
76 | ///
77 | /// カルチャの名前。
78 | public void ChangeCulture(string name)
79 | {
80 | TextResource.Culture = this.SupportedCultures.SingleOrDefault(x => x.Name == name);
81 |
82 | this.RaisePropertyChanged("Resources");
83 | }
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/KcvPlugins/DebugExtensions/Helper/ErrorLogHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace AMing.DebugExtensions.Helper
9 | {
10 | public class ErrorLogHelper : LogHelper
11 | {
12 |
13 | #region Current
14 |
15 | private static ErrorLogHelper _current = new ErrorLogHelper();
16 |
17 | public static ErrorLogHelper Current
18 | {
19 | get { return _current; }
20 | set { _current = value; }
21 | }
22 |
23 | #endregion
24 |
25 | protected override string GetLogDirPath()
26 | {
27 | return Path.Combine(
28 | base.logsRootDir,
29 | "Error",
30 | DateTime.Now.ToString("yyyy_MM")
31 | );
32 | }
33 |
34 | protected override string GetLogFileName()
35 | {
36 | return string.Format("logs_{0:yyyy_MM_dd}.txt", DateTime.Now);
37 | }
38 |
39 | protected override string ObjectToString(Exception ex)
40 | {
41 | StringBuilder sb = new StringBuilder();
42 | sb.AppendFormat("Time:{0:yyyy-MM-dd HH:mm:ss.fff}\nMessage:{1}\nSource:{2}\nTrace:\n{3}\n",
43 | DateTime.Now,
44 | ex.Message,
45 | ex.Source,
46 | ex.StackTrace);
47 | sb.AppendLine("---------------------------------------");
48 |
49 | return sb.ToString();
50 | }
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/KcvPlugins/DebugExtensions/Helper/LogHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace AMing.DebugExtensions.Helper
9 | {
10 | public class LogHelper
11 | {
12 | ///
13 | /// 日志根目录位置
14 | ///
15 | protected readonly string logsRootDir = Path.Combine(
16 | Environment.CurrentDirectory,
17 | "Plugins",
18 | "Logs");
19 | ///
20 | /// 获取日志保存目录
21 | ///
22 | ///
23 | protected virtual string GetLogDirPath()
24 | {
25 | throw new NotImplementedException();
26 | }
27 | ///
28 | /// 获取日志文件名
29 | ///
30 | ///
31 | protected virtual string GetLogFileName()
32 | {
33 | throw new NotImplementedException();
34 | }
35 | ///
36 | /// 将对象转换成字符串
37 | ///
38 | ///
39 | ///
40 | protected virtual string ObjectToString(T val)
41 | {
42 | throw new NotImplementedException();
43 | }
44 | ///
45 | /// 追加内容
46 | ///
47 | ///
48 | public virtual void Append(T val)
49 | {
50 | try
51 | {
52 | string logDirPath = GetLogDirPath();
53 | string logFileName = GetLogFileName();
54 | string logFileNamePath = Path.Combine(logDirPath, logFileName);
55 | if (!Directory.Exists(logDirPath))
56 | {
57 | Directory.CreateDirectory(logDirPath);
58 | }
59 | string content = ObjectToString(val);
60 | File.AppendAllText(logFileNamePath, content);
61 | }
62 | catch { }
63 | }
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/KcvPlugins/DebugExtensions/Helper/MessageLogHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace AMing.DebugExtensions.Helper
9 | {
10 | public class MessageLogHelper : LogHelper
11 | {
12 | #region Current
13 |
14 | private static MessageLogHelper _current = new MessageLogHelper();
15 |
16 | public static MessageLogHelper Current
17 | {
18 | get { return _current; }
19 | set { _current = value; }
20 | }
21 |
22 | #endregion
23 |
24 | protected override string GetLogDirPath()
25 | {
26 | return Path.Combine(
27 | base.logsRootDir,
28 | "Message",
29 | DateTime.Now.ToString("yyyy_MM_dd")
30 | );
31 | }
32 | ///
33 | /// message有时候消息量比较大,所以一个小时记录一个文件
34 | ///
35 | ///
36 | protected override string GetLogFileName()
37 | {
38 | return string.Format("msg_{0:yyyy_MM_dd_HH}.txt", DateTime.Now);
39 | }
40 |
41 | protected override string ObjectToString(string val)
42 | {
43 | StringBuilder sb = new StringBuilder();
44 | sb.AppendFormat("Time:{0:yyyy-MM-dd HH:mm:ss.fff}\nMessage:\n{1}\n",
45 | DateTime.Now,
46 | val);
47 | sb.AppendLine("---------------------------------------");
48 |
49 | return sb.ToString();
50 | }
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/KcvPlugins/DebugExtensions/Modules/InitModules.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace AMing.DebugExtensions.Modules
8 | {
9 | public class InitModules : AMing.Plugins.Core.Modules.InitModules
10 | {
11 | public override void SetModules()
12 | {
13 | base.SetModules();
14 |
15 | ModulesList.Add(Modules.LogsModules.Current);
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/KcvPlugins/DebugExtensions/Modules/LogsModules.cs:
--------------------------------------------------------------------------------
1 | using AMing.Plugins.Core.Modules;
2 | using Grabacr07.KanColleWrapper.Models;
3 | using Grabacr07.KanColleWrapper;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using AMing.Plugins.Core.Extensions;
7 | using System;
8 | using AMing.Plugins.Core.Models;
9 |
10 | namespace AMing.DebugExtensions.Modules
11 | {
12 | public class LogsModules : ModulesBase
13 | {
14 | #region Current
15 |
16 | private static LogsModules _current = new LogsModules();
17 |
18 | public static LogsModules Current
19 | {
20 | get { return _current; }
21 | set { _current = value; }
22 | }
23 |
24 | #endregion
25 |
26 | #region member
27 |
28 | public ViewModels.SettingsViewModel SettingsViewModel { get; set; }
29 |
30 | #endregion
31 |
32 | #region method
33 |
34 | #endregion
35 |
36 | public override void Initialize()
37 | {
38 | base.Initialize();
39 | InitPublicModules();
40 | }
41 |
42 | #region PublicModules
43 |
44 | private void InitPublicModules()
45 | {
46 | AMing.Plugins.Core.GenericMessager.Current.RegisterForLogs(this, obj => AppendLogs(obj)); ;
47 | AMing.Plugins.Core.GenericMessager.Current.RegisterForException(this, ex => AppendLogsForException(ex));
48 | }
49 |
50 | void AppendLogs(string val)
51 | {
52 | SettingsViewModel.LogsText = string.Format("{0}\nDateTime:{1:yyyy-MM-dd HH:mm:ss.fff}\n{2}\n",
53 | SettingsViewModel.LogsText,
54 | DateTime.Now,
55 | val);
56 | Helper.MessageLogHelper.Current.Append(val);
57 | }
58 | void AppendLogsForException(Exception ex)
59 | {
60 | Helper.ErrorLogHelper.Current.Append(ex);
61 | }
62 |
63 |
64 | #endregion
65 |
66 |
67 | public override void Dispose()
68 | {
69 | base.Dispose();
70 | }
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/KcvPlugins/DebugExtensions/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过以下
6 | // 特性集控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("DebugExtensions")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("DebugExtensions")]
13 | [assembly: AssemblyCopyright("Copyright © 2015")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("29cbb75c-312f-4fc6-8dab-cb5a09551e22")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 生成号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.2.*")]
36 | [assembly: AssemblyFileVersion("1.2.*")]
37 |
--------------------------------------------------------------------------------
/KcvPlugins/DebugExtensions/ViewModels/SettingsViewModel.cs:
--------------------------------------------------------------------------------
1 | using Livet;
2 | using Livet.Commands;
3 | using MetroRadiance;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Input;
10 |
11 | namespace AMing.DebugExtensions.ViewModels
12 | {
13 | public class SettingsViewModel : ViewModel
14 | {
15 |
16 | #region PluginInfo
17 |
18 | private string _logsText;
19 |
20 | public string LogsText
21 | {
22 | get { return _logsText; }
23 | set
24 | {
25 | if (_logsText != value)
26 | {
27 | _logsText = value;
28 | this.RaisePropertyChanged();
29 | }
30 | }
31 | }
32 |
33 | #endregion
34 |
35 |
36 | public void ClearLogs()
37 | {
38 | this.LogsText = string.Empty;
39 | }
40 |
41 |
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/KcvPlugins/DebugExtensions/Views/SettingsControl.xaml:
--------------------------------------------------------------------------------
1 |
15 |
16 |
17 |
18 |
19 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/KcvPlugins/DebugExtensions/Views/SettingsControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace AMing.DebugExtensions.Views
17 | {
18 | ///
19 | /// SettingsControl.xaml 的交互逻辑
20 | ///
21 | public partial class SettingsControl : UserControl
22 | {
23 | public SettingsControl()
24 | {
25 | InitializeComponent();
26 | }
27 |
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/KcvPlugins/DebugExtensions/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/KcvPlugins/KcvPlugins/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/KcvPlugins/KcvPlugins/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/KcvPlugins/KcvPlugins/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using Grabacr07.KanColleViewer.Composition;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Controls;
9 | using System.Windows.Data;
10 | using System.Windows.Documents;
11 | using System.Windows.Input;
12 | using System.Windows.Media;
13 | using System.Windows.Media.Imaging;
14 | using System.Windows.Navigation;
15 | using System.Windows.Shapes;
16 |
17 | namespace KcvPlugins
18 | {
19 | ///
20 | /// MainWindow.xaml 的交互逻辑
21 | ///
22 | public partial class MainWindow
23 | {
24 | public MainWindow()
25 | {
26 | InitializeComponent();
27 |
28 | this.Loaded += MainWindow_Loaded;
29 | }
30 |
31 | void MainWindow_Loaded(object sender, RoutedEventArgs e)
32 | {
33 | App.PluginList.ForEach(pugin => AddPlugin(pugin));
34 |
35 | MetroRadiance.ThemeService.Current.ChangeTheme(MetroRadiance.Theme.Light);
36 | }
37 |
38 |
39 |
40 | private void AddPlugin(IToolPlugin plugin)
41 | {
42 | var tabitem = new TabItem
43 | {
44 | Header = plugin.ToolName,
45 | Content = plugin.GetToolView()
46 | };
47 |
48 | tabControl.Items.Add(tabitem);
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/KcvPlugins/KcvPlugins/OpenToastWindow.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/KcvPlugins/KcvPlugins/OpenToastWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Media;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 | using System.Windows;
9 | using System.Windows.Controls;
10 | using System.Windows.Data;
11 | using System.Windows.Documents;
12 | using System.Windows.Input;
13 | using System.Windows.Media;
14 | using System.Windows.Media.Imaging;
15 | using System.Windows.Shapes;
16 |
17 | namespace KcvPlugins
18 | {
19 | ///
20 | /// OpenToastWindow.xaml 的交互逻辑
21 | ///
22 | public partial class OpenToastWindow : Window
23 | {
24 | public OpenToastWindow()
25 | {
26 | InitializeComponent();
27 | }
28 | private static readonly string filePathFormat = System.IO.Path.Combine(
29 | Environment.CurrentDirectory,
30 | //"Plugins",
31 | "sounds",
32 | "notify.wav");
33 |
34 |
35 | MediaPlayer MediaPlayer = new MediaPlayer();
36 | private void Button_Click(object sender, RoutedEventArgs e)
37 | {
38 | //var soundPlayer = new SoundPlayer(fs);
39 | //soundPlayer.Play();
40 | MediaPlayer.Open(new Uri(filePathFormat, UriKind.Absolute));
41 | MediaPlayer.Play();
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/KcvPlugins/KcvPlugins/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Resources;
3 | using System.Runtime.CompilerServices;
4 | using System.Runtime.InteropServices;
5 | using System.Windows;
6 |
7 | // 有关程序集的常规信息通过以下
8 | // 特性集控制。更改这些特性值可修改
9 | // 与程序集关联的信息。
10 | [assembly: AssemblyTitle("KcvPlugins")]
11 | [assembly: AssemblyDescription("")]
12 | [assembly: AssemblyConfiguration("")]
13 | [assembly: AssemblyCompany("")]
14 | [assembly: AssemblyProduct("KcvPlugins")]
15 | [assembly: AssemblyCopyright("Copyright © 2015")]
16 | [assembly: AssemblyTrademark("")]
17 | [assembly: AssemblyCulture("")]
18 |
19 | // 将 ComVisible 设置为 false 使此程序集中的类型
20 | // 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
21 | // 则将该类型上的 ComVisible 特性设置为 true。
22 | [assembly: ComVisible(false)]
23 |
24 | //若要开始生成可本地化的应用程序,请在
25 | // 中的 .csproj 文件中
26 | //设置 CultureYouAreCodingWith。 例如,如果您在源文件中
27 | //使用的是美国英语,请将 设置为 en-US。 然后取消
28 | //对以下 NeutralResourceLanguage 特性的注释。 更新
29 | //以下行中的“en-US”以匹配项目文件中的 UICulture 设置。
30 |
31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32 |
33 |
34 | [assembly: ThemeInfo(
35 | ResourceDictionaryLocation.None, //主题特定资源词典所处位置
36 | //(在页面或应用程序资源词典中
37 | // 未找到某个资源的情况下使用)
38 | ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置
39 | //(在页面、应用程序或任何主题特定资源词典中
40 | // 未找到某个资源的情况下使用)
41 | )]
42 |
43 |
44 | // 程序集的版本信息由下面四个值组成:
45 | //
46 | // 主版本
47 | // 次版本
48 | // 生成号
49 | // 修订号
50 | //
51 | // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
52 | // 方法是按如下所示使用“*”:
53 | // [assembly: AssemblyVersion("1.0.*")]
54 | [assembly: AssemblyVersion("1.0.0.0")]
55 | [assembly: AssemblyFileVersion("1.0.0.0")]
56 |
--------------------------------------------------------------------------------
/KcvPlugins/KcvPlugins/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.34014
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace KcvPlugins.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/KcvPlugins/KcvPlugins/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/KcvPlugins/KcvPlugins/ToastWindow.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/KcvPlugins/KcvPlugins/Window1.xaml.cs:
--------------------------------------------------------------------------------
1 | using Grabacr07.KanColleWrapper.Models;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Text;
5 | using System.Windows;
6 | using System.Windows.Controls;
7 | using System.Windows.Data;
8 | using System.Windows.Documents;
9 | using System.Windows.Input;
10 | using System.Windows.Media;
11 | using System.Windows.Media.Imaging;
12 | using System.Windows.Shapes;
13 |
14 | namespace KcvPlugins
15 | {
16 | ///
17 | /// Window1.xaml 的交互逻辑
18 | ///
19 | public partial class Window1 : Window
20 | {
21 | public Window1()
22 | {
23 | this.InitializeComponent();
24 |
25 | // 在此点之下插入创建对象所需的代码。
26 | AMing.SettingsExtensions.Converters.ArcLimitedValueConverter ArcLimitedValueConverter = new AMing.SettingsExtensions.Converters.ArcLimitedValueConverter();
27 | var val = ArcLimitedValueConverter.Convert(new LimitedValue(62, 120, 0), null, 87, null);
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/KcvPlugins/KcvPlugins/img/17.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AMMing/KcvPlugins/d913a95310a95c3411dd317f79fed51a4793b65d/KcvPlugins/KcvPlugins/img/17.ico
--------------------------------------------------------------------------------
/KcvPlugins/KcvPlugins/sounds/notify.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AMMing/KcvPlugins/d913a95310a95c3411dd317f79fed51a4793b65d/KcvPlugins/KcvPlugins/sounds/notify.wav
--------------------------------------------------------------------------------
/KcvPlugins/Plugins.Core/Backup/propex.snippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | propex
6 | propex
7 | 属性和支持字段的代码片段
8 | Microsoft Corporation
9 |
10 | Expansion
11 |
12 |
13 |
14 |
15 |
16 | type
17 | 属性类型
18 | int
19 |
20 |
21 | property
22 | 属性名
23 | MyProperty
24 |
25 |
26 | field
27 | 支持此属性的变量
28 | myVar
29 |
30 |
31 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/KcvPlugins/Plugins.Core/Backup/propsetting.snippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | propsetting
6 | propsetting
7 | 属性和支持字段的代码片段
8 | Microsoft Corporation
9 |
10 | Expansion
11 |
12 |
13 |
14 |
15 |
16 | type
17 | 属性类型
18 | int
19 |
20 |
21 | property
22 | 属性名
23 | MyProperty
24 |
25 |
26 | field
27 | 支持此属性的变量
28 | myVar
29 |
30 |
31 |
32 |
51 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/KcvPlugins/Plugins.Core/Collections/Generic.cs:
--------------------------------------------------------------------------------
1 | //来源:http://www.cnblogs.com/ldp615/archive/2011/08/01/distinct-entension.html
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace AMing.Plugins.Core.Collections
9 | {
10 | public class CommonEqualityComparer : IEqualityComparer
11 | {
12 | private Func keySelector;
13 | private IEqualityComparer comparer;
14 |
15 | public CommonEqualityComparer(Func keySelector, IEqualityComparer comparer)
16 | {
17 | this.keySelector = keySelector;
18 | this.comparer = comparer;
19 | }
20 |
21 | public CommonEqualityComparer(Func keySelector)
22 | : this(keySelector, EqualityComparer.Default)
23 | { }
24 |
25 | public bool Equals(T x, T y)
26 | {
27 | return comparer.Equals(keySelector(x), keySelector(y));
28 | }
29 |
30 | public int GetHashCode(T obj)
31 | {
32 | return comparer.GetHashCode(keySelector(obj));
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/KcvPlugins/Plugins.Core/Enums/MessageType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace AMing.Plugins.Core.Enums
8 | {
9 | public enum MessageType
10 | {
11 | None = 0,
12 | Logs = 1,
13 | Warning = 2,
14 | Notification = 3,
15 | Error = 4
16 | }
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/KcvPlugins/Plugins.Core/Enums/ModulesChangeEventArgsType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace AMing.Plugins.Core.Enums
8 | {
9 | public enum ModulesChangeEventArgsType
10 | {
11 | Add = 1,
12 | Remove = 2
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/KcvPlugins/Plugins.Core/Enums/ModulesType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace AMing.Plugins.Core.Enums
8 | {
9 | public enum ModulesType
10 | {
11 | Pubilc = 0,
12 | Keys = 1,
13 | NotifyIcon = 2
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/KcvPlugins/Plugins.Core/Enums/ShipStatus.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace AMing.Plugins.Core.Enums
8 | {
9 | ///
10 | /// 船体状态
11 | ///
12 | public enum ShipStatus
13 | {
14 | ///
15 | /// 正常(HP 75% 以上)
16 | ///
17 | Normal = 0,
18 | ///
19 | /// 小破(HP 75% 到 50%)
20 | ///
21 | MinorDamage = 1,
22 | ///
23 | /// 中破(HP 50% 到 25%)
24 | ///
25 | ModerateDamage = 2,
26 | ///
27 | /// 大破(HP 25% 以下)
28 | ///
29 | SevereDamage = 3
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/KcvPlugins/Plugins.Core/Extensions/ArrayEx.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace AMing.Plugins.Core.Extensions
8 | {
9 | public static class ArrayEx
10 | {
11 | public static int? Get(this int[] array, int index)
12 | {
13 | return array.Length > index ? (int?)array[index] : null;
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/KcvPlugins/Plugins.Core/Extensions/DistinctExtensions.cs:
--------------------------------------------------------------------------------
1 | //来源:http://www.cnblogs.com/ldp615/archive/2011/08/01/distinct-entension.html
2 | using AMing.Plugins.Core.Collections;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace AMing.Plugins.Core.Extensions
10 | {
11 | public static class DistinctExtensions
12 | {
13 | public static IEnumerable Distinct(this IEnumerable source, Func keySelector)
14 | {
15 | return source.Distinct(new CommonEqualityComparer(keySelector));
16 | }
17 |
18 | public static IEnumerable Distinct(this IEnumerable source, Func keySelector, IEqualityComparer comparer)
19 | {
20 | return source.Distinct(new CommonEqualityComparer(keySelector, comparer));
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/KcvPlugins/Plugins.Core/Extensions/EnumEx.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace AMing.Plugins.Core.Extensions
8 | {
9 | public static class EnumEx
10 | {
11 | public static void ForEach(Action action)
12 | {
13 | var type = typeof(T);
14 | Enum.GetNames(type).ToList().ForEach(item => action((T)Enum.Parse(type, item)));
15 | }
16 | public static void ForEach(this Enum val, Action action)
17 | {
18 | ForEach(action);
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/KcvPlugins/Plugins.Core/Extensions/IEnumerableEx.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace AMing.Plugins.Core.Extensions
8 | {
9 | public static class IEnumerableEx
10 | {
11 | public static void ForEach(this IEnumerable sequence, Action action)
12 | {
13 | foreach (var item in sequence) action(item);
14 | }
15 |
16 | public static void ForEach(this IEnumerable sequence, Action action)
17 | {
18 | int index = 0;
19 | foreach (var item in sequence)
20 | {
21 | action(item, index);
22 | index++;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/KcvPlugins/Plugins.Core/Extensions/LimitedValueEx.cs:
--------------------------------------------------------------------------------
1 | using Grabacr07.KanColleWrapper.Models;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace AMing.Plugins.Core.Extensions
9 | {
10 | public static class LimitedValueEx
11 | {
12 | public static double Percentage(this LimitedValue limitedValue)
13 | {
14 | return limitedValue.Maximum == 0 ? 0.0 : limitedValue.Current / (double)limitedValue.Maximum;
15 | }
16 |
17 | public static Enums.ShipStatus ShipStatus(this LimitedValue limitedValue)
18 | {
19 | var percentage = limitedValue.Percentage();
20 |
21 | if (percentage <= 0.25)
22 | return Enums.ShipStatus.SevereDamage;
23 | else if (percentage <= 0.5)
24 | return Enums.ShipStatus.ModerateDamage;
25 | else if (percentage <= 0.75)
26 | return Enums.ShipStatus.MinorDamage;
27 | else
28 | return Enums.ShipStatus.Normal;
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/KcvPlugins/Plugins.Core/Helper/JsonHelper.cs:
--------------------------------------------------------------------------------
1 | using Codeplex.Data;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace AMing.Plugins.Core.Helper
9 | {
10 |
11 | ///
12 | /// Json序列化/反序列化
13 | ///
14 | public class JsonHelper
15 | {
16 | ///
17 | /// 序列化Json
18 | ///
19 | /// 对象
20 | ///
21 | public static string Serialize(object obj)
22 | {
23 | try
24 | {
25 | return DynamicJson.Serialize(obj);
26 | }
27 | catch (Exception)
28 | {
29 | return null;
30 | }
31 | }
32 | ///
33 | /// 反序列化Json
34 | ///
35 | /// 数据类型
36 | /// Json数据
37 | ///
38 | public static T Deserialize(string jsonData, T defaultVal = default(T))
39 | {
40 | try
41 | {
42 | return DynamicJson.Parse(jsonData);
43 | }
44 | catch (Exception)
45 | {
46 | return defaultVal;
47 | }
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/KcvPlugins/Plugins.Core/Helper/MessageBoxDialog.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 |
8 | namespace AMing.Plugins.Core.Helper
9 | {
10 | public class MessageBoxDialog
11 | {
12 | public static void Show(string messageBoxText)
13 | {
14 | try
15 | {
16 | Views.MessageBoxDialog messageBoxDialog = new Views.MessageBoxDialog(messageBoxText);
17 | messageBoxDialog.ShowDialog();
18 | }
19 | catch (Exception)
20 | {
21 | MessageBox.Show(messageBoxText);
22 | }
23 | }
24 |
25 | public static bool Show(string messageBoxText, string caption)
26 | {
27 | try
28 | {
29 | Views.MessageBoxDialog messageBoxDialog = new Views.MessageBoxDialog(messageBoxText, caption);
30 | return messageBoxDialog.ShowDialog() ?? false;
31 | }
32 | catch (Exception)
33 | {
34 | return MessageBox.Show(messageBoxText, caption, MessageBoxButton.OKCancel) == MessageBoxResult.OK;
35 | }
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/KcvPlugins/Plugins.Core/Helper/PenetrateHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Interop;
8 |
9 | namespace AMing.Plugins.Core.Helper
10 | {
11 | public class PenetrateHelper
12 | {
13 | ///
14 | /// 设置穿透
15 | ///
16 | ///
17 | ///
18 | public static bool SetPenetrate(Window win)
19 | {
20 | var handle = new WindowInteropHelper(win).Handle;
21 | var winlong = Win32.Window.GetWindowLong(handle, Win32.Window.GWL_EXSTYLE);
22 | return SetWindowLong(handle, winlong | Win32.Window.WS_EX_TRANSPARENT | Win32.Window.WS_EX_LAYERED);
23 | }
24 |
25 | ///
26 | /// 取消穿透
27 | ///
28 | ///
29 | ///
30 | public static bool CancelPenetrate(Window win)
31 | {
32 | var handle = new WindowInteropHelper(win).Handle;
33 | return SetWindowLong(handle, 0);
34 | }
35 |
36 | private static bool SetWindowLong(IntPtr handle, int val)
37 | {
38 | var result = Win32.Window.SetWindowLong(handle, Win32.Window.GWL_EXSTYLE, val);
39 |
40 | return result == val;
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/KcvPlugins/Plugins.Core/Helper/ThreadHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 |
8 | namespace AMing.Plugins.Core.Helper
9 | {
10 | public class ThreadHelper
11 | {
12 | ///
13 | /// 延迟执行(多线程)
14 | ///
15 | /// 延迟时间
16 | /// 执行方法
17 | public void DeferredExecution(double time, Action method)
18 | {
19 | System.Threading.Thread thread = new System.Threading.Thread((obj) =>
20 | {
21 | System.Threading.Thread.Sleep(TimeSpan.FromMilliseconds(time));
22 | Application.Current.Dispatcher.BeginInvoke(new Action(() =>
23 | {
24 | method();
25 | }));
26 | });
27 | thread.IsBackground = true;
28 | thread.Name = "延迟用线程";
29 | thread.Start();
30 | }
31 |
32 | ///
33 | /// 后台处理(多线程)
34 | ///
35 | /// 执行方法
36 | public void Background(Action method)
37 | {
38 | System.Threading.Thread thread = new System.Threading.Thread((obj) =>
39 | {
40 | method();
41 | });
42 | thread.IsBackground = true;
43 | thread.Name = "后台处理用线程";
44 | thread.Start();
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/KcvPlugins/Plugins.Core/Helper/ToolWindowHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Interop;
8 |
9 | namespace AMing.Plugins.Core.Helper
10 | {
11 | public class ToolWindowHelper
12 | {
13 | public static void SetToolWindow(Window win)
14 | {
15 | WindowInteropHelper wndHelper = new WindowInteropHelper(win);
16 |
17 | int exStyle = (int)Win32.ToolWindow.GetWindowLong(wndHelper.Handle, (int)Win32.ToolWindow.GetWindowLongFields.GWL_EXSTYLE);
18 |
19 | exStyle |= (int)Win32.ToolWindow.ExtendedWindowStyles.WS_EX_TOOLWINDOW;
20 | Win32.ToolWindow.SetWindowLong(wndHelper.Handle, (int)Win32.ToolWindow.GetWindowLongFields.GWL_EXSTYLE, (IntPtr)exStyle);
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/KcvPlugins/Plugins.Core/Helper/UIHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 |
8 | namespace AMing.Plugins.Core.Helper
9 | {
10 | public class UIHelper
11 | {
12 | ///
13 | /// 判断是否是指定类型的控件,是的话调用回调函数
14 | ///
15 | /// 判断控件类型
16 | /// 控件
17 | /// 成功之后的回调
18 | public static void GetControl(object obj, Action callback)
19 | where T : UIElement
20 | {
21 | if (obj is T)
22 | {
23 | callback(obj as T);
24 | }
25 |
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/KcvPlugins/Plugins.Core/Models/MessageAction.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace AMing.Plugins.Core.Models
8 | {
9 | public class MessageAction
10 | {
11 | public object MessageObject { get; set; }
12 | public string MessageKey { get; set; }
13 | ///
14 | /// 消息被触发
15 | ///
16 | public event EventHandler MessengerTrigger;
17 |
18 | public void OnMessengerTrigger(string key, object val)
19 | {
20 | if (MessengerTrigger != null)
21 | MessengerTrigger(val, key);
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/KcvPlugins/Plugins.Core/Models/MessageItem.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace AMing.Plugins.Core.Models
8 | {
9 | public class MessageItem
10 | {
11 | public string Title { get; set; }
12 | public string Content { get; set; }
13 |
14 | public override string ToString()
15 | {
16 | return string.Format("Title:{0}\nContent:{1}\n", this.Title, this.Content);
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/KcvPlugins/Plugins.Core/Models/ModulesChangeEventArgs.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace AMing.Plugins.Core.Models
8 | {
9 | public class ModulesChangeEventArgs : EventArgs
10 | {
11 | public List ChangeList { get; set; }
12 |
13 | public Enums.ModulesChangeEventArgsType Type { get; set; }
14 |
15 | public ModulesChangeEventArgs(Models.ModulesItem modules, Enums.ModulesChangeEventArgsType type)
16 | {
17 | var list = new List();
18 | list.Add(modules);
19 | this.ChangeList = list;
20 | this.Type = type;
21 | }
22 | public ModulesChangeEventArgs(List list, Enums.ModulesChangeEventArgsType type)
23 | {
24 | this.ChangeList = list;
25 | this.Type = type;
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/KcvPlugins/Plugins.Core/Modules/InitModules.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 |
8 | namespace AMing.Plugins.Core.Modules
9 | {
10 | ///
11 | /// 初始化模块
12 | ///
13 | public class InitModules : ModulesBase
14 | {
15 | public InitModules()
16 | {
17 | SetModules();
18 | }
19 |
20 | public virtual List ModulesList { get; set; }
21 |
22 | bool isActivated = false;
23 |
24 | #region method
25 |
26 | public virtual void SetModules()
27 | {
28 | ModulesList = new List();
29 | }
30 |
31 |
32 | public override void Initialize()
33 | {
34 | base.Initialize();
35 | Application.Current.Activated += Current_Activated;
36 | Application.Current.Exit += Current_Exit;
37 | }
38 |
39 | public override void Dispose()
40 | {
41 | base.Dispose();
42 | Application.Current.Activated -= Current_Activated;
43 | Application.Current.Exit -= Current_Exit;
44 | DisposeModulesList();
45 | }
46 |
47 | void InitModulesList()
48 | {
49 | ModulesList.ForEach(modules => modules.Initialize());
50 | }
51 |
52 | void DisposeModulesList()
53 | {
54 | ModulesList.ForEach(modules => modules.Dispose());
55 | }
56 |
57 | #endregion
58 |
59 | #region event
60 |
61 | void Current_Activated(object sender, EventArgs e)
62 | {
63 | if (isActivated)
64 | {
65 | return;
66 | }
67 | isActivated = true;
68 | InitModulesList();
69 | }
70 | void Current_Exit(object sender, ExitEventArgs e)
71 | {
72 | this.Dispose();
73 | }
74 |
75 | #endregion
76 | }
77 | }
--------------------------------------------------------------------------------
/KcvPlugins/Plugins.Core/Modules/ModulesBase.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace AMing.Plugins.Core.Modules
8 | {
9 | public class ModulesBase : IDisposable
10 | {
11 | bool isinit = false;
12 | ///
13 | /// 初始化
14 | ///
15 | public virtual void Initialize()
16 | {
17 | if (isinit)
18 | {
19 | return;
20 | }
21 | isinit = true;
22 | }
23 |
24 | ///
25 | /// 释放
26 | ///
27 | public virtual void Dispose() { }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/KcvPlugins/Plugins.Core/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过以下
6 | // 特性集控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("Plugins.Core")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Plugins.Core")]
13 | [assembly: AssemblyCopyright("Copyright © 2015")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("02f75713-dca8-423f-8236-3b00ed70c97d")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 生成号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("2015.0206.*")]
36 | [assembly: AssemblyFileVersion("2015.0206.*")]
37 |
--------------------------------------------------------------------------------
/KcvPlugins/Plugins.Core/StaticData.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace AMing.Plugins.Core
8 | {
9 | public class StaticData
10 | {
11 | public const string MessagerKey = "AMing.Plugins/";
12 | public const string PublicModulesKey = "AMing.Plugins.PublicModules/";
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/KcvPlugins/Plugins.Core/Styles/Controls.xaml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/KcvPlugins/Plugins.Core/Styles/Generic.xaml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/KcvPlugins/Plugins.Core/ViewModels/ViewModelEx.cs:
--------------------------------------------------------------------------------
1 | using Livet;
2 | using Livet.Commands;
3 | using MetroRadiance;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Linq;
7 | using System.Runtime.CompilerServices;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 | using System.Windows.Input;
11 |
12 | namespace AMing.Plugins.Core.ViewModels
13 | {
14 | public class ViewModelEx : ViewModel
15 | {
16 | ///
17 | ///
18 | ///
19 | ///
20 | ///
21 | ///
22 | ///
23 | /// value is change
24 | protected virtual bool RaisePropertyChanged(ref T propValue, T newValue, [CallerMemberName]string propertyName = null)
25 | {
26 | if (object.Equals(propValue, newValue)) return false;
27 |
28 | propValue = newValue;
29 | RaisePropertyChanged(propertyName);
30 |
31 | return true;
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/KcvPlugins/Plugins.Core/Views/MessageBoxDialog.xaml:
--------------------------------------------------------------------------------
1 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
29 |
30 |
36 |
37 |
43 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/KcvPlugins/Plugins.Core/Views/MessageBoxDialog.xaml.cs:
--------------------------------------------------------------------------------
1 | using Grabacr07.KanColleViewer.Composition;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Controls;
9 | using System.Windows.Data;
10 | using System.Windows.Documents;
11 | using System.Windows.Input;
12 | using System.Windows.Media;
13 | using System.Windows.Media.Imaging;
14 | using System.Windows.Shapes;
15 |
16 | namespace AMing.Plugins.Core.Views
17 | {
18 | ///
19 | /// ContainerWindow.xaml 的交互逻辑
20 | ///
21 | public partial class MessageBoxDialog
22 | {
23 | public MessageBoxDialog()
24 | {
25 | InitializeComponent();
26 |
27 | this.btn_ok.Click += (btn_ok_sender, btn_ok_e) =>
28 | {
29 | this.DialogResult = true;
30 | this.Close();
31 | };
32 |
33 | this.btn_cancel.Click += (btn_cancel_sender, btn_cancel_e) =>
34 | {
35 | this.DialogResult = false;
36 | this.Close();
37 | };
38 |
39 | }
40 | public MessageBoxDialog(string msg)
41 | : this()
42 | {
43 | this.Title = string.Empty;
44 | this.tb_content.Text = msg;
45 | this.btn_ok.Content = TextResource.Ok;
46 | this.btn_cancel.Visibility = System.Windows.Visibility.Collapsed;
47 | this.sp_btns.HorizontalAlignment = System.Windows.HorizontalAlignment.Center;
48 | }
49 |
50 | public MessageBoxDialog(string msg, string caption)
51 | : this()
52 | {
53 | this.Title = caption;
54 | this.tb_content.Text = msg;
55 | this.btn_ok.Content = TextResource.Yes;
56 | this.btn_cancel.Content = TextResource.No;
57 | this.btn_cancel.Visibility = System.Windows.Visibility.Visible;
58 |
59 | this.btn_cancel.Focus();
60 | }
61 |
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/KcvPlugins/Plugins.Core/Win32/Window.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Runtime.InteropServices;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace AMing.Plugins.Core.Win32
9 | {
10 | public class Window
11 | {
12 | [DllImport("user32")]
13 | public static extern int GetWindowLong(IntPtr hWnd, int nIndex);
14 | [DllImport("user32")]
15 | public static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwLong);
16 |
17 | public const int GWL_EXSTYLE = -20;
18 | public const int WS_EX_TRANSPARENT = 0x20;
19 | public const int WS_EX_LAYERED = 0x80000;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/KcvPlugins/Plugins.Core/logs.txt:
--------------------------------------------------------------------------------
1 |
2 |
3 | 2015-02-04
4 |
5 |
6 | 完成大破警告,警告效果不算醒目 原本打算做的动画效果也还没做,迷你舰队可以切换样式, 透明度设置还没做 卡在设置界面的UI上了
7 |
8 |
9 |
10 |
11 |
12 |
13 | 2015-01-30
14 |
15 | 将通用模块拆分出来
16 |
17 |
18 | 插件实现部分调用Modules需要创建一个继承InitModules的类然后重写SetModules用于初始化模块然后插件那边调用这个初始化的类的Initialize方法。
19 |
20 | MessagerModules模块的使用直接调用Current静态实例即可
21 | PublicModules模块的使用跟MessagerModules一样
22 |
23 |
24 |
25 | Ver 1.10 — 2015.01.19
26 |
27 | _ (:3」∠)_ 将kcv本体上面的四个按钮功能加到热键和托盘菜单模块,分别是 截图、开关声音、打开舰娘一览窗口、打开装备一览窗口
28 |
29 | PS:_ (:3」∠)_用的提督一多各种环境下各种bug都来了,最近老板又丢了一堆项目过来一直催着赶,好想摸鱼修复bug啊_ (:3」∠)_
30 |
31 | Ver 1.9 — 2015.01.18
32 |
33 | 由于迷你窗口的舰队信息太过拥挤导致有些字体过小看不清,于是重新设计了样式做成了环形样式(虽然还是蛮拥挤的,但是好看多了不是么_ (:3」∠)_ ),新样式需要各位提督用一段才能适应,这边感谢 @Chaos 吵死老板 在样式设计上给出的建议和idea
34 |
35 | _ (:3」∠)_ 有提督的系统是win7,kcv自带的通知插件在win7会加入一个没效果的托盘用来来弹出气泡通知消息,加上本插件就会有两个托盘,于是写了个在win7下模仿win8通知效果的插件,需要的提督可以自行安装同时记得将kcv的通知插件“WindowsNotifier.dll”去掉,否则就重复了。
36 |
37 | PS:本来周末这两天打算把大破提醒或者迷你窗口添加更多信息的,结果这两天冷得要死(๑•́ ₃ •̀๑) 我一个人躲在小黑屋里面敲代码手冻得老是敲错字,结果啥都没写好_ (:3」∠)_
38 |
39 | Ver 1.8 —2015.01.14
40 |
41 | 将热键弄成一个大模块,可以设置多个热键(功能之后会慢慢加上),迷你状态窗口添加"幽灵模式"(๑•́ ₃ •̀๑) 其实就是相当于挂在那边但是鼠标能够穿透过去点击后面的东西
42 |
43 | PS:舰娘贴吧被卖了,看来得把自己那几个荒废好久的网站弄个页面来更新发布了(๑•́ ₃ •̀๑)
44 |
45 | Ver 1.7 — 2015.01.12
46 |
47 | 在MainWindow下的快捷键Ctrl+Tab 切换Tab模式的game和tool面板,Ctrl+M显示隐藏迷你舰队信息
48 |
49 | 加大了迷你舰队信息的内容大小
50 |
51 | 在托盘添加了显示迷你舰队信息的菜单
52 |
53 | Ver 1.6 —— Ver 1.0
54 | 忘记记录了_ (:3」∠)_
--------------------------------------------------------------------------------
/KcvPlugins/Plugins.Core/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/KcvPlugins/QuestsExtensions/Converters/QuestConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Globalization;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows.Data;
8 | using System.Windows.Media;
9 | using AMing.QuestsExtensions.ViewModels;
10 |
11 | namespace AMing.QuestsExtensions.Converters
12 | {
13 | public class QuestConverter : IValueConverter
14 | {
15 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
16 | {
17 | if (value is QuestViewModelEx)
18 | {
19 | return Modules.QuestsModules.Current.Replace(value as QuestViewModelEx);
20 | }
21 |
22 | return value;
23 | }
24 |
25 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
26 | {
27 | throw new NotImplementedException();
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/KcvPlugins/QuestsExtensions/Data/LocalQuestsSettings.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Threading.Tasks;
6 | using System.Xml.Serialization;
7 | using Grabacr07.KanColleViewer.Models.Data.Xml;
8 | using Grabacr07.KanColleWrapper;
9 | using Livet;
10 | using Grabacr07.KanColleViewer.Models;
11 | using System.Windows.Input;
12 |
13 | namespace AMing.QuestsExtensions.Data
14 | {
15 | [Serializable]
16 | public class LocalQuestsSettings
17 | {
18 | #region static members
19 |
20 | private static readonly string filePath = Path.Combine(
21 | Environment.CurrentDirectory,
22 | "Plugins",
23 | "LocalQuests",
24 | "Settings.xml");
25 |
26 | public static LocalQuestsSettings Current { get; set; }
27 |
28 | public static void Load()
29 | {
30 | try
31 | {
32 | Current = filePath.ReadXml();
33 | Current.IsLoad = true;
34 | }
35 | catch (Exception ex)
36 | {
37 | #if DEBUG
38 | Current = GetInitialSettings();
39 | Current.IsLoad = false;
40 | System.Diagnostics.Debug.WriteLine(ex);
41 |
42 | #endif
43 | }
44 | }
45 |
46 | #if DEBUG
47 | public static LocalQuestsSettings GetInitialSettings()
48 | {
49 | var list = new List();
50 | list.Add("zh-cn");
51 | var defaultkey = list.First();
52 |
53 | return new LocalQuestsSettings
54 | {
55 | QuestsResourceList = list,
56 | Default = defaultkey
57 | };
58 | }
59 | public void Save()
60 | {
61 | try
62 | {
63 | this.WriteXml(filePath);
64 | }
65 | catch (Exception ex)
66 | {
67 | System.Diagnostics.Debug.WriteLine(ex);
68 | }
69 | }
70 | #endif
71 |
72 | #endregion
73 |
74 | #region member
75 |
76 |
77 | public string Default { get; set; }
78 |
79 | public List QuestsResourceList { get; set; }
80 |
81 | [XmlIgnore]
82 | public bool IsLoad { get; set; }
83 |
84 | #endregion
85 |
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/KcvPlugins/QuestsExtensions/Data/ResourceService.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Globalization;
4 | using System.Linq;
5 | using System.Threading.Tasks;
6 | using Livet;
7 |
8 | namespace AMing.QuestsExtensions.Data
9 | {
10 | ///
11 | /// 多言語化されたリソースへのアクセスを提供します。
12 | ///
13 | public class ResourceService : NotificationObject
14 | {
15 | #region static members
16 |
17 | private static readonly ResourceService current = new ResourceService();
18 |
19 | public static ResourceService Current
20 | {
21 | get { return current; }
22 | }
23 |
24 | #endregion
25 |
26 | ///
27 | /// サポートされているカルチャの名前。
28 | ///
29 | private readonly string[] supportedCultureNames =
30 | {
31 | //"ja", // Resources.resx
32 | "en",
33 | "zh-CN"//,
34 | //"ko-KR",
35 | };
36 |
37 | private readonly TextResource _TextResource = new TextResource();
38 | private readonly IReadOnlyCollection _SupportedCultures;
39 |
40 | ///
41 | /// 多言語化されたリソースを取得します。
42 | ///
43 | public TextResource TextResource
44 | {
45 | get { return this._TextResource; }
46 | }
47 |
48 | ///
49 | /// サポートされているカルチャを取得します。
50 | ///
51 | public IReadOnlyCollection SupportedCultures
52 | {
53 | get { return this._SupportedCultures; }
54 | }
55 |
56 | private ResourceService()
57 | {
58 | this._SupportedCultures = this.supportedCultureNames
59 | .Select(x =>
60 | {
61 | try
62 | {
63 | return CultureInfo.GetCultureInfo(x);
64 | }
65 | catch (CultureNotFoundException)
66 | {
67 | return null;
68 | }
69 | })
70 | .Where(x => x != null)
71 | .ToList();
72 | }
73 |
74 | ///
75 | /// 指定されたカルチャ名を使用して、リソースのカルチャを変更します。
76 | ///
77 | /// カルチャの名前。
78 | public void ChangeCulture(string name)
79 | {
80 | TextResource.Culture = this.SupportedCultures.SingleOrDefault(x => x.Name == name);
81 |
82 | this.RaisePropertyChanged("Resources");
83 | }
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/KcvPlugins/QuestsExtensions/Entrance.cs:
--------------------------------------------------------------------------------
1 | using Grabacr07.KanColleViewer.Composition;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.ComponentModel.Composition;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 | using System.Windows.Controls;
9 | using kcv = Grabacr07.KanColleViewer;
10 | using AMing.QuestsExtensions.Extensions;
11 |
12 | namespace AMing.QuestsExtensions
13 | {
14 | [Export(typeof(IToolPlugin))]
15 | [ExportMetadata("Title", "QuestsExtensions")]
16 | [ExportMetadata("Description", "KCV Quests Extensions")]
17 | [ExportMetadata("Version", "1.0")]
18 | [ExportMetadata("Author", "@AMing")]
19 | public class Entrance : IToolPlugin
20 | {
21 | private readonly ViewModels.QuestsViewModelEx questsViewModelEx = new ViewModels.QuestsViewModelEx();
22 | public string ToolName
23 | {
24 | get { return TextResource.Plugin_ToolName; }
25 | }
26 |
27 | public object GetToolView()
28 | {
29 | questsViewModelEx.Initialize();
30 | var list = new List();
31 | list.Add(new Models.Quest
32 | {
33 | Id = 1,
34 | Title = "ttt",
35 | Detail = "ddd"
36 | }.ToViewModels());
37 | questsViewModelEx.Quests = list.ToArray();
38 | return new Views.QuestControl { DataContext = this.questsViewModelEx };
39 | }
40 |
41 | public object GetSettingsView()
42 | {
43 | return null;
44 | }
45 |
46 | public Entrance()
47 | {
48 | Init();
49 | }
50 |
51 | ~Entrance()
52 | {
53 | Exit();
54 | }
55 | private void Init()
56 | {
57 | Modules.InitModules.Current.Initialize();
58 | Data.Settings.FirstLoad();
59 | Data.LocalQuestsSettings.Load();
60 | #if DEBUG
61 | //Data.LocalQuests LocalQuests = new Data.LocalQuests("zh-cn");
62 | //LocalQuests.Load();
63 | //LocalQuests.Save();
64 | #endif
65 | }
66 |
67 | private void Exit()
68 | {
69 | //Data.Settings.Current.Save();
70 | #if DEBUG
71 | //Data.LocalQuestsSettings.Current.Save();
72 | #endif
73 | }
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/KcvPlugins/QuestsExtensions/EntranceSettings.cs:
--------------------------------------------------------------------------------
1 | using Grabacr07.KanColleViewer.Composition;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.ComponentModel.Composition;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 | using System.Windows.Controls;
9 | using kcv = Grabacr07.KanColleViewer;
10 |
11 | namespace AMing.QuestsExtensions
12 | {
13 | [Export(typeof(IToolPlugin))]
14 | [ExportMetadata("Title", "QuestsExtensions")]
15 | [ExportMetadata("Description", "KCV Quests Extensions")]
16 | [ExportMetadata("Version", "1.0")]
17 | [ExportMetadata("Author", "@AMing")]
18 | public class EntranceSettings : IToolPlugin
19 | {
20 | private readonly ViewModels.SettingsViewModel settingsViewModel = new ViewModels.SettingsViewModel();
21 | public string ToolName
22 | {
23 | get { return TextResource.Plugin_ToolName; }
24 | }
25 |
26 | public object GetToolView()
27 | {
28 | return new Views.SettingsControl { DataContext = this.settingsViewModel };
29 | }
30 |
31 | public object GetSettingsView()
32 | {
33 | return null;
34 | }
35 |
36 | public EntranceSettings()
37 | {
38 | Init();
39 | }
40 |
41 | ~EntranceSettings()
42 | {
43 | Exit();
44 | }
45 |
46 | private void Init()
47 | {
48 | Data.Settings.FirstLoad();
49 | }
50 |
51 | private void Exit()
52 | {
53 | Data.Settings.Current.Save();
54 | }
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/KcvPlugins/QuestsExtensions/Extensions/QuestEx.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using kcvModels = Grabacr07.KanColleWrapper.Models;
7 |
8 | namespace AMing.QuestsExtensions.Extensions
9 | {
10 | public static class QuestEx
11 | {
12 | public static kcvModels.Raw.kcsapi_quest ToKcvApi(this Models.Quest quest)
13 | {
14 | return new kcvModels.Raw.kcsapi_quest
15 | {
16 | api_no = quest.Id,
17 | api_category = quest.Category,
18 | api_type = quest.Type,
19 | api_title = quest.Title,
20 | api_detail = quest.Detail
21 | };
22 | }
23 | public static kcvModels.Quest ToKcvModels(this Models.Quest quest)
24 | {
25 | return new kcvModels.Quest(quest.ToKcvApi());
26 | }
27 | public static ViewModels.QuestViewModelEx ToViewModels(this Models.Quest quest)
28 | {
29 | return new ViewModels.QuestViewModelEx(quest.ToKcvModels());
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/KcvPlugins/QuestsExtensions/Models/Quest.cs:
--------------------------------------------------------------------------------
1 | using Grabacr07.KanColleWrapper.Models;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace AMing.QuestsExtensions.Models
9 | {
10 | [Serializable]
11 | public class Quest
12 | {
13 | public int Id { get; set; }
14 | public int Type { get; set; }
15 |
16 | public int Category { get; set; }
17 |
18 | public string Title { get; set; }
19 |
20 | public string Detail { get; set; }
21 |
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/KcvPlugins/QuestsExtensions/Models/QuestsResource.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace AMing.QuestsExtensions.Models
8 | {
9 | [Serializable]
10 | public class QuestsResource
11 | {
12 | public string Key { get; set; }
13 |
14 | public string Name { get; set; }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/KcvPlugins/QuestsExtensions/Modules/InitModules.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 |
8 | namespace AMing.QuestsExtensions.Modules
9 | {
10 | public class InitModules : ModulesBase
11 | {
12 | #region Current
13 |
14 | private static InitModules _current = new InitModules();
15 |
16 | public static InitModules Current
17 | {
18 | get { return _current; }
19 | set { _current = value; }
20 | }
21 |
22 | #endregion
23 |
24 | public InitModules()
25 | {
26 | ModulesList = new List();
27 |
28 | ModulesList.Add(Modules.QuestsModules.Current);
29 | }
30 |
31 | public List ModulesList { get; set; }
32 | bool isActivated = false;
33 |
34 | #region method
35 |
36 | public override void Initialize()
37 | {
38 | base.Initialize();
39 | Application.Current.Activated += Current_Activated;
40 | Application.Current.Exit += Current_Exit;
41 | }
42 |
43 | public override void Dispose()
44 | {
45 | base.Dispose();
46 | Application.Current.Activated -= Current_Activated;
47 | Application.Current.Exit -= Current_Exit;
48 | DisposeModulesList();
49 | }
50 |
51 | void InitModulesList()
52 | {
53 | ModulesList.ForEach(modules => modules.Initialize());
54 | }
55 |
56 | void DisposeModulesList()
57 | {
58 | ModulesList.ForEach(modules => modules.Dispose());
59 | }
60 |
61 | #endregion
62 |
63 | #region event
64 |
65 | void Current_Activated(object sender, EventArgs e)
66 | {
67 | if (isActivated)
68 | {
69 | return;
70 | }
71 | isActivated = true;
72 | InitModulesList();
73 | }
74 | void Current_Exit(object sender, ExitEventArgs e)
75 | {
76 | this.Dispose();
77 | }
78 |
79 | #endregion
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/KcvPlugins/QuestsExtensions/Modules/ModulesBase.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace AMing.QuestsExtensions.Modules
8 | {
9 | public class ModulesBase : IDisposable
10 | {
11 | bool isinit = false;
12 | ///
13 | /// 初始化
14 | ///
15 | public virtual void Initialize()
16 | {
17 | if (isinit)
18 | {
19 | return;
20 | }
21 | isinit = true;
22 | }
23 |
24 | ///
25 | /// 释放
26 | ///
27 | public virtual void Dispose() { }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/KcvPlugins/QuestsExtensions/Modules/QuestsModules.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Controls;
9 | using System.Windows.Input;
10 | using kcv = Grabacr07.KanColleViewer;
11 |
12 | namespace AMing.QuestsExtensions.Modules
13 | {
14 | public class QuestsModules : ModulesBase
15 | {
16 | #region Current
17 |
18 | private static QuestsModules _current = new QuestsModules();
19 |
20 | public static QuestsModules Current
21 | {
22 | get { return _current; }
23 | set { _current = value; }
24 | }
25 |
26 | #endregion
27 |
28 | Helper.QuestHelper QuestHelper = new Helper.QuestHelper();
29 |
30 |
31 | #region method
32 |
33 |
34 | public ViewModels.QuestViewModelEx Replace(ViewModels.QuestViewModelEx quest_vm)
35 | {
36 | return QuestHelper.Replace(quest_vm);
37 | }
38 |
39 | #endregion
40 |
41 | public override void Initialize()
42 | {
43 | base.Initialize();
44 |
45 | QuestHelper.Init();
46 | }
47 |
48 |
49 | public override void Dispose()
50 | {
51 | base.Dispose();
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/KcvPlugins/QuestsExtensions/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过以下
6 | // 特性集控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("QuestsExtensions")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("QuestsExtensions")]
13 | [assembly: AssemblyCopyright("Copyright © 2015")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("186dbf48-9fb8-426a-9ece-45b95b6cbdcc")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 生成号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.*")]
36 | [assembly: AssemblyFileVersion("1.0.*")]
37 |
--------------------------------------------------------------------------------
/KcvPlugins/QuestsExtensions/ViewModels/QuestViewModelEx.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using Livet;
6 | using Grabacr07.KanColleViewer.ViewModels.Contents;
7 | using kcvModels = Grabacr07.KanColleWrapper.Models;
8 |
9 | namespace AMing.QuestsExtensions.ViewModels
10 | {
11 | public class QuestViewModelEx : QuestViewModel
12 | {
13 | #region Id 変更通知プロパティ
14 |
15 | private int _Id;
16 |
17 | public int Id
18 | {
19 | get { return this._Id; }
20 | set
21 | {
22 | if (this._Id != value)
23 | {
24 | this._Id = value;
25 | this.RaisePropertyChanged();
26 | }
27 | }
28 | }
29 |
30 | #endregion
31 |
32 |
33 | public QuestViewModelEx(kcvModels.Quest quest)
34 | : base(quest)
35 | {
36 | if (quest == null)
37 | {
38 | this.IsUntaken = true;
39 | }
40 | else
41 | {
42 | this.Id = quest.Id;
43 | }
44 |
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/KcvPlugins/QuestsExtensions/ViewModels/SettingsViewModel.cs:
--------------------------------------------------------------------------------
1 | using AMing.QuestsExtensions.Data;
2 | using Livet;
3 | using Livet.Commands;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Input;
10 |
11 | namespace AMing.QuestsExtensions.ViewModels
12 | {
13 | public class SettingsViewModel : ViewModel
14 | {
15 | public SettingsViewModel()
16 | {
17 | var assembly = System.Reflection.Assembly.GetExecutingAssembly().GetName();
18 | PluginInfo = string.Format("{0} Version {1}",
19 | assembly.Name,
20 | assembly.Version.ToString());
21 | }
22 |
23 |
24 | #region PluginInfo
25 |
26 | private string _pluginInfo;
27 |
28 | public string PluginInfo
29 | {
30 | get { return _pluginInfo; }
31 | set
32 | {
33 | if (_pluginInfo != value)
34 | {
35 | _pluginInfo = value;
36 | this.RaisePropertyChanged();
37 | }
38 | }
39 | }
40 |
41 | #endregion
42 |
43 |
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/KcvPlugins/QuestsExtensions/Views/QuestControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace AMing.QuestsExtensions.Views
17 | {
18 | ///
19 | /// QuestControl.xaml 的交互逻辑
20 | ///
21 | public partial class QuestControl : UserControl
22 | {
23 | public QuestControl()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/KcvPlugins/QuestsExtensions/Views/SettingsControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace AMing.QuestsExtensions.Views
17 | {
18 | ///
19 | /// SettingsControl.xaml 的交互逻辑
20 | ///
21 | public partial class SettingsControl : UserControl
22 | {
23 | public SettingsControl()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/KcvPlugins/QuestsExtensions/XmlFile/QuestsResource.zh-cn.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 简体中文
4 | zh-cn
5 | 1.0
6 |
7 |
8 | 1
9 | 0
10 | 0
11 | title
12 | detail
13 |
14 |
15 |
--------------------------------------------------------------------------------
/KcvPlugins/QuestsExtensions/XmlFile/Settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | zh-cn
5 |
6 |
7 |
12 | zh-cn
13 |
14 |
--------------------------------------------------------------------------------
/KcvPlugins/QuestsExtensions/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/Controls/AppendProperty.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 |
8 | namespace AMing.SettingsExtensions.Controls
9 | {
10 | public class AppendProperty
11 | {
12 | public static bool? GetShowInTaskbar(DependencyObject obj)
13 | {
14 | return (bool?)obj.GetValue(ShowInTaskbarProperty);
15 | }
16 |
17 | public static void SetShowInTaskbar(DependencyObject obj, bool? value)
18 | {
19 | obj.SetValue(ShowInTaskbarProperty, value);
20 | }
21 |
22 | // Using a DependencyProperty as the backing store for ShowInTaskbar. This enables animation, styling, binding, etc...
23 | public static readonly DependencyProperty ShowInTaskbarProperty =
24 | DependencyProperty.RegisterAttached("ShowInTaskbar", typeof(bool?), typeof(AppendProperty), new PropertyMetadata(null));
25 |
26 |
27 |
28 |
29 | public static string GetType(DependencyObject obj)
30 | {
31 | return (string )obj.GetValue(TypeProperty);
32 | }
33 |
34 | public static void SetType(DependencyObject obj, string value)
35 | {
36 | obj.SetValue(TypeProperty, value);
37 | }
38 |
39 | // Using a DependencyProperty as the backing store for Type. This enables animation, styling, binding, etc...
40 | public static readonly DependencyProperty TypeProperty =
41 | DependencyProperty.RegisterAttached("Type", typeof(string ), typeof(AppendProperty), new PropertyMetadata(null));
42 |
43 |
44 |
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/Controls/ConditionDataTemplateSelector.cs:
--------------------------------------------------------------------------------
1 | using Grabacr07.KanColleWrapper.Models;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Controls;
9 |
10 | namespace AMing.SettingsExtensions.Controls
11 | {
12 | public class ConditionDataTemplateSelector : DataTemplateSelector
13 | {
14 | public DataTemplate Brilliant { get; set; }
15 | public DataTemplate Normal { get; set; }
16 | public DataTemplate Tired { get; set; }
17 | public DataTemplate OrangeTired { get; set; }
18 | public DataTemplate RedTired { get; set; }
19 |
20 | public override DataTemplate SelectTemplate(object item, System.Windows.DependencyObject container)
21 | {
22 | var type = (ConditionType)item;
23 | switch (type)
24 | {
25 | case ConditionType.Brilliant:
26 | return this.Brilliant;
27 | case ConditionType.Normal:
28 | return this.Normal;
29 | case ConditionType.Tired:
30 | return this.Tired;
31 | case ConditionType.OrangeTired:
32 | return this.OrangeTired;
33 | case ConditionType.RedTired:
34 | return this.RedTired;
35 | }
36 | return base.SelectTemplate(item, container);
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/Controls/FeetStyleTypeDataTemplateSelector.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 |
9 | namespace AMing.SettingsExtensions.Controls
10 | {
11 | public class FeetStyleTypeDataTemplateSelector : DataTemplateSelector
12 | {
13 | public DataTemplate Arc_1 { get; set; }
14 | public DataTemplate Arc_2 { get; set; }
15 | public DataTemplate Rectangle { get; set; }
16 |
17 | public override DataTemplate SelectTemplate(object item, System.Windows.DependencyObject container)
18 | {
19 | var type = (Enums.FeetStyleType)item;
20 | switch (type)
21 | {
22 | case AMing.SettingsExtensions.Enums.FeetStyleType.Arc_1:
23 | return Arc_1;
24 | case AMing.SettingsExtensions.Enums.FeetStyleType.Arc_2:
25 | return Arc_2;
26 | case AMing.SettingsExtensions.Enums.FeetStyleType.Rectangle:
27 | return Rectangle;
28 | }
29 | return base.SelectTemplate(item, container);
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/Controls/WindowViewTypeDataTemplateSelector.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 |
9 | namespace AMing.SettingsExtensions.Controls
10 | {
11 | public class WindowViewTypeDataTemplateSelector : DataTemplateSelector
12 | {
13 | public DataTemplate Bottom { get; set; }
14 | public DataTemplate Top { get; set; }
15 | public DataTemplate Left { get; set; }
16 | public DataTemplate Right { get; set; }
17 | public DataTemplate Split { get; set; }
18 | public DataTemplate Tabs { get; set; }
19 |
20 | public override DataTemplate SelectTemplate(object item, System.Windows.DependencyObject container)
21 | {
22 | var type = (Enums.WindowViewType)item;
23 | switch (type)
24 | {
25 | case AMing.SettingsExtensions.Enums.WindowViewType.Bottom:
26 | return this.Bottom;
27 | case AMing.SettingsExtensions.Enums.WindowViewType.Top:
28 | return this.Top;
29 | case AMing.SettingsExtensions.Enums.WindowViewType.Left:
30 | return this.Left;
31 | case AMing.SettingsExtensions.Enums.WindowViewType.Right:
32 | return this.Right;
33 | case AMing.SettingsExtensions.Enums.WindowViewType.Split:
34 | return this.Split;
35 | case AMing.SettingsExtensions.Enums.WindowViewType.Tabs:
36 | return this.Tabs;
37 | default:
38 | break;
39 | }
40 | return base.SelectTemplate(item, container);
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/Converters/ArcLimitedValueConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Globalization;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows.Data;
8 | using System.Windows.Media;
9 | using Grabacr07.KanColleViewer.ViewModels.Contents.Fleets;
10 | using Grabacr07.KanColleWrapper.Models;
11 | using AMing.Plugins.Core.Extensions;
12 |
13 | namespace AMing.SettingsExtensions.Converters
14 | {
15 | public class ArcLimitedValueConverter : IValueConverter
16 | {
17 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
18 | {
19 | int arc_max = 0;
20 | int.TryParse(parameter.ToString(), out arc_max);
21 | if (value is LimitedValue)
22 | {
23 | var limitedValue = (LimitedValue)value;
24 | var percentage = limitedValue.Percentage();
25 | var result = percentage * Math.Abs(arc_max);
26 | if (arc_max < 0)
27 | {
28 | result = Math.Abs(arc_max) - result;
29 | }
30 | return result;
31 | }
32 |
33 | return value;
34 | }
35 |
36 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
37 | {
38 | throw new NotImplementedException();
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/Converters/FleetsColorConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Globalization;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows.Data;
8 | using System.Windows.Media;
9 | using Grabacr07.KanColleViewer.ViewModels.Contents.Fleets;
10 | using Grabacr07.KanColleWrapper.Models;
11 | using AMing.Plugins.Core.Extensions;
12 | using AMing.Plugins.Core.Enums;
13 |
14 | namespace AMing.SettingsExtensions.Converters
15 | {
16 | public class FleetsColorConverter : IValueConverter
17 | {
18 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
19 | {
20 | if (value is LimitedValue)
21 | {
22 | var limitedValue = (LimitedValue)value;
23 |
24 | Color color;
25 | switch (limitedValue.ShipStatus())
26 | {
27 | case ShipStatus.Normal:
28 | color = Color.FromRgb(64, 200, 32);
29 | break;
30 | case ShipStatus.MinorDamage:
31 | color = Color.FromRgb(240, 240, 0);
32 | break;
33 | case ShipStatus.ModerateDamage:
34 | color = Color.FromRgb(240, 128, 32);
35 | break;
36 | default:
37 | color = Color.FromRgb(255, 32, 32);
38 | break;
39 | }
40 |
41 | return new SolidColorBrush(color);
42 | }
43 |
44 | return value;
45 | }
46 |
47 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
48 | {
49 | throw new NotImplementedException();
50 | }
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/Converters/FleetsConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Globalization;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows.Data;
8 | using System.Windows.Media;
9 | using Grabacr07.KanColleViewer.ViewModels.Contents.Fleets;
10 |
11 | namespace AMing.SettingsExtensions.Converters
12 | {
13 | public class FleetsConverter : IValueConverter
14 | {
15 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
16 | {
17 | if (value is FleetViewModel[])
18 | {
19 | var feets = value as FleetViewModel[];
20 | if (feets != null && feets.Count() > 0)
21 | {
22 | return feets.FirstOrDefault();
23 | }
24 | }
25 |
26 | return value;
27 | }
28 |
29 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
30 | {
31 | throw new NotImplementedException();
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/Converters/FuelColorConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Globalization;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows.Data;
8 | using System.Windows.Media;
9 | using Grabacr07.KanColleViewer.ViewModels.Contents.Fleets;
10 | using Grabacr07.KanColleWrapper.Models;
11 | using AMing.Plugins.Core.Extensions;
12 | using AMing.Plugins.Core.Enums;
13 |
14 | namespace AMing.SettingsExtensions.Converters
15 | {
16 | public class FuelColorConverter : IValueConverter
17 | {
18 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
19 | {
20 | if (value is LimitedValue)
21 | {
22 | var limitedValue = (LimitedValue)value;
23 |
24 | Color color;
25 |
26 | switch (limitedValue.ShipStatus())
27 | {
28 | case ShipStatus.Normal:
29 | color = Color.FromRgb(135, 98, 201);
30 | break;
31 | case ShipStatus.MinorDamage:
32 | color = Color.FromRgb(190, 160, 243);
33 | break;
34 | case ShipStatus.ModerateDamage:
35 | color = Color.FromRgb(252, 127, 213);
36 | break;
37 | default:
38 | color = Color.FromRgb(255, 88, 88);
39 | break;
40 | }
41 |
42 | return new SolidColorBrush(color);
43 | }
44 |
45 | return value;
46 | }
47 |
48 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
49 | {
50 | throw new NotImplementedException();
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/Converters/KeySettingNameConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Globalization;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows.Data;
8 | using System.Windows.Media;
9 | using Grabacr07.KanColleViewer.ViewModels.Contents.Fleets;
10 | using System.Windows.Input;
11 |
12 | namespace AMing.SettingsExtensions.Converters
13 | {
14 | public class KeySettingNameConverter : IValueConverter
15 | {
16 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
17 | {
18 | if (value is Models.KeySetting)
19 | {
20 | var keySetting = value as Models.KeySetting;
21 | if (keySetting != null)
22 | {
23 | if (keySetting.IsNotSetKey)
24 | {
25 | return TextResource.KeySetting_IsNotSetKey;
26 | }
27 |
28 | return Helper.KeysHelper.ToName(keySetting.ModifierKeys, keySetting.Key);
29 | }
30 | }
31 |
32 | return value;
33 | }
34 |
35 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
36 | {
37 | throw new NotImplementedException();
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/Converters/KeySettingTypeConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Globalization;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows.Data;
8 | using System.Windows.Media;
9 | using Grabacr07.KanColleViewer.ViewModels.Contents.Fleets;
10 | using System.Windows.Input;
11 |
12 | namespace AMing.SettingsExtensions.Converters
13 | {
14 | public class KeySettingTypeConverter : IValueConverter
15 | {
16 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
17 | {
18 | if (value is Enums.KeyType)
19 | {
20 | var keySetting = (Enums.KeyType)value;
21 | var typename = string.Empty;
22 | switch (keySetting)
23 | {
24 | case AMing.SettingsExtensions.Enums.KeyType.Normal:
25 | typename = TextResource.KeyType_Normal;
26 | break;
27 | case AMing.SettingsExtensions.Enums.KeyType.HotKey:
28 | typename = TextResource.KeyType_HotKey;
29 | break;
30 | default:
31 | break;
32 | }
33 |
34 | return typename;
35 | }
36 |
37 | return value;
38 | }
39 |
40 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
41 | {
42 | throw new NotImplementedException();
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/Converters/WarningColorConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Globalization;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows.Data;
8 | using System.Windows.Media;
9 | using Grabacr07.KanColleViewer.ViewModels.Contents.Fleets;
10 | using Grabacr07.KanColleWrapper.Models;
11 | using AMing.Plugins.Core.Extensions;
12 |
13 | namespace AMing.SettingsExtensions.Converters
14 | {
15 | public class WarningColorConverter : IValueConverter
16 | {
17 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
18 | {
19 | if (value is LimitedValue)
20 | {
21 | var limitedValue = (LimitedValue)value;
22 |
23 | Color color;
24 |
25 | switch (limitedValue.ShipStatus())
26 | {
27 | case AMing.Plugins.Core.Enums.ShipStatus.SevereDamage:
28 | color = Colors.Red;
29 | break;
30 | default:
31 | color = Colors.White;
32 | break;
33 | }
34 |
35 | return new SolidColorBrush(color);
36 | }
37 |
38 | return value;
39 | }
40 |
41 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
42 | {
43 | throw new NotImplementedException();
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/Data/ResourceService.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Globalization;
4 | using System.Linq;
5 | using System.Threading.Tasks;
6 | using Livet;
7 |
8 | namespace AMing.SettingsExtensions.Data
9 | {
10 | ///
11 | /// 多言語化されたリソースへのアクセスを提供します。
12 | ///
13 | public class ResourceService : NotificationObject
14 | {
15 | #region static members
16 |
17 | private static readonly ResourceService current = new ResourceService();
18 |
19 | public static ResourceService Current
20 | {
21 | get { return current; }
22 | }
23 |
24 | #endregion
25 |
26 | ///
27 | /// サポートされているカルチャの名前。
28 | ///
29 | private readonly string[] supportedCultureNames =
30 | {
31 | //"ja", // Resources.resx
32 | "en",
33 | "zh-CN"//,
34 | //"ko-KR",
35 | };
36 |
37 | private readonly TextResource _TextResource = new TextResource();
38 | private readonly IReadOnlyCollection _SupportedCultures;
39 |
40 | ///
41 | /// 多言語化されたリソースを取得します。
42 | ///
43 | public TextResource TextResource
44 | {
45 | get { return this._TextResource; }
46 | }
47 |
48 | ///
49 | /// サポートされているカルチャを取得します。
50 | ///
51 | public IReadOnlyCollection SupportedCultures
52 | {
53 | get { return this._SupportedCultures; }
54 | }
55 |
56 | private ResourceService()
57 | {
58 | this._SupportedCultures = this.supportedCultureNames
59 | .Select(x =>
60 | {
61 | try
62 | {
63 | return CultureInfo.GetCultureInfo(x);
64 | }
65 | catch (CultureNotFoundException)
66 | {
67 | return null;
68 | }
69 | })
70 | .Where(x => x != null)
71 | .ToList();
72 | }
73 |
74 | ///
75 | /// 指定されたカルチャ名を使用して、リソースのカルチャを変更します。
76 | ///
77 | /// カルチャの名前。
78 | public void ChangeCulture(string name)
79 | {
80 | TextResource.Culture = this.SupportedCultures.SingleOrDefault(x => x.Name == name);
81 |
82 | this.RaisePropertyChanged("Resources");
83 | }
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/Entrance.cs:
--------------------------------------------------------------------------------
1 | using Grabacr07.KanColleViewer.Composition;
2 | using MetroRadiance;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.ComponentModel.Composition;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Controls;
10 | using System.Windows.Forms;
11 | using kcv = Grabacr07.KanColleViewer;
12 |
13 | namespace AMing.SettingsExtensions
14 | {
15 | [Export(typeof(IToolPlugin))]
16 | [ExportMetadata("Title", "SettingsExtensions")]
17 | [ExportMetadata("Description", "KCV Settings Extensions")]
18 | [ExportMetadata("Version", Entrance.IToolPluginVersion)]
19 | [ExportMetadata("Author", "@AMing")]
20 | public class Entrance : IToolPlugin
21 | {
22 | private readonly ViewModels.SettingsViewModel settingsViewModel = new ViewModels.SettingsViewModel();
23 |
24 | public const string IToolPluginVersion = "1.12";
25 | public string ToolName
26 | {
27 | get { return TextResource.Plugin_ToolName; }
28 | }
29 |
30 | public object GetToolView()
31 | {
32 | return new Views.SettingsControl { DataContext = this.settingsViewModel };
33 | }
34 |
35 | public object GetSettingsView()
36 | {
37 | return null;
38 | }
39 |
40 | public Entrance()
41 | {
42 | Init();
43 | }
44 |
45 | ~Entrance()
46 | {
47 | Exit();
48 | }
49 | Modules.InitModules initModules;
50 | private void Init()
51 | {
52 | initModules = new Modules.InitModules();
53 | initModules.Initialize();
54 |
55 | Data.Settings.Load();
56 | }
57 |
58 | private void Exit()
59 | {
60 | Data.Settings.Current.Save();
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/Entrance_Hotkey.cs:
--------------------------------------------------------------------------------
1 | using Grabacr07.KanColleViewer.Composition;
2 | using MetroRadiance;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.ComponentModel.Composition;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Controls;
10 | using System.Windows.Forms;
11 | using kcv = Grabacr07.KanColleViewer;
12 |
13 | namespace AMing.SettingsExtensions
14 | {
15 | [Export(typeof(IToolPlugin))]
16 | [ExportMetadata("Title", "SettingsExtensions.KeysSettings")]
17 | [ExportMetadata("Description", "KeysSettings")]
18 | [ExportMetadata("Version", Entrance.IToolPluginVersion)]
19 | [ExportMetadata("Author", "@AMing")]
20 | public class Entrance_keys : IToolPlugin
21 | {
22 | private readonly ViewModels.KeysSettingsViewModel keysSettingsViewModel = new ViewModels.KeysSettingsViewModel();
23 | public string ToolName
24 | {
25 | get { return TextResource.Plugin_ToolName_keys; }
26 | }
27 |
28 | public object GetToolView()
29 | {
30 | return new Views.KeysSettingsControl { DataContext = this.keysSettingsViewModel };
31 | }
32 |
33 | public object GetSettingsView()
34 | {
35 | return null;
36 | }
37 |
38 | public Entrance_keys()
39 | {
40 | Init();
41 | }
42 |
43 | ~Entrance_keys()
44 | {
45 | Exit();
46 | }
47 |
48 | private void Init()
49 | {
50 | }
51 |
52 | private void Exit()
53 | {
54 | }
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/Enums/FeetStyleType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace AMing.SettingsExtensions.Enums
8 | {
9 | public enum FeetStyleType
10 | {
11 | Arc_1 = 0,
12 | Arc_2 = 1,
13 | //Arc_Mini = 1,
14 | Rectangle = 2
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/Enums/KeyType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace AMing.SettingsExtensions.Enums
8 | {
9 | public enum KeyType
10 | {
11 | Normal = 0,
12 | HotKey = 1
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/Enums/WindowViewType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace AMing.SettingsExtensions.Enums
8 | {
9 | ///
10 | /// 信息面板的位置
11 | ///
12 | public enum WindowViewType
13 | {
14 | ///
15 | /// 底部
16 | ///
17 | Bottom = 0,
18 | ///
19 | /// 顶部
20 | ///
21 | Top = 1,
22 | ///
23 | /// 左边
24 | ///
25 | Left = 2,
26 | ///
27 | /// 右边
28 | ///
29 | Right = 3,
30 | ///
31 | /// 拆分
32 | ///
33 | Split = 4,
34 | ///
35 | /// 选项卡
36 | ///
37 | Tabs = 5
38 | }
39 | }
40 | //Bottom
41 | //M3.083,7.333v16.334h24.833V7.333H3.083zM24.915,16.833H6.083v-6.501h18.833L24.915,16.833L24.915,16.833z
42 | //Top
43 | //M27.916,23.667V7.333H3.083v16.334H27.916zM24.915,20.668H6.083v-6.501h18.833L24.915,20.668L24.915,20.668z
44 | //Left
45 | //M3.084,7.333v16.334h24.832V7.333H3.084z M11.667,10.332h13.251v10.336H11.667V10.332z
46 | //Right
47 | //M3.083,7.333v16.334h24.833V7.333H3.083z M19.333,20.668H6.083V10.332h13.25V20.668z
48 | //Split
49 | //M5.896,5.333V21.25h23.417V5.333H5.896zM26.312,18.25H8.896V8.334h17.417V18.25L26.312,18.25zM4.896,9.542H1.687v15.917h23.417V22.25H4.896V9.542z
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/Extensions/KanColleHostEx.cs:
--------------------------------------------------------------------------------
1 | using Grabacr07.KanColleViewer.Views.Controls;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace AMing.SettingsExtensions.Extensions
10 | {
11 | public static class KanColleHostEx
12 | {
13 | public static void SetMiniWindow(this KanColleHost kanColleHost, double captionHeight)
14 | {
15 | if (kanColleHost.WebBrowser == null) return;
16 |
17 | kanColleHost.Update();
18 | Window win = Window.GetWindow(kanColleHost);
19 |
20 | win.Width = kanColleHost.WebBrowser.ActualWidth;
21 | win.MinHeight = kanColleHost.WebBrowser.ActualHeight + captionHeight + 23;
22 | win.Height = win.MinHeight;
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/Helper/KeysHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows.Input;
7 |
8 | namespace AMing.SettingsExtensions.Helper
9 | {
10 | public class KeysHelper
11 | {
12 | public static string ToName(ModifierKeys modifierKeys, Key key)
13 | {
14 | string modifierkey_txt = modifierKeys == ModifierKeys.None ? string.Empty : modifierKeys.ToString(),
15 | key_txt = key == Key.None ? string.Empty : key.ToString();
16 |
17 | var keyText = string.Format("{0}{1}{2}",
18 | modifierkey_txt,
19 | (modifierKeys == ModifierKeys.None || key == Key.None) ? string.Empty : ",", key_txt);
20 |
21 | keyText = keyText.Replace(",", " + ");
22 |
23 | return keyText;
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/Models/KeyModulesItem.cs:
--------------------------------------------------------------------------------
1 | using AMing.Plugins.Core.Models;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace AMing.SettingsExtensions.Models
9 | {
10 | public class KeyModulesItem
11 | {
12 | public ModulesItem ModulesItem { get; set; }
13 | public KeySetting KeySetting { get; set; }
14 | public Helper.HotKeyHelper HotKeyHelper { get; set; }
15 |
16 | public bool ModulesIsInvalid { get; set; }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/Models/KeySetting.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows.Input;
7 | using System.Xml.Serialization;
8 |
9 | namespace AMing.SettingsExtensions.Models
10 | {
11 | [Serializable]
12 | public class KeySetting
13 | {
14 | ///
15 | /// 模块key
16 | ///
17 | public string ModulesKey { get; set; }
18 | ///
19 | /// 键
20 | ///
21 | public Key Key { get; set; }
22 | ///
23 | /// 组合键
24 | ///
25 | public ModifierKeys ModifierKeys { get; set; }
26 | ///
27 | /// 类型
28 | ///
29 | public Enums.KeyType Type { get; set; }
30 | ///
31 | /// 不设置按键
32 | ///
33 | public bool IsNotSetKey { get; set; }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/Models/MessageAction.cs.bak:
--------------------------------------------------------------------------------
1 | using Livet.Behaviors.Messaging;
2 | using Livet.Messaging;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace AMing.SettingsExtensions.Messager
10 | {
11 | public class MessageAction : InteractionMessageAction
12 | {
13 | public Action MssageCallback { get; set; }
14 | protected override void InvokeAction(InteractionMessage message)
15 | {
16 | var msg = message as SetMessage;
17 | if (msg == null || MssageCallback == null) return;
18 |
19 | MssageCallback(msg.Message);
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/Models/SetMessage.cs.bak:
--------------------------------------------------------------------------------
1 | using Livet.Messaging;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace AMing.SettingsExtensions.Messager
10 | {
11 | public class SetMessage : InteractionMessage
12 | {
13 | public T Message { get; set; }
14 |
15 | protected override Freezable CreateInstanceCore()
16 | {
17 | return new SetMessage
18 | {
19 | MessageKey = this.MessageKey,
20 | Message = this.Message
21 | };
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/Models/ThemeItem.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows.Media;
7 |
8 | namespace AMing.SettingsExtensions.Models
9 | {
10 | public class ThemeItem
11 | {
12 |
13 | public Color BackgroundColor { get; set; }
14 | public Color ForegroundColor { get; set; }
15 |
16 | public T Type { get; set; }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/Modules/ExitTipModules.cs:
--------------------------------------------------------------------------------
1 | using AMing.Plugins.Core.Helper;
2 | using AMing.Plugins.Core.Modules;
3 | using AMing.SettingsExtensions.Helper;
4 | using Grabacr07.Desktop.Metro.Controls;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.ComponentModel;
8 | using System.Linq;
9 | using System.Text;
10 | using System.Threading.Tasks;
11 | using System.Windows;
12 | using System.Windows.Controls;
13 | using kcv = Grabacr07.KanColleViewer;
14 |
15 | namespace AMing.SettingsExtensions.Modules
16 | {
17 | public class ExitTipModules : ModulesBase
18 | {
19 | #region Current
20 |
21 | private static ExitTipModules _current = new ExitTipModules();
22 |
23 | public static ExitTipModules Current
24 | {
25 | get { return _current; }
26 | set { _current = value; }
27 | }
28 |
29 | #endregion
30 |
31 | public override void Initialize()
32 | {
33 | Application.Current.MainWindow.Closing += new CancelEventHandler(MainWindow_Closing);
34 | }
35 | public override void Dispose()
36 | {
37 | }
38 |
39 | void MainWindow_Closing(object o, CancelEventArgs e)
40 | {
41 | if (!Data.Settings.Current.EnableExitTip)
42 | {
43 | return;
44 | }
45 |
46 | if (!MessageBoxDialog.Show(TextResource.Exit_Msg_Content, TextResource.Exit_Msg_Title))
47 | {
48 | e.Cancel = true;
49 | }
50 |
51 | }
52 |
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/Modules/Generic/MessagerHelper.cs.bak:
--------------------------------------------------------------------------------
1 | using Livet.Messaging;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace AMing.SettingsExtensions.Helper
9 | {
10 | public class MessagerHelper
11 | {
12 | #region Current
13 |
14 | private static MessagerHelper _current = new MessagerHelper();
15 |
16 | public static MessagerHelper Current
17 | {
18 | get { return _current; }
19 | set { _current = value; }
20 | }
21 |
22 | #endregion
23 |
24 | public MessagerHelper()
25 | {
26 | Messenger = new InteractionMessenger();
27 | }
28 |
29 | public InteractionMessenger Messenger { get; set; }
30 |
31 | public void Register(T val, Action callback)
32 | {
33 | var msgTrigger = new Livet.Behaviors.Messaging.InteractionMessageTrigger { Messenger = this.Messenger, };
34 | msgTrigger.Attach(new Messager.MessageAction { MssageCallback = callback });
35 | }
36 |
37 | public void Send(string key, T val)
38 | {
39 | var message = new Messager.SetMessage()
40 | {
41 | MessageKey = key,
42 | Message = val
43 | };
44 | this.Messenger.Raise(message);
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/Modules/InitModules.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace AMing.SettingsExtensions.Modules
8 | {
9 | public class InitModules : AMing.Plugins.Core.Modules.InitModules
10 | {
11 | public override void SetModules()
12 | {
13 | base.SetModules();
14 |
15 | ModulesList.Add(Modules.MainWindowModules.Current);
16 | ModulesList.Add(Modules.ExitTipModules.Current);
17 | ModulesList.Add(Modules.NotifyIconModules.Current);
18 | ModulesList.Add(Modules.KeysModules.Current);
19 | ModulesList.Add(Modules.ThemeModules.Current);
20 | ModulesList.Add(Modules.WindowViewModules.Current);
21 | ModulesList.Add(Modules.SimpleFleetModules.Current);
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/Modules/PublicModulesKeys.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace AMing.SettingsExtensions.Modules
8 | {
9 | public class PublicModulesKeys
10 | {
11 | public const string HideAllWindows = "HideAllWindows";
12 | public const string ShowAllWindows = "ShowAllWindows";
13 | public const string ChangeAllWindowsByMainWindow = "ChangeAllWindowsByMainWindow";
14 | public const string ChangeTabs = "ChangeTabs";
15 | public const string ToggleMute = "ToggleMute";
16 | public const string TakeScreenshot = "TakeScreenshot";
17 | public const string ShowShipCatalog = "ShowShipCatalog";
18 | public const string ShowSlotItemCatalog = "ShowSlotItemCatalog";
19 |
20 |
21 | public const string EnableSimpleFleet = "EnableSimpleFleet";
22 | public const string GhostSimpleFleet = "GhostSimpleFleet";
23 |
24 |
25 | public static string GetModulesKey(string key)
26 | {
27 | return string.Format( AMing.Plugins.Core.StaticData.PublicModulesKey + key);
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过以下
6 | // 特性集控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("SettingsExtensions")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("SettingsExtensions")]
13 | [assembly: AssemblyCopyright("Copyright © 2015")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("4d40cb37-3e7d-4052-9757-c898469bd60d")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 生成号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.12.*")]
36 | [assembly: AssemblyFileVersion("1.12.*")]
37 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/ViewModels/Collections/ListViewModels.cs:
--------------------------------------------------------------------------------
1 | using Livet;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows.Media;
8 |
9 | namespace AMing.SettingsExtensions.ViewModels.Collections
10 | {
11 | public class ListViewModels : ViewModel
12 | where T : Items.SelectedItemViewModel
13 | {
14 | #region List
15 |
16 | protected IList _list;
17 |
18 | public virtual IList List
19 | {
20 | get
21 | {
22 | if (this._list == null && GetListFunc != null)
23 | {
24 | var result = GetListFunc();
25 |
26 | this.List = result;
27 | }
28 |
29 | return _list;
30 | }
31 | set
32 | {
33 | if (_list != value)
34 | {
35 | _list = value;
36 | this.RaisePropertyChanged();
37 | }
38 | }
39 | }
40 |
41 | #endregion
42 |
43 | #region SelectedItem
44 |
45 | protected T _selectedItem;
46 |
47 | public virtual T SelectedItem
48 | {
49 | get { return this._selectedItem; }
50 | set
51 | {
52 | if (this._selectedItem != value)
53 | {
54 | if (this._selectedItem != null) this._selectedItem.IsSelected = false;
55 | if (value != null) value.IsSelected = true;
56 | this._selectedItem = value;
57 | this.RaisePropertyChanged();
58 | this.OnSelectedChange();
59 | }
60 | }
61 | }
62 |
63 | #endregion
64 |
65 |
66 | public Func> GetListFunc { get; set; }
67 |
68 | public event EventHandler SelectedChange;
69 |
70 | protected virtual void OnSelectedChange()
71 | {
72 | if (SelectedChange != null)
73 | {
74 | SelectedChange(this, this.SelectedItem);
75 | }
76 | }
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/ViewModels/Collections/ThemeListViewModels.cs:
--------------------------------------------------------------------------------
1 | using AMing.SettingsExtensions.ViewModels.Items;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace AMing.SettingsExtensions.ViewModels.Collections
9 | {
10 | public class ThemeListViewModels : ListViewModels>>
11 | {
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/ViewModels/Items/FeetStyleTypeViewModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace AMing.SettingsExtensions.ViewModels.Items
8 | {
9 | public class FeetStyleTypeViewModel : SelectedItemViewModel
10 | {
11 | public FeetStyleTypeViewModel(Enums.FeetStyleType type)
12 | {
13 | this.Type = type;
14 | }
15 | public Enums.FeetStyleType Type { get; set; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/ViewModels/Items/KeyModulesItemViewModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace AMing.SettingsExtensions.ViewModels.Items
8 | {
9 | public class KeyModulesItemViewModel : SelectedItemViewModel
10 | {
11 | public KeyModulesItemViewModel(Models.KeyModulesItem keyModulesItem)
12 | {
13 | this.KeyModulesItem = keyModulesItem;
14 | }
15 | public Models.KeyModulesItem KeyModulesItem { get; set; }
16 |
17 | public Action SetKeyAction { get; set; }
18 |
19 | public void SetKey(KeyModulesItemViewModel viewModel)
20 | {
21 | if (SetKeyAction != null)
22 | SetKeyAction(viewModel);
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/ViewModels/Items/SelectedItemViewModel.cs:
--------------------------------------------------------------------------------
1 | using Livet;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows.Media;
8 |
9 | namespace AMing.SettingsExtensions.ViewModels.Items
10 | {
11 | public class SelectedItemViewModel : ViewModel
12 | {
13 | #region IsSelected
14 |
15 | private bool _IsSelected;
16 |
17 | public bool IsSelected
18 | {
19 | get { return this._IsSelected; }
20 | set
21 | {
22 | if (this._IsSelected != value)
23 | {
24 | this._IsSelected = value;
25 | this.RaisePropertyChanged();
26 | }
27 | }
28 | }
29 |
30 | #endregion
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/ViewModels/Items/ThemeItemViewModel.cs:
--------------------------------------------------------------------------------
1 | using Livet;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows.Media;
8 |
9 | namespace AMing.SettingsExtensions.ViewModels.Items
10 | {
11 | public class ThemeItemViewModel : SelectedItemViewModel
12 | where T_Models : Models.ThemeItem
13 | {
14 | public ThemeItemViewModel(T_Models models)
15 | {
16 | this.Type = models.Type;
17 | this.BackgroundColor = models.BackgroundColor;
18 | this.ForegroundColor = models.ForegroundColor;
19 | }
20 |
21 | public Color BackgroundColor { get; set; }
22 | public Color ForegroundColor { get; set; }
23 |
24 | public T Type { get; set; }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/ViewModels/Items/WindowViewTypeViewModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace AMing.SettingsExtensions.ViewModels.Items
8 | {
9 | public class WindowViewTypeViewModel : SelectedItemViewModel
10 | {
11 | public WindowViewTypeViewModel(Enums.WindowViewType type)
12 | {
13 | this.Type = type;
14 | }
15 | public Enums.WindowViewType Type { get; set; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/Views/ContainerWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using Grabacr07.KanColleViewer.Composition;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Controls;
9 | using System.Windows.Data;
10 | using System.Windows.Documents;
11 | using System.Windows.Input;
12 | using System.Windows.Media;
13 | using System.Windows.Media.Imaging;
14 | using System.Windows.Shapes;
15 |
16 | namespace AMing.SettingsExtensions.Views
17 | {
18 | ///
19 | /// ContainerWindow.xaml 的交互逻辑
20 | ///
21 | public partial class ContainerWindow
22 | {
23 | public ContainerWindow()
24 | {
25 | InitializeComponent();
26 | IsClose = false;
27 | Application.Current.MainWindow.Closed += (sender, args) =>
28 | {
29 | this.IsClose = true;
30 | this.Close();
31 | };
32 | this.Closing += (sender, args) =>
33 | {
34 | if (!this.IsClose)
35 | {
36 | args.Cancel = true;
37 | OnShowHide(false);
38 | }
39 | };
40 | }
41 |
42 | public bool IsClose { get; set; }
43 | public object WindowContent
44 | {
45 | get { return contentControl.Content; }
46 | set { contentControl.Content = value; }
47 | }
48 |
49 | public event EventHandler ShowHide;
50 | public void OnShowHide(bool isshow)
51 | {
52 | if (isshow)
53 | {
54 | this.Show();
55 | }
56 | else
57 | {
58 | this.Hide();
59 | }
60 | if (ShowHide != null)
61 | {
62 | ShowHide(this, isshow);
63 | }
64 | }
65 |
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/Views/KeysSettingsControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace AMing.SettingsExtensions.Views
17 | {
18 | ///
19 | /// SettingsControl.xaml 的交互逻辑
20 | ///
21 | public partial class KeysSettingsControl : UserControl
22 | {
23 | public KeysSettingsControl()
24 | {
25 | InitializeComponent();
26 | }
27 |
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/Views/MessageBoxDialog.xaml:
--------------------------------------------------------------------------------
1 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
29 |
30 |
36 |
37 |
43 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/Views/MessageBoxDialog.xaml.cs:
--------------------------------------------------------------------------------
1 | using Grabacr07.KanColleViewer.Composition;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Controls;
9 | using System.Windows.Data;
10 | using System.Windows.Documents;
11 | using System.Windows.Input;
12 | using System.Windows.Media;
13 | using System.Windows.Media.Imaging;
14 | using System.Windows.Shapes;
15 |
16 | namespace AMing.SettingsExtensions.Views
17 | {
18 | ///
19 | /// ContainerWindow.xaml 的交互逻辑
20 | ///
21 | public partial class MessageBoxDialog
22 | {
23 | public MessageBoxDialog()
24 | {
25 | InitializeComponent();
26 |
27 | this.btn_ok.Click += (btn_ok_sender, btn_ok_e) =>
28 | {
29 | this.DialogResult = true;
30 | this.Close();
31 | };
32 |
33 | this.btn_cancel.Click += (btn_cancel_sender, btn_cancel_e) =>
34 | {
35 | this.DialogResult = false;
36 | this.Close();
37 | };
38 |
39 | }
40 | public MessageBoxDialog(string msg)
41 | : this()
42 | {
43 | this.Title = string.Empty;
44 | this.tb_content.Text = msg;
45 | this.btn_ok.Content = TextResource.Ok;
46 | this.btn_cancel.Visibility = System.Windows.Visibility.Collapsed;
47 | this.sp_btns.HorizontalAlignment = System.Windows.HorizontalAlignment.Center;
48 | }
49 |
50 | public MessageBoxDialog(string msg, string caption)
51 | : this()
52 | {
53 | this.Title = caption;
54 | this.tb_content.Text = msg;
55 | this.btn_ok.Content = TextResource.Yes;
56 | this.btn_cancel.Content = TextResource.No;
57 | this.btn_cancel.Visibility = System.Windows.Visibility.Visible;
58 |
59 | this.btn_cancel.Focus();
60 | }
61 |
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/Views/SettingsControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace AMing.SettingsExtensions.Views
17 | {
18 | ///
19 | /// SettingsControl.xaml 的交互逻辑
20 | ///
21 | public partial class SettingsControl : UserControl
22 | {
23 | public SettingsControl()
24 | {
25 | InitializeComponent();
26 | }
27 |
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/Views/Simple/ExpeditionsControl.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/Views/Simple/ExpeditionsControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace AMing.SettingsExtensions.Views.Simple
17 | {
18 | ///
19 | /// ExpeditionsControl.xaml 的交互逻辑
20 | ///
21 | public partial class ExpeditionsControl : UserControl
22 | {
23 | public ExpeditionsControl()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/Views/Simple/FleetControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace AMing.SettingsExtensions.Views.Simple
17 | {
18 | ///
19 | /// FleetControl.xaml 的交互逻辑
20 | ///
21 | public partial class FleetControl : UserControl
22 | {
23 | public FleetControl()
24 | {
25 | InitializeComponent();
26 | this.Loaded += FleetControl_Loaded;
27 | }
28 |
29 | void FleetControl_Loaded(object sender, RoutedEventArgs e)
30 | {
31 | Modules.SimpleFleetModules.Current.FeetStyleChange += Current_FeetStyleChange;
32 | if (Data.Settings.Current.SimpleFeetStyleType != Enums.FeetStyleType.Arc_1)
33 | {
34 | ChangeStyle(Data.Settings.Current.SimpleFeetStyleType);
35 | }
36 | }
37 |
38 | void Current_FeetStyleChange(object sender, Enums.FeetStyleType e)
39 | {
40 | ChangeStyle(e);
41 | }
42 |
43 | public void ChangeStyle(Enums.FeetStyleType type)
44 | {
45 | var key = string.Format("FleetItem_{0}", type);
46 | var dataTemplate = this.Resources[key] as DataTemplate;
47 | if (dataTemplate != null)
48 | {
49 | itemsControl.ItemTemplate = dataTemplate;
50 | }
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/Views/Simple/QuestsControl.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/Views/Simple/QuestsControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace AMing.SettingsExtensions.Views.Simple
17 | {
18 | ///
19 | /// QuestsControl.xaml 的交互逻辑
20 | ///
21 | public partial class QuestsControl : UserControl
22 | {
23 | public QuestsControl()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/Views/Simple/ShipyardControl.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/Views/Simple/ShipyardControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace AMing.SettingsExtensions.Views.Simple
17 | {
18 | ///
19 | /// ShipyardControl.xaml 的交互逻辑
20 | ///
21 | public partial class ShipyardControl : UserControl
22 | {
23 | public ShipyardControl()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/Views/SplitWindowButton.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/Views/SplitWindowButton.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace AMing.SettingsExtensions.Views
17 | {
18 | ///
19 | /// ShowMainInfoViewButton.xaml 的交互逻辑
20 | ///
21 | public partial class SplitWindowButton : UserControl
22 | {
23 | public SplitWindowButton()
24 | {
25 | InitializeComponent();
26 | this.Loaded += ShowMainInfoViewButton_Loaded;
27 | }
28 |
29 | void ShowMainInfoViewButton_Loaded(object sender, RoutedEventArgs e)
30 | {
31 | this.btn.Click += (btn_sender, btn_e) =>
32 | {
33 | if (Click != null)
34 | Click(btn_sender, btn_e);
35 | };
36 | }
37 |
38 | public event RoutedEventHandler Click;
39 |
40 | public bool BtnIsEnabled
41 | {
42 | get { return this.btn.IsEnabled; }
43 | set
44 | {
45 | if (this.btn.IsEnabled != value)
46 | {
47 | this.btn.IsEnabled = value;
48 | this.btn.Opacity = value ? 1 : 0.6d;
49 | }
50 | }
51 | }
52 |
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/Win32/HotKey.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Runtime.InteropServices;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace AMing.SettingsExtensions.Win32
9 | {
10 | public class HotKey
11 | {
12 | [DllImport("user32")]
13 | public static extern bool RegisterHotKey(IntPtr hWnd, int id, uint controlKey, uint virtualKey);
14 |
15 | [DllImport("user32")]
16 | public static extern bool UnregisterHotKey(IntPtr hWnd, int id);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/memo.txt:
--------------------------------------------------------------------------------
1 |
2 |
3 | mini信息栏添加更多内容
4 |
5 |
6 |
7 |
8 | 舰队 远征 任务 工厂
--------------------------------------------------------------------------------
/KcvPlugins/SettingsExtensions/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/KcvPlugins/SoundNotifier/Modules/InitModules.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace AMing.SoundNotifier.Modules
8 | {
9 | public class InitModules : AMing.Plugins.Core.Modules.InitModules
10 | {
11 | public override void SetModules()
12 | {
13 | base.SetModules();
14 |
15 | ModulesList.Add(Modules.SoundsModules.Current);
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/KcvPlugins/SoundNotifier/Notifier.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel.Composition;
4 | using System.Linq;
5 | using System.Reflection;
6 | using System.Threading.Tasks;
7 | using Grabacr07.KanColleViewer.Composition;
8 | using System.Windows;
9 | using System.Media;
10 | using System.IO;
11 | using System.Windows.Media;
12 |
13 | namespace AMing.SoundNotifier
14 | {
15 | [Export(typeof(INotifier))]
16 | [ExportMetadata("Title", "Sound Notifier")]
17 | [ExportMetadata("Description", "声音提示")]
18 | [ExportMetadata("Version", "1.2")]
19 | [ExportMetadata("Author", "@AMing")]
20 | public class SoundNotifier : INotifier
21 | {
22 | Modules.InitModules initModules;
23 | public void Initialize()
24 | {
25 | initModules = new Modules.InitModules();
26 | initModules.Initialize();
27 | }
28 |
29 | public void Show(NotifyType type, string header, string body, Action activated, Action failed = null)
30 | {
31 | Modules.SoundsModules.Current.Notify(failed);
32 | }
33 |
34 | public object GetSettingsView()
35 | {
36 | return null;
37 | }
38 | public void Dispose()
39 | {
40 | }
41 |
42 | }
43 | }
--------------------------------------------------------------------------------
/KcvPlugins/SoundNotifier/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过以下
6 | // 特性集控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("SoundNotifier")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("SoundNotifier")]
13 | [assembly: AssemblyCopyright("Copyright © 2015")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("c6e61ada-5622-44f6-a340-d78510a9b44f")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 生成号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.2.*")]
36 | [assembly: AssemblyFileVersion("1.2.*")]
37 |
--------------------------------------------------------------------------------
/KcvPlugins/SoundNotifier/readme.SoundNotifier.txt:
--------------------------------------------------------------------------------
1 | author/developer :AMing
2 | website:http://kcvp.logs.moe/
3 | Github:https://github.com/AMMing
4 | SourceCode:https://github.com/AMMing/KcvPlugins
5 |
6 |
7 |
8 |
9 | ##提督很忙的拓展插件(KanColleViewer Plugins)
10 | ==========
11 |
12 | KanColleViewer 在3.0版本之后增加了插件功能,可以通过添加插件完善kcv的功能。
13 |
14 | 本插件在只kcv3.4下测试,其他旧版本理论上可以,不过没有测试,使用时最好是用最新的kcv。
15 |
16 |
17 | ### 主要功能
18 |
19 | * 有通知的时候发出声音提示
20 |
21 | ### 使用方法
22 |
23 | 将解压出来的dll放到kcv的Plugins目录下然后重启kcv,如果失败的话右键dll属性看看有个没有个什么什么锁定的 把那个解锁掉再重启kcv
24 |
25 | 更改声音请修改 Plugins/sounds 里面的音频文件,支持 wav和mp3格式,但是必须按照固定的文件名 notify.wav 或notify.mp3
26 |
27 | ### 注意事项
28 |
29 | “AMing.Plugins.Core.dll”为核心组件不可删除
30 |
31 | ### 参考项目
32 |
33 | * [KanColleViewer](https://github.com/Grabacr07/KanColleViewer)
34 |
35 |
36 | #### 许可证
37 |
38 | * MIT License
39 |
40 |
41 |
42 |
43 |
44 | 更新日志
45 |
46 | 1.2 -- 2015.02.03
47 |
48 | 调用core模块实现接收其他插件发出的通知,添加警告音效“warning”跟“notify”一样提督们可以自行修改,目前在大破插件“AMing.Warning.dll”舰娘大破的时候会发出警报的音效
49 |
50 |
51 | 1.1 -- 2015.01.19
52 |
53 | 修复不能静音的bug?(我几台电脑都没问题,不知道具体有没有解决)
54 |
55 | PS:_ (:3」∠)_好像是MediaPlayer太早实例化导致kcv将他识别成游戏声音控制了 导致游戏静音不了?
56 |
57 | 1.0 -- 2015.01.18
58 |
59 | 有通知的时候发出声音提示在win7下可以和另一个通知插件组合成win8的推送效果
--------------------------------------------------------------------------------
/KcvPlugins/SoundNotifier/sounds/notify.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AMMing/KcvPlugins/d913a95310a95c3411dd317f79fed51a4793b65d/KcvPlugins/SoundNotifier/sounds/notify.wav
--------------------------------------------------------------------------------
/KcvPlugins/SoundNotifier/sounds/warning.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AMMing/KcvPlugins/d913a95310a95c3411dd317f79fed51a4793b65d/KcvPlugins/SoundNotifier/sounds/warning.wav
--------------------------------------------------------------------------------
/KcvPlugins/ViewRange/Converters/ViewRangeConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Globalization;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows.Data;
8 | using System.Windows.Media;
9 | using Grabacr07.KanColleViewer.ViewModels.Contents.Fleets;
10 | using Grabacr07.KanColleWrapper.Models;
11 | using AMing.Plugins.Core.Extensions;
12 | using Grabacr07.KanColleWrapper;
13 | using AMing.ViewRange.Extensions;
14 |
15 | namespace AMing.ViewRange.Converters
16 | {
17 | public class ViewRangeConverter : IValueConverter
18 | {
19 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
20 | {
21 | var data = value as FleetViewModel;
22 | if (data == null)
23 | return value;
24 |
25 | //return Helper.CalcFleetViewRangeHelper.CalcFleetViewRange(data, Data.Settings.Current.Type);
26 | var msg = data.Ships.Select(s => s.Ship).Select(s => string.Format("{0}\n{1}\n", s.ToString(), s.SlotItems.Select(si => si.ToString()).ToString(","))).ToString("\n");
27 | AMing.Plugins.Core.GenericMessager.Current.SendToLogs(msg);
28 |
29 | return value;
30 | }
31 |
32 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
33 | {
34 | throw new NotImplementedException();
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/KcvPlugins/ViewRange/Data/ResourceService.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Globalization;
4 | using System.Linq;
5 | using System.Threading.Tasks;
6 | using Livet;
7 |
8 | namespace AMing.ViewRange.Data
9 | {
10 | ///
11 | /// 多言語化されたリソースへのアクセスを提供します。
12 | ///
13 | public class ResourceService : NotificationObject
14 | {
15 | #region static members
16 |
17 | private static readonly ResourceService current = new ResourceService();
18 |
19 | public static ResourceService Current
20 | {
21 | get { return current; }
22 | }
23 |
24 | #endregion
25 |
26 | ///
27 | /// サポートされているカルチャの名前。
28 | ///
29 | private readonly string[] supportedCultureNames =
30 | {
31 | //"ja", // Resources.resx
32 | "en",
33 | "zh-CN"//,
34 | //"ko-KR",
35 | };
36 |
37 | private readonly TextResource _TextResource = new TextResource();
38 | private readonly IReadOnlyCollection _SupportedCultures;
39 |
40 | ///
41 | /// 多言語化されたリソースを取得します。
42 | ///
43 | public TextResource TextResource
44 | {
45 | get { return this._TextResource; }
46 | }
47 |
48 | ///
49 | /// サポートされているカルチャを取得します。
50 | ///
51 | public IReadOnlyCollection SupportedCultures
52 | {
53 | get { return this._SupportedCultures; }
54 | }
55 |
56 | private ResourceService()
57 | {
58 | this._SupportedCultures = this.supportedCultureNames
59 | .Select(x =>
60 | {
61 | try
62 | {
63 | return CultureInfo.GetCultureInfo(x);
64 | }
65 | catch (CultureNotFoundException)
66 | {
67 | return null;
68 | }
69 | })
70 | .Where(x => x != null)
71 | .ToList();
72 | }
73 |
74 | ///
75 | /// 指定されたカルチャ名を使用して、リソースのカルチャを変更します。
76 | ///
77 | /// カルチャの名前。
78 | public void ChangeCulture(string name)
79 | {
80 | TextResource.Culture = this.SupportedCultures.SingleOrDefault(x => x.Name == name);
81 |
82 | this.RaisePropertyChanged("Resources");
83 | }
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/KcvPlugins/ViewRange/Data/Settings.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Threading.Tasks;
6 | using System.Xml.Serialization;
7 | using Grabacr07.KanColleViewer.Models.Data.Xml;
8 | using Grabacr07.KanColleWrapper;
9 | using Livet;
10 | using Grabacr07.KanColleViewer.Models;
11 | using System.Windows.Input;
12 | using MetroRadiance;
13 |
14 | namespace AMing.ViewRange.Data
15 | {
16 | [Serializable]
17 | public class Settings
18 | {
19 | #region static members
20 |
21 | #if DEBUG
22 | private static readonly string filePath = Path.Combine(
23 | Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
24 | "y2443.com",
25 | "ViewRange.Debug",
26 | "Settings.xml");
27 | #else
28 | private static readonly string filePath = Path.Combine(
29 | Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
30 | "y2443.com",
31 | "ViewRange",
32 | "Settings.xml");
33 | #endif
34 |
35 | public static Settings Current { get; set; }
36 |
37 | public static void Load()
38 | {
39 | try
40 | {
41 | Current = filePath.ReadXml();
42 | }
43 | catch (Exception ex)
44 | {
45 | Current = GetInitialSettings();
46 | System.Diagnostics.Debug.WriteLine(ex);
47 | }
48 | }
49 |
50 | public static Settings GetInitialSettings()
51 | {
52 | return new Settings
53 | {
54 | Type = Enums.ViewRangeType.Type3
55 | };
56 | }
57 |
58 | #endregion
59 |
60 | #region member
61 |
62 | public Enums.ViewRangeType Type { get; set; }
63 |
64 | #endregion
65 |
66 | public void Save()
67 | {
68 | try
69 | {
70 | this.WriteXml(filePath);
71 | }
72 | catch (Exception ex)
73 | {
74 | System.Diagnostics.Debug.WriteLine(ex);
75 | }
76 | }
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/KcvPlugins/ViewRange/Entrance.cs:
--------------------------------------------------------------------------------
1 | using Grabacr07.KanColleViewer.Composition;
2 | using Grabacr07.KanColleWrapper;
3 | using Grabacr07.KanColleWrapper.Models.Raw;
4 | using MetroRadiance;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.ComponentModel.Composition;
8 | using System.Linq;
9 | using System.Text;
10 | using System.Threading.Tasks;
11 | using System.Windows.Controls;
12 | using kcv = Grabacr07.KanColleViewer;
13 |
14 | namespace AMing.ViewRange
15 | {
16 | [Export(typeof(IToolPlugin))]
17 | [ExportMetadata("Title", "ViewRange")]
18 | [ExportMetadata("Description", "FleetsViewRangeEx")]
19 | [ExportMetadata("Version", Entrance.IToolPluginVersion)]
20 | [ExportMetadata("Author", "@AMing")]
21 | public class Entrance : IToolPlugin
22 | {
23 | private readonly ViewModels.SettingsViewModel settingsViewModel = new ViewModels.SettingsViewModel();
24 |
25 |
26 | public const string IToolPluginVersion = "1.0";
27 | public string ToolName
28 | {
29 | get
30 | {
31 | return TextResource.Plugin_ToolName;
32 | }
33 | }
34 |
35 | public object GetToolView()
36 | {
37 | return new Views.SettingsControl { DataContext = this.settingsViewModel };
38 | }
39 |
40 | public object GetSettingsView()
41 | {
42 | return null;
43 | }
44 |
45 | public Entrance()
46 | {
47 | Init();
48 | }
49 |
50 | ~Entrance()
51 | {
52 | Exit();
53 | }
54 |
55 | Modules.InitModules initModules;
56 | private void Init()
57 | {
58 | initModules = new Modules.InitModules();
59 | initModules.Initialize();
60 |
61 | Data.Settings.Load();
62 | }
63 |
64 | private void Exit()
65 | {
66 | Data.Settings.Current.Save();
67 | }
68 | }
69 |
70 | }
71 |
--------------------------------------------------------------------------------
/KcvPlugins/ViewRange/Enums/MessageType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace AMing.ViewRange.Enums
8 | {
9 | public enum ViewRangeType
10 | {
11 | ///
12 | /// 単純な索敵合計値。
13 | ///
14 | Type1,
15 |
16 | ///
17 | /// (偵察機 × 2) + (電探) + √(装備込みの艦隊索敵値合計 - 偵察機 - 電探)。
18 | ///
19 | Type2,
20 |
21 |
22 | Type3,
23 |
24 |
25 | Type4
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/KcvPlugins/ViewRange/Extensions/ViewRangeEx.cs:
--------------------------------------------------------------------------------
1 | using Grabacr07.KanColleWrapper.Models;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Reflection;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 | using AMing.Plugins.Core.Extensions;
9 | using Grabacr07.KanColleViewer.ViewModels.Contents.Fleets;
10 |
11 | namespace AMing.ViewRange.Extensions
12 | {
13 | public static class ViewRangeEx
14 | {
15 | public static Fleet GetFleet(this FleetViewModel data)
16 | {
17 | return data.GetField("source");
18 | }
19 | public static T GetRawData(this RawDataWrapper data)
20 | {
21 | return data.GetField("RawData");
22 | }
23 | public static int? Get(this int[] array, int index)
24 | {
25 | return array.Length > index ? (int?)array[index] : null;
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/KcvPlugins/ViewRange/Modules/InitModules.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace AMing.ViewRange.Modules
8 | {
9 | public class InitModules : AMing.Plugins.Core.Modules.InitModules
10 | {
11 | public override void SetModules()
12 | {
13 | base.SetModules();
14 |
15 | ModulesList.Add(Modules.ViewRangeModules.Current);
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/KcvPlugins/ViewRange/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过以下
6 | // 特性集控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("ViewRange")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("ViewRange")]
13 | [assembly: AssemblyCopyright("Copyright © 2015")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("81cf2f4f-4e70-4a9c-bfbf-7030ac1abc26")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 生成号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/KcvPlugins/ViewRange/Views/SettingsControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace AMing.ViewRange.Views
17 | {
18 | ///
19 | /// SettingsControl.xaml 的交互逻辑
20 | ///
21 | public partial class SettingsControl : UserControl
22 | {
23 | public SettingsControl()
24 | {
25 | InitializeComponent();
26 | }
27 |
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/KcvPlugins/ViewRange/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/KcvPlugins/Warning/Data/ResourceService.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Globalization;
4 | using System.Linq;
5 | using System.Threading.Tasks;
6 | using Livet;
7 |
8 | namespace AMing.Warning.Data
9 | {
10 | ///
11 | /// 多言語化されたリソースへのアクセスを提供します。
12 | ///
13 | public class ResourceService : NotificationObject
14 | {
15 | #region static members
16 |
17 | private static readonly ResourceService current = new ResourceService();
18 |
19 | public static ResourceService Current
20 | {
21 | get { return current; }
22 | }
23 |
24 | #endregion
25 |
26 | ///
27 | /// サポートされているカルチャの名前。
28 | ///
29 | private readonly string[] supportedCultureNames =
30 | {
31 | //"ja", // Resources.resx
32 | "en",
33 | "zh-CN"//,
34 | //"ko-KR",
35 | };
36 |
37 | private readonly TextResource _TextResource = new TextResource();
38 | private readonly IReadOnlyCollection _SupportedCultures;
39 |
40 | ///
41 | /// 多言語化されたリソースを取得します。
42 | ///
43 | public TextResource TextResource
44 | {
45 | get { return this._TextResource; }
46 | }
47 |
48 | ///
49 | /// サポートされているカルチャを取得します。
50 | ///
51 | public IReadOnlyCollection SupportedCultures
52 | {
53 | get { return this._SupportedCultures; }
54 | }
55 |
56 | private ResourceService()
57 | {
58 | this._SupportedCultures = this.supportedCultureNames
59 | .Select(x =>
60 | {
61 | try
62 | {
63 | return CultureInfo.GetCultureInfo(x);
64 | }
65 | catch (CultureNotFoundException)
66 | {
67 | return null;
68 | }
69 | })
70 | .Where(x => x != null)
71 | .ToList();
72 | }
73 |
74 | ///
75 | /// 指定されたカルチャ名を使用して、リソースのカルチャを変更します。
76 | ///
77 | /// カルチャの名前。
78 | public void ChangeCulture(string name)
79 | {
80 | TextResource.Culture = this.SupportedCultures.SingleOrDefault(x => x.Name == name);
81 |
82 | this.RaisePropertyChanged("Resources");
83 | }
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/KcvPlugins/Warning/Entrance.cs:
--------------------------------------------------------------------------------
1 | using Grabacr07.KanColleViewer.Composition;
2 | using Grabacr07.KanColleWrapper;
3 | using Grabacr07.KanColleWrapper.Models.Raw;
4 | using MetroRadiance;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.ComponentModel.Composition;
8 | using System.Linq;
9 | using System.Text;
10 | using System.Threading.Tasks;
11 | using System.Windows.Controls;
12 | using System.Windows.Forms;
13 | using kcv = Grabacr07.KanColleViewer;
14 |
15 | namespace AMing.Warning
16 | {
17 | [Export(typeof(IToolPlugin))]
18 | [ExportMetadata("Title", "Warning")]
19 | [ExportMetadata("Description", "Feet Hp Warning")]
20 | [ExportMetadata("Version", Entrance.IToolPluginVersion)]
21 | [ExportMetadata("Author", "@AMing")]
22 | public class Entrance : IToolPlugin
23 | {
24 | private readonly ViewModels.SettingsViewModel settingsViewModel = new ViewModels.SettingsViewModel();
25 |
26 |
27 | public const string IToolPluginVersion = "1.0";
28 | public string ToolName
29 | {
30 | get
31 | {
32 | return TextResource.Plugin_ToolName;
33 | }
34 | }
35 |
36 | public object GetToolView()
37 | {
38 | return new Views.SettingsControl { DataContext = this.settingsViewModel };
39 | }
40 |
41 | public object GetSettingsView()
42 | {
43 | return null;
44 | }
45 |
46 | public Entrance()
47 | {
48 | Init();
49 | }
50 |
51 | ~Entrance()
52 | {
53 | Exit();
54 | }
55 |
56 | Modules.InitModules initModules;
57 | private void Init()
58 | {
59 | initModules = new Modules.InitModules();
60 | initModules.Initialize();
61 |
62 | Data.Settings.Load();
63 | }
64 |
65 | private void Exit()
66 | {
67 | Data.Settings.Current.Save();
68 | }
69 | }
70 |
71 | }
72 |
--------------------------------------------------------------------------------
/KcvPlugins/Warning/Modules/InitModules.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace AMing.Warning.Modules
8 | {
9 | public class InitModules : AMing.Plugins.Core.Modules.InitModules
10 | {
11 | public override void SetModules()
12 | {
13 | base.SetModules();
14 |
15 | ModulesList.Add(Modules.WarningModules.Current);
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/KcvPlugins/Warning/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过以下
6 | // 特性集控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("Warning")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Warning")]
13 | [assembly: AssemblyCopyright("Copyright © 2015")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("16453cab-9248-4a4d-82c4-ffd0e6411a69")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 生成号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.*")]
36 | [assembly: AssemblyFileVersion("1.0.*")]
37 |
--------------------------------------------------------------------------------
/KcvPlugins/Warning/Readme.Warning.txt:
--------------------------------------------------------------------------------
1 | author/developer :AMing
2 | website:http://kcvp.logs.moe/
3 | Github:https://github.com/AMMing
4 | SourceCode:https://github.com/AMMing/KcvPlugins
5 |
6 |
7 |
8 |
9 | ##提督很忙的拓展插件(KanColleViewer Plugins)
10 | ==========
11 |
12 | KanColleViewer 在3.0版本之后增加了插件功能,可以通过添加插件完善kcv的功能。
13 |
14 | 本插件在只kcv3.4下测试,其他旧版本理论上可以,不过没有测试,使用时最好是用最新的kcv。
15 |
16 |
17 | ### 主要功能
18 |
19 | * 在队伍里面有大破舰娘的时候发出警告,可以结合“AMing.SoundNotifier.dll”和“AMing.WindowsNotifierEx.dll”达到更醒目的提示。
20 |
21 | ### 使用方法
22 |
23 | 将解压出来的dll放到kcv的Plugins目录下然后重启kcv,如果失败的话右键dll属性看看有个没有个什么什么锁定的 把那个解锁掉再重启kcv
24 |
25 | ### 注意事项
26 |
27 | “AMing.Plugins.Core.dll”为核心组件不可删除
28 |
29 | ### 参考项目
30 |
31 | * [KanColleViewer](https://github.com/Grabacr07/KanColleViewer)
32 |
33 |
34 | #### 许可证
35 |
36 | * MIT License
37 |
38 |
39 |
40 |
41 |
42 | 更新日志
43 |
44 | 1.1
45 |
46 | tab+alt的时候看得到通知窗口的问题
47 |
48 | 1.0 -- 2015.02.04
49 |
50 | 在队伍里面有大破舰娘的时候发出警告,入渠那边没有实时监听好需要回到母港才会生效,下个版本处理 orz因为游戏机制还是因为kcv监听的机制的原因,在推图的时候战斗结束 点击回港或者进击之后才会更新舰队信息,没办法在之前就监听到数据的变化,主动发包请求这种大作死的东西还是想都别想了orz
--------------------------------------------------------------------------------
/KcvPlugins/Warning/Themes/Accents/Red.xaml:
--------------------------------------------------------------------------------
1 |
3 |
4 | #FFFF4141
5 |
7 |
8 | #FFFF6D6D
9 |
11 |
12 | #FFCF1515
13 |
15 |
16 | White
17 |
19 |
20 |
--------------------------------------------------------------------------------
/KcvPlugins/Warning/Views/SettingsControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace AMing.Warning.Views
17 | {
18 | ///
19 | /// SettingsControl.xaml 的交互逻辑
20 | ///
21 | public partial class SettingsControl : UserControl
22 | {
23 | public SettingsControl()
24 | {
25 | InitializeComponent();
26 | }
27 |
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/KcvPlugins/Warning/Views/StatusWindow.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/KcvPlugins/Warning/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/KcvPlugins/Warning/memo.txt:
--------------------------------------------------------------------------------
1 | 四队 可以单独设置是否显示
2 | 可以设置显示级别 大破才提醒 或者中破就提醒
3 |
4 | 无需监听 ship 的HP状态 因为kcv每次刷新都是更新整个 ships 列表 所以值都是新的 监听不到变化,只需要在fleet 里面监听 ships 属性变化
5 |
6 | 可以设置 开启关闭右下角大破状态窗口, 可选 第一二三四舰队大破监听,忽略入渠中的大破舰娘
--------------------------------------------------------------------------------
/KcvPlugins/Warning/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/KcvPlugins/WindowsNotifierForWin7/Enums/ToastType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace AMing.WindowsNotifierEx.Enums
8 | {
9 | public enum ToastType
10 | {
11 | Notification = 0,
12 | Warning = 1,
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/KcvPlugins/WindowsNotifierForWin7/Modules/InitModules.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace AMing.WindowsNotifierEx.Modules
8 | {
9 | public class InitModules : AMing.Plugins.Core.Modules.InitModules
10 | {
11 | public override void SetModules()
12 | {
13 | base.SetModules();
14 |
15 | ModulesList.Add(Modules.NotifierModules.Current);
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/KcvPlugins/WindowsNotifierForWin7/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过以下
6 | // 特性集控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("WindowsNotifierForWin7")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("WindowsNotifierForWin7")]
13 | [assembly: AssemblyCopyright("Copyright © 2015")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("8496370f-e9ea-4f21-9588-a0f040495fcd")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 生成号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.3.*")]
36 | [assembly: AssemblyFileVersion("1.3.*")]
37 |
--------------------------------------------------------------------------------
/KcvPlugins/WindowsNotifierForWin7/Readme.WindowsNotifierEx.txt:
--------------------------------------------------------------------------------
1 | author/developer :AMing
2 | website:http://kcvp.logs.moe/
3 | Github:https://github.com/AMMing
4 | SourceCode:https://github.com/AMMing/KcvPlugins
5 |
6 |
7 |
8 |
9 | ##提督很忙的拓展插件(KanColleViewer Plugins)
10 | ==========
11 |
12 | KanColleViewer 在3.0版本之后增加了插件功能,可以通过添加插件完善kcv的功能。
13 |
14 | 本插件在只kcv3.4下测试,其他旧版本理论上可以,不过没有测试,使用时最好是用最新的kcv。
15 |
16 |
17 | ### 主要功能
18 |
19 | * 适用不同情况下的信息通知效果,可以在win7下实现win8的通知效果,当然win8 win8.1这些也可以用,不过使用的时候需要将kcv的通知插件“WindowsNotifier.dll”去掉,否则就重复通知了。
20 |
21 | ### 使用方法
22 |
23 | 将解压出来的dll放到kcv的Plugins目录下然后重启kcv,如果失败的话右键dll属性看看有个没有个什么什么锁定的 把那个解锁掉再重启kcv
24 |
25 | ### 注意事项
26 |
27 | “AMing.Plugins.Core.dll”为核心组件不可删除
28 |
29 | ### 参考项目
30 |
31 | * [KanColleViewer](https://github.com/Grabacr07/KanColleViewer)
32 |
33 |
34 | #### 许可证
35 |
36 | * MIT License
37 |
38 |
39 |
40 |
41 |
42 | 更新日志
43 |
44 | 1.3
45 |
46 | tab+alt的时候看得到通知窗口的问题,通知的背景颜色根据kcv的主题色改变
47 |
48 |
49 | 1.2 -- 2015.02.03
50 |
51 | 修复某些桌面下通知窗口的位置不对的bug,调用core模块实现接收其他插件发出的通知,添加警告样式
52 |
53 |
54 | 1.1 -- 2015.01.19
55 |
56 | 点击通知信息会隐藏信息并激活kcv
57 |
58 |
59 | 1.0 -- 2015.01.18
60 |
61 | 在win7下模仿win8的通知效果 没有声音,打算分开成另一个插件
--------------------------------------------------------------------------------
/KcvPlugins/WindowsNotifierForWin7/ToastMessage.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace AMing.WindowsNotifierEx
8 | {
9 | public struct ToastMessage
10 | {
11 | public string Title { get; set; }
12 | public string Content { get; set; }
13 | public Enums.ToastType Type { get; set; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/KcvPlugins/WindowsNotifierForWin7/ToastWindow.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/KcvPlugins/WindowsNotifierForWin7/WindowsNotifier.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel.Composition;
4 | using System.Linq;
5 | using System.Reflection;
6 | using System.Threading.Tasks;
7 | using Grabacr07.KanColleViewer.Composition;
8 | using System.Windows;
9 |
10 | namespace AMing.WindowsNotifierEx
11 | {
12 | [Export(typeof(INotifier))]
13 | [ExportMetadata("Title", "WindowsNotifier Extensions")]
14 | [ExportMetadata("Description", "适用不同情况下的信息通知效果")]
15 | [ExportMetadata("Version", "1.2")]
16 | [ExportMetadata("Author", "@AMing")]
17 | public class WindowsNotifier : INotifier
18 | {
19 | Modules.InitModules initModules;
20 | public void Initialize()
21 | {
22 | initModules = new Modules.InitModules();
23 | initModules.Initialize();
24 | }
25 |
26 | public void Show(NotifyType type, string header, string body, Action activated, Action failed = null)
27 | {
28 | Modules.NotifierModules.Current.Notify(header, body, activated, failed);
29 | }
30 |
31 | public object GetSettingsView()
32 | {
33 | return null;
34 | }
35 | public void Dispose()
36 | {
37 | }
38 |
39 | }
40 | }
--------------------------------------------------------------------------------
/KcvPlugins/WindowsNotifierForWin7/memo.txt:
--------------------------------------------------------------------------------
1 | 一个列表放三个toast控件 通知队列加入新消息的时候从第一个开始检查是否在显示信息中,如果正在使用就往下检查,如果全部都在使用就挂起消息,当通知控件手动关闭或者自动关闭的时候去 消息队列获取最新的消息如果有信息消息就继续重新显示没有就闲置
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 AMMing
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ##提督很忙的拓展插件([KanColleViewer Plugins](http://kcvp.logs.moe))
2 |
3 | KanColleViewer 在3.0版本之后增加了插件功能,可以通过添加插件完善kcv的功能。
4 |
5 | 本插件在只kcv3.4及3.5下测试,其他旧版本理论上可以,不过没有测试,使用时最好是用最新的kcv。
6 |
7 |
8 | ###主要功能
9 |
10 | SettingsExtensions
11 |
12 | * 添加到系统托盘
13 | * 最小化时隐藏任务栏上的kcv
14 | * 退出kcv时提示
15 | * 更换kcv窗体主题
16 | * 设置kcv的工具面板位置
17 | * 肝船用的迷你小窗口(新样式)
18 | * 迷你小窗口添加鼠标穿透模式(幽灵模式)
19 | * 热键(老板键,开关声音,快速截图)等按键设置
20 |
21 | WindowsNotifierEx
22 |
23 | * 适用不同情况下的信息通知效果,可以在win7下实现win8的通知效果,当然win8 win8.1这些也可以用,不过使用的时候需要将kcv的通知插件“WindowsNotifier.dll”去掉,否则就重复通知了。
24 |
25 | SoundNotifier
26 |
27 | * 有通知的时候发出声音提示
28 |
29 | Warning
30 |
31 | * 在队伍里面有大破舰娘的时候发出警告,可以结合“SoundNotifier”和“WindowsNotifierEx”达到更醒目的提示。
32 |
33 | DebugExtensions
34 |
35 | * 调试用,弹出异常信息
36 |
37 | ### 使用方法
38 |
39 | * 将解压出来的dll放到kcv的Plugins目录下然后重启kcv,如果失败的话右键dll属性看看有个没有个什么什么锁定的 把那个解锁掉再重启kcv
40 |
41 | ### 注意事项
42 |
43 | * “AMing.Plugins.Core.dll”为核心组件不可删除
44 | * 本插件除了kcv自带的插件之外不保证跟其他第三的插件兼容,混合使用时请注意
45 |
46 | ### 更新主页
47 |
48 | * [http://kcvp.logs.moe](http://kcvp.logs.moe)
49 |
50 | ### 参考项目
51 |
52 | * [KanColleViewer](https://github.com/Grabacr07/KanColleViewer)
53 |
54 | ### 引用项目
55 |
56 | * [KanColleViewer](https://github.com/Grabacr07/KanColleViewer)
57 | * [Reactive Extensions](http://rx.codeplex.com/)
58 | * [Livet](http://ugaya40.net/livet)
59 | * [DynamicJson](http://dynamicjson.codeplex.com/)
60 |
61 | ### SVG Icons 素材
62 |
63 | * [http://raphaeljs.com/icons](http://raphaeljs.com/icons)
64 | * [http://thenounproject.com](http://thenounproject.com)
65 |
66 |
67 | #### 许可证
68 |
69 | * MIT License
70 |
--------------------------------------------------------------------------------