Mercurial > wow > cyborg-mmo7
comparison CyborgMMO7.lua @ 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 | da9c4373da48 |
| children | 80192bc4a108 |
comparison
equal
deleted
inserted
replaced
| 12:72b92b3e476e | 13:6cb9a2936580 |
|---|---|
| 1 --~ Warcraft Plugin for Cyborg MMO7 | 1 --~ Warcraft Plugin for Cyborg MMO7 |
| 2 --~ Filename: CyborgMMO7.lua | 2 --~ Filename: CyborgMMO7.lua |
| 3 --~ Description: Plugin entry point, String tables and other generic crap that I could not think to put anywhere else. | 3 --~ Description: Plugin entry point, String tables and other generic crap that I could not think to put anywhere else. |
| 4 --~ Copyright (C) 2012 Mad Catz Inc. | 4 --~ Copyright (C) 2012 Mad Catz Inc. |
| 5 --~ Author: Christopher Hooks | 5 --~ Author: Christopher Hooks |
| 6 | 6 |
| 16 | 16 |
| 17 --~ You should have received a copy of the GNU General Public License | 17 --~ You should have received a copy of the GNU General Public License |
| 18 --~ along with this program; if not, write to the Free Software | 18 --~ along with this program; if not, write to the Free Software |
| 19 --~ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 19 --~ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 20 | 20 |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 function CyborgMMO_LoadStrings(self) | 21 function CyborgMMO_LoadStrings(self) |
| 26 --~ msg("LoadStrings("..self:GetName()..") = "..CyborgMMO_StringTable[self:GetName()]) | 22 --~ msg("LoadStrings("..self:GetName()..") = "..CyborgMMO_StringTable[self:GetName()]) |
| 27 self:SetText(CyborgMMO_StringTable[self:GetName()]); | 23 self:SetText(CyborgMMO_StringTable[self:GetName()]) |
| 28 end | 24 end |
| 29 | 25 |
| 30 local CyborgMMO_VarsLoaded = false; | 26 local CyborgMMO_VarsLoaded = false |
| 31 local CyborgMMO_EnteredWorld = false; | 27 local CyborgMMO_EnteredWorld = false |
| 32 local CyborgMMO_LoadBinding = false; | 28 local CyborgMMO_LoadBinding = false |
| 33 local CyborgMMO_SaveName = GetRealmName().."_"..UnitName("player"); | 29 local CyborgMMO_SaveName = GetRealmName().."_"..UnitName("player") |
| 34 local CyborgMMO_Settings = nil; | 30 local CyborgMMO_Settings = nil |
| 35 | 31 |
| 36 | 32 |
| 37 function CyborgMMO_MiniMapButtonReposition(pos) | 33 function CyborgMMO_MiniMapButtonReposition(pos) |
| 38 CyborgMMO_MiniMapFrame:SetPoint("TOPLEFT", | 34 CyborgMMO_MiniMapFrame:SetPoint("TOPLEFT", |
| 39 "Minimap", | 35 "Minimap", |
| 40 "TOPLEFT", | 36 "TOPLEFT", |
| 41 52-(80*cos(pos)), | 37 52 - (80 * cos(pos)), |
| 42 (80*sin(pos))-52) | 38 (80 * sin(pos)) - 52) |
| 43 end | 39 end |
| 44 | 40 |
| 45 | 41 |
| 46 function CyborgMMO_MiniMapButtonOnUpdate() | 42 function CyborgMMO_MiniMapButtonOnUpdate() |
| 47 | 43 |
| 49 local xmin,ymin = Minimap:GetLeft(), Minimap:GetBottom() | 45 local xmin,ymin = Minimap:GetLeft(), Minimap:GetBottom() |
| 50 | 46 |
| 51 xpos = (xmin)-(xpos / UIParent:GetScale()) | 47 xpos = (xmin)-(xpos / UIParent:GetScale()) |
| 52 ypos = (ypos/ UIParent:GetScale())-(ymin) | 48 ypos = (ypos/ UIParent:GetScale())-(ymin) |
| 53 | 49 |
| 54 local degrees = math.deg(math.atan2(ypos,xpos)); | 50 local degrees = math.deg(math.atan2(ypos, xpos)) |
| 55 | 51 |
| 56 while(degrees < 0) do | 52 while degrees < 0 do |
| 57 degrees = degrees + 360; | 53 degrees = degrees + 360 |
| 58 end | 54 end |
| 59 | |
| 60 | 55 |
| 61 CyborgMMO_MiniMapButtonReposition(degrees) | 56 CyborgMMO_MiniMapButtonReposition(degrees) |
| 62 end | 57 end |
| 63 | 58 |
| 64 function CyborgMMO_MouseModeChange(mode) | 59 function CyborgMMO_MouseModeChange(mode) |
| 65 local MiniMapTexture = getglobal("CyborgMMO_MiniMapFrameButton_Icon") | 60 local MiniMapTexture = getglobal("CyborgMMO_MiniMapFrameButton_Icon") |
| 66 local MiniMapGlowTexture = getglobal("CyborgMMO_MiniMapFrameButton_IconGlow") | 61 local MiniMapGlowTexture = getglobal("CyborgMMO_MiniMapFrameButton_IconGlow") |
| 67 local OpenButtonTexture = getglobal("CyborgMMO_OpenButtonPage".."OpenMainForm"):GetNormalTexture(); | 62 local OpenButtonTexture = getglobal("CyborgMMO_OpenButtonPage".."OpenMainForm"):GetNormalTexture() |
| 68 local OpenButtonGlowTexture = getglobal("CyborgMMO_OpenButtonPage".."OpenMainForm"):GetHighlightTexture(); | 63 local OpenButtonGlowTexture = getglobal("CyborgMMO_OpenButtonPage".."OpenMainForm"):GetHighlightTexture() |
| 69 if(1==mode) then | 64 if mode == 1 then |
| 70 MiniMapTexture:SetVertexColor(1,0,0,1) | 65 MiniMapTexture:SetVertexColor(1,0,0,1) |
| 71 --MiniMapGlowTexture:SetVertexColor(1,0.26,0.26,.75); | 66 -- MiniMapGlowTexture:SetVertexColor(1,0.26,0.26,.75) |
| 72 OpenButtonTexture:SetVertexColor(1,0,0,0.75); | 67 OpenButtonTexture:SetVertexColor(1,0,0,0.75) |
| 73 --OpenButtonGlowTexture:SetVertexColor(1,0.26,0.26,0.50); | 68 -- OpenButtonGlowTexture:SetVertexColor(1,0.26,0.26,0.50) |
| 74 elseif(2==mode) then | 69 elseif mode == 2 then |
| 75 MiniMapTexture:SetVertexColor(0.07,0.22,1,1) | 70 MiniMapTexture:SetVertexColor(0.07,0.22,1,1) |
| 76 MiniMapGlowTexture:SetVertexColor(0.13,0.56,1,.75); | 71 MiniMapGlowTexture:SetVertexColor(0.13,0.56,1,.75) |
| 77 OpenButtonTexture:SetVertexColor(0.07,0.22,1,0.75); | 72 OpenButtonTexture:SetVertexColor(0.07,0.22,1,0.75) |
| 78 OpenButtonGlowTexture:SetVertexColor(0.13,0.56,1,0.5); | 73 OpenButtonGlowTexture:SetVertexColor(0.13,0.56,1,0.5) |
| 79 elseif(3==mode) then | 74 elseif mode == 3 then |
| 80 MiniMapTexture:SetVertexColor(0.52,0.08,0.89,1) | 75 MiniMapTexture:SetVertexColor(0.52,0.08,0.89,1) |
| 81 MiniMapGlowTexture:SetVertexColor(0.67,0.31,0.85,.75); | 76 MiniMapGlowTexture:SetVertexColor(0.67,0.31,0.85,.75) |
| 82 OpenButtonTexture:SetVertexColor(0.52,0.08,0.89,0.75); | 77 OpenButtonTexture:SetVertexColor(0.52,0.08,0.89,0.75) |
| 83 OpenButtonGlowTexture:SetVertexColor(0.67,0.31,0.85,0.5); | 78 OpenButtonGlowTexture:SetVertexColor(0.67,0.31,0.85,0.5) |
| 84 end | 79 end |
| 85 end | 80 end |
| 86 | 81 |
| 87 function CyborgMMO_LoadWowCommands() | 82 function CyborgMMO_LoadWowCommands() |
| 88 if (CyborgMMO_ProfileKeyBindings == nil) then | 83 if not CyborgMMO_ProfileKeyBindings then |
| 89 CyborgMMO_ProfileKeyBindings = {} | |
| 90 CyborgMMO_ProfileKeyBindings = CyborgMMO_DefaultWowCommands | 84 CyborgMMO_ProfileKeyBindings = CyborgMMO_DefaultWowCommands |
| 91 end | 85 end |
| 92 CyborgMMO_WowCommands = CyborgMMO_ProfileKeyBindings | 86 CyborgMMO_WowCommands = CyborgMMO_ProfileKeyBindings |
| 93 end | 87 end |
| 94 | 88 |
| 95 function CyborgMMO_GetSaveData() | 89 function CyborgMMO_GetSaveData() |
| 96 if(CyborgMMO_VarsLoaded) then | 90 if CyborgMMO_VarsLoaded then |
| 97 if (CyborgMMO7SaveData == nil) then | 91 if not CyborgMMO7SaveData then |
| 98 CyborgMMO7SaveData = {}; | 92 CyborgMMO7SaveData = {} |
| 99 CyborgMMO7SaveData[CyborgMMO_SaveName] = {} | 93 CyborgMMO7SaveData[CyborgMMO_SaveName] = {} |
| 100 end | 94 end |
| 101 CyborgMMO_LoadWowCommands() | 95 CyborgMMO_LoadWowCommands() |
| 102 return CyborgMMO7SaveData[CyborgMMO_SaveName]; | 96 return CyborgMMO7SaveData[CyborgMMO_SaveName] |
| 103 end | 97 end |
| 104 return nil; | 98 return nil |
| 105 end | 99 end |
| 106 | 100 |
| 107 function CyborgMMO_SetSaveData(data, index) | 101 function CyborgMMO_SetSaveData(data, index) |
| 108 if(CyborgMMO_VarsLoaded) then | 102 if CyborgMMO_VarsLoaded then |
| 109 CyborgMMO_GetSaveData()[index] = data | 103 CyborgMMO_GetSaveData()[index] = data |
| 110 CyborgMMO_ProfileKeyBindings = CyborgMMO_WowCommands | 104 CyborgMMO_ProfileKeyBindings = CyborgMMO_WowCommands |
| 111 end | 105 end |
| 112 end | 106 end |
| 113 | 107 |
| 114 function CyborgMMO_Event(self, event, ...) | 108 function CyborgMMO_Event(self, event, ...) |
| 115 if(event == "VARIABLES_LOADED") then | 109 if event == "VARIABLES_LOADED" then |
| 116 CyborgMMO_VarsLoaded = true; | 110 CyborgMMO_VarsLoaded = true |
| 117 elseif(event == "PLAYER_ENTERING_WORLD") then | 111 elseif event == "PLAYER_ENTERING_WORLD" then |
| 118 CyborgMMO_EnteredWorld = true; | 112 CyborgMMO_EnteredWorld = true |
| 119 elseif(event == "PLAYER_ENTER_COMBAT") then | 113 elseif event == "PLAYER_ENTER_COMBAT" then |
| 120 msg("PLAYER_ENTER_COMBAT"); | 114 msg("PLAYER_ENTER_COMBAT") |
| 121 CyborgMMO_Close(); | 115 CyborgMMO_Close() |
| 122 elseif(event == nil) then | 116 else |
| 123 msg("Event is nil"); | 117 msg("Event is "..tostring(event)) |
| 124 else | 118 end |
| 125 msg("Event is " + event); | |
| 126 end | |
| 127 | |
| 128 | 119 |
| 129 -- Fire Loading if and only if the player is in the world and vars are loaded | 120 -- Fire Loading if and only if the player is in the world and vars are loaded |
| 130 if(false == CyborgMMO_LoadBinding) then | 121 if not CyborgMMO_LoadBinding then |
| 131 if(CyborgMMO_VarsLoaded) then | 122 if CyborgMMO_VarsLoaded then |
| 132 if(CyborgMMO_EnteredWorld) then | 123 if CyborgMMO_EnteredWorld then |
| 133 local data = CyborgMMO_GetSaveData() | 124 local data = CyborgMMO_GetSaveData() |
| 134 | 125 |
| 135 CyborgMMO_RatPageModel.Instance().LoadData(); | 126 CyborgMMO_RatPageModel.Instance().LoadData() |
| 136 CyborgMMO_LoadBinding = true; | 127 CyborgMMO_LoadBinding = true |
| 137 | 128 |
| 138 ShowMacroFrame(); | 129 ShowMacroFrame() |
| 139 HideUIPanel(MacroFrame); | 130 HideUIPanel(MacroFrame) |
| 140 | 131 |
| 141 | 132 |
| 142 CyborgMMO_SetupModeCallbacks(1); | 133 CyborgMMO_SetupModeCallbacks(1) |
| 143 CyborgMMO_SetupModeCallbacks(2); | 134 CyborgMMO_SetupModeCallbacks(2) |
| 144 CyborgMMO_SetupModeCallbacks(3); | 135 CyborgMMO_SetupModeCallbacks(3) |
| 145 | 136 |
| 146 | 137 |
| 147 --Reload Slider values: | 138 --Reload Slider values: |
| 148 if(nil == data["Settings"]) then | 139 if not data["Settings"] then |
| 149 data["Settings"] = {} | 140 data["Settings"] = {} |
| 150 data["Settings"]["Cyborg"] = 0.75; | 141 data["Settings"]["Cyborg"] = 0.75 |
| 151 data["Settings"]["Plugin"] = 0.75; | 142 data["Settings"]["Plugin"] = 0.75 |
| 152 data["Settings"]["MiniMapButton"] = true; | 143 data["Settings"]["MiniMapButton"] = true |
| 153 data["Settings"]["CyborgButton"] = true; | 144 data["Settings"]["CyborgButton"] = true |
| 154 end | 145 end |
| 155 | 146 |
| 156 CyborgMMO_Settings = data["Settings"]; | 147 CyborgMMO_Settings = data["Settings"] |
| 157 | 148 |
| 158 CyborgMMO_OptionPageCyborgSizeSlider:SetValue(CyborgMMO_Settings["Cyborg"]); | 149 CyborgMMO_OptionPageCyborgSizeSlider:SetValue(CyborgMMO_Settings["Cyborg"]) |
| 159 CyborgMMO_SetOpenButtonSize(CyborgMMO_Settings["Cyborg"]) | 150 CyborgMMO_SetOpenButtonSize(CyborgMMO_Settings["Cyborg"]) |
| 160 CyborgMMO_OptionPagePluginSizeSlider:SetValue(CyborgMMO_Settings["Plugin"]); | 151 CyborgMMO_OptionPagePluginSizeSlider:SetValue(CyborgMMO_Settings["Plugin"]) |
| 161 CyborgMMO_SetMainPageSize(CyborgMMO_Settings["Plugin"]); | 152 CyborgMMO_SetMainPageSize(CyborgMMO_Settings["Plugin"]) |
| 162 | 153 |
| 163 CyborgMMO_SetMiniMapButton(CyborgMMO_Settings["MiniMapButton"]) | 154 CyborgMMO_SetMiniMapButton(CyborgMMO_Settings["MiniMapButton"]) |
| 164 CyborgMMO_SetCyborgHeadButton(CyborgMMO_Settings["CyborgButton"]) | 155 CyborgMMO_SetCyborgHeadButton(CyborgMMO_Settings["CyborgButton"]) |
| 165 | 156 |
| 166 local xmin,ymin = Minimap:GetLeft(), Minimap:GetBottom() | 157 local xmin,ymin = Minimap:GetLeft(),Minimap:GetBottom() |
| 167 CyborgMMO_MiniMapButtonReposition(math.deg(math.atan2(ymin,xmin))) | 158 CyborgMMO_MiniMapButtonReposition(math.deg(math.atan2(ymin, xmin))) |
| 168 -- Close the main window for now | 159 -- Close the main window for now |
| 169 CyborgMMO_Close(); | 160 CyborgMMO_Close() |
| 170 end | 161 end |
| 171 end | 162 end |
| 172 end | 163 end |
| 173 end | 164 end |
| 174 | 165 |
| 175 function CyborgMMO_SetDefaultSettings() | 166 function CyborgMMO_SetDefaultSettings() |
| 176 CyborgMMO_OpenButtonPageOpenMainForm:ClearAllPoints(); | 167 CyborgMMO_OpenButtonPageOpenMainForm:ClearAllPoints() |
| 177 CyborgMMO_MainPage:ClearAllPoints(); | 168 CyborgMMO_MainPage:ClearAllPoints() |
| 178 CyborgMMO_OpenButtonPageOpenMainForm:SetPoint("LEFT", UIParent, "LEFT", 0, 0); | 169 CyborgMMO_OpenButtonPageOpenMainForm:SetPoint("LEFT", UIParent, "LEFT", 0, 0) |
| 179 CyborgMMO_MainPage:SetPoint("LEFT", UIParent, "LEFT", 0, 0); | 170 CyborgMMO_MainPage:SetPoint("LEFT", UIParent, "LEFT", 0, 0) |
| 180 | 171 |
| 181 CyborgMMO_SetOpenButtonSize(0.75); | 172 CyborgMMO_SetOpenButtonSize(0.75) |
| 182 CyborgMMO_SetMainPageSize(0.75); | 173 CyborgMMO_SetMainPageSize(0.75) |
| 183 CyborgMMO_SetMiniMapButton(true); | 174 CyborgMMO_SetMiniMapButton(true) |
| 184 CyborgMMO_SetCyborgHeadButton(true); | 175 CyborgMMO_SetCyborgHeadButton(true) |
| 185 end | 176 end |
| 186 | 177 |
| 187 | 178 |
| 188 function CyborgMMO_SetupModeCallbacks(modeNum) | 179 function CyborgMMO_SetupModeCallbacks(modeNum) |
| 189 fn = function() | 180 fn = function() |
| 190 CyborgMMO_MouseModeChange(modeNum); | 181 CyborgMMO_MouseModeChange(modeNum) |
| 191 CyborgMMO_RatPageModel.Instance().SetMode(modeNum) | 182 CyborgMMO_RatPageModel.Instance().SetMode(modeNum) |
| 192 end | 183 end |
| 193 | 184 |
| 194 local buttonFrame, parentFrame, name = CyborgMMO_CallbackFactory.Instance().AddCallback(fn); | 185 local buttonFrame,parentFrame,name = CyborgMMO_CallbackFactory.Instance().AddCallback(fn) |
| 195 if(1 ~= SetOverrideBindingClick(parentFrame, true, CyborgMMO_Mode[modeNum], name, "LeftButton")) then | 186 local result = SetOverrideBindingClick(parentFrame, true, CyborgMMO_Mode[modeNum], name, "LeftButton") |
| 196 msg("Failed to Bind modeChange"); | 187 if result ~= 1 then |
| 188 msg("Failed to Bind modeChange") | |
| 197 end | 189 end |
| 198 end | 190 end |
| 199 | 191 |
| 200 function CyborgMMO_Loaded() | 192 function CyborgMMO_Loaded() |
| 201 CyborgMMO_MainPage:RegisterEvent("VARIABLES_LOADED"); | 193 CyborgMMO_MainPage:RegisterEvent("VARIABLES_LOADED") |
| 202 CyborgMMO_MainPage:RegisterEvent("PLAYER_ENTERING_WORLD"); | 194 CyborgMMO_MainPage:RegisterEvent("PLAYER_ENTERING_WORLD") |
| 203 CyborgMMO_MainPage:RegisterEvent("PLAYER_ENTER_COMBAT"); | 195 CyborgMMO_MainPage:RegisterEvent("PLAYER_ENTER_COMBAT") |
| 204 end | 196 end |
| 205 | 197 |
| 206 function CyborgMMO_Close() | 198 function CyborgMMO_Close() |
| 207 CyborgMMO_MainPage:Hide(); | 199 CyborgMMO_MainPage:Hide() |
| 208 if(CyborgMMO_Settings["CyborgButton"] == true) then | 200 if CyborgMMO_Settings["CyborgButton"] then |
| 209 CyborgMMO_OpenButtonPage:Show(); | 201 CyborgMMO_OpenButtonPage:Show() |
| 210 end | 202 end |
| 211 end | 203 end |
| 212 | 204 |
| 213 function CyborgMMO_Open() | 205 function CyborgMMO_Open() |
| 214 CyborgMMO_MainPage:Show(); | 206 CyborgMMO_MainPage:Show() |
| 215 CyborgMMO_RatQuickPage:Hide(); | 207 CyborgMMO_RatQuickPage:Hide() |
| 216 if(CyborgMMO_Settings["CyborgButton"] == true) then | 208 if CyborgMMO_Settings["CyborgButton"] then |
| 217 CyborgMMO_OpenButtonPage:Show(); | 209 CyborgMMO_OpenButtonPage:Show() |
| 218 end | 210 end |
| 219 end | 211 end |
| 220 | 212 |
| 221 function CyborgMMO_IsOpen() | 213 function CyborgMMO_IsOpen() |
| 222 if(CyborgMMO_MainPage:IsVisible() == 1) then | 214 if CyborgMMO_MainPage:IsVisible() == 1 then |
| 223 return true; | 215 return true |
| 224 else | 216 else |
| 225 return false; | 217 return false |
| 226 end | 218 end |
| 227 end | 219 end |
| 228 | 220 |
| 229 function CyborgMMO_Toggle() | 221 function CyborgMMO_Toggle() |
| 230 if(CyborgMMO_IsOpen()) then | 222 if CyborgMMO_IsOpen() then |
| 231 CyborgMMO_Close(); | 223 CyborgMMO_Close() |
| 232 else | 224 else |
| 233 CyborgMMO_Open(); | 225 CyborgMMO_Open() |
| 234 end | 226 end |
| 235 end | 227 end |
| 236 | 228 |
| 237 function msg(m) | 229 function msg(m) |
| 238 local id, name = GetChannelName("Debug"); | 230 local id,name = GetChannelName("Debug") |
| 239 SendChatMessage(m, "CHANNEL", nil, id); | 231 SendChatMessage(m, "CHANNEL", nil, id) |
| 240 end | 232 end |
| 241 | 233 |
| 242 function CyborgMMO_SetMainPageSize(percent) | 234 function CyborgMMO_SetMainPageSize(percent) |
| 243 if(CyborgMMO_VarsLoaded) then | 235 if CyborgMMO_VarsLoaded then |
| 244 if(CyborgMMO_EnteredWorld) then | 236 if CyborgMMO_EnteredWorld then |
| 245 CyborgMMO_MainPage:SetScale(percent); | 237 CyborgMMO_MainPage:SetScale(percent) |
| 246 CyborgMMO_Settings["Plugin"] = percent; | 238 CyborgMMO_Settings["Plugin"] = percent |
| 247 local data = CyborgMMO_GetSaveData() | 239 local data = CyborgMMO_GetSaveData() |
| 248 data["Settings"] = CyborgMMO_Settings | 240 data["Settings"] = CyborgMMO_Settings |
| 249 CyborgMMO_OptionPagePluginSizeSlider:SetValue(percent); | 241 CyborgMMO_OptionPagePluginSizeSlider:SetValue(percent) |
| 250 end | 242 end |
| 251 end | 243 end |
| 252 end | 244 end |
| 253 | 245 |
| 254 function CyborgMMO_SetOpenButtonSize(percent) | 246 function CyborgMMO_SetOpenButtonSize(percent) |
| 255 if(CyborgMMO_VarsLoaded) then | 247 if CyborgMMO_VarsLoaded then |
| 256 if(CyborgMMO_EnteredWorld) then | 248 if CyborgMMO_EnteredWorld then |
| 257 CyborgMMO_OpenButtonPage:SetScale(percent) | 249 CyborgMMO_OpenButtonPage:SetScale(percent) |
| 258 CyborgMMO_Settings["Cyborg"] = percent; | 250 CyborgMMO_Settings["Cyborg"] = percent |
| 259 local data = CyborgMMO_GetSaveData() | 251 local data = CyborgMMO_GetSaveData() |
| 260 data["Settings"] = CyborgMMO_Settings | 252 data["Settings"] = CyborgMMO_Settings |
| 261 CyborgMMO_OptionPageCyborgSizeSlider:SetValue(percent); | 253 CyborgMMO_OptionPageCyborgSizeSlider:SetValue(percent) |
| 262 end | 254 end |
| 263 end | 255 end |
| 264 end | 256 end |
| 265 | 257 |
| 266 function CyborgMMO_SetCyborgHeadButton(boolVal) | 258 function CyborgMMO_SetCyborgHeadButton(boolVal) |
| 267 CyborgMMO_Settings["CyborgButton"] = boolVal; | 259 CyborgMMO_Settings["CyborgButton"] = boolVal |
| 268 CyborgMMO_OptionPageCyborgButton:SetChecked(boolVal); | 260 CyborgMMO_OptionPageCyborgButton:SetChecked(boolVal) |
| 269 if(CyborgMMO_Settings["CyborgButton"] == true) then | 261 if CyborgMMO_Settings["CyborgButton"] then |
| 270 CyborgMMO_Close(); | 262 CyborgMMO_Close() |
| 271 else | 263 else |
| 272 CyborgMMO_OpenButtonPage:Hide(); | 264 CyborgMMO_OpenButtonPage:Hide() |
| 273 end | 265 end |
| 274 local data = CyborgMMO_GetSaveData() | 266 local data = CyborgMMO_GetSaveData() |
| 275 data["Settings"] = CyborgMMO_Settings | 267 data["Settings"] = CyborgMMO_Settings |
| 276 end | 268 end |
| 277 | 269 |
| 278 function CyborgMMO_SetMiniMapButton(boolVal) | 270 function CyborgMMO_SetMiniMapButton(boolVal) |
| 279 CyborgMMO_Settings["MiniMapButton"] = boolVal | 271 CyborgMMO_Settings["MiniMapButton"] = boolVal |
| 280 CyborgMMO_Settings["MiniMapButton"] = boolVal | |
| 281 CyborgMMO_OptionPageMiniMapButton:SetChecked(boolVal) | 272 CyborgMMO_OptionPageMiniMapButton:SetChecked(boolVal) |
| 282 if(CyborgMMO_Settings["MiniMapButton"] == true) then | 273 if CyborgMMO_Settings["MiniMapButton"] then |
| 283 CyborgMMO_MiniMapFrameButton:Show() | 274 CyborgMMO_MiniMapFrameButton:Show() |
| 284 else | 275 else |
| 285 CyborgMMO_MiniMapFrameButton:Hide() | 276 CyborgMMO_MiniMapFrameButton:Hide() |
| 286 end | 277 end |
| 287 local data = CyborgMMO_GetSaveData() | 278 local data = CyborgMMO_GetSaveData() |
