So, I wrote a little addon event manager co-opting some utilities I wrote for the Moon Mod and setting them up to be easily addable to FfH2. They didn't seem to be of any interest to folks there, but in the interest of the post not getting entirely lost I thought I would post it up here.
Right now I haven't made any sort of fancy installer, and I'm not really intending to. If this ModComp actually turns out to be of general interest, I may get together with TheLopez and adopy the same ini config system he's using, and write some better general instructions for adding this bit onto an existing mod.
For now, to install, extract the zip into your Mod/FfH2/Assets/Python/ folder.
Ok, once extracted you have to open up the CvEventInterface.py file in Python/entrypoints/ and change two lines as follows:
The commented out lines are the old lines, the lines underneath them are the new ones.
Next, go into the addon/ folder and edit the CvAddonEventManager.py file to replace three lines (the ones which reference CvFFHSpellsEventManager)...
And that's it. Things should work as normal. If you catch keyboard events already, or have other conflicts (most likely because you are already utilizing one or both plot layers in your mod already), then you'll need to do more modifications.
Features:
Ctrl-M allows you to play a user mark (an arbitrary sign). Ctrl-M where a sign is currently will remove it. (I think this was the music key, so I should probably change it sometime...)
Ctrl-Shift-B enables Barbarian marking which will mark all the barbarians you can see with a color coded marker indicating the highest mp of any unit present.
Ctrl-Shift-L enables messaging during Barbarian Marking. This will cause the marker to send out notifications which you can click on to get sent to where the barbarians are. You have to enable marking in order to receive the listings.
Ctrl-Shift-P enters City Placement mode. This allows you to plan out where you want to place your cities. Click to place a city spot. Click an existing spot to remove it. Ctrl-Shift-P again to disable it again.
Ctrl-K will display the city grids for your cities (I think potentials, not current ones, I wrote it a long time ago, so I forget).
Ctrl... P I think will turn on 12Monkey's movement display code, to see where the currently selected unit can move. Note it doesn't work for stacks. That code was written by 12Monkey's, not by me, so I can take no credit for it .
And that's it. I find these utilities to be great, maybe you will too.
Oh, you can't have City Grid and Barbarian Markers up at the same time. Too few display layers. I haven't written the sort of complicated infrastructure to layer the two together. This entire suite was written very much ad hoc one afternoon while I was playing around with the Moon Mod. Well, and the barbarian stuff which I wrote in the last few hours. There may be other bugs as well, but I haven't encountered them :/. Also, the sign implementation was changed in 1.61, and I haven't really tested the extent of the changes. Caveat Emptor and all that..
The File:
http://forums.civfanatics.com/attachment.php?attachmentid=127523&d=1148293306
Right now I haven't made any sort of fancy installer, and I'm not really intending to. If this ModComp actually turns out to be of general interest, I may get together with TheLopez and adopy the same ini config system he's using, and write some better general instructions for adding this bit onto an existing mod.
For now, to install, extract the zip into your Mod/FfH2/Assets/Python/ folder.
Ok, once extracted you have to open up the CvEventInterface.py file in Python/entrypoints/ and change two lines as follows:
Code:
#import YourModsEventManager
import CvAddonEventManager
from CvPythonExtensions import *
#normalEventManager = YourModsEventManager.YourModsEventManager()
normalEventManager = CvAddonEventManager.CvAddonEventManager()
The commented out lines are the old lines, the lines underneath them are the new ones.
Next, go into the addon/ folder and edit the CvAddonEventManager.py file to replace three lines (the ones which reference CvFFHSpellsEventManager)...
Code:
#import CvFFHSpellsEventManager
import YourEventManager
gc = CyGlobalContext()
localText = CyTranslator()
PyPlayer = PyHelpers.PyPlayer
PyInfo = PyHelpers.PyInfo
bCityPlacementMode = False
bBarbarianMarkers = False
bListBarbarians = False
###################################################
#class CvAddonEventManager(CvFFHSpellsEventManager.CvFFHSpellsEventManager):
class CvAddonEventManager (YourEventManager.YourEventManager):
def __init__(self):
# replace this with the event manager class of the mod being added onto
#self.parent = CvFFHSpellsEventManager.CvFFHSpellsEventManager
self.parent = YourEventManager.YourEventManager
And that's it. Things should work as normal. If you catch keyboard events already, or have other conflicts (most likely because you are already utilizing one or both plot layers in your mod already), then you'll need to do more modifications.
Features:
Ctrl-M allows you to play a user mark (an arbitrary sign). Ctrl-M where a sign is currently will remove it. (I think this was the music key, so I should probably change it sometime...)
Ctrl-Shift-B enables Barbarian marking which will mark all the barbarians you can see with a color coded marker indicating the highest mp of any unit present.
Ctrl-Shift-L enables messaging during Barbarian Marking. This will cause the marker to send out notifications which you can click on to get sent to where the barbarians are. You have to enable marking in order to receive the listings.
Ctrl-Shift-P enters City Placement mode. This allows you to plan out where you want to place your cities. Click to place a city spot. Click an existing spot to remove it. Ctrl-Shift-P again to disable it again.
Ctrl-K will display the city grids for your cities (I think potentials, not current ones, I wrote it a long time ago, so I forget).
Ctrl... P I think will turn on 12Monkey's movement display code, to see where the currently selected unit can move. Note it doesn't work for stacks. That code was written by 12Monkey's, not by me, so I can take no credit for it .
And that's it. I find these utilities to be great, maybe you will too.
Oh, you can't have City Grid and Barbarian Markers up at the same time. Too few display layers. I haven't written the sort of complicated infrastructure to layer the two together. This entire suite was written very much ad hoc one afternoon while I was playing around with the Moon Mod. Well, and the barbarian stuff which I wrote in the last few hours. There may be other bugs as well, but I haven't encountered them :/. Also, the sign implementation was changed in 1.61, and I haven't really tested the extent of the changes. Caveat Emptor and all that..
The File:
http://forums.civfanatics.com/attachment.php?attachmentid=127523&d=1148293306