Skip to content

Commit 7aebb0f

Browse files
committed
Updated to version 2.3.0
WARNING: Code is still stupid and bad. Just added a fields list to help out some folks ----- Added a dynamic Field list that you can add stuff to. Set defaults in the Start Node per conversation. Defaults will be added as nodes are viewed and will be added for the entire conversation on save. Defaults can be overwritten per node.
1 parent 0118207 commit 7aebb0f

File tree

12 files changed

+243
-17
lines changed

12 files changed

+243
-17
lines changed

GraphLayout/GraphLayout/GraphLayout.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<AppDesignerFolder>Properties</AppDesignerFolder>
1111
<RootNamespace>GraphLayout</RootNamespace>
1212
<AssemblyName>GraphLayout</AssemblyName>
13-
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
13+
<TargetFrameworkVersion>v4.8.1</TargetFrameworkVersion>
1414
<FileAlignment>512</FileAlignment>
1515
<FileUpgradeFlags>
1616
</FileUpgradeFlags>

SetupScript.iss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
33

44
#define MyAppName "TalkerMaker Deluxe"
5-
#define MyAppVersion "2.2.2"
5+
#define MyAppVersion "2.3.0"
66
#define MyAppPublisher "Barky Seal Games"
77
#define MyAppURL "http://randallfitzgerald.net"
88
#define MyAppExeName "TalkerMakerDeluxe.exe"

TalkerMakerDeluxe/EditorWindow.xaml

Lines changed: 98 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,6 +1121,8 @@
11211121
<RowDefinition Height="Auto"/>
11221122
<RowDefinition Height="Auto"/>
11231123
<RowDefinition Height="Auto"/>
1124+
<RowDefinition Height="Auto"/>
1125+
<RowDefinition Height="Auto"/>
11241126
</Grid.RowDefinitions>
11251127
<Label Grid.Row="0" Grid.Column="0" Margin="4,0,4,4" HorizontalAlignment="Left" VerticalAlignment="Top" FontWeight="Bold">ID</Label>
11261128
<TextBlock Grid.Row="0" Grid.Column="1" Margin="4,0,4,4" TextAlignment="Left" Text="{Binding SelectedItem.ID, ElementName=lstConversations}" Name="txtConvoID" VerticalAlignment="Top"/>
@@ -1155,11 +1157,57 @@
11551157

11561158
<Label Grid.Row="5" Grid.Column="0" Margin="4,0,4,4" HorizontalAlignment="Left" VerticalAlignment="Top" FontWeight="Bold">Description</Label>
11571159
<TextBox Grid.Row="5" Grid.Column="1" Margin="4,0,4,4" SpellCheck.IsEnabled="True" TextWrapping="Wrap" MinHeight="50" MaxHeight="200" VerticalScrollBarVisibility="Auto" Text="{Binding SelectedItem.description, ElementName=lstConversations}" Name="txtConvoDescription" />
1160+
<Label Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="2" FontSize="12" Margin="4,0,4,4" BorderBrush="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" VerticalAlignment="Top" FontWeight="Bold" HorizontalAlignment="Left">Default Fields
1161+
</Label>
1162+
<StackPanel Orientation="Horizontal" Grid.Row="6" Grid.Column="1" Margin="4,0,4,4" HorizontalAlignment="Right" VerticalAlignment="Center" Visibility="Hidden">
1163+
<Button Width="20" Height="20" x:Name="btnAddField" Click="btnAddField_Click" Background="#FF2A2A2A" Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}">+</Button>
1164+
</StackPanel>
1165+
<DataGrid x:Name="dgFields" AutoGenerateColumns="False" Grid.Row="7" Grid.ColumnSpan="2" Grid.Column="0" DataContext="{Binding ElementName=EditorWin}" ItemsSource="{Binding selectedEntry.fields}" HorizontalContentAlignment="Stretch" MinHeight="100" VerticalContentAlignment="Stretch" SelectionMode="Single" CanUserAddRows="True" CanUserDeleteRows="True" Background="#FF2A2A2A" Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}">
1166+
<DataGrid.Resources>
1167+
<SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightBrushKey}" Color="#333333"/>
1168+
<SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightTextBrushKey}" Color="#eeeeee"/>
1169+
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#555555"/>
1170+
</DataGrid.Resources>
1171+
<DataGrid.ColumnHeaderStyle>
1172+
<Style TargetType="DataGridColumnHeader">
1173+
<Setter Property="Background" Value="#FF222222"/>
1174+
<Setter Property="Foreground" Value="White"/>
1175+
</Style>
1176+
</DataGrid.ColumnHeaderStyle>
1177+
1178+
<DataGrid.Columns>
1179+
<DataGridTextColumn Width="80" Header="Name" Binding="{Binding name}"/>
1180+
<DataGridTextColumn Width="40" Header="Type" Binding="{Binding type}" />
1181+
<DataGridTextColumn Width="*" Header="Value" Binding="{Binding value}"/>
1182+
<DataGridTemplateColumn Header="Del" Width="30">
1183+
<DataGridTemplateColumn.CellTemplate>
1184+
<DataTemplate>
1185+
<ContentControl Button.Click="btnFieldDelete_Click">
1186+
<ContentControl.Resources>
1187+
<Button x:Key="btn" Content="Del" Click="btnFieldDelete_Click" Background="#FF2A2A2A" Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
1188+
</ContentControl.Resources>
1189+
<ContentControl.Style>
1190+
<Style TargetType="ContentControl">
1191+
<Setter Property="Content" Value="{StaticResource btn}" />
1192+
<Style.Triggers>
1193+
<DataTrigger Binding="{Binding DataContext, RelativeSource={RelativeSource AncestorType=DataGridRow}}" Value="{x:Static CollectionView.NewItemPlaceholder}">
1194+
<Setter Property="Visibility" Value="Hidden">
1195+
</Setter>
1196+
</DataTrigger>
1197+
</Style.Triggers>
1198+
</Style>
1199+
</ContentControl.Style>
1200+
</ContentControl>
1201+
</DataTemplate>
1202+
</DataGridTemplateColumn.CellTemplate>
1203+
</DataGridTemplateColumn>
1204+
</DataGrid.Columns>
1205+
</DataGrid>
11581206
</Grid>
11591207
</TabItem>
11601208
<TabItem x:Name="tabEntry" Header="Entry" Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}">
11611209
<ScrollViewer VerticalScrollBarVisibility="Auto">
1162-
<Grid x:Name="gridDialogueEntry">
1210+
<Grid x:Name="gridDialogueEntry" VerticalAlignment="Top">
11631211
<Grid.ColumnDefinitions>
11641212
<ColumnDefinition Width="Auto"/>
11651213
<ColumnDefinition Width="*"/>
@@ -1232,6 +1280,8 @@
12321280
</Style>
12331281
</RowDefinition.Style>
12341282
</RowDefinition>
1283+
<RowDefinition Height="Auto"/>
1284+
<RowDefinition Height="Auto"/>
12351285
</Grid.RowDefinitions>
12361286
<Label Grid.Row="0" Grid.Column="0" FontSize="12" Margin="4,0,4,4" VerticalAlignment="Top" FontWeight="Bold" HorizontalAlignment="Left">ID</Label>
12371287
<TextBlock Grid.Row="0" Grid.Column="1" Margin="4,0,4,4" Text="{Binding ID}" TextAlignment="Left" Name="txtDialogueID"/>
@@ -1411,9 +1461,55 @@
14111461
</CheckBox.BorderBrush>
14121462
</CheckBox>
14131463
</StackPanel>
1464+
<Label Grid.Row="11" Grid.Column="0" Grid.ColumnSpan="2" FontSize="12" Margin="4,0,4,4" BorderBrush="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" VerticalAlignment="Top" FontWeight="Bold" HorizontalAlignment="Left">Fields</Label>
1465+
<StackPanel Orientation="Horizontal" Grid.Row="11" Grid.Column="1" Margin="4,0,4,4" HorizontalAlignment="Right" VerticalAlignment="Center" Visibility="Hidden">
1466+
<Button Width="20" Height="20" x:Name="btnAddDefaultField" Click="btnAddDefaultField_Click" Background="#FF2A2A2A" Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}">+</Button>
1467+
</StackPanel>
1468+
<DataGrid x:Name="dgDefaultFields" AutoGenerateColumns="False" Grid.Row="12" Grid.ColumnSpan="2" Grid.Column="0" DataContext="{Binding ElementName=EditorWin}" ItemsSource="{Binding selectedEntry.fields}" HorizontalContentAlignment="Stretch" MinHeight="100" VerticalContentAlignment="Stretch" SelectionMode="Single" CanUserAddRows="True" CanUserDeleteRows="True" Background="#FF2A2A2A" Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}">
1469+
<DataGrid.Resources>
1470+
<SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightBrushKey}" Color="#333333"/>
1471+
<SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightTextBrushKey}" Color="#eeeeee"/>
1472+
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#555555"/>
1473+
</DataGrid.Resources>
1474+
<DataGrid.ColumnHeaderStyle>
1475+
<Style TargetType="DataGridColumnHeader">
1476+
<Setter Property="Background" Value="#FF222222"/>
1477+
<Setter Property="Foreground" Value="White"/>
1478+
</Style>
1479+
</DataGrid.ColumnHeaderStyle>
1480+
1481+
<DataGrid.Columns>
1482+
<DataGridTextColumn Width="80" Header="Name" Binding="{Binding name}"/>
1483+
<DataGridTextColumn Width="40" Header="Type" Binding="{Binding type}" />
1484+
<DataGridTextColumn Width="*" Header="Value" Binding="{Binding value}"/>
1485+
<DataGridTemplateColumn Header="Del" Width="30">
1486+
<DataGridTemplateColumn.CellTemplate>
1487+
<DataTemplate>
1488+
<ContentControl Button.Click="btnDefaultFieldDelete_Click">
1489+
<ContentControl.Resources>
1490+
<Button x:Key="btn" Content="Del" Click="btnDefaultFieldDelete_Click" Background="#FF2A2A2A" Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
1491+
</ContentControl.Resources>
1492+
<ContentControl.Style>
1493+
<Style TargetType="ContentControl">
1494+
<Setter Property="Content" Value="{StaticResource btn}" />
1495+
<Style.Triggers>
1496+
<DataTrigger Binding="{Binding DataContext, RelativeSource={RelativeSource AncestorType=DataGridRow}}" Value="{x:Static CollectionView.NewItemPlaceholder}">
1497+
<Setter Property="Visibility" Value="Hidden">
1498+
</Setter>
1499+
</DataTrigger>
1500+
</Style.Triggers>
1501+
</Style>
1502+
</ContentControl.Style>
1503+
</ContentControl>
1504+
</DataTemplate>
1505+
</DataGridTemplateColumn.CellTemplate>
1506+
</DataGridTemplateColumn>
1507+
</DataGrid.Columns>
1508+
</DataGrid>
14141509
</Grid>
14151510
</ScrollViewer>
14161511
</TabItem>
1512+
14171513
</TabControl>
14181514
</Grid>
14191515
</Border>
@@ -1476,7 +1572,7 @@
14761572
</Button>
14771573
</StatusBarItem>
14781574
<StatusBarItem HorizontalAlignment="Right" Margin="0,0,16,0">
1479-
<TextBlock Text="v2.2.2" />
1575+
<TextBlock Text="v2.3.0" />
14801576
</StatusBarItem>
14811577
</StatusBar>
14821578
<StackPanel Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Bottom" Width="225">

TalkerMakerDeluxe/EditorWindow.xaml.cs

Lines changed: 105 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
using System.Windows.Threading;
1717
using System.Xml;
1818
using System.Windows.Shapes;
19+
using System.Windows.Data;
1920

2021
namespace TalkerMakerDeluxe
2122
{
@@ -161,7 +162,7 @@ void PrepareProject()
161162
theDatabase.Version = "1.0.0";
162163
theDatabase.Actors.Add(new Actor() { ID = 0, name = "Player", isPlayer = true });
163164
theDatabase.Conversations.Add(new Conversation() { ID = 0, title = "New Conversation", description = "A new conversation", actorID = 0, conversantID = 0, actor = theDatabase.Actors[0], conversant = theDatabase.Actors[0] });
164-
theDatabase.Conversations[0].DialogEntries.Add(new DialogueEntry() { ID = 0, IsRoot = true, title = "START", actorID = 0, actor = theDatabase.Actors[0], conversantID = 0, conversant = theDatabase.Actors[0], NodeColor = "Normal" });
165+
theDatabase.Conversations[0].DialogEntries.Add(new DialogueEntry() { ID = 0, IsRoot = true, title = "START", actorID = 0, actor = theDatabase.Actors[0], conversantID = 0, conversant = theDatabase.Actors[0], NodeColor = "Normal", fields = new List<DialogueEntry.Field>() });
165166
theDatabase.Items.Add(new Item() { ID = 0, name = "New Item" });
166167
theDatabase.Variables.Add(new UserVariable() { ID = 0, name = "New Variable", type = "Boolean", initialValue = "false" });
167168
theDatabase.Locations.Add(new Location() { ID = 0, name = "New Location" });
@@ -171,6 +172,7 @@ void PrepareProject()
171172
conditionsStack.DataContext = null;
172173
gridScript.DataContext = null;
173174

175+
174176
lstConversations.SelectionChanged -= lstConversations_SelectionChanged;
175177

176178
lstCharacters.SelectedItem = null;
@@ -217,7 +219,10 @@ void PrepareProject()
217219
lstConversations.SelectionChanged += lstConversations_SelectionChanged;
218220
lstConversations.SelectedIndex = 0;
219221
//LoadConversation(0);
220-
Console.WriteLine("Finish making new project");
222+
223+
SelectNode("_node_0");
224+
225+
Console.WriteLine("Finished making new project");
221226
}
222227

223228
void PrepareProject(string project)
@@ -275,6 +280,8 @@ void PrepareProject(string project)
275280
lstConversations.Items.Refresh();
276281
lstConversations.SelectionChanged += lstConversations_SelectionChanged;
277282
lstConversations.SelectedIndex = 0;
283+
284+
SelectNode("_node_0");
278285
}
279286

280287
private void DoAutoSave(object sender, EventArgs e)
@@ -358,11 +365,21 @@ public void AddNode(string parentNode, DialogueEntry entryToAdd = null)
358365
newDialogueEntry.conversant = theDatabase.Actors.FirstOrDefault(x => x.ID == theDatabase.Conversations[loadedConversation].conversantID);
359366
newDialogueEntry.menuText = "";
360367
newDialogueEntry.dialogueText = "";
368+
newDialogueEntry.fields = new List<DialogueEntry.Field>();
361369
}
362370
else
363371
{
364372
newDialogueEntry = new DialogueEntry(entryToAdd);
365373
newDialogueEntry.ID = theDatabase.Conversations[loadedConversation].DialogEntries.OrderByDescending(p => p.ID).First().ID + 1;
374+
newDialogueEntry.fields = new List<DialogueEntry.Field>();
375+
}
376+
377+
foreach (DialogueEntry.Field field in theDatabase.Conversations[loadedConversation].DialogEntries.Find(x => x.ID == 0).fields)
378+
{
379+
if (!selectedEntry.fields.Exists(y => y.name == field.name))
380+
{
381+
selectedEntry.fields.Add(new DialogueEntry.Field() { name = field.name, type = field.type, value = field.value });
382+
}
366383
}
367384

368385
//Add to conversation
@@ -538,6 +555,7 @@ public void SelectNode(string newNode)
538555
nodeTree = tcMain.FindName(newNode.Remove(0, 1)) as TreeNode;
539556
node = nodeTree.Content as NodeControl;
540557
currentNode = newNode;
558+
541559

542560
if (newNode == "_node_0")
543561
{
@@ -551,10 +569,38 @@ public void SelectNode(string newNode)
551569
editScript.IsEnabled = false;
552570
conditionsStack.DataContext = null;
553571
gridScript.DataContext = null;
572+
573+
selectedEntry = theDatabase.Conversations[loadedConversation].DialogEntries[0];
574+
if (selectedEntry.fields == null)
575+
{
576+
selectedEntry.fields = new List<DialogueEntry.Field>();
577+
}
578+
//dgDefaultFields.DataContext = selectedEntry;
579+
//dgDefaultFields.ItemsSource = selectedEntry.fields;
580+
//dgDefaultFields.Items.Refresh();
554581
}
555582
else
556583
{
557-
selectedEntry = theDatabase.Conversations[loadedConversation].DialogEntries.FirstOrDefault(x => x.ID == node.dialogueEntryID);
584+
selectedEntry = null;
585+
selectedEntry = theDatabase.Conversations[loadedConversation].DialogEntries.Find(x => x.ID == node.dialogueEntryID);
586+
587+
if (selectedEntry.fields == null)
588+
{
589+
selectedEntry.fields = new List<DialogueEntry.Field>();
590+
}
591+
592+
foreach(DialogueEntry.Field field in theDatabase.Conversations[loadedConversation].DialogEntries.Find(x => x.ID == 0).fields)
593+
{
594+
if(!selectedEntry.fields.Exists(y => y.name == field.name))
595+
{
596+
selectedEntry.fields.Add(new DialogueEntry.Field() { name = field.name, type = field.type, value = field.value});
597+
}
598+
}
599+
600+
//dgFields.DataContext = selectedEntry;
601+
//dgFields.ItemsSource = selectedEntry.fields;
602+
//dgFields.Items.Refresh();
603+
558604
node.DataContext = selectedEntry;
559605
Console.WriteLine("UserScript: " + selectedEntry.UserScript + " | UserScript.Length: " + selectedEntry.UserScript.Length + " | IsNullOrEmpty: " + string.IsNullOrEmpty(selectedEntry.UserScript) + " | IsNullOrWhiteSpace: " + string.IsNullOrWhiteSpace(selectedEntry.UserScript));
560606
gridDialogueEntry.DataContext = selectedEntry;
@@ -566,6 +612,17 @@ public void SelectNode(string newNode)
566612
editConditions.IsEnabled = true;
567613
editScript.IsEnabled = true;
568614
}
615+
616+
if (selectedEntry != null)
617+
{
618+
Console.WriteLine($"Changing Items | Selected ID: {selectedEntry.ID}");
619+
dgDefaultFields.DataContext = selectedEntry;
620+
dgDefaultFields.ItemsSource = selectedEntry.fields;
621+
dgDefaultFields.Items.Refresh();
622+
dgFields.DataContext = selectedEntry;
623+
dgFields.ItemsSource = selectedEntry.fields;
624+
dgFields.Items.Refresh();
625+
}
569626
}
570627

571628
private void DrawConversationTree(DialogHolder dh)
@@ -681,6 +738,8 @@ private void LoadConversation(int convotoload)
681738
//recOverview.GetBindingExpression(VisualBrush.VisualProperty).UpdateTarget();
682739
DrawExtraConnections();
683740
handledNodes.Clear();
741+
742+
SelectNode("_node_0");
684743
}
685744

686745
private void Delete_Node(TreeNode mainNode)
@@ -1279,7 +1338,8 @@ private void btnAddConversation_Click(object sender, RoutedEventArgs e)
12791338
actorID = 0,
12801339
actor = theDatabase.Actors[0],
12811340
conversantID = 0,
1282-
conversant = theDatabase.Actors[0]
1341+
conversant = theDatabase.Actors[0],
1342+
fields = new List<DialogueEntry.Field>()
12831343
};
12841344

12851345
newConvo.DialogEntries.Add(convoStart);
@@ -1804,6 +1864,47 @@ private void ScaleTransform_Changed(object sender, EventArgs e)
18041864
DrawExtraConnections();
18051865
}
18061866
}
1867+
1868+
private void btnAddField_Click(object sender, RoutedEventArgs e)
1869+
{
1870+
if (selectedEntry != null)
1871+
{
1872+
if(selectedEntry.fields == null)
1873+
{
1874+
selectedEntry.fields = new List<DialogueEntry.Field>();
1875+
}
1876+
selectedEntry.fields.Add(new DialogueEntry.Field());
1877+
dgFields.DataContext = selectedEntry;
1878+
dgFields.ItemsSource = selectedEntry.fields;
1879+
dgFields.Items.Refresh();
1880+
}
1881+
}
1882+
1883+
private void btnFieldDelete_Click(object sender, RoutedEventArgs e)
1884+
{
1885+
//Console.WriteLine($"Removing Field at Index: {dgFields.SelectedIndex} | {selectedEntry.fields?.Count}");
1886+
if (selectedEntry != null && selectedEntry.fields?.Count > dgFields.SelectedIndex)
1887+
{
1888+
selectedEntry.fields.RemoveAt(dgFields.SelectedIndex);
1889+
dgFields.DataContext = selectedEntry;
1890+
dgFields.ItemsSource = selectedEntry.fields;
1891+
dgFields.Items.Refresh();
1892+
}
1893+
}
1894+
1895+
private void btnAddDefaultField_Click(object sender, RoutedEventArgs e)
1896+
{
1897+
if(selectedEntry.ID == 0)
1898+
{
1899+
Console.Write("We're good");
1900+
}
1901+
}
1902+
1903+
private void btnDefaultFieldDelete_Click(object sender, RoutedEventArgs e)
1904+
{
1905+
1906+
}
1907+
18071908
}
18081909

18091910
public static class SelectOnInternalClick

TalkerMakerDeluxe/Properties/Resources.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

TalkerMakerDeluxe/Properties/Settings.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)