Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.5.2 #103

Merged
merged 1 commit into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/common.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<!--Development Variables-->
<PropertyGroup>
<Version>1.5.1</Version>
<Version>1.5.2</Version>
<HarmonyVersion>2.2.2</HarmonyVersion>
<BUTRSharedVersion>3.0.0.139</BUTRSharedVersion>
<BUTRModuleManagerVersion>5.0.222</BUTRModuleManagerVersion>
Expand Down
6 changes: 6 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
---------------------------------------------------------------------------------------------------
Version: 1.5.2
Game Versions: v1.0.0,v1.0.1,v1.0.2,v1.0.3,v1.1.0,v1.1.1,v1.1.2,v1.1.3,v1.1.4,v1.1.5,v1.1.6,v1.2.x
* BETA Release!
* Update Recommendations now have color grading
* Fixed mod dragging
---------------------------------------------------------------------------------------------------
Version: 1.5.1
Game Versions: v1.0.0,v1.0.1,v1.0.2,v1.0.3,v1.1.0,v1.1.1,v1.1.2,v1.1.3,v1.1.4,v1.1.5,v1.1.6,v1.2.x
* BETA Release!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
<Constant Name="ModToggle.Width" BrushName="Launcher.Mods.ModToggle" BrushLayer="Default" BrushValueType="Width" />
<Constant Name="ModToggle.Height" BrushName="Launcher.Mods.ModToggle" BrushLayer="Default" BrushValueType="Height" />

<Constant Name="ModSorter.Width" BrushName="Launcher.Mods.ModSorter" BrushLayer="Default" BrushValueType="Width"/>
<Constant Name="ModSorter.Height" BrushName="Launcher.Mods.ModSorter" BrushLayer="Default" BrushValueType="Height"/>

<Constant Name="VersionText.Width" Value="150" />

<Constant Name="ModuleType.Width" Value="27" />
Expand All @@ -20,13 +23,15 @@

<ListPanel Id="EntryPanel" WidthSizePolicy="StretchToParent" HeightSizePolicy="Fixed" SuggestedHeight="!Entry.Height" MarginBottom="5" AcceptDrag="true" DragWidget="DragWidget" IsVisible="@IsVisible">
<Children>

<!-- Toggle -->
<Widget WidthSizePolicy="Fixed" HeightSizePolicy="Fixed" SuggestedWidth="!ModToggle.Width" SuggestedHeight="!ModToggle.Height" VerticalAlignment="Center" >
<Children>
<Launcher.ToggleButton WidthSizePolicy="StretchToParent" HeightSizePolicy="StretchToParent" Command.Click="ExecuteSelect" IsSelected="@IsSelected" ManualToggle="true" IsDisabled="@IsNotSelectable" />
</Children>
</Widget>
<!-- Drag Drop -->
<ButtonWidget WidthSizePolicy="Fixed" HeightSizePolicy="Fixed" SuggestedWidth="!ModSorter.Width" SuggestedHeight="!ModSorter.Height" VerticalAlignment="Center" MarginLeft="10" Brush="Launcher.Mods.ModSorter" IsDisabled="true"/>
<!-- Module Type Icon -->
<Widget WidthSizePolicy="Fixed" HeightSizePolicy="Fixed" SuggestedWidth="!ModToggle.Width" SuggestedHeight="!ModToggle.Height" VerticalAlignment="Center" MarginLeft="!Margin.Left">
<Children>
Expand Down Expand Up @@ -64,12 +69,6 @@
<TextWidget WidthSizePolicy="StretchToParent" HeightSizePolicy="StretchToParent" Text="@VersionText" Brush="Launcher.Mods.ModNameText" Brush.FontSize="26" IsDisabled="true" />
</Children>
</Widget>
<!-- Drag Widget -->
<Widget Id="DragWidget" DoNotAcceptEvents="true" DoNotPassEventsToChildren="true" WidthSizePolicy="Fixed" HeightSizePolicy="Fixed" SuggestedWidth="200" SuggestedHeight="50" HorizontalAlignment="Center" VerticalAlignment="Center" IsDisabled="true" IsVisible="false">
<Children>
<TextWidget Text="@Name" WidthSizePolicy="StretchToParent" HeightSizePolicy="StretchToParent" Brush="Launcher.Mods.ModNameText" Brush.TextHorizontalAlignment="Left" />
</Children>
</Widget>
<!-- Issue Expand Indicator -->
<Widget WidthSizePolicy="Fixed" HeightSizePolicy="Fixed" SuggestedWidth="30" SuggestedHeight="30" VerticalAlignment="Center" MarginLeft="!Margin.Left" >
<Children>
Expand All @@ -79,7 +78,17 @@
<!-- Update Info -->
<Widget WidthSizePolicy="Fixed" HeightSizePolicy="Fixed" SuggestedWidth="!ModToggle.Width" SuggestedHeight="!ModToggle.Height" VerticalAlignment="Center" MarginLeft="!Margin.Left" >
<Children>
<BrushWidget WidthSizePolicy="StretchToParent" HeightSizePolicy="StretchToParent" Brush="Launcher.Info" IsVisible="@UpdateInfoAvailable">
<BrushWidget WidthSizePolicy="StretchToParent" HeightSizePolicy="StretchToParent" Brush="Launcher.Info" IsVisible="@IsUpdateHintHigh">
<Children>
<LauncherHintTriggerWidget DataSource="{UpdateHint}" WidthSizePolicy="StretchToParent" HeightSizePolicy="StretchToParent" Command.HoverBegin="ExecuteBeginHint" Command.HoverEnd="ExecuteEndHint" IsDisabled="true" />
</Children>
</BrushWidget>
<BrushWidget WidthSizePolicy="StretchToParent" HeightSizePolicy="StretchToParent" Brush="Launcher.Warning" IsVisible="@IsUpdateHintMedium">
<Children>
<LauncherHintTriggerWidget DataSource="{UpdateHint}" WidthSizePolicy="StretchToParent" HeightSizePolicy="StretchToParent" Command.HoverBegin="ExecuteBeginHint" Command.HoverEnd="ExecuteEndHint" IsDisabled="true" />
</Children>
</BrushWidget>
<BrushWidget WidthSizePolicy="StretchToParent" HeightSizePolicy="StretchToParent" Brush="Launcher.Error" IsVisible="@IsUpdateHintLow">
<Children>
<LauncherHintTriggerWidget DataSource="{UpdateHint}" WidthSizePolicy="StretchToParent" HeightSizePolicy="StretchToParent" Command.HoverBegin="ExecuteBeginHint" Command.HoverEnd="ExecuteEndHint" IsDisabled="true" />
</Children>
Expand All @@ -92,6 +101,13 @@
<ButtonWidget WidthSizePolicy="StretchToParent" HeightSizePolicy="StretchToParent" Brush="Launcher.Folder" Command.Click="ExecuteOpen"/>
</Children>
</Widget>

<!-- Drag Widget -->
<Widget Id="DragWidget" DoNotAcceptEvents="true" DoNotPassEventsToChildren="true" WidthSizePolicy="Fixed" HeightSizePolicy="Fixed" SuggestedWidth="200" SuggestedHeight="50" HorizontalAlignment="Center" VerticalAlignment="Center" IsDisabled="true" IsVisible="false">
<Children>
<TextWidget Text="@Name" WidthSizePolicy="StretchToParent" HeightSizePolicy="StretchToParent" Brush="Launcher.Mods.ModNameText" Brush.TextHorizontalAlignment="Left" />
</Children>
</Widget>

</Children>
</ListPanel>
Expand Down
17 changes: 17 additions & 0 deletions src/Bannerlord.LauncherEx/ViewModels/BUTRLauncherModuleVM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,15 @@ public string IssuesText
public LauncherHintVM? UpdateHint { get => _updateHint; set => SetField(ref _updateHint, value); }
private LauncherHintVM? _updateHint;

[BUTRDataSourceProperty]
public bool IsUpdateHintHigh => UpdateInfoAvailable && CompatibilityScore >= 75d;

[BUTRDataSourceProperty]
public bool IsUpdateHintMedium => UpdateInfoAvailable && CompatibilityScore is >= 50d and < 75d;

[BUTRDataSourceProperty]
public bool IsUpdateHintLow => UpdateInfoAvailable && CompatibilityScore is >= 0d and < 50d;

public BUTRLauncherModuleVM(ModuleInfoExtendedWithMetadata moduleInfoExtended, Action<BUTRLauncherModuleVM> select, Func<BUTRLauncherModuleVM, IEnumerable<string>> validate,
Func<ModuleInfoExtendedWithMetadata, ICollection<ModuleProviderType>> getPossibleProviders)
{
Expand Down Expand Up @@ -208,6 +217,10 @@ public void SetUpdateInfo(double compatibilityScore, string? recommendedVersion)
.SetTextVariable("CURRENTVERSION", VersionText)
.SetTextVariable("RECOMMENDEDVERSION", RecommendedVersion)
.SetTextVariable("GAMEVERSION", ApplicationVersionHelper.GameVersionStr()).ToString());

OnPropertyChanged(nameof(IsUpdateHintHigh));
OnPropertyChanged(nameof(IsUpdateHintMedium));
OnPropertyChanged(nameof(IsUpdateHintLow));
}

public void RemoveUpdateInfo()
Expand All @@ -216,6 +229,10 @@ public void RemoveUpdateInfo()
CompatibilityScore = 0d;
RecommendedVersion = string.Empty;
UpdateHint = null;

OnPropertyChanged(nameof(IsUpdateHintHigh));
OnPropertyChanged(nameof(IsUpdateHintMedium));
OnPropertyChanged(nameof(IsUpdateHintLow));
}


Expand Down
Loading