Feature Make KoLmafia upeffect arrows work like KoL's new upeffect

Bale

Minion
It's beginning to seem that if we add our own (or steal KoL's) right click menu to let you specify a count, and use the result in the sidecommand we ship to KoLmafia to interpret and submit, we will have a superset of KoL's uparrow. That's all Javascripty stuff that I'm not experienced with, though.

This would seem to be the best option. Maybe someone reading this thread has necessary javascript experience even if they are not a dev. If so, please post!


Our "uneffect" link has hover text that tells you how it will be removed.
For effects that'll use a green echo thinge there is a popup first saying "this will use a echo thingie, are you sure". Not that I know if that is in any way detectable or whatnot, or even interesting information.

I think that having both the hover text and the popup would be best. I kinda like that warning.
 

heeheehee

Developer
Staff member
The relevant javascript handler seems to be
Code:
	var multi = function  (e) {
		e.preventDefault();
		var link = this;
		pop_query($(this), 'How many times?', 'Do It!', function (res) {
			dojax(($(link).attr('href')+'&ajax=1').replace('qty=1', 'qty='+res));
		});
	};
	$('.upeffect').click(function (e) {
		e.preventDefault();
		if (e.shiftKey) multi.apply(this, [e]);
		else dojax($(this).attr('href')+'&ajax=1');
	});

I believe one approach would be to modify Mafia's sideCommand interface to accept a qty field, specify said field, then add the upeffect class to the arrows. That... should work?
 

Bale

Minion
But wouldn't that use upeffect.php? The idea is to use mafia's effect handling since it can buy items and restore mp as necessary, as well as behave consistently. That means avoiding uneffect.php. Or did I misunderstand your solution?
 

heeheehee

Developer
Staff member
It would not use upeffect.php, as far as I can tell. The handler (which is applied to everything with the class "upeffect") basically says "if you right-click (or shift-click), create a popup that replaces the qty field in the URL.

A second thing we'd have to handle is replacing the URLs of KoL's upeffect arrows.
 
Top