xna-cncnet-client
xna-cncnet-client copied to clipboard
#352: Add custom map directory file watcher
- Add a file watcher that will detect when a map is added or deleted, then update the game mode dropdown according to the new map list
- Add and use
CustomMapsDirectory
field toMapLoader
to avoid hard coded strings. - Add
GetLoadedMapBySha1
to remove some duplicateGameModeMaps.Find()
. - Add a function
RefreshGameModeDropdown
to modify the dropdown after client is loaded. The function is a bit complicated due to doing inline modifications to the items and keeping the selected mode.
Issue: https://github.com/CnCNet/xna-cncnet-client/issues/352
Nightly build for this pull request:
- artifacts.zip This comment is automatic and is meant to allow guests to get latest automatic builds without registering. It is updated on every successful build.
I think I addressed all the feedback
Does this currently handle a case where existing custom maps are modified? If that is done, the SHA1 for the map in question needs to be recalculated. See
FileSystemWatcher.Changed
event.
It does not, but the map will still load if you try to play it. The Client can already handle that case. I often just save the map in FA2 then just click "play" and it works.