Refactor identifiers and add subtitle UI
This commit is contained in:
@@ -2,10 +2,6 @@ namespace BriarQueen.Data.Identifiers
|
||||
{
|
||||
public enum AchievementID
|
||||
{
|
||||
WorkshopSafeUnlocked,
|
||||
WorkshopPuzzleBoxSolved,
|
||||
FountainGemPuzzleSolved,
|
||||
FireplaceLockboxPuzzleBoxSolved,
|
||||
LaxleyGrandfatherClockPuzzleSolved,
|
||||
AshwickGateKeypadUnlocked,
|
||||
}
|
||||
}
|
||||
@@ -49,9 +49,9 @@ namespace BriarQueen.Data.Identifiers
|
||||
ClockTower,
|
||||
}
|
||||
|
||||
public static class AudioNameIdentifiers
|
||||
public static class AudioNameIdentifiers
|
||||
{
|
||||
public static readonly IReadOnlyDictionary<MusicKey, string> Music =
|
||||
private static readonly IReadOnlyDictionary<MusicKey, string> _music =
|
||||
new ReadOnlyDictionary<MusicKey, string>(
|
||||
new Dictionary<MusicKey, string>
|
||||
{
|
||||
@@ -59,7 +59,7 @@ namespace BriarQueen.Data.Identifiers
|
||||
// { MusicKey.SomeTrack, "Music:SomeTrack" }
|
||||
});
|
||||
|
||||
public static readonly IReadOnlyDictionary<SFXKey, string> SFX =
|
||||
private static readonly IReadOnlyDictionary<SFXKey, string> _sfx =
|
||||
new ReadOnlyDictionary<SFXKey, string>(
|
||||
new Dictionary<SFXKey, string>
|
||||
{
|
||||
@@ -68,7 +68,7 @@ namespace BriarQueen.Data.Identifiers
|
||||
{ SFXKey.AshwickGateOpening, "SFX:Level:AshwickOutskirts:GateOpening" },
|
||||
});
|
||||
|
||||
public static readonly IReadOnlyDictionary<UIFXKey, string> UIFX =
|
||||
private static readonly IReadOnlyDictionary<UIFXKey, string> _uifx =
|
||||
new ReadOnlyDictionary<UIFXKey, string>(
|
||||
new Dictionary<UIFXKey, string>
|
||||
{
|
||||
@@ -76,14 +76,14 @@ namespace BriarQueen.Data.Identifiers
|
||||
{ UIFXKey.CodexEntryUnlocked, "UIFX:General:CodexEntryUnlocked" },
|
||||
});
|
||||
|
||||
public static readonly IReadOnlyDictionary<AmbienceKey, string> Ambience =
|
||||
private static readonly IReadOnlyDictionary<AmbienceKey, string> _ambience =
|
||||
new ReadOnlyDictionary<AmbienceKey, string>(
|
||||
new Dictionary<AmbienceKey, string>
|
||||
{
|
||||
// Add ambience mappings here
|
||||
});
|
||||
|
||||
public static readonly IReadOnlyDictionary<VoiceKey, string> Voice =
|
||||
private static readonly IReadOnlyDictionary<VoiceKey, string> _voice =
|
||||
new ReadOnlyDictionary<VoiceKey, string>(
|
||||
new Dictionary<VoiceKey, string>
|
||||
{
|
||||
@@ -106,27 +106,27 @@ namespace BriarQueen.Data.Identifiers
|
||||
|
||||
public static string Get(MusicKey key)
|
||||
{
|
||||
return Music.TryGetValue(key, out var value) ? value : string.Empty;
|
||||
return _music.TryGetValue(key, out var value) ? value : string.Empty;
|
||||
}
|
||||
|
||||
public static string Get(SFXKey key)
|
||||
{
|
||||
return SFX.TryGetValue(key, out var value) ? value : string.Empty;
|
||||
return _sfx.TryGetValue(key, out var value) ? value : string.Empty;
|
||||
}
|
||||
|
||||
public static string Get(UIFXKey key)
|
||||
{
|
||||
return UIFX.TryGetValue(key, out var value) ? value : string.Empty;
|
||||
return _uifx.TryGetValue(key, out var value) ? value : string.Empty;
|
||||
}
|
||||
|
||||
public static string Get(AmbienceKey key)
|
||||
{
|
||||
return Ambience.TryGetValue(key, out var value) ? value : string.Empty;
|
||||
return _ambience.TryGetValue(key, out var value) ? value : string.Empty;
|
||||
}
|
||||
|
||||
public static string Get(VoiceKey key)
|
||||
{
|
||||
return Voice.TryGetValue(key, out var value) ? value : string.Empty;
|
||||
return _voice.TryGetValue(key, out var value) ? value : string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,25 +22,25 @@ namespace BriarQueen.Data.Identifiers
|
||||
|
||||
public static class CodexEntryIDs
|
||||
{
|
||||
private const string DOCUMENT_PREFIX = "Codex:Document:";
|
||||
private const string CLUE_PREFIX = "Codex:Clue:";
|
||||
private const string PHOTO_PREFIX = "Codex:Photo:";
|
||||
private const string DOCUMENT_PREFIX = "Codex:Document";
|
||||
private const string CLUE_PREFIX = "Codex:Clue";
|
||||
private const string PHOTO_PREFIX = "Codex:Photo";
|
||||
|
||||
public static readonly IReadOnlyDictionary<DocumentEntryID, string> Documents =
|
||||
private static readonly IReadOnlyDictionary<DocumentEntryID, string> _documents =
|
||||
new ReadOnlyDictionary<DocumentEntryID, string>(
|
||||
new Dictionary<DocumentEntryID, string>
|
||||
{
|
||||
{ DocumentEntryID.C1CarNewspaper, GetDocumentIdentifier(DocumentEntryID.C1CarNewspaper) },
|
||||
});
|
||||
|
||||
public static readonly IReadOnlyDictionary<ClueEntryID, string> Clues =
|
||||
private static readonly IReadOnlyDictionary<ClueEntryID, string> _clues =
|
||||
new ReadOnlyDictionary<ClueEntryID, string>(
|
||||
new Dictionary<ClueEntryID, string>
|
||||
{
|
||||
{ ClueEntryID.JasonsNote, $"{PHOTO_PREFIX}:AshwickMarketGate" },
|
||||
{ ClueEntryID.JasonsNote, GetClueIdentifier(ClueEntryID.JasonsNote) },
|
||||
});
|
||||
|
||||
public static readonly IReadOnlyDictionary<PhotoEntryID, string> Photos =
|
||||
private static readonly IReadOnlyDictionary<PhotoEntryID, string> _photos =
|
||||
new ReadOnlyDictionary<PhotoEntryID, string>(
|
||||
new Dictionary<PhotoEntryID, string>
|
||||
{
|
||||
@@ -48,32 +48,32 @@ namespace BriarQueen.Data.Identifiers
|
||||
|
||||
public static string Get(DocumentEntryID id)
|
||||
{
|
||||
return Documents.TryGetValue(id, out var value) ? value : string.Empty;
|
||||
return _documents.TryGetValue(id, out var value) ? value : string.Empty;
|
||||
}
|
||||
|
||||
public static string Get(ClueEntryID id)
|
||||
{
|
||||
return Clues.TryGetValue(id, out var value) ? value : string.Empty;
|
||||
return _clues.TryGetValue(id, out var value) ? value : string.Empty;
|
||||
}
|
||||
|
||||
public static string Get(PhotoEntryID id)
|
||||
{
|
||||
return Photos.TryGetValue(id, out var value) ? value : string.Empty;
|
||||
return _photos.TryGetValue(id, out var value) ? value : string.Empty;
|
||||
}
|
||||
|
||||
private static string GetDocumentIdentifier(DocumentEntryID id)
|
||||
{
|
||||
return $"{DOCUMENT_PREFIX}{id}";
|
||||
return $"{DOCUMENT_PREFIX}:{id}";
|
||||
}
|
||||
|
||||
private static string GetClueIdentifier(ClueEntryID id)
|
||||
{
|
||||
return $"{CLUE_PREFIX}{id}";
|
||||
return $"{CLUE_PREFIX}:{id}";
|
||||
}
|
||||
|
||||
private static string GetPhotoIdentifier(PhotoEntryID id)
|
||||
{
|
||||
return $"{PHOTO_PREFIX}{id}";
|
||||
return $"{PHOTO_PREFIX}:{id}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace BriarQueen.Data.Identifiers
|
||||
|
||||
public static class InteractEventIDs
|
||||
{
|
||||
public static readonly IReadOnlyDictionary<ItemInteractKey, string> ItemInteractions =
|
||||
private static readonly IReadOnlyDictionary<ItemInteractKey, string> _itemInteractions =
|
||||
new ReadOnlyDictionary<ItemInteractKey, string>(
|
||||
new Dictionary<ItemInteractKey, string>
|
||||
{
|
||||
@@ -54,13 +54,13 @@ namespace BriarQueen.Data.Identifiers
|
||||
|
||||
});
|
||||
|
||||
public static readonly IReadOnlyDictionary<LevelInteractKey, string> LevelInteractions =
|
||||
private static readonly IReadOnlyDictionary<LevelInteractKey, string> _levelInteractions =
|
||||
new ReadOnlyDictionary<LevelInteractKey, string>(
|
||||
new Dictionary<LevelInteractKey, string>
|
||||
{
|
||||
});
|
||||
|
||||
public static readonly IReadOnlyDictionary<EnvironmentInteractKey, string> EnvironmentInteractions =
|
||||
private static readonly IReadOnlyDictionary<EnvironmentInteractKey, string> _environmentInteractions =
|
||||
new ReadOnlyDictionary<EnvironmentInteractKey, string>(
|
||||
new Dictionary<EnvironmentInteractKey, string>
|
||||
{
|
||||
@@ -73,7 +73,7 @@ namespace BriarQueen.Data.Identifiers
|
||||
{ EnvironmentInteractKey.ClockTower, "Even from here, something about that clock tower feels wrong."}
|
||||
});
|
||||
|
||||
public static readonly IReadOnlyDictionary<UIInteractKey, string> UIInteractions =
|
||||
private static readonly IReadOnlyDictionary<UIInteractKey, string> _uiInteractions =
|
||||
new ReadOnlyDictionary<UIInteractKey, string>(
|
||||
new Dictionary<UIInteractKey, string>
|
||||
{
|
||||
@@ -82,22 +82,22 @@ namespace BriarQueen.Data.Identifiers
|
||||
|
||||
public static string Get(ItemInteractKey key)
|
||||
{
|
||||
return ItemInteractions.TryGetValue(key, out var value) ? value : string.Empty;
|
||||
return _itemInteractions.TryGetValue(key, out var value) ? value : string.Empty;
|
||||
}
|
||||
|
||||
public static string Get(LevelInteractKey key)
|
||||
{
|
||||
return LevelInteractions.TryGetValue(key, out var value) ? value : string.Empty;
|
||||
return _levelInteractions.TryGetValue(key, out var value) ? value : string.Empty;
|
||||
}
|
||||
|
||||
public static string Get(EnvironmentInteractKey key)
|
||||
{
|
||||
return EnvironmentInteractions.TryGetValue(key, out var value) ? value : string.Empty;
|
||||
return _environmentInteractions.TryGetValue(key, out var value) ? value : string.Empty;
|
||||
}
|
||||
|
||||
public static string Get(UIInteractKey key)
|
||||
{
|
||||
return UIInteractions.TryGetValue(key, out var value) ? value : string.Empty;
|
||||
return _uiInteractions.TryGetValue(key, out var value) ? value : string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,19 +25,19 @@ namespace BriarQueen.Data.Identifiers
|
||||
|
||||
public static class ItemIDs
|
||||
{
|
||||
public static readonly IReadOnlyDictionary<PuzzleSlotKey, string> PuzzleSlots =
|
||||
private static readonly IReadOnlyDictionary<PuzzleSlotKey, string> _puzzleSlots =
|
||||
new ReadOnlyDictionary<PuzzleSlotKey, string>(
|
||||
new Dictionary<PuzzleSlotKey, string>
|
||||
{
|
||||
});
|
||||
|
||||
public static readonly IReadOnlyDictionary<EnvironmentKey, string> Environment =
|
||||
private static readonly IReadOnlyDictionary<EnvironmentKey, string> _environment =
|
||||
new ReadOnlyDictionary<EnvironmentKey, string>(
|
||||
new Dictionary<EnvironmentKey, string>
|
||||
{
|
||||
});
|
||||
|
||||
public static readonly IReadOnlyDictionary<ItemKey, string> Pickups =
|
||||
private static readonly IReadOnlyDictionary<ItemKey, string> _pickups =
|
||||
new ReadOnlyDictionary<ItemKey, string>(
|
||||
new Dictionary<ItemKey, string>
|
||||
{
|
||||
@@ -48,37 +48,37 @@ namespace BriarQueen.Data.Identifiers
|
||||
|
||||
public static string Get(ItemKey key)
|
||||
{
|
||||
return Pickups.TryGetValue(key, out var id) ? id : string.Empty;
|
||||
return _pickups.TryGetValue(key, out var id) ? id : string.Empty;
|
||||
}
|
||||
|
||||
public static string Get(EnvironmentKey key)
|
||||
{
|
||||
return Environment.TryGetValue(key, out var id) ? id : string.Empty;
|
||||
return _environment.TryGetValue(key, out var id) ? id : string.Empty;
|
||||
}
|
||||
|
||||
public static string Get(PuzzleSlotKey key)
|
||||
{
|
||||
return PuzzleSlots.TryGetValue(key, out var id) ? id : string.Empty;
|
||||
return _puzzleSlots.TryGetValue(key, out var id) ? id : string.Empty;
|
||||
}
|
||||
|
||||
public static bool TryGet(ItemKey key, out string id)
|
||||
{
|
||||
return Pickups.TryGetValue(key, out id);
|
||||
return _pickups.TryGetValue(key, out id);
|
||||
}
|
||||
|
||||
public static bool TryGet(EnvironmentKey key, out string id)
|
||||
{
|
||||
return Environment.TryGetValue(key, out id);
|
||||
return _environment.TryGetValue(key, out id);
|
||||
}
|
||||
|
||||
public static bool TryGet(PuzzleSlotKey key, out string id)
|
||||
{
|
||||
return PuzzleSlots.TryGetValue(key, out id);
|
||||
return _puzzleSlots.TryGetValue(key, out id);
|
||||
}
|
||||
|
||||
public static IEnumerable<string> GetAllItemIDs()
|
||||
{
|
||||
return Pickups.Values;
|
||||
return _pickups.Values;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,23 +1,30 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
namespace BriarQueen.Data.Identifiers
|
||||
{
|
||||
public enum PuzzleKey
|
||||
{
|
||||
AshwickMarketGate,
|
||||
AshwickOutskirtsGate,
|
||||
}
|
||||
|
||||
public static class PuzzleIdentifiers
|
||||
{
|
||||
public static readonly Dictionary<PuzzleKey, string> AllPuzzles = new()
|
||||
{
|
||||
{ PuzzleKey.AshwickMarketGate, "CH1:Puzzle:AshwickMarketGate" },
|
||||
};
|
||||
private static readonly IReadOnlyDictionary<PuzzleKey, string> _allPuzzles =
|
||||
new ReadOnlyDictionary<PuzzleKey, string>(
|
||||
new Dictionary<PuzzleKey, string>
|
||||
{
|
||||
{ PuzzleKey.AshwickOutskirtsGate, "CH1:Puzzle:AshwickOutskirtsGate" },
|
||||
});
|
||||
|
||||
public static string Get(PuzzleKey key)
|
||||
{
|
||||
return _allPuzzles.TryGetValue(key, out var value) ? value : string.Empty;
|
||||
}
|
||||
|
||||
// Optional helper to get all puzzle IDs
|
||||
public static IEnumerable<string> GetAllPuzzleIDs()
|
||||
{
|
||||
return AllPuzzles.Values;
|
||||
return _allPuzzles.Values;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace BriarQueen.Data.Identifiers
|
||||
|
||||
public static class SubtitleIdentifiers
|
||||
{
|
||||
public static readonly IReadOnlyDictionary<SubtitleKey, SubtitleEntry> Subtitles =
|
||||
private static readonly IReadOnlyDictionary<SubtitleKey, SubtitleEntry> _subtitles =
|
||||
new ReadOnlyDictionary<SubtitleKey, SubtitleEntry>(
|
||||
new Dictionary<SubtitleKey, SubtitleEntry>
|
||||
{
|
||||
@@ -34,22 +34,22 @@ namespace BriarQueen.Data.Identifiers
|
||||
|
||||
public static bool TryGet(SubtitleKey key, out SubtitleEntry entry)
|
||||
{
|
||||
return Subtitles.TryGetValue(key, out entry);
|
||||
return _subtitles.TryGetValue(key, out entry);
|
||||
}
|
||||
|
||||
public static string GetText(SubtitleKey key)
|
||||
{
|
||||
return Subtitles.TryGetValue(key, out var entry) ? entry.Text : string.Empty;
|
||||
return _subtitles.TryGetValue(key, out var entry) ? entry.Text : string.Empty;
|
||||
}
|
||||
|
||||
public static float GetPreferredDuration(SubtitleKey key)
|
||||
{
|
||||
return Subtitles.TryGetValue(key, out var entry) ? entry.PreferredDurationSeconds : 0f;
|
||||
return _subtitles.TryGetValue(key, out var entry) ? entry.PreferredDurationSeconds : 0f;
|
||||
}
|
||||
|
||||
public static IEnumerable<SubtitleKey> GetAllKeys()
|
||||
{
|
||||
return Subtitles.Keys;
|
||||
return _subtitles.Keys;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,8 +6,6 @@ namespace BriarQueen.Data.Identifiers
|
||||
{
|
||||
[DisplayName("Empty Hands")]
|
||||
None = 0,
|
||||
[DisplayName("Sharpened Knife")]
|
||||
Knife = 1,
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
namespace BriarQueen.Data.Identifiers
|
||||
{
|
||||
@@ -21,63 +22,77 @@ namespace BriarQueen.Data.Identifiers
|
||||
|
||||
public static class TutorialPopupTexts
|
||||
{
|
||||
public static readonly Dictionary<TutorialPopupID, string> AllPopups = new()
|
||||
private static readonly IReadOnlyDictionary<TutorialPopupID, string> _allPopups =
|
||||
new ReadOnlyDictionary<TutorialPopupID, string>(
|
||||
new Dictionary<TutorialPopupID, string>
|
||||
{
|
||||
{
|
||||
TutorialPopupID.ReturnToPreviousLevel,
|
||||
"Click the lower corners to return to the previous area."
|
||||
},
|
||||
{
|
||||
TutorialPopupID.UsingItemsTogether,
|
||||
"Select one item, then click another to use them together."
|
||||
},
|
||||
{
|
||||
TutorialPopupID.HideHUD,
|
||||
"Press '{Hide_HUD}' to hide the HUD."
|
||||
},
|
||||
{
|
||||
TutorialPopupID.MultipleUseItems,
|
||||
"Some items can be used more than once, but they may wear out."
|
||||
},
|
||||
{
|
||||
TutorialPopupID.DarkRooms,
|
||||
"Dark rooms can hide important details. Use light to reveal them."
|
||||
},
|
||||
{
|
||||
TutorialPopupID.Codex,
|
||||
"Documents you find are stored in the Codex. Press '{Codex}' to open it."
|
||||
},
|
||||
{
|
||||
TutorialPopupID.HiddenItems,
|
||||
"Some items are hidden. Search carefully."
|
||||
},
|
||||
{
|
||||
TutorialPopupID.ResetPuzzles,
|
||||
"Some puzzles can be reset if you get stuck."
|
||||
},
|
||||
{
|
||||
TutorialPopupID.LeavingPuzzles,
|
||||
"When you leave a puzzle, your progress is saved."
|
||||
},
|
||||
{
|
||||
TutorialPopupID.Tools,
|
||||
"You'll find tools as you explore. Try them on different objects. Press '{Show_Tools}' to open your tools."
|
||||
},
|
||||
{
|
||||
TutorialPopupID.ItemsAway,
|
||||
"Press '{Right_Click}' to put away the selected item."
|
||||
},
|
||||
{
|
||||
TutorialPopupID.ItemCycling,
|
||||
"Press '{Previous_Item}' or '{Next_Item}' to cycle through the items in your backpack."
|
||||
},
|
||||
{
|
||||
TutorialPopupID.ToolCycling,
|
||||
"Press '{Previous_Tool}' or '{Next_Tool}' to cycle through your tools."
|
||||
},
|
||||
});
|
||||
|
||||
public static bool TryGet(TutorialPopupID id, out string text)
|
||||
{
|
||||
{
|
||||
TutorialPopupID.ReturnToPreviousLevel,
|
||||
"Click the lower corners to return to the previous area."
|
||||
},
|
||||
{
|
||||
TutorialPopupID.UsingItemsTogether,
|
||||
"Select one item, then click another to use them together."
|
||||
},
|
||||
{
|
||||
TutorialPopupID.HideHUD,
|
||||
"Press '{Hide_HUD}' to hide the HUD."
|
||||
},
|
||||
{
|
||||
TutorialPopupID.MultipleUseItems,
|
||||
"Some items can be used more than once, but they may wear out."
|
||||
},
|
||||
{
|
||||
TutorialPopupID.DarkRooms,
|
||||
"Dark rooms can hide important details. Use light to reveal them."
|
||||
},
|
||||
{
|
||||
TutorialPopupID.Codex,
|
||||
"Documents you find are stored in the Codex. Press '{Codex}' to open it."
|
||||
},
|
||||
{
|
||||
TutorialPopupID.HiddenItems,
|
||||
"Some items are hidden. Search carefully."
|
||||
},
|
||||
{
|
||||
TutorialPopupID.ResetPuzzles,
|
||||
"Some puzzles can be reset if you get stuck."
|
||||
},
|
||||
{
|
||||
TutorialPopupID.LeavingPuzzles,
|
||||
"When you leave a puzzle, your progress is saved."
|
||||
},
|
||||
return _allPopups.TryGetValue(id, out text);
|
||||
}
|
||||
|
||||
{
|
||||
TutorialPopupID.Tools,
|
||||
"You'll find tools as you explore. Try them on different objects. Press '{Show_Tools}' to open your tools."
|
||||
},
|
||||
{
|
||||
TutorialPopupID.ItemsAway,
|
||||
"Press '{Right_Click}' to put away the selected item."
|
||||
},
|
||||
{
|
||||
TutorialPopupID.ItemCycling,
|
||||
"Press '{Previous_Item}' or '{Next_Item}' to cycle through the items in your backpack."
|
||||
},
|
||||
{
|
||||
TutorialPopupID.ToolCycling,
|
||||
"Press '{Previous_Tool}' or '{Next_Tool}' to cycle through your tools."
|
||||
},
|
||||
};
|
||||
public static string Get(TutorialPopupID id)
|
||||
{
|
||||
return _allPopups.TryGetValue(id, out var value) ? value : string.Empty;
|
||||
}
|
||||
|
||||
public static IEnumerable<string> GetAllTexts() => AllPopups.Values;
|
||||
public static IEnumerable<string> GetAllTexts()
|
||||
{
|
||||
return _allPopups.Values;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user