Skip to content

Conversation

@Doomster14
Copy link

@Doomster14 Doomster14 commented Nov 11, 2023

Fix the following scenario:

  1. Save a game without the mod active.
  2. Activate the mod.
  3. Load the game twice.
  4. Change work priorities.
  5. Save.
  6. Load.
  7. Priorities are reset to default values and there are errors in the log:
    Exception in LookDictionary(label=Priorities): System.InvalidOperationException: Tried to add different values for the same key.

Also, fix the following scenario:

  1. Play any game with the mod active.
  2. Start a new game (without exiting the application).
  3. Save.
  4. Load.
  5. Probably harmless errors appear in the log:
    Could not resolve reference to object with loadID Thing_Human#

Supposedly, fixes #203 and fixes #208.

Games saved with the erroneous mod version may still give errors on load. Saving them anew should fix them.

Too bad, the source branch of this pull request was updated, and while the PR was supposed to be just one commit, now it's not. PR #210 supersedes this one.

EDIT: This pull request is closed after I updated it's source branch. The PR was supposed to have just one commit, but now it pulls too much. PR #210 supersedes this one.

angelolocritani and others added 20 commits August 16, 2021 19:38
Fluffy.WorkTab.NoStoredFavourites was not translated
fixes fluffy-mods#157, fluffy-mods#159 and fluffy-mods#164

The scroll area was using cachedSize for its output rectangle capping it at the screen width. As the "Work"-tab window is not as wide as the screen, ouput rectangle was too wide when there were many work types.

To fix this the PawnTable was extended with the property methods void set_OutRect(this PawnTable, Rect) and Rect get_OutRect() 'fake adding' a new property that can be used to set and get the "Work"-tab window dimension instead of relying on the screen size.

MainTabWindow_WorkTab.DoWindowContents calls set_OutRect with the window dimension PawnTable_PawnTableOnGUI.PawnTableOnGUI calls get_OutRect to clamp the output rectangle properly

I think ideally PawnTable.PawnTableOnGUI's parameter would be Rect window instead of Vector2 position in the future.
PriorityManager class was relying on Scribe methods in ExposeData() for clearing out old priorities data.
But ExposeData() is not called when a new game is started or a game is loaded which was saved without the mod active.
So, new data was added to the old one.
If a non-modded save was loaded twice, pawn priorities lists were doubled, with the latest list being active.
When the game was subsequently saved and loaded, all data was saved, but only the oldest copy of priorities was restored.
Other copies yielded an error:
Exception in LookDictionary(label=Priorities): System.InvalidOperationException: Tried to add different values for the same key.
Attempts to load priorities data of non-existent pawns, inherited from other games, resulted in a probably harmless error:
Could not resolve reference to object with loadID Thing_Human#

Now, all static members of PriorityManager are initialized by constructor.
…_on_type_checkboxes

Respect "Disable Scrollwheel" on Checkbox WorkTypes
Add Setting to Render Job Column as Text (instead of Icon)
Add Option to Highlight Current Active Work Cell
…p attribute

Fix warning in the game's log:
Type DrawUtilities probably needs a StaticConstructorOnStartup attribute, because it has a field activeHighlightBox of type Texture2D. All assets must be loaded in the main thread.
Also, change names and labels for being consistent: ActiveWorkCells => CurrentJobCell.
Minor clean-up.
@Doomster14
Copy link
Author

Doomster14 commented Dec 8, 2024

Closing this pull request after I updated it's source branch. The PR was supposed to have just one commit, but now it pulls too much. PR #210 supersedes this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants