annotate clients/editor/plugins/CameraEdit.py @ 377:fe6fb0e0ed23

Adding freebsd8 build support. Thanks to varnie.
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Wed, 09 Dec 2009 17:01:52 +0000
parents c4df3fbbbc91
children
rev   line source
365
54cf58876c31 Updated to have the correct header.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 364
diff changeset
1 # -*- coding: utf-8 -*-
54cf58876c31 Updated to have the correct header.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 364
diff changeset
2
54cf58876c31 Updated to have the correct header.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 364
diff changeset
3 # ####################################################################
54cf58876c31 Updated to have the correct header.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 364
diff changeset
4 # Copyright (C) 2005-2009 by the FIFE team
54cf58876c31 Updated to have the correct header.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 364
diff changeset
5 # http://www.fifengine.de
54cf58876c31 Updated to have the correct header.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 364
diff changeset
6 # This file is part of FIFE.
363
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
7 #
365
54cf58876c31 Updated to have the correct header.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 364
diff changeset
8 # FIFE is free software; you can redistribute it and/or
54cf58876c31 Updated to have the correct header.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 364
diff changeset
9 # modify it under the terms of the GNU Lesser General Public
54cf58876c31 Updated to have the correct header.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 364
diff changeset
10 # License as published by the Free Software Foundation; either
54cf58876c31 Updated to have the correct header.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 364
diff changeset
11 # version 2.1 of the License, or (at your option) any later version.
363
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
12 #
365
54cf58876c31 Updated to have the correct header.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 364
diff changeset
13 # This library is distributed in the hope that it will be useful,
54cf58876c31 Updated to have the correct header.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 364
diff changeset
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
54cf58876c31 Updated to have the correct header.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 364
diff changeset
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
54cf58876c31 Updated to have the correct header.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 364
diff changeset
16 # Lesser General Public License for more details.
363
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
17 #
365
54cf58876c31 Updated to have the correct header.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 364
diff changeset
18 # You should have received a copy of the GNU Lesser General Public
54cf58876c31 Updated to have the correct header.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 364
diff changeset
19 # License along with this library; if not, write to the
54cf58876c31 Updated to have the correct header.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 364
diff changeset
20 # Free Software Foundation, Inc.,
54cf58876c31 Updated to have the correct header.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 364
diff changeset
21 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
54cf58876c31 Updated to have the correct header.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 364
diff changeset
22 # ####################################################################
363
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
23
368
c4df3fbbbc91 Fixed the doc string for the CameraEdit plugin.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 365
diff changeset
24 """ a tool for FIFEdit to edit camera attributes. It does not
c4df3fbbbc91 Fixed the doc string for the CameraEdit plugin.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 365
diff changeset
25 currently support multiple cameras.
c4df3fbbbc91 Fixed the doc string for the CameraEdit plugin.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 365
diff changeset
26 """
363
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
27
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
28 import fife
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
29 import pychan
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
30 import pychan.widgets as widgets
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
31 from pychan.tools import callbackWithArguments as cbwa
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
32
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
33 from fife_timer import Timer
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
34
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
35 import scripts
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
36 import scripts.plugin as plugin
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
37 from scripts.events import *
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
38 from scripts.gui.action import Action
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
39
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
40
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
41 import os
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
42 try:
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
43 import xml.etree.cElementTree as ET
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
44 except:
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
45 import xml.etree.ElementTree as ET
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
46
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
47 import math
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
48
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
49
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
50 class CameraEdit(plugin.Plugin):
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
51
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
52 def __init__(self):
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
53 self._enabled = False
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
54
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
55 # Camera instance
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
56 self._camera = None
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
57
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
58 # Editor instance
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
59 self._editor = None
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
60
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
61 # Toolbar button to display Camera Editor
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
62 self._action_show = None
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
63
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
64 # GUI
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
65 self._container = None
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
66 self._ok_button = None
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
67 self._cancel_button = None
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
68
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
69 def enable(self):
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
70 """ plugin method """
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
71 if self._enabled is True:
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
72 return
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
73
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
74 self._editor = scripts.editor.getEditor()
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
75 #self._camera = self._editor.getActiveMapView().getCamera()
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
76 self._action_show = Action(u"Camera Editor", checkable=True)
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
77 scripts.gui.action.activated.connect(self.toggle, sender=self._action_show)
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
78 self._editor._tools_menu.addAction(self._action_show)
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
79
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
80 self._createGui()
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
81
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
82 self._enabled = True
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
83
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
84 def disable(self):
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
85 """ plugin method """
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
86 if self._enabled is False:
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
87 return
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
88
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
89 self._container.setDocked(False)
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
90 self._container.hide()
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
91
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
92 self._editor._tools_menu.removeAction(self._action_show)
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
93
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
94 self._enabled = False
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
95
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
96
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
97 def isEnabled(self):
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
98 """ plugin method """
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
99 return self._enabled;
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
100
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
101 def getName(self):
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
102 """ plugin method """
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
103 return "Camera Editor"
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
104
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
105 def toggle(self):
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
106 """ Toggles the cameratool visible / invisible and sets
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
107 dock status
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
108 """
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
109 if self._container.isVisible() or self._container.isDocked():
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
110 self._container.setDocked(False)
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
111 self._container.hide()
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
112
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
113 self._action_show.setChecked(False)
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
114 else:
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
115 self._container.show()
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
116 self.loadSettings()
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
117 self._action_show.setChecked(True)
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
118 self._adjustPosition()
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
119
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
120 def saveSettings(self):
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
121 engine = self._editor.getEngine()
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
122
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
123 id = self._container.collectData('idBox')
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
124 if id == '':
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
125 print 'Please enter a camera id.'
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
126 return
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
127
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
128 try:
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
129 map = engine.getModel().getMap(str(self._container.collectData('mapBox')))
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
130 except fife.Exception:
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
131 print 'Cannot find the specified map id.'
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
132 return
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
133
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
134 try:
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
135 layer = map.getLayer(str(self._container.collectData('layerBox')))
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
136 except fife.Exception:
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
137 print 'Cannot find the specified layer id.'
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
138 return
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
139
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
140 try:
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
141 vals = self._container.collectData('viewBox').split(',')
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
142 if len(vals) != 4:
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
143 raise ValueError
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
144
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
145 viewport = fife.Rect(*[int(c) for c in vals])
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
146 except ValueError:
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
147 print 'Please enter 4 comma (,) delimited values for viewport x,y,width,height.'
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
148 return
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
149
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
150 try:
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
151 refh = int(self._container.collectData('refhBox'))
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
152 refw = int(self._container.collectData('refwBox'))
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
153 except ValueError:
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
154 print 'Please enter positive integer values for reference width and height.'
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
155 return
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
156
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
157 try:
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
158 rot = int(self._container.collectData('rotBox'))
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
159 tilt = int(self._container.collectData('tiltBox'))
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
160 except ValueError:
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
161 print 'Please enter positive integer values for rotation and tilt.'
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
162 return
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
163
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
164 self._camera = self._editor.getActiveMapView().getCamera()
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
165 self._camera.setId(str(id))
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
166 self._camera.getLocation().setLayer(layer)
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
167 self._camera.setViewPort(viewport)
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
168 self._camera.setCellImageDimensions(refw, refh)
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
169 self._camera.setRotation(rot)
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
170 self._camera.setTilt(tilt)
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
171
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
172 self.toggle()
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
173
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
174 def loadSettings(self):
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
175 if self._editor.getActiveMapView() is None:
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
176 return
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
177 else:
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
178 self._camera = self._editor.getActiveMapView().getCamera()
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
179
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
180 map = self._editor.getActiveMapView().getMap().getId()
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
181 self._container.findChild(name="mapBox").text = unicode(str(map))
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
182
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
183 layer = self._camera.getLocation().getLayer().getId()
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
184 self._container.findChild(name="layerBox").text = unicode(layer)
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
185
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
186 vp = self._camera.getViewPort()
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
187 viewport_str = unicode(str(vp.x) + "," + str(vp.y) + "," + str(vp.w) + "," + str(vp.h))
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
188 self._container.findChild(name="viewBox").text = viewport_str
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
189
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
190 ref = self._camera.getCellImageDimensions()
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
191 refw_str = unicode(str(ref.x))
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
192 refh_str = unicode(str(ref.y))
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
193 self._container.findChild(name="refhBox").text = refh_str
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
194 self._container.findChild(name="refwBox").text = refw_str
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
195
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
196 self._container.findChild(name="idBox").text = unicode(str(self._camera.getId()))
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
197 self._container.findChild(name="rotBox").text = unicode(str(int(self._camera.getRotation())))
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
198 self._container.findChild(name="tiltBox").text = unicode(str(int(self._camera.getTilt())))
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
199
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
200 def _createGui(self):
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
201 """ Create the basic gui container """
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
202 self._container = pychan.loadXML('gui/cameradialog.xml')
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
203
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
204 self._ok_button = self._container.findChild(name="okButton")
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
205 self._cancel_button = self._container.findChild(name="cancelButton")
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
206
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
207 self._ok_button.capture(self.saveSettings)
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
208 self._ok_button.capture(cbwa(self._editor.getStatusBar().showTooltip, unicode("Save changes to the camera")), 'mouseEntered')
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
209 self._ok_button.capture(self._editor.getStatusBar().hideTooltip, 'mouseExited')
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
210
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
211 self._cancel_button.capture(self.toggle)
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
212 self._cancel_button.capture(cbwa(self._editor.getStatusBar().showTooltip, unicode("Discard any changes to the camera")), 'mouseEntered')
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
213 self._cancel_button.capture(self._editor.getStatusBar().hideTooltip, 'mouseExited')
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
214
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
215
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
216 def _adjustPosition(self):
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
217 """ Adjusts the position of the container - we don't want to
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
218 let the window appear at the center of the screen.
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
219 (new default position: left, beneath the tools window)
714673208050 Adding the CameraEdit plugin to the editor. You must enable it in your settings.xml file. Still not fully tested.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
220 """
364
c3443aa7be10 Forgot to comment a few lines which caused the Camera Editor to not be shown.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 363
diff changeset
221 self._container.position = (50, 200)
c3443aa7be10 Forgot to comment a few lines which caused the Camera Editor to not be shown.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 363
diff changeset
222
c3443aa7be10 Forgot to comment a few lines which caused the Camera Editor to not be shown.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 363
diff changeset
223
c3443aa7be10 Forgot to comment a few lines which caused the Camera Editor to not be shown.
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 363
diff changeset
224