-
-
Notifications
You must be signed in to change notification settings - Fork 154
feat(creature): new creature_text editor #2889
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(creature): new creature_text editor #2889
Conversation
6f9174c
to
6e7118f
Compare
hi @Instantium thank you very much for contributing at Keira3! I haven't looked carefully into this PR yet (I will do it later), but I immediately noticed you pushed huge changes to the package-lock.json. This is probably unintended and should be reverted. I know what could have been the cause and how to easily revert it. Ping me if you need any assistance! |
ae7aed6
to
89b8f72
Compare
Reverted the changes to package-lock.json. |
libs/features/creature/src/creature-text/creature-text.component.ts
Outdated
Show resolved
Hide resolved
libs/features/creature/src/creature-text/creature-text.service.ts
Outdated
Show resolved
Hide resolved
89b8f72
to
452e49b
Compare
@@ -85,7 +85,8 @@ | |||
"SKINNING_LOOT": "Skinning Loot", | |||
"SPAWN": "Spawn", | |||
"SPAWN_ADDON": "Spawn Addon", | |||
"SMARTAI": "SmartAI" | |||
"SMARTAI": "SmartAI", | |||
"TEXT": "Text" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should add this new key in all other languages, it's okay to put the text in English as temporary and it can be translated later (but they key should exist)
<div class="form-group col-12 col-sm-6 col-md-4 col-lg-2 col-xl-2"> | ||
<label class="control-label" for="GroupID">GroupID</label> | ||
<input [formControlName]="'GroupID'" id="GroupID" type="number" class="form-control form-control-sm" /> | ||
</div> | ||
<div class="form-group col-12 col-sm-6 col-md-4 col-lg-2 col-xl-2"> | ||
<label class="control-label" for="ID">ID</label> | ||
<input [formControlName]="'ID'" id="ID" type="number" class="form-control form-control-sm" /> | ||
</div> | ||
<div class="form-group col-12 col-sm-6 col-md-4 col-lg-2 col-xl-2"> | ||
<label class="control-label" for="Type">Type</label> | ||
<input [formControlName]="'Type'" id="Type" type="number" class="form-control form-control-sm" /> | ||
</div> | ||
<div class="form-group col-12 col-sm-6 col-md-4 col-lg-2 col-xl-2"> | ||
<label class="control-label" for="Language">Language</label> | ||
<input [formControlName]="'Language'" id="Language" type="number" class="form-control form-control-sm" /> | ||
</div> | ||
<div class="form-group col-12 col-sm-6 col-md-4 col-lg-2 col-xl-2"> | ||
<label class="control-label" for="Probability">Probability</label> | ||
<input [formControlName]="'Probability'" id="Probability" type="number" class="form-control form-control-sm" /> | ||
</div> | ||
<div class="form-group col-12 col-sm-6 col-md-4 col-lg-2 col-xl-2"> | ||
<label class="control-label" for="Emote">Emote</label> | ||
<input [formControlName]="'Emote'" id="Emote" type="number" class="form-control form-control-sm" /> | ||
</div> | ||
<div class="form-group col-12 col-sm-6 col-md-4 col-lg-2 col-xl-2"> | ||
<label class="control-label" for="Duration">Duration</label> | ||
<input [formControlName]="'Duration'" id="Duration" type="number" class="form-control form-control-sm" /> | ||
</div> | ||
<div class="form-group col-12 col-sm-6 col-md-4 col-lg-2 col-xl-2"> | ||
<label class="control-label" for="Sound">Sound</label> | ||
<input [formControlName]="'Sound'" id="Sound" type="number" class="form-control form-control-sm" /> | ||
</div> | ||
<div class="form-group col-12 col-sm-6 col-md-4 col-lg-2 col-xl-2"> | ||
<label class="control-label" for="BroadcastTextId">BroadcastTextId</label> | ||
<input [formControlName]="'BroadcastTextId'" id="BroadcastTextId" type="number" class="form-control form-control-sm" /> | ||
</div> | ||
<div class="form-group col-12 col-sm-6 col-md-4 col-lg-2 col-xl-2"> | ||
<label class="control-label" for="Type">TextRange</label> | ||
<input [formControlName]="'TextRange'" id="TextRange" type="number" class="form-control form-control-sm" /> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bonus: add the tooltip to these fields to give a (short) explanation of what they do.
Example:
<i class="fas fa-info-circle ms-1" placement="auto" [tooltip]="'CREATURE.TEMPLATE.SPEED_SWIM' | translate"></i>
<label class="control-label" for="Type">TextRange</label> | ||
<input [formControlName]="'TextRange'" id="TextRange" type="number" class="form-control form-control-sm" /> | ||
</div> | ||
<div class="form-group col-12 col-sm-6 col-md-4 col-lg-2 col-xl-2"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can make this field a bit bigger, so removing the col-xl-2
class should be enough
changeDetection: ChangeDetectionStrategy.OnPush, | ||
selector: 'keira-creature-text', | ||
templateUrl: './creature-text.component.html', | ||
styleUrls: ['./creature-text.component.scss'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since this is empty, the file creature-text.component.scss
can be deleted and this line removed
let fixture: ComponentFixture<CreatureTextComponent>; | ||
let queryService: MysqlQueryService; | ||
let querySpy: Spy; | ||
let handlerService: CreatureHandlerService; | ||
let page: CreatureTextPage; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer if we avoided shared-variables across tests and instantiate and return them in the setup
function.
}); | ||
|
||
describe('Editing existing', () => { | ||
beforeEach(() => setup(false)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this beforeEach
will become obsolete with the new setup
structure suggested in my comment above
} | ||
|
||
describe('Creating new', () => { | ||
beforeEach(() => setup(true)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this beforeEach
will become obsolete with the new setup
structure suggested in my comment above
@Instantium very well done, I just left a bunch of minor comments and once they are addressed I think this is ready to go! thank you very much for your contributions. PS: I'm working on the |
452e49b
to
61ebd6a
Compare
I added the tooltips as suggested. It just made sense to also add the SingleValueSelector to TextType and TextRange. |
Some errors in the pipeline:
|
"EMOTE": "The emote that the creature plays when the text is executed. Value to use in this field can be obtained from the emote.dbc", | ||
"DURATION": "Time in ms to see text. 0 is default and calculated by core.", | ||
"SOUND": "The sound entry this creature will play at the same time the text is executed. Sounds are found in SoundEntries.dbc.", | ||
"BROADCAST_TEXT_ID": "Id of the equivalent text found in broadcast_text" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe @pangolp can hep with the Spanish translations (in a separate PR of course, this should be merged meanwhile)
very well done @Instantium thanks for your valuable contribution! As I said, I will soon push the |
Relates to:
#1819
#1078
Improvements:
link to broadcast_text