From 69aad4caa2a8556432c4a3e6a8849fad557ab335 Mon Sep 17 00:00:00 2001 From: jacob1 Date: Sun, 21 Oct 2012 19:42:06 -0400 Subject: [PATCH] some testing with DEBUG mode, add some stuff Conflicts: src/cat/TPTScriptInterface.cpp --- src/cat/TPTScriptInterface.cpp | 7 +++++- src/interface/Window.cpp | 41 ++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/src/cat/TPTScriptInterface.cpp b/src/cat/TPTScriptInterface.cpp index 7f1556603..982425f6a 100644 --- a/src/cat/TPTScriptInterface.cpp +++ b/src/cat/TPTScriptInterface.cpp @@ -218,7 +218,12 @@ AnyType TPTScriptInterface::tptS_set(std::deque * words) { newValue = GetParticleType(((StringType)value).Value()); if (newValue < 0 || newValue >= PT_NUM) - throw GeneralException("Invalid element"); + { + if (newString == "GOLD") + throw GeneralException("No, GOLD will not be an element"); + else + throw GeneralException("Invalid element"); + } } else throw GeneralException("Invalid value for assignment"); diff --git a/src/interface/Window.cpp b/src/interface/Window.cpp index 013ec1a41..e36f9c1f9 100644 --- a/src/interface/Window.cpp +++ b/src/interface/Window.cpp @@ -283,6 +283,47 @@ void Window::DoKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool a if(key == KEY_RIGHT) focusedComponent_->Position.X++; } + if (key == KEY_DELETE) + { + RemoveComponent(focusedComponent_); + halt = false; + } + } + else + { + if(shift) + { + if(key == KEY_UP) + Size.Y--; + if(key == KEY_DOWN) + Size.Y++; + if(key == KEY_LEFT) + Size.X--; + if(key == KEY_RIGHT) + Size.X++; + } + if(ctrl) + { + if(key == KEY_UP) + Size.Y++; + if(key == KEY_DOWN) + Size.Y--; + if(key == KEY_LEFT) + Size.X++; + if(key == KEY_RIGHT) + Size.X--; + } + if(!shift) + { + if(key == KEY_UP) + Position.Y--; + if(key == KEY_DOWN) + Position.Y++; + if(key == KEY_LEFT) + Position.X--; + if(key == KEY_RIGHT) + Position.X++; + } } return; }