diff --git a/.editorconfig b/.editorconfig index 3e6adb7..a52bb32 100644 --- a/.editorconfig +++ b/.editorconfig @@ -43,6 +43,20 @@ dotnet_naming_rule.consts_must_be_all_caps.severity = warning dotnet_naming_rule.consts_must_be_all_caps.symbols = const_fields dotnet_naming_rule.consts_must_be_all_caps.style = all_caps + +# Turn off the naming style that enforces an underscore prefix for private fields +dotnet_naming_style.underscore_prefix_style.capitalization = camel_case +dotnet_naming_style.underscore_prefix_style.required_prefix = _ + +# Remove the rule that ties the naming style to private fields +dotnet_naming_rule.private_fields_underscore_rule.severity = none +dotnet_naming_rule.private_fields_underscore_rule.symbols = private_fields +dotnet_naming_rule.private_fields_underscore_rule.style = underscore_prefix_style + +# Symbol group for private fields (so the rule can be disabled) +dotnet_naming_symbols.private_fields.applicable_kinds = field +dotnet_naming_symbols.private_fields.applicable_accessibilities = private + # Formatting csharp_new_line_before_open_brace = all csharp_indent_case_contents = true diff --git a/CyberBits/Assets/game_die.png b/CyberBits/Assets/game_die.png new file mode 100644 index 0000000..0f4404b Binary files /dev/null and b/CyberBits/Assets/game_die.png differ diff --git a/CyberBits/Bits.cs b/CyberBits/Bits.cs deleted file mode 100644 index 930eed5..0000000 --- a/CyberBits/Bits.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace CyberBits; - -public record Bits( - [property: JsonPropertyName("image")] - string Image, - [property: JsonPropertyName("feat")] - string Feat, - [property: JsonPropertyName("model")] - string[] Model, - [property: JsonPropertyName("style")] - string[] Style - ); - -public record Addon( - [property: JsonPropertyName("cyberware")] - string[] Cyberware -); diff --git a/CyberBits/CyberBits.csproj b/CyberBits/CyberBits.csproj index d98e0b8..1ed5516 100644 --- a/CyberBits/CyberBits.csproj +++ b/CyberBits/CyberBits.csproj @@ -9,9 +9,15 @@ - - - + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + diff --git a/CyberBits/Data/cock.json b/CyberBits/Data/cock.json new file mode 100644 index 0000000..345a28f --- /dev/null +++ b/CyberBits/Data/cock.json @@ -0,0 +1,21 @@ +{ + "image": "avares://CyberBits/Assets/cock.jpg", + "feat": "Aim Piss", + "model": [ + "Au Natural", + "Les Americaines", + "La Grand Chungus", + "Veini Vici", + "Das Banane", + "The Ace Custom" + ], + "extra": [ + "Hairy", + "Dangly", + "Asymmetrical", + "Bulbous", + "Doubled", + "Wrinkly", + "Cyber" + ] +} diff --git a/CyberBits/Data/pussy.json b/CyberBits/Data/pussy.json new file mode 100644 index 0000000..ab57ac3 --- /dev/null +++ b/CyberBits/Data/pussy.json @@ -0,0 +1,20 @@ +{ + "image": "avares://CyberBits/Assets/pussy.jpg", + "feat": "Boom of the Mother Godness", + "model": [ + "The Shy Sharon", + "The Proud Priscilla", + "The Matronly Miriam", + "The Stretchy Sandra", + "The Outer Olivia" + ], + "extra": [ + "Huge", + "Hooded", + "Bright", + "Shifted", + "Hard", + "Expansive", + "Cyber" + ] +} diff --git a/CyberBits/Data/universal.json b/CyberBits/Data/universal.json new file mode 100644 index 0000000..0a0b6e3 --- /dev/null +++ b/CyberBits/Data/universal.json @@ -0,0 +1,39 @@ +{ + "aesthetic": [ + "Bioware", + "Cyberware", + "Roboware", + "Holoware" + ], + "cyberware": [ + "Piercings", + "Datajack", + "Censor Field", + "Laser Sight", + "AI-Controlled Booster Module", + "Second Bladder", + "Map Hack", + "Monowire Blade", + "Projectile Launcher" + ], + "pubes": [ + "The Baldie", + "The Peach", + "The Landing Strip", + "The Peek-a-Boo", + "The Rectangle", + "The Bar Code", + "The Heart", + "The Lighting Bolt", + "The Neat Triangle", + "The Forest", + "The Jungle", + "The Breath of the Wild" + ], + "butt": + [ + "Big", + "Round", + "Firm" + ] +} diff --git a/CyberBits/DataFiles.cs b/CyberBits/DataFiles.cs new file mode 100644 index 0000000..5bb1277 --- /dev/null +++ b/CyberBits/DataFiles.cs @@ -0,0 +1,8 @@ +namespace CyberBits; + +public struct DataFiles +{ + public const string COCK_JSON = "/Data/cock.json"; + public const string PUSSY_JSON = "Data/pussy.json"; + public const string UNIVERSAL_JSON = "Data/universal.json"; +} diff --git a/CyberBits/Genitals.cs b/CyberBits/Genitals.cs new file mode 100644 index 0000000..5a91bb0 --- /dev/null +++ b/CyberBits/Genitals.cs @@ -0,0 +1,33 @@ +using CommunityToolkit.Mvvm.ComponentModel; + +namespace CyberBits; + +public enum Genitals +{ + COCK, + PUSSY +} + +public record GenitalModel( + [property: JsonPropertyName("image")] + string Image, + [property: JsonPropertyName("feat")] + string Feat, + [property: JsonPropertyName("model")] + string[] Model, + [property: JsonPropertyName("aesthetic")] + string[] Aesthetic, + [property: JsonPropertyName("extra")] + string[] Extra // Balls or Clits + ); + +public record UniversalModel( + [property: JsonPropertyName("aesthetic")] + string[] Aesthetic, + [property: JsonPropertyName("cyberware")] + string[] Cyberware, + [property: JsonPropertyName("pubes")] + string[] Pubes, + [property: JsonPropertyName("butt")] + string[] Butt +); diff --git a/CyberBits/ImageHelper.cs b/CyberBits/ImageHelper.cs index 808204b..06781f5 100644 --- a/CyberBits/ImageHelper.cs +++ b/CyberBits/ImageHelper.cs @@ -16,7 +16,7 @@ public static class ImageHelper return new Bitmap(AssetLoader.Open(resourceUri)); } - public static async Task LoadFromWeb(Uri url) + public static async Task LoadFromWebAsync(Uri url) { try { diff --git a/CyberBits/ResourceFiles.cs b/CyberBits/ResourceFiles.cs deleted file mode 100644 index 09d3c03..0000000 --- a/CyberBits/ResourceFiles.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace CyberBits; - -public struct ResourceFiles -{ - public const string COCK_JSON = "Resources/cock.json"; - public const string PUSSY_JSON = "Resources/pussy.json"; - public const string ADDONS_JSON = "Resources/addons.json"; -} diff --git a/CyberBits/Resources/addons.json b/CyberBits/Resources/addons.json deleted file mode 100644 index 3f038b0..0000000 --- a/CyberBits/Resources/addons.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "cyberware": [ - "Piercings", - "Datajack" - ] -} diff --git a/CyberBits/Resources/cock.json b/CyberBits/Resources/cock.json deleted file mode 100644 index b11d20b..0000000 --- a/CyberBits/Resources/cock.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "image": "avares://CyberBits/Assets/cock.jpg", - "feat": "Aim Piss", - "model": [ - "Au Natural", - "Les Americaines" - ], - "style": [ - "Bioware", - "Cyberware" - ], - "cyberware": [ - "Piercings", - "Datajack" - ] -} diff --git a/CyberBits/Resources/pussy.json b/CyberBits/Resources/pussy.json deleted file mode 100644 index 3608721..0000000 --- a/CyberBits/Resources/pussy.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "image": "avares://CyberBits/Assets/pussy.jpg", - "feat": "Boom of the Mother Godness", - "model": [ - "Au Natural", - "Les Americaines" - ], - "style": [ - "Bioware", - "Cyberware" - ] -} diff --git a/CyberBits/ViewModels/ViewModelBase.cs b/CyberBits/ViewModels/ViewModelBase.cs index 3d616ef..732a5ea 100644 --- a/CyberBits/ViewModels/ViewModelBase.cs +++ b/CyberBits/ViewModels/ViewModelBase.cs @@ -1,11 +1,12 @@ -using System.Collections.ObjectModel; +using System; +using System.Collections.ObjectModel; using CommunityToolkit.Mvvm.ComponentModel; namespace CyberBits.ViewModels; public partial class ViewModelBase : ObservableObject { - public ObservableCollection GenitalsList { get; } = ["Cock", "Pussy"]; + public Genitals[] GenitalOptions { get; } = Enum.GetValues(); public ObservableCollection ModelsList { get; } = [ @@ -54,7 +55,25 @@ public partial class ViewModelBase : ObservableObject "The Breath of the Wild" ]; - [ObservableProperty] private string? _selectedBits; + public ObservableCollection ExtrasList { get; } = + [ + "Hairy", + "Dangly", + "Asymmetrical", + "Bulbous", + "Doubled", + "Wrinkly", + "Cyber" + ]; + + public ObservableCollection ButtsList { get; } = + [ + "Big", + "Round", + "Firm" + ]; + + [ObservableProperty] private Genitals _selectedBits = Genitals.COCK; [ObservableProperty] private string? _selectedModels; @@ -63,4 +82,8 @@ public partial class ViewModelBase : ObservableObject [ObservableProperty] private string? _selectedCyberware; [ObservableProperty] private string? _selectedPubes; + + [ObservableProperty] private string? _selectedExtras; + + [ObservableProperty] private string? _selectedButt; } diff --git a/CyberBits/Views/MainWindow.axaml b/CyberBits/Views/MainWindow.axaml index adf846b..d03aad9 100644 --- a/CyberBits/Views/MainWindow.axaml +++ b/CyberBits/Views/MainWindow.axaml @@ -3,8 +3,8 @@ xmlns:vm="using:CyberBits.ViewModels" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - mc:Ignorable="d" d:DesignWidth="720" d:DesignHeight="430" - Width="720" Height="430" CanResize="False" + mc:Ignorable="d" d:DesignWidth="700" d:DesignHeight="520" + Width="700" Height="520" CanResize="False" ExtendClientAreaToDecorationsHint="True" x:Class="CyberBits.Views.MainWindow" x:DataType="vm:MainWindowViewModel" @@ -25,49 +25,72 @@ Text="CyberBits" > - + - - - + - + - + + + - + + - + + + diff --git a/CyberBits/Views/MainWindow.axaml.cs b/CyberBits/Views/MainWindow.axaml.cs index 3569087..50032c7 100644 --- a/CyberBits/Views/MainWindow.axaml.cs +++ b/CyberBits/Views/MainWindow.axaml.cs @@ -1,29 +1,77 @@ using System; +using System.IO; +using System.Reflection; +using System.Text.Json; using Avalonia.Controls; namespace CyberBits.Views; public partial class MainWindow : Window { + string? AppPath => Path.GetDirectoryName(Assembly.GetAssembly(typeof(MainWindow))?.Location); + public MainWindow() { InitializeComponent(); - VersionBox.Text = $"v{AppConsts.VERSION}"; + try + { + var univieralFile = File.ReadAllText($"{AppPath}//{DataFiles.UNIVERSAL_JSON}"); + var univieralData = JsonSerializer.Deserialize(univieralFile); + + PubesItems.ItemsSource = univieralData?.Pubes; + CyberwareItems.ItemsSource = univieralData?.Cyberware; + AestheticsItems.ItemsSource = univieralData?.Aesthetic; + ButtOptions.ItemsSource = univieralData?.Butt; + } + catch (Exception e) + { + Console.WriteLine(e); + throw; + } + +#if DEBUG + VersionBox.Text = $"{AppConsts.VERSION}-{ThisAssembly.Git.Commit}"; +#else + VersionBox.Text = AppConsts.VERSION; +#endif + + } + + void GenitalSwap(string image, string data) + { + + try + { + var genitalFile = File.ReadAllText($"{AppPath}//{data}"); + var genitalData = JsonSerializer.Deserialize(genitalFile); + var genitalImage = ImageHelper.LoadFromResource(new Uri(image)); + + BitsImage.Source = genitalImage; + ModelItems.ItemsSource = genitalData?.Model; + ExtraItems.ItemsSource = genitalData?.Extra; + } + catch (Exception e) + { + Console.WriteLine(e); + throw; + } } private void SelectedBitsControl_OnSelectionChanged(object? sender, SelectionChangedEventArgs e) { + var appPath = Path.GetDirectoryName(Assembly.GetAssembly(typeof(MainWindow))?.Location); + switch (BitSelection.SelectionBoxItem) { - case "Pussy": - var pussy = ImageHelper.LoadFromResource(new Uri("avares://CyberBits/Assets/pussy.jpg")); - BitsImage.Source = pussy; + case Genitals.PUSSY: + GenitalSwap("avares://CyberBits/Assets/pussy.jpg", DataFiles.PUSSY_JSON); + ExtrasText.Text = "Clits"; break; - case "Cock": - var cock = ImageHelper.LoadFromResource(new Uri("avares://CyberBits/Assets/cock.jpg")); - BitsImage.Source = cock; + case Genitals.COCK: + GenitalSwap("avares://CyberBits/Assets/cock.jpg", DataFiles.COCK_JSON); + ExtrasText.Text = "Balls"; break; } }