-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DungeonManager by Kory, Warp fixes #434
Conversation
…hout table parameter
…onstructor functions to use new RoomConfig.ApplyConfig method
…AddPrefab instead
// TODO - unsure if cache clearing is still necessary for resolving mocks of these assets | ||
//ClearPrefabCache(typeof(Material)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's fine to preemptively clear the Material cache. It's not an expensive operation unlike clearing the GameObject cache, because there are a lot more GameObjects than materials
JotunnLib/Entities/CustomRoom.cs
Outdated
/// <summary> | ||
/// Theme name of this room. | ||
/// </summary> | ||
public string ThemeName { get; private set; } | ||
|
||
/// <summary> | ||
/// <see cref="Room.Theme"/> of this room. | ||
/// </summary> | ||
public Room.Theme Theme { get; private set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like in the original PR, this should be changed to primarily use the string ThemeName and convert to the Room.Theme
internally if needed (can be cached).
At the very least, Room.Theme Theme
should be made internal and not exposed to the API, a dev shouldn't have to worry about when to choose what or even theme name changes. Take a look at https://github.com/Valheim-Modding/Jotunn/blob/23cc2fd84ec72a1f19d17da4b8ed2f2b561af9e7/JotunnLib/Configs/CraftingStations.cs and
Jotunn/JotunnLib/Configs/PieceConfig.cs
Line 64 in 22b24cb
set => craftingStation = CraftingStations.GetInternalName(value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in 5084fd2
JotunnLib/Configs/RoomConfig.cs
Outdated
if (roomConfig.Weight != null) room.m_weight = roomConfig.Weight.Value; | ||
if (roomConfig.FaceCenter != null) room.m_faceCenter = roomConfig.FaceCenter.Value; | ||
if (roomConfig.Perimeter != null) room.m_perimeter = roomConfig.Perimeter.Value; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From 366b7ab:
if (roomConfig.MusicPrefab != null) room.m_musicPrefab = Mock<MusicVolume>.Create(roomConfig.MusicPrefab); | |
A music prefab sounds nice to have, if MusicPrefab is a string the mock system can handle it. Haven't tested this tho. Maybe the outer FixReference can be set to true if MusicPrefab is set, for convince
…nDungeonDBStarted.
…will parse a custom Theme value to string or attempt to parse vanilla Theme value to string
…7. Add method GetCustomRoomTheme to retrieve and return a new Room Theme, which was added to list of Room Themes.
…ad. Add IsCustomTheme flag. Combine GetCustomRoomTheme and GetVanillaRoomTheme functions.
Included in #430 |
Adding a new DungeonManager to Jotunn, allowing devs to add custom dungeon rooms to Valheim. Fixes and adjustments by Warp.