Skip to content

Commit

Permalink
implemented issue #902: Option to ignore MHDT conflicts when using Ve…
Browse files Browse the repository at this point in the history
…ry Quick Show Conflicts (use `-IgnoreWorldMHDT` parameter)
  • Loading branch information
ElminsterAU committed Nov 10, 2021
1 parent f05381a commit c4d7f36
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 21 deletions.
17 changes: 10 additions & 7 deletions wbDefinitionsFO4.pas
Original file line number Diff line number Diff line change
Expand Up @@ -6587,6 +6587,9 @@ function wbTintLayerToStr(aInt: Int64; const aElement: IwbElement; aType: TwbCal
var
wbRecordFlagsFlags : IwbFlagsDef;

const
wbWorldMHDTConflictPriority : array[Boolean] of TwbConflictPriority = (cpNormalIgnoreEmpty, cpIgnore);

procedure DefineFO4a;

begin
Expand Down Expand Up @@ -7799,7 +7802,7 @@ procedure DefineFO4a;

if wbSimpleRecords then begin
wbMaxHeightDataCELL := wbByteArray(MHDT, 'Max Height Data', 0, cpNormal);
wbMaxHeightDataWRLD := wbByteArray(MHDT, 'Max Height Data', 0, cpNormal);
wbMaxHeightDataWRLD := wbByteArray(MHDT, 'Max Height Data', 0, wbWorldMHDTConflictPriority[wbIgnoreWorldMHDT]);
end
else begin
wbMaxHeightDataCELL := wbStruct(MHDT, 'Max Height Data', [
Expand All @@ -7812,22 +7815,22 @@ procedure DefineFO4a;
]);
wbMaxHeightDataWRLD := wbStruct(MHDT, 'Max Height Data', [
wbStruct('Min', [
wbInteger('X', itS16),
wbInteger('Y', itS16)
wbInteger('X', itS16, nil, nil, wbWorldMHDTConflictPriority[wbIgnoreWorldMHDT]),
wbInteger('Y', itS16, nil, nil, wbWorldMHDTConflictPriority[wbIgnoreWorldMHDT])
]),
wbStruct('Max', [
wbInteger('X', itS16),
wbInteger('Y', itS16)
wbInteger('X', itS16, nil, nil, wbWorldMHDTConflictPriority[wbIgnoreWorldMHDT]),
wbInteger('Y', itS16, nil, nil, wbWorldMHDTConflictPriority[wbIgnoreWorldMHDT])
]),
wbByteArray('Cell Data', 0)
wbByteArray('Cell Data', 0, wbWorldMHDTConflictPriority[wbIgnoreWorldMHDT])
// way too verbose for no practical use
{wbArray('Cell Data', wbStruct('Quad Height', [
wbInteger('Bottom Left', itU8),
wbInteger('Bottom Right', itU8),
wbInteger('Top Left', itU8),
wbInteger('Top Right', itU8)
]))}
]);
], wbWorldMHDTConflictPriority[wbIgnoreWorldMHDT]);
end;

if wbSimpleRecords then
Expand Down
17 changes: 10 additions & 7 deletions wbDefinitionsFO76.pas
Original file line number Diff line number Diff line change
Expand Up @@ -7119,6 +7119,9 @@ function wbTintLayerToStr(aInt: Int64; const aElement: IwbElement; aType: TwbCal
var
wbRecordFlagsFlags : IwbFlagsDef;

const
wbWorldMHDTConflictPriority : array[Boolean] of TwbConflictPriority = (cpNormalIgnoreEmpty, cpIgnore);

procedure DefineFO76a;

begin
Expand Down Expand Up @@ -8432,7 +8435,7 @@ procedure DefineFO76a;

if wbSimpleRecords then begin
wbMaxHeightDataCELL := wbByteArray(MHDT, 'Max Height Data', 0, cpNormal);
wbMaxHeightDataWRLD := wbByteArray(MHDT, 'Max Height Data', 0, cpNormal);
wbMaxHeightDataWRLD := wbByteArray(MHDT, 'Max Height Data', 0, wbWorldMHDTConflictPriority[wbIgnoreWorldMHDT]);
end
else begin
wbMaxHeightDataCELL := wbStruct(MHDT, 'Max Height Data', [
Expand All @@ -8445,22 +8448,22 @@ procedure DefineFO76a;
]);
wbMaxHeightDataWRLD := wbStruct(MHDT, 'Max Height Data', [
wbStruct('Min', [
wbInteger('X', itS16),
wbInteger('Y', itS16)
wbInteger('X', itS16, nil, nil, wbWorldMHDTConflictPriority[wbIgnoreWorldMHDT]),
wbInteger('Y', itS16, nil, nil, wbWorldMHDTConflictPriority[wbIgnoreWorldMHDT])
]),
wbStruct('Max', [
wbInteger('X', itS16),
wbInteger('Y', itS16)
wbInteger('X', itS16, nil, nil, wbWorldMHDTConflictPriority[wbIgnoreWorldMHDT]),
wbInteger('Y', itS16, nil, nil, wbWorldMHDTConflictPriority[wbIgnoreWorldMHDT])
]),
wbByteArray('Cell Data', 0)
wbByteArray('Cell Data', 0, wbWorldMHDTConflictPriority[wbIgnoreWorldMHDT])
// way too verbose for no practical use
{wbArray('Cell Data', wbStruct('Quad Height', [
wbInteger('Bottom Left', itU8),
wbInteger('Bottom Right', itU8),
wbInteger('Top Left', itU8),
wbInteger('Top Right', itU8)
]))}
]);
], wbWorldMHDTConflictPriority[wbIgnoreWorldMHDT]);
end;

if wbSimpleRecords then
Expand Down
17 changes: 10 additions & 7 deletions wbDefinitionsTES5.pas
Original file line number Diff line number Diff line change
Expand Up @@ -5048,6 +5048,9 @@ function wbTintLayerToStr(aInt: Int64; const aElement: IwbElement; aType: TwbCal
var
wbRecordFlagsFlags : IwbFlagsDef;

const
wbWorldMHDTConflictPriority : array[Boolean] of TwbConflictPriority = (cpNormalIgnoreEmpty, cpIgnore);

procedure DefineTES5a;

begin
Expand Down Expand Up @@ -6163,7 +6166,7 @@ procedure DefineTES5a;

if wbSimpleRecords then begin
wbMaxHeightDataCELL := wbByteArray(MHDT, 'Max Height Data', 0, cpNormal);
wbMaxHeightDataWRLD := wbByteArray(MHDT, 'Max Height Data', 0, cpNormalIgnoreEmpty);
wbMaxHeightDataWRLD := wbByteArray(MHDT, 'Max Height Data', 0, wbWorldMHDTConflictPriority[wbIgnoreWorldMHDT]);
end
else begin
wbMaxHeightDataCELL := wbStruct(MHDT, 'Max Height Data', [
Expand All @@ -6176,22 +6179,22 @@ procedure DefineTES5a;
]);
wbMaxHeightDataWRLD := wbStruct(MHDT, 'Max Height Data', [
wbStruct('Min', [
wbInteger('X', itS16, nil, nil, cpNormalIgnoreEmpty),
wbInteger('Y', itS16, nil, nil, cpNormalIgnoreEmpty)
wbInteger('X', itS16, nil, nil, wbWorldMHDTConflictPriority[wbIgnoreWorldMHDT]),
wbInteger('Y', itS16, nil, nil, wbWorldMHDTConflictPriority[wbIgnoreWorldMHDT])
]),
wbStruct('Max', [
wbInteger('X', itS16, nil, nil, cpNormalIgnoreEmpty),
wbInteger('Y', itS16, nil, nil, cpNormalIgnoreEmpty)
wbInteger('X', itS16, nil, nil, wbWorldMHDTConflictPriority[wbIgnoreWorldMHDT]),
wbInteger('Y', itS16, nil, nil, wbWorldMHDTConflictPriority[wbIgnoreWorldMHDT])
]),
wbByteArray('Cell Data', 0, cpNormalIgnoreEmpty)
wbByteArray('Cell Data', 0, wbWorldMHDTConflictPriority[wbIgnoreWorldMHDT])
// way too verbose for no practical use
{wbArray('Cell Data', wbStruct('Quad Height', [
wbInteger('Bottom Left', itU8),
wbInteger('Bottom Right', itU8),
wbInteger('Top Left', itU8),
wbInteger('Top Right', itU8)
]))}
], cpNormalIgnoreEmpty);
], wbWorldMHDTConflictPriority[wbIgnoreWorldMHDT]);
end;

if wbSimpleRecords then
Expand Down
3 changes: 3 additions & 0 deletions wbInit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1070,6 +1070,9 @@ function wbDoInit: Boolean;
else if FindCmdLineSwitch('hidefixup') then
wbShowInternalEdit := False;

if FindCmdLineSwitch('IgnoreWorldMHDT') then
wbIgnoreWorldMHDT := True;

if wbQuickClean then begin
wbFixupPGRD := True;
wbAllowInternalEdit := True;
Expand Down
2 changes: 2 additions & 0 deletions wbInterface.pas
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ TwbTwoPtr = record
wbAllowInternalEdit : Boolean = True;
wbShowInternalEdit : Boolean = False;

wbIgnoreWorldMHDT : Boolean = False;

wbReportMode : Boolean = False;
wbReportUnused : Boolean = False;
wbReportRequired : Boolean = False;
Expand Down
1 change: 1 addition & 0 deletions whatsnew.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@

* #827 - Allow SSEEdit to Minimize during processing
* #901 - "Unhide all..." option in column context menu
* #902 - Option to ignore MHDT conflicts when using Very Quick Show Conflicts (use `-IgnoreWorldMHDT` parameter)

## Enderal Special Edition

Expand Down

0 comments on commit c4d7f36

Please sign in to comment.