Skip to content

Commit

Permalink
Backported freezing textbox bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Aragas committed Jun 22, 2022
1 parent 6b7dc94 commit b6cbe73
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 76 deletions.
79 changes: 6 additions & 73 deletions .github/workflows/test-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@ on:
types: [game_version_update, game_version_update_patch]
push:
branches:
- master
- dev
- v4.3.16
paths:
- '.github/workflows/test-and-publish.yml'
- 'src/**'
- 'build/**'
- 'tests/**'
pull_request:
branches:
- dev
- v4.3.16
# will be triggereg when undrafting or requesting review
types: [review_requested, ready_for_review]
paths:
Expand Down Expand Up @@ -95,14 +94,14 @@ jobs:

# ignore Stable_Release and treat is as Release
- name: Build MCM (Release)
if: ${{ github.ref == 'refs/heads/master' }}
#if: ${{ github.ref == 'refs/heads/master' }}
run: >-
mkdir bannerlord-publish;
dotnet build src/MCM.Publish/MCM.Publish.csproj --configuration Stable_Release -p:GameFolder="$PWD/bannerlord-publish";
shell: pwsh

- name: Upload Bannerlord folder
if: ${{ github.ref == 'refs/heads/master' }}
#if: ${{ github.ref == 'refs/heads/master' }}
uses: actions/upload-artifact@v2
with:
name: bannerlord
Expand All @@ -115,7 +114,7 @@ jobs:
publish-on-nuget:
name: Publish on NuGet
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/master' }}
#if: ${{ github.ref == 'refs/heads/master' }}
needs: test
steps:
- name: Setup
Expand Down Expand Up @@ -155,79 +154,13 @@ jobs:
done
shell: bash

###########################
# NEXUS #
###########################
publish-on-nexusmods:
name: Publish on NexusMods
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/master' && false }}
needs: test
steps:
- name: Setup
uses: butr/[email protected]
with:
github-token: ${{secrets.GITHUB_TOKEN}}

- name: Download bannerlord folder
uses: actions/download-artifact@v2
with:
name: bannerlord
path: ./bannerlord

- name: Zip MCM.Standalone
run: 7z a -t7z MCM.Standalone.7z ./bannerlord/*
#shell: pwsh
# pwsh casues it to include the root folder

- name: Install Bannerlord.ChangelogParser and Bannerlord.NexusmodsUploader
run: >-
dotnet tool install -g Bannerlord.ChangelogParser;
dotnet tool install -g Bannerlord.NexusmodsUploader;
shell: pwsh

- name: Run ChangelogParser
id: changelog
run: |
vers="$(bannerlord_changelog_parser latestversion -f "$PWD/changelog.txt")"
echo "::set-output name=mod_version::$vers"
desc="$(bannerlord_changelog_parser fulldescription -f "$PWD/changelog.txt")"
desc="${desc//'%'/'%25'}"
desc="${desc//$'\n'/'%0A'}"
desc="${desc//$'\r'/'%0D'}"
echo "::set-output name=mod_description::$desc"
shell: bash

- name: Start Selenoid
uses: Xotabu4/selenoid-github-action@v1

- name: Run NexusmodsUploader
run: >-
bannerlord_nexusmods_uploader upload -g mountandblade2bannerlord -m 612 -n "Mod Configuration Menu"
-v "v${{steps.changelog.outputs.mod_version}}" -l true -e true -d "${{steps.changelog.outputs.mod_description}}"
-p "$PWD/MCM.Standalone.7z";
env:
NEXUSMODS_COOKIES_JSON: '${{secrets.NEXUSMODS_COOKIES_JSON}}'
shell: pwsh

- name: Password protect Screenshots
run: 7z a -p${{secrets.SCREENSHOTS_PASSWORD}} Screenshots.7z ./Screenshots/*
#shell: pwsh
# pwsh casues it to include the root folder

- name: Upload Screenshots Artifact
uses: actions/upload-artifact@v2
with:
name: Screenshots
path: Screenshots.7z

###########################
# GITHUB #
###########################
publish-on-github:
name: Publish on GitHub
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/master' }}
#if: ${{ github.ref == 'refs/heads/master' }}
needs: test
steps:
- name: Setup
Expand Down
2 changes: 1 addition & 1 deletion build/common.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<PropertyGroup>
<GameVersion>1.4.3</GameVersion>
<Version>4.3.23</Version>
<Version>4.3.24</Version>
<HarmonyVersion>2.1.1</HarmonyVersion>
<ButterLibVersion>1.0.31</ButterLibVersion>
<UIExtenderExVersion>2.1.8</UIExtenderExVersion>
Expand Down
4 changes: 4 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
---------------------------------------------------------------------------------------------------
Version: 4.3.24
Game Versions: e1.4.3,e1.5.0,e1.5.1,e1.5.2,e1.5.3,e1.5.4,e1.5.5,e1.5.6,e1.5.7,e1.5.8,e1.5.9,e1.5.10,e1.6.0,e1.6.1,e1.6.2,e1.6.3,e1.6.4,e1.6.5,e1.7.0,e1.7.1
* Backported freezing textbox bug
---------------------------------------------------------------------------------------------------
Version: 4.3.23
Game Versions: e1.4.3,e1.5.0,e1.5.1,e1.5.2,e1.5.3,e1.5.4,e1.5.5,e1.5.6,e1.5.7,e1.5.8,e1.5.9,e1.5.10,e1.6.0,e1.6.1,e1.6.2,e1.6.3,e1.6.4,e1.6.5,e1.7.0,e1.7.1
* Sandbox settings creation
Expand Down
4 changes: 3 additions & 1 deletion src/MCM.UI/GUI/ViewModels/SettingsPropertyVM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ public float FloatValue
get => IsFloatVisible ? PropertyReference.Value is float val ? val : float.MinValue : 0f;
set
{
if (IsFloatVisible && FloatValue != value)
value = Math.Max(Math.Min(value, MaxValue), MinValue);
if (IsFloatVisible && Math.Abs(FloatValue - value) >= Constants.Tolerance) // Todo: check other float comparisons
{
URS.Do(new SetValueTypeAction<float>(PropertyReference, value));
OnPropertyChanged(nameof(FloatValue));
Expand All @@ -100,6 +101,7 @@ public int IntValue
get => IsIntVisible ? PropertyReference.Value is int val ? val : int.MinValue : 0;
set
{
value = (int) Math.Max(Math.Min(value, MaxValue), MinValue);
if (IsIntVisible && IntValue != value)
{
URS.Do(new SetValueTypeAction<int>(PropertyReference, value));
Expand Down
2 changes: 1 addition & 1 deletion src/MCM.UI/MCM.UI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

<!--Windows Forms-->
<ItemGroup>
<_SDKImplicitReference Include="System.Windows.Forms" />
<Reference Include="System.Windows.Forms" />
</ItemGroup>
<!--Windows Forms-->

Expand Down
7 changes: 7 additions & 0 deletions src/MCM/Constants.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace MCM
{
public class Constants
{
public static float Tolerance = 0.000_001f;
}
}

0 comments on commit b6cbe73

Please sign in to comment.