Skip to content

Commit

Permalink
Merge pull request #355 from storybuilder-org/ReportIssuesAndKeybinds
Browse files Browse the repository at this point in the history
Adds some new keybinds and fixes report issues relating to outertraits
  • Loading branch information
terrycox authored Jun 15, 2022
2 parents ad271d6 + 53107d5 commit eda6156
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
5 changes: 0 additions & 5 deletions StoryBuilder/Views/CharacterPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
using CommunityToolkit.Mvvm.DependencyInjection;
using StoryBuilder.ViewModels;

// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238

namespace StoryBuilder.Views;

/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class CharacterPage : BindablePage
{
public CharacterViewModel CharVm => Ioc.Default.GetService<CharacterViewModel>();
Expand Down
18 changes: 15 additions & 3 deletions StoryBuilder/Views/Shell.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,11 @@
</AppBarButton.Icon>
<AppBarButton.Flyout>
<MenuFlyout>
<MenuFlyoutItem Text="Key Questions" Command="{x:Bind ShellVm.KeyQuestionsCommand, Mode=OneWay}" />
<MenuFlyoutItem Text="Key Questions" Command="{x:Bind ShellVm.KeyQuestionsCommand, Mode=OneWay}">
<MenuFlyoutItem.KeyboardAccelerators>
<KeyboardAccelerator Key="Q" Modifiers="Control"/>
</MenuFlyoutItem.KeyboardAccelerators>
</MenuFlyoutItem>
<MenuFlyoutItem Text="Topic Information" Command="{x:Bind ShellVm.TopicsCommand, Mode=OneWay}" />
<MenuFlyoutSubItem Text="Plotting Aids">
<MenuFlyoutItem Text="Master Plots" Command="{x:Bind ShellVm.MasterPlotsCommand, Mode=OneWay}">
Expand Down Expand Up @@ -266,8 +270,16 @@
</AppBarButton.Icon>
<AppBarButton.Flyout>
<MenuFlyout>
<MenuFlyoutItem Text="Print Reports" Command="{x:Bind ShellVm.PrintReportsCommand, Mode=OneWay}" />
<MenuFlyoutItem Text="Scrivener Reports" Command="{x:Bind ShellVm.ScrivenerReportsCommand, Mode=OneWay}" />
<MenuFlyoutItem Text="Print Reports" Command="{x:Bind ShellVm.PrintReportsCommand, Mode=OneWay}">
<MenuFlyoutItem.KeyboardAccelerators>
<KeyboardAccelerator Key="P" Modifiers="Control"/>
</MenuFlyoutItem.KeyboardAccelerators>
</MenuFlyoutItem>
<MenuFlyoutItem Text="Scrivener Reports" Command="{x:Bind ShellVm.ScrivenerReportsCommand, Mode=OneWay}">
<MenuFlyoutItem.KeyboardAccelerators>
<KeyboardAccelerator Key="R" Modifiers="Control"/>
</MenuFlyoutItem.KeyboardAccelerators>
</MenuFlyoutItem>
</MenuFlyout>
</AppBarButton.Flyout>
</AppBarButton>
Expand Down
7 changes: 6 additions & 1 deletion StoryBuilderLib/Services/Reports/ReportFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,12 @@ public string FormatCharacterReport(StoryElement element)
sb.Replace("@Sociability", character.Sociability);
sb.Replace("@Stability", character.Stability);
//Outer Traits section
sb.Replace("@Traits", character.outerTrait);
string traits = "";
foreach (var trait in character.TraitList)
{
traits += trait.ToString() + "\n";
}
sb.Replace("@Traits", traits);
// Notes section
sb.Replace("@Notes", GetText(character.Notes));

Expand Down

0 comments on commit eda6156

Please sign in to comment.