Skip to content

Commit

Permalink
Fixed issue where the appearance panel options were not updated properly
Browse files Browse the repository at this point in the history
when randomizing a pawn
  • Loading branch information
edbmods committed May 4, 2024
1 parent 7d3faf3 commit 62c7e56
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions Resources/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- Fixed an error where implants that can be attached to a body part group
(instead of to a specific body part) were not being loaded correctly from
saved presets
- Fixed some issues with the Appearance panel when randomizing pawns

_____________________________________________________________________________

Expand Down
12 changes: 7 additions & 5 deletions Source/PanelAppearance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ public class PanelAppearance : PanelModule {
public Rect RectGenderFemale;
public Rect RectGenderMale;

protected CustomizedPawn currentPawn = null;
protected CustomizedPawn CachedCustomizedPawn = null;
protected Pawn CachedPawn = null;
protected List<PawnLayer> currentPawnLayers = null;
protected PawnLayer selectedPawnLayer = null;
protected List<Action> pawnLayerActions = new List<Action>();
Expand Down Expand Up @@ -78,11 +79,12 @@ public override float Draw(float y) {

CustomizedPawn customizedPawn = ViewState.CurrentPawn;
Pawn pawn = customizedPawn.Pawn;
if (currentPawn != customizedPawn) {
currentPawn = customizedPawn;
UpdatePawnLayers();
if (pawn == null) {
return 0;
}
if (currentPawnLayers == null) {
if (currentPawnLayers == null || CachedCustomizedPawn != customizedPawn || CachedPawn != pawn) {
CachedCustomizedPawn = customizedPawn;
CachedPawn = pawn;
UpdatePawnLayers();
}

Expand Down

0 comments on commit 62c7e56

Please sign in to comment.