Mercurial > fife-parpg
changeset 599:a2024b994ca3
- re-arranged the ObjectEdit gui to avoid misunderstandings;
- the object section groups everything which allows to edit the object file
- the instance section only shows instance id and rotation
- added help button to plugin
- added plugin help text to lang/
author | chewie@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Fri, 27 Aug 2010 12:59:50 +0000 |
parents | 36b865a9cde7 |
children | 427150724fe1 |
files | tools/editor/gui/objectedit.xml tools/editor/lang/help_object_edit.txt tools/editor/plugins/ObjectEdit.py |
diffstat | 3 files changed, 133 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/tools/editor/gui/objectedit.xml Thu Aug 26 20:26:23 2010 +0000 +++ b/tools/editor/gui/objectedit.xml Fri Aug 27 12:59:50 2010 +0000 @@ -1,4 +1,12 @@ <Panel title="Object editor" position="10,700" min_size="200,250"> <!-- size="200,250" min_size="200,250" max_size="200,250" > --> + <HBox> + <Spacer min_size="150"/> + <ImageButton up_image="gui/icons/help.png" down_image="gui/icons/help.png" hover_image="gui/icons/help.png" name="show_help" text=" Help" /> +<!-- + <ImageButton name="show_settings" text="Settings" /> +--> + </HBox> + <Label text=" Object" background_color="0,0,0" /> <HBox> <Label text="Namespace:" min_size="85,20"/> @@ -16,8 +24,6 @@ <TextBox text="0" name="object_static" min_size="20,20"/> </HBox> - <Label text=" Selected Instance" background_color="0,0,0" /> - <HBox> <Label text="Select Rotation:" min_size="85,20" /> </HBox> @@ -41,8 +47,10 @@ </HBox> </VBox> - <Label text="Selected Instance" min_size="85,20" /> - + <Button name="change_data" text="Save rotation"/> + + <Label text=" Selected Instance" background_color="0,0,0" /> + <HBox > <Label text="Instance ID:" min_size="85,20"/> <TextBox text="None" name="instance_id" min_size="30,20"/> @@ -53,11 +61,9 @@ </HBox> <HBox> - <Button name="use_data" text="Use"/> + <Button name="use_data" text="Set instance id"/> </HBox> <Spacer /> - <Button name="change_data" text="Save rotation"/> - <Label text=" Animation viewer" background_color="0,0,0" /> <VBox name="animation_panel_wrapper">
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/editor/lang/help_object_edit.txt Fri Aug 27 12:59:50 2010 +0000 @@ -0,0 +1,91 @@ +Usage: +------ + +Activate the plugin and select an instance. The selected +instance will be highlighted, the plugin is set to +visible or is updated accordingly. + +MOUSEWHEEL: + - above the offset labels, it allows quick de-/ + increasing of values + - above dropdowns, it allows to change to the + next entry (and apply it, e.g. animation viewer + seamlessly plays the next selected animation) + +Object editing: +By selecting a rotation, you can alter the offset of +_this_ angle and save it to the object file. The +selected instance is just an interface to see your +changes - you can't change a single instances offset. + +Instance editing: +Instances can't be edited - you can only type in an id +which is set if it is unique. Saving your map also saves +this id to your mapfile. + +Animation editing: +ATM it is not possible to alter animations. You can +use the animation viewer to check your defined actions +though. + + Buttons: + - p = "Play" + - S = "Start" + - E = "End" + - l1 = "one frame left" + - r1 = "one frame right + +User interface: +--------------- + +The object section allows you to inspect: +- namespace of the object +- object id +- blocking flag +- static flag +- current x/y offset + +The instance section shows: +- instance id +- instance rotation + +The animation viewer shows: +- nothing, if a static instance is clicked +- all actions of an instance +- a control panel to play the animations + +The purpose of this plugin is to: + +- edit object xml files +- edit the instance id of the selected instance +- provide an animation viewer + +The main purpose is to easily change offsets and +save these changes. (extremely helpful for the +creation of tiled walls) + +Limitations: +------------ + +- only object data is saved +- instances on the map are _not_ touched +- exception is the instance id, this can be + altered via this plugin +- animations can't be edited and / or saved + +About +----- + +The Object Edit plugin was originally written +by the Zero-Projekt team and was contributed to +FIFE as an example for the editor plugin system +and to encourage other projects within the FIFE +community to also contribute their tools to +enhance the Editor for all projects + +cheers, +chewie +Zero-Projekt team + +http://en.zero-projekt.net +http://fifengine.net
--- a/tools/editor/plugins/ObjectEdit.py Thu Aug 26 20:26:23 2010 +0000 +++ b/tools/editor/plugins/ObjectEdit.py Fri Aug 27 12:59:50 2010 +0000 @@ -75,6 +75,8 @@ self.guidata = {} self.objectdata = {} + + self._help_dialog = None def _reset(self): """ @@ -153,6 +155,31 @@ """ plugin method """ return "Object editor" + def _show_help(self): + """ shows the help dialog """ + if self._help_dialog is not None: + self._help_dialog.show() + return + + self._help_dialog = pychan.loadXML("gui/help.xml") + self._help_dialog.title = u"Help (Object Editor)" + self._help_dialog.mapEvents({ + "closeButton" : self._help_dialog.hide, + }) + + # gimme some more space + _SIZE = (320,400) + scrollarea = self._help_dialog.findChildren(__class__=pychan.widgets.ScrollArea)[0] + scrollarea.size = _SIZE + scrollarea.min_size = _SIZE + scrollarea.max_size = _SIZE + + f = open('lang/help_object_edit.txt', 'r') + self._help_dialog.findChild(name="helpText").text = unicode(f.read()) + f.close() + + self._help_dialog.show() + def create_gui(self): """ - creates the gui skeleton by loading the xml file @@ -170,6 +197,8 @@ 'anim_right' : self.next_anim_frame, 'anim_start_pos' : self.anim_start_frame, 'anim_end_pos' : self.anim_end_frame, + + 'show_help' : self._show_help, }) self.container.findChild(name="x_offset_up").capture(self.change_offset, "mousePressed")