diff --git a/ElectronicObserver/Data/ShipDataMaster.cs b/ElectronicObserver/Data/ShipDataMaster.cs
index c856f1689..9db1fbfe4 100644
--- a/ElectronicObserver/Data/ShipDataMaster.cs
+++ b/ElectronicObserver/Data/ShipDataMaster.cs
@@ -3,6 +3,7 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
+using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -564,36 +565,6 @@ public bool IsAbyssalShip {
get { return ShipID > 1500; }
}
- ///
- /// 深海棲艦のクラス
- /// 0=その他, 1=通常, 2=elite, 3=flagship, 4=改flagship|後期型, 5=後期型elite, 6=後期型flagship
- ///
- public int AbyssalShipClass {
- get {
- if ( !IsAbyssalShip )
- return 0;
-
- else if ( Name.Contains( "後期型" ) ) {
- if ( NameReading == "flagship" )
- return 6;
- else if ( NameReading == "elite" )
- return 5;
- else
- return 4;
-
- } else if ( Name.Contains( "改" ) && NameReading == "flagship" )
- return 4;
- else if ( NameReading == "flagship" )
- return 3;
- else if ( NameReading == "elite" )
- return 2;
- else if ( NameReading == "" ||
- NameReading == "-" )
- return 1;
- else
- return 0;
- }
- }
///
/// クラスも含めた艦名
@@ -651,6 +622,62 @@ private ShipParameterRecord.ShipParameterElement GetParameterElement() {
+ private static readonly Color[] ShipNameColors = new Color[] {
+ Color.FromArgb( 0x00, 0x00, 0x00 ),
+ Color.FromArgb( 0xFF, 0x00, 0x00 ),
+ Color.FromArgb( 0xFF, 0x88, 0x00 ),
+ Color.FromArgb( 0x00, 0x66, 0x00 ),
+ Color.FromArgb( 0x88, 0x00, 0x00 ),
+ Color.FromArgb( 0x00, 0x88, 0xFF ),
+ Color.FromArgb( 0x00, 0x00, 0xFF ),
+ };
+
+ public Color GetShipNameColor() {
+
+ if ( !IsAbyssalShip ) {
+ return SystemColors.ControlText;
+ }
+
+ bool isLateModel = Name.Contains( "後期型" );
+ bool isRemodeled = Name.Contains( "改" );
+ bool isDestroyed = Name.EndsWith( "-壊" );
+ bool isDemon = Name.EndsWith( "鬼" );
+ bool isPrincess = Name.EndsWith( "姫" );
+ bool isWaterDemon = Name.EndsWith( "水鬼" );
+ bool isWaterPrincess = Name.EndsWith( "水姫" );
+ bool isElite = NameReading == "elite";
+ bool isFlagship = NameReading == "flagship";
+
+
+ if ( isDestroyed )
+ return Color.FromArgb( 0xFF, 0x00, 0xFF );
+
+ else if ( isWaterPrincess )
+ return ShipNameColors[6];
+ else if ( isWaterDemon )
+ return ShipNameColors[5];
+ else if ( isPrincess )
+ return ShipNameColors[4];
+ else if ( isDemon )
+ return ShipNameColors[3];
+ else {
+
+ int tier;
+
+ if ( isFlagship )
+ tier = 2;
+ else if ( isElite )
+ tier = 1;
+ else
+ tier = 0;
+
+ if ( isLateModel || isRemodeled )
+ tier += 3;
+
+ return ShipNameColors[tier];
+ }
+ }
+
public ShipDataMaster() {
RemodelBeforeShipID = 0;
diff --git a/ElectronicObserver/ElectronicObserver.csproj b/ElectronicObserver/ElectronicObserver.csproj
index b11e03f42..a946a5a69 100644
--- a/ElectronicObserver/ElectronicObserver.csproj
+++ b/ElectronicObserver/ElectronicObserver.csproj
@@ -218,6 +218,7 @@
+
diff --git a/ElectronicObserver/Other/Information/apilist.txt b/ElectronicObserver/Other/Information/apilist.txt
index 4eb260b95..a71d32e91 100644
--- a/ElectronicObserver/Other/Information/apilist.txt
+++ b/ElectronicObserver/Other/Information/apilist.txt
@@ -154,7 +154,7 @@ api_start2 :艦娘・装備固有データその他
api_id :カテゴリID(艦船のstypeに対応)
api_sortno :並べ替え順
api_name :艦種名(英語は図鑑内での表示)
- 1=海防艦 Escort Ship
+ 1=海防艦 Escort
2=駆逐艦 Destroyer
3=軽巡洋艦 Light Cruiser
4=重雷装巡洋艦 Torpedo Cruiser
diff --git a/ElectronicObserver/Resource/SwfHelper.cs b/ElectronicObserver/Resource/SwfHelper.cs
new file mode 100644
index 000000000..f595ada42
--- /dev/null
+++ b/ElectronicObserver/Resource/SwfHelper.cs
@@ -0,0 +1,101 @@
+using SwfExtractor;
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ElectronicObserver.Resource {
+
+
+ public static class SwfHelper {
+
+ // 各種画像リソースのサイズ
+ public static readonly Size ShipBannerSize = new Size( 160, 40 );
+ public static readonly Size ShipCardSize = new Size( 218, 300 );
+ public static readonly Size ShipCutinSize = new Size( 665, 121 );
+ public static readonly Size ShipNameSize = new Size( 436, 63 );
+ public static readonly Size ShipSupplySize = new Size( 474, 47 );
+
+ ///
+ /// 各種画像リソースの CharacterID
+ ///
+ public enum ShipResourceCharacterID {
+ BannerNormal = 1,
+ BannerDamaged = 3,
+ CardNormal = 5,
+ CardDamaged = 7,
+ CutinNormal = 21,
+ CutinDamaged = 23,
+ Name = 25,
+ SupplyNormal = 27,
+ SupplyDamaged = 29,
+ }
+
+
+ ///
+ /// 現在使用可能な画像リソースファイルへのパスを取得します。
+ ///
+ public static string GetResourcePath( string relativePath, string resourceName ) {
+ return Directory.GetFiles( Utility.Configuration.Config.Connection.SaveDataPath + @"\" + relativePath, "*.swf", System.IO.SearchOption.TopDirectoryOnly )
+ .Where( path => path.Contains( resourceName ) ).LastOrDefault();
+ }
+
+ ///
+ /// 現在使用可能な艦船画像リソースファイルへのパスを取得します。
+ ///
+ public static string GetShipResourcePath( string resourceName ) {
+ return GetResourcePath( @"resources\swf\ships\", resourceName );
+ }
+
+
+ ///
+ /// 艦船画像リソースファイルが存在するかを調べます。
+ ///
+ public static bool HasShipSwfImage( string resourceName ) {
+ return GetShipResourcePath( resourceName ) != null;
+ }
+
+
+ ///
+ /// 艦船画像を swf ファイルから読み込みます。
+ ///
+ /// 艦船のリソース名(ファイル名)。
+ /// 描画する画像の CharacterID 。
+ /// 成功した場合は対象の Bitmap オブジェクト、失敗した場合は null を返します。
+ public static Bitmap GetShipSwfImage( string resourceName, int characterID ) {
+ try {
+
+ string shipSwfPath = GetShipResourcePath( resourceName );
+
+ if ( shipSwfPath != null ) {
+
+ var shipSwf = new SwfParser();
+ shipSwf.Parse( shipSwfPath );
+
+ var imgtag = shipSwf.FindTags().FirstOrDefault( t => t.CharacterID == characterID );
+ return imgtag.ExtractImage();
+ }
+
+ return null;
+ } catch ( Exception ) {
+ return null;
+ }
+ }
+
+ ///
+ /// 艦船画像を swf ファイルから読み込みます。
+ ///
+ /// 艦船のリソース名(ファイル名)。
+ /// 描画する画像の CharacterID 。
+ /// 成功した場合は対象の Bitmap オブジェクト、失敗した場合は null を返します。
+ public static Bitmap GetShipSwfImage( string resourceName, ShipResourceCharacterID characterID ) {
+ return GetShipSwfImage( resourceName, (int)characterID );
+ }
+
+
+ }
+
+}
diff --git a/ElectronicObserver/Utility/Data/Calculator.cs b/ElectronicObserver/Utility/Data/Calculator.cs
index 6e6b89590..6c29046ea 100644
--- a/ElectronicObserver/Utility/Data/Calculator.cs
+++ b/ElectronicObserver/Utility/Data/Calculator.cs
@@ -1484,6 +1484,7 @@ public static bool IsAircraft( int equipmentID, bool containsRecon, bool contain
public static bool CanAttackSubmarine( ShipData ship ) {
switch ( ship.MasterShip.ShipType ) {
+ case 1: //海防
case 2: //駆逐
case 3: //軽巡
case 4: //雷巡
diff --git a/ElectronicObserver/Utility/FleetImageGenerator.cs b/ElectronicObserver/Utility/FleetImageGenerator.cs
index d487b2c34..103e4225f 100644
--- a/ElectronicObserver/Utility/FleetImageGenerator.cs
+++ b/ElectronicObserver/Utility/FleetImageGenerator.cs
@@ -23,28 +23,10 @@ public class FleetImageGenerator {
protected static readonly Size MaxValueSize = new Size( int.MaxValue, int.MaxValue );
// 各種画像リソースのサイズ
- protected static readonly Size ShipBannerSize = new Size( 160, 40 );
- protected static readonly Size ShipCardSize = new Size( 218, 300 );
- protected static readonly Size ShipCutinSize = new Size( 665, 121 );
- protected static readonly Size ShipNameSize = new Size( 436, 63 );
- protected static readonly Size ShipSupplySize = new Size( 474, 47 );
-
protected static readonly Size EquipmentCardSize = new Size( 260, 260 );
protected static readonly Size EquipmentIconSize = new Size( 16, 16 );
- // 各種画像リソースの CharacterID
- protected static readonly int ShipBannerNormalID = 1;
- protected static readonly int ShipBannerDamagedID = 3;
- protected static readonly int ShipCardNormalID = 5;
- protected static readonly int ShipCardDamagedID = 7;
- protected static readonly int ShipCutinNormalID = 21;
- protected static readonly int ShipCutinDamagedID = 23;
- protected static readonly int ShipNameID = 25;
- protected static readonly int ShipSupplyNormalID = 27;
- protected static readonly int ShipSupplyDamagedID = 29;
-
-
private FleetImageGenerator() { }
@@ -126,7 +108,7 @@ public static Bitmap GenerateCardBitmap( FleetImageArgument args ) {
Size parameterAreaSize = new Size( parameterAreaUnitSize.Width * 2, parameterAreaUnitSize.Height * 6 ) + parameterAreaInnerMargin;
Size shipValuePaneSize = MaxWidthSumHeight( shipNameAreaSize + shipNameAreaMargin.Size, equipmentAreaSize + equipmentAreaMargin.Size, parameterAreaSize + parameterAreaMargin.Size );
- Size shipImagePaneSize = ShipCardSize;
+ Size shipImagePaneSize = SwfHelper.ShipCardSize;
Size shipPaneUnitSize = SumWidthMaxHeight( shipValuePaneSize, shipImagePaneSize );
Size shipPaneSize = new Size(
( shipPaneUnitSize.Width + shipPaneUnitMargin.Horizontal ) * Math.Min( args.HorizontalShipCount, 6 ),
@@ -371,7 +353,7 @@ public static Bitmap GenerateCardBitmap( FleetImageArgument args ) {
// ship image
shipPointer.X = shipPointerOrigin.X + shipValuePaneSize.Width;
shipPointer.Y = shipPointerOrigin.Y;
- DrawShipSwfImage( g, ship.MasterShip.ResourceName, args.ReflectDamageGraphic && ship.HPRate <= 0.5 ? ShipCardDamagedID : ShipCardNormalID, shipPointer.X, shipPointer.Y, ShipCardSize );
+ DrawShipSwfImage( g, ship.MasterShip.ResourceName, args.ReflectDamageGraphic && ship.HPRate <= 0.5 ? SwfHelper.ShipResourceCharacterID.CardDamaged : SwfHelper.ShipResourceCharacterID.CardNormal, shipPointer.X, shipPointer.Y, SwfHelper.ShipCardSize );
}
}
@@ -470,7 +452,7 @@ public static Bitmap GenerateCutinBitmap( FleetImageArgument args ) {
Size smallDigit3Size = MeasureString( preg, "888", args.SmallDigitFont, MaxValueSize, formatMiddleRight );
Size levelSize = MeasureString( preg, "Lv.", args.SmallDigitFont, MaxValueSize, formatMiddleLeft );
Size equipmentLevelSize = MeasureString( preg, "+10", args.SmallDigitFont, MaxValueSize, formatMiddleRight );
- Rectangle shipNameImageAvailableArea = new Rectangle( 100, 0, ShipNameSize.Width - 124, ShipNameSize.Height - 16 );
+ Rectangle shipNameImageAvailableArea = new Rectangle( 100, 0, SwfHelper.ShipNameSize.Width - 124, SwfHelper.ShipNameSize.Height - 16 );
Size fleetParameterAreaInnerMargin = new Size( 16, 0 );
Padding shipNameAreaMargin = new Padding( 0, 0, 0, 2 );
@@ -491,8 +473,8 @@ public static Bitmap GenerateCutinBitmap( FleetImageArgument args ) {
Size equipmentAreaUnitSize = SumWidthMaxHeight( smallDigit3Size, EquipmentIconSize, equipmentNameSize, equipmentLevelSize );
Size equipmentAreaSize = new Size( ( equipmentAreaUnitSize.Width + equipmentAreaUnitMargin.Horizontal ), ( equipmentAreaUnitSize.Height + equipmentAreaUnitMargin.Vertical ) * slotCount );
- Size shipPaneUnitSize = new Size( Max( shipNameAreaSize.Width + equipmentAreaSize.Width, ShipCutinSize.Width ),
- Max( shipNameAreaSize.Height + ShipCutinSize.Height, equipmentAreaSize.Height ) ); // SumWidthMaxHeight( MaxWidthSumHeight( shipNameAreaSize, ShipCutinSize ), equipmentAreaSize + equipmentAreaMargin.Size );
+ Size shipPaneUnitSize = new Size( Max( shipNameAreaSize.Width + equipmentAreaSize.Width, SwfHelper.ShipCutinSize.Width ),
+ Max( shipNameAreaSize.Height + SwfHelper.ShipCutinSize.Height, equipmentAreaSize.Height ) ); // SumWidthMaxHeight( MaxWidthSumHeight( shipNameAreaSize, ShipCutinSize ), equipmentAreaSize + equipmentAreaMargin.Size );
Size shipPaneSize = new Size(
( shipPaneUnitSize.Width + shipPaneUnitMargin.Horizontal ) * Math.Min( args.HorizontalShipCount, 6 ),
( shipPaneUnitSize.Height + shipPaneUnitMargin.Vertical ) * (int)Math.Ceiling( 6.0 / args.HorizontalShipCount ) );
@@ -528,10 +510,10 @@ public static Bitmap GenerateCutinBitmap( FleetImageArgument args ) {
}
equipmentNameBrush.GammaCorrection = true;
- var shipImageMaskBrush = new LinearGradientBrush( new Rectangle( 0, 0, ShipCutinSize.Width, ShipCutinSize.Height ), Color.Black, Color.Black, LinearGradientMode.Horizontal );
+ var shipImageMaskBrush = new LinearGradientBrush( new Rectangle( 0, 0, SwfHelper.ShipCutinSize.Width, SwfHelper.ShipCutinSize.Height ), Color.Black, Color.Black, LinearGradientMode.Horizontal );
{
var blend = new ColorBlend();
- blend.Positions = new[] { 0f, Math.Min( (float)( shipPaneUnitSize.Width - equipmentAreaSize.Width - 16 ) / ShipCutinSize.Width, 1f ), Math.Min( (float)( shipPaneUnitSize.Width - equipmentAreaSize.Width + 16 ) / ShipCutinSize.Width, 1f ), 1f };
+ blend.Positions = new[] { 0f, Math.Min( (float)( shipPaneUnitSize.Width - equipmentAreaSize.Width - 16 ) / SwfHelper.ShipCutinSize.Width, 1f ), Math.Min( (float)( shipPaneUnitSize.Width - equipmentAreaSize.Width + 16 ) / SwfHelper.ShipCutinSize.Width, 1f ), 1f };
blend.Colors = new[] { Color.White, Color.White, Color.FromArgb( 0xff, 0x11, 0x11, 0x11 ), Color.FromArgb( 0xff, 0x11, 0x11, 0x11 ) };
shipImageMaskBrush.InterpolationColors = blend;
}
@@ -638,7 +620,7 @@ public static Bitmap GenerateCutinBitmap( FleetImageArgument args ) {
g.DrawString( string.Format( "#{0}:", shipIndex + 1 ), args.MediumDigitFont, subTextBrush, new Rectangle( shipPointer + GetAlignmentOffset( ContentAlignment.MiddleLeft, shipIndexSize, shipNameAreaSize ), shipIndexSize ), formatMiddleLeft );
shipPointer.X += shipIndexSize.Width;
- using ( var shipNameImage = GetShipSwfImage( ship.MasterShip.ResourceName, ShipNameID ) ) {
+ using ( var shipNameImage = SwfHelper.GetShipSwfImage( ship.MasterShip.ResourceName, SwfHelper.ShipResourceCharacterID.Name ) ) {
if ( shipNameImage != null ) {
g.DrawImage( shipNameImage, new Rectangle( shipPointer + GetAlignmentOffset( ContentAlignment.MiddleLeft, shipNameSize, shipNameAreaSize ), shipNameSize ),
shipNameImageAvailableArea, GraphicsUnit.Pixel );
@@ -665,10 +647,10 @@ public static Bitmap GenerateCutinBitmap( FleetImageArgument args ) {
shipPointer.X = shipPointerOrigin.X;
- using ( var shipImageOriginal = GetShipSwfImage( ship.MasterShip.ResourceName, args.ReflectDamageGraphic && ship.HPRate <= 0.5 ? ShipCutinDamagedID : ShipCutinNormalID ) ) {
+ using ( var shipImageOriginal = SwfHelper.GetShipSwfImage( ship.MasterShip.ResourceName, args.ReflectDamageGraphic && ship.HPRate <= 0.5 ? SwfHelper.ShipResourceCharacterID.CutinDamaged : SwfHelper.ShipResourceCharacterID.CutinNormal ) ) {
if ( shipImageOriginal != null ) {
using ( var shipImage = shipImageOriginal.Clone( new Rectangle( 0, 0, shipImageOriginal.Width, shipImageOriginal.Height ), PixelFormat.Format32bppArgb ) ) {
- using ( var maskImage = new Bitmap( ShipCutinSize.Width, ShipCutinSize.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb ) ) { // move to top
+ using ( var maskImage = new Bitmap( SwfHelper.ShipCutinSize.Width, SwfHelper.ShipCutinSize.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb ) ) { // move to top
using ( var maskg = Graphics.FromImage( maskImage ) ) {
maskg.Clear( Color.Black );
maskg.FillRectangle( shipImageMaskBrush, new Rectangle( 0, 0, maskImage.Width, maskImage.Height ) );
@@ -695,8 +677,8 @@ public static Bitmap GenerateCutinBitmap( FleetImageArgument args ) {
}
- var shipOffset = GetAlignmentOffset( ContentAlignment.BottomLeft, ShipCutinSize, shipPaneUnitSize );
- g.DrawImage( shipImage, shipPointer.X + shipOffset.Width, shipPointer.Y + shipOffset.Height, ShipCutinSize.Width, ShipCutinSize.Height );
+ var shipOffset = GetAlignmentOffset( ContentAlignment.BottomLeft, SwfHelper.ShipCutinSize, shipPaneUnitSize );
+ g.DrawImage( shipImage, shipPointer.X + shipOffset.Width, shipPointer.Y + shipOffset.Height, SwfHelper.ShipCutinSize.Width, SwfHelper.ShipCutinSize.Height );
}
}
@@ -884,8 +866,8 @@ public static Bitmap GenerateBannerBitmap( FleetImageArgument args ) {
Padding entireMargin = new Padding();
int lineMargin = 4;
- Size shipBannerSize = ShipBannerSize;
- Size shipNameAreaSize = SumWidthMaxHeight( ShipBannerSize, MaxWidthSumHeight( SumWidthMaxHeight( levelSize, smallDigit3Size ), SumWidthMaxHeight( EquipmentIconSize, smallDigit3Size ) ) );
+ Size shipBannerSize = SwfHelper.ShipBannerSize;
+ Size shipNameAreaSize = SumWidthMaxHeight( SwfHelper.ShipBannerSize, MaxWidthSumHeight( SumWidthMaxHeight( levelSize, smallDigit3Size ), SumWidthMaxHeight( EquipmentIconSize, smallDigit3Size ) ) );
Size equipmentAreaUnitSize = SumWidthMaxHeight( EquipmentIconSize, equipmentNameSize, equipmentLevelSize );
Size equipmentAreaSize = new Size( equipmentAreaUnitSize.Width + equipmentAreaUnitMargin.Horizontal, ( equipmentAreaUnitSize.Height + equipmentAreaUnitMargin.Vertical ) * slotCount );
@@ -1030,9 +1012,9 @@ public static Bitmap GenerateBannerBitmap( FleetImageArgument args ) {
//g.DrawString( string.Format( "#{0}:", shipIndex + 1 ), args.MediumDigitFont, subTextBrush, new Rectangle( shipPointer + GetAlignmentOffset( ContentAlignment.MiddleLeft, shipIndexSize, shipNameAreaSize ), shipIndexSize ), formatMiddleLeft );
//shipPointer.X += shipIndexSize.Width;
- if ( !DrawShipSwfImage( g, ship.MasterShip.ResourceName, args.ReflectDamageGraphic && ship.HPRate <= 0.5 ? ShipBannerDamagedID : ShipBannerNormalID, shipPointer.X, shipPointer.Y, ShipBannerSize ) ) {
+ if ( !DrawShipSwfImage( g, ship.MasterShip.ResourceName, args.ReflectDamageGraphic && ship.HPRate <= 0.5 ? SwfHelper.ShipResourceCharacterID.BannerDamaged : SwfHelper.ShipResourceCharacterID.BannerNormal, shipPointer.X, shipPointer.Y, SwfHelper.ShipBannerSize ) ) {
// alternate drawing
- g.DrawString( ship.Name, args.MediumFont, mainTextBrush, new RectangleF( shipPointer.X, shipPointer.Y, ShipBannerSize.Width, ShipBannerSize.Height ), formatTopLeft );
+ g.DrawString( ship.Name, args.MediumFont, mainTextBrush, new RectangleF( shipPointer.X, shipPointer.Y, SwfHelper.ShipBannerSize.Width, SwfHelper.ShipBannerSize.Height ), formatTopLeft );
}
shipPointer.X += shipBannerSize.Width;
@@ -1098,7 +1080,7 @@ public static Bitmap GenerateBannerBitmap( FleetImageArgument args ) {
if ( eq != null ) {
if ( eq.Level > 0 ) {
var currentEquipmentNameSize = MeasureString( g, equipmentName, args.SmallFont, MaxValueSize, formatMiddleLeft );
- equipmentPointer.X += currentEquipmentNameSize.Width;
+ equipmentPointer.X += Math.Min( currentEquipmentNameSize.Width, equipmentNameSize.Width );
g.DrawString( "+" + eq.Level, args.SmallDigitFont, subTextBrush, new Rectangle( equipmentPointer + GetAlignmentOffset( ContentAlignment.MiddleLeft, equipmentLevelSize, equipmentAreaUnitSize ), equipmentLevelSize ), formatMiddleRight );
}
@@ -1280,9 +1262,9 @@ public ShipParameterData( ResourceManager.IconContent iconIndex, string name, Fu
/// 描画先の Y 座標。
/// 描画する画像のサイズ。
/// 描画に成功したかを返します。ファイルが存在しない場合などには false が返ります。
- protected static bool DrawShipSwfImage( Graphics g, string resourceID, int characterID, int x, int y, Size size ) {
+ protected static bool DrawShipSwfImage( Graphics g, string resourceID, SwfHelper.ShipResourceCharacterID characterID, int x, int y, Size size ) {
try {
- using ( var shipImage = GetShipSwfImage( resourceID, characterID ) ) {
+ using ( var shipImage = SwfHelper.GetShipSwfImage( resourceID, characterID ) ) {
if ( shipImage == null )
return false;
@@ -1295,33 +1277,6 @@ protected static bool DrawShipSwfImage( Graphics g, string resourceID, int chara
}
}
- ///
- /// 艦船画像を swf ファイルから読み込みます。
- ///
- /// 艦船のリソース名(ファイル名)。
- /// 描画する画像の CharacterID 。
- /// 成功した場合は対象の Bitmap オブジェクト、失敗した場合は null を返します。
- protected static Bitmap GetShipSwfImage( string resourceID, int characterID ) {
- try {
-
- string shipSwfPath = System.IO.Directory.GetFiles( Utility.Configuration.Config.Connection.SaveDataPath + @"\resources\swf\ships\", "*.swf", System.IO.SearchOption.TopDirectoryOnly )
- .Where( path => path.Contains( resourceID ) ).LastOrDefault();
-
- if ( shipSwfPath != null ) {
-
- var shipSwf = new SwfParser();
- shipSwf.Parse( shipSwfPath );
-
- var imgtag = shipSwf.FindTags().FirstOrDefault( t => t.CharacterID == characterID );
- return imgtag.ExtractImage();
- }
-
- return null;
- } catch ( Exception ) {
- return null;
- }
- }
-
///
/// 矩形範囲にコントロールを配置した際の座標を求めます。
diff --git a/ElectronicObserver/Utility/SoftwareInformation.cs b/ElectronicObserver/Utility/SoftwareInformation.cs
index 98ddea4a9..44844d66d 100644
--- a/ElectronicObserver/Utility/SoftwareInformation.cs
+++ b/ElectronicObserver/Utility/SoftwareInformation.cs
@@ -35,7 +35,7 @@ public static string SoftwareNameEnglish {
///
public static string VersionJapanese {
get {
- return SoftwareNameJapanese + "二六型改";
+ return SoftwareNameJapanese + "二六型改二";
}
}
@@ -44,7 +44,7 @@ public static string VersionJapanese {
///
public static string VersionEnglish {
get {
- return "2.6.1";
+ return "2.6.2";
}
}
@@ -54,7 +54,7 @@ public static string VersionEnglish {
///
public static DateTime UpdateTime {
get {
- return DateTimeHelper.CSVStringToTime( "2017/05/05 21:00:00" );
+ return DateTimeHelper.CSVStringToTime( "2017/05/07 23:00:00" );
}
}
diff --git a/ElectronicObserver/Window/Dialog/DialogAlbumMasterShip.Designer.cs b/ElectronicObserver/Window/Dialog/DialogAlbumMasterShip.Designer.cs
index 4d3f7b670..13a43967d 100644
--- a/ElectronicObserver/Window/Dialog/DialogAlbumMasterShip.Designer.cs
+++ b/ElectronicObserver/Window/Dialog/DialogAlbumMasterShip.Designer.cs
@@ -24,8 +24,8 @@ protected override void Dispose( bool disposing ) {
///
private void InitializeComponent() {
this.components = new System.ComponentModel.Container();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.StripMenu_File = new System.Windows.Forms.ToolStripMenuItem();
this.StripMenu_File_OutputCSVUser = new System.Windows.Forms.ToolStripMenuItem();
@@ -148,10 +148,11 @@ private void InitializeComponent() {
this.ASWSeparater = new ElectronicObserver.Window.Control.ImageLabel();
this.ASWLevel = new ElectronicObserver.Window.Control.ImageLabel();
this.EvasionMin = new ElectronicObserver.Window.Control.ImageLabel();
- this.pictureBox1 = new System.Windows.Forms.PictureBox();
+ this.ShipBanner = new System.Windows.Forms.PictureBox();
this.ToolTipInfo = new System.Windows.Forms.ToolTip(this.components);
this.LevelTimer = new System.Windows.Forms.Timer(this.components);
this.SaveCSVDialog = new System.Windows.Forms.SaveFileDialog();
+ this.ImageLoader = new System.ComponentModel.BackgroundWorker();
this.menuStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
@@ -168,7 +169,7 @@ private void InitializeComponent() {
this.TableEquipment.SuspendLayout();
this.TableParameterMain.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.ParameterLevel)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.ShipBanner)).BeginInit();
this.SuspendLayout();
//
// menuStrip1
@@ -251,14 +252,14 @@ private void InitializeComponent() {
this.ShipView_ShipID,
this.ShipView_ShipType,
this.ShipView_Name});
- dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
- dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control;
- dataGridViewCellStyle2.Font = new System.Drawing.Font("Meiryo UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
- dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.ControlText;
- dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Control;
- dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.ControlText;
- dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
- this.ShipView.DefaultCellStyle = dataGridViewCellStyle2;
+ dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
+ dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control;
+ dataGridViewCellStyle4.Font = new System.Drawing.Font("Meiryo UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
+ dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.ControlText;
+ dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Control;
+ dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.ControlText;
+ dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
+ this.ShipView.DefaultCellStyle = dataGridViewCellStyle4;
this.ShipView.Dock = System.Windows.Forms.DockStyle.Fill;
this.ShipView.Location = new System.Drawing.Point(0, 0);
this.ShipView.MultiSelect = false;
@@ -276,8 +277,8 @@ private void InitializeComponent() {
// ShipView_ShipID
//
this.ShipView_ShipID.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
- dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
- this.ShipView_ShipID.DefaultCellStyle = dataGridViewCellStyle1;
+ dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
+ this.ShipView_ShipID.DefaultCellStyle = dataGridViewCellStyle3;
this.ShipView_ShipID.HeaderText = "ID";
this.ShipView_ShipID.Name = "ShipView_ShipID";
this.ShipView_ShipID.ReadOnly = true;
@@ -316,7 +317,7 @@ private void InitializeComponent() {
this.BasePanelShipGirl.Controls.Add(this.TableEquipment);
this.BasePanelShipGirl.Controls.Add(this.imageLabel45);
this.BasePanelShipGirl.Controls.Add(this.TableParameterMain);
- this.BasePanelShipGirl.Controls.Add(this.pictureBox1);
+ this.BasePanelShipGirl.Controls.Add(this.ShipBanner);
this.BasePanelShipGirl.Dock = System.Windows.Forms.DockStyle.Fill;
this.BasePanelShipGirl.Location = new System.Drawing.Point(0, 0);
this.BasePanelShipGirl.Name = "BasePanelShipGirl";
@@ -1663,14 +1664,14 @@ private void InitializeComponent() {
this.EvasionMin.Text = "123";
this.EvasionMin.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
- // pictureBox1
+ // ShipBanner
//
- this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.pictureBox1.Location = new System.Drawing.Point(383, 3);
- this.pictureBox1.Name = "pictureBox1";
- this.pictureBox1.Size = new System.Drawing.Size(160, 40);
- this.pictureBox1.TabIndex = 4;
- this.pictureBox1.TabStop = false;
+ this.ShipBanner.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this.ShipBanner.Location = new System.Drawing.Point(383, 3);
+ this.ShipBanner.Name = "ShipBanner";
+ this.ShipBanner.Size = new System.Drawing.Size(160, 40);
+ this.ShipBanner.TabIndex = 4;
+ this.ShipBanner.TabStop = false;
//
// ToolTipInfo
//
@@ -1689,6 +1690,11 @@ private void InitializeComponent() {
this.SaveCSVDialog.Filter = "CSV|*.csv|File|*";
this.SaveCSVDialog.Title = "CSVに出力";
//
+ // ImageLoader
+ //
+ this.ImageLoader.DoWork += new System.ComponentModel.DoWorkEventHandler(this.ImageLoader_DoWork);
+ this.ImageLoader.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.ImageLoader_RunWorkerCompleted);
+ //
// DialogAlbumMasterShip
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@@ -1730,7 +1736,7 @@ private void InitializeComponent() {
this.TableParameterMain.ResumeLayout(false);
this.TableParameterMain.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.ParameterLevel)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.ShipBanner)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
@@ -1742,7 +1748,7 @@ private void InitializeComponent() {
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.DataGridView ShipView;
private System.Windows.Forms.Panel BasePanelShipGirl;
- private System.Windows.Forms.PictureBox pictureBox1;
+ private System.Windows.Forms.PictureBox ShipBanner;
private System.Windows.Forms.TableLayoutPanel TableParameterMain;
private Control.ImageLabel TitleLuck;
private System.Windows.Forms.NumericUpDown ParameterLevel;
@@ -1864,5 +1870,6 @@ private void InitializeComponent() {
private Control.ImageLabel ResourceName;
private System.Windows.Forms.ToolStripMenuItem StripMenu_Edit;
private System.Windows.Forms.ToolStripMenuItem StripMenu_Edit_EditParameter;
+ private System.ComponentModel.BackgroundWorker ImageLoader;
}
}
\ No newline at end of file
diff --git a/ElectronicObserver/Window/Dialog/DialogAlbumMasterShip.cs b/ElectronicObserver/Window/Dialog/DialogAlbumMasterShip.cs
index 49ac8676d..2bdb66eb4 100644
--- a/ElectronicObserver/Window/Dialog/DialogAlbumMasterShip.cs
+++ b/ElectronicObserver/Window/Dialog/DialogAlbumMasterShip.cs
@@ -24,6 +24,8 @@ public partial class DialogAlbumMasterShip : Form {
private ImageLabel[] Aircrafts;
private ImageLabel[] Equipments;
+ private int loadingResourceShipID;
+
public DialogAlbumMasterShip() {
InitializeComponent();
@@ -31,6 +33,7 @@ public DialogAlbumMasterShip() {
Aircrafts = new ImageLabel[] { Aircraft1, Aircraft2, Aircraft3, Aircraft4, Aircraft5 };
Equipments = new ImageLabel[] { Equipment1, Equipment2, Equipment3, Equipment4, Equipment5 };
+ loadingResourceShipID = -1;
TitleHP.ImageList =
TitleFirepower.ImageList =
@@ -269,6 +272,7 @@ private void UpdateAlbumPage( int shipID ) {
ShipType.Text = ship.IsLandBase ? "陸上施設" : db.ShipTypes[ship.ShipType].Name;
ShipName.Text = ship.NameWithClass;
+ ShipName.ForeColor = ship.GetShipNameColor();
ToolTipInfo.SetToolTip( ShipName, !ship.IsAbyssalShip ? ship.NameReading : null );
TableShipName.ResumeLayout();
@@ -555,6 +559,16 @@ private void UpdateAlbumPage( int shipID ) {
}
+ if ( ShipBanner.Image != null ) {
+ var img = ShipBanner.Image;
+ ShipBanner.Image = null;
+ img.Dispose();
+ }
+ if ( !ImageLoader.IsBusy ) {
+ loadingResourceShipID = ship.ShipID;
+ ImageLoader.RunWorkerAsync( ship.ResourceName );
+ }
+
BasePanelShipGirl.ResumeLayout();
@@ -645,6 +659,7 @@ private void LevelTimer_Tick( object sender, EventArgs e ) {
}
+
private void TableParameterMain_CellPaint( object sender, TableLayoutCellPaintEventArgs e ) {
e.Graphics.DrawLine( Pens.Silver, e.CellBounds.X, e.CellBounds.Bottom - 1, e.CellBounds.Right - 1, e.CellBounds.Bottom - 1 );
/*/
@@ -992,6 +1007,54 @@ private void StripMenu_Edit_EditParameter_Click( object sender, EventArgs e ) {
dialog.ShowDialog( this );
UpdateAlbumPage( _shipID );
}
+
+ }
+
+
+
+ private void ImageLoader_DoWork( object sender, DoWorkEventArgs e ) {
+
+ string resourceName = e.Argument as string;
+
+ //System.Threading.Thread.Sleep( 2000 ); // for test
+
+ try {
+
+ e.Result = SwfHelper.GetShipSwfImage( resourceName, SwfHelper.ShipResourceCharacterID.BannerNormal );
+
+ } catch ( Exception ) {
+ e.Result = null;
+ }
+
+ }
+
+ private void ImageLoader_RunWorkerCompleted( object sender, RunWorkerCompletedEventArgs e ) {
+
+ if ( ShipBanner.Image != null ) {
+ var img = ShipBanner.Image;
+ ShipBanner.Image = null;
+ img.Dispose();
+ }
+
+ if ( loadingResourceShipID != _shipID ) {
+ if ( e.Result != null )
+ ( (Bitmap)e.Result ).Dispose();
+
+ if ( !ImageLoader.IsBusy ) {
+ loadingResourceShipID = _shipID;
+ var ship = KCDatabase.Instance.MasterShips[_shipID];
+ if ( ship != null )
+ ImageLoader.RunWorkerAsync( ship.ResourceName );
+ }
+
+ return;
+ }
+
+ if ( e.Result != null ) {
+ ShipBanner.Image = e.Result as Bitmap;
+ loadingResourceShipID = -1;
+ }
+
}
}
diff --git a/ElectronicObserver/Window/Dialog/DialogAlbumMasterShip.resx b/ElectronicObserver/Window/Dialog/DialogAlbumMasterShip.resx
index ef5e401b3..74eac03ce 100644
--- a/ElectronicObserver/Window/Dialog/DialogAlbumMasterShip.resx
+++ b/ElectronicObserver/Window/Dialog/DialogAlbumMasterShip.resx
@@ -132,10 +132,16 @@
139, 17
+
+ 139, 17
+
259, 17
377, 17
+
+ 520, 17
+
\ No newline at end of file
diff --git a/ElectronicObserver/Window/Dialog/DialogFleetImageGenerator.Designer.cs b/ElectronicObserver/Window/Dialog/DialogFleetImageGenerator.Designer.cs
index 0ff0fb181..231fe9eb0 100644
--- a/ElectronicObserver/Window/Dialog/DialogFleetImageGenerator.Designer.cs
+++ b/ElectronicObserver/Window/Dialog/DialogFleetImageGenerator.Designer.cs
@@ -144,7 +144,7 @@ private void InitializeComponent() {
| System.Windows.Forms.AnchorStyles.Right)));
this.GroupOutputPath.Controls.Add(this.SearchOutputPath);
this.GroupOutputPath.Controls.Add(this.OutputPath);
- this.GroupOutputPath.Location = new System.Drawing.Point(8, 271);
+ this.GroupOutputPath.Location = new System.Drawing.Point(8, 279);
this.GroupOutputPath.Name = "GroupOutputPath";
this.GroupOutputPath.Size = new System.Drawing.Size(440, 57);
this.GroupOutputPath.TabIndex = 10;
@@ -185,7 +185,7 @@ private void InitializeComponent() {
this.groupBox7.Controls.Add(this.Comment);
this.groupBox7.Location = new System.Drawing.Point(8, 127);
this.groupBox7.Name = "groupBox7";
- this.groupBox7.Size = new System.Drawing.Size(440, 138);
+ this.groupBox7.Size = new System.Drawing.Size(440, 146);
this.groupBox7.TabIndex = 9;
this.groupBox7.TabStop = false;
this.groupBox7.Text = "自由入力欄";
@@ -221,6 +221,7 @@ private void InitializeComponent() {
// Comment
//
this.Comment.AcceptsReturn = true;
+ this.Comment.AcceptsTab = true;
this.Comment.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
@@ -229,15 +230,16 @@ private void InitializeComponent() {
this.Comment.Multiline = true;
this.Comment.Name = "Comment";
this.Comment.ScrollBars = System.Windows.Forms.ScrollBars.Both;
- this.Comment.Size = new System.Drawing.Size(428, 66);
+ this.Comment.Size = new System.Drawing.Size(428, 74);
this.Comment.TabIndex = 6;
+ this.Comment.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Comment_KeyDown);
//
// ButtonAlert
//
this.ButtonAlert.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.ButtonAlert.Font = new System.Drawing.Font("Meiryo UI", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Pixel);
this.ButtonAlert.ForeColor = System.Drawing.Color.Red;
- this.ButtonAlert.Location = new System.Drawing.Point(6, 334);
+ this.ButtonAlert.Location = new System.Drawing.Point(6, 342);
this.ButtonAlert.Name = "ButtonAlert";
this.ButtonAlert.Size = new System.Drawing.Size(278, 23);
this.ButtonAlert.TabIndex = 8;
@@ -299,7 +301,7 @@ private void InitializeComponent() {
//
this.ButtonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.ButtonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
- this.ButtonCancel.Location = new System.Drawing.Point(373, 334);
+ this.ButtonCancel.Location = new System.Drawing.Point(373, 342);
this.ButtonCancel.Name = "ButtonCancel";
this.ButtonCancel.Size = new System.Drawing.Size(75, 23);
this.ButtonCancel.TabIndex = 0;
@@ -310,7 +312,7 @@ private void InitializeComponent() {
// ButtonOK
//
this.ButtonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.ButtonOK.Location = new System.Drawing.Point(292, 334);
+ this.ButtonOK.Location = new System.Drawing.Point(292, 342);
this.ButtonOK.Name = "ButtonOK";
this.ButtonOK.Size = new System.Drawing.Size(75, 23);
this.ButtonOK.TabIndex = 7;
@@ -659,7 +661,7 @@ private void InitializeComponent() {
this.groupBox6.Controls.Add(this.TextGeneralFont);
this.groupBox6.Location = new System.Drawing.Point(6, 6);
this.groupBox6.Name = "groupBox6";
- this.groupBox6.Size = new System.Drawing.Size(442, 351);
+ this.groupBox6.Size = new System.Drawing.Size(442, 349);
this.groupBox6.TabIndex = 0;
this.groupBox6.TabStop = false;
this.groupBox6.Text = "フォント";
diff --git a/ElectronicObserver/Window/Dialog/DialogFleetImageGenerator.cs b/ElectronicObserver/Window/Dialog/DialogFleetImageGenerator.cs
index 0a5f6ff07..863eb1e95 100644
--- a/ElectronicObserver/Window/Dialog/DialogFleetImageGenerator.cs
+++ b/ElectronicObserver/Window/Dialog/DialogFleetImageGenerator.cs
@@ -1,4 +1,5 @@
-using ElectronicObserver.Utility;
+using ElectronicObserver.Data;
+using ElectronicObserver.Utility;
using ElectronicObserver.Utility.Storage;
using System;
using System.Collections.Generic;
@@ -46,7 +47,10 @@ public DialogFleetImageGenerator() {
public DialogFleetImageGenerator( int fleetID )
: this() {
- CurrentArgument.FleetIDs = new int[] { fleetID };
+ if ( KCDatabase.Instance.Fleet.CombinedFlag > 0 && fleetID <= 2 )
+ CurrentArgument.FleetIDs = new int[] { 1, 2 };
+ else
+ CurrentArgument.FleetIDs = new int[] { fleetID };
}
@@ -279,15 +283,28 @@ private void ButtonOK_Click( object sender, EventArgs e ) {
return;
}
- if ( !OutputToClipboard.Checked && !DisableOverwritePrompt.Checked && File.Exists( OutputPath.Text ) ) {
- if ( MessageBox.Show( Path.GetFileName( OutputPath.Text ) + "\r\nは既に存在します。\r\n上書きしますか?", "上書き確認",
- MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2 )
- == System.Windows.Forms.DialogResult.No ) {
+ if ( !OutputToClipboard.Checked ) {
+ if ( string.IsNullOrWhiteSpace( OutputPath.Text ) ) {
+ MessageBox.Show( "出力先ファイル名が入力されていません。", "入力値エラー", MessageBoxButtons.OK, MessageBoxIcon.Exclamation );
+ args.DisposeResources();
+ return;
+ }
+
+ if ( OutputPath.Text.ToCharArray().Intersect( Path.GetInvalidPathChars() ).Any() ) {
+ MessageBox.Show( "出力先に使用できない文字が含まれています。", "入力値エラー", MessageBoxButtons.OK, MessageBoxIcon.Exclamation );
args.DisposeResources();
return;
}
- }
+ if ( !DisableOverwritePrompt.Checked && File.Exists( OutputPath.Text ) ) {
+ if ( MessageBox.Show( Path.GetFileName( OutputPath.Text ) + "\r\nは既に存在します。\r\n上書きしますか?", "上書き確認",
+ MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2 )
+ == System.Windows.Forms.DialogResult.No ) {
+ args.DisposeResources();
+ return;
+ }
+ }
+ }
int mode;
if ( ImageTypeCard.Checked )
@@ -522,8 +539,10 @@ private void OutputPath_TextChanged( object sender, EventArgs e ) {
}
}
- if ( OutputPath.Text.ToCharArray().Intersect( Path.GetInvalidPathChars() ).Any() || File.Exists( OutputPath.Text ) ) {
+ if ( string.IsNullOrWhiteSpace( OutputPath.Text ) || OutputPath.Text.ToCharArray().Intersect( Path.GetInvalidPathChars() ).Any() ) {
OutputPath.BackColor = Color.MistyRose;
+ } else if ( File.Exists( OutputPath.Text ) ) {
+ OutputPath.BackColor = Color.Moccasin;
} else {
OutputPath.BackColor = SystemColors.Window;
}
@@ -586,13 +605,26 @@ private void OutputToClipboard_CheckedChanged( object sender, EventArgs e ) {
SearchOutputPath.Enabled =
OpenImageAfterOutput.Enabled =
DisableOverwritePrompt.Enabled =
- AutoSetFileNameToDate.Enabled =
+ AutoSetFileNameToDate.Enabled =
SyncronizeTitleAndFileName.Enabled =
!OutputToClipboard.Checked;
ToolTipInfo.SetToolTip( GroupOutputPath, OutputToClipboard.Checked ? "クリップボードに出力されます。\r\nファイルに出力したい場合は、詳細タブの「クリップボードに出力する」を外してください。" : null );
}
+ private void Comment_KeyDown( object sender, KeyEventArgs e ) {
+
+ // Multiline == true の TextBox では、 Ctrl-A ショートカットが無効化されるらしいので自家実装
+
+ if ( e.Control && e.KeyCode == Keys.A ) {
+ if ( sender != null ) {
+ ( (TextBox)sender ).SelectAll();
+ }
+ e.SuppressKeyPress = true;
+ e.Handled = true;
+ }
+ }
+
}
}
diff --git a/ElectronicObserver/Window/Dialog/DialogFleetImageGenerator.resx b/ElectronicObserver/Window/Dialog/DialogFleetImageGenerator.resx
index 9192f569b..f5675f2b9 100644
--- a/ElectronicObserver/Window/Dialog/DialogFleetImageGenerator.resx
+++ b/ElectronicObserver/Window/Dialog/DialogFleetImageGenerator.resx
@@ -129,4 +129,7 @@
297, 17
+
+ 454, 17
+
\ No newline at end of file
diff --git a/ElectronicObserver/Window/FormCompass.cs b/ElectronicObserver/Window/FormCompass.cs
index 5c47a750f..c02719469 100644
--- a/ElectronicObserver/Window/FormCompass.cs
+++ b/ElectronicObserver/Window/FormCompass.cs
@@ -116,7 +116,7 @@ public void Update( int shipID, int[] slot ) {
ShipName.Text = ship.Name;
- ShipName.ForeColor = GetShipNameColor( ship );
+ ShipName.ForeColor = ship.GetShipNameColor();
ToolTipInfo.SetToolTip( ShipName, GetShipString( shipID, slot ) );
Equipments.SetSlotList( shipID, slot );
@@ -270,7 +270,7 @@ public void Update( EnemyFleetRecord.EnemyFleetElement fleet ) {
} else {
ShipNames[i].Text = ship.Name;
- ShipNames[i].ForeColor = GetShipNameColor( ship );
+ ShipNames[i].ForeColor = ship.GetShipNameColor();
ShipNames[i].Tag = ship.ShipID;
ShipNames[i].Cursor = Cursors.Help;
ToolTipInfo.SetToolTip( ShipNames[i], GetShipString( ship.ShipID, ship.DefaultSlot != null ? ship.DefaultSlot.ToArray() : null ) );
@@ -310,26 +310,6 @@ void TableEnemyCandidateControl_MouseClick( object sender, MouseEventArgs e ) {
#region ***Control method
- private static Color GetShipNameColor( ShipDataMaster ship ) {
- switch ( ship.AbyssalShipClass ) {
- case 0:
- case 1: //normal
- default:
- return Color.FromArgb( 0x00, 0x00, 0x00 );
- case 2: //elite
- return Color.FromArgb( 0xFF, 0x00, 0x00 );
- case 3: //flagship
- return Color.FromArgb( 0xFF, 0x88, 0x00 );
- case 4: //latemodel / flagship kai
- return Color.FromArgb( 0x00, 0x88, 0xFF );
- case 5: //latemodel elite
- return Color.FromArgb( 0x88, 0x00, 0x00 );
- case 6: //latemodel flagship
- return Color.FromArgb( 0x88, 0x44, 0x00 );
- }
- }
-
-
private static string GetShipString( int shipID, int[] slot ) {
ShipDataMaster ship = KCDatabase.Instance.MasterShips[shipID];
@@ -709,7 +689,7 @@ private void Updated( string apiname, dynamic data ) {
} else if ( mapinfo.MapHPMax > 0 ) {
int current = compass.MapHPCurrent > 0 ? compass.MapHPCurrent : mapinfo.MapHPCurrent;
int max = compass.MapHPMax > 0 ? compass.MapHPMax : mapinfo.MapHPMax;
-
+
ToolTipInfo.SetToolTip( TextMapArea, string.Format( "{0}: {1} / {2}", mapinfo.GaugeType == 3 ? "TP" : "HP", current, max ) );
} else {
diff --git a/README.md b/README.md
index 154f2e81a..67179e893 100644
--- a/README.md
+++ b/README.md
@@ -37,7 +37,7 @@
*このリンクの更新は遅れる可能性があります。最新版は[こちら](http://electronicobserver.blog.fc2.com/)で確認してください。*
-[ver. 2.6.1 (2017/05/05)](http://bit.ly/2qHzPAR)
+[ver. 2.6.2 (2017/05/07)](http://bit.ly/2qFNVoV)
[更新内容・履歴はこちらで確認できます。](https://github.com/andanteyk/ElectronicObserver/wiki/ChangeLog)