Skip to content

Commit

Permalink
Closes #877: Templates should show the library source columns
Browse files Browse the repository at this point in the history
  • Loading branch information
richardwilkes committed Aug 16, 2024
1 parent 8761fd2 commit 5608035
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,4 @@ issues:
- "package-comments: should have a package comment"
- "stdmethods: method MarshalJSON"
- "stdmethods: method UnmarshalJSON"
- "SA1003: value of type bool cannot be used with binary.Write"
2 changes: 1 addition & 1 deletion ux/equipment_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ func (p *equipmentProvider) ColumnIDs() []int {
}
columnIDs = append(columnIDs, gurps.EquipmentReferenceColumn)
if p.forPage {
if entity := p.DataOwner().OwningEntity(); entity != nil && !entity.SheetSettings.HideSourceMismatch {
if entity := p.DataOwner().OwningEntity(); entity == nil || !entity.SheetSettings.HideSourceMismatch {
columnIDs = append(columnIDs, gurps.EquipmentLibSrcColumn)
}
}
Expand Down
2 changes: 1 addition & 1 deletion ux/notes_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func (p *notesProvider) ColumnIDs() []int {
gurps.NoteReferenceColumn,
}
if p.forPage {
if entity := p.DataOwner().OwningEntity(); entity != nil && !entity.SheetSettings.HideSourceMismatch {
if entity := p.DataOwner().OwningEntity(); entity == nil || !entity.SheetSettings.HideSourceMismatch {
columnIDs = append(columnIDs, gurps.NoteLibSrcColumn)
}
}
Expand Down
2 changes: 1 addition & 1 deletion ux/skills_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func (p *skillsProvider) ColumnIDs() []int {
}
columnIDs = append(columnIDs, gurps.SkillReferenceColumn)
if p.forPage {
if entity := p.DataOwner().OwningEntity(); entity != nil && !entity.SheetSettings.HideSourceMismatch {
if entity := p.DataOwner().OwningEntity(); entity == nil || !entity.SheetSettings.HideSourceMismatch {
columnIDs = append(columnIDs, gurps.SkillLibSrcColumn)
}
}
Expand Down
2 changes: 1 addition & 1 deletion ux/spells_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func (p *spellsProvider) ColumnIDs() []int {
}
columnIDs = append(columnIDs, gurps.SpellReferenceColumn)
if p.forPage {
if entity := p.DataOwner().OwningEntity(); entity != nil && !entity.SheetSettings.HideSourceMismatch {
if entity := p.DataOwner().OwningEntity(); entity == nil || !entity.SheetSettings.HideSourceMismatch {
columnIDs = append(columnIDs, gurps.SpellLibSrcColumn)
}
}
Expand Down
2 changes: 1 addition & 1 deletion ux/traits_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func (p *traitsProvider) ColumnIDs() []int {
}
columnIDs = append(columnIDs, gurps.TraitReferenceColumn)
if p.forPage {
if entity := p.DataOwner().OwningEntity(); entity != nil && !entity.SheetSettings.HideSourceMismatch {
if entity := p.DataOwner().OwningEntity(); entity == nil || !entity.SheetSettings.HideSourceMismatch {
columnIDs = append(columnIDs, gurps.TraitLibSrcColumn)
}
}
Expand Down

0 comments on commit 5608035

Please sign in to comment.