Mercurial > wow > cyborg-mmo7
comparison OptionPage.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 | d186f8cd5000 |
children | 80192bc4a108 |
comparison
equal
deleted
inserted
replaced
12:72b92b3e476e | 13:6cb9a2936580 |
---|---|
53 <Scripts> | 53 <Scripts> |
54 <OnLoad> | 54 <OnLoad> |
55 self:RegisterEvent("VARIABLES_LOADED") | 55 self:RegisterEvent("VARIABLES_LOADED") |
56 </OnLoad> | 56 </OnLoad> |
57 <OnEvent> | 57 <OnEvent> |
58 if(event == "VARIABLES_LOADED") then | 58 if event == "VARIABLES_LOADED" then |
59 CyborgMMO_GetBindingButtonText(self:GetName()); | 59 CyborgMMO_GetBindingButtonText(self:GetName()) |
60 end | 60 end |
61 </OnEvent> | 61 </OnEvent> |
62 <OnClick> | 62 <OnClick> |
63 CyborgMMO_BindButton(self:GetName()) | 63 CyborgMMO_BindButton(self:GetName()) |
64 </OnClick> | 64 </OnClick> |
134 </Anchors> | 134 </Anchors> |
135 </Button> | 135 </Button> |
136 </Frames> | 136 </Frames> |
137 <Scripts> | 137 <Scripts> |
138 <OnLoad> | 138 <OnLoad> |
139 CyborgMMO_LoadStrings(getglobal(self:GetName().."Name")); | 139 CyborgMMO_LoadStrings(getglobal(self:GetName().."Name")) |
140 </OnLoad> | 140 </OnLoad> |
141 </Scripts> | 141 </Scripts> |
142 </Frame> | 142 </Frame> |
143 | 143 |
144 <!--Custom keybinds --> | 144 <!--Custom keybinds --> |
344 </FontString> | 344 </FontString> |
345 </Layer> | 345 </Layer> |
346 </Layers> | 346 </Layers> |
347 <Scripts> | 347 <Scripts> |
348 <OnLoad> | 348 <OnLoad> |
349 CyborgMMO_LoadStrings(getglobal(self:GetName().."Title")); | 349 CyborgMMO_LoadStrings(getglobal(self:GetName().."Title")) |
350 </OnLoad> | 350 </OnLoad> |
351 <OnClick> | 351 <OnClick> |
352 if(self:GetChecked() == 1) then | 352 if self:GetChecked() == 1 then |
353 CyborgMMO_SetMiniMapButton(true) | 353 CyborgMMO_SetMiniMapButton(true) |
354 else | 354 else |
355 CyborgMMO_SetMiniMapButton(false) | 355 CyborgMMO_SetMiniMapButton(false) |
356 end | 356 end |
357 </OnClick> | 357 </OnClick> |
383 </FontString> | 383 </FontString> |
384 </Layer> | 384 </Layer> |
385 </Layers> | 385 </Layers> |
386 <Scripts> | 386 <Scripts> |
387 <OnLoad> | 387 <OnLoad> |
388 CyborgMMO_LoadStrings(getglobal(self:GetName().."Title")); | 388 CyborgMMO_LoadStrings(getglobal(self:GetName().."Title")) |
389 </OnLoad> | 389 </OnLoad> |
390 <OnClick> | 390 <OnClick> |
391 if(self:GetChecked() == 1) then | 391 if self:GetChecked() == 1 then |
392 CyborgMMO_SetCyborgHeadButton(true) | 392 CyborgMMO_SetCyborgHeadButton(true) |
393 else | 393 else |
394 CyborgMMO_SetCyborgHeadButton(false) | 394 CyborgMMO_SetCyborgHeadButton(false) |
395 end | 395 end |
396 </OnClick> | 396 </OnClick> |
408 </Offset> | 408 </Offset> |
409 </Anchor> | 409 </Anchor> |
410 </Anchors> | 410 </Anchors> |
411 <Scripts> | 411 <Scripts> |
412 <OnLoad> | 412 <OnLoad> |
413 CyborgMMO_LoadStrings(getglobal(self:GetName())); | 413 CyborgMMO_LoadStrings(getglobal(self:GetName())) |
414 </OnLoad> | 414 </OnLoad> |
415 <OnClick> | 415 <OnClick> |
416 CyborgMMO_SetDefaultSettings(); | 416 CyborgMMO_SetDefaultSettings() |
417 </OnClick> | 417 </OnClick> |
418 </Scripts> | 418 </Scripts> |
419 </Button> | 419 </Button> |
420 | 420 |
421 <Frame name="$parentRebind" inherits="CyborgMMO_MouseRebind"> | 421 <Frame name="$parentRebind" inherits="CyborgMMO_MouseRebind"> |
558 <AbsDimension x="32" y="32" /> | 558 <AbsDimension x="32" y="32" /> |
559 </Size> | 559 </Size> |
560 </ThumbTexture> | 560 </ThumbTexture> |
561 <Scripts> | 561 <Scripts> |
562 <OnLoad> | 562 <OnLoad> |
563 CyborgMMO_LoadStrings(getglobal(self:GetName().."Title")); | 563 CyborgMMO_LoadStrings(getglobal(self:GetName().."Title")) |
564 </OnLoad> | 564 </OnLoad> |
565 <OnValueChanged> | 565 <OnValueChanged> |
566 CyborgMMO_SetMainPageSize(self:GetValue()) | 566 CyborgMMO_SetMainPageSize(self:GetValue()) |
567 </OnValueChanged> | 567 </OnValueChanged> |
568 </Scripts> | 568 </Scripts> |
571 </Frame> | 571 </Frame> |
572 </Frames> | 572 </Frames> |
573 | 573 |
574 <Scripts> | 574 <Scripts> |
575 <OnLoad> | 575 <OnLoad> |
576 CyborgMMO_LoadStrings(getglobal(self:GetName().."Title")); | 576 CyborgMMO_LoadStrings(getglobal(self:GetName().."Title")) |
577 msg("Loaded Option Page"); | 577 msg("Loaded Option Page") |
578 self = CyborgMMO_OptionView.new(self); | 578 self = CyborgMMO_OptionView.new(self) |
579 </OnLoad> | 579 </OnLoad> |
580 </Scripts> | 580 </Scripts> |
581 </Frame> | 581 </Frame> |
582 | 582 |
583 <Button name="CyborgMMO_BindingFrame" toplevel="true" parent="UIParent" frameStrata="DIALOG" movable="true" enableMouse="true" hidden="true" enableKeyboard="true"> | 583 <Button name="CyborgMMO_BindingFrame" toplevel="true" parent="UIParent" frameStrata="DIALOG" movable="true" enableMouse="true" hidden="true" enableKeyboard="true"> |
669 </Offset> | 669 </Offset> |
670 </Anchor> | 670 </Anchor> |
671 </Anchors> | 671 </Anchors> |
672 <Scripts> | 672 <Scripts> |
673 <OnClick> | 673 <OnClick> |
674 HideUIPanel(self:GetParent()); | 674 HideUIPanel(self:GetParent()) |
675 </OnClick> | 675 </OnClick> |
676 </Scripts> | 676 </Scripts> |
677 </Button> | 677 </Button> |
678 </Frames> | 678 </Frames> |
679 | 679 |
680 <Scripts> | 680 <Scripts> |
681 <OnLoad> | 681 <OnLoad> |
682 CyborgMMO_LoadStrings(getglobal(self:GetName().."HeaderText")) | 682 CyborgMMO_LoadStrings(getglobal(self:GetName().."HeaderText")) |
683 CyborgMMO_LoadStrings(getglobal(self:GetName().."ExitButton")) | 683 CyborgMMO_LoadStrings(getglobal(self:GetName().."ExitButton")) |
684 self:RegisterForClicks("AnyUp"); | 684 self:RegisterForClicks("AnyUp") |
685 </OnLoad> | 685 </OnLoad> |
686 <OnClick> | 686 <OnClick> |
687 CyborgMMO_BindingFrameOnKeyDown(self, button); | 687 CyborgMMO_BindingFrameOnKeyDown(self, button) |
688 </OnClick> | 688 </OnClick> |
689 <OnKeyDown> | 689 <OnKeyDown> |
690 CyborgMMO_BindingFrameOnKeyDown(self, key); | 690 CyborgMMO_BindingFrameOnKeyDown(self, key) |
691 </OnKeyDown> | 691 </OnKeyDown> |
692 <OnMouseWheel> | 692 <OnMouseWheel> |
693 if (delta > 0) then | 693 if delta > 0 then |
694 CyborgMMO_BindingFrameOnKeyDown(self, "MOUSEWHEELUP"); | 694 CyborgMMO_BindingFrameOnKeyDown(self, "MOUSEWHEELUP") |
695 else | 695 else |
696 CyborgMMO_BindingFrameOnKeyDown(self, "MOUSEWHEELDOWN"); | 696 CyborgMMO_BindingFrameOnKeyDown(self, "MOUSEWHEELDOWN") |
697 end | 697 end |
698 </OnMouseWheel> | 698 </OnMouseWheel> |
699 </Scripts> | 699 </Scripts> |
700 </Button> | 700 </Button> |
701 </Ui> | 701 </Ui> |