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

feat(conditions): add rankmask flag selector #708

Merged
merged 10 commits into from
May 24, 2020
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,13 @@
[config]="{ flags: QUEST_STATE, name: 'ConditionValue2' }"
[modalClass]="'modal-lg'"
></keira-flags-selector-btn>
<keira-flags-selector-btn
*ngIf="showReactionTo"
[control]="editorService.form.controls.ConditionValue2"
[config]="{ flags: RANKMASK, name: 'ConditionValue2' }"
[modalClass]="'modal-lg'"
></keira-flags-selector-btn>
Kitzunu marked this conversation as resolved.
Show resolved Hide resolved

<input [formControlName]="'ConditionValue2'" id="ConditionValue2" type="number" class="form-control form-control-sm">
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
SOURCE_ENTRY_TOOLTIPS,
SOURCE_GROUP_TOOLTIPS
} from './conditions-constants';
import { QUEST_STATE } from '@keira-constants/flags/quest-state';
import { QUEST_STATE, RANKMASK } from '@keira-constants/flags/conditions';

@Component({
selector: 'keira-conditions',
Expand All @@ -38,6 +38,7 @@ export class ConditionsComponent extends SingleRowEditorComponent<Conditions> {
public readonly CONDITION_VALUE_3_TOOLTIPS = CONDITION_VALUE_3_TOOLTIPS;

public readonly QUEST_STATE = QUEST_STATE;
public readonly RANKMASK = RANKMASK;

get selectedSourceType(): number {
return this.editorService.form.controls.SourceTypeOrReferenceId.value;
Expand All @@ -51,6 +52,10 @@ export class ConditionsComponent extends SingleRowEditorComponent<Conditions> {
return this.conditionType === CONDITION_TYPES.CONDITION_QUESTSTATE;
}

get showReactionTo(): boolean {
return this.conditionType === CONDITION_TYPES.CONDITION_REACTION_TO;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Kitzunu I've updated this part to enable it also for CONDITION_REPUTATION_RANK since it's the same flag

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea I thought of doing that too :D


/* istanbul ignore next */ // because of: https://github.com/gotwarlost/istanbul/issues/690
constructor(
public editorService: ConditionsService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,14 @@ export const QUEST_STATE: Flag[] = [
{ bit: 5, name: 'FAILED', },
{ bit: 6, name: 'REWARDED', },
];

export const RANKMASK: Flag[] = [
{ bit: 0, name: 'HATED', },
{ bit: 1, name: 'HOSTILE', },
{ bit: 2, name: 'UNFRIENDLY', },
{ bit: 3, name: 'NEUTRAL', },
{ bit: 4, name: 'FRIENDLY', },
{ bit: 5, name: 'HONORED', },
{ bit: 6, name: 'REVERED', },
{ bit: 7, name: 'EXALTED', },
];