Skip to content

Commit

Permalink
Fixed bugs to do with the Items menu
Browse files Browse the repository at this point in the history
Opening the items menu now doesn't show all the details. You now have to select an item to do that
Fixed an issue where the program would crash when trying to add a command to a gettable item
  • Loading branch information
crispyricepc committed Mar 19, 2019
1 parent 522524c commit f9119a3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
6 changes: 5 additions & 1 deletion SkeletonGameMaker/Item.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,11 @@ public void OverWriteCommands(List<string> commandList)

if (IsGettable)
{
newCommand += ",get";
if (newCommand.Length != 0)
{
newCommand += ",";
}
newCommand += "get";
}

Commands = newCommand;
Expand Down
11 changes: 6 additions & 5 deletions SkeletonGameMaker/ItemsMenu.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,20 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:SkeletonGameMaker"
mc:Ignorable="d" Loaded="UserControl_Loaded" IsVisibleChanged="UserControl_IsVisibleChanged" MinWidth="800" MinHeight="450">
mc:Ignorable="d" Loaded="UserControl_Loaded" IsVisibleChanged="UserControl_IsVisibleChanged" MinWidth="800" MinHeight="450"
MaxWidth="4096" MaxHeight="4096">
<Grid>
<Label x:Name="LblHeader" Content="Items" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" FontWeight="Bold" FontSize="24"/>
<ListView x:Name="LvItemsList" HorizontalAlignment="Left" Margin="10,57,0,10" Width="167" SelectionChanged="LvItemsList_SelectionChanged">
<ListView.View>
<GridView>
<GridViewColumn x:Name="GvcolID">
<GridViewColumn x:Name="GvcolID" Width="{Binding ActualWidth, ElementName=LvItemsList, Mode=OneWay}">
<GridViewColumnHeader Content="Item Names"/>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
<Grid x:Name="GrdDetails" Margin="182,57,10,10" Visibility="Visible">
<Grid x:Name="GrdDetails" Margin="182,57,10,10" Visibility="Collapsed">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
Expand Down Expand Up @@ -64,7 +65,7 @@
<ListView x:Name="LvStatus" Margin="0,31,10,0" SelectionChanged="LvStatus_SelectionChanged" Grid.Row="0">
<ListView.View>
<GridView>
<GridViewColumn>
<GridViewColumn Width="{Binding ActualWidth, ElementName=GrdStatus, Mode=OneWay}">
<GridViewColumnHeader Content="Status List"/>
</GridViewColumn>
</GridView>
Expand All @@ -76,7 +77,7 @@
<ListView x:Name="LvCommands" SelectionChanged="LvCommands_SelectionChanged" Margin="0,31,0,0">
<ListView.View>
<GridView>
<GridViewColumn>
<GridViewColumn Width="{Binding ActualWidth, ElementName=LvCommands, Mode=OneWay}">
<GridViewColumnHeader Content="Commands List"/>
</GridViewColumn>
</GridView>
Expand Down

0 comments on commit f9119a3

Please sign in to comment.