User:Plucked
From WiCWiki
Contents |
Overview
Version: 0.2 (2007-12-16)
Download: [1]
This is an extension for the Custom Viewer.
About
With the help of the AreaEditor you can place areas in your world and visualize those. Afterwards you can manipulate those and use the areas for other actions, f. ex. creating units.
Instructions
1. Download "areaeditor.py" and put it into the "cust_viewer"-folder 2. Open "cviewer.py" and change the following
2.1 add the following imports somewhere before initViewer is executed:
# from areaeditor.py from cust_viewer.areaeditor import printAreas from cust_viewer.areaeditor import initializeAreaEditor
2.2 in "initViewer()" add the following at the end:
# AreaEditor initializeAreaEditor()
2.3.1 If the following methods don't exist, then create those:
def key_act_NUM_PLUS_hold():
selectedEntry = getSelectedEntry()
selectedEntry.executeActions("plus")
def key_act_NUM_MINUS_hold():
selectedEntry = getSelectedEntry()
selectedEntry.executeActions("minus")
And in the "update()"-method add those four lines:
# check if user holds num-plus-key checkHoldingKey(KEY_NUM_PLUS, Action(key_act_NUM_PLUS_hold), 0.4, 0.01) # check if user holds num-minus-key checkHoldingKey(KEY_NUM_MINUS, Action(key_act_NUM_MINUS_hold), 0.4, 0.01)
2.3.2 If the methods already existed, then adjust those, so that they execute the "plus" and "minus"-actions
2.4 in "update()" add the following in the printing-part:
# print Areas in World printAreas()
Usage
Navigate as normal. You can manipulate the 3 coordinates of the position and the radius with your num-pads plus- and minus-keys.
API
Members
addedAreas = Container in which the areas are saved (Dictionary<String,Area>), key is "Area" + number
