AEEditorStrings.cpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // Copyright (c) 2014-2015, THUNDERBEAST GAMES LLC All rights reserved
  2. // Please see LICENSE.md in repository root for license information
  3. // https://github.com/AtomicGameEngine/AtomicGameEngine
  4. #include "AtomicEditor.h"
  5. #include <Atomic/Core/Context.h>
  6. #include "AEEvents.h"
  7. #include "AEEditorStrings.h"
  8. namespace AtomicEditor
  9. {
  10. EditorStrings::EditorStrings(Context* context) :
  11. Object(context)
  12. {
  13. InitializeStrings();
  14. SubscribeToEvent(E_EDITORSHUTDOWN, HANDLER(EditorStrings, HandleEditorShutdown));
  15. }
  16. EditorStrings::~EditorStrings()
  17. {
  18. }
  19. const String& EditorStrings::Str(EditorString estring)
  20. {
  21. if (stringLookup_.Contains(estring))
  22. return stringLookup_[estring];
  23. return String::EMPTY;
  24. }
  25. void EditorStrings::InitializeStrings()
  26. {
  27. stringLookup_[RevealInFinder] = "Reveal in Finder";
  28. // Shortcuts
  29. stringLookup_[ShortcutUndo] = "⌘Z";
  30. stringLookup_[ShortcutRedo] ="⇧⌘Z";
  31. stringLookup_[ShortcutCut] = "⌘X";
  32. stringLookup_[ShortcutCopy] = "⌘C";
  33. stringLookup_[ShortcutPaste] = "⌘V";
  34. stringLookup_[ShortcutFind] = "⌘F";
  35. stringLookup_[ShortcutBeautify] = "⌘I";
  36. stringLookup_[ShortcutSaveFile] = "⌘S";
  37. stringLookup_[ShortcutCloseFile] = "⌘W";
  38. stringLookup_[ShortcutPlay] = "⌘P";
  39. stringLookup_[ShortcutBuild] = "⌘B";
  40. stringLookup_[ShortcutBuildSettings] = "⇧⌘B";
  41. }
  42. void EditorStrings::HandleEditorShutdown(StringHash eventType, VariantMap& eventData)
  43. {
  44. context_->RemoveSubsystem(GetType());
  45. }
  46. }