Left-click the portrait to follow the entity #7018
Labels
No Label
Closed
Duplicate
Closed
Fixed
Closed
Invalid
Closed
Needs info
Closed
Won't fix
Closed
Works for me
Difficulty
Hard
Difficulty
Medium
Difficulty
Simple
Needed for Beta
Needs Design Input
Needs Info
Pathfinding
Priority
1: Release Blocker
Priority
2: Must Have
Priority
3: Should Have
Priority
4: Nice To Have
Priority
5: If Time Permits
Regression
Theme
AI
Theme
Art & Animation
Theme
Atlas editor
Theme
Build & Packages
Theme
Core engine
Theme
Documentation
Theme
Internationalization & Localization
Theme
Maps
Theme
Multiplayer Lobby
Theme
Music & Sound FX
Theme
Network
Theme
Non-game systems
Theme
Simulation
Theme
UI & Simulation
Theme
UI β Game setup
Theme
UI β In-game
Theme
UI β Miscellaneous
Theme
Website & Forum
Type
Defect
Type
Enhancement
Type
Task
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: 0ad/0ad#7018
Loadingβ¦
Reference in New Issue
Block a user
No description provided.
Delete Branch "abian/0ad:left-click-portrait"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Left-clicking the portrait of a unit will make the camera follow that unit (before: no action). A tooltip informs the player of this possibility.
Left-clicking the portrait of a structure will make the camera focus on that structure (before: no action). A tooltip informs the player of this possibility.
Double-clicking a hero/treasure icon will make the camera follow that hero/treasure (before: just focus on that hero/treasure).
Some minor related changes.
Fixes #6879
Being pedantic here, about commit messages: https://www.baeldung.com/ops/git-commit-messages#3-the-5072-rule. ducks
Except for nitpicks this looks fine and the functionality useful.
@ -362,2 +370,4 @@
getTreasureTooltip
].map(func => func(template)));
let leftClickTooltip = hasClass(entState, "Unit") ? getFollowOnLeftClickTooltip() : getFocusOnLeftClickTooltip();
looks like it could be const, seems the linter isn't up and running just yet.
Should I add another commit? Or squash? Let's see if I don't mess it up once again...
During review it's fine to add just another commit on top and can in some scenarios help the review process but before merging squashing is a must. For the sake of testing squashing and force pushing I'd say just try it out and see what happens.
It worked! \o/
@ -386,14 +386,16 @@ function cancelUpgradeEntity()
}
/**
* Set the camera to follow the given entity if it's a unit.
An entity can be a building or even a tree, therefore the specialization of unit
I changed the word as it can now "follow" all kinds of entities (the camera will just focus on buildings or trees, but there's no noticeable difference).
So you set the camera to the position of entity if possible and enable follow if entity is unit
Thank you for your comments and patience! π
1411c27082
to37e69cae55
From quickly checking over it, this looks good to me. Cool.
Just one small thing;)
@ -325,3 +325,3 @@
Engine.GetGUIObjectByName("icon").sprite = template.icon ? ("stretched:session/portraits/" + template.icon) : "BackgroundBlack";
if (template.icon)
Engine.GetGUIObjectByName("iconBorder").onPressRight = () => {
{
Sorry if I'm being overly nitpicky here, but I believe it's customary in this codebase to place the opening brace on the same line as the lamba expression for arrow functions.
Oh, maybe the diff is confusing. This line used to open a lambda expression, but now it opens the if block.
Ah, I see. Everything's fine then, my bad.
No worries!
tested, works as promised
@ -328,0 +327,4 @@
{
const iconBorder = Engine.GetGUIObjectByName("iconBorder");
// Actions on left click
Guess the comment here isn't really needed
Agreed, removed! Thanks for the testing and for moving this forward.
eb3547c7c0
to2cae398a6f
2cae398a6f
tod31084950b
Anything to do before we can merge this? (ping @Itms)
If the reviewer is OK then it's good to go. @sera do you want to merge this as your first team action? π