Skip to content

Commit

Permalink
The drop-down on missions now includes a "Notes" section where a comm…
Browse files Browse the repository at this point in the history
…ander can record notes about ongoing missions.

Resolves #2410.
  • Loading branch information
Tkael committed Aug 8, 2024
1 parent d9ca2ac commit 75131d8
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 3 deletions.
3 changes: 3 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ Full details of the variables available for each noted event, and VoiceAttack in

## 4.1.0-b1
* Core
* Added support for the Type-8 Transporter.
* Added `sourcesystem`, `sourcebody`, `collected`, and `delivered`, properties to the `mission` object.
* Commodities now have a `corrosive` boolean property.
* Removed `haulageData` map from the `cargo` object, add `missionCargo` dictionary object in its place.
* Suppressed a repetitious `Body scanned` event which could occur after mapping. (#2633)
* The `need` property of `cargo` is now calculated after resolvers have handled events (to minimize cross linking between the Cargo and Mission Monitors).
* Crime Monitor
* An interstellar bounty applies when fines or bounties for factions aligned with a superpower exceed 10,000 credits.
* Mission Monitor
* The drop-down on missions now includes a "Notes" section where you can record notes about ongoing missions. (#2410)
* Speech Responder
* Fixed a bug that could prevent variables set with `set` from being available in some contexts.
* Custom Functions
Expand Down
17 changes: 16 additions & 1 deletion DataDefinitions/Mission.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,20 @@ public MissionStatus statusDef
[Utilities.PublicAPI]
public bool shared { get; set; }

[Utilities.PublicAPI ("Notes you have recorded about the mission.")]
public string notes
{
get => _notes;
set
{
if ( _notes == value ) { return; }
_notes = value;
OnPropertyChanged( nameof( notes ) );
}
}
[JsonIgnore]
private string _notes;

#endregion

#region Mission Tags / MetaData
Expand Down Expand Up @@ -471,13 +485,14 @@ public Mission () { }

[JsonConstructor]
// Main Constructor
public Mission(long MissionId, string Name, DateTime? expiry, MissionStatus Status, bool Shared = false)
public Mission(long MissionId, string Name, DateTime? expiry, MissionStatus Status, string notes = null, bool Shared = false)
{
this.missionid = MissionId;
this.name = Name;
this.expiry = expiry?.ToUniversalTime();
this.statusDef = Status;
this.shared = Shared;
this.notes = notes;
this.expiring = false;
destinationsystems = new List<NavWaypoint>();
}
Expand Down
12 changes: 10 additions & 2 deletions MissionMonitor/ConfigurationWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
d:DesignHeight="300" d:DesignWidth="800">
<UserControl.Resources>
<DataTemplate x:Key="defaultMissionTemplate" DataType="{x:Type defs:Mission}">
<Grid Background="Azure">
<Grid Background="Azure" Width="{Binding ElementName=UserControl, Path=ActualWidth}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
Expand All @@ -22,6 +22,7 @@
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0" Text="{x:Static resx:MissionMonitor.header_tags}" Margin="15, 0" />
<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding localizedTagsString}" Margin="5, 0" />
Expand All @@ -31,6 +32,10 @@
<TextBlock Grid.Row="0" Grid.Column="3" Text="{Binding originsystem}" Margin="5, 0" />
<TextBlock Grid.Row="1" Grid.Column="2" Text="{x:Static resx:MissionMonitor.header_originstation}" Margin="15, 0" />
<TextBlock Grid.Row="1" Grid.Column="3" Text="{Binding originstation}" Margin="5, 0" />
<TextBlock Grid.Row="2" Grid.Column="0" Text="{x:Static resx:MissionMonitor.header_notes}" Margin="15, 0" />
<TextBox Grid.Row ="2" Grid.Column ="1" Grid.ColumnSpan="3"
Text="{Binding notes, Mode=TwoWay, NotifyOnTargetUpdated=True, NotifyOnSourceUpdated=True, UpdateSourceTrigger=PropertyChanged}"
TextChanged="MissionNotes_OnTextChanged" TextWrapping="Wrap" AcceptsReturn="True" AcceptsTab="True" />
</Grid>
</DataTemplate>
<DataTemplate x:Key="communityGoalTemplate" DataType="{x:Type defs:Mission}">
Expand All @@ -56,6 +61,9 @@
<TextBlock Grid.Row="1" Grid.Column="3" Text="{Binding originsystem}" Margin="5, 0" />
<TextBlock Grid.Row="2" Grid.Column="2" Text="{x:Static resx:MissionMonitor.header_originstation}" Margin="15, 0" />
<TextBlock Grid.Row="2" Grid.Column="3" Text="{Binding originstation}" Margin="5, 0" />
<TextBox Grid.Row ="2" Grid.Column ="1" Grid.ColumnSpan="3"
Text="{Binding notes, Mode=TwoWay, NotifyOnTargetUpdated=True, NotifyOnSourceUpdated=True, UpdateSourceTrigger=PropertyChanged}"
TextChanged="MissionNotes_OnTextChanged" TextWrapping="Wrap" AcceptsReturn="True" AcceptsTab="True" />
</Grid>
</DataTemplate>
</UserControl.Resources>
Expand All @@ -66,7 +74,7 @@
<Label x:Name ="missionWarningLabel" VerticalContentAlignment="Center" Content="{x:Static resx:MissionMonitor.tab_mission_warning}"/>
<TextBox x:Name="missionWarningInt" PreviewTextInput="EnsureValidInteger" TextChanged="warningChanged" TextAlignment="Center" VerticalContentAlignment="Center" Height="25" Width="40"/>
</StackPanel>
<DataGrid Margin="0,10" AutoGenerateColumns="False" x:Name="missionsData" CanUserAddRows="false" CanUserDeleteRows="False" TargetUpdated="missionsUpdated" HeadersVisibility="Column">
<DataGrid Margin="0,10" AutoGenerateColumns="False" x:Name="missionsData" CanUserAddRows="false" CanUserDeleteRows="False" TargetUpdated="missionsUpdated" HeadersVisibility="Column" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<DataGrid.Columns>
<DataGridTemplateColumn>
<DataGridTemplateColumn.CellTemplate>
Expand Down
5 changes: 5 additions & 0 deletions MissionMonitor/ConfigurationWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,10 @@ private void RowDetailsButtonClick(object sender, RoutedEventArgs e)
}
}
}

private void MissionNotes_OnTextChanged ( object sender, TextChangedEventArgs e )
{
missionMonitor().writeMissions();
}
}
}
11 changes: 11 additions & 0 deletions MissionMonitor/Properties/MissionMonitor.Designer.cs

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

3 changes: 3 additions & 0 deletions MissionMonitor/Properties/MissionMonitor.resx
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,7 @@
<data name="extra_details_tooltip" xml:space="preserve">
<value>Show or hide additional details about the selected mission</value>
</data>
<data name="header_notes" xml:space="preserve">
<value>Notes:</value><comment>A label for a UI element where a commander can record personal notes about a mission.</comment>
</data>
</root>

0 comments on commit 75131d8

Please sign in to comment.