Skip to content
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

More Anomaly syncing #448

Merged
merged 4 commits into from
May 24, 2024
Merged

Conversation

SokyranTheDragon
Copy link
Member

I'm trying to avoid (too many) spoilers about anomaly, so I'm patching stuff as I go through and progress the DLC. I've gone through and tested some of the stuff that I already saw in game, and fixed whatever needed fixing.

Changes:

  • Creating corpse stockpile for harbinger trees needed SyncContext.MapSelected
  • Synced a float menu option for capturing entity into any holding building
    • The interaction would work if selecting a specific holding building
  • Synced a float menu option for drafted carrying an entity to a holding building
    • It was not needed, but was synced like the other similar methods to save up on the amount of data that would end up being synced
  • Moved the gizmo for carry to shuttle interaction lower, as the other sync delegates were ordered by their lambdaOrdinal
  • Synced CompStudiable.studyEnabled field changes from ITab_StudyNotes.DrawTitle
    • Changing it using a gizmo was synced already
  • Synced CompHoldingPlatformTarget.containmentMode field changes from ITab_Entity.FillTab

I'm trying to avoid (too many) spoilers about anomaly, so I'm patching stuff as I go through and progress the DLC. I've gone through and tested some of the stuff that I already saw in game, and fixed whatever needed fixing.

Changes:

- Creating corpse stockpile for harbinger trees needed `SyncContext.MapSelected`
- Synced a float menu option for capturing entity into any holding building
  - The interaction would work if selecting a specific holding building
- Synced a float menu option for drafted carrying an entity to a holding building
  - It was not needed, but was synced like the other similar methods to save up on the amount of data that would end up being synced
- Moved the gizmo for carry to shuttle interaction lower, as the other sync delegates were ordered by their `lambdaOrdinal`
- Synced `CompStudiable.studyEnabled` field changes from `ITab_StudyNotes.DrawTitle`
  - Changing it using a gizmo was synced already
- Synced `CompHoldingPlatformTarget.containmentMode` field changes from `ITab_Entity.FillTab`
@SokyranTheDragon SokyranTheDragon added the anomaly Fix or bugs relating to Anomaly (Not 1.5) label Apr 23, 2024
The checkbox was added in a recent update, so it requires an update to `Krafs.RimWorld.Ref` package to work. I've not included it here as I feel it would not fit the PR this belongs to.
@SokyranTheDragon
Copy link
Member Author

I've pushed an update to sync the "extract bioferrite" checkbox, but since this checkbox is a recent addition this PR now depends on #454 to work (or changing the code to not use nameof but a manually typed string).

Syncing of `HarbingerTree.UpdateRoots` was removed, as the method would naturally be queued up during simulation (SpawnSetup) and called in as a long event, causing the call to be synced. If dev mode syncing was disabled it would end up never being called.

Synced following fields:
- `ActivityGizmo.targetValuePct`
- `CompActivity.suppressIfAbove`
- `CompActivity.suppressionEnabled`

This required creating a sync worker for `ActivityGizmo`.

The syncing here is pretty similar to syncing of `GeneGizmo_Resource`, `Gene_Resource`, and `Gene_Hemogen`. It would potentially be possible to make a more universal approach, but I could not think of one myself.

`SyncGeneGizmoResource` and `SyncActivityGizmoTarget` sync the same field (`Gizmo_Slider.targetValuePct`), but we can't register sync field targeting `Gizmo_Slider` as that type is not syncable.
@SokyranTheDragon
Copy link
Member Author

A change from yesterday that I didn't leave a message for - one of gizmos for Building_HoldingPlatform was set as debug only, as I accidentally forgot to include that previously.

Syncing of HarbingerTree.UpdateRoots was removed, as the method would naturally be queued up during simulation (SpawnSetup) and called in as a long event, causing the call to be synced. If dev mode syncing was disabled it would end up never being called. If we want to sync that gizmo, we'll like have to make a transpiler for HarbingerTree:GetGizmos which will replace the call to UpdateRoots with our synced method, which will then (in turn) call the target method.

Synced following fields:

  • ActivityGizmo.targetValuePct
  • CompActivity.suppressIfAbove
  • CompActivity.suppressionEnabled

This required creating a sync worker for ActivityGizmo.

The syncing here is pretty similar to syncing of GeneGizmo_Resource, Gene_Resource, and Gene_Hemogen. It would potentially be possible to make a more universal approach, but I could not think of one myself.

SyncGeneGizmoResource and SyncActivityGizmoTarget sync the same field (Gizmo_Slider.targetValuePct), but we can't register sync field targeting Gizmo_Slider as that type is not syncable.

@Zetrith Zetrith merged commit 29a4dca into rwmt:master May 24, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
anomaly Fix or bugs relating to Anomaly (Not 1.5)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants