Mercurial > wow > cyborg-mmo7
diff OpenButtonPage.xml @ 13:6cb9a2936580
Miscellanous Lua code consistency improvements:
- no semicolon except between statements on same line
- use of implicit cast to bool in if/while conditions, instead of various eq/neq against true, false or nil
- no parenthesis around if/while conditions (C-ism)
- avoid long function calls in if conditions
- removed space in comma-separated expressions lists in multiple assignments
- added spaces between arguments of functions calls
- use tabs for indentation (in Lua files only)
- don't reverse == in if conditions, like "if 42==foo then" (C-ism)
- removed some extra parenthesis in complex expressions (C-ism)
- added spaces around operators in most expressions for ease of reading
- added comma after last element of table initializers
- removed space after # operator
- moved comment prefix of disabled code into tab (to keep disabled code aligned)
author | madcatzinc@35b17cf1-18cd-47ff-9ca3-31d6b526ef09 |
---|---|
date | Thu, 25 Apr 2013 01:29:45 +0000 |
parents | 8428fa7cf0e4 |
children | f02cf040133c |
line wrap: on
line diff
--- a/OpenButtonPage.xml Tue Apr 16 15:19:23 2013 +0000 +++ b/OpenButtonPage.xml Thu Apr 25 01:29:45 2013 +0000 @@ -55,18 +55,18 @@ </Anchors> <Scripts> <OnLoad> - self:RegisterForDrag("LeftButton","RightButton") + self:RegisterForDrag("LeftButton", "RightButton") </OnLoad> <OnClick> - CyborgMMO_Toggle(); + CyborgMMO_Toggle() </OnClick> <OnDragStart> - self:StartMoving(); - self.isMoving = true; + self:StartMoving() + self.isMoving = true </OnDragStart> <OnDragStop> - self:StopMovingOrSizing(); - self.isMoving = false; + self:StopMovingOrSizing() + self.isMoving = false </OnDragStop> <OnEnter> CyborgMMO_ShowProfileTooltip(self:GetNormalTexture()) @@ -160,19 +160,19 @@ </Layers> <Scripts> <OnLoad> - self:RegisterForDrag("LeftButton","RightButton") + self:RegisterForDrag("LeftButton", "RightButton") </OnLoad> <OnMouseDown> </OnMouseDown> <OnMouseUp> - CyborgMMO_Toggle(); - if(false == CyborgMMO_IsOpen()) then - CyborgMMO_RatQuickPage:Show(); + CyborgMMO_Toggle() + if not CyborgMMO_IsOpen() then + CyborgMMO_RatQuickPage:Show() end </OnMouseUp> <OnEnter> - if(false == CyborgMMO_IsOpen()) then - CyborgMMO_RatQuickPage:Show(); + if not CyborgMMO_IsOpen() then + CyborgMMO_RatQuickPage:Show() end CyborgMMO_ShowProfileTooltip(getglobal(self:GetName().."_Icon")) </OnEnter> @@ -181,8 +181,8 @@ CyborgMMO_HideProfileTooltip() </OnLeave> <OnUpdate> - if(self:IsDragging()) then - CyborgMMO_MiniMapButtonOnUpdate(); + if self:IsDragging() then + CyborgMMO_MiniMapButtonOnUpdate() end </OnUpdate> </Scripts>