Skip to content

Commit

Permalink
Version 0.3.0
Browse files Browse the repository at this point in the history
・通知設定が保存されない不具合を修正
・一部ログ出力がおかしい不具合を修正
・任務窓:進捗によって色を変える
  • Loading branch information
andanteyk committed Feb 22, 2015
1 parent bbbf686 commit 3dba744
Show file tree
Hide file tree
Showing 9 changed files with 151 additions and 18 deletions.
12 changes: 12 additions & 0 deletions ElectronicObserver/Notifier/NotifierBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,5 +169,17 @@ public virtual void Notify() {

}


public virtual void ApplyToConfiguration( Utility.Configuration.ConfigurationData.ConfigNotifierBase config ) {

DialogData.ApplyToConfiguration( config );
config.PlaysSound = PlaysSound;
config.SoundPath = SoundPath;
config.IsEnabled = IsEnabled;
config.ShowsDialog = ShowsDialog;
config.AccelInterval = AccelInterval;

}

}
}
18 changes: 18 additions & 0 deletions ElectronicObserver/Notifier/NotifierDamage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,5 +242,23 @@ public void Notify( string[] messages ) {
base.Notify();
}


public override void ApplyToConfiguration( Utility.Configuration.ConfigurationData.ConfigNotifierBase config ) {
base.ApplyToConfiguration( config );

var c = config as Utility.Configuration.ConfigurationData.ConfigNotifierDamage;

if ( c != null ) {
c.NotifiesBefore = NotifiesBefore;
c.NotifiesNow = NotifiesNow;
c.NotifiesAfter = NotifiesAfter;
c.LevelBorder = LevelBorder;
c.ContainsNotLockedShip = ContainsNotLockedShip;
c.ContainsSafeShip = ContainsSafeShip;
c.ContainsFlagship = ContainsFlagship;
c.NotifiesAtEndpoint = NotifiesAtEndpoint;
}
}

}
}
19 changes: 19 additions & 0 deletions ElectronicObserver/Notifier/NotifierDialogData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,25 @@ public void DisposeImage() {
}

#endregion


public void ApplyToConfiguration( Utility.Configuration.ConfigurationData.ConfigNotifierBase config ) {

config.ImagePath = ImagePath;
config.DrawsImage = DrawsImage;
config.DrawsMessage = DrawsMessage;
config.ClosingInterval = ClosingInterval;
config.CloseOnMouseMove = CloseOnMouseMove;
config.Alignment = Alignment;
config.Location = Location;
config.HasFormBorder = HasFormBorder;
config.TopMost = TopMost;
config.ShowWithActivation = ShowWithActivation;
config.ForeColor = ForeColor;
config.BackColor = BackColor;

}

}


Expand Down
9 changes: 9 additions & 0 deletions ElectronicObserver/Notifier/NotifierManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ public void Initialize( FormMain parent ) {

}

public void ApplyToConfiguration() {

Expedition.ApplyToConfiguration( Utility.Configuration.Config.NotifierExpedition );
Construction.ApplyToConfiguration( Utility.Configuration.Config.NotifierConstruction );
Repair.ApplyToConfiguration( Utility.Configuration.Config.NotifierRepair );
Condition.ApplyToConfiguration( Utility.Configuration.Config.NotifierCondition );
Damage.ApplyToConfiguration( Utility.Configuration.Config.NotifierDamage );

}

public void ShowNotifier( Form form ) {
_parentForm.Invoke( (MethodInvoker)( () => form.Show() ) );
Expand Down
2 changes: 1 addition & 1 deletion ElectronicObserver/Utility/SoftwareInformation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public static string VersionEnglish {
/// </summary>
public static DateTime UpdateTime {
get {
return DateTimeHelper.CSVStringToTime( "2015/02/20 16:00:00" );
return DateTimeHelper.CSVStringToTime( "2015/02/22 22:22:22" );
}
}

Expand Down
3 changes: 2 additions & 1 deletion ElectronicObserver/Window/FormLog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ public FormLog( FormMain parent ) {
private void FormLog_Load( object sender, EventArgs e ) {

foreach ( var log in Utility.Logger.Log ) {
LogList.Items.Add( log.ToString() );
if ( log.Priority >= Utility.Configuration.Config.Log.LogLevel )
LogList.Items.Add( log.ToString() );
}
LogList.TopIndex = LogList.Items.Count - 1;

Expand Down
1 change: 1 addition & 0 deletions ElectronicObserver/Window/FormMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ private void FormMain_FormClosing( object sender, FormClosingEventArgs e ) {

private void FormMain_FormClosed( object sender, FormClosedEventArgs e ) {

NotifierManager.Instance.ApplyToConfiguration();
Utility.Configuration.Instance.Save();
APIObserver.Instance.Stop();
RecordManager.Instance.Save();
Expand Down
103 changes: 88 additions & 15 deletions ElectronicObserver/Window/FormQuest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,48 @@ namespace ElectronicObserver.Window {

public partial class FormQuest : DockContent {

private DataGridViewCellStyle CSDefaultLeft, CSDefaultCenter, CSProgress1, CSProgress50, CSProgress80, CSProgress100;


public FormQuest( FormMain parent ) {
InitializeComponent();

ControlHelper.SetDoubleBuffered( QuestView );

ConfigurationChanged();


#region set cellstyle

CSDefaultLeft = new DataGridViewCellStyle();
CSDefaultLeft.Alignment = DataGridViewContentAlignment.MiddleLeft;
CSDefaultLeft.BackColor = SystemColors.Control;
//CSDefaultLeft.Font = Font;
CSDefaultLeft.ForeColor = SystemColors.ControlText;
CSDefaultLeft.SelectionBackColor = Color.FromArgb( 0xFF, 0xFF, 0xCC );
CSDefaultLeft.SelectionForeColor = SystemColors.ControlText;
CSDefaultLeft.WrapMode = DataGridViewTriState.False;

CSDefaultCenter = new DataGridViewCellStyle( CSDefaultLeft );
CSDefaultCenter.Alignment = DataGridViewContentAlignment.MiddleCenter;

CSProgress1 = new DataGridViewCellStyle( CSDefaultLeft );
CSProgress1.BackColor = Color.FromArgb( 0xFF, 0xFF, 0xBB );

CSProgress50 = new DataGridViewCellStyle( CSDefaultLeft );
CSProgress50.BackColor = Color.FromArgb( 0xDD, 0xFF, 0xBB );

CSProgress80 = new DataGridViewCellStyle( CSDefaultLeft );
CSProgress80.BackColor = Color.FromArgb( 0xBB, 0xFF, 0xBB );

CSProgress100 = new DataGridViewCellStyle( CSDefaultLeft );
CSProgress100.BackColor = Color.FromArgb( 0xBB, 0xFF, 0xFF );

QuestView.DefaultCellStyle = CSDefaultCenter;
QuestView_Name.DefaultCellStyle = CSDefaultLeft;
QuestView_Progress.DefaultCellStyle = CSDefaultLeft;

#endregion
}


Expand Down Expand Up @@ -70,11 +106,6 @@ void ConfigurationChanged() {




void APIUpdated( string apiname, dynamic data ) {
Updated();
}

void Updated() {

if ( !KCDatabase.Instance.Quest.IsLoaded ) return;
Expand Down Expand Up @@ -118,22 +149,63 @@ void Updated() {

{
string value;
DataGridViewCellStyle style;

if ( q.State == 3 ) {
value = "達成!";
style = CSProgress100;

} else {
switch ( q.Progress ) {
case 0:
value = "-"; break;
case 1:
value = "50%以上"; break;
case 2:
value = "80%以上"; break;
default:
value = "???"; break;

if ( KCDatabase.Instance.QuestProgress.Progresses.ContainsKey( q.QuestID ) ) {
var p = KCDatabase.Instance.QuestProgress.Progresses[q.QuestID];
value = p.ToString();

double percentage = p.ProgressPercentage;

if ( percentage >= 1.00 ) {
style = CSProgress100;

} else if ( percentage >= 0.80 ) {
style = CSProgress80;

} else if ( percentage >= 0.50 ) {
style = CSProgress50;

} else if ( percentage > 0.00 ) {
style = CSProgress1;

} else {
style = CSDefaultLeft;

}

} else {

switch ( q.Progress ) {
case 0:
value = "-";
style = CSDefaultLeft;
break;
case 1:
value = "50%以上";
style = CSProgress50;
break;
case 2:
value = "80%以上";
style = CSProgress80;
break;
default:
value = "???";
style = CSDefaultLeft;
break;
}
}
}

row.Cells[QuestView_Progress.Index].Value = value;
row.Cells[QuestView_Progress.Index].Style = style;

}

QuestView.Rows.Add( row );
Expand Down Expand Up @@ -197,6 +269,7 @@ private void QuestView_CellFormatting( object sender, DataGridViewCellFormatting
}


/*
if ( e.ColumnIndex == QuestView_Progress.Index ) {
int? qid = QuestView.Rows[e.RowIndex].Cells[QuestView_Name.Index].Value as int?;
Expand All @@ -209,7 +282,7 @@ private void QuestView_CellFormatting( object sender, DataGridViewCellFormatting
}
}
}

*/

}

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

*このリンクの更新は遅れる可能性があります。最新版は[こちら](http://electronicobserver.blog.fc2.com/)で確認してください。*

[ver. 0.2.1 (2015/02/17)](http://bit.ly/1DAz8uG)
[ver. 0.3.0 (2015/02/22)](http://bit.ly/1BAq9KH)

### 開発者の皆様へ
---
Expand Down

0 comments on commit 3dba744

Please sign in to comment.