Skip to content

Commit

Permalink
Fix crash when importing
Browse files Browse the repository at this point in the history
Fix #24, #23
Bumped version
  • Loading branch information
Rokuazery committed May 7, 2023
1 parent 88c4888 commit 2632e2e
Show file tree
Hide file tree
Showing 18 changed files with 254 additions and 260 deletions.
27 changes: 27 additions & 0 deletions LoL Assist/Converters/RoleImageConverter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using LoL_Assist_WAPP.Models;
using LoLA.Data.Enums;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;

namespace LoL_Assist_WAPP.Converters
{
public class RoleImageConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var role = (Role)value;
if(role == Role.RECOMENDED) return $"{ConfigModel.RESOURCE_PATH}fill.png";
return $"{ConfigModel.RESOURCE_PATH}{role.ToString().Replace("BOTTOM", "adc")}.png";
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
7 changes: 4 additions & 3 deletions LoL Assist/LoL Assist.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{0BD0D0DA-C57A-43F1-A986-0B92F2235045}</ProjectGuid>
<OutputType>Exe</OutputType>
<OutputType>WinExe</OutputType>
<RootNamespace>LoL_Assist_WAPP</RootNamespace>
<AssemblyName>LoL Assist</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
Expand Down Expand Up @@ -67,9 +67,9 @@
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<Reference Include="LoLA, Version=2.0.0.2, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="LoLA, Version=2.0.0.5, Culture=neutral, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\LoLA\LoLA\bin\x64\Release\LoLA.dll</HintPath>
<HintPath>..\LoLA\LoLA\bin\x64\Debug\LoLA.dll</HintPath>
</Reference>
<Reference Include="PresentationFramework.Aero2" />
<Reference Include="System" />
Expand Down Expand Up @@ -104,6 +104,7 @@
<Compile Include="Commands\ItemRemovedCommand.cs" />
<Compile Include="Converters\ChampionToImageConverter.cs" />
<Compile Include="Converters\EmptyToNoneConverter.cs" />
<Compile Include="Converters\RoleImageConverter.cs" />
<Compile Include="Converters\NullToCollapseConverter.cs" />
<Compile Include="Converters\NullToVisibleConverter.cs" />
<Compile Include="Converters\RunePerkToolTipConverter.cs" />
Expand Down
6 changes: 3 additions & 3 deletions LoL Assist/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -172,17 +172,17 @@
</Grid>

<ComboBox ItemsSource="{Binding Path=Roles}" Visibility="{Binding Path=RoleSelectVisibility}" HorizontalAlignment="Left" VerticalAlignment="Top" ItemContainerStyle="{DynamicResource FlatItemContainerStyle}"
Style="{DynamicResource FlatComboboxStyle}" Width="135" SelectedItem="{Binding Path=SelectedRole, UpdateSourceTrigger=PropertyChanged}" Margin="-5,10,0,0" >
Style="{DynamicResource FlatComboboxStyle}" Width="135" SelectedItem="{Binding Path=SelectedRole, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Margin="-5,10,0,0" >
<ComboBox.ItemTemplate>
<DataTemplate>
<DockPanel>
<Border CornerRadius="5" Width="18" Height="18" Margin="0,0,5,0" VerticalAlignment="Center">
<Border.Background>
<ImageBrush ImageSource="{Binding Image}" RenderOptions.BitmapScalingMode="HighQuality"/>
<ImageBrush ImageSource="{Binding Path=., Converter={StaticResource RoleImageConverter}}" RenderOptions.BitmapScalingMode="HighQuality"/>
</Border.Background>
</Border>

<TextBlock TextTrimming="CharacterEllipsis" VerticalAlignment="Center" Text="{Binding Text}" Foreground="{DynamicResource FontPrimaryBrush}" FontSize="11" Margin="0,0,0,1"/>
<TextBlock TextTrimming="CharacterEllipsis" VerticalAlignment="Center" Text="{Binding Path=.}" Foreground="{DynamicResource FontPrimaryBrush}" FontSize="11" Margin="0,0,0,1"/>
</DockPanel>
</DataTemplate>
</ComboBox.ItemTemplate>
Expand Down
3 changes: 1 addition & 2 deletions LoL Assist/Models/LoLAWrapper.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
using LoLA.Networking.LCU.Objects;
using LoLA.Networking.LCU.Events;
using System.Collections.Generic;
using Converter = LoLA.Networking.WebWrapper.DataDragon.Data.Converter;
using LoLA.Networking.LCU.Enums;
using System.Threading.Tasks;
using LoLA.Networking.LCU;
using System.Linq;
using LoLA.Data;
using LoLA;
using System.Linq;

namespace LoL_Assist_WAPP.Models
{
Expand Down
4 changes: 2 additions & 2 deletions LoL Assist/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.0.7")]
[assembly: AssemblyFileVersion("2.0.0.7")]
[assembly: AssemblyVersion("2.0.0.8")]
[assembly: AssemblyFileVersion("2.0.0.8")]
[assembly: NeutralResourcesLanguage("")]
1 change: 1 addition & 0 deletions LoL Assist/ResourceDictionaries/Styles.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<converters:NullToVisibleConverter x:Key="NullToVisibleConverter"/>
<converters:TextToForegroundConverter x:Key="TextToForegroundConverter"/>
<converters:RunePerkToolTipConverter x:Key="RunePerkToolTipConverter"/>
<converters:RoleImageConverter x:Key="RoleImageConverter"/>

<Style x:Key="FocusVisual">
<Setter Property="Control.Template">
Expand Down
70 changes: 0 additions & 70 deletions LoL Assist/ViewModels/ChampionPickerViewModel-Rokuazery.cs

This file was deleted.

3 changes: 1 addition & 2 deletions LoL Assist/ViewModels/DownloadViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,7 @@ private void HideUserControl(object p)
return;
}

ShowMsgBox(new Action(() =>
{
ShowMsgBox(new Action(() => {
cancellationTokenSource.Cancel();
Utils.Animation.FadeOut(p as UserControl); }),
"A download is still in progress. Do you want to close the Download Panel and cancel the download?",
Expand Down
Loading

0 comments on commit 2632e2e

Please sign in to comment.