Feature Mood Manager auto fill extra option to use current buffs explicitly

matt.chugg

Moderator
When clicking auto-fill in the mood manager it would be useful (to me anyway) to have another option in the auto-fill options list to use the current buffs explicitly, I'm not sure how it would be worded to avoid confusion but something along the lines of would suit me:

Replace mood with current active effects
Add current effects to existing mood [or] Merge existing effects into current mood
Create mood from all castable buffs

In my mind, choosing to replace the mood wouldn't un-effect anything, just stop rebuffing it

Its been a while since I did anything useful around here, so maybe i'll get eclipse/netbeans set up again look into this myself.
 

matt.chugg

Moderator
Would this do the trick?

Edit minimalSet to accept a clearList boolean value, if true remove triggers first resulting in a clean copy of active buffs if called with true, and current behavior if called with false?

Code:
# This patch file was generated by NetBeans IDE
# Following Index: paths are relative to: C:\Users\Matt\Documents\NetBeansProjects\src
# This patch can be applied using context Tools: Patch action on respective folder.
# It uses platform neutral UTF-8 encoding and \n newlines.
# Above lines and this line are ignored by the patching process.
Index: net/sourceforge/kolmafia/moods/MoodManager.java
--- net/sourceforge/kolmafia/moods/MoodManager.java Base (BASE)
+++ net/sourceforge/kolmafia/moods/MoodManager.java Locally Modified (Based On LOCAL)
@@ -304,7 +304,7 @@
 		}
 	}
 
-	public static final void minimalSet()
+	public static final void minimalSet(boolean ClearList)
 	{
 		String currentMood = Preferences.getString( "currentMood" );
 		if ( currentMood.equals( "apathetic" ) )
@@ -312,6 +312,11 @@
 			return;
 		}
 
+                if(ClearList) 
+                {
+                    removeTriggers(MoodManager.currentMood.getTriggers());
+                }
+
 		// If there's any effects the player currently has and there
 		// is a known way to re-acquire it (internally known, anyway),
 		// make sure to add those as well.
@@ -451,7 +456,7 @@
 		// Now add in all the buffs from the minimal buff set, as those
 		// are included here.
 
-		MoodManager.minimalSet();
+		MoodManager.minimalSet(false);
 	}
 
 	private static final void pickSkills( final List skills, final int limit, final String [] rankedBuffs )
Index: net/sourceforge/kolmafia/swingui/panel/MoodOptionsPanel.java
--- net/sourceforge/kolmafia/swingui/panel/MoodOptionsPanel.java Base (BASE)
+++ net/sourceforge/kolmafia/swingui/panel/MoodOptionsPanel.java Locally Modified (Based On LOCAL)
@@ -297,7 +297,7 @@
 		public void actionCancelled()
 		{
 			String[] autoFillTypes =
-				new String[] { "minimal set (current active buffs)", "maximal set (all castable buffs)" };
+				new String[] { "Merge current buffs with mood", "Replace mood with current buffs", "maximal set (all castable buffs)" };
 			String desiredType =
 				(String) InputFieldUtilities.input( "Which kind of buff set would you like to use?", autoFillTypes );
 
@@ -308,10 +308,12 @@
 
 			if ( desiredType.equals( autoFillTypes[ 0 ] ) )
 			{
-				MoodManager.minimalSet();
+				MoodManager.minimalSet(false);
 			}
-			else
+                        else if(desiredType.equals(autoFillTypes [ 1 ]))
 			{
+				MoodManager.minimalSet(true);
+			} else {
 				MoodManager.maximalSet();
 			}
 
Index: net/sourceforge/kolmafia/textui/command/SaveAsMoodCommand.java
--- net/sourceforge/kolmafia/textui/command/SaveAsMoodCommand.java Base (BASE)
+++ net/sourceforge/kolmafia/textui/command/SaveAsMoodCommand.java Locally Modified (Based On LOCAL)
@@ -46,7 +46,7 @@
 	@Override
 	public void run( final String cmd, final String parameters )
 	{
-		MoodManager.minimalSet();
+		MoodManager.minimalSet(false);
 		MoodManager.saveSettings();
 	}
 }
 

lostcalpolydude

Developer
Staff member
This lets you skip clicking delete list, then new list, retyping the name, then auto-fill. Or highlighting everything in the current mood, pressing Delete, then clicking auto-fill.

I don't use those buttons much (it's likely that I've never used auto-fill), so I'll let someone else decide if adding a button to save those clicks makes sense.
 
Top