Skip to content

Commit

Permalink
Begin work on version list
Browse files Browse the repository at this point in the history
  • Loading branch information
TrinityDevelopers committed Apr 3, 2020
1 parent a0ac90a commit 899418f
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 0 deletions.
27 changes: 27 additions & 0 deletions ZenovaLauncher/Profiles/MinecraftVersion.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ZenovaLauncher
{
class MinecraftVersion
{
private string _name;
private string _uuid;
private bool _isBeta;

public MinecraftVersion(string name, string uuid, bool isBeta)
{
_name = name;
_uuid = uuid;
_isBeta = isBeta;
}

public string Name
{
get { return _name + (_isBeta ? " (Beta)" : ""); }
}
}
}
36 changes: 36 additions & 0 deletions ZenovaLauncher/Profiles/Profile.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ZenovaLauncher
{
class Profile
{
private MinecraftVersion _version;

public Profile(string name, MinecraftVersion version)
{
ProfileName = name;
_version = version;
}

public string ProfileName { get; set; }

public string VersionName
{
get { return _version.Name; }
}
}

class Profiles : ObservableCollection<Profile>
{
public Profiles()
{
Add(new Profile("Latest release", new MinecraftVersion("1.14.30.2", "uuid", false)));
Add(new Profile("Latest beta", new MinecraftVersion("1.16.0.55", "uuid", true)));
}
}
}
30 changes: 30 additions & 0 deletions ZenovaLauncher/ProfilesPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
xmlns:comment="Comments"
mc:Ignorable="d comment">

<Page.Resources>
<local:Profiles x:Key="CurrentProfiles" />
</Page.Resources>

<Grid>
<ui:ScrollViewerEx
HorizontalScrollBarVisibility="Hidden"
Expand Down Expand Up @@ -68,6 +72,32 @@
</ui:SimpleStackPanel>
</ui:SimpleStackPanel>
</Grid>
<Grid Grid.Row="1" HorizontalAlignment="Stretch">
<ListBox ItemsSource="{Binding Source={StaticResource CurrentProfiles}}" HorizontalContentAlignment="Stretch">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Background="Blue" HorizontalAlignment="Center">
<Grid MaxWidth="900" Margin="15,10,15,12" HorizontalAlignment="Stretch" Background="Green">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<ui:SimpleStackPanel Grid.Column="0" HorizontalAlignment="Left" Orientation="Horizontal">
<ui:SimpleStackPanel>
<TextBlock FontWeight="Bold" FontSize="16" Text="{Binding Path=ProfileName}" />
<TextBlock FontSize="12" Text="{Binding Path=VersionName}" />
</ui:SimpleStackPanel>
</ui:SimpleStackPanel>
<ui:SimpleStackPanel Grid.Column="2" HorizontalAlignment="Right" Orientation="Horizontal">
<Button Content="Play" Style="{DynamicResource AccentButtonStyle}" />
</ui:SimpleStackPanel>
</Grid>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</Grid>
</ui:ScrollViewerEx>
</Grid>
Expand Down
2 changes: 2 additions & 0 deletions ZenovaLauncher/ZenovaLauncher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@
<Compile Include="ProfilesPage.xaml.cs">
<DependentUpon>ProfilesPage.xaml</DependentUpon>
</Compile>
<Compile Include="Profiles\MinecraftVersion.cs" />
<Compile Include="Profiles\Profile.cs" />
<Compile Include="SettingsPage.xaml.cs">
<DependentUpon>SettingsPage.xaml</DependentUpon>
</Compile>
Expand Down

0 comments on commit 899418f

Please sign in to comment.