Skip to content

Commit

Permalink
Merge branch 'hotfix'
Browse files Browse the repository at this point in the history
  • Loading branch information
andanteyk committed Mar 15, 2015
2 parents 5b8a9fb + ad8f2bb commit 6ccaefe
Show file tree
Hide file tree
Showing 9 changed files with 215 additions and 194 deletions.
58 changes: 31 additions & 27 deletions ElectronicObserver/Resource/ResourceManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,30 +170,14 @@ public bool Load() {
} catch ( Exception ex ) {

Utility.ErrorReporter.SendErrorReport( ex, "リソースファイルの読み込みに失敗しました。" );
MessageBox.Show( "リソースファイルの読み込みに失敗しました。", "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error );
MessageBox.Show( "リソースファイルの読み込みに失敗しました。\r\n" + ex.Message, "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error );

}

return false;
}


[Obsolete]
private Image LoadImage( string path ) {
try {

using ( FileStream fs = new FileStream( path, FileMode.Open, FileAccess.Read ) ) {
return Image.FromStream( fs );
}

} catch ( Exception ex ) {

Utility.ErrorReporter.SendErrorReport( ex, string.Format( "画像リソース {0} の読み込みに失敗しました。", path ) );
return new Bitmap( 16, 16, System.Drawing.Imaging.PixelFormat.Format32bppArgb );
FillWithBlankImage( Icons, Enum.GetValues( typeof( IconContent ) ).Length );
FillWithBlankImage( Equipments, Enum.GetValues( typeof( EquipmentContent ) ).Length );

}

//return null;
return false;
}


Expand Down Expand Up @@ -351,19 +335,20 @@ private static void LoadImageFromArchive( ImageList imglist, ZipArchive arc, str

Bitmap bmp = new Bitmap( entry.Open() );

if ( bmp.Size == imglist.ImageSize ) {

imglist.Images.Add( name, bmp );

} else {
if ( bmp.Size != imglist.ImageSize ) {

bmp.Dispose();
}
bmp = CreateBlankImage();

}

imglist.Images.Add( name, bmp );


} catch ( Exception ) {

Utility.Logger.Add( 3, string.Format( "画像リソース {0} の読み込みに失敗しました。" ) );
imglist.Images.Add( name, new Bitmap( imglist.ImageSize.Width, imglist.ImageSize.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb ) );
imglist.Images.Add( name, CreateBlankImage() );
return;
}

Expand Down Expand Up @@ -403,6 +388,25 @@ private static Icon LoadIconFromArchive( ZipArchive arc, string path ) {
}


/// <summary>
/// エラーが発生しないよう、ダミーの画像で領域を埋めます。
/// </summary>
private static void FillWithBlankImage( ImageList list, int length ) {

for ( int i = list.Images.Count; i < length; i++ ) {
list.Images.Add( CreateBlankImage() );
}
}

/// <summary>
/// 空白画像を作成します。
/// </summary>
private static Bitmap CreateBlankImage() {
return new Bitmap( 16, 16, System.Drawing.Imaging.PixelFormat.Format32bppArgb );
}



/// <summary>
/// 装備アイコンを取得します。一般的用途(ロック/未装備等でない、マスターとしてのアイコン)に向いています。
/// </summary>
Expand Down
6 changes: 6 additions & 0 deletions ElectronicObserver/Utility/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,11 @@ public class ConfigFormBrowser : ConfigPartBase {
/// </summary>
public bool IsScrollable { get; set; }

/// <summary>
/// スタイルシートを適用するか
/// </summary>
public bool AplliesStyleSheet { get; set; }


public ConfigFormBrowser() {
ZoomRate = 100;
Expand All @@ -475,6 +480,7 @@ public ConfigFormBrowser() {
ScreenShotFormat = 2;
StyleSheet = "\r\nbody {\r\n margin:0;\r\n overflow:hidden\r\n}\r\n\r\n#game_frame {\r\n position:fixed;\r\n left:50%;\r\n top:-16px;\r\n margin-left:-450px;\r\n z-index:1\r\n}\r\n";
IsScrollable = false;
AplliesStyleSheet = true;
}
}
/// <summary>[ブラウザ]ウィンドウ</summary>
Expand Down
2 changes: 1 addition & 1 deletion ElectronicObserver/Utility/Mathematics/DateTimeHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static class DateTimeHelper {
/// <summary>
/// 起点となる日時。
/// </summary>
private static readonly DateTime origin = new DateTime( 1970, 1, 1 ).ToLocalTime();
private static readonly DateTime origin = new DateTime( 1970, 1, 1, 9, 0, 0 );


/// <summary>
Expand Down
6 changes: 3 additions & 3 deletions ElectronicObserver/Utility/SoftwareInformation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static string SoftwareNameEnglish {
/// </summary>
public static string VersionJapanese {
get {
return SoftwareNameJapanese + "一〇型改";
return SoftwareNameJapanese + "一〇型改二";
}
}

Expand All @@ -44,7 +44,7 @@ public static string VersionJapanese {
/// </summary>
public static string VersionEnglish {
get {
return "1.0.1";
return "1.0.2";
}
}

Expand All @@ -54,7 +54,7 @@ public static string VersionEnglish {
/// </summary>
public static DateTime UpdateTime {
get {
return DateTimeHelper.CSVStringToTime( "2015/03/12 18:00:00" );
return DateTimeHelper.CSVStringToTime( "2015/03/15 22:00:00" );
}
}

Expand Down
106 changes: 53 additions & 53 deletions ElectronicObserver/Window/Dialog/DialogConfiguration.Designer.cs

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

7 changes: 5 additions & 2 deletions ElectronicObserver/Window/FormBrowser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ private void Browser_DocumentCompleted( object sender, WebBrowserDocumentComplet
/// </summary>
public void ApplyStyleSheet() {

if ( !Utility.Configuration.Config.FormBrowser.AplliesStyleSheet )
return;

try {

var document = Browser.Document;
Expand Down Expand Up @@ -335,8 +338,8 @@ private void SaveScreenShot( string path, System.Drawing.Imaging.ImageFormat for
if ( target == null ) return false;
viewobj = target as IViewObject;
if ( viewobj == null ) return false;
width = int.Parse( target.width );
height = int.Parse( target.height );
if ( !int.TryParse( target.width, out width ) ) return false;
if ( !int.TryParse( target.height, out height ) ) return false;
return true;
};

Expand Down
Loading

0 comments on commit 6ccaefe

Please sign in to comment.