EditorStrings.ts 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. }
  26. export class EditorString {
  27. public static GetString(id: StringID): string {
  28. return EditorString.lookup[id];
  29. }
  30. private static lookup: { [id: number]: string; } = {};
  31. private static Ctor = (() => {
  32. var lookup = EditorString.lookup;
  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.ShortcutBeautify] = shortcutKey + "I";
  54. lookup[StringID.ShortcutSaveFile] = shortcutKey + "S";
  55. lookup[StringID.ShortcutCloseFile] = shortcutKey + "W";
  56. lookup[StringID.ShortcutPlay] = shortcutKey + "P";
  57. lookup[StringID.ShortcutPlayDebug] = "⇧" + shortcutKey + "P";
  58. lookup[StringID.ShortcutBuild] = shortcutKey + "B";
  59. })();
  60. }