Opened 9 years ago
Closed 8 years ago
#3383 closed defect (fixed)
[PATCH] Lobby - coding convention
Reported by: | elexis | Owned by: | elexis |
---|---|---|---|
Priority: | Should Have | Milestone: | Alpha 20 |
Component: | Multiplayer lobby | Keywords: | patch |
Cc: | Patch: |
Description
- object keys should be quoted
- objects should have a space after
{
and before}
- global variables should have a capital letter following the
g_
prefix - constants should be declared as such
each
is deprecated- trailing whitespace should be removed
Attachments (4)
Change History (16)
by , 9 years ago
Attachment: | lobby_coding_convention_v1.patch added |
---|
by , 9 years ago
Attachment: | lobby_coding_convention_v2.patch added |
---|
More cleanup as discussed in IRC.
by , 9 years ago
Attachment: | lobby_coding_convention_v3.patch added |
---|
comment:1 by , 9 years ago
- Fixed moderator translation (where translate was called on arbitrary strings after converting them to uppercase)
- moved color hardcoding to constants
- removed pony-colors and the ability to colorize every character of usernames individually o.O
- eliminated useless variables
- early returns
- fat arrows
let
instead ofvar
- refactored commonly used functions like
colorize()
,setSenderFont()
andreturnToMainMenu()
by , 9 years ago
Attachment: | lobby_coding_convention_v4.patch added |
---|
comment:2 by , 9 years ago
Some minor changes after a review by leper on september 1st in irc:
- Removed the "invalid nick" check which should be prohibited in the Xmpp server, not in the GUI of the client
- Simplified the object key substitutions in
addChatMessage
- Moved the bracket for the
Engine.PushGuiPage
calls and new global arrays - Doesn't introduce a setFont function, but explicitly adds the
"[font='...']" + txt + "[/font]"
tags. I still think we should refactor that, but that should happen in a new ticket then as these tags are added in like 60 lines. - That "gone" state exists and you reproduce it by joining with a regular xmpp client and setting your state to "extended away".
- Removes some newlines
comment:3 by , 9 years ago
Keywords: | review removed |
---|---|
Milestone: | Alpha 19 → Alpha 20 |
Too much to rebase and review for the remaining a19 time, also no benefits to the user, only to devs.
Note:
See TracTickets
for help on using tickets.
for ... of
unfortunately doesn't work withg_SpamMonitor)
, so I usedfor ... in
there.