Skip to content

Commit

Permalink
'Release 0.7.539 [nolog]'
Browse files Browse the repository at this point in the history
  • Loading branch information
FluffierThanThou committed Oct 1, 2018
1 parent 02972cd commit fcd207d
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 13 deletions.
2 changes: 1 addition & 1 deletion About/About.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ erdelf: invaluable help with Harmony transpilers
FluffierThanThou:

<size=24>Version</size>
This is version 0.6.532, for RimWorld 0.19.2009.
This is version 0.7.539, for RimWorld 0.19.2009.

</description>
</ModMetaData>
Binary file modified Assemblies/ModManager.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ Show your appreciation by buying me a coffee (or contribute towards a nice singl
[![Buy Me a Coffee](http://i.imgur.com/EjWiUwx.gif)](https://ko-fi.com/fluffymods)

# Version
This is version 0.6.532, for RimWorld 0.19.2009.
This is version 0.7.539, for RimWorld 0.19.2009.
4 changes: 2 additions & 2 deletions Source/ModConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"version": {
"alpha": 18,
"major": 0,
"minor": 6,
"build": 532
"minor": 7,
"build": 539
},
"visibility": 0,
"git_repo": "ModManager",
Expand Down
11 changes: 10 additions & 1 deletion Source/ModManager/ModButton/ModButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,16 @@ public virtual void DoModButton( Rect canvas, bool alternate = false, Action cli
}

public abstract bool IsCoreMod { get; }
public virtual bool MatchesFilter( string filter ) => filter.NullOrEmpty() || Name.ToUpper().Contains( filter.ToUpper() );

public virtual int MatchesFilter( string filter )
{
if ( filter.NullOrEmpty() || Name.ToUpper().Contains( filter.ToUpper() ) )
{
return 1;
}
return 0;
}

internal abstract void DoModActionButtons( Rect canvas );
internal abstract void DoModDetails( Rect canvas );
public virtual int LoadOrder => -1;
Expand Down
16 changes: 14 additions & 2 deletions Source/ModManager/ModButton/ModButton_Installed.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,18 @@ public static ModButton_Installed For( ModMetaData mod )

public override int LoadOrder => Selected?.LoadOrder() ?? base.LoadOrder;

public override int MatchesFilter( string filter )
{
if ( base.MatchesFilter( filter ) > 0 )
return 1;
if ( Selected.Author.ToUpperInvariant().Contains( filter.ToUpperInvariant() ) )
return 2;
// too many false positives.
//if ( Selected.Description.ToUpperInvariant().Contains( filter.ToUpperInvariant() ) )
// return 3;
return 0;
}

private List<ModIssue> _issues;
public override void Notify_RecacheIssues()
{
Expand Down Expand Up @@ -170,7 +182,7 @@ public override void DoModButton(
( SmallIconSize + SmallMargin ) * Versions.Count,
nameRect.height);

var deemphasized = deemphasizeFiltered && !filter.NullOrEmpty() && !MatchesFilter(filter);
var deemphasized = deemphasizeFiltered && !filter.NullOrEmpty() && MatchesFilter( filter ) <= 0;
GUI.color = ( deemphasized || !Selected.enabled ) ? Color.white.Desaturate() : Color.white;

Text.Anchor = TextAnchor.MiddleLeft;
Expand Down Expand Up @@ -263,7 +275,7 @@ internal override void DoModActionButtons( Rect canvas )

internal bool Matches(Dependency dep, bool strict = false )
{
return MatchesFilter( dep.Identifier )
return base.MatchesFilter( dep.Identifier ) > 0
&& dep.MatchesVersion( Selected, false );
}

Expand Down
2 changes: 1 addition & 1 deletion Source/ModManager/ModButton/ModButton_Missing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public override void DoModButton( Rect canvas, bool alternate = false, Action cl
canvas.width - SmallIconSize * 2 - SmallMargin,
canvas.height * 2 / 3f);

var deemphasized = deemphasizeFiltered && !filter.NullOrEmpty() && !MatchesFilter(filter);
var deemphasized = deemphasizeFiltered && !filter.NullOrEmpty() && MatchesFilter(filter) <= 0;

Text.Anchor = TextAnchor.MiddleLeft;
Text.Font = GameFont.Small;
Expand Down
4 changes: 2 additions & 2 deletions Source/ModManager/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
// 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("0.6.532")]
[assembly: AssemblyFileVersion("0.6.532")]
[assembly: AssemblyVersion("0.7.539")]
[assembly: AssemblyFileVersion("0.7.539")]
7 changes: 4 additions & 3 deletions Source/ModManager/Windows/Page_BetterModConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,8 @@ private void EnsureVisible( ref Vector2 scrollPosition, int index )
}

public List<ModButton> FilteredAvailableButtons => ModButtonManager.AvailableButtons
.Where( b => !FilterAvailable || b.MatchesFilter( _availableFilter ) )
.Where( b => !FilterAvailable || b.MatchesFilter( _availableFilter ) > 0 )
.OrderBy( b => FilterAvailable ? b.MatchesFilter( _availableFilter ) : 0 )
.ToList();

public void DoAvailableMods( Rect canvas )
Expand Down Expand Up @@ -572,7 +573,7 @@ public void DoAvailableMods( Rect canvas )
private bool _draggingOverAvailable = false;
private int _lastHoverIndex;
public List<ModButton> FilteredActiveButtons => ModButtonManager.ActiveButtons
.Where( b => !FilterActive || b.MatchesFilter( _activeFilter ) )
.Where( b => !FilterActive || b.MatchesFilter( _activeFilter ) > 0 )
.ToList();

public void DoActiveMods( Rect canvas )
Expand Down Expand Up @@ -727,7 +728,7 @@ public void DoFilterField( Rect canvas, ref string filter, ref bool visible, Foc
// code is a handy shortcut for mouseOver interactions.
if ( !filter.NullOrEmpty() )
{
if ( Widgets.ButtonImage( iconRect, Resources.Close ) )
if ( Widgets.ButtonImage( iconRect, Status_Cross ) )
{
filter = string.Empty;
Notify_FilterChanged();
Expand Down

0 comments on commit fcd207d

Please sign in to comment.