EditorStrings.ts 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. ShortcutPause,
  23. ShortcutStep,
  24. ShortcutPlayDebug,
  25. ShortcutBuild,
  26. ShortcutBuildSettings,
  27. ShortcutFrameSelected
  28. }
  29. export class EditorString {
  30. public static GetString(id: StringID): string {
  31. return EditorString.lookup[id];
  32. }
  33. private static lookup: { [id: number]: string; } = {};
  34. private static Ctor = (() => {
  35. var lookup = EditorString.lookup;
  36. var shortcutKey;
  37. if (Atomic.platform == "MacOSX") {
  38. shortcutKey = "⌘";
  39. } else { // Windows and Linux
  40. shortcutKey = "CTRL + ";
  41. }
  42. lookup[StringID.RevealInFinder] = "Reveal in Finder";
  43. // Mac, Windows and Linux
  44. lookup[StringID.ShortcutRedo] = "⇧" + shortcutKey + "Z";
  45. lookup[StringID.ShortcutFindNext] = shortcutKey + "G";
  46. lookup[StringID.ShortcutFindPrev] = "⇧" + shortcutKey + "G";
  47. lookup[StringID.ShortcutBuildSettings] = "⇧" + shortcutKey + "B";
  48. // General
  49. lookup[StringID.ShortcutUndo] = shortcutKey + "Z";
  50. lookup[StringID.ShortcutCut] = shortcutKey + "X";
  51. lookup[StringID.ShortcutCopy] = shortcutKey + "C";
  52. lookup[StringID.ShortcutPaste] = shortcutKey + "V";
  53. lookup[StringID.ShortcutSelectAll] = shortcutKey + "A";
  54. lookup[StringID.ShortcutFind] = shortcutKey + "F";
  55. lookup[StringID.ShortcutFrameSelected] = "F";
  56. lookup[StringID.ShortcutBeautify] = shortcutKey + "I";
  57. lookup[StringID.ShortcutSaveFile] = shortcutKey + "S";
  58. lookup[StringID.ShortcutCloseFile] = shortcutKey + "W";
  59. lookup[StringID.ShortcutPlay] = shortcutKey + "P";
  60. lookup[StringID.ShortcutPause] = shortcutKey + "U";
  61. lookup[StringID.ShortcutStep] = "⇧" + shortcutKey + "U";
  62. lookup[StringID.ShortcutPlayDebug] = "⇧" + shortcutKey + "P";
  63. lookup[StringID.ShortcutBuild] = shortcutKey + "B";
  64. })();
  65. }