[colobot] 296/390: Copying info about selected object to clipboard (#391)
Didier Raboud
odyx at moszumanska.debian.org
Fri Jun 12 14:21:56 UTC 2015
This is an automated email from the git hooks/post-receive script.
odyx pushed a commit to branch upstream/latest
in repository colobot.
commit a0097a0e5390a99c604aa459b6913469530e0836
Author: krzys-h <krzys_h at interia.pl>
Date: Sun Mar 22 16:32:21 2015 +0100
Copying info about selected object to clipboard (#391)
---
src/object/robotmain.cpp | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/object/robotmain.cpp b/src/object/robotmain.cpp
index f932e93..36b9182 100644
--- a/src/object/robotmain.cpp
+++ b/src/object/robotmain.cpp
@@ -26,6 +26,8 @@
#include "app/controller.h"
#include "app/input.h"
+#include "clipboard/clipboard.h"
+
#include "common/event.h"
#include "common/global.h"
#include "common/iman.h"
@@ -888,6 +890,15 @@ bool CRobotMain::ProcessEvent(Event &event)
{
SetSpeed(4.0f);
}
+ if (event.key.key == KEY(c) && ((event.kmodState & KEY_MOD(CTRL)) != 0) && m_engine->GetShowStats())
+ {
+ std::ostringstream ss;
+ CObject* obj = GetSelect();
+ if(obj != nullptr) {
+ ss << "CreateObject type=" << GetTypeObject(obj->GetType()) << " pos=" << std::fixed << std::setprecision(3) << obj->GetPosition(0).x/g_unit << ";" << obj->GetPosition(0).z/g_unit << " dir=" << (obj->GetAngleZ(0)/(Math::PI/180.0f));
+ }
+ widgetSetClipboardText(ss.str().c_str());
+ }
break;
case EVENT_KEY_UP:
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/colobot.git
More information about the Pkg-games-commits
mailing list