-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
armour type select and targets allowed
- Loading branch information
Showing
163 changed files
with
34,197 additions
and
22 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/app/components/drop-down-select-field/drop-down-select-field.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<div class="form-group row"> | ||
<label class="col-sm-2 col-form-label" for="exampleFormControlSelect1">{{weService.FieldToName(fieldName)}}</label> | ||
<div class="col-sm-10"> | ||
|
||
<select [value]="value" | ||
[disabled]="disabled" | ||
(change)="onChange($event.target.value)" | ||
class="form-control" | ||
id="exampleFormControlSelect1"> | ||
<option *ngFor="let opt of options" [value]="opt">{{opt}}</option> | ||
</select> | ||
</div> | ||
</div> |
Empty file.
25 changes: 25 additions & 0 deletions
25
src/app/components/drop-down-select-field/drop-down-select-field.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { DropDownSelectFieldComponent } from './drop-down-select-field.component'; | ||
|
||
describe('DropDownSelectFieldComponent', () => { | ||
let component: DropDownSelectFieldComponent; | ||
let fixture: ComponentFixture<DropDownSelectFieldComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ DropDownSelectFieldComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(DropDownSelectFieldComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
47 changes: 47 additions & 0 deletions
47
src/app/components/drop-down-select-field/drop-down-select-field.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { Component, forwardRef, Input, OnInit } from '@angular/core'; | ||
import { WorldEditService } from '../../services/WorldEditService/world-edit.service'; | ||
import { NG_VALUE_ACCESSOR } from '@angular/forms'; | ||
|
||
@Component({ | ||
selector: 'app-drop-down-select-field', | ||
templateUrl: './drop-down-select-field.component.html', | ||
styleUrls: ['./drop-down-select-field.component.scss'], | ||
providers: [ | ||
{ | ||
provide: NG_VALUE_ACCESSOR, | ||
useExisting: forwardRef(() => DropDownSelectFieldComponent), | ||
multi: true | ||
} | ||
] | ||
}) | ||
export class DropDownSelectFieldComponent { | ||
@Input() public fieldName: string; | ||
@Input() public options: string[]; | ||
public value: string; | ||
public active: boolean = false; | ||
public onChange: (value: string) => void; | ||
public onTouched: () => void; | ||
public disabled: boolean; | ||
|
||
constructor(public weService: WorldEditService) { | ||
} | ||
|
||
public registerOnChange(fn: any): void { | ||
this.onChange = fn; | ||
} | ||
|
||
public registerOnTouched(fn: any): void { | ||
this.onTouched = fn; | ||
|
||
} | ||
|
||
public setDisabledState(isDisabled: boolean): void { | ||
this.disabled = isDisabled; | ||
} | ||
|
||
public writeValue(value: string): void { | ||
this.value = value ? value : ''; | ||
} | ||
|
||
|
||
} |
13 changes: 13 additions & 0 deletions
13
src/app/components/integer-field/integer-field.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<div class="form-group row"> | ||
<label [for]="'input'+fieldName" class="col-sm-2 col-form-label">{{weService.FieldToName(fieldName)}}</label> | ||
<div class="col-sm-10"> | ||
<input | ||
[value]="value" | ||
[disabled]="disabled" | ||
(change)="onChange($event.target.value)" | ||
[placeholder]="weService.FieldToName(fieldName)" | ||
type="number" | ||
class="form-control" | ||
[id]="'input'+fieldName"> | ||
</div> | ||
</div> |
Empty file.
25 changes: 25 additions & 0 deletions
25
src/app/components/integer-field/integer-field.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { IntegerFieldComponent } from './integer-field.component'; | ||
|
||
describe('IntegerFieldComponent', () => { | ||
let component: IntegerFieldComponent; | ||
let fixture: ComponentFixture<IntegerFieldComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ IntegerFieldComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(IntegerFieldComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
44 changes: 44 additions & 0 deletions
44
src/app/components/integer-field/integer-field.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { Component, forwardRef, Input, OnInit } from '@angular/core'; | ||
import { NG_VALUE_ACCESSOR } from '@angular/forms'; | ||
import { WorldEditService } from '../../services/WorldEditService/world-edit.service'; | ||
|
||
@Component({ | ||
selector: 'app-integer-field', | ||
templateUrl: './integer-field.component.html', | ||
styleUrls: ['./integer-field.component.scss'], | ||
providers: [ | ||
{ | ||
provide: NG_VALUE_ACCESSOR, | ||
useExisting: forwardRef(() => IntegerFieldComponent), | ||
multi: true | ||
} | ||
] | ||
}) | ||
export class IntegerFieldComponent { | ||
@Input() public fieldName: string; | ||
public value: number; | ||
public active: boolean = false; | ||
public onChange: (value: string) => void; | ||
public onTouched: () => void; | ||
public disabled: boolean; | ||
|
||
constructor(public weService: WorldEditService) { | ||
} | ||
|
||
public registerOnChange(fn: any): void { | ||
this.onChange = fn; | ||
} | ||
|
||
public registerOnTouched(fn: any): void { | ||
this.onTouched = fn; | ||
|
||
} | ||
|
||
public setDisabledState(isDisabled: boolean): void { | ||
this.disabled = isDisabled; | ||
} | ||
|
||
public writeValue(value: number): void { | ||
this.value = value ? value : 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.