Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 330 vs 331 for /trunk/Source Code/GUI/GUIEditor/GUIEditor.cpp

Diff revisions: vs.
  @@ -106,10 +106,12 @@
106 106 _valuesField[i][j]->setText(CEGUI::PropertyHelper<F32>::toString(_currentValues[i][j]));
107 107 }
108 108 }
109 - _toggleButtons[TOGGLE_SKELETONS]->setSelected(_currentSelection->getComponent<RenderingComponent>()->renderSkeleton());
110 - _toggleButtons[TOGGLE_SHADOW_MAPPING]->setSelected(_currentSelection->getComponent<RenderingComponent>()->castsShadows());
111 - _toggleButtons[TOGGLE_WIREFRAME]->setSelected(_currentSelection->getComponent<RenderingComponent>()->renderWireframe());
112 - _toggleButtons[TOGGLE_BOUNDING_BOXES]->setSelected(_currentSelection->getComponent<RenderingComponent>()->renderBoundingBox());
109 +
110 + RenderingComponent* rComp = _currentSelection->getComponent<RenderingComponent>();
111 + _toggleButtons[TOGGLE_SKELETONS]->setSelected(rComp->renderSkeleton());
112 + _toggleButtons[TOGGLE_SHADOW_MAPPING]->setSelected(rComp->castsShadows());
113 + _toggleButtons[TOGGLE_WIREFRAME]->setSelected(rComp->renderWireframe());
114 + _toggleButtons[TOGGLE_BOUNDING_BOXES]->setSelected(rComp->renderBoundingBox());
113 115 }
114 116 }
115 117
  @@ -158,7 +160,9 @@
158 160 }
159 161 _toggleButtons[TOGGLE_POST_FX]->setSelected(GFX_DEVICE.postProcessingEnabled());
160 162 _toggleButtons[TOGGLE_FOG]->setSelected(ParamHandler::getInstance().getParam<bool>("rendering.enableFog", false));
161 - _toggleButtons[TOGGLE_DEPTH_PREVIEW]->setSelected(ParamHandler::getInstance().getParam<bool>("postProcessing.fullScreenDepthBuffer", false));
163 +
164 + bool depthPreview = ParamHandler::getInstance().getParam<bool>("postProcessing.fullScreenDepthBuffer", false);
165 + _toggleButtons[TOGGLE_DEPTH_PREVIEW]->setSelected(depthPreview);
162 166 }
163 167
164 168 void GUIEditor::setVisible(bool visible) {
  @@ -181,7 +185,7 @@
181 185 AI::AIManager::getInstance().toggleNavMeshDebugDraw(_toggleButtons[TOGGLE_NAV_MESH_DRAW]->isSelected());
182 186 // Create a new NavMesh if we don't currently have one
183 187 if (!temp) {
184 - temp = New AI::Navigation::NavigationMesh();
188 + temp = MemoryManager_NEW AI::Navigation::NavigationMesh();
185 189 }
186 190 // Set it's file name
187 191 temp->setFileName(GET_ACTIVE_SCENE()->getName());
  @@ -209,286 +213,398 @@
209 213
210 214 void GUIEditor::RegisterHandlers() {
211 215 CEGUI::Window* EditorBar = static_cast<CEGUI::Window*>(_editorWindow->getChild("MenuBar"));
212 - EditorBar->subscribeEvent(CEGUI::Window::EventMouseButtonUp, CEGUI::Event::Subscriber(&GUIEditor::Handle_MenuBarClickOn, this));
216 + EditorBar->subscribeEvent(CEGUI::Window::EventMouseButtonUp,
217 + CEGUI::Event::Subscriber(&GUIEditor::Handle_MenuBarClickOn, this));
213 218
214 219 for (U16 i = 0; i < EditorBar->getChildCount(); ++i) {
215 - EditorBar->getChildElementAtIdx(i)->subscribeEvent(CEGUI::Window::EventMouseButtonUp, CEGUI::Event::Subscriber(&GUIEditor::Handle_MenuBarClickOn, this));
220 + EditorBar->getChildElementAtIdx(i)->subscribeEvent(CEGUI::Window::EventMouseButtonUp,
221 + CEGUI::Event::Subscriber(&GUIEditor::Handle_MenuBarClickOn, this));
216 222 }
217 223
218 224 // Save Scene Button
219 225 {
220 226 CEGUI::Window* saveSceneButton = static_cast<CEGUI::Window*>(EditorBar->getChild("SaveSceneButton"));
221 - saveSceneButton->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&GUIEditor::Handle_SaveScene, this));
227 + saveSceneButton->subscribeEvent(CEGUI::PushButton::EventClicked,
228 + CEGUI::Event::Subscriber(&GUIEditor::Handle_SaveScene, this));
222 229 }
223 230 // Save Selection Button
224 231 {
225 232 _saveSelectionButton = static_cast<CEGUI::Window*>(EditorBar->getChild("SaveSelectionButton"));
226 - _saveSelectionButton->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&GUIEditor::Handle_SaveSelection, this));
233 + _saveSelectionButton->subscribeEvent(CEGUI::PushButton::EventClicked,
234 + CEGUI::Event::Subscriber(&GUIEditor::Handle_SaveSelection, this));
227 235 }
228 236 // Delete Selection Button
229 237 {
230 238 _deleteSelectionButton = static_cast<CEGUI::Window*>(EditorBar->getChild("DeleteSelection"));
231 - _deleteSelectionButton->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&GUIEditor::Handle_DeleteSelection, this));
239 + _deleteSelectionButton->subscribeEvent(CEGUI::PushButton::EventClicked,
240 + CEGUI::Event::Subscriber(&GUIEditor::Handle_DeleteSelection, this));
232 241 }
233 242 // Generate NavMesh button
234 243 {
235 244 CEGUI::Window* createNavMeshButton = static_cast<CEGUI::Window*>(EditorBar->getChild("NavMeshButton"));
236 - createNavMeshButton->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&GUIEditor::Handle_CreateNavMesh, this));
245 + createNavMeshButton->subscribeEvent(CEGUI::PushButton::EventClicked,
246 + CEGUI::Event::Subscriber(&GUIEditor::Handle_CreateNavMesh, this));
237 247 }
238 248 // Reload Scene Button
239 249 {
240 250 CEGUI::Window* reloadSceneButton = static_cast<CEGUI::Window*>(EditorBar->getChild("ReloadSceneButton"));
241 - reloadSceneButton->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&GUIEditor::Handle_ReloadScene, this));
251 + reloadSceneButton->subscribeEvent(CEGUI::PushButton::EventClicked,
252 + CEGUI::Event::Subscriber(&GUIEditor::Handle_ReloadScene, this));
242 253 }
243 254 // Print SceneGraph Button
244 255 {
245 256 CEGUI::Window* dumpSceneGraphButton = static_cast<CEGUI::Window*>(EditorBar->getChild("DumpSceneGraphTree"));
246 - dumpSceneGraphButton->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&GUIEditor::Handle_PrintSceneGraph, this));
257 + dumpSceneGraphButton->subscribeEvent(CEGUI::PushButton::EventClicked,
258 + CEGUI::Event::Subscriber(&GUIEditor::Handle_PrintSceneGraph, this));
247 259 }
260 + CEGUI::ToggleButton* toggleButton = nullptr;
248 261 // Toggle Wireframe rendering
249 262 {
250 263 _toggleButtons[TOGGLE_WIREFRAME] = static_cast<CEGUI::ToggleButton*>(EditorBar->getChild("ToggleWireframe"));
251 - _toggleButtons[TOGGLE_WIREFRAME]->subscribeEvent(CEGUI::ToggleButton::EventSelectStateChanged, CEGUI::Event::Subscriber(&GUIEditor::Handle_WireframeToggle, this));
264 + toggleButton = _toggleButtons[TOGGLE_WIREFRAME];
265 + toggleButton->subscribeEvent(CEGUI::ToggleButton::EventSelectStateChanged,
266 + CEGUI::Event::Subscriber(&GUIEditor::Handle_WireframeToggle, this));
252 267 }
253 268 // Toggle Depth Preview
254 269 {
255 270 _toggleButtons[TOGGLE_DEPTH_PREVIEW]= static_cast<CEGUI::ToggleButton*>(EditorBar->getChild("ToggleDepthPreview"));
256 - _toggleButtons[TOGGLE_DEPTH_PREVIEW]->subscribeEvent(CEGUI::ToggleButton::EventSelectStateChanged, CEGUI::Event::Subscriber(&GUIEditor::Handle_DepthPreviewToggle, this));
271 + toggleButton = _toggleButtons[TOGGLE_DEPTH_PREVIEW];
272 + toggleButton->subscribeEvent(CEGUI::ToggleButton::EventSelectStateChanged,
273 + CEGUI::Event::Subscriber(&GUIEditor::Handle_DepthPreviewToggle, this));
257 274 }
258 275 // Toggle Shadows
259 276 {
260 277 _toggleButtons[TOGGLE_SHADOW_MAPPING] = static_cast<CEGUI::ToggleButton*>(EditorBar->getChild("ToggleShadowMapping"));
261 - _toggleButtons[TOGGLE_SHADOW_MAPPING]->subscribeEvent(CEGUI::ToggleButton::EventSelectStateChanged, CEGUI::Event::Subscriber(&GUIEditor::Handle_ShadowMappingToggle, this));
278 + toggleButton = _toggleButtons[TOGGLE_SHADOW_MAPPING];
279 + toggleButton->subscribeEvent(CEGUI::ToggleButton::EventSelectStateChanged,
280 + CEGUI::Event::Subscriber(&GUIEditor::Handle_ShadowMappingToggle, this));
262 281 }
263 282 // Toggle Fog
264 283 {
265 284 _toggleButtons[TOGGLE_FOG] = static_cast<CEGUI::ToggleButton*>(EditorBar->getChild("ToggleFog"));
266 - _toggleButtons[TOGGLE_FOG]->subscribeEvent(CEGUI::ToggleButton::EventSelectStateChanged, CEGUI::Event::Subscriber(&GUIEditor::Handle_FogToggle, this));
285 + toggleButton = _toggleButtons[TOGGLE_FOG];
286 + toggleButton->subscribeEvent(CEGUI::ToggleButton::EventSelectStateChanged,
287 + CEGUI::Event::Subscriber(&GUIEditor::Handle_FogToggle, this));
267 288 }
268 289 // Toggle PostFX
269 290 {
270 291 _toggleButtons[TOGGLE_POST_FX] = static_cast<CEGUI::ToggleButton*>(EditorBar->getChild("TogglePostFX"));
271 - _toggleButtons[TOGGLE_POST_FX]->subscribeEvent(CEGUI::ToggleButton::EventSelectStateChanged, CEGUI::Event::Subscriber(&GUIEditor::Handle_PostFXToggle, this));
292 + toggleButton = _toggleButtons[TOGGLE_POST_FX];
293 + toggleButton->subscribeEvent(CEGUI::ToggleButton::EventSelectStateChanged,
294 + CEGUI::Event::Subscriber(&GUIEditor::Handle_PostFXToggle, this));
272 295 }
273 296 // Toggle Bounding Boxes
274 297 {
275 298 _toggleButtons[TOGGLE_BOUNDING_BOXES] = static_cast<CEGUI::ToggleButton*>(EditorBar->getChild("ToggleBoundingBoxes"));
276 - _toggleButtons[TOGGLE_BOUNDING_BOXES]->subscribeEvent(CEGUI::ToggleButton::EventSelectStateChanged, CEGUI::Event::Subscriber(&GUIEditor::Handle_BoundingBoxesToggle, this));
299 + toggleButton = _toggleButtons[TOGGLE_BOUNDING_BOXES];
300 + toggleButton->subscribeEvent(CEGUI::ToggleButton::EventSelectStateChanged,
301 + CEGUI::Event::Subscriber(&GUIEditor::Handle_BoundingBoxesToggle, this));
277 302 }
278 303 // Toggle NavMesh Rendering
279 304 {
280 305 _toggleButtons[TOGGLE_NAV_MESH_DRAW] = static_cast<CEGUI::ToggleButton*>(EditorBar->getChild("DebugDraw"));
281 - _toggleButtons[TOGGLE_NAV_MESH_DRAW]->subscribeEvent(CEGUI::ToggleButton::EventSelectStateChanged, CEGUI::Event::Subscriber(&GUIEditor::Handle_DrawNavMeshToggle, this));
306 + toggleButton = _toggleButtons[TOGGLE_NAV_MESH_DRAW];
307 + toggleButton->subscribeEvent(CEGUI::ToggleButton::EventSelectStateChanged,
308 + CEGUI::Event::Subscriber(&GUIEditor::Handle_DrawNavMeshToggle, this));
282 309 }
283 310 // Toggle Skeleton Rendering
284 311 {
285 312 _toggleButtons[TOGGLE_SKELETONS] = static_cast<CEGUI::ToggleButton*>(EditorBar->getChild("ToggleSkeletons"));
286 - _toggleButtons[TOGGLE_SKELETONS]->subscribeEvent(CEGUI::ToggleButton::EventSelectStateChanged, CEGUI::Event::Subscriber(&GUIEditor::Handle_SkeletonsToggle, this));
313 + toggleButton = _toggleButtons[TOGGLE_SKELETONS];
314 + toggleButton->subscribeEvent(CEGUI::ToggleButton::EventSelectStateChanged,
315 + CEGUI::Event::Subscriber(&GUIEditor::Handle_SkeletonsToggle, this));
287 316 }
288 317
318 + CEGUI::Editbox* field = nullptr;
289 319 // Type new X Position
290 320 {
291 321 _valuesField[TRANSFORM_POSITION][CONTROL_FIELD_X] = static_cast<CEGUI::Editbox*>(EditorBar->getChild("XPositionValue"));
292 - _valuesField[TRANSFORM_POSITION][CONTROL_FIELD_X]->subscribeEvent(CEGUI::Editbox::EventTextAccepted, CEGUI::Event::Subscriber(&GUIEditor::Handle_PositionXChange, this));
293 - _valuesField[TRANSFORM_POSITION][CONTROL_FIELD_X]->subscribeEvent(CEGUI::Editbox::EventInputCaptureGained, CEGUI::Event::Subscriber(&GUIEditor::Handle_EditFieldClick, this));
294 - _valuesField[TRANSFORM_POSITION][CONTROL_FIELD_X]->setValidationString(CEGUI::String("^[-+]?[0-9]{1,10}([.][0-9]{1,10})?$"));
322 + field = _valuesField[TRANSFORM_POSITION][CONTROL_FIELD_X];
323 + field->subscribeEvent(CEGUI::Editbox::EventTextAccepted,
324 + CEGUI::Event::Subscriber(&GUIEditor::Handle_PositionXChange, this));
325 + field->subscribeEvent(CEGUI::Editbox::EventInputCaptureGained,
326 + CEGUI::Event::Subscriber(&GUIEditor::Handle_EditFieldClick, this));
327 + field->setValidationString(CEGUI::String("^[-+]?[0-9]{1,10}([.][0-9]{1,10})?$"));
295 328 }
296 329 // Type new Y Position
297 330 {
298 331 _valuesField[TRANSFORM_POSITION][CONTROL_FIELD_Y] = static_cast<CEGUI::Editbox*>(EditorBar->getChild("YPositionValue"));
299 - _valuesField[TRANSFORM_POSITION][CONTROL_FIELD_Y]->subscribeEvent(CEGUI::Editbox::EventTextAccepted, CEGUI::Event::Subscriber(&GUIEditor::Handle_PositionYChange, this));
300 - _valuesField[TRANSFORM_POSITION][CONTROL_FIELD_Y]->subscribeEvent(CEGUI::Editbox::EventInputCaptureGained, CEGUI::Event::Subscriber(&GUIEditor::Handle_EditFieldClick, this));
301 - _valuesField[TRANSFORM_POSITION][CONTROL_FIELD_Y]->setValidationString(CEGUI::String("^[-+]?[0-9]{1,10}([.][0-9]{1,10})?$"));
332 + field = _valuesField[TRANSFORM_POSITION][CONTROL_FIELD_Y];
333 + field->subscribeEvent(CEGUI::Editbox::EventTextAccepted,
334 + CEGUI::Event::Subscriber(&GUIEditor::Handle_PositionYChange, this));
335 + field->subscribeEvent(CEGUI::Editbox::EventInputCaptureGained,
336 + CEGUI::Event::Subscriber(&GUIEditor::Handle_EditFieldClick, this));
337 + field->setValidationString(CEGUI::String("^[-+]?[0-9]{1,10}([.][0-9]{1,10})?$"));
302 338 }
303 339 // Type new Z Position
304 340 {
305 341 _valuesField[TRANSFORM_POSITION][CONTROL_FIELD_Z] = static_cast<CEGUI::Editbox*>(EditorBar->getChild("ZPositionValue"));
306 - _valuesField[TRANSFORM_POSITION][CONTROL_FIELD_Z]->subscribeEvent(CEGUI::Editbox::EventTextAccepted, CEGUI::Event::Subscriber(&GUIEditor::Handle_PositionZChange, this));
307 - _valuesField[TRANSFORM_POSITION][CONTROL_FIELD_Z]->subscribeEvent(CEGUI::Editbox::EventInputCaptureGained, CEGUI::Event::Subscriber(&GUIEditor::Handle_EditFieldClick, this));
308 - _valuesField[TRANSFORM_POSITION][CONTROL_FIELD_Z]->setValidationString(CEGUI::String("^[-+]?[0-9]{1,10}([.][0-9]{1,10})?$"));
342 + field = _valuesField[TRANSFORM_POSITION][CONTROL_FIELD_Z];
343 + field->subscribeEvent(CEGUI::Editbox::EventTextAccepted,
344 + CEGUI::Event::Subscriber(&GUIEditor::Handle_PositionZChange, this));
345 + field->subscribeEvent(CEGUI::Editbox::EventInputCaptureGained,
346 + CEGUI::Event::Subscriber(&GUIEditor::Handle_EditFieldClick, this));
347 + field->setValidationString(CEGUI::String("^[-+]?[0-9]{1,10}([.][0-9]{1,10})?$"));
309 348 }
349 +
310 350 // Type new Position Granularity
311 351 {
312 - _valuesField[TRANSFORM_POSITION][CONTROL_FIELD_GRANULARITY] = static_cast<CEGUI::Editbox*>(EditorBar->getChild("PositionGranularityValue"));
313 - _valuesField[TRANSFORM_POSITION][CONTROL_FIELD_GRANULARITY]->subscribeEvent(CEGUI::Editbox::EventTextAccepted, CEGUI::Event::Subscriber(&GUIEditor::Handle_PositionGranularityChange, this));
314 - _valuesField[TRANSFORM_POSITION][CONTROL_FIELD_GRANULARITY]->setText(CEGUI::PropertyHelper<F32>::toString(_currentValues[TRANSFORM_POSITION][CONTROL_FIELD_GRANULARITY]));
315 - _valuesField[TRANSFORM_POSITION][CONTROL_FIELD_GRANULARITY]->setValidationString(CEGUI::String("^[-+]?[0-9]{1,10}([.][0-9]{1,10})?$"));
352 + _valuesField[TRANSFORM_POSITION][CONTROL_FIELD_GRANULARITY] =
353 + static_cast<CEGUI::Editbox*>(EditorBar->getChild("PositionGranularityValue"));
354 + field = _valuesField[TRANSFORM_POSITION][CONTROL_FIELD_GRANULARITY];
355 + field->subscribeEvent(CEGUI::Editbox::EventTextAccepted,
356 + CEGUI::Event::Subscriber(&GUIEditor::Handle_PositionGranularityChange, this));
357 + field->setText(CEGUI::PropertyHelper<F32>::toString(_currentValues[TRANSFORM_POSITION][CONTROL_FIELD_GRANULARITY]));
358 + field->setValidationString(CEGUI::String("^[-+]?[0-9]{1,10}([.][0-9]{1,10})?$"));
316 359 }
317 360 // Type new X Rotation
318 361 {
319 362 _valuesField[TRANSFORM_ROTATION][CONTROL_FIELD_X] = static_cast<CEGUI::Editbox*>(EditorBar->getChild("XRotationValue"));
320 - _valuesField[TRANSFORM_ROTATION][CONTROL_FIELD_X]->subscribeEvent(CEGUI::Editbox::EventTextAccepted, CEGUI::Event::Subscriber(&GUIEditor::Handle_RotationXChange, this));
321 - _valuesField[TRANSFORM_ROTATION][CONTROL_FIELD_X]->subscribeEvent(CEGUI::Editbox::EventInputCaptureGained, CEGUI::Event::Subscriber(&GUIEditor::Handle_EditFieldClick, this));
322 - _valuesField[TRANSFORM_ROTATION][CONTROL_FIELD_X]->setValidationString(CEGUI::String("^[-+]?[0-9]{1,10}([.][0-9]{1,10})?$"));
363 + field = _valuesField[TRANSFORM_ROTATION][CONTROL_FIELD_X];
364 + field->subscribeEvent(CEGUI::Editbox::EventTextAccepted,
365 + CEGUI::Event::Subscriber(&GUIEditor::Handle_RotationXChange, this));
366 + field->subscribeEvent(CEGUI::Editbox::EventInputCaptureGained,
367 + CEGUI::Event::Subscriber(&GUIEditor::Handle_EditFieldClick, this));
368 + field->setValidationString(CEGUI::String("^[-+]?[0-9]{1,10}([.][0-9]{1,10})?$"));
323 369 }
324 370 // Type new Y Rotation
325 371 {
326 372 _valuesField[TRANSFORM_ROTATION][CONTROL_FIELD_Y] = static_cast<CEGUI::Editbox*>(EditorBar->getChild("YRotationValue"));
327 - _valuesField[TRANSFORM_ROTATION][CONTROL_FIELD_Y]->subscribeEvent(CEGUI::Editbox::EventTextAccepted, CEGUI::Event::Subscriber(&GUIEditor::Handle_RotationYChange, this));
328 - _valuesField[TRANSFORM_ROTATION][CONTROL_FIELD_Y]->subscribeEvent(CEGUI::Editbox::EventInputCaptureGained, CEGUI::Event::Subscriber(&GUIEditor::Handle_EditFieldClick, this));
329 - _valuesField[TRANSFORM_ROTATION][CONTROL_FIELD_Y]->setValidationString(CEGUI::String("^[-+]?[0-9]{1,10}([.][0-9]{1,10})?$"));
373 + field = _valuesField[TRANSFORM_ROTATION][CONTROL_FIELD_Y];
374 + field->subscribeEvent(CEGUI::Editbox::EventTextAccepted,
375 + CEGUI::Event::Subscriber(&GUIEditor::Handle_RotationYChange, this));
376 + field->subscribeEvent(CEGUI::Editbox::EventInputCaptureGained,
377 + CEGUI::Event::Subscriber(&GUIEditor::Handle_EditFieldClick, this));
378 + field->setValidationString(CEGUI::String("^[-+]?[0-9]{1,10}([.][0-9]{1,10})?$"));
330 379 }
331 380 // Type new Z Rotation
332 381 {
333 382 _valuesField[TRANSFORM_ROTATION][CONTROL_FIELD_Z] = static_cast<CEGUI::Editbox*>(EditorBar->getChild("ZRotationValue"));
334 - _valuesField[TRANSFORM_ROTATION][CONTROL_FIELD_Z]->subscribeEvent(CEGUI::Editbox::EventTextAccepted, CEGUI::Event::Subscriber(&GUIEditor::Handle_RotationZChange, this));
335 - _valuesField[TRANSFORM_ROTATION][CONTROL_FIELD_Z]->subscribeEvent(CEGUI::Editbox::EventInputCaptureGained, CEGUI::Event::Subscriber(&GUIEditor::Handle_EditFieldClick, this));
336 - _valuesField[TRANSFORM_ROTATION][CONTROL_FIELD_Z]->setValidationString(CEGUI::String("^[-+]?[0-9]{1,10}([.][0-9]{1,10})?$"));
383 + field = _valuesField[TRANSFORM_ROTATION][CONTROL_FIELD_Z];
384 + field->subscribeEvent(CEGUI::Editbox::EventTextAccepted,
385 + CEGUI::Event::Subscriber(&GUIEditor::Handle_RotationZChange, this));
386 + field->subscribeEvent(CEGUI::Editbox::EventInputCaptureGained,
387 + CEGUI::Event::Subscriber(&GUIEditor::Handle_EditFieldClick, this));
388 + field->setValidationString(CEGUI::String("^[-+]?[0-9]{1,10}([.][0-9]{1,10})?$"));
337 389 }
338 390 // Type new Rotation Granularity
339 391 {
340 - _valuesField[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY] = static_cast<CEGUI::Editbox*>(EditorBar->getChild("RotationGranularityValue"));
341 - _valuesField[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY]->subscribeEvent(CEGUI::Editbox::EventTextAccepted, CEGUI::Event::Subscriber(&GUIEditor::Handle_RotationGranularityChange, this));
342 - _valuesField[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY]->setText(CEGUI::PropertyHelper<F32>::toString(_currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY]));
343 - _valuesField[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY]->setValidationString(CEGUI::String("^[-+]?[0-9]{1,10}([.][0-9]{1,10})?$"));
392 + _valuesField[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY] =
393 + static_cast<CEGUI::Editbox*>(EditorBar->getChild("RotationGranularityValue"));
394 + field = _valuesField[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY];
395 + field->subscribeEvent(CEGUI::Editbox::EventTextAccepted,
396 + CEGUI::Event::Subscriber(&GUIEditor::Handle_RotationGranularityChange, this));
397 + field->setText(CEGUI::PropertyHelper<F32>::toString(_currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY]));
398 + field->setValidationString(CEGUI::String("^[-+]?[0-9]{1,10}([.][0-9]{1,10})?$"));
344 399 }
345 400 // Type new X Scale
346 401 {
347 402 _valuesField[TRANSFORM_SCALE][CONTROL_FIELD_X] = static_cast<CEGUI::Editbox*>(EditorBar->getChild("XScaleValue"));
348 - _valuesField[TRANSFORM_SCALE][CONTROL_FIELD_X]->subscribeEvent(CEGUI::Editbox::EventTextAccepted, CEGUI::Event::Subscriber(&GUIEditor::Handle_ScaleXChange, this));
349 - _valuesField[TRANSFORM_SCALE][CONTROL_FIELD_X]->subscribeEvent(CEGUI::Editbox::EventInputCaptureGained, CEGUI::Event::Subscriber(&GUIEditor::Handle_EditFieldClick, this));
350 - _valuesField[TRANSFORM_SCALE][CONTROL_FIELD_X]->setValidationString(CEGUI::String("^[-+]?[0-9]{1,10}([.][0-9]{1,10})?$"));
403 + field = _valuesField[TRANSFORM_SCALE][CONTROL_FIELD_X];
404 + field->subscribeEvent(CEGUI::Editbox::EventTextAccepted,
405 + CEGUI::Event::Subscriber(&GUIEditor::Handle_ScaleXChange, this));
406 + field->subscribeEvent(CEGUI::Editbox::EventInputCaptureGained,
407 + CEGUI::Event::Subscriber(&GUIEditor::Handle_EditFieldClick, this));
408 + field->setValidationString(CEGUI::String("^[-+]?[0-9]{1,10}([.][0-9]{1,10})?$"));
351 409 }
352 410 // Type new Y Scale
353 411 {
354 412 _valuesField[TRANSFORM_SCALE][CONTROL_FIELD_Y] = static_cast<CEGUI::Editbox*>(EditorBar->getChild("YScaleValue"));
355 - _valuesField[TRANSFORM_SCALE][CONTROL_FIELD_Y]->subscribeEvent(CEGUI::Editbox::EventTextAccepted, CEGUI::Event::Subscriber(&GUIEditor::Handle_ScaleYChange, this));
356 - _valuesField[TRANSFORM_SCALE][CONTROL_FIELD_Y]->subscribeEvent(CEGUI::Editbox::EventInputCaptureGained, CEGUI::Event::Subscriber(&GUIEditor::Handle_EditFieldClick, this));
357 - _valuesField[TRANSFORM_SCALE][CONTROL_FIELD_Y]->setValidationString(CEGUI::String("^[-+]?[0-9]{1,10}([.][0-9]{1,10})?$"));
413 + field = _valuesField[TRANSFORM_SCALE][CONTROL_FIELD_Y];
414 + field->subscribeEvent(CEGUI::Editbox::EventTextAccepted,
415 + CEGUI::Event::Subscriber(&GUIEditor::Handle_ScaleYChange, this));
416 + field->subscribeEvent(CEGUI::Editbox::EventInputCaptureGained,
417 + CEGUI::Event::Subscriber(&GUIEditor::Handle_EditFieldClick, this));
418 + field->setValidationString(CEGUI::String("^[-+]?[0-9]{1,10}([.][0-9]{1,10})?$"));
358 419 }
359 420 // Type new Z Scale
360 421 {
361 422 _valuesField[TRANSFORM_SCALE][CONTROL_FIELD_Z] = static_cast<CEGUI::Editbox*>(EditorBar->getChild("ZScaleValue"));
362 - _valuesField[TRANSFORM_SCALE][CONTROL_FIELD_Z]->subscribeEvent(CEGUI::Editbox::EventTextAccepted, CEGUI::Event::Subscriber(&GUIEditor::Handle_ScaleZChange, this));
363 - _valuesField[TRANSFORM_SCALE][CONTROL_FIELD_Z]->subscribeEvent(CEGUI::Editbox::EventInputCaptureGained, CEGUI::Event::Subscriber(&GUIEditor::Handle_EditFieldClick, this));
364 - _valuesField[TRANSFORM_SCALE][CONTROL_FIELD_Z]->setValidationString(CEGUI::String("^[-+]?[0-9]{1,10}([.][0-9]{1,10})?$"));
423 + field = _valuesField[TRANSFORM_SCALE][CONTROL_FIELD_Z];
424 + field->subscribeEvent(CEGUI::Editbox::EventTextAccepted,
425 + CEGUI::Event::Subscriber(&GUIEditor::Handle_ScaleZChange, this));
426 + field->subscribeEvent(CEGUI::Editbox::EventInputCaptureGained,
427 + CEGUI::Event::Subscriber(&GUIEditor::Handle_EditFieldClick, this));
428 + field->setValidationString(CEGUI::String("^[-+]?[0-9]{1,10}([.][0-9]{1,10})?$"));
365 429 }
366 430 // Type new Scale Granularity
367 431 {
368 - _valuesField[TRANSFORM_SCALE][CONTROL_FIELD_GRANULARITY] = static_cast<CEGUI::Editbox*>(EditorBar->getChild("ScaleGranularityValue"));
369 - _valuesField[TRANSFORM_SCALE][CONTROL_FIELD_GRANULARITY]->subscribeEvent(CEGUI::Editbox::EventTextAccepted, CEGUI::Event::Subscriber(&GUIEditor::Handle_ScaleGranularityChange, this));
370 - _valuesField[TRANSFORM_SCALE][CONTROL_FIELD_GRANULARITY]->setText(CEGUI::PropertyHelper<F32>::toString(_currentValues[TRANSFORM_SCALE][CONTROL_FIELD_GRANULARITY]));
371 - _valuesField[TRANSFORM_SCALE][CONTROL_FIELD_GRANULARITY]->setValidationString(CEGUI::String("^[-+]?[0-9]{1,10}([.][0-9]{1,10})?$"));
432 + _valuesField[TRANSFORM_SCALE][CONTROL_FIELD_GRANULARITY] =
433 + static_cast<CEGUI::Editbox*>(EditorBar->getChild("ScaleGranularityValue"));
434 + field = _valuesField[TRANSFORM_SCALE][CONTROL_FIELD_GRANULARITY];
435 + field->subscribeEvent(CEGUI::Editbox::EventTextAccepted,
436 + CEGUI::Event::Subscriber(&GUIEditor::Handle_ScaleGranularityChange, this));
437 + field->setText(CEGUI::PropertyHelper<F32>::toString(_currentValues[TRANSFORM_SCALE][CONTROL_FIELD_GRANULARITY]));
438 + field->setValidationString(CEGUI::String("^[-+]?[0-9]{1,10}([.][0-9]{1,10})?$"));
372 439 }
440 + CEGUI::Window* transformButton = nullptr;
373 441 // Increment X Position
374 442 {
375 - _transformButtonsInc[TRANSFORM_POSITION][CONTROL_FIELD_X] = static_cast<CEGUI::Window*>(EditorBar->getChild("IncPositionXButton"));
376 - _transformButtonsInc[TRANSFORM_POSITION][CONTROL_FIELD_X]->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&GUIEditor::Handle_IncrementPositionX, this));
443 + _transformButtonsInc[TRANSFORM_POSITION][CONTROL_FIELD_X] = EditorBar->getChild("IncPositionXButton");
444 + transformButton = _transformButtonsInc[TRANSFORM_POSITION][CONTROL_FIELD_X];
445 + transformButton->subscribeEvent(CEGUI::PushButton::EventClicked,
446 + CEGUI::Event::Subscriber(&GUIEditor::Handle_IncrementPositionX, this));
377 447 }
378 448 // Decrement X Position
379 449 {
380 - _transformButtonsDec[TRANSFORM_POSITION][CONTROL_FIELD_X] = static_cast<CEGUI::Window*>(EditorBar->getChild("DecPositionXButton"));
381 - _transformButtonsDec[TRANSFORM_POSITION][CONTROL_FIELD_X]->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&GUIEditor::Handle_DecrementPositionX, this));
450 + _transformButtonsDec[TRANSFORM_POSITION][CONTROL_FIELD_X] = EditorBar->getChild("DecPositionXButton");
451 + transformButton = _transformButtonsDec[TRANSFORM_POSITION][CONTROL_FIELD_X];
452 + transformButton->subscribeEvent(CEGUI::PushButton::EventClicked,
453 + CEGUI::Event::Subscriber(&GUIEditor::Handle_DecrementPositionX, this));
382 454 }
383 455 // Increment Y Position
384 456 {
385 - _transformButtonsInc[TRANSFORM_POSITION][CONTROL_FIELD_Y] = static_cast<CEGUI::Window*>(EditorBar->getChild("IncPositionYButton"));
386 - _transformButtonsInc[TRANSFORM_POSITION][CONTROL_FIELD_Y]->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&GUIEditor::Handle_IncrementPositionY, this));
457 + _transformButtonsInc[TRANSFORM_POSITION][CONTROL_FIELD_Y] = EditorBar->getChild("IncPositionYButton");
458 + transformButton = _transformButtonsInc[TRANSFORM_POSITION][CONTROL_FIELD_Y];
459 + transformButton->subscribeEvent(CEGUI::PushButton::EventClicked,
460 + CEGUI::Event::Subscriber(&GUIEditor::Handle_IncrementPositionY, this));
387 461 }
388 462 // Decrement Y Position
389 463 {
390 - _transformButtonsDec[TRANSFORM_POSITION][CONTROL_FIELD_Y] = static_cast<CEGUI::Window*>(EditorBar->getChild("DecPositionYButton"));
391 - _transformButtonsDec[TRANSFORM_POSITION][CONTROL_FIELD_Y]->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&GUIEditor::Handle_DecrementPositionY, this));
464 + _transformButtonsDec[TRANSFORM_POSITION][CONTROL_FIELD_Y] = EditorBar->getChild("DecPositionYButton");
465 + transformButton = _transformButtonsDec[TRANSFORM_POSITION][CONTROL_FIELD_Y];
466 + transformButton->subscribeEvent(CEGUI::PushButton::EventClicked,
467 + CEGUI::Event::Subscriber(&GUIEditor::Handle_DecrementPositionY, this));
392 468 }
393 469 // Increment Z Position
394 470 {
395 - _transformButtonsInc[TRANSFORM_POSITION][CONTROL_FIELD_Z] = static_cast<CEGUI::Window*>(EditorBar->getChild("IncPositionZButton"));
396 - _transformButtonsInc[TRANSFORM_POSITION][CONTROL_FIELD_Z]->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&GUIEditor::Handle_IncrementPositionZ, this));
471 + _transformButtonsInc[TRANSFORM_POSITION][CONTROL_FIELD_Z] = EditorBar->getChild("IncPositionZButton");
472 + transformButton = _transformButtonsInc[TRANSFORM_POSITION][CONTROL_FIELD_Z];
473 + transformButton->subscribeEvent(CEGUI::PushButton::EventClicked,
474 + CEGUI::Event::Subscriber(&GUIEditor::Handle_IncrementPositionZ, this));
397 475 }
398 476 // Decrement Z Position
399 477 {
400 - _transformButtonsDec[TRANSFORM_POSITION][CONTROL_FIELD_Z] = static_cast<CEGUI::Window*>(EditorBar->getChild("DecPositionZButton"));
401 - _transformButtonsDec[TRANSFORM_POSITION][CONTROL_FIELD_Z]->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&GUIEditor::Handle_DecrementPositionZ, this));
478 + _transformButtonsDec[TRANSFORM_POSITION][CONTROL_FIELD_Z] = EditorBar->getChild("DecPositionZButton");
479 + transformButton = _transformButtonsDec[TRANSFORM_POSITION][CONTROL_FIELD_Z];
480 + transformButton->subscribeEvent(CEGUI::PushButton::EventClicked,
481 + CEGUI::Event::Subscriber(&GUIEditor::Handle_DecrementPositionZ, this));
402 482 }
403 483 // Increment Position Granularity
404 484 {
405 - _transformButtonsInc[TRANSFORM_POSITION][CONTROL_FIELD_GRANULARITY] = static_cast<CEGUI::Window*>(EditorBar->getChild("IncPositionGranButton"));
406 - _transformButtonsInc[TRANSFORM_POSITION][CONTROL_FIELD_GRANULARITY]->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&GUIEditor::Handle_IncrementPositionGranularity, this));
485 + _transformButtonsInc[TRANSFORM_POSITION][CONTROL_FIELD_GRANULARITY] = EditorBar->getChild("IncPositionGranButton");
486 + transformButton = _transformButtonsInc[TRANSFORM_POSITION][CONTROL_FIELD_GRANULARITY];
487 + transformButton->subscribeEvent(CEGUI::PushButton::EventClicked,
488 + CEGUI::Event::Subscriber(&GUIEditor::Handle_IncrementPositionGranularity, this));
407 489 }
408 490 // Decrement Position Granularity
409 491 {
410 - _transformButtonsDec[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY] = static_cast<CEGUI::Window*>(EditorBar->getChild("DecPositionGranButton"));
411 - _transformButtonsDec[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY]->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&GUIEditor::Handle_DecrementPositionGranularity, this));
492 + _transformButtonsDec[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY] = EditorBar->getChild("DecPositionGranButton");
493 + transformButton = _transformButtonsDec[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY];
494 + transformButton->subscribeEvent(CEGUI::PushButton::EventClicked,
495 + CEGUI::Event::Subscriber(&GUIEditor::Handle_DecrementPositionGranularity, this));
412 496 }
413 497 // Increment X Rotation
414 498 {
415 - _transformButtonsInc[TRANSFORM_ROTATION][CONTROL_FIELD_X] = static_cast<CEGUI::Window*>(EditorBar->getChild("IncRotationXButton"));
416 - _transformButtonsInc[TRANSFORM_ROTATION][CONTROL_FIELD_X]->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&GUIEditor::Handle_IncrementRotationX, this));
499 + _transformButtonsInc[TRANSFORM_ROTATION][CONTROL_FIELD_X] = EditorBar->getChild("IncRotationXButton");
500 + transformButton = _transformButtonsInc[TRANSFORM_ROTATION][CONTROL_FIELD_X];
501 + transformButton->subscribeEvent(CEGUI::PushButton::EventClicked,
502 + CEGUI::Event::Subscriber(&GUIEditor::Handle_IncrementRotationX, this));
417 503 }
418 504 // Decrement X Rotation
419 505 {
420 - _transformButtonsDec[TRANSFORM_ROTATION][CONTROL_FIELD_X] = static_cast<CEGUI::Window*>(EditorBar->getChild("DecRotationXButton"));
421 - _transformButtonsDec[TRANSFORM_ROTATION][CONTROL_FIELD_X]->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&GUIEditor::Handle_DecrementRotationX, this));
506 + _transformButtonsDec[TRANSFORM_ROTATION][CONTROL_FIELD_X] = EditorBar->getChild("DecRotationXButton");
507 + transformButton = _transformButtonsDec[TRANSFORM_ROTATION][CONTROL_FIELD_X];
508 + transformButton->subscribeEvent(CEGUI::PushButton::EventClicked,
509 + CEGUI::Event::Subscriber(&GUIEditor::Handle_DecrementRotationX, this));
422 510 }
423 511 // Increment Y Rotation
424 512 {
425 - _transformButtonsInc[TRANSFORM_ROTATION][CONTROL_FIELD_Y] = static_cast<CEGUI::Window*>(EditorBar->getChild("IncRotationYButton"));
426 - _transformButtonsInc[TRANSFORM_ROTATION][CONTROL_FIELD_Y]->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&GUIEditor::Handle_IncrementRotationY, this));
513 + _transformButtonsInc[TRANSFORM_ROTATION][CONTROL_FIELD_Y] = EditorBar->getChild("IncRotationYButton");
514 + transformButton = _transformButtonsInc[TRANSFORM_ROTATION][CONTROL_FIELD_Y];
515 + transformButton->subscribeEvent(CEGUI::PushButton::EventClicked,
516 + CEGUI::Event::Subscriber(&GUIEditor::Handle_IncrementRotationY, this));
427 517 }
428 518 // Decrement Y Rotation
429 519 {
430 - _transformButtonsDec[TRANSFORM_ROTATION][CONTROL_FIELD_Y] = static_cast<CEGUI::Window*>(EditorBar->getChild("DecRotationYButton"));
431 - _transformButtonsDec[TRANSFORM_ROTATION][CONTROL_FIELD_Y]->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&GUIEditor::Handle_DecrementRotationY, this));
520 + _transformButtonsDec[TRANSFORM_ROTATION][CONTROL_FIELD_Y] = EditorBar->getChild("DecRotationYButton");
521 + transformButton = _transformButtonsDec[TRANSFORM_ROTATION][CONTROL_FIELD_Y];
522 + transformButton->subscribeEvent(CEGUI::PushButton::EventClicked,
523 + CEGUI::Event::Subscriber(&GUIEditor::Handle_DecrementRotationY, this));
432 524 }
433 525 // Increment Z Rotation
434 526 {
435 - _transformButtonsInc[TRANSFORM_ROTATION][CONTROL_FIELD_Z] = static_cast<CEGUI::Window*>(EditorBar->getChild("IncRotationZButton"));
436 - _transformButtonsInc[TRANSFORM_ROTATION][CONTROL_FIELD_Z]->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&GUIEditor::Handle_IncrementRotationZ, this));
527 + _transformButtonsInc[TRANSFORM_ROTATION][CONTROL_FIELD_Z] = EditorBar->getChild("IncRotationZButton");
528 + transformButton = _transformButtonsInc[TRANSFORM_ROTATION][CONTROL_FIELD_Z];
529 + transformButton->subscribeEvent(CEGUI::PushButton::EventClicked,
530 + CEGUI::Event::Subscriber(&GUIEditor::Handle_IncrementRotationZ, this));
437 531 }
438 532 // Decrement Z Rotation
439 533 {
440 - _transformButtonsDec[TRANSFORM_ROTATION][CONTROL_FIELD_Z] = static_cast<CEGUI::Window*>(EditorBar->getChild("DecRotationZButton"));
441 - _transformButtonsDec[TRANSFORM_ROTATION][CONTROL_FIELD_Z]->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&GUIEditor::Handle_DecrementRotationZ, this));
534 + _transformButtonsDec[TRANSFORM_ROTATION][CONTROL_FIELD_Z] = EditorBar->getChild("DecRotationZButton");
535 + transformButton = _transformButtonsDec[TRANSFORM_ROTATION][CONTROL_FIELD_Z];
536 + transformButton->subscribeEvent(CEGUI::PushButton::EventClicked,
537 + CEGUI::Event::Subscriber(&GUIEditor::Handle_DecrementRotationZ, this));
442 538 }
443 539 // Increment Rotation Granularity
444 540 {
445 - _transformButtonsInc[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY] = static_cast<CEGUI::Window*>(EditorBar->getChild("IncRotationGranButton"));
446 - _transformButtonsInc[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY]->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&GUIEditor::Handle_IncrementRotationGranularity, this));
541 + _transformButtonsInc[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY] = EditorBar->getChild("IncRotationGranButton");
542 + transformButton = _transformButtonsInc[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY];
543 + transformButton->subscribeEvent(CEGUI::PushButton::EventClicked,
544 + CEGUI::Event::Subscriber(&GUIEditor::Handle_IncrementRotationGranularity, this));
447 545 }
448 546 // Decrement Rotation Granularity
449 547 {
450 - _transformButtonsDec[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY] = static_cast<CEGUI::Window*>(EditorBar->getChild("DecRotationGranButton"));
451 - _transformButtonsDec[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY]->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&GUIEditor::Handle_DecrementRotationGranularity, this));
548 + _transformButtonsDec[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY] = EditorBar->getChild("DecRotationGranButton");
549 + transformButton = _transformButtonsDec[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY];
550 + transformButton->subscribeEvent(CEGUI::PushButton::EventClicked,
551 + CEGUI::Event::Subscriber(&GUIEditor::Handle_DecrementRotationGranularity, this));
452 552 }
453 553 // Increment X Scale
454 554 {
455 - _transformButtonsInc[TRANSFORM_SCALE][CONTROL_FIELD_X] = static_cast<CEGUI::Window*>(EditorBar->getChild("IncScaleXButton"));
456 - _transformButtonsInc[TRANSFORM_SCALE][CONTROL_FIELD_X]->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&GUIEditor::Handle_IncrementScaleX, this));
555 + _transformButtonsInc[TRANSFORM_SCALE][CONTROL_FIELD_X] = EditorBar->getChild("IncScaleXButton");
556 + _transformButtonsInc[TRANSFORM_SCALE][CONTROL_FIELD_X];
557 + transformButton->subscribeEvent(CEGUI::PushButton::EventClicked,
558 + CEGUI::Event::Subscriber(&GUIEditor::Handle_IncrementScaleX, this));
457 559 }
458 560 // Decrement X Scale
459 561 {
460 - _transformButtonsDec[TRANSFORM_SCALE][CONTROL_FIELD_X] = static_cast<CEGUI::Window*>(EditorBar->getChild("DecScaleXButton"));
461 - _transformButtonsDec[TRANSFORM_SCALE][CONTROL_FIELD_X]->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&GUIEditor::Handle_DecrementScaleX, this));
562 + _transformButtonsDec[TRANSFORM_SCALE][CONTROL_FIELD_X] = EditorBar->getChild("DecScaleXButton");
563 + transformButton = _transformButtonsDec[TRANSFORM_SCALE][CONTROL_FIELD_X];
564 + transformButton->subscribeEvent(CEGUI::PushButton::EventClicked,
565 + CEGUI::Event::Subscriber(&GUIEditor::Handle_DecrementScaleX, this));
462 566 }
463 567 // Increment Y Scale
464 568 {
465 - _transformButtonsInc[TRANSFORM_SCALE][CONTROL_FIELD_Y]= static_cast<CEGUI::Window*>(EditorBar->getChild("IncScaleYButton"));
466 - _transformButtonsInc[TRANSFORM_SCALE][CONTROL_FIELD_Y]->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&GUIEditor::Handle_IncrementScaleY, this));
569 + _transformButtonsInc[TRANSFORM_SCALE][CONTROL_FIELD_Y]= EditorBar->getChild("IncScaleYButton");
570 + transformButton = _transformButtonsInc[TRANSFORM_SCALE][CONTROL_FIELD_Y];
571 + transformButton->subscribeEvent(CEGUI::PushButton::EventClicked,
572 + CEGUI::Event::Subscriber(&GUIEditor::Handle_IncrementScaleY, this));
467 573 }
468 574 // Decrement Y Scale
469 575 {
470 - _transformButtonsDec[TRANSFORM_SCALE][CONTROL_FIELD_Y] = static_cast<CEGUI::Window*>(EditorBar->getChild("DecScaleYButton"));
471 - _transformButtonsDec[TRANSFORM_SCALE][CONTROL_FIELD_Y]->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&GUIEditor::Handle_DecrementScaleY, this));
576 + _transformButtonsDec[TRANSFORM_SCALE][CONTROL_FIELD_Y] = EditorBar->getChild("DecScaleYButton");
577 + transformButton = _transformButtonsDec[TRANSFORM_SCALE][CONTROL_FIELD_Y];
578 + transformButton->subscribeEvent(CEGUI::PushButton::EventClicked,
579 + CEGUI::Event::Subscriber(&GUIEditor::Handle_DecrementScaleY, this));
472 580 }
473 581 // Increment Z Scale
474 582 {
475 - _transformButtonsInc[TRANSFORM_SCALE][CONTROL_FIELD_Z] = static_cast<CEGUI::Window*>(EditorBar->getChild("IncScaleZButton"));
476 - _transformButtonsInc[TRANSFORM_SCALE][CONTROL_FIELD_Z]->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&GUIEditor::Handle_IncrementScaleZ, this));
583 + _transformButtonsInc[TRANSFORM_SCALE][CONTROL_FIELD_Z] = EditorBar->getChild("IncScaleZButton");
584 + transformButton = _transformButtonsInc[TRANSFORM_SCALE][CONTROL_FIELD_Z];
585 + transformButton->subscribeEvent(CEGUI::PushButton::EventClicked,
586 + CEGUI::Event::Subscriber(&GUIEditor::Handle_IncrementScaleZ, this));
477 587 }
478 588 // Decrement Z Scale
479 589 {
480 - _transformButtonsDec[TRANSFORM_SCALE][CONTROL_FIELD_Z] = static_cast<CEGUI::Window*>(EditorBar->getChild("DecScaleZButton"));
481 - _transformButtonsDec[TRANSFORM_SCALE][CONTROL_FIELD_Z]->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&GUIEditor::Handle_DecrementScaleZ, this));
590 + _transformButtonsDec[TRANSFORM_SCALE][CONTROL_FIELD_Z] = EditorBar->getChild("DecScaleZButton");
591 + transformButton = _transformButtonsDec[TRANSFORM_SCALE][CONTROL_FIELD_Z];
592 + transformButton->subscribeEvent(CEGUI::PushButton::EventClicked,
593 + CEGUI::Event::Subscriber(&GUIEditor::Handle_DecrementScaleZ, this));
482 594 }
483 595 // Increment Scale Granularity
484 596 {
485 - _transformButtonsInc[TRANSFORM_SCALE][CONTROL_FIELD_GRANULARITY] = static_cast<CEGUI::Window*>(EditorBar->getChild("IncScaleGranButton"));
486 - _transformButtonsInc[TRANSFORM_SCALE][CONTROL_FIELD_GRANULARITY]->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&GUIEditor::Handle_IncrementScaleGranularity, this));
597 + _transformButtonsInc[TRANSFORM_SCALE][CONTROL_FIELD_GRANULARITY] = EditorBar->getChild("IncScaleGranButton");
598 + transformButton = _transformButtonsInc[TRANSFORM_SCALE][CONTROL_FIELD_GRANULARITY];
599 + transformButton->subscribeEvent(CEGUI::PushButton::EventClicked,
600 + CEGUI::Event::Subscriber(&GUIEditor::Handle_IncrementScaleGranularity, this));
487 601 }
488 602 // Decrement Scale Granularity
489 603 {
490 - _transformButtonsDec[TRANSFORM_SCALE][CONTROL_FIELD_GRANULARITY] = static_cast<CEGUI::Window*>(EditorBar->getChild("DecScaleGranButton"));
491 - _transformButtonsDec[TRANSFORM_SCALE][CONTROL_FIELD_GRANULARITY]->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&GUIEditor::Handle_DecrementScaleGranularity, this));
604 + _transformButtonsDec[TRANSFORM_SCALE][CONTROL_FIELD_GRANULARITY] = EditorBar->getChild("DecScaleGranButton");
605 + transformButton = _transformButtonsDec[TRANSFORM_SCALE][CONTROL_FIELD_GRANULARITY];
606 + transformButton->subscribeEvent(CEGUI::PushButton::EventClicked,
607 + CEGUI::Event::Subscriber(&GUIEditor::Handle_DecrementScaleGranularity, this));
492 608 }
493 609 }
494 610
  @@ -553,7 +669,8 @@
553 669 } else {
554 670 D_PRINT_FN("[Editor]: Depth Preview disabled!");
555 671 }
556 - ParamHandler::getInstance().setParam("postProcessing.fullScreenDepthBuffer", _toggleButtons[TOGGLE_DEPTH_PREVIEW]->isSelected());
672 + ParamHandler::getInstance().setParam("postProcessing.fullScreenDepthBuffer",
673 + _toggleButtons[TOGGLE_DEPTH_PREVIEW]->isSelected());
557 674 return true;
558 675 }
559 676
  @@ -598,7 +715,8 @@
598 715 D_PRINT_FN("[Editor]: Bounding Box rendering disabled!");
599 716 }
600 717 if (_currentSelection) {
601 - _currentSelection->getComponent<RenderingComponent>()->renderBoundingBox(_toggleButtons[TOGGLE_BOUNDING_BOXES]->isSelected());
718 + RenderingComponent* rComp = _currentSelection->getComponent<RenderingComponent>();
719 + rComp->renderBoundingBox(_toggleButtons[TOGGLE_BOUNDING_BOXES]->isSelected());
602 720 }
603 721 return true;
604 722 }
  @@ -628,7 +746,8 @@
628 746
629 747 bool GUIEditor::Handle_PositionXChange(const CEGUI::EventArgs &e) {
630 748 D_PRINT_FN("[Editor]: Position X changed via text edit!");
631 - _currentValues[TRANSFORM_POSITION][CONTROL_FIELD_X] = CEGUI::PropertyHelper<F32>::fromString(_valuesField[TRANSFORM_POSITION][CONTROL_FIELD_X]->getText());
749 + F32 x = CEGUI::PropertyHelper<F32>::fromString(_valuesField[TRANSFORM_POSITION][CONTROL_FIELD_X]->getText());
750 + _currentValues[TRANSFORM_POSITION][CONTROL_FIELD_X] = x;
632 751 _currentSelection->getComponent<PhysicsComponent>()->setPositionX(_currentValues[TRANSFORM_POSITION][CONTROL_FIELD_X]);
633 752 _pauseSelectionTracking = false;
634 753 return true;
  @@ -636,7 +755,8 @@
636 755
637 756 bool GUIEditor::Handle_PositionYChange(const CEGUI::EventArgs &e) {
638 757 D_PRINT_FN("[Editor]: Position Y changed via text edit!");
639 - _currentValues[TRANSFORM_POSITION][CONTROL_FIELD_Y] = CEGUI::PropertyHelper<F32>::fromString(_valuesField[TRANSFORM_POSITION][CONTROL_FIELD_Y]->getText());
758 + F32 y = CEGUI::PropertyHelper<F32>::fromString(_valuesField[TRANSFORM_POSITION][CONTROL_FIELD_Y]->getText());
759 + _currentValues[TRANSFORM_POSITION][CONTROL_FIELD_Y] = y;
640 760 _currentSelection->getComponent<PhysicsComponent>()->setPositionY(_currentValues[TRANSFORM_POSITION][CONTROL_FIELD_Y]);
641 761 _pauseSelectionTracking = false;
642 762 return true;
  @@ -644,7 +764,8 @@
644 764
645 765 bool GUIEditor::Handle_PositionZChange(const CEGUI::EventArgs &e) {
646 766 D_PRINT_FN("[Editor]: Position Z changed via text edit!");
647 - _currentValues[TRANSFORM_POSITION][CONTROL_FIELD_Z] = CEGUI::PropertyHelper<F32>::fromString(_valuesField[TRANSFORM_POSITION][CONTROL_FIELD_Z]->getText());
767 + F32 z = CEGUI::PropertyHelper<F32>::fromString(_valuesField[TRANSFORM_POSITION][CONTROL_FIELD_Z]->getText());
768 + _currentValues[TRANSFORM_POSITION][CONTROL_FIELD_Z] = z;
648 769 _currentSelection->getComponent<PhysicsComponent>()->setPositionZ(_currentValues[TRANSFORM_POSITION][CONTROL_FIELD_Z]);
649 770 _pauseSelectionTracking = false;
650 771 return true;
  @@ -652,59 +773,73 @@
652 773
653 774 bool GUIEditor::Handle_PositionGranularityChange(const CEGUI::EventArgs &e) {
654 775 D_PRINT_FN("[Editor]: Position Granularity changed via text edit!");
655 - _currentValues[TRANSFORM_POSITION][CONTROL_FIELD_GRANULARITY] = CEGUI::PropertyHelper<F32>::fromString(_valuesField[TRANSFORM_POSITION][CONTROL_FIELD_GRANULARITY]->getText());
776 + F32 gran = CEGUI::PropertyHelper<F32>::fromString(_valuesField[TRANSFORM_POSITION][CONTROL_FIELD_GRANULARITY]->getText());
777 + _currentValues[TRANSFORM_POSITION][CONTROL_FIELD_GRANULARITY] = gran;
656 778 CLAMP<F32>(_currentValues[TRANSFORM_POSITION][CONTROL_FIELD_GRANULARITY], 0.0000001f, 10000000.0f);
657 - _valuesField[TRANSFORM_POSITION][CONTROL_FIELD_GRANULARITY]->setText(CEGUI::PropertyHelper<F32>::toString(_currentValues[TRANSFORM_POSITION][CONTROL_FIELD_GRANULARITY]));
779 + CEGUI::String granStr = CEGUI::PropertyHelper<F32>::toString(_currentValues[TRANSFORM_POSITION][CONTROL_FIELD_GRANULARITY]);
780 + _valuesField[TRANSFORM_POSITION][CONTROL_FIELD_GRANULARITY]->setText(granStr);
658 781 return true;
659 782 }
660 783
661 784 bool GUIEditor::Handle_RotationXChange(const CEGUI::EventArgs &e) {
662 785 D_PRINT_FN("[Editor]: Rotation X changed via text edit!");
663 - _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_X] = CEGUI::PropertyHelper<F32>::fromString(_valuesField[TRANSFORM_ROTATION][CONTROL_FIELD_X]->getText());
786 + F32 x = CEGUI::PropertyHelper<F32>::fromString(_valuesField[TRANSFORM_ROTATION][CONTROL_FIELD_X]->getText());
787 + _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_X] = x;
664 788 CLAMP<F32>(_currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_X], -360.0f, 360.0f);
665 - _valuesField[TRANSFORM_ROTATION][CONTROL_FIELD_X]->setText(CEGUI::PropertyHelper<F32>::toString(_currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_X]));
666 - _currentSelection->getComponent<PhysicsComponent>()->setRotation(vec3<F32>(_currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_X],
667 - _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Y],
668 - _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Z]));
789 + CEGUI::String xStr = CEGUI::PropertyHelper<F32>::toString(_currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_X]);
790 + _valuesField[TRANSFORM_ROTATION][CONTROL_FIELD_X]->setText(xStr);
791 + PhysicsComponent* pComp = _currentSelection->getComponent<PhysicsComponent>();
792 + pComp->setRotation(vec3<F32>(_currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_X],
793 + _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Y],
794 + _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Z]));
669 795 _pauseSelectionTracking = false;
670 796 return true;
671 797 }
672 798
673 799 bool GUIEditor::Handle_RotationYChange(const CEGUI::EventArgs &e) {
674 800 D_PRINT_FN("[Editor]: Rotation Y changed via text edit!");
675 - _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Y] = CEGUI::PropertyHelper<F32>::fromString(_valuesField[TRANSFORM_ROTATION][CONTROL_FIELD_Y]->getText());
801 + F32 y = CEGUI::PropertyHelper<F32>::fromString(_valuesField[TRANSFORM_ROTATION][CONTROL_FIELD_Y]->getText());
802 + _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Y] = y;
676 803 CLAMP<F32>(_currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Y], -360.0f, 360.0f);
677 - _valuesField[TRANSFORM_ROTATION][CONTROL_FIELD_Y]->setText(CEGUI::PropertyHelper<F32>::toString(_currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Y]));
678 - _currentSelection->getComponent<PhysicsComponent>()->setRotation(vec3<F32>(_currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_X],
679 - _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Y],
680 - _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Z]));
804 + CEGUI::String yStr = CEGUI::PropertyHelper<F32>::toString(_currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Y]);
805 + _valuesField[TRANSFORM_ROTATION][CONTROL_FIELD_Y]->setText(yStr);
806 + PhysicsComponent* pComp = _currentSelection->getComponent<PhysicsComponent>();
807 + pComp->setRotation(vec3<F32>(_currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_X],
808 + _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Y],
809 + _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Z]));
681 810 _pauseSelectionTracking = false;
682 811 return true;
683 812 }
684 813
685 814 bool GUIEditor::Handle_RotationZChange(const CEGUI::EventArgs &e) {
686 815 D_PRINT_FN("[Editor]: Position X changed via text edit!");
687 - _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Z] = CEGUI::PropertyHelper<F32>::fromString(_valuesField[TRANSFORM_ROTATION][CONTROL_FIELD_Z]->getText());
816 + F32 z = CEGUI::PropertyHelper<F32>::fromString(_valuesField[TRANSFORM_ROTATION][CONTROL_FIELD_Z]->getText());
817 + _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Z] = z;
688 818 CLAMP<F32>(_currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Z], -360.0f, 360.0f);
689 - _valuesField[TRANSFORM_ROTATION][CONTROL_FIELD_Z]->setText(CEGUI::PropertyHelper<F32>::toString(_currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Z]));
690 - _currentSelection->getComponent<PhysicsComponent>()->setRotation(vec3<F32>(_currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_X],
691 - _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Y],
692 - _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Z]));
819 + CEGUI::String zStr = CEGUI::PropertyHelper<F32>::toString(_currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Z]);
820 + _valuesField[TRANSFORM_ROTATION][CONTROL_FIELD_Z]->setText(zStr);
821 + PhysicsComponent* pComp = _currentSelection->getComponent<PhysicsComponent>();
822 + pComp->setRotation(vec3<F32>(_currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_X],
823 + _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Y],
824 + _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Z]));
693 825 _pauseSelectionTracking = false;
694 826 return true;
695 827 }
696 828
697 829 bool GUIEditor::Handle_RotationGranularityChange(const CEGUI::EventArgs &e) {
698 830 D_PRINT_FN("[Editor]: Rotation Granularity changed via text edit!");
699 - _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY] = CEGUI::PropertyHelper<F32>::fromString(_valuesField[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY]->getText());
831 + F32 gran = CEGUI::PropertyHelper<F32>::fromString(_valuesField[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY]->getText());
832 + _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY] = gran;
700 833 CLAMP<F32>(_currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY], 0.0000001f, 359.0f);
701 - _valuesField[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY]->setText(CEGUI::PropertyHelper<F32>::toString(_currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY]));
834 + CEGUI::String granStr = CEGUI::PropertyHelper<F32>::toString(_currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY]);
835 + _valuesField[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY]->setText(granStr);
702 836 return true;
703 837 }
704 838
705 839 bool GUIEditor::Handle_ScaleXChange(const CEGUI::EventArgs &e) {
706 840 D_PRINT_FN("[Editor]: Scale X changed via text edit!");
707 - _currentValues[TRANSFORM_SCALE][CONTROL_FIELD_X] = CEGUI::PropertyHelper<F32>::fromString(_valuesField[TRANSFORM_SCALE][CONTROL_FIELD_X]->getText());
841 + F32 x = CEGUI::PropertyHelper<F32>::fromString(_valuesField[TRANSFORM_SCALE][CONTROL_FIELD_X]->getText());
842 + _currentValues[TRANSFORM_SCALE][CONTROL_FIELD_X] = x;
708 843 _currentSelection->getComponent<PhysicsComponent>()->setScaleX(_currentValues[TRANSFORM_SCALE][CONTROL_FIELD_X]);
709 844 _pauseSelectionTracking = false;
710 845 return true;
  @@ -712,7 +847,8 @@
712 847
713 848 bool GUIEditor::Handle_ScaleYChange(const CEGUI::EventArgs &e) {
714 849 D_PRINT_FN("[Editor]: Scale Y changed via text edit!");
715 - _currentValues[TRANSFORM_SCALE][CONTROL_FIELD_Y] = CEGUI::PropertyHelper<F32>::fromString(_valuesField[TRANSFORM_SCALE][CONTROL_FIELD_Y]->getText());
850 + F32 y = CEGUI::PropertyHelper<F32>::fromString(_valuesField[TRANSFORM_SCALE][CONTROL_FIELD_Y]->getText());
851 + _currentValues[TRANSFORM_SCALE][CONTROL_FIELD_Y] = y;
716 852 _currentSelection->getComponent<PhysicsComponent>()->setScaleY(_currentValues[TRANSFORM_SCALE][CONTROL_FIELD_Y]);
717 853 _pauseSelectionTracking = false;
718 854 return true;
  @@ -720,7 +856,8 @@
720 856
721 857 bool GUIEditor::Handle_ScaleZChange(const CEGUI::EventArgs &e) {
722 858 D_PRINT_FN("[Editor]: Scale Z changed via text edit!");
723 - _currentValues[TRANSFORM_SCALE][CONTROL_FIELD_Z] = CEGUI::PropertyHelper<F32>::fromString(_valuesField[TRANSFORM_SCALE][CONTROL_FIELD_Z]->getText());
859 + F32 z = CEGUI::PropertyHelper<F32>::fromString(_valuesField[TRANSFORM_SCALE][CONTROL_FIELD_Z]->getText());
860 + _currentValues[TRANSFORM_SCALE][CONTROL_FIELD_Z] = z;
724 861 _currentSelection->getComponent<PhysicsComponent>()->setScaleZ(_currentValues[TRANSFORM_SCALE][CONTROL_FIELD_Z]);
725 862 _pauseSelectionTracking = false;
726 863 return true;
  @@ -728,9 +865,11 @@
728 865
729 866 bool GUIEditor::Handle_ScaleGranularityChange(const CEGUI::EventArgs &e) {
730 867 D_PRINT_FN("[Editor]: Scale Granularity changed via text edit!");
731 - _currentValues[TRANSFORM_SCALE][CONTROL_FIELD_GRANULARITY] = CEGUI::PropertyHelper<F32>::fromString(_valuesField[TRANSFORM_SCALE][CONTROL_FIELD_GRANULARITY]->getText());
868 + F32 gran = CEGUI::PropertyHelper<F32>::fromString(_valuesField[TRANSFORM_SCALE][CONTROL_FIELD_GRANULARITY]->getText());
869 + _currentValues[TRANSFORM_SCALE][CONTROL_FIELD_GRANULARITY] = gran;
732 870 CLAMP<F32>(_currentValues[TRANSFORM_SCALE][CONTROL_FIELD_GRANULARITY], 0.0000001f, 10000000.0f);
733 - _valuesField[TRANSFORM_SCALE][CONTROL_FIELD_GRANULARITY]->setText(CEGUI::PropertyHelper<F32>::toString(_currentValues[TRANSFORM_SCALE][CONTROL_FIELD_GRANULARITY]));
871 + CEGUI::String granStr = CEGUI::PropertyHelper<F32>::toString(_currentValues[TRANSFORM_SCALE][CONTROL_FIELD_GRANULARITY]);
872 + _valuesField[TRANSFORM_SCALE][CONTROL_FIELD_GRANULARITY]->setText(granStr);
734 873 return true;
735 874 }
736 875
  @@ -790,15 +929,19 @@
790 929
791 930 bool GUIEditor::Handle_IncrementPositionGranularity(const CEGUI::EventArgs &e) {
792 931 D_PRINT_FN("[Editor]: Position Granularity incremented via button!");
793 - _currentValues[TRANSFORM_POSITION][CONTROL_FIELD_GRANULARITY] = std::min(_currentValues[TRANSFORM_POSITION][CONTROL_FIELD_GRANULARITY] * 10.0f, 10000000.0f);
794 - _valuesField[TRANSFORM_POSITION][CONTROL_FIELD_GRANULARITY]->setText(CEGUI::PropertyHelper<F32>::toString(_currentValues[TRANSFORM_POSITION][CONTROL_FIELD_GRANULARITY]));
932 + F32 pos = std::min(_currentValues[TRANSFORM_POSITION][CONTROL_FIELD_GRANULARITY] * 10.0f, 10000000.0f);
933 + _currentValues[TRANSFORM_POSITION][CONTROL_FIELD_GRANULARITY] = pos;
934 + CEGUI::String posStr = CEGUI::PropertyHelper<F32>::toString(_currentValues[TRANSFORM_POSITION][CONTROL_FIELD_GRANULARITY]);
935 + _valuesField[TRANSFORM_POSITION][CONTROL_FIELD_GRANULARITY]->setText(posStr);
795 936 return true;
796 937 }
797 938
798 939 bool GUIEditor::Handle_DecrementPositionGranularity(const CEGUI::EventArgs &e) {
799 940 D_PRINT_FN("[Editor]: Position Granularity decremented via button!");
800 - _currentValues[TRANSFORM_POSITION][CONTROL_FIELD_GRANULARITY] = std::max(_currentValues[TRANSFORM_POSITION][CONTROL_FIELD_GRANULARITY] / 10.0f, 0.0000001f);
801 - _valuesField[TRANSFORM_POSITION][CONTROL_FIELD_GRANULARITY]->setText(CEGUI::PropertyHelper<F32>::toString(_currentValues[TRANSFORM_POSITION][CONTROL_FIELD_GRANULARITY]));
941 + F32 pos = std::max(_currentValues[TRANSFORM_POSITION][CONTROL_FIELD_GRANULARITY] / 10.0f, 0.0000001f);
942 + _currentValues[TRANSFORM_POSITION][CONTROL_FIELD_GRANULARITY] = pos;
943 + CEGUI::String posStr = CEGUI::PropertyHelper<F32>::toString(_currentValues[TRANSFORM_POSITION][CONTROL_FIELD_GRANULARITY]);
944 + _valuesField[TRANSFORM_POSITION][CONTROL_FIELD_GRANULARITY]->setText(posStr);
802 945 return true;
803 946 }
804 947
  @@ -806,9 +949,10 @@
806 949 D_PRINT_FN("[Editor]: Rotation X incremented via button!");
807 950 assert(_currentSelection != nullptr);
808 951 _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_X] += _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY];
809 - _currentSelection->getComponent<PhysicsComponent>()->setRotation(vec3<F32>(_currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_X],
810 - _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Y],
811 - _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Z]));
952 + PhysicsComponent* pComp = _currentSelection->getComponent<PhysicsComponent>();
953 + pComp->setRotation(vec3<F32>(_currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_X],
954 + _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Y],
955 + _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Z]));
812 956 return true;
813 957 }
814 958
  @@ -816,9 +960,10 @@
816 960 D_PRINT_FN("[Editor]: Rotation X decremented via button!");
817 961 assert(_currentSelection != nullptr);
818 962 _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_X] -= _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY];
819 - _currentSelection->getComponent<PhysicsComponent>()->setRotation(vec3<F32>(_currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_X],
820 - _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Y],
821 - _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Z]));
963 + PhysicsComponent* pComp = _currentSelection->getComponent<PhysicsComponent>();
964 + pComp->setRotation(vec3<F32>(_currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_X],
965 + _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Y],
966 + _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Z]));
822 967 return true;
823 968 }
824 969
  @@ -826,9 +971,10 @@
826 971 D_PRINT_FN("[Editor]: Rotation Y incremented via button!");
827 972 assert(_currentSelection != nullptr);
828 973 _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Y] += _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY];
829 - _currentSelection->getComponent<PhysicsComponent>()->setRotation(vec3<F32>(_currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_X],
830 - _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Y],
831 - _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Z]));
974 + PhysicsComponent* pComp = _currentSelection->getComponent<PhysicsComponent>();
975 + pComp->setRotation(vec3<F32>(_currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_X],
976 + _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Y],
977 + _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Z]));
832 978 return true;
833 979 }
834 980
  @@ -836,9 +982,10 @@
836 982 D_PRINT_FN("[Editor]: Rotation Y decremented via button!");
837 983 assert(_currentSelection != nullptr);
838 984 _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Y] -= _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY];
839 - _currentSelection->getComponent<PhysicsComponent>()->setRotation(vec3<F32>(_currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_X],
840 - _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Y],
841 - _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Z]));
985 + PhysicsComponent* pComp = _currentSelection->getComponent<PhysicsComponent>();
986 + pComp->setRotation(vec3<F32>(_currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_X],
987 + _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Y],
988 + _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Z]));
842 989 return true;
843 990 }
844 991
  @@ -846,9 +993,10 @@
846 993 D_PRINT_FN("[Editor]: Rotation Z incremented via button!");
847 994 assert(_currentSelection != nullptr);
848 995 _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Z] += _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY];
849 - _currentSelection->getComponent<PhysicsComponent>()->setRotation(vec3<F32>(_currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_X],
850 - _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Y],
851 - _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Z]));
996 + PhysicsComponent* pComp = _currentSelection->getComponent<PhysicsComponent>();
997 + pComp->setRotation(vec3<F32>(_currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_X],
998 + _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Y],
999 + _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Z]));
852 1000 return true;
853 1001 }
854 1002
  @@ -856,23 +1004,28 @@
856 1004 D_PRINT_FN("[Editor]: Rotation Z decremented via button!");
857 1005 assert(_currentSelection != nullptr);
858 1006 _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Z] -= _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY];
859 - _currentSelection->getComponent<PhysicsComponent>()->setRotation(vec3<F32>(_currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_X],
860 - _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Y],
861 - _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Z]));
1007 + PhysicsComponent* pComp = _currentSelection->getComponent<PhysicsComponent>();
1008 + pComp->setRotation(vec3<F32>(_currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_X],
1009 + _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Y],
1010 + _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_Z]));
862 1011 return true;
863 1012 }
864 1013
865 1014 bool GUIEditor::Handle_IncrementRotationGranularity(const CEGUI::EventArgs &e) {
866 1015 D_PRINT_FN("[Editor]: Rotation Granularity incremented via button!");
867 - _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY] = std::min(_currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY] * 10.0f, 359.0f);
868 - _valuesField[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY]->setText(CEGUI::PropertyHelper<F32>::toString(_currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY]));
1016 + F32 gran = std::min(_currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY] * 10.0f, 359.0f);
1017 + _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY] = gran;
1018 + CEGUI::String granStr = CEGUI::PropertyHelper<F32>::toString(_currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY]);
1019 + _valuesField[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY]->setText(granStr);
869 1020 return true;
870 1021 }
871 1022
872 1023 bool GUIEditor::Handle_DecrementRotationGranularity(const CEGUI::EventArgs &e) {
873 1024 D_PRINT_FN("[Editor]: Rotation Granularity decremented via button!");
874 - _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY] = std::max(_currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY] / 10.0f, 0.0000001f);
875 - _valuesField[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY]->setText(CEGUI::PropertyHelper<F32>::toString(_currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY]));
1025 + F32 gran = std::max(_currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY] / 10.0f, 0.0000001f);
1026 + _currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY] = gran;
1027 + CEGUI::String granStr = CEGUI::PropertyHelper<F32>::toString(_currentValues[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY]);
1028 + _valuesField[TRANSFORM_ROTATION][CONTROL_FIELD_GRANULARITY]->setText(granStr);
876 1029 return true;
877 1030 }
878 1031
  @@ -925,15 +1078,19 @@
925 1078
926 1079 bool GUIEditor::Handle_IncrementScaleGranularity(const CEGUI::EventArgs &e) {
927 1080 D_PRINT_FN("[Editor]: Scale Granularity incremented via button!");
928 - _currentValues[TRANSFORM_SCALE][CONTROL_FIELD_GRANULARITY] = std::min(_currentValues[TRANSFORM_SCALE][CONTROL_FIELD_GRANULARITY] * 10.0f, 10000000.0f);
929 - _valuesField[TRANSFORM_SCALE][CONTROL_FIELD_GRANULARITY]->setText(CEGUI::PropertyHelper<F32>::toString(_currentValues[TRANSFORM_SCALE][CONTROL_FIELD_GRANULARITY]));
1081 + F32 gran = std::min(_currentValues[TRANSFORM_SCALE][CONTROL_FIELD_GRANULARITY] * 10.0f, 10000000.0f);
1082 + _currentValues[TRANSFORM_SCALE][CONTROL_FIELD_GRANULARITY] = gran;
1083 + CEGUI::String granStr = CEGUI::PropertyHelper<F32>::toString(_currentValues[TRANSFORM_SCALE][CONTROL_FIELD_GRANULARITY]);
1084 + _valuesField[TRANSFORM_SCALE][CONTROL_FIELD_GRANULARITY]->setText(granStr);
930 1085 return true;
931 1086 }
932 1087
933 1088 bool GUIEditor::Handle_DecrementScaleGranularity(const CEGUI::EventArgs &e) {
934 1089 D_PRINT_FN("[Editor]: Scale Granularity decremented via button!");
935 - _currentValues[TRANSFORM_SCALE][CONTROL_FIELD_GRANULARITY] = std::max(_currentValues[TRANSFORM_SCALE][CONTROL_FIELD_GRANULARITY] / 10.0f, 0.0000001f);
936 - _valuesField[TRANSFORM_SCALE][CONTROL_FIELD_GRANULARITY]->setText(CEGUI::PropertyHelper<F32>::toString(_currentValues[TRANSFORM_SCALE][CONTROL_FIELD_GRANULARITY]));
1090 + F32 gran = std::max(_currentValues[TRANSFORM_SCALE][CONTROL_FIELD_GRANULARITY] / 10.0f, 0.0000001f);
1091 + _currentValues[TRANSFORM_SCALE][CONTROL_FIELD_GRANULARITY] = gran;
1092 + CEGUI::String granStr = CEGUI::PropertyHelper<F32>::toString(_currentValues[TRANSFORM_SCALE][CONTROL_FIELD_GRANULARITY]);
1093 + _valuesField[TRANSFORM_SCALE][CONTROL_FIELD_GRANULARITY]->setText(granStr);
937 1094 return true;
938 1095 }
939 1096