Skip to content

Commit

Permalink
Update unit texture in the world too
Browse files Browse the repository at this point in the history
  • Loading branch information
Crystalwarrior committed Jul 3, 2024
1 parent c7f02ee commit cccac59
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/gm-unit/editor_body.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ function Editor_Body_Modifier:setPartModifier(indexList, value)

-- Update the unit's portrait
self.target_unit.flags4.portrait_must_be_refreshed = true
-- Update the world texture
self.target_unit.flags4.any_texture_must_be_refreshed = true

self:updateChoices()
end
Expand All @@ -40,6 +42,8 @@ function Editor_Body_Modifier:setBodyModifier(modifierIndex, value)

-- Update the unit's portrait
self.target_unit.flags4.portrait_must_be_refreshed = true
-- Update the world texture
self.target_unit.flags4.any_texture_must_be_refreshed = true

self:updateChoices()
end
Expand Down
4 changes: 4 additions & 0 deletions internal/gm-unit/editor_colors.lua
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,17 @@ function Editor_Colors:random()

-- Update the unit's portrait
self.target_unit.flags4.portrait_must_be_refreshed = true
-- Update the world texture
self.target_unit.flags4.any_texture_must_be_refreshed = true
end

function Editor_Colors:colorSelected(index, choice)
-- Update the modifier for the unit
self.target_unit.appearance.colors[self.modIndex] = choice.index
-- Update the unit's portrait
self.target_unit.flags4.portrait_must_be_refreshed = true
-- Update the world texture
self.target_unit.flags4.any_texture_must_be_refreshed = true
end

function Editor_Colors:featureSelected(index, choice)
Expand Down

0 comments on commit cccac59

Please sign in to comment.