Skip to content

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

Merged
merged 9 commits into from
Apr 26, 2024

Conversation

Instantium
Copy link
Contributor

@Instantium Instantium commented Apr 18, 2024

Relates to:
#1819
#1078

Improvements:
link to broadcast_text

@Instantium Instantium force-pushed the feature/creature_text branch from 6f9174c to 6e7118f Compare April 18, 2024 07:51
@FrancescoBorzi
Copy link
Collaborator

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!

@Instantium Instantium force-pushed the feature/creature_text branch 2 times, most recently from ae7aed6 to 89b8f72 Compare April 19, 2024 14:53
@Instantium
Copy link
Contributor Author

Reverted the changes to package-lock.json.

@Instantium Instantium force-pushed the feature/creature_text branch from 89b8f72 to 452e49b Compare April 23, 2024 10:59
@Instantium Instantium requested a review from Helias April 23, 2024 11:08
@@ -85,7 +85,8 @@
"SKINNING_LOOT": "Skinning Loot",
"SPAWN": "Spawn",
"SPAWN_ADDON": "Spawn Addon",
"SMARTAI": "SmartAI"
"SMARTAI": "SmartAI",
"TEXT": "Text"
Copy link
Collaborator

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)

Comment on lines 16 to 55
<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>
Copy link
Collaborator

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">
Copy link
Collaborator

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'],
Copy link
Collaborator

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

Comment on lines 18 to 22
let fixture: ComponentFixture<CreatureTextComponent>;
let queryService: MysqlQueryService;
let querySpy: Spy;
let handlerService: CreatureHandlerService;
let page: CreatureTextPage;
Copy link
Collaborator

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.

For example: https://github.com/azerothcore/Keira3/blob/master/libs/features/creature/src/creature-template-spell/creature-template-spell.integration.spec.ts#L33

});

describe('Editing existing', () => {
beforeEach(() => setup(false));
Copy link
Collaborator

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));
Copy link
Collaborator

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

@FrancescoBorzi
Copy link
Collaborator

@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 page_text already, I will submit a PR for that later.

@FrancescoBorzi FrancescoBorzi changed the title Feat: Added creature-text feat(creature): new creature_text editor Apr 24, 2024
@Instantium Instantium force-pushed the feature/creature_text branch from 452e49b to 61ebd6a Compare April 24, 2024 15:12
@Instantium
Copy link
Contributor Author

I added the tooltips as suggested. It just made sense to also add the SingleValueSelector to TextType and TextRange.

@Helias
Copy link
Member

Helias commented Apr 24, 2024

Some errors in the pipeline:

  /home/runner/work/Keira3/Keira3/libs/features/creature/src/creature-text/creature-text.integration.spec.ts
     1:10  error  'ComponentFixture' is defined but never used. Allowed unused vars must match /^_/u  @typescript-eslint/no-unused-vars
    13:8   error  'Spy' is defined but never used. Allowed unused vars must match /^_/u               @typescript-eslint/no-unused-vars

"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"
Copy link
Collaborator

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)

@FrancescoBorzi FrancescoBorzi merged commit ee953c1 into azerothcore:master Apr 26, 2024
12 checks passed
@FrancescoBorzi
Copy link
Collaborator

very well done @Instantium

thanks for your valuable contribution!

As I said, I will soon push the page_text editor myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants