EditorStrings.ts 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. //
  2. // Copyright (c) 2014-2015, THUNDERBEAST GAMES LLC All rights reserved
  3. // LICENSE: Atomic Game Engine Editor and Tools EULA
  4. // Please see LICENSE_ATOMIC_EDITOR_AND_TOOLS.md in repository root for
  5. // license information: https://github.com/AtomicGameEngine/AtomicGameEngine
  6. //
  7. export enum StringID {
  8. RevealInFinder,
  9. ShortcutUndo,
  10. ShortcutRedo,
  11. ShortcutCut,
  12. ShortcutCopy,
  13. ShortcutPaste,
  14. ShortcutSelectAll,
  15. ShortcutFind,
  16. ShortcutFindNext,
  17. ShortcutFindPrev,
  18. ShortcutBeautify,
  19. ShortcutCloseFile,
  20. ShortcutSaveFile,
  21. ShortcutPlay,
  22. ShortcutBuild,
  23. ShortcutBuildSettings
  24. }
  25. export class EditorString {
  26. public static GetString(id: StringID): string {
  27. return EditorString.lookup[id];
  28. }
  29. private static lookup: { [id: number]: string; } = {};
  30. private static Ctor = (() => {
  31. var lookup = EditorString.lookup;
  32. var lookup = EditorString.lookup;
  33. var shortcutKey;
  34. if (Atomic.platform == "MacOSX") {
  35. shortcutKey = "⌘";
  36. } else { // Windows and Linux
  37. shortcutKey = "CTRL + "
  38. }
  39. lookup[StringID.RevealInFinder] = "Reveal in Finder";
  40. // Mac, Windows and Linux
  41. lookup[StringID.ShortcutRedo] = "⇧" + shortcutKey + "Z";
  42. lookup[StringID.ShortcutFindNext] = shortcutKey + "G";
  43. lookup[StringID.ShortcutFindPrev] = "⇧" + shortcutKey + "G";
  44. lookup[StringID.ShortcutBuildSettings] = "⇧" + shortcutKey + "B";
  45. // General
  46. lookup[StringID.ShortcutUndo] = shortcutKey + "Z";
  47. lookup[StringID.ShortcutCut] = shortcutKey + "X";
  48. lookup[StringID.ShortcutCopy] = shortcutKey + "C";
  49. lookup[StringID.ShortcutPaste] = shortcutKey + "V";
  50. lookup[StringID.ShortcutSelectAll] = shortcutKey + "A";
  51. lookup[StringID.ShortcutFind] = shortcutKey + "F";
  52. lookup[StringID.ShortcutBeautify] = shortcutKey + "I";
  53. lookup[StringID.ShortcutSaveFile] = shortcutKey + "S";
  54. lookup[StringID.ShortcutCloseFile] = shortcutKey + "W";
  55. lookup[StringID.ShortcutPlay] = shortcutKey + "P";
  56. lookup[StringID.ShortcutBuild] = shortcutKey + "B";
  57. })();
  58. }