Skip to content

Commit ff78394

Browse files
skizzix3FluffierThanThou
authored andcommitted
Fixed minor UI/Window bugs
1 parent bc1dc1a commit ff78394

File tree

5 files changed

+22
-21
lines changed

5 files changed

+22
-21
lines changed

Source/Helpers/Mining/Dialog_MiningDebugOptions.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,91 +23,91 @@ protected override void DoListingItems()
2323
{
2424
foreach ( var thing in Find.CurrentMap.thingGrid.ThingsAt( UI.MouseCell() ).OfType<Mineable>() )
2525
Messages.Message( job.IsValidMiningTarget( thing ).ToString(), MessageTypeDefOf.SilentInput );
26-
} );
26+
}, false );
2727

2828

2929
DebugToolMap( "IsValidDeconstructionTarget", delegate
3030
{
3131
foreach ( var thing in Find.CurrentMap.thingGrid.ThingsAt( UI.MouseCell() ).OfType<Building>() )
3232
Messages.Message( job.IsValidDeconstructionTarget( thing ).ToString(),
3333
MessageTypeDefOf.SilentInput );
34-
} );
34+
}, false );
3535

3636
DebugToolMap( "Faction", delegate
3737
{
3838
foreach ( var thing in Find.CurrentMap.thingGrid.ThingsAt( UI.MouseCell() ).OfType<Building>() )
3939
Messages.Message( thing.Faction.ToStringSafe(), MessageTypeDefOf.SilentInput );
40-
} );
40+
}, false );
4141

4242
DebugToolMap( "AllowedBuilding", delegate
4343
{
4444
foreach ( var thing in Find.CurrentMap.thingGrid.ThingsAt( UI.MouseCell() ).OfType<Building>() )
4545
Messages.Message( job.AllowedBuilding( thing.def ).ToString(), MessageTypeDefOf.SilentInput );
46-
} );
46+
}, false);
4747

4848

4949
DebugToolMap( "AllowedMineral", delegate
5050
{
5151
foreach ( var thing in Find.CurrentMap.thingGrid.ThingsAt( UI.MouseCell() ).OfType<Mineable>() )
5252
Messages.Message( job.AllowedMineral( thing.def ).ToString(), MessageTypeDefOf.SilentInput );
53-
} );
53+
}, false);
5454

5555

5656
DebugToolMap( "IsRelevantDeconstructionTarget", delegate
5757
{
5858
foreach ( var thing in Find.CurrentMap.thingGrid.ThingsAt( UI.MouseCell() ).OfType<Building>() )
5959
Messages.Message( job.IsRelevantDeconstructionTarget( thing ).ToString(),
6060
MessageTypeDefOf.SilentInput );
61-
} );
61+
}, false);
6262

6363
DebugToolMap( "IsRelevantMiningTarget", delegate
6464
{
6565
foreach ( var thing in Find.CurrentMap.thingGrid.ThingsAt( UI.MouseCell() ).OfType<Mineable>() )
6666
Messages.Message( job.IsRelevantMiningTarget( thing ).ToString(), MessageTypeDefOf.SilentInput );
67-
} );
67+
}, false);
6868

6969
DebugToolMap( "IsInAllowedArea", delegate
7070
{
7171
foreach ( var thing in Find.CurrentMap.thingGrid.ThingsAt( UI.MouseCell() ).OfType<Building>() )
7272
Messages.Message( job.IsInAllowedArea( thing ).ToString(), MessageTypeDefOf.SilentInput );
73-
} );
73+
}, false);
7474

7575
DebugToolMap( "IsReachable", delegate
7676
{
7777
foreach ( var thing in Find.CurrentMap.thingGrid.ThingsAt( UI.MouseCell() ).OfType<Building>() )
7878
Messages.Message( job.IsReachable( thing ).ToString(), MessageTypeDefOf.SilentInput );
79-
} );
79+
}, false);
8080

8181
DebugToolMap( "IsRoomDivider", delegate
8282
{
8383
foreach ( var thing in Find.CurrentMap.thingGrid.ThingsAt( UI.MouseCell() ).OfType<Building>() )
8484
Messages.Message( job.IsARoomDivider( thing ).ToString(), MessageTypeDefOf.SilentInput );
85-
} );
85+
}, false);
8686

8787
DebugToolMap( "IsRoofSupport: basic", delegate
8888
{
8989
foreach ( var thing in Find.CurrentMap.thingGrid.ThingsAt( UI.MouseCell() ).OfType<Building>() )
9090
Messages.Message( job.IsARoofSupport_Basic( thing ).ToString(), MessageTypeDefOf.SilentInput );
91-
} );
91+
}, false); ;
9292

9393
DebugToolMap( "IsRoofSupport: advanced", delegate
9494
{
9595
foreach ( var thing in Find.CurrentMap.thingGrid.ThingsAt( UI.MouseCell() ).OfType<Building>() )
9696
Messages.Message( job.IsARoofSupport_Advanced( thing ).ToString(), MessageTypeDefOf.SilentInput );
97-
} );
97+
}, false);
9898

9999
DebugAction( "DrawSupportGrid", delegate
100100
{
101101
foreach ( var cell in job.manager.map.AllCells )
102102
if ( job.IsARoofSupport_Basic( cell ) )
103103
job.manager.map.debugDrawer.FlashCell( cell, DebugSolidColorMats.MaterialOf( Color.green ) );
104-
} );
104+
}, false);
105105

106106
DebugAction( "GetBaseCenter", delegate
107107
{
108108
var cell = Utilities.GetBaseCenter( job.manager );
109109
job.manager.map.debugDrawer.FlashCell( cell, DebugSolidColorMats.MaterialOf( Color.blue ) );
110-
} );
110+
}, false);
111111

112112
DebugToolMap( "DrawPath", delegate
113113
{
@@ -118,7 +118,7 @@ protected override void DoListingItems()
118118
TraverseMode.PassDoors, Danger.Some ) );
119119
path.DrawPath( null );
120120
path.ReleaseToPool();
121-
}
121+
}, false
122122
);
123123
}
124124
}

Source/Helpers/UI/UIThingFilterSearchable.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public void DoThingFilterConfigWindow( Rect canvas, ref Vector2 scrollPosition,
8181

8282
// main listing
8383
var listingRect = new Rect( 0f, curY, viewRect.width, 9999f );
84-
var listingTreeThingFilter = new Listing_TreeThingFilter( filter, parentFilter, null, null, null );
84+
var listingTreeThingFilter = new Listing_TreeThingFilter( filter, parentFilter, null, null, null, new RimWorld.QuickSearchFilter() );
8585
listingTreeThingFilter.Begin( listingRect );
8686
var node = ThingCategoryNodeDatabase.RootNode;
8787
if ( parentFilter != null )
@@ -91,7 +91,7 @@ public void DoThingFilterConfigWindow( Rect canvas, ref Vector2 scrollPosition,
9191
}
9292

9393
// draw the actual thing
94-
listingTreeThingFilter.DoCategoryChildren( node, 0, openMask, Find.CurrentMap, true );
94+
listingTreeThingFilter.ListCategoryChildren(node, openMask, Find.CurrentMap, new Rect(0f, curY+2f, viewRect.width-2f, 9999f));//DoCategoryChildren( node, 0, openMask, Find.CurrentMap, true );
9595
listingTreeThingFilter.End();
9696

9797
// update height.

Source/ManagerJobs/ManagerJob_Mining.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ public bool IsARoomDivider( Thing target )
441441
.ToArray();
442442

443443
// check if there are more than two rooms in the surrounding cells.
444-
var rooms = adjacent.Select( c => c.GetRoom( manager.map, RegionType.Normal ) )
444+
var rooms = adjacent.Select( c => c.GetRoom( manager.map) )
445445
.Where( r => r != null )
446446
.Distinct()
447447
.ToList();

Source/Triggers/Trigger_Threshold.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,13 +255,13 @@ public override void DrawTriggerConfig( ref Vector2 cur, float width, float entr
255255
{
256256
var option = string.Empty;
257257
Action onClick = () => Find.WindowStack.TryRemove( typeof( MainTabWindow_Manager ), false );
258-
Action onHover = null;
258+
Action<UnityEngine.Rect> onHover = null;
259259
if ( designation.target.HasThing )
260260
{
261261
var thing = designation.target.Thing;
262262
option = designationLabelGetter?.Invoke( designation ) ?? thing.LabelCap;
263263
onClick += () => CameraJumper.TryJumpAndSelect( thing );
264-
onHover += () => CameraJumper.TryJump( thing );
264+
onHover += (c) => CameraJumper.TryJump( thing );
265265
}
266266
else
267267
{
@@ -271,7 +271,7 @@ public override void DrawTriggerConfig( ref Vector2 cur, float width, float entr
271271
// so I suppose it doesn't matter -- Fluffy.
272272
option = designationLabelGetter?.Invoke( designation ) ?? cell.GetTerrain( map ).LabelCap;
273273
onClick += () => CameraJumper.TryJump( cell, map );
274-
onHover += () => CameraJumper.TryJump( cell, map );
274+
onHover += (c) => CameraJumper.TryJump( cell, map );
275275
}
276276

277277
options.Add( new FloatMenuOption( option, onClick, MenuOptionPriority.Default, onHover ) );

Source/Windows/Window_TriggerThresholdDetails.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Collections.Generic;
55
using UnityEngine;
66
using Verse;
7+
using RimWorld;
78

89
namespace FluffyManager
910
{

0 commit comments

Comments
 (0)