ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/gde/bin/gce
(Generate patch)

Comparing deliantra/gde/bin/gce (file contents):
Revision 1.9 by root, Mon Mar 20 01:13:28 2006 UTC vs.
Revision 1.10 by elmex, Mon Mar 20 02:53:49 2006 UTC

1#!/opt/bin/perl 1#!/opt/bin/perl
2 2
3=head1 NAME 3=head1 NAME
4 4
5 gce - gtk (perl) crossfire editor 5 gce - gtk (perl) crossfire editor
6
7=head1 SYNOPSIS
8
9 gce [<map-filename>]
10
11=head1 FEATURES
12
13gce is a map editor for crossfire.
14Main features are:
15
16 - more map editing comfort
17 - intelligent placement tool
18 - intelligent connection tool
19 - intelligent erase tool
20 - faster and smaller than the java editor
21 - map normalizing (removal of old deprecated attributes)
22 - exit following
23 - world map navigation
24
25=head1 DESCRIPTION
26
27=head2 THE MAIN WINDOW
28
29This is the main window of gce. It provides the display of the
30picked arch and the tools. The buttons are providing the selection
31of the editing tool:
32
33=over 4
34
35=item * Pick
36
37This tool is the simplest of all. It lets the user just pick the topmost
38object of a map cell in the map window and updates the stack view, the picked arch
39and the attribute editor.
40
41If the pick attr flag is set only the attribute editor and the stack view
42are updated. This is useful when you want to put an object in the attribute editor
43and want to place an object from the map, you picked before, in an inventory of a different
44object (you just picked). This is a very special thing. It will propably go away.
45
46Shortcut-key in map editor: i
47
48=item * Place
49
50This is the intelligent placement tool. It has many modes:
51
52=over 4
53
54=item auto
55
56This mode trys to do the most usual thing with the picked arch.
57If you picked a floor arch, it will try to replace the existing floor
58or set the floor below all items. If you picked a monster or other arch,
59it will place it on top. If you picked a wall, it will put the wall above the floor
60and propably replace other walls.
61
62=item top
63
64Places the picked arch on the top of the stack of the map cell.
65
66=item above floor
67
68Places the picked arch just right above the floor (or the bottom of the stack).
69
70=item below floor
71
72Places the picked arch just right below the floor (or the bottom of the stack).
73
74=item bottom
75
76Places the picked arch on the bottom of the stack.
77
78=item place clean (checkbox)
79
80This is a flag, that when enabled, will let the placement tool
81only place an unmodified object on the map. This is useful when you have a
82modified arch in the picker (eg. special monster with modified hp) but want
83a unmodified monster being placed.
84
85=back
86
87Shortcut-key in map editor: p
88
89=item * Erase
90
91This is the tool that lets you erase an arch.
92It has following modes:
93
94=over 4
95
96=item top
97
98Erases the topmost object on the stack.
99
100=item walls
101
102Erases all walls in the stack. (and only walls)
103
104=item above floor
105
106Erases the first object above the floor.
107
108=item floor
109
110Erases all floor from the stack. (and only the floor)
111
112=item below floor
113
114Erases the first object below the floor.
115
116=item bottom
117
118Erases the first object on the bottom of the stack.
119
120=item pick match
121
122This erases all object with the same name as the picked arch
123from the stack.
124
125=item exclude walls (checkbox)
126
127This excludes erasing of walls in any erase action (except when erasing walls)
128
129=item exclude monsters (checkbox)
130
131This excludes erasing of monsters in any erase action.
132
133=back
134
135Shortcut-key in map editor: e
136
137=item * Select
138
139This is the select tool. You can select rectangular areas with it
140and operate on that area in following ways:
141
142=over 4
143
144=item copy
145
146This just copies all selected stacks.
147
148Shortcut-key in map editor: c
149
150=item paste
151
152This function pastes the copied stacks. The pasting
153beginns at the top left cell which is selected.
154
155Shortcut-key in map editor: p
156
157=item invoke
158
159This functions is a very mighty one. It can iterate the
160selected tool over the selected area. For example: It
161can be used to fill a map with floor or erase everything.
162
163Shortcut-key in map editor: n
164
165=back
166
167Shortcut-key in map editor: s
168
169=item * Eval
170
171This is a very special tool which isn't finished yet.
172It lets you insert a perl snippet that can manipulate the
173stack.
174
175Shortcut-key in map editor: l
176
177=item * Connect Exit
178
179This tool connectes two exits or teleporters.
180You can either connect two exits to each other, or just direct
181an exit to a certain location on a map.
182
183Shortcut-key in map editor: x
184
185=item * Follow Exit
186
187With this tool you can follow exits and teleporters on a map.
188It will open the map you go to.
189
190Shortcut-key in map editor: f
191
192=back
193
194=head2 THE STACK VIEW
195
196This window displays the stack of the picked map cell.
197You can swap two objects on the stack and delete a object from the stack.
198
199By clicking on an item on the stack you can transfer it to the picker and the attribute editor.
200
201=head2 THE MAP EDITOR
202
203This window just displays the map and lets you use the tools. The shortcuts are
204documented above in the tool descriptions.
205
206You can pan the map with the middle mouse button and use the tool with the
207left mouse button.
208
209There are two modifiers: You can hold the Alt-key to switch quickly to the pick tool
210and hold the Ctrl-key to switch to the erase tool. The settings from the tool in the
211main window will be used.
212
213=head2 THE ATTRIBUTE EDITOR
214
215This is the attribute editing window. On the top will be the name of the
216arch followed by the name of the object and the type of the arch in parents.
217
218The first tabs are the different aspects of the object.
219The lore and msg tab lets you edit the text attributes of the object.
220The inventory tab lets you add stuff to the inventory by dragging them from the
221picked arch in the main window to the top most button with the image in the inventory.
222(the inventory editor is subject to change and improvement)
223
224Tool tips on the labels in the attribute editor show the documentation of the
225attribute and the tool tips over the editing widget show the default value from the archetypes.
226
227
228=head2 THE PICK WINDOW
229
230You can pick archetypes from this window.
231The left click puts the object in the picker in the main window and the attribute editor.
232You can change the attributes of the picked arch in the attribute editor and will let you
233place that modifies object on the map.
234
235You can open multiple pick windows.
6 236
7=cut 237=cut
8 238
9our $VERSION = '0.1'; 239our $VERSION = '0.1';
10 240
34our $CFG; 264our $CFG;
35our $MAINWIN; 265our $MAINWIN;
36 266
37use GCE::MainWindow; 267use GCE::MainWindow;
38use Data::Dumper; 268use Data::Dumper;
269use File::Spec;
39 270
40sub read_cfg { 271sub read_cfg {
41 my ($file) = @_; 272 my ($file) = @_;
42 273
43 open CFG, $file 274 open CFG, $file
98 $window->move ($p_and_s->[0] || $default_x, $p_and_s->[1] || $default_y); 329 $window->move ($p_and_s->[0] || $default_x, $p_and_s->[1] || $default_y);
99} 330}
100 331
101read_cfg "$Crossfire::VARDIR/gceconfig"; 332read_cfg "$Crossfire::VARDIR/gceconfig";
102 333
334$CFG->{LIBDIR} ||= $ENV{CROSSFIRE_LIBDIR};
335$CFG->{MAPDIR} ||= File::Spec->catfile ($CFG->{LIBDIR}, 'maps');
336
103# must be done after changing the libdir path: 337# must be done after changing the libdir path:
104Crossfire::set_libdir $ENV{CROSSFIRE_LIBDIR}; 338Crossfire::set_libdir ($CFG->{LIBDIR});
105Crossfire::load_archetypes; 339Crossfire::load_archetypes;
106Crossfire::load_tilecache; 340Crossfire::load_tilecache;
107 341
108my $w = GCE::MainWindow->new; 342my $w = GCE::MainWindow->new;
109 343

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines