Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#2266 closed enhancement (duplicate)

[PATCH] Guard button In unit command panel

Reported by: dajayalol Owned by: dajayalol
Priority: Nice to Have Milestone:
Component: UI & Simulation Keywords: patch
Cc: Patch:

Description

Attachments (2)

backup.zip (1.4 MB ) - added by dajayalol 10 years ago.
backup of /gui and /simulation before lobby was implemented
Guard.diff (22.8 KB ) - added by dajayalol 10 years ago.
i wrecked some function of garrison and lobby in this patch

Download all attachments as: .zip

Change History (15)

by dajayalol, 10 years ago

Attachment: backup.zip added

backup of /gui and /simulation before lobby was implemented

in reply to:  description comment:1 by dajayalol, 10 years ago

Replying to dajayalol:

http://imgur.com/BhbdLOU

This is a pre-selected action defined by input.js of /gui with a unitcommand button of unit command panel as it's gui interface
Since i made it by cutting down garrison button

it already got a cursor,a case "guard" in /simulation/helpers/Commands.js
an Order.Guard to change an entites into "INDIVIDUAL.GUARD.APPROACHING"
and "INDIVIDUAL.GUARD.GUARDING" status
like Garrisonholder.js under /simulation/components i added a Guard.js that has the following functions:


Guard.prototype.Init = function() Guard.prototype.GetEntities = function() Guard.prototype.GetCapacity = function()


to make sure every Unit that is under guard by another unit got a list of entitiesID that lists the Guardians of the unit,so we can manipulate the list of entitiesID when GlobalOwnershipChanged and OnGlobalEntityRenamed...etc..etc and it will Post a message to engine when MT_GuardingUnitsChanged

things that i haven't done yet is that when an entity is under "INDIVIDUAL.GUARD.GUARDING" status and when the Guarded unit is not killed or Ownershipchanged to an enemy player,it should try to keep in a range within the Guarded unit's LOS

comment:2 by leper, 10 years ago

Could you provide a diff (against the latest revision)?

in reply to:  2 comment:3 by dajayalol, 10 years ago

Replying to leper:

Could you provide a diff (against the latest revision)?

i'll try doing so ,but last time i tried using svn -diff it didn't include guard.js and any new file against latest svn,that's the reason why i uploaded with zip it can works by extraction of the zip into /mod/public/

Last edited 10 years ago by dajayalol (previous) (diff)

comment:4 by leper, 10 years ago

Try using svn add on the new files, then they should show up in the diff.

comment:5 by leper, 10 years ago

Keywords: patch review added
Milestone: BacklogAlpha 16
Summary: Guard button In unit command panel[PATCH] Guard button In unit command panel

See SubmittingPatches (especially the part about adding the review keyword) for future patches.

In Guard.js you are using var and const inconsitently.
In UnitAI.js the indentation in both "Order.Guard" and "GUARD.GUARDING.enter" is messed up.
You can just use <Guard/> in the .xml-file.

in reply to:  5 comment:6 by dajayalol, 10 years ago

Replying to leper:

See SubmittingPatches (especially the part about adding the review keyword) for future patches.

In Guard.js you are using var and const inconsitently.
In UnitAI.js the indentation in both "Order.Guard" and "GUARD.GUARDING.enter" is messed up.
You can just use <Guard/> in the .xml-file.

i've acknowledged the problem during fixing FORMATIONCONTROLLER's Order.Guard

by dajayalol, 10 years ago

Attachment: Guard.diff added

i wrecked some function of garrison and lobby in this patch

comment:7 by mimo, 10 years ago

It's not clear to me what is the purpose of this patch (there is no description), but from what I can guess fetching the code, I wonder to what extend it dupplicates http://trac.wildfiregames.com/ticket/2034 ? specially that one of the comments of #2034 was to also pass commands via a button. Most of the comments in question (including the guard button) had already been implemented in #2034, although I had not yet time to clean and finalize the patch.

comment:8 by Marcio, 10 years ago

I'm follow both, but the difference is one for siege units, other for all units. I recommend merge all.

comment:9 by Marcio, 10 years ago

you can convert this a Follow Unit patch?

comment:10 by dajayalol, 10 years ago

i am busy doing grad school stuff so this patch might not be updated soon There's a bug that i can not make a group of unit in formation into guard mode (fixing FORMATIONCONTROLLER's Order.Guard) and i am wondering how to implement unit attacks units that attacks their vip when under INDIVIDUAL.GUARD.GUARDING

comment:11 by leper, 10 years ago

Is this still needed? Since we #2304 has been committed I'm not really sure if this ticket is still needed.

comment:12 by mimo, 10 years ago

Keywords: review removed
Milestone: Alpha 16Backlog
Resolution: duplicate
Status: newclosed

Thanks for the patch, but as it is already covered by #2304 which is commited, I put it as duplicate

comment:13 by leper, 10 years ago

Milestone: Backlog
Note: See TracTickets for help on using tickets.