EditorStrings.ts 2.3 KB

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