Skip to content

Commit

Permalink
chore(SAI): general (#295)
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancescoBorzi authored and Helias committed Dec 24, 2019
1 parent 5e444e1 commit 69c647e
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 1 deletion.
Expand Up @@ -63,6 +63,10 @@
<div class="form-row">
<div class="form-group col-6">
<label class="control-label" for="link">link</label>
<i
class="fas fa-info-circle ml-1" [placement]="'auto'"
[tooltip]="'Event linking. Example: if id = 0 and link = 1; id 1 will only be able to occur if id = 0 was triggered (id 1 has to use event_type SMART_EVENT_LINK)'"
></i>
</div>

<div class="form-group col">
Expand All @@ -73,6 +77,15 @@
<div class="form-row">
<div class="form-group col-6">
<label class="control-label" for="event_phase_mask">phase</label>
<app-flags-selector-btn
[control]="editorService.form.get('event_phase_mask')"
[config]="{ flags: EVENT_PHASE_MASK, name: 'event_phase_mask' }"
[modalClass]="'modal-lg'"
></app-flags-selector-btn>
<i
class="fas fa-info-circle ml-1" [placement]="'auto'"
[tooltip]="'Use 0 for all phases'"
></i>
</div>

<div class="form-group col">
Expand All @@ -83,6 +96,10 @@
<div class="form-row">
<div class="form-group col-6">
<label class="control-label" for="event_chance">chance</label>
<i
class="fas fa-info-circle ml-1" [placement]="'auto'"
[tooltip]="'This is the probability of the event to occur as a percentage from 0-100. Example: if you want the event to occur roughly half of the time, then set this to 50.'"
></i>
</div>

<div class="form-group col">
Expand All @@ -93,6 +110,11 @@
<div class="form-row">
<div class="form-group col-6">
<label class="control-label" for="event_flags">flags</label>
<app-flags-selector-btn
[control]="editorService.form.get('event_flags')"
[config]="{ flags: SMART_EVENT_FLAGS, name: 'event_flags' }"
[modalClass]="'modal-lg'"
></app-flags-selector-btn>
</div>

<div class="form-group col">
Expand Down
Expand Up @@ -31,6 +31,8 @@ import {
SAI_TARGET_PARAM4_NAMES,
SAI_TARGET_PARAM4_TOOLTIPS, SAI_TARGET_TOOLTIPS, SAI_TARGETS, SAI_TARGETS_KEYS
} from './constants/sai-targets';
import { EVENT_PHASE_MASK } from '../../../../constants/flags/event-phase-mask';
import { SMART_EVENT_FLAGS } from '../../../../constants/flags/smart-event-flags';

@Component({
selector: 'app-sai-editor',
Expand All @@ -39,6 +41,8 @@ import {
})
export class SaiEditorComponent extends MultiRowEditorComponent<SmartScripts> {

public readonly EVENT_PHASE_MASK = EVENT_PHASE_MASK;
public readonly SMART_EVENT_FLAGS = SMART_EVENT_FLAGS;
public readonly SAI_EVENTS = SAI_EVENTS;
public readonly SAI_EVENTS_KEYS = SAI_EVENTS_KEYS;
public readonly SAI_ACTIONS = SAI_ACTIONS;
Expand Down
Expand Up @@ -7,6 +7,7 @@ import { NgxDatatableModule } from '@swimlane/ngx-datatable';
import { QueryOutputModule } from '../query-output/query-output.module';
import { SaiEditorComponent } from './sai-editor.component';
import { SaiTopBarComponent } from './sai-top-bar/sai-top-bar.component';
import { FlagsSelectorModule } from '../selectors/flags-selector/flags-selector.module';

@NgModule({
declarations: [
Expand All @@ -17,6 +18,7 @@ import { SaiTopBarComponent } from './sai-top-bar/sai-top-bar.component';
BrowserModule,
ReactiveFormsModule,
QueryOutputModule,
FlagsSelectorModule,
TooltipModule.forRoot(),
NgxDatatableModule,
],
Expand Down
16 changes: 16 additions & 0 deletions src/app/constants/flags/event-phase-mask.ts
@@ -0,0 +1,16 @@
import { Flag } from '../../types/general';

export const EVENT_PHASE_MASK: Flag[] = [
{ bit: 0, name: 'SMART_EVENT_PHASE_1' },
{ bit: 1, name: 'SMART_EVENT_PHASE_2' },
{ bit: 2, name: 'SMART_EVENT_PHASE_3' },
{ bit: 3, name: 'SMART_EVENT_PHASE_4' },
{ bit: 4, name: 'SMART_EVENT_PHASE_5' },
{ bit: 5, name: 'SMART_EVENT_PHASE_6' },
{ bit: 6, name: 'SMART_EVENT_PHASE_7' },
{ bit: 7, name: 'SMART_EVENT_PHASE_8' },
{ bit: 8, name: 'SMART_EVENT_PHASE_9' },
{ bit: 9, name: 'SMART_EVENT_PHASE_10' },
{ bit: 10, name: 'SMART_EVENT_PHASE_11' },
{ bit: 11, name: 'SMART_EVENT_PHASE_12' },
];
2 changes: 1 addition & 1 deletion src/app/constants/flags/phase-mask.ts
Expand Up @@ -33,5 +33,5 @@ export const PHASE_MASK: Flag[] = [
{ bit: 29, name: 'Phase 29' },
{ bit: 30, name: 'Phase 30' },
{ bit: 31, name: 'Phase 31' },
{ bit: 32, name: 'Phase 12' },
{ bit: 32, name: 'Phase 32' },
];
13 changes: 13 additions & 0 deletions src/app/constants/flags/smart-event-flags.ts
@@ -0,0 +1,13 @@
import { Flag } from '../../types/general';

export const SMART_EVENT_FLAGS: Flag[] = [
{ bit: 0, name: 'NOT_REPEATABLE (Event can not repeat)' },
{ bit: 1, name: 'DIFFICULTY_0 (Normal dungeon)' },
{ bit: 2, name: 'DIFFICULTY_1 (Heroic dungeon)' },
{ bit: 3, name: 'DIFFICULTY_2 (Normal raid)' },
{ bit: 4, name: 'DIFFICULTY_3 (Heroic raid)' },
{ bit: 5, name: 'RESERVED_5 (not used)' },
{ bit: 6, name: 'RESERVED_6 (not used)' },
{ bit: 7, name: 'DEBUG_ONLY (only used in debug build)' },
{ bit: 8, name: 'DONT_RESET (Event will not reset)' },
];

0 comments on commit 69c647e

Please sign in to comment.