Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
andanteyk committed Jan 7, 2016
2 parents a1db820 + 984ecf1 commit 40dff89
Show file tree
Hide file tree
Showing 11 changed files with 106 additions and 43 deletions.
21 changes: 12 additions & 9 deletions ElectronicObserver/Other/Information/apilist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1680,21 +1680,24 @@ Request.api_req_member/payitemuse :課金アイテム使用
api_force_flag :

api_req_member/payitemuse :課金アイテム使用
api_caution_flag :0?
api_caution_flag :確認ダイアログ(資源上限により無駄が出ますが本当に使いますか?)表示フラグ? 0=非表示 1=表示?


Request.api_req_member/itemuse :アイテム使用
api_exchange_type :勲章のみ存在? 1=設計図と交換
api_useitem_id :使用したアイテムのID
api_force_flag :
api_force_flag :0=資源上限確認ダイアログを表示 1=非表示
上限突破する場合、これが 0 なら response で api_caution_flag が 1 になる(まだ使われない)。それで確認ダイアログを出し、yes ならば api_force_flag=1 で再送する(ここで実際に消費される)

api_req_member/itemuse :アイテム使用
api_caution_flag :0
api_flag :1
api_getitem :入手アイテム
api_usemst :? 設計図=6
api_mst_id :ID
api_getcount :入手個数
api_caution_flag :確認ダイアログ(資源上限により無駄が出ますが本当に使いますか?)表示フラグ? 0=非表示 1=表示?
api_flag :1=アイテム 2=資源
api_getitem :入手アイテム アイテム入手時のみ存在
api_usemst :? 設計図=6 2=装備? 5・6=アイテム
api_mst_id :入手アイテムID
api_getcount :入手アイテム個数
api_material :入手資源 資源入手時のみ存在 [燃料, 弾薬, 鋼材, ボーキ, 高速建造材, 高速修復材, 開発資材, 改修資材]
api_slotitem :入手装備アイテム?


api_req_furniture/music_list :ジュークボックスメニュー
Expand Down Expand Up @@ -1741,7 +1744,7 @@ api_req_furniture/buy :家具購入
(情報なし)

api_dmm_payment/paycheck :アイテム購入
api_check_value :購入個数?
api_check_value :2=成功



Expand Down
3 changes: 2 additions & 1 deletion ElectronicObserver/Utility/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ public class ConfigControl : ConfigPartBase {
public ConfigControl() {
ConditionBorder = 40;
RecordAutoSaving = 1;
UseSystemVolume = false;
UseSystemVolume = true;
}
}
/// <summary>動作</summary>
Expand Down Expand Up @@ -630,6 +630,7 @@ public ConfigFormQuest() {
/// </summary>
public class ConfigFormShipGroup : ConfigPartBase {

[Obsolete]
public int SplitterDistance { get; set; }

public bool AutoUpdate { get; set; }
Expand Down
61 changes: 43 additions & 18 deletions ElectronicObserver/Utility/MediaPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,23 @@ public class MediaPlayer {
"wav",
"m4a",
"aac",
"flac",
"mka",
} );

private static readonly Regex SupportedFileName = new Regex( ".*\\.(" + string.Join( "|", SupportedExtensions ) + ")", RegexOptions.Compiled );


public MediaPlayer() {
var type = Type.GetTypeFromProgID( "WMPlayer.OCX.7" );
_wmp = Activator.CreateInstance( type );
_wmp.uiMode = "none";
_wmp.settings.autoStart = false;
_wmp.PlayStateChange += new Action<int>( wmp_PlayStateChange );
if ( type != null ) {
_wmp = Activator.CreateInstance( type );
_wmp.uiMode = "none";
_wmp.settings.autoStart = false;
_wmp.PlayStateChange += new Action<int>( wmp_PlayStateChange );
} else {
_wmp = null;
}

IsLoop = false;
_isShuffle = false;
Expand All @@ -70,16 +76,22 @@ public MediaPlayer() {
}



/// <summary>
/// 利用可能かどうか
/// false の場合全機能が使用不可能
/// </summary>
public bool IsAvailable {
get { return _wmp != null; }
}

/// <summary>
/// メディアファイルのパス。
/// 再生中に変更された場合停止します。
/// </summary>
public string SourcePath {
get { return _wmp.URL; }
get { return !IsAvailable ? string.Empty : _wmp.URL; }
set {
if ( _wmp.URL != value )
if ( IsAvailable && _wmp.URL != value )
_wmp.URL = value;
}
}
Expand All @@ -90,16 +102,16 @@ public string SourcePath {
/// 注: システムの音量設定と連動しているようなので注意が必要
/// </summary>
public int Volume {
get { return _wmp.settings.volume; }
set { _wmp.settings.volume = value; }
get { return !IsAvailable ? 0 : _wmp.settings.volume; }
set { if ( IsAvailable ) _wmp.settings.volume = value; }
}

/// <summary>
/// ミュート
/// </summary>
public bool IsMute {
get { return _wmp.settings.mute; }
set { _wmp.settings.mute = value; }
get { return !IsAvailable ? false : _wmp.settings.mute; }
set { if ( IsAvailable ) _wmp.settings.mute = value; }
}


Expand All @@ -111,7 +123,8 @@ public bool IsLoop {
get { return _isLoop; }
set {
_isLoop = value;
_wmp.settings.setMode( "loop", _isLoop );
if ( IsAvailable )
_wmp.settings.setMode( "loop", _isLoop );
}
}

Expand All @@ -125,30 +138,30 @@ public bool IsLoop {
/// 現在の再生地点 (秒単位)
/// </summary>
public double CurrentPosition {
get { return _wmp.controls.currentPosition; }
set { _wmp.controls.currentPosition = value; }
get { return !IsAvailable ? 0.0 : _wmp.controls.currentPosition; }
set { if ( IsAvailable ) _wmp.controls.currentPosition = value; }
}

/// <summary>
/// 再生状態
/// </summary>
public int PlayState {
get { return _wmp.playState; }
get { return !IsAvailable ? 0 : _wmp.playState; }
}

/// <summary>
/// 現在のメディアの名前
/// </summary>
public string MediaName {
get { return _wmp.currentMedia != null ? _wmp.currentMedia.name : null; }
get { return !IsAvailable ? string.Empty : _wmp.currentMedia != null ? _wmp.currentMedia.name : null; }
}

/// <summary>
/// 現在のメディアの長さ(秒単位)
/// なければ 0
/// </summary>
public double Duration {
get { return _wmp.currentMedia != null ? _wmp.currentMedia.duration : 0; }
get { return !IsAvailable ? 0.0 : _wmp.currentMedia != null ? _wmp.currentMedia.duration : 0; }
}


Expand All @@ -169,7 +182,7 @@ public void SetPlaylist( IEnumerable<string> list ) {
if ( list == null )
_playlist = new List<string>();
else
_playlist = list.Distinct().Where( s => SupportedFileName.IsMatch( s ) ).ToList();
_playlist = list.Distinct().ToList();

UpdateRealPlaylist();
}
Expand Down Expand Up @@ -240,6 +253,8 @@ public bool IsShuffle {
/// 再生
/// </summary>
public void Play() {
if ( !IsAvailable ) return;

if ( _realPlaylist.Count > 0 && SourcePath != _realPlaylist[_playingIndex] )
SourcePath = _realPlaylist[_playingIndex];

Expand All @@ -250,20 +265,26 @@ public void Play() {
/// ポーズ
/// </summary>
public void Pause() {
if ( !IsAvailable ) return;

_wmp.controls.pause();
}

/// <summary>
/// 停止
/// </summary>
public void Stop() {
if ( !IsAvailable ) return;

_wmp.controls.stop();
}

/// <summary>
/// ファイルを閉じる
/// </summary>
public void Close() {
if ( !IsAvailable ) return;

_wmp.close();
}

Expand All @@ -272,6 +293,7 @@ public void Close() {
/// 次の曲へ
/// </summary>
public void Next() {
if ( !IsAvailable ) return;

int prevState = PlayState;

Expand All @@ -291,6 +313,8 @@ public void Next() {
/// 前の曲へ
/// </summary>
public void Prev() {
if ( !IsAvailable ) return;

if ( IsShuffle )
return;

Expand All @@ -306,6 +330,7 @@ public void Prev() {
}

private void UpdateRealPlaylist() {
if ( !IsAvailable ) return;

if ( !IsShuffle ) {
_realPlaylist = new List<string>( _playlist );
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 "2.1.0";
return "2.1.1";
}
}

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

Expand Down
4 changes: 4 additions & 0 deletions ElectronicObserver/Utility/SyncBGMPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ public enum SoundHandleID {
public SyncBGMPlayer() {

_mp = new MediaPlayer();

if ( !_mp.IsAvailable )
Utility.Logger.Add( 3, "Windows Media Player のロードに失敗しました。音声の再生はできません。" );

_mp.AutoPlay = false;

_isBoss = false;
Expand Down
3 changes: 3 additions & 0 deletions ElectronicObserver/Window/Dialog/DialogConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,9 @@ public void ToConfiguration( Configuration.ConfigurationData config ) {

//[BGM]
config.BGMPlayer.Enabled = BGMPlayer_Enabled.Checked;
for ( int i = 0; i < BGMPlayer_ControlGrid.Rows.Count; i++ ) {
BGMHandles[(SyncBGMPlayer.SoundHandleID)BGMPlayer_ControlGrid[BGMPlayer_ColumnContent.Index, i].Value].Enabled = (bool)BGMPlayer_ControlGrid[BGMPlayer_ColumnEnabled.Index, i].Value;
}
config.BGMPlayer.Handles = new List<SyncBGMPlayer.SoundHandle>( BGMHandles.Values.ToList() );

}
Expand Down
2 changes: 1 addition & 1 deletion ElectronicObserver/Window/Dialog/DialogNotifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public DialogNotifier( NotifierDialogData data ) {
private void DialogNotifier_Load( object sender, EventArgs e ) {


Rectangle screen = System.Windows.Forms.Screen.PrimaryScreen.Bounds;
Rectangle screen = System.Windows.Forms.Screen.GetWorkingArea( this );
switch ( DialogData.Alignment ) {

case NotifierDialogAlignment.TopLeft:
Expand Down
11 changes: 8 additions & 3 deletions ElectronicObserver/Window/FormMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -360,18 +360,23 @@ private IDockContent GetDockContentFromPersistString( string persistString ) {
return fBattle;
case "FleetOverview":
return fFleetOverview;
case "ShipGroup":
return fShipGroup;
//case "ShipGroup":
// return fShipGroup;
case "Browser":
return fBrowser;
case "WindowCapture":
return fWindowCapture;
default:
if ( persistString.StartsWith( "ShipGroup" ) ) {
fShipGroup.ConfigureFromPersistString( persistString );
return fShipGroup;
}
if ( persistString.StartsWith( FormIntegrate.PREFIX ) ) {
return FormIntegrate.FromPersistString( this, persistString );
}
return null;
}

}


Expand Down Expand Up @@ -1163,7 +1168,7 @@ private void StripMenu_WindowCapture_SubWindow_Click( object sender, EventArgs e

#endregion





Expand Down
1 change: 1 addition & 0 deletions ElectronicObserver/Window/FormShipGroup.Designer.cs

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

Loading

0 comments on commit 40dff89

Please sign in to comment.