Community Coding Request: Mouseover help for the PLE buttons

Kael

Deity
Joined
May 6, 2002
Messages
17,403
Location
Paris, France
Any community members able to figure out a way to get mouseover help on 12monkeys Plot List Enchancement (PLE) buttons?

Teg, Vorshlumpf, Maian? Anyone?

It would be greatly appreciated.
 
I haven't played a FfH version with PLE yet, nor have I ever tried PLE, so I can't offer much help. Is this something broke when integrating PLE with FfH, or just a limitation of PLE?

I'm not even sure what these PLE "buttons" are. From the screenshots I've seen of PLE, I assume you mean those little buttons at the very top of the action/upgrade/ability display.
 
Maian said:
I haven't played a FfH version with PLE yet, nor have I ever tried PLE, so I can't offer much help. Is this something broke when integrating PLE with FfH, or just a limitation of PLE?

I'm not even sure what these PLE "buttons" are. From the screenshots I've seen of PLE, I assume you mean those little buttons at the very top of the action/upgrade/ability display.

Yeap thats them. There isnt anything broken about them. 12monkeys just didnt add in any sort of mouseover feature for them, so they are confusing for new players.
 
Perhaps you could give us new players some sort of overview of what they do, so at least those of us who read here regularly are up-to-speed? I figured a few of them out, but I didn't play long enough to experiment on all of them.
 
I remember having a lot of trouble trying to add hints for icons. Panels support hints, but AFAIK controls don't, with a couple exceptions - some WidgetTypes.* give the control predefined hints, e.g. promotion info. I don't think I ever found a way around the problem.

Well I can tell you one useful tidbit: the code that defines those buttons is at line 742 in screens\CvMainInterface.py. The buttons apparently are actually checkboxes.
 
Grillick said:
Perhaps you could give us new players some sort of overview of what they do, so at least those of us who read here regularly are up-to-speed? I figured a few of them out, but I didn't play long enough to experiment on all of them.
The original thread (http://forums.civfanatics.com/showthread.php?t=149572) explains it fairly well. Kael made some changes to the unit filters to more aptly fit FfH.

I've spent the last few hours just trying to figure 12monkey's code out and it's slow coming. I'll continue to look, but don't expect anything from me - I'm still a Python noob.

- Niilo
 
The PLE buttons really slow down gameplay, could you release a version without them?
 
I think I can just re-use the unit statistics code here - I'll try.
 
Deathling said:
The PLE buttons really slow down gameplay, could you release a version without them?

No, they are to integrated (and supporting multiple versions is a pain).

But i suspect your slowness isnt coming from PLE but in errors that are occuring with the PLE. Let me know if it speeds up with patch "h".
 
Ok, here you go. I couldn't really bugtest it since the whole thing is buggy, but I hope it works fine when you incorporate it into patch h. I haven't added any texts but just a little test string (buttonName, different for each button). The rest is up to you, since I don't know myself what the buttons are for ;)

My changes are commented with "Teg's Mouseover" (3 blocks), the naming and placement of the custom functions is still a bit misleading, since I just did a copy & paste from the unit statistics mod.
 

Attachments

Teg_Navanis said:
Ok, here you go. I couldn't really bugtest it since the whole thing is buggy, but I hope it works fine when you incorporate it into patch h. I haven't added any texts but just a little test string (buttonName, different for each button). The rest is up to you, since I don't know myself what the buttons are for ;)

My changes are commented with "Teg's Mouseover" (3 blocks), the naming and placement of the custom functions is still a bit misleading, since I just did a copy & paste from the unit statistics mod.

That works beautifully! Thanks Teg!
 
*nudge nudge* interested in incorporating some more 3rd party mod components? ;)
 
Teg_Navanis said:
*nudge nudge* interested in incorporating some more 3rd party mod components? ;)

Id love to get unit stats in. How long would you need sdk and python ownership to integrate?
 
I can do the SDK-changes in an hour. I just need the current version of CvUnits.cpp. I'll do the python merge later after bugtesting it myself.
 
Hmm.. Im running into some problems with the PLE mouseover. The addition of the "1" to the end of the function name tags seems to disable the buttons. But if I take the "1" off the mouseover doesnt work.
 
The problem might be that "PLE_FILTER_WOUND1" is split into inputClass.getFunctionName() (PLE_FILTER_WOUND) and inputClass.getID (1).

I'll try changing

Code:
			if (self.MainInterfaceInputMap.has_key(inputClass.getFunctionName())):	
				return self.MainInterfaceInputMap.get(inputClass.getFunctionName())(inputClass)

to

Code:
			if (self.MainInterfaceInputMap.has_key(inputClass.getFunctionName())):	
				return self.MainInterfaceInputMap.get(inputClass.getFunctionName())(inputClass)

			if (self.MainInterfaceInputMap.has_key(inputClass.getFunctionName() + "1")):	
				return self.MainInterfaceInputMap.get(inputClass.getFunctionName() + "1")(inputClass)
 
It worked, but the function returned before the mouseover code could be run. I had to move it up a bit. Here's how it looks now:

Code:
	# Will handle the input for this screen...
	def handleInput (self, inputClass):
## 12monkeys - PlotList Button Enhancement  - begin

## Teg's Mouseover begin
		if ( inputClass.getNotifyCode() == NotifyCode.NOTIFY_CURSOR_MOVE_ON and inputClass.getFunctionName().startswith("PLE")):
			self.showUnitStatsInfoPane(inputClass.getFunctionName())
		elif ( inputClass.getNotifyCode() == NotifyCode.NOTIFY_CURSOR_MOVE_OFF and inputClass.getFunctionName().startswith("PLE")):
			self.hideUnitStatsInfoPane()	
## Teg's Mouseover end

		if  (inputClass.getNotifyCode() == NotifyCode.NOTIFY_CURSOR_MOVE_ON) or \
			(inputClass.getNotifyCode() == NotifyCode.NOTIFY_CURSOR_MOVE_OFF) or \
			(inputClass.getNotifyCode() == NotifyCode.NOTIFY_CLICKED):
			if (self.MainInterfaceInputMap.has_key(inputClass.getFunctionName())):	
				return self.MainInterfaceInputMap.get(inputClass.getFunctionName())(inputClass)
			if (self.MainInterfaceInputMap.has_key(inputClass.getFunctionName() + "1")):	
				return self.MainInterfaceInputMap.get(inputClass.getFunctionName() + "1")(inputClass)
## 12monkeys - PlotList Button Enhancement  - end
		return 0
 
That works beautifully. Tested and everything is good.

I have to ask for my own curiosity though, why did the 1 have to be added? Why couldn't they have remained the same as the function names?

I understand why adding the 1 broke the haskey check. But I don't understand why if it doesn't have the 1 your mouseover code doesnt work.
 
Back
Top Bottom