Browse Source

Get rid of trailing whitespace.

Commit generated by command:

find -type f ! -path '*.git*' ! -path '*.png' ! -path '*.ico' ! -path \
    '*.ogg' | xargs -I '{}' sed -i '{}' -e 's/\t*$//g' -e 's/ *$//g'
Jacek Wielemborek 7 years ago
parent
commit
e6c9e78935
55 changed files with 341 additions and 341 deletions
  1. 3
    3
      data/locales/es.lua
  2. 2
    2
      data/styles/30-minimap.otui
  3. 3
    3
      modules/client/client.lua
  4. 1
    1
      modules/client_entergame/characterlist.lua
  5. 1
    1
      modules/client_entergame/characterlist.otui
  6. 1
    1
      modules/client_entergame/entergame.lua
  7. 2
    2
      modules/client_options/graphics.otui
  8. 1
    1
      modules/client_serverlist/serverlist.lua
  9. 3
    3
      modules/client_terminal/terminal.lua
  10. 3
    3
      modules/corelib/table.lua
  11. 1
    1
      modules/corelib/ui/uiminiwindow.lua
  12. 5
    5
      modules/corelib/ui/uimovabletabbar.lua
  13. 1
    1
      modules/corelib/ui/uiradiogroup.lua
  14. 18
    18
      modules/game_battle/battle.lua
  15. 3
    3
      modules/game_battle/battle.otui
  16. 11
    11
      modules/game_combatcontrols/combatcontrols.lua
  17. 2
    2
      modules/game_combatcontrols/combatcontrols.otui
  18. 17
    17
      modules/game_console/communicationwindow.otui
  19. 25
    25
      modules/game_console/console.lua
  20. 1
    1
      modules/game_console/console.otui
  21. 6
    6
      modules/game_cooldown/cooldown.lua
  22. 4
    4
      modules/game_cooldown/cooldown.otui
  23. 1
    1
      modules/game_healthinfo/healthinfo.otui
  24. 5
    5
      modules/game_hotkeys/hotkeys_manager.lua
  25. 4
    4
      modules/game_interface/gameinterface.lua
  26. 5
    5
      modules/game_interface/widgets/uigamemap.lua
  27. 7
    7
      modules/game_market/market.lua
  28. 3
    3
      modules/game_minimap/flagwindow.otui
  29. 6
    6
      modules/game_modaldialog/modaldialog.lua
  30. 3
    3
      modules/game_npctrade/npctrade.lua
  31. 1
    1
      modules/game_outfit/outfit.lua
  32. 1
    1
      modules/game_skills/skills.lua
  33. 39
    39
      modules/game_spelllist/spelllist.lua
  34. 1
    1
      modules/game_viplist/editvip.otui
  35. 9
    9
      modules/game_viplist/viplist.lua
  36. 1
    1
      modules/gamelib/game.lua
  37. 1
    1
      modules/gamelib/gamelib.otmod
  38. 1
    1
      modules/gamelib/player.lua
  39. 3
    3
      modules/gamelib/protocollogin.lua
  40. 77
    77
      modules/gamelib/spells.lua
  41. 4
    4
      modules/gamelib/ui/uicreaturebutton.lua
  42. 6
    6
      modules/gamelib/ui/uiminimap.lua
  43. 1
    1
      src/client/houses.h
  44. 1
    1
      src/client/mapview.cpp
  45. 1
    1
      src/client/minimap.cpp
  46. 2
    2
      src/client/tile.cpp
  47. 1
    1
      src/client/uiminimap.cpp
  48. 1
    1
      src/framework/CMakeLists.txt
  49. 9
    9
      src/framework/cmake/FindDirectX.cmake
  50. 1
    1
      src/framework/cmake/FindPkgMacros.cmake
  51. 1
    1
      src/framework/platform/win32platform.cpp
  52. 3
    3
      src/framework/sound/soundmanager.cpp
  53. 1
    1
      src/framework/stdext/shared_object.h
  54. 2
    2
      src/framework/stdext/shared_ptr.h
  55. 25
    25
      tools/tfs_extendedopcode.patch

+ 3
- 3
data/locales/es.lua View File

@@ -6,7 +6,7 @@ locale = {
6 6
   name = "es",
7 7
   charset = "cp1252",
8 8
   languageName = "Español",
9
- 
9
+
10 10
   translation = {
11 11
     ["1a) Offensive Name"] = "1a) Nombre ofensivo",
12 12
     ["1b) Invalid Name Format"] = "1b) Formato invalido para nombre",
@@ -154,7 +154,7 @@ locale = {
154 154
     ["Hide spells for higher exp. levels"] = "Ocultar hechizos para niveles mas altos que tu experiencia.",
155 155
     ["Hide spells for other vocations"] = "Ocultar hechizos que sean para otra vocación",
156 156
     ["Hit Points"] = "Puntos de vida",
157
-    ["Hold left mouse button to navigate\nScroll mouse middle button to zoom\nRight mouse button to create map marks"] = "Mantenga presionado el botón derecho del ratón para navegar\nDezplaze la rueda central del ratón para ampliar\nbotón derecho del mouse para crear marcas del mapa", 
157
+    ["Hold left mouse button to navigate\nScroll mouse middle button to zoom\nRight mouse button to create map marks"] = "Mantenga presionado el botón derecho del ratón para navegar\nDezplaze la rueda central del ratón para ampliar\nbotón derecho del mouse para crear marcas del mapa",
158 158
     ["Hotkeys"] = "Hotkeys",
159 159
     ["If you shut down the program, your character might stay in the game.\nClick on 'Logout' to ensure that you character leaves the game properly.\nClick on 'Exit' if you want to exit the program without logging out your character."] = "Si se cierra el programa, tu personaje puede permanecer en el juego.\nHaga clic en 'Salir' para asegurarse de que personaje deja el juego correctamente.\nHaga click en 'Salir' si desea salir del programa sin tener que salir de tu personaje.",
160 160
     ["Ignore"] = "Ignorar",
@@ -374,5 +374,5 @@ locale = {
374 374
     ["Don't stretch or shrink Game Window"] = "No estirar o encoger Ventana de Juego"
375 375
   }
376 376
 }
377
- 
377
+
378 378
 modules.client_locales.installLocale(locale)

+ 2
- 2
data/styles/30-minimap.otui View File

@@ -146,7 +146,7 @@ MinimapFlagWindow < MainWindow
146 146
     anchors.left: parent.left
147 147
     anchors.top: prev.bottom
148 148
     margin-top: 6
149
-    margin-left: 0  
149
+    margin-left: 0
150 150
 
151 151
   MinimapFlagCheckBox
152 152
     id: flag1
@@ -190,7 +190,7 @@ MinimapFlagWindow < MainWindow
190 190
     anchors.left: parent.left
191 191
     anchors.top: prev.bottom
192 192
     margin-top: 6
193
-    margin-left: 0  
193
+    margin-left: 0
194 194
 
195 195
   MinimapFlagCheckBox
196 196
     id: flag11

+ 3
- 3
modules/client/client.lua View File

@@ -53,7 +53,7 @@ function startup()
53 53
 end
54 54
 
55 55
 function init()
56
-  connect(g_app, { onRun = startup, 
56
+  connect(g_app, { onRun = startup,
57 57
                    onExit = exit })
58 58
 
59 59
   g_window.setMinimumSize({ width = 600, height = 480 })
@@ -94,11 +94,11 @@ function init()
94 94
   if not g_crypt.setMachineUUID(g_configs.get('uuid')) then
95 95
     g_configs.set('uuid', g_crypt.getMachineUUID())
96 96
     g_configs.save()
97
-  end                   
97
+  end
98 98
 end
99 99
 
100 100
 function terminate()
101
-  disconnect(g_app, { onRun = startup, 
101
+  disconnect(g_app, { onRun = startup,
102 102
                       onExit = exit })
103 103
   -- save window configs
104 104
   g_settings.set('window-size', g_window.getUnmaximizedSize())

+ 1
- 1
modules/client_entergame/characterlist.lua View File

@@ -243,7 +243,7 @@ function CharacterList.create(characters, account, otui)
243 243
   else
244 244
     accountStatusLabel:setText(tr('Free Account'))
245 245
   end
246
-  
246
+
247 247
   if account.premDays > 0 and account.premDays <= 7 then
248 248
     accountStatusLabel:setOn(true)
249 249
   else

+ 1
- 1
modules/client_entergame/characterlist.otui View File

@@ -81,7 +81,7 @@ MainWindow
81 81
     anchors.right: parent.right
82 82
     anchors.bottom: next.top
83 83
     margin-bottom: 1
84
-    
84
+
85 85
   Label
86 86
     id: accountStatusLabel
87 87
     !text: tr('Free Account')

+ 1
- 1
modules/client_entergame/entergame.lua View File

@@ -225,7 +225,7 @@ function EnterGame.doLogin()
225 225
 
226 226
   g_settings.set('host', G.host)
227 227
   g_settings.set('port', G.port)
228
-  g_settings.set('client-version', clientVersion) 
228
+  g_settings.set('client-version', clientVersion)
229 229
 
230 230
   protocolLogin = ProtocolLogin.create()
231 231
   protocolLogin.onLoginError = onError

+ 2
- 2
modules/client_options/graphics.otui View File

@@ -39,10 +39,10 @@ Panel
39 39
     id: fullscreen
40 40
     !text: tr('Fullscreen')
41 41
     tooltip: Ctrl+Shift+F
42
-    
42
+
43 43
   OptionCheckBox
44 44
     id: dontStretchShrink
45
-    !text: tr('Don\'t stretch/shrink Game Window')  
45
+    !text: tr('Don\'t stretch/shrink Game Window')
46 46
 
47 47
   Label
48 48
     id: backgroundFrameRateLabel

+ 1
- 1
modules/client_serverlist/serverlist.lua View File

@@ -50,7 +50,7 @@ function ServerList.add(host, port, protocol, load)
50 50
   end
51 51
   local widget = g_ui.createWidget('ServerWidget', serverTextList)
52 52
   widget:setId(host)
53
-  
53
+
54 54
   if not load then
55 55
     servers[host] = {
56 56
       port = port,

+ 3
- 3
modules/client_terminal/terminal.lua View File

@@ -131,11 +131,11 @@ function init()
131 131
   commandTextEdit = terminalWindow:getChildById('commandTextEdit')
132 132
   g_keyboard.bindKeyPress('Up', function() navigateCommand(1) end, commandTextEdit)
133 133
   g_keyboard.bindKeyPress('Down', function() navigateCommand(-1) end, commandTextEdit)
134
-  g_keyboard.bindKeyPress('Ctrl+C', 
135
-    function() 
134
+  g_keyboard.bindKeyPress('Ctrl+C',
135
+    function()
136 136
       if commandTextEdit:hasSelection() or not terminalSelectText:hasSelection() then return false end
137 137
       g_window.setClipboardText(terminalSelectText:getSelection())
138
-    return true 
138
+    return true
139 139
     end, commandTextEdit)
140 140
   g_keyboard.bindKeyDown('Tab', completeCommand, commandTextEdit)
141 141
   g_keyboard.bindKeyDown('Enter', doCommand, commandTextEdit)

+ 3
- 3
modules/corelib/table.lua View File

@@ -55,7 +55,7 @@ end
55 55
 
56 56
 function table.find(t, value, lowercase)
57 57
   for k,v in pairs(t) do
58
-    if lowercase and type(value) == 'string' and type(v) == 'string' then 
58
+    if lowercase and type(value) == 'string' and type(v) == 'string' then
59 59
       if v:lower() == value:lower() then return k end
60 60
     end
61 61
     if v == value then return k end
@@ -64,7 +64,7 @@ end
64 64
 
65 65
 function table.findbykey(t, key, lowercase)
66 66
   for k,v in pairs(t) do
67
-    if lowercase and type(key) == 'string' and type(k) == 'string' then 
67
+    if lowercase and type(key) == 'string' and type(k) == 'string' then
68 68
       if k:lower() == key:lower() then return v end
69 69
     end
70 70
     if k == key then return v end
@@ -149,7 +149,7 @@ function table.size(t)
149 149
   for i, n in pairs(t) do
150 150
     size = size + 1
151 151
   end
152
- 
152
+
153 153
   return size
154 154
 end
155 155
 

+ 1
- 1
modules/corelib/ui/uiminiwindow.lua View File

@@ -81,7 +81,7 @@ function UIMiniWindow:setup()
81 81
         self:minimize()
82 82
       end
83 83
     end
84
-    
84
+
85 85
   self:getChildById('miniwindowTopBar').onDoubleClick =
86 86
     function()
87 87
       if self:isOn() then

+ 5
- 5
modules/corelib/ui/uimovabletabbar.lua View File

@@ -8,7 +8,7 @@ end
8 8
 
9 9
 local function updateMargins(tabBar, ignored)
10 10
   if #tabBar.tabs == 0 then return end
11
- 
11
+
12 12
   local currentMargin = 0
13 13
   for i = 1, #tabBar.tabs do
14 14
     tabBar.tabs[i]:setMarginLeft(currentMargin)
@@ -279,17 +279,17 @@ end
279 279
 function UIMoveableTabBar:moveTab(tab, units)
280 280
   local index = table.find(self.tabs, tab)
281 281
   if index == nil then return end
282
-  
282
+
283 283
   local focus = false
284 284
   if self.currentTab == tab then
285 285
     self:selectPrevTab()
286 286
     focus = true
287 287
   end
288
-  
288
+
289 289
   table.remove(self.tabs, index)
290
-  
290
+
291 291
   local newIndex = math.min(#self.tabs+1, math.max(index + units, 1))
292
-  table.insert(self.tabs, newIndex, tab) 
292
+  table.insert(self.tabs, newIndex, tab)
293 293
   if focus then self:selectTab(tab) end
294 294
   updateMargins(self)
295 295
   return newIndex

+ 1
- 1
modules/corelib/ui/uiradiogroup.lua View File

@@ -47,7 +47,7 @@ end
47 47
 
48 48
 function UIRadioGroup:clearSelected()
49 49
   if not self.selectedWidget then return end
50
-  
50
+
51 51
   local previousSelectedWidget = self.selectedWidget
52 52
   self.selectedWidget:setChecked(false)
53 53
   self.selectedWidget = nil

+ 18
- 18
modules/game_battle/battle.lua View File

@@ -32,11 +32,11 @@ function init()
32 32
 
33 33
   filterPanel = battleWindow:recursiveGetChildById('filterPanel')
34 34
   toggleFilterButton = battleWindow:recursiveGetChildById('toggleFilterButton')
35
-  
35
+
36 36
   if isHidingFilters() then
37 37
     hideFilterPanel()
38 38
   end
39
-  
39
+
40 40
   sortTypeBox = battleWindow:recursiveGetChildById('sortTypeBox')
41 41
   sortOrderBox = battleWindow:recursiveGetChildById('sortOrderBox')
42 42
   hidePlayersButton = battleWindow:recursiveGetChildById('hidePlayers')
@@ -63,7 +63,7 @@ function init()
63 63
   sortOrderBox:addOption('Desc.', 'desc')
64 64
   sortOrderBox:setCurrentOptionByData(getSortOrder())
65 65
   sortOrderBox.onOptionChange = onChangeSortOrder
66
-  
66
+
67 67
   connect(Creature, {
68 68
     onSkullChange = updateCreatureSkull,
69 69
     onEmblemChange = updateCreatureEmblem,
@@ -73,7 +73,7 @@ function init()
73 73
     onAppear = onCreatureAppear,
74 74
     onDisappear = onCreatureDisappear
75 75
   })
76
-  
76
+
77 77
   connect(LocalPlayer, {
78 78
     onPositionChange = onCreaturePositionChange
79 79
   })
@@ -95,7 +95,7 @@ function terminate()
95 95
   battleWindow:destroy()
96 96
   mouseWidget:destroy()
97 97
 
98
-  disconnect(Creature, {  
98
+  disconnect(Creature, {
99 99
     onSkullChange = updateCreatureSkull,
100 100
     onEmblemChange = updateCreatureEmblem,
101 101
     onOutfitChange = onCreatureOutfitChange,
@@ -108,7 +108,7 @@ function terminate()
108 108
   disconnect(LocalPlayer, {
109 109
     onPositionChange = onCreaturePositionChange
110 110
   })
111
-  
111
+
112 112
   disconnect(g_game, {
113 113
     onAttackingCreatureChange = onAttack,
114 114
     onFollowingCreatureChange = onFollow,
@@ -296,17 +296,17 @@ function onCreaturePositionChange(creature, newPos, oldPos)
296 296
         for id, creatureButton in pairs(battleButtonsByCreaturesList) do
297 297
           table.insert(distanceList, {distance = getDistanceBetween(newPos, creatureButton.creature:getPosition()), widget = creatureButton})
298 298
         end
299
-  
299
+
300 300
         if isSortAsc() then
301 301
           table.sort(distanceList, function(a, b) return a.distance < b.distance end)
302 302
         else
303
-          table.sort(distanceList, function(a, b) return a.distance > b.distance end)    
303
+          table.sort(distanceList, function(a, b) return a.distance > b.distance end)
304 304
         end
305
-        
305
+
306 306
         for i = 1, #distanceList do
307 307
           battlePanel:moveChildToIndex(distanceList[i].widget, i)
308 308
         end
309
-      end    
309
+      end
310 310
 
311 311
       for id, creatureButton in pairs(battleButtonsByCreaturesList) do
312 312
         addCreature(creatureButton.creature)
@@ -356,7 +356,7 @@ function addCreature(creature)
356 356
   if not creatureAgeList[creatureId] then
357 357
     creatureAgeList[creatureId] = os.time()
358 358
   end
359
-  
359
+
360 360
   if not battleButton then
361 361
     battleButton = g_ui.createWidget('BattleButton')
362 362
     battleButton:setup(creature)
@@ -373,14 +373,14 @@ function addCreature(creature)
373 373
     if creature == g_game.getFollowingCreature() then
374 374
       onFollow(creature)
375 375
     end
376
-    
376
+
377 377
     local inserted = false
378 378
     local nameLower = creature:getName():lower()
379 379
     local healthPercent = creature:getHealthPercent()
380 380
     local playerPosition = g_game.getLocalPlayer():getPosition()
381 381
     local distance = getDistanceBetween(playerPosition, creature:getPosition())
382 382
     local age = creatureAgeList[creatureId]
383
-    
383
+
384 384
     local childCount = battlePanel:getChildCount()
385 385
     for i = 1, childCount do
386 386
       local child = battlePanel:getChildByIndex(i)
@@ -412,9 +412,9 @@ function addCreature(creature)
412 412
             break
413 413
           elseif healthPercent == childHealth then
414 414
             equal = true
415
-          end            
415
+          end
416 416
       end
417
-      
417
+
418 418
       -- If any other sort type is selected and values are equal, sort it by name also
419 419
       if getSortType() == 'name' or equal then
420 420
           local length = math.min(childName:len(), nameLower:len())
@@ -425,7 +425,7 @@ function addCreature(creature)
425 425
               break
426 426
             elseif (nameLower:byte(j) > childName:byte(j) and isSortAsc()) or (nameLower:byte(j) < childName:byte(j) and isSortDesc()) then
427 427
               break
428
-            elseif j == nameLower:len() and isSortAsc() then 
428
+            elseif j == nameLower:len() and isSortAsc() then
429 429
               battlePanel:insertChild(i, battleButton)
430 430
               inserted = true
431 431
             elseif j == childName:len() and isSortDesc() then
@@ -439,7 +439,7 @@ function addCreature(creature)
439 439
         break
440 440
       end
441 441
     end
442
-    
442
+
443 443
     -- Insert at the end if no other place is found
444 444
     if not inserted then
445 445
       battlePanel:insertChild(childCount + 1, battleButton)
@@ -478,7 +478,7 @@ function onBattleButtonMouseRelease(self, mousePosition, mouseButton)
478 478
     mouseWidget.cancelNextRelease = false
479 479
     return false
480 480
   end
481
-  if ((g_mouse.isPressed(MouseLeftButton) and mouseButton == MouseRightButton) 
481
+  if ((g_mouse.isPressed(MouseLeftButton) and mouseButton == MouseRightButton)
482 482
     or (g_mouse.isPressed(MouseRightButton) and mouseButton == MouseLeftButton)) then
483 483
     mouseWidget.cancelNextRelease = true
484 484
     g_game.look(self.creature)

+ 3
- 3
modules/game_battle/battle.otui View File

@@ -92,7 +92,7 @@ MiniWindow
92 92
       height: 20
93 93
       width: 128
94 94
       margin-top: 6
95
-      
95
+
96 96
       ComboBox
97 97
         id: sortTypeBox
98 98
         width: 74
@@ -107,7 +107,7 @@ MiniWindow
107 107
         anchors.top: parent.top
108 108
         anchors.left: prev.right
109 109
         margin-left: 4
110
-        
110
+
111 111
   Panel
112 112
     height: 18
113 113
     anchors.top: prev.bottom
@@ -132,7 +132,7 @@ MiniWindow
132 132
     anchors.right: miniwindowScrollBar.left
133 133
     margin-right: 1
134 134
     margin-top: 11
135
-    
135
+
136 136
   MiniWindowContents
137 137
     anchors.top: prev.bottom
138 138
     margin-top: 6

+ 11
- 11
modules/game_combatcontrols/combatcontrols.lua View File

@@ -23,15 +23,15 @@ function init()
23 23
   fightOffensiveBox = combatControlsWindow:recursiveGetChildById('fightOffensiveBox')
24 24
   fightBalancedBox = combatControlsWindow:recursiveGetChildById('fightBalancedBox')
25 25
   fightDefensiveBox = combatControlsWindow:recursiveGetChildById('fightDefensiveBox')
26
-  
26
+
27 27
   chaseModeButton = combatControlsWindow:recursiveGetChildById('chaseModeBox')
28 28
   safeFightButton = combatControlsWindow:recursiveGetChildById('safeFightBox')
29
-  
29
+
30 30
   mountButton = combatControlsWindow:recursiveGetChildById('mountButton')
31 31
   mountButton.onClick = onMountButtonClick
32
-  
32
+
33 33
   pvpModesPanel = combatControlsWindow:recursiveGetChildById('pvpModesPanel')
34
-  
34
+
35 35
   whiteDoveBox = combatControlsWindow:recursiveGetChildById('whiteDoveBox')
36 36
   whiteHandBox = combatControlsWindow:recursiveGetChildById('whiteHandBox')
37 37
   yellowHandBox = combatControlsWindow:recursiveGetChildById('yellowHandBox')
@@ -41,7 +41,7 @@ function init()
41 41
   fightModeRadioGroup:addWidget(fightOffensiveBox)
42 42
   fightModeRadioGroup:addWidget(fightBalancedBox)
43 43
   fightModeRadioGroup:addWidget(fightDefensiveBox)
44
-  
44
+
45 45
   pvpModeRadioGroup = UIRadioGroup.create()
46 46
   pvpModeRadioGroup:addWidget(whiteDoveBox)
47 47
   pvpModeRadioGroup:addWidget(whiteHandBox)
@@ -62,7 +62,7 @@ function init()
62 62
     onWalk = check,
63 63
     onAutoWalk = check
64 64
   })
65
-  
65
+
66 66
   connect(LocalPlayer, { onOutfitChange = onOutfitChange })
67 67
 
68 68
   if g_game.isOnline() then
@@ -92,7 +92,7 @@ function terminate()
92 92
     onWalk = check,
93 93
     onAutoWalk = check
94 94
   })
95
-  
95
+
96 96
   disconnect(LocalPlayer, { onOutfitChange = onOutfitChange })
97 97
 end
98 98
 
@@ -111,7 +111,7 @@ function update()
111 111
 
112 112
   local safeFight = g_game.isSafeFight()
113 113
   safeFightButton:setChecked(not safeFight)
114
-  
114
+
115 115
   if g_game.getFeature(GamePVPMode) then
116 116
     local pvpMode = g_game.getPVPMode()
117 117
     local pvpWidget = getPVPBoxByMode(pvpMode)
@@ -153,7 +153,7 @@ function online()
153 153
     else
154 154
       mountButton:setVisible(false)
155 155
     end
156
-    
156
+
157 157
     if g_game.getFeature(GamePVPMode) then
158 158
       pvpModesPanel:setVisible(true)
159 159
       combatControlsWindow:setHeight(combatControlsWindow.extendedControlsHeight)
@@ -232,7 +232,7 @@ function onSetPVPMode(self, selectedPVPButton)
232 232
   if selectedPVPButton == nil then
233 233
     return
234 234
   end
235
-  
235
+
236 236
   local buttonId = selectedPVPButton:getId()
237 237
   local pvpMode = PVPWhiteDove
238 238
   if buttonId == 'whiteDoveBox' then
@@ -263,7 +263,7 @@ function onOutfitChange(localPlayer, outfit, oldOutfit)
263 263
   if outfit.mount == oldOutfit.mount then
264 264
     return
265 265
   end
266
-  
266
+
267 267
   mountButton:setChecked(outfit.mount ~= nil and outfit.mount > 0)
268 268
 end
269 269
 

+ 2
- 2
modules/game_combatcontrols/combatcontrols.otui View File

@@ -16,7 +16,7 @@ ChaseModeBox < CombatBox
16 16
   image-source: /images/game/combatmodes/chasemode
17 17
 SafeFightBox < CombatBox
18 18
   image-source: /images/game/combatmodes/safefight
19
-  
19
+
20 20
 MountButton < CombatBox
21 21
   image-source: /images/game/combatmodes/mount
22 22
 
@@ -73,7 +73,7 @@ MiniWindow
73 73
       anchors.right: parent.right
74 74
       anchors.bottom: parent.bottom
75 75
       height: 20
76
-      
76
+
77 77
       WhiteDoveBox
78 78
         id: whiteDoveBox
79 79
         anchors.left: parent.left

+ 17
- 17
modules/game_console/communicationwindow.otui View File

@@ -33,13 +33,13 @@ MainWindow
33 33
     anchors.left: parent.left
34 34
     anchors.top: parent.top
35 35
     width: 180
36
-  
36
+
37 37
   Label
38 38
     !text: tr('Ignored Players:')
39 39
     anchors.left: parent.left
40 40
     anchors.top: prev.bottom
41 41
     margin-top: 10
42
-    
42
+
43 43
   TextList
44 44
     id: ignoreList
45 45
     vertical-scrollbar: ignoreListScrollBar
@@ -51,14 +51,14 @@ MainWindow
51 51
     margin-top: 3
52 52
     padding: 1
53 53
     focusable: false
54
-    
54
+
55 55
   TextEdit
56 56
     id: ignoreNameEdit
57 57
     anchors.top: prev.bottom
58 58
     anchors.left: parent.left
59 59
     width: 110
60 60
     margin-top: 5
61
-    
61
+
62 62
   Button
63 63
     id: buttonIgnoreAdd
64 64
     !text: tr('Add')
@@ -67,7 +67,7 @@ MainWindow
67 67
     margin-left: 5
68 68
     anchors.top: prev.top
69 69
     anchors.left: prev.right
70
-    
70
+
71 71
   Button
72 72
     id: buttonIgnoreRemove
73 73
     !text: tr('Remove')
@@ -90,7 +90,7 @@ MainWindow
90 90
     anchors.top: prev.bottom
91 91
     width: 180
92 92
     margin-top: 5
93
-    
93
+
94 94
   CheckBox
95 95
     id: checkboxIgnoreYelling
96 96
     !text: tr('Ignore Yelling')
@@ -98,7 +98,7 @@ MainWindow
98 98
     anchors.top: prev.bottom
99 99
     width: 180
100 100
     margin-top: 5
101
-    
101
+
102 102
   CheckBox
103 103
     id: checkboxUseWhiteList
104 104
     !text: tr('Activate whitelist')
@@ -106,13 +106,13 @@ MainWindow
106 106
     anchors.left: ignoreList.right
107 107
     margin-left: 20
108 108
     width: 180
109
-    
109
+
110 110
   Label
111 111
     !text: tr('Allowed Players:')
112 112
     anchors.top: prev.bottom
113 113
     anchors.left: prev.left
114 114
     margin-top: 10
115
-    
115
+
116 116
   TextList
117 117
     id: whiteList
118 118
     vertical-scrollbar: whiteListScrollBar
@@ -124,14 +124,14 @@ MainWindow
124 124
     margin-top: 3
125 125
     padding: 1
126 126
     focusable: false
127
-    
127
+
128 128
   TextEdit
129 129
     id: whitelistNameEdit
130 130
     anchors.top: prev.bottom
131 131
     anchors.left: prev.left
132 132
     width: 110
133 133
     margin-top: 5
134
-    
134
+
135 135
   Button
136 136
     id: buttonWhitelistAdd
137 137
     !text: tr('Add')
@@ -140,7 +140,7 @@ MainWindow
140 140
     margin-left: 5
141 141
     anchors.top: prev.top
142 142
     anchors.left: prev.right
143
-    
143
+
144 144
   Button
145 145
     id: buttonWhitelistRemove
146 146
     !text: tr('Remove')
@@ -149,7 +149,7 @@ MainWindow
149 149
     margin-left: 5
150 150
     anchors.top: prev.top
151 151
     anchors.left: prev.right
152
-    
152
+
153 153
   Label
154 154
     !text: tr('Global whitelist settings')
155 155
     anchors.left: whiteList.left
@@ -163,17 +163,17 @@ MainWindow
163 163
     anchors.top: prev.bottom
164 164
     width: 180
165 165
     margin-top: 5
166
-    
166
+
167 167
   Panel
168 168
     anchors.bottom: parent.bottom
169 169
     anchors.left: parent.left
170 170
     anchors.right: parent.right
171 171
     height: 30
172
-    
172
+
173 173
     Panel
174 174
       size: 160 30
175 175
       anchors.horizontalCenter: parent.horizontalCenter
176
-    
176
+
177 177
       Button
178 178
         id: buttonSave
179 179
         !text: tr('Save')
@@ -196,7 +196,7 @@ MainWindow
196 196
     anchors.right: ignoreList.right
197 197
     step: 14
198 198
     pixels-scroll: true
199
-    
199
+
200 200
   VerticalScrollBar
201 201
     id: whiteListScrollBar
202 202
     anchors.top: whiteList.top

+ 25
- 25
modules/game_console/console.lua View File

@@ -175,7 +175,7 @@ end
175 175
 
176 176
 function disableChat()
177 177
   local gameInterface = modules.game_interface
178
-  
178
+
179 179
   consoleTextEdit:setVisible(false)
180 180
   consoleTextEdit:setText("")
181 181
 
@@ -220,11 +220,11 @@ function terminate()
220 220
   g_keyboard.unbindKeyDown('Ctrl+H')
221 221
 
222 222
   saveCommunicationSettings()
223
-  
223
+
224 224
   if channelsWindow then
225 225
     channelsWindow:destroy()
226 226
   end
227
-  
227
+
228 228
   if communicationWindow then
229 229
     communicationWindow:destroy()
230 230
   end
@@ -232,7 +232,7 @@ function terminate()
232 232
   if violationWindow then
233 233
     violationWindow:destroy()
234 234
   end
235
-  
235
+
236 236
   consolePanel:destroy()
237 237
   ownPrivateName = nil
238 238
 
@@ -363,7 +363,7 @@ function addTab(name, focus)
363 363
 end
364 364
 
365 365
 function removeTab(tab)
366
-  if type(tab) == 'string' then 
366
+  if type(tab) == 'string' then
367 367
     tab = consoleTabBar:getTab(tab)
368 368
   end
369 369
 
@@ -824,7 +824,7 @@ function onTalk(name, level, mode, message, channelId, creaturePos)
824 824
   end
825 825
 
826 826
   if ignoreNpcMessages and mode == MessageModes.NpcFrom then return end
827
-  
827
+
828 828
   speaktype = SpeakTypes[mode]
829 829
 
830 830
   if not speaktype then
@@ -833,10 +833,10 @@ function onTalk(name, level, mode, message, channelId, creaturePos)
833 833
   end
834 834
 
835 835
   local localPlayer = g_game.getLocalPlayer()
836
-  if name ~= g_game.getCharacterName()     
837
-      and isUsingIgnoreList()             
836
+  if name ~= g_game.getCharacterName()
837
+      and isUsingIgnoreList()
838 838
         and not(isUsingWhiteList()) or (isUsingWhiteList() and not(isWhitelisted(name)) and not(isAllowingVIPs() and localPlayer:hasVip(name))) then
839
-    
839
+
840 840
     if mode == MessageModes.Yell and isIgnoringYelling() then
841 841
       return
842 842
     elseif speaktype.private and isIgnoringPrivate() and mode ~= MessageModes.NpcFrom then
@@ -1042,16 +1042,16 @@ end
1042 1042
 function saveCommunicationSettings()
1043 1043
   local tmpIgnoreList = {}
1044 1044
   local ignoredPlayers = getIgnoredPlayers()
1045
-  for i = 1, #ignoredPlayers do    
1045
+  for i = 1, #ignoredPlayers do
1046 1046
     table.insert(tmpIgnoreList, ignoredPlayers[i])
1047 1047
   end
1048 1048
 
1049 1049
   local tmpWhiteList = {}
1050 1050
   local whitelistedPlayers = getWhitelistedPlayers()
1051
-  for i = 1, #whitelistedPlayers do    
1051
+  for i = 1, #whitelistedPlayers do
1052 1052
     table.insert(tmpWhiteList, whitelistedPlayers[i])
1053 1053
   end
1054
-  
1054
+
1055 1055
   g_settings.set('UseIgnoreList', communicationSettings.useIgnoreList)
1056 1056
   g_settings.set('UseWhiteList', communicationSettings.useWhiteList)
1057 1057
   g_settings.set('IgnorePrivateMessages', communicationSettings.privateMessages)
@@ -1119,7 +1119,7 @@ function onClickIgnoreButton()
1119 1119
   local ignoreListPanel = communicationWindow:getChildById('ignoreList')
1120 1120
   local whiteListPanel = communicationWindow:getChildById('whiteList')
1121 1121
   communicationWindow.onDestroy = function() communicationWindow = nil end
1122
-  
1122
+
1123 1123
   local useIgnoreListBox = communicationWindow:getChildById('checkboxUseIgnoreList')
1124 1124
   useIgnoreListBox:setChecked(communicationSettings.useIgnoreList)
1125 1125
   local useWhiteListBox = communicationWindow:getChildById('checkboxUseWhiteList')
@@ -1128,8 +1128,8 @@ function onClickIgnoreButton()
1128 1128
   local removeIgnoreButton = communicationWindow:getChildById('buttonIgnoreRemove')
1129 1129
   removeIgnoreButton:disable()
1130 1130
   ignoreListPanel.onChildFocusChange = function() removeIgnoreButton:enable() end
1131
-  removeIgnoreButton.onClick = function() 
1132
-    local selection = ignoreListPanel:getFocusedChild() 
1131
+  removeIgnoreButton.onClick = function()
1132
+    local selection = ignoreListPanel:getFocusedChild()
1133 1133
     if selection then
1134 1134
       ignoreListPanel:removeChild(selection)
1135 1135
       selection:destroy()
@@ -1140,19 +1140,19 @@ function onClickIgnoreButton()
1140 1140
   local removeWhitelistButton = communicationWindow:getChildById('buttonWhitelistRemove')
1141 1141
   removeWhitelistButton:disable()
1142 1142
   whiteListPanel.onChildFocusChange = function() removeWhitelistButton:enable() end
1143
-  removeWhitelistButton.onClick = function() 
1144
-    local selection = whiteListPanel:getFocusedChild() 
1143
+  removeWhitelistButton.onClick = function()
1144
+    local selection = whiteListPanel:getFocusedChild()
1145 1145
     if selection then
1146 1146
       whiteListPanel:removeChild(selection)
1147 1147
       selection:destroy()
1148 1148
     end
1149 1149
     removeWhitelistButton:disable()
1150 1150
   end
1151
-  
1151
+
1152 1152
   local newlyIgnoredPlayers = {}
1153 1153
   local addIgnoreName = communicationWindow:getChildById('ignoreNameEdit')
1154 1154
   local addIgnoreButton = communicationWindow:getChildById('buttonIgnoreAdd')
1155
-  local addIgnoreFunction = function() 
1155
+  local addIgnoreFunction = function()
1156 1156
       local newEntry = addIgnoreName:getText()
1157 1157
       if newEntry == '' then return end
1158 1158
       if table.find(getIgnoredPlayers(), newEntry) then return end
@@ -1186,14 +1186,14 @@ function onClickIgnoreButton()
1186 1186
         addIgnoreFunction()
1187 1187
       end
1188 1188
     end
1189
-    
1189
+
1190 1190
   local ignorePrivateMessageBox = communicationWindow:getChildById('checkboxIgnorePrivateMessages')
1191 1191
   ignorePrivateMessageBox:setChecked(communicationSettings.privateMessages)
1192 1192
   local ignoreYellingBox = communicationWindow:getChildById('checkboxIgnoreYelling')
1193 1193
   ignoreYellingBox:setChecked(communicationSettings.yelling)
1194 1194
   local allowVIPsBox = communicationWindow:getChildById('checkboxAllowVIPs')
1195 1195
   allowVIPsBox:setChecked(communicationSettings.allowVIPs)
1196
-    
1196
+
1197 1197
   local saveButton = communicationWindow:recursiveGetChildById('buttonSave')
1198 1198
   saveButton.onClick = function()
1199 1199
       communicationSettings.ignoredPlayers = {}
@@ -1205,7 +1205,7 @@ function onClickIgnoreButton()
1205 1205
       for i = 1, whiteListPanel:getChildCount() do
1206 1206
         addWhitelistedPlayer(whiteListPanel:getChildByIndex(i):getText())
1207 1207
       end
1208
-      
1208
+
1209 1209
       communicationSettings.useIgnoreList = useIgnoreListBox:isChecked()
1210 1210
       communicationSettings.useWhiteList = useWhiteListBox:isChecked()
1211 1211
       communicationSettings.yelling = ignoreYellingBox:isChecked()
@@ -1213,18 +1213,18 @@ function onClickIgnoreButton()
1213 1213
       communicationSettings.allowVIPs = allowVIPsBox:isChecked()
1214 1214
       communicationWindow:destroy()
1215 1215
     end
1216
-            
1216
+
1217 1217
   local cancelButton = communicationWindow:recursiveGetChildById('buttonCancel')
1218 1218
   cancelButton.onClick = function()
1219 1219
       communicationWindow:destroy()
1220 1220
     end
1221
-    
1221
+
1222 1222
   local ignoredPlayers = getIgnoredPlayers()
1223 1223
   for i = 1, #ignoredPlayers do
1224 1224
     local label = g_ui.createWidget('IgnoreListLabel', ignoreListPanel)
1225 1225
     label:setText(ignoredPlayers[i])
1226 1226
   end
1227
-    
1227
+
1228 1228
   local whitelistedPlayers = getWhitelistedPlayers()
1229 1229
   for i = 1, #whitelistedPlayers do
1230 1230
     local label = g_ui.createWidget('WhiteListLabel', whiteListPanel)

+ 1
- 1
modules/game_console/console.otui View File

@@ -133,7 +133,7 @@ Panel
133 133
     margin-right: 5
134 134
     margin-top: 6
135 135
     @onClick: onClickIgnoreButton()
136
-    
136
+
137 137
   Panel
138 138
     id: consoleContentPanel
139 139
     anchors.top: prev.bottom

+ 6
- 6
modules/game_cooldown/cooldown.lua View File

@@ -20,8 +20,8 @@ function init()
20 20
 
21 21
   cooldownWindow = g_ui.loadUI('cooldown', modules.game_interface.getRightPanel())
22 22
   cooldownWindow:disableResize()
23
-  cooldownWindow:setup() 
24
-  
23
+  cooldownWindow:setup()
24
+
25 25
   contentsPanel = cooldownWindow:getChildById('contentsPanel')
26 26
   cooldownPanel = contentsPanel:getChildById('cooldownPanel')
27 27
 
@@ -47,10 +47,10 @@ end
47 47
 function loadIcon(iconId)
48 48
   local spell, profile, spellName = Spells.getSpellByIcon(iconId)
49 49
   if not spellName then return end
50
-  
50
+
51 51
   clientIconId = Spells.getClientId(spellName)
52 52
   if not clientIconId then return end
53
-  
53
+
54 54
   local icon = cooldownPanel:getChildById(iconId)
55 55
   if not icon then
56 56
     icon = g_ui.createWidget('SpellIcon')
@@ -109,7 +109,7 @@ function turnOffCooldown(progressRect)
109 109
     progressRect.icon:setOn(false)
110 110
     progressRect.icon = nil
111 111
   end
112
-  
112
+
113 113
   -- create particles
114 114
   --[[local particle = g_ui.createWidget('GroupCooldownParticles', progressRect)
115 115
   particle:fill('parent')
@@ -130,7 +130,7 @@ end
130 130
 
131 131
 function updateCooldown(progressRect, duration)
132 132
   progressRect:setPercent(progressRect:getPercent() + 10000/duration)
133
-  
133
+
134 134
   if progressRect:getPercent() < 100 then
135 135
     removeEvent(progressRect.event)
136 136
     progressRect.event = scheduleEvent(function() progressRect.callback[ProgressCallback.update]() end, 100)

+ 4
- 4
modules/game_cooldown/cooldown.otui View File

@@ -6,7 +6,7 @@ SpellGroupIcon < UIWidget
6 6
   margin-top: 3
7 7
 
8 8
 SpellIcon < UIWidget
9
-  size: 24 24 
9
+  size: 24 24
10 10
   image-size: 24 24
11 11
   focusable: false
12 12
 
@@ -20,7 +20,7 @@ SpellProgressRect < UIProgressRect
20 20
 
21 21
 GroupCooldownParticles < UIParticles
22 22
   effect: groupcooldown-effect
23
-  
23
+
24 24
 MiniWindow
25 25
   id: cooldownWindow
26 26
   !text: tr('Spell Cooldowns')
@@ -28,7 +28,7 @@ MiniWindow
28 28
   icon: /images/topbuttons/cooldowns
29 29
   @onClose: modules.game_cooldown.onMiniWindowClose()
30 30
   &save: true
31
-  
31
+
32 32
   MiniWindowContents
33 33
     SpellGroupIcon
34 34
       id: groupIconAttack
@@ -97,4 +97,4 @@ MiniWindow
97 97
       anchors.left: parent.left
98 98
       anchors.right: parent.right
99 99
       background-color: #ffffff11
100
-      
100
+

+ 1
- 1
modules/game_healthinfo/healthinfo.otui View File

@@ -14,7 +14,7 @@ ManaBar < ProgressBar
14 14
   anchors.right: parent.right
15 15
   margin: 1
16 16
   margin-top: 3
17
-  
17
+
18 18
 ExperienceBar < ProgressBar
19 19
   id: experienceBar
20 20
   background-color: #B6E866

+ 5
- 5
modules/game_hotkeys/hotkeys_manager.lua View File

@@ -72,7 +72,7 @@ function init()
72 72
   g_keyboard.bindKeyPress('Down', function() currentHotkeys:focusNextChild(KeyboardFocusReason) end, hotkeysWindow)
73 73
   g_keyboard.bindKeyPress('Up', function() currentHotkeys:focusPreviousChild(KeyboardFocusReason) end, hotkeysWindow)
74 74
 
75
-  connect(g_game, { 
75
+  connect(g_game, {
76 76
     onGameStart = online,
77 77
     onGameEnd = offline
78 78
   })
@@ -386,7 +386,7 @@ function doKeyCombo(keyCombo)
386 386
       local item = g_game.findPlayerItem(hotKey.itemId, hotKey.subType or -1)
387 387
       if item then
388 388
         g_game.use(item)
389
-      end        
389
+      end
390 390
     else
391 391
       g_game.useInventoryItem(hotKey.itemId)
392 392
     end
@@ -395,7 +395,7 @@ function doKeyCombo(keyCombo)
395 395
       local item = g_game.findPlayerItem(hotKey.itemId, hotKey.subType or -1)
396 396
       if item then
397 397
         g_game.useWith(item, g_game.getLocalPlayer())
398
-      end        
398
+      end
399 399
     else
400 400
       g_game.useInventoryItemWith(hotKey.itemId, g_game.getLocalPlayer())
401 401
     end
@@ -418,7 +418,7 @@ function doKeyCombo(keyCombo)
418 418
       local item = g_game.findPlayerItem(hotKey.itemId, hotKey.subType or -1)
419 419
       if item then
420 420
         g_game.useWith(item, attackingCreature)
421
-      end        
421
+      end
422 422
     else
423 423
       g_game.useInventoryItemWith(hotKey.itemId, attackingCreature)
424 424
     end
@@ -426,7 +426,7 @@ function doKeyCombo(keyCombo)
426 426
     local item = Item.create(hotKey.itemId)
427 427
     if g_game.getProtocolVersion() < 780 or hotKey.subType then
428 428
       local tmpItem = g_game.findPlayerItem(hotKey.itemId, hotKey.subType or -1)
429
-      if not tmpItem then return true end     
429
+      if not tmpItem then return true end
430 430
       item = tmpItem
431 431
     end
432 432
     modules.game_interface.startUseWith(item)

+ 4
- 4
modules/game_interface/gameinterface.lua View File

@@ -42,7 +42,7 @@ function init()
42 42
   gameBottomPanel = gameRootPanel:getChildById('gameBottomPanel')
43 43
   connect(gameLeftPanel, { onVisibilityChange = onLeftPanelVisibilityChange })
44 44
 
45
-  logoutButton = modules.client_topmenu.addLeftButton('logoutButton', tr('Exit'), 
45
+  logoutButton = modules.client_topmenu.addLeftButton('logoutButton', tr('Exit'),
46 46
     '/images/topbuttons/logout', tryLogout, true)
47 47
 
48 48
   setupViewMode(0)
@@ -158,7 +158,7 @@ end
158 158
 function hide()
159 159
   disconnect(g_app, { onClose = tryExit })
160 160
   logoutButton:setTooltip(tr('Exit'))
161
-  
161
+
162 162
   if logoutWindow then
163 163
     logoutWindow:destroy()
164 164
     logoutWindow = nil
@@ -235,7 +235,7 @@ function tryLogout(prompt)
235 235
   if not g_game.isConnectionOk() then
236 236
     msg = 'Your connection is failing, if you logout now your character will be still online, do you want to force logout?'
237 237
 
238
-    yesCallback = function() 
238
+    yesCallback = function()
239 239
       g_game.forceLogout()
240 240
       if logoutWindow then
241 241
         logoutWindow:destroy()
@@ -486,7 +486,7 @@ function createThingMenu(menuPosition, lookThing, useThing, creatureThing)
486 486
         else
487 487
           menu:addOption(tr('Stop Attack'), function() g_game.cancelAttack() end, shortcut)
488 488
         end
489
-  
489
+
490 490
         if g_game.getFollowingCreature() ~= creatureThing then
491 491
           menu:addOption(tr('Follow'), function() g_game.follow(creatureThing) end)
492 492
         else

+ 5
- 5
modules/game_interface/widgets/uigamemap.lua View File

@@ -60,9 +60,9 @@ function UIGameMap:onMouseRelease(mousePosition, mouseButton)
60 60
   if not self.allowNextRelease then
61 61
     return true
62 62
   end
63
-  
63
+
64 64
   local autoWalkPos = self:getPosition(mousePosition)
65
-  
65
+
66 66
   -- happens when clicking outside of map boundaries
67 67
   if not autoWalkPos then return false end
68 68
 
@@ -73,7 +73,7 @@ function UIGameMap:onMouseRelease(mousePosition, mouseButton)
73 73
     autoWalkPos.y = autoWalkPos.y + dz
74 74
     autoWalkPos.z = localPlayerPos.z
75 75
   end
76
-  
76
+
77 77
   local lookThing
78 78
   local useThing
79 79
   local creatureThing
@@ -85,8 +85,8 @@ function UIGameMap:onMouseRelease(mousePosition, mouseButton)
85 85
     lookThing = tile:getTopLookThing()
86 86
     useThing = tile:getTopUseThing()
87 87
     creatureThing = tile:getTopCreature()
88
-  end 
89
-   
88
+  end
89
+
90 90
   local autoWalkTile = g_map.getTile(autoWalkPos)
91 91
   if autoWalkTile then
92 92
     attackCreature = autoWalkTile:getTopCreature()

+ 7
- 7
modules/game_market/market.lua View File

@@ -1,6 +1,6 @@
1 1
 --[[
2 2
     Finalizing Market:
3
-      Note: Feel free to work on any area and submit 
3
+      Note: Feel free to work on any area and submit
4 4
             it as a pull request from your git fork.
5 5
 
6 6
       BeniS's Skype: benjiz69
@@ -11,7 +11,7 @@
11 11
         - Offer History
12 12
 
13 13
       * Clean up the interface building
14
-        - Add a new market interface file to handle building?      
14
+        - Add a new market interface file to handle building?
15 15
 
16 16
       * Add offer table column ordering.
17 17
         - Player Name, Amount, Total Price, Peice Price and Ends At
@@ -251,7 +251,7 @@ local function updateOffers(offers)
251 251
   -- clear existing offer data
252 252
   buyOfferTable:clearData()
253 253
   sellOfferTable:clearData()
254
-  
254
+
255 255
   sellButton:setEnabled(false)
256 256
   buyButton:setEnabled(false)
257 257
 
@@ -431,7 +431,7 @@ local function openAmountWindow(callback, type, actionText)
431 431
     widget:setText(tostring(value*selectedOffer[type]:getPrice())..'gp')
432 432
     itembox:setText(tostring(value))
433 433
   end
434
-  
434
+
435 435
   local okButton = amountWindow:getChildById('buttonOk')
436 436
   if actionText ~= '' then
437 437
     okButton:setText(actionText)
@@ -814,7 +814,7 @@ function Market.enableCreateOffer(enable)
814 814
 
815 815
   local prevAmountButton = marketOffersPanel:recursiveGetChildById('prevAmountButton')
816 816
   local nextAmountButton = marketOffersPanel:recursiveGetChildById('nextAmountButton')
817
-  
817
+
818 818
   prevAmountButton:setEnabled(enable)
819 819
   nextAmountButton:setEnabled(enable)
820 820
 end
@@ -1076,7 +1076,7 @@ function Market.onMarketEnter(depotItems, offers, balance, vocation)
1076 1076
 
1077 1077
   Market.clearSelectedItem()
1078 1078
   updateBalance(balance)
1079
-  
1079
+
1080 1080
   information.totalOffers = offers
1081 1081
   local player = g_game.getLocalPlayer()
1082 1082
   if player then
@@ -1101,7 +1101,7 @@ function Market.onMarketEnter(depotItems, offers, balance, vocation)
1101 1101
   else
1102 1102
     Market.refreshItemsWidget()
1103 1103
   end
1104
- 
1104
+
1105 1105
   if table.empty(currentItems) then
1106 1106
     Market.loadMarketItems(MarketCategory.First)
1107 1107
   end

+ 3
- 3
modules/game_minimap/flagwindow.otui View File

@@ -8,7 +8,7 @@ FlagButton < CheckBox
8 8
   icon-size: 11 11
9 9
   icon-clip: 0 0 11 11
10 10
   icon-offset: 2 4
11
-  text: 
11
+  text:
12 12
 
13 13
   $!checked:
14 14
     image-clip: 26 0 26 26
@@ -54,7 +54,7 @@ FlagWindow < MainWindow
54 54
     anchors.left: parent.left
55 55
     anchors.top: prev.bottom
56 56
     margin-top: 6
57
-    margin-left: 0  
57
+    margin-left: 0
58 58
 
59 59
   FlagButton
60 60
     id: flag2
@@ -116,7 +116,7 @@ FlagWindow < MainWindow
116 116
     anchors.left: parent.left
117 117
     anchors.top: prev.bottom
118 118
     margin-top: 6
119
-    margin-left: 0  
119
+    margin-left: 0
120 120
 
121 121
   FlagButton
122 122
     id: flag12

+ 6
- 6
modules/game_modaldialog/modaldialog.lua View File

@@ -31,15 +31,15 @@ function onModalDialog(id, title, message, buttons, enterButton, escapeButton, c
31 31
   end
32 32
 
33 33
   modalDialog = g_ui.createWidget('ModalDialog', rootWidget)
34
-  
34
+
35 35
   local messageLabel = modalDialog:getChildById('messageLabel')
36 36
   local choiceList = modalDialog:getChildById('choiceList')
37 37
   local choiceScrollbar = modalDialog:getChildById('choiceScrollBar')
38 38
   local buttonList = modalDialog:getChildById('buttonList')
39
-  
39
+
40 40
   modalDialog:setText(title)
41 41
   messageLabel:setText(message)
42
-  
42
+
43 43
   local horizontalPadding = modalDialog:getPaddingLeft() + modalDialog:getPaddingRight()
44 44
   modalDialog:setWidth(math.min(modalDialog.maximumWidth, math.max(messageLabel:getWidth(), modalDialog.minimumWidth)))
45 45
   messageLabel:setWidth(math.min(modalDialog.maximumWidth, math.max(messageLabel:getWidth(), modalDialog.minimumWidth)) - horizontalPadding)
@@ -48,7 +48,7 @@ function onModalDialog(id, title, message, buttons, enterButton, escapeButton, c
48 48
   for i = 1, #choices do
49 49
     local choiceId = choices[i][1]
50 50
     local choiceName = choices[i][2]
51
-    
51
+
52 52
     local label = g_ui.createWidget('ChoiceListLabel', choiceList)
53 53
     label.choiceId = choiceId
54 54
     label:setText(choiceName)
@@ -99,7 +99,7 @@ function onModalDialog(id, title, message, buttons, enterButton, escapeButton, c
99 99
     g_game.answerModalDialog(id, enterButton, choice)
100 100
     destroyDialog()
101 101
   end
102
-  
102
+
103 103
   local escapeFunc = function()
104 104
     local focusedChoice = choiceList:getFocusedChild()
105 105
     local choice = 0xFF
@@ -111,7 +111,7 @@ function onModalDialog(id, title, message, buttons, enterButton, escapeButton, c
111 111
   end
112 112
 
113 113
   choiceList.onDoubleClick = enterFunc
114
-  
114
+
115 115
   modalDialog.onEnter = enterFunc
116 116
   modalDialog.onEscape = escapeFunc
117 117
 end

+ 3
- 3
modules/game_npctrade/npctrade.lua View File

@@ -180,7 +180,7 @@ function itemPopup(self, mousePosition, mouseButton)
180 180
     menu:addOption(tr('Look'), function() return g_game.inspectNpcTrade(self:getItem()) end)
181 181
     menu:display(mousePosition)
182 182
     return true
183
-  elseif ((g_mouse.isPressed(MouseLeftButton) and mouseButton == MouseRightButton) 
183
+  elseif ((g_mouse.isPressed(MouseLeftButton) and mouseButton == MouseRightButton)
184 184
     or (g_mouse.isPressed(MouseRightButton) and mouseButton == MouseLeftButton)) then
185 185
     cancelNextRelease = true
186 186
     g_game.inspectNpcTrade(self:getItem())
@@ -438,7 +438,7 @@ function onPlayerGoods(money, items)
438 438
       playerItems[id] = playerItems[id] + item[2]
439 439
     end
440 440
   end
441
-  
441
+
442 442
   refreshPlayerGoods()
443 443
 end
444 444
 
@@ -480,7 +480,7 @@ end
480 480
 function checkSellAllTooltip()
481 481
   sellAllButton:setEnabled(true)
482 482
   sellAllButton:removeTooltip()
483
-  
483
+
484 484
   local total = 0
485 485
   local info = ''
486 486
   local first = true

+ 1
- 1
modules/game_outfit/outfit.lua View File

@@ -50,7 +50,7 @@ function create(creatureOutfit, outfitList, creatureMount, mountList)
50 50
   if outfitWindow and not outfitWindow:isHidden() then
51 51
     return
52 52
   end
53
-  
53
+
54 54
   outfitCreature = creatureOutfit
55 55
   mountCreature = creatureMount
56 56
   outfits = outfitList

+ 1
- 1
modules/game_skills/skills.lua View File

@@ -233,7 +233,7 @@ end
233 233
 function checkExpSpeed()
234 234
   local player = g_game.getLocalPlayer()
235 235
   if not player then return end
236
-  
236
+
237 237
   local currentExp = player:getExperience()
238 238
   local currentTime = g_clock.seconds()
239 239
   if player.lastExps ~= nil then

+ 39
- 39
modules/game_spelllist/spelllist.lua View File

@@ -53,8 +53,8 @@ FILTER_GROUP_SUPPORT      = 3
53 53
 local filters = {
54 54
   level        = false,
55 55
   vocation     = false,
56
-  
57
-  vocationId   = FILTER_VOCATION_ANY,  
56
+
57
+  vocationId   = FILTER_VOCATION_ANY,
58 58
   premium      = FILTER_PREMIUM_ANY,
59 59
   groupId      = FILTER_GROUP_ANY
60 60
 }
@@ -65,7 +65,7 @@ end
65 65
 
66 66
 function setSpelllistProfile(name)
67 67
   if SpelllistProfile == name then return end
68
-  
68
+
69 69
   if SpelllistSettings[name] and SpellInfo[name] then
70 70
     local oldProfile = SpelllistProfile
71 71
     SpelllistProfile = name
@@ -95,13 +95,13 @@ end
95 95
 function init()
96 96
   connect(g_game, { onGameStart = online,
97 97
                     onGameEnd   = offline })
98
-          
98
+
99 99
   spelllistWindow = g_ui.displayUI('spelllist', modules.game_interface.getRightPanel())
100 100
   spelllistWindow:hide()
101
-  
101
+
102 102
   spelllistButton = modules.client_topmenu.addRightGameToggleButton('spelllistButton', tr('Spell List'), '/images/topbuttons/spelllist', toggle)
103 103
   spelllistButton:setOn(false)
104
-  
104
+
105 105
   nameValueLabel        = spelllistWindow:getChildById('labelNameValue')
106 106
   formulaValueLabel     = spelllistWindow:getChildById('labelFormulaValue')
107 107
   vocationValueLabel    = spelllistWindow:getChildById('labelVocationValue')
@@ -112,18 +112,18 @@ function init()
112 112
   manaValueLabel        = spelllistWindow:getChildById('labelManaValue')
113 113
   premiumValueLabel     = spelllistWindow:getChildById('labelPremiumValue')
114 114
   descriptionValueLabel = spelllistWindow:getChildById('labelDescriptionValue')
115
-  
115
+
116 116
   vocationBoxAny        = spelllistWindow:getChildById('vocationBoxAny')
117 117
   vocationBoxSorcerer   = spelllistWindow:getChildById('vocationBoxSorcerer')
118 118
   vocationBoxDruid      = spelllistWindow:getChildById('vocationBoxDruid')
119 119
   vocationBoxPaladin    = spelllistWindow:getChildById('vocationBoxPaladin')
120 120
   vocationBoxKnight     = spelllistWindow:getChildById('vocationBoxKnight')
121
-  
121
+
122 122
   groupBoxAny           = spelllistWindow:getChildById('groupBoxAny')
123 123
   groupBoxAttack        = spelllistWindow:getChildById('groupBoxAttack')
124 124
   groupBoxHealing       = spelllistWindow:getChildById('groupBoxHealing')
125 125
   groupBoxSupport       = spelllistWindow:getChildById('groupBoxSupport')
126
-  
126
+
127 127
   premiumBoxAny         = spelllistWindow:getChildById('premiumBoxAny')
128 128
   premiumBoxYes         = spelllistWindow:getChildById('premiumBoxYes')
129 129
   premiumBoxNo          = spelllistWindow:getChildById('premiumBoxNo')
@@ -134,32 +134,32 @@ function init()
134 134
   vocationRadioGroup:addWidget(vocationBoxDruid)
135 135
   vocationRadioGroup:addWidget(vocationBoxPaladin)
136 136
   vocationRadioGroup:addWidget(vocationBoxKnight)
137
-  
137
+
138 138
   groupRadioGroup = UIRadioGroup.create()
139 139
   groupRadioGroup:addWidget(groupBoxAny)
140 140
   groupRadioGroup:addWidget(groupBoxAttack)
141 141
   groupRadioGroup:addWidget(groupBoxHealing)
142 142
   groupRadioGroup:addWidget(groupBoxSupport)
143
-  
143
+
144 144
   premiumRadioGroup = UIRadioGroup.create()
145 145
   premiumRadioGroup:addWidget(premiumBoxAny)
146 146
   premiumRadioGroup:addWidget(premiumBoxYes)
147 147
   premiumRadioGroup:addWidget(premiumBoxNo)
148
-  
148
+
149 149
   premiumRadioGroup:selectWidget(premiumBoxAny)
150 150
   vocationRadioGroup:selectWidget(vocationBoxAny)
151 151
   groupRadioGroup:selectWidget(groupBoxAny)
152
-  
152
+
153 153
   vocationRadioGroup.onSelectionChange  = toggleFilter
154 154
   groupRadioGroup.onSelectionChange     = toggleFilter
155 155
   premiumRadioGroup.onSelectionChange   = toggleFilter
156
-  
157
-  spellList = spelllistWindow:getChildById('spellList')   
156
+
157
+  spellList = spelllistWindow:getChildById('spellList')
158 158
 
159 159
   g_keyboard.bindKeyPress('Down', function() spellList:focusNextChild(KeyboardFocusReason) end, spelllistWindow)
160 160
   g_keyboard.bindKeyPress('Up', function() spellList:focusPreviousChild(KeyboardFocusReason) end, spelllistWindow)
161
-  
162
-  initialiseSpelllist() 
161
+
162
+  initialiseSpelllist()
163 163
   resizeWindow()
164 164
 
165 165
   if g_game.isOnline() then
@@ -174,11 +174,11 @@ function terminate()
174 174
   disconnect(spellList, { onChildFocusChange = function(self, focusedChild)
175 175
                           if focusedChild == nil then return end
176 176
                           updateSpellInformation(focusedChild)
177
-                        end })   
177
+                        end })
178 178
 
179 179
   spelllistWindow:destroy()
180 180
   spelllistButton:destroy()
181
-  
181
+
182 182
   vocationRadioGroup:destroy()
183 183
   groupRadioGroup:destroy()
184 184
   premiumRadioGroup:destroy()
@@ -188,21 +188,21 @@ function initialiseSpelllist()
188 188
   for i = 1, #SpelllistSettings[SpelllistProfile].spellOrder do
189 189
     local spell = SpelllistSettings[SpelllistProfile].spellOrder[i]
190 190
     local info = SpellInfo[SpelllistProfile][spell]
191
-  
191
+
192 192
     local tmpLabel = g_ui.createWidget('SpellListLabel', spellList)
193 193
     tmpLabel:setId(spell)
194 194
     tmpLabel:setText(spell .. '\n\'' .. info.words .. '\'')
195 195
     tmpLabel:setPhantom(false)
196
-  
196
+
197 197
     local iconId = tonumber(info.icon)
198 198
     if not iconId and SpellIcons[info.icon] then
199 199
       iconId = SpellIcons[info.icon][1]
200 200
     end
201 201
 
202 202
     if not(iconId) then
203
-      perror('Spell icon \'' .. info.icon .. '\' not found.') 
203
+      perror('Spell icon \'' .. info.icon .. '\' not found.')
204 204
     end
205
-  
205
+
206 206
     tmpLabel:setHeight(SpelllistSettings[SpelllistProfile].iconSize.height + 4)
207 207
     tmpLabel:setTextOffset(topoint((SpelllistSettings[SpelllistProfile].iconSize.width + 10) .. ' ' .. (SpelllistSettings[SpelllistProfile].iconSize.height - 32)/2 + 3))
208 208
     tmpLabel:setImageSource(SpelllistSettings[SpelllistProfile].iconFile)
@@ -210,11 +210,11 @@ function initialiseSpelllist()
210 210
     tmpLabel:setImageSize(tosize(SpelllistSettings[SpelllistProfile].iconSize.width .. ' ' .. SpelllistSettings[SpelllistProfile].iconSize.height))
211 211
     tmpLabel.onClick = updateSpellInformation
212 212
   end
213
- 
213
+
214 214
   connect(spellList, { onChildFocusChange = function(self, focusedChild)
215 215
                           if focusedChild == nil then return end
216 216
                           updateSpellInformation(focusedChild)
217
-                        end })   
217
+                        end })
218 218
 end
219 219
 
220 220
 function changeSpelllistProfile(oldProfile)
@@ -222,10 +222,10 @@ function changeSpelllistProfile(oldProfile)
222 222
   for i = 1, #SpelllistSettings[oldProfile].spellOrder do
223 223
     local spell = SpelllistSettings[oldProfile].spellOrder[i]
224 224
     local tmpLabel = spellList:getChildById(spell)
225
-  
225
+
226 226
     tmpLabel:destroy()
227 227
   end
228
-  
228
+
229 229
   -- Create new spelllist and ajust window
230 230
   initialiseSpelllist()
231 231
   setOptions()
@@ -238,7 +238,7 @@ function updateSpelllist()
238 238
     local spell = SpelllistSettings[SpelllistProfile].spellOrder[i]
239 239
     local info = SpellInfo[SpelllistProfile][spell]
240 240
     local tmpLabel = spellList:getChildById(spell)
241
-  
241
+
242 242
     local localPlayer = g_game.getLocalPlayer()
243 243
     if (not(filters.level) or info.level <= localPlayer:getLevel()) and (not(filters.vocation) or table.find(info.vocations, localPlayer:getVocation())) and (filters.vocationId == FILTER_VOCATION_ANY or table.find(info.vocations, filters.vocationId) or table.find(info.vocations, filters.vocationId+4)) and (filters.groupId == FILTER_GROUP_ANY or info.group[filters.groupId]) and (filters.premium == FILTER_PREMIUM_ANY or (info.premium and filters.premium == FILTER_PREMIUM_YES) or (not(info.premium) and filters.premium == FILTER_PREMIUM_NO)) then
244 244
       tmpLabel:setVisible(true)
@@ -250,7 +250,7 @@ end
250 250
 
251 251
 function updateSpellInformation(widget)
252 252
   local spell = widget:getId()
253
-  
253
+
254 254
   local name        = ''
255 255
   local formula     = ''
256 256
   local vocation    = ''
@@ -261,10 +261,10 @@ function updateSpellInformation(widget)
261 261
   local mana        = ''
262 262
   local premium     = ''
263 263
   local description = ''
264
-  
264
+
265 265
   if SpellInfo[SpelllistProfile][spell] then
266 266
     local info = SpellInfo[SpelllistProfile][spell]
267
-    
267
+
268 268
     name    = spell
269 269
     formula = info.words
270 270
 
@@ -274,7 +274,7 @@ function updateSpellInformation(widget)
274 274
         vocation = vocation .. (vocation:len() == 0 and '' or ', ') .. VocationNames[vocationId]
275 275
       end
276 276
     end
277
-    
277
+
278 278
     cooldown = (info.exhaustion / 1000) .. 's'
279 279
     for groupId, groupName in ipairs(SpellGroups) do
280 280
       if info.group[groupId] then
@@ -282,14 +282,14 @@ function updateSpellInformation(widget)
282 282
         cooldown = cooldown .. ' / ' .. (info.group[groupId] / 1000) .. 's'
283 283
       end
284 284
     end
285
-  
285
+
286 286
     type    = info.type
287 287
     level   = info.level
288 288
     mana    = info.mana .. ' / ' .. info.soul
289 289
     premium = (info.premium and 'yes' or 'no')
290 290
     description = info.description or '-'
291 291
   end
292
-    
292
+
293 293
   nameValueLabel:setText(name)
294 294
   formulaValueLabel:setText(formula)
295 295
   vocationValueLabel:setText(vocation)
@@ -356,7 +356,7 @@ function toggleFilter(widget, selectedWidget)
356 356
       widget:setOn(filters.vocation)
357 357
     end
358 358
   end
359
-  
359
+
360 360
   updateSpelllist()
361 361
 end
362 362
 
@@ -372,16 +372,16 @@ function resetWindow()
372 372
   -- Resetting filters
373 373
   filters.level = false
374 374
   filters.vocation = false
375
-  
375
+
376 376
   local buttonFilterLevel = spelllistWindow:getChildById('buttonFilterLevel')
377 377
   buttonFilterLevel:setOn(filters.level)
378
-  
378
+
379 379
   local buttonFilterVocation = spelllistWindow:getChildById('buttonFilterVocation')
380 380
   buttonFilterVocation:setOn(filters.vocation)
381
-  
381
+
382 382
   vocationRadioGroup:selectWidget(vocationBoxAny)
383 383
   groupRadioGroup:selectWidget(groupBoxAny)
384 384
   premiumRadioGroup:selectWidget(premiumBoxAny)
385
-  
385
+
386 386
   updateSpelllist()
387 387
 end

+ 1
- 1
modules/game_viplist/editvip.otui View File

@@ -99,7 +99,7 @@ MainWindow
99 99
     IconButton
100 100
       id: icon6
101 101
       icon-clip: 72 0 12 12
102
-        
102
+
103 103
     IconButton
104 104
       id: icon7
105 105
       icon-clip: 84 0 12 12

+ 9
- 9
modules/game_viplist/viplist.lua View File

@@ -289,7 +289,7 @@ function onAddVip(id, name, state, description, iconId, notify)
289 289
 
290 290
   local nameLower = name:lower()
291 291
   local childrenCount = vipList:getChildCount()
292
-  
292
+
293 293
   for i=1,childrenCount do
294 294
     local child = vipList:getChildByIndex(i)
295 295
     if (state == VipState.Online and child.vipState ~= VipState.Online and getSortedBy() == 'status')
@@ -300,7 +300,7 @@ function onAddVip(id, name, state, description, iconId, notify)
300 300
 
301 301
     if (((state ~= VipState.Online and child.vipState ~= VipState.Online) or (state == VipState.Online and child.vipState == VipState.Online)) and getSortedBy() == 'status')
302 302
         or (label.iconId == child.iconId and getSortedBy() == 'type') or getSortedBy() == 'name' then
303
-      
303
+
304 304
       local childText = child:getText():lower()
305 305
       local length = math.min(childText:len(), nameLower:len())
306 306
 
@@ -351,11 +351,11 @@ function onVipListMousePress(widget, mousePos, mouseButton)
351 351
   else
352 352
     menu:addOption(tr('Show Offline'), function() hideOffline(false) end)
353 353
   end
354
-  
354
+
355 355
   if not(getSortedBy() == 'name') then
356 356
     menu:addOption(tr('Sort by name'), function() sortBy('name') end)
357 357
   end
358
-  
358
+
359 359
   if not(getSortedBy() == 'status') then
360 360
     menu:addOption(tr('Sort by status'), function() sortBy('status') end)
361 361
   end
@@ -380,7 +380,7 @@ function onVipListLabelMousePress(widget, mousePos, mouseButton)
380 380
   menu:addOption(tr('Edit %s', widget:getText()), function() if widget then createEditWindow(widget) end end)
381 381
   menu:addOption(tr('Remove %s', widget:getText()), function() if widget then removeVip(widget) end end)
382 382
   menu:addSeparator()
383
-  menu:addOption(tr('Copy Name'), function() g_window.setClipboardText(widget:getText()) end) 
383
+  menu:addOption(tr('Copy Name'), function() g_window.setClipboardText(widget:getText()) end)
384 384
 
385 385
   if modules.game_console.getOwnPrivateTab() then
386 386
     menu:addSeparator()
@@ -393,15 +393,15 @@ function onVipListLabelMousePress(widget, mousePos, mouseButton)
393 393
   else
394 394
     menu:addOption(tr('Show Offline'), function() hideOffline(false) end)
395 395
   end
396
-  
396
+
397 397
   if not(getSortedBy() == 'name') then
398 398
     menu:addOption(tr('Sort by name'), function() sortBy('name') end)
399 399
   end
400
-  
400
+
401 401
   if not(getSortedBy() == 'status') then
402 402
     menu:addOption(tr('Sort by status'), function() sortBy('status') end)
403
-  end 
404
-  
403
+  end
404
+
405 405
   menu:display(mousePos)
406 406
 
407 407
   return true

+ 1
- 1
modules/gamelib/game.lua View File

@@ -14,7 +14,7 @@ function g_game.findPlayerItem(itemId, subType)
14 14
             end
15 15
         end
16 16
     end
17
-    
17
+
18 18
     return g_game.findItemInContainers(itemId, subType)
19 19
 end
20 20
 

+ 1
- 1
modules/gamelib/gamelib.otmod View File

@@ -19,5 +19,5 @@ Module
19 19
     dofile 'market'
20 20
     dofile 'thing'
21 21
     dofile 'spells'
22
-    
22
+
23 23
     dofiles 'ui'

+ 1
- 1
modules/gamelib/player.lua View File

@@ -154,7 +154,7 @@ function Player:hasState(_state, states)
154 154
   for i = 1, 32 do
155 155
     local pow = math.pow(2, i-1)
156 156
     if pow > states then break end
157
-    
157
+
158 158
     local states = bit32.band(states, pow)
159 159
     if states == _state then
160 160
       return true

+ 3
- 3
modules/gamelib/protocollogin.lua View File

@@ -57,7 +57,7 @@ function ProtocolLogin:sendLoginPacket()
57 57
     msg:addU32(xteaKey[3])
58 58
     msg:addU32(xteaKey[4])
59 59
   end
60
-  
60
+
61 61
   if g_game.getFeature(GameAccountNames) then
62 62
     msg:addString(self.accountName)
63 63
   else
@@ -77,7 +77,7 @@ function ProtocolLogin:sendLoginPacket()
77 77
   if g_game.getProtocolVersion() >= 770 then
78 78
     msg:encryptRsa()
79 79
   end
80
-  
80
+
81 81
   if g_game.getFeature(GameProtocolChecksum) then
82 82
     self:enableChecksum()
83 83
   end
@@ -137,7 +137,7 @@ function ProtocolLogin:parseCharacterList(msg)
137 137
     local worldsCount = msg:getU8()
138 138
     for i=1, worldsCount do
139 139
       local world = {}
140
-      local worldId = msg:getU8() 
140
+      local worldId = msg:getU8()
141 141
       world.worldName = msg:getString()
142 142
       world.worldIp = msg:getString()
143 143
       world.worldPort = msg:getU16()

+ 77
- 77
modules/gamelib/spells.lua View File

@@ -1,14 +1,14 @@
1 1
 SpelllistSettings = {
2
-  ['Default'] = { 
2
+  ['Default'] = {
3 3
     iconFile = '/images/game/spells/defaultspells',
4 4
     iconSize = {width = 32, height = 32},
5 5
     spellListWidth = 210,
6 6
     spellWindowWidth = 550,
7 7
     spellOrder = {'Animate Dead', 'Annihilation', 'Avalanche', 'Berserk', 'Blood Rage', 'Brutal Strike', 'Cancel Invisibility', 'Challenge', 'Chameleon', 'Charge', 'Conjure Arrow', 'Conjure Bolt', 'Conjure Explosive Arrow', 'Conjure Piercing Bolt', 'Conjure Poisoned Arrow', 'Conjure Power Bolt', 'Conjure Sniper Arrow', 'Convince Creature', 'Creature Illusion', 'Cure Bleeding', 'Cure Burning', 'Cure Curse', 'Cure Electrification', 'Cure Poison', 'Cure Poison Rune', 'Curse', 'Death Strike', 'Desintegrate', 'Destroy Field', 'Divine Caldera', 'Divine Healing', 'Divine Missile', 'Electrify', 'Enchant Party', 'Enchant Spear', 'Enchant Staff', 'Energy Beam', 'Energy Field', 'Energy Strike', 'Energy Wall', 'Energy Wave', 'Energybomb', 'Envenom', 'Eternal Winter', 'Ethereal Spear', 'Explosion', 'Fierce Berserk', 'Find Person', 'Fire Field', 'Fire Wall', 'Fire Wave', 'Fireball', 'Firebomb', 'Flame Strike', 'Food', 'Front Sweep', 'Great Energy Beam', 'Great Fireball', 'Great Light', 'Groundshaker', 'Haste', 'Heal Friend', 'Heal Party', 'Heavy Magic Missile', 'Hells Core', 'Holy Flash', 'Holy Missile', 'Ice Strike', 'Ice Wave', 'Icicle', 'Ignite', 'Inflict Wound', 'Intense Healing', 'Intense Healing Rune', 'Intense Recovery', 'Intense Wound Cleansing', 'Invisibility', 'Levitate', 'Light', 'Light Healing', 'Light Magic Missile', 'Lightning', 'Magic Rope', 'Magic Shield', 'Magic Wall', 'Mass Healing', 'Paralyze', 'Physical Strike', 'Poison Bomb', 'Poison Field', 'Poison Wall', 'Protect Party', 'Protector', 'Rage of the Skies', 'Recovery', 'Salvation', 'Sharpshooter', 'Soulfire', 'Stalagmite', 'Stone Shower', 'Strong Energy Strike', 'Strong Ethereal Spear', 'Strong Flame Strike', 'Strong Haste', 'Strong Ice Strike', 'Strong Ice Wave', 'Strong Terra Strike', 'Sudden Death', 'Summon Creature', 'Swift Foot', 'Terra Strike', 'Terra Wave', 'Thunderstorm', 'Train Party', 'Ultimate Energy Strike', 'Ultimate Flame Strike', 'Ultimate Healing', 'Ultimate Healing Rune', 'Ultimate Ice Strike', 'Ultimate Light', 'Ultimate Terra Strike', 'Whirlwind Throw', 'Wild Growth', 'Wound Cleansing', 'Wrath of Nature'}
8 8
   }--[[,
9
-  
10
-  ['Sample'] =  { 
11
-    iconFile = '/images/game/spells/sample', 
9
+
10
+  ['Sample'] =  {
11
+    iconFile = '/images/game/spells/sample',
12 12
     iconSize = {width = 64, height = 64},
13 13
     spellOrder = {'Critical Strike', 'Firefly', 'Fire Breath', 'Moonglaives', 'Wind Walk'}
14 14
   }]]
@@ -142,7 +142,7 @@ SpellInfo = {
142 142
     ['Thunderstorm'] =             {id = 117, words = 'adori mas vis',         exhaustion = 2000,  premium = false, type = 'Conjure', icon = 'thunderstorm',           mana = 430,    level = 28, soul = 3, group = {[3] = 2000},               vocations = {1, 5}},
143 143
     ['Holy Missile'] =             {id = 130, words = 'adori san',             exhaustion = 2000,  premium = false, type = 'Conjure', icon = 'holymissile',            mana = 350,    level = 27, soul = 3, group = {[3] = 2000},               vocations = {3, 7}}
144 144
   },
145
-  
145
+
146 146
   ['Sample'] = {
147 147
     ['Wind Walk'] =                {id = 1, words = 'windwalk',        description = 'Run at enormous speed.',          exhaustion = 2000,  premium = false, type = 'Instant', icon = 1,  mana = 50,     level = 10, soul = 0, group = {[3] = 2000}, vocations = {1, 2}},
148 148
     ['Fire Breath'] =              {id = 2, words = 'firebreath',      description = 'A strong firewave.',              exhaustion = 2000,  premium = false, type = 'Instant', icon = 2,  mana = 350,    level = 27, soul = 0, group = {[1] = 2000}, vocations = {4, 8}},
@@ -209,89 +209,89 @@ SpellIcons = {
209 209
   ['sniperarrow']               = {112, 108},
210 210
   ['whirlwindthrow']            = {19, 107},
211 211
   ['groundshaker']              = {25, 106},
212
-  ['fierceberserk']             = {22, 105},  
212
+  ['fierceberserk']             = {22, 105},
213 213
   -- [[ 96 - 104 Unknown ]]
214
-  ['powerbolt']                 = {108, 95},  
215
-  ['wildgrowth']                = {61, 94},  
216
-  ['challenge']                 = {97, 93},  
217
-  ['enchantstaff']              = {103, 92},  
218
-  ['poisonbomb']                = {70, 91},  
219
-  ['cancelinvisibility']        = {95, 90},  
220
-  ['flamestrike']               = {26, 89},  
221
-  ['energystrike']              = {29, 88},  
222
-  ['deathstrike']               = {38, 87},  
223
-  ['magicwall']                 = {72, 86},  
224
-  ['healfriend']                = {8, 84},  
225
-  ['animatedead']               = {93, 83},  
226
-  ['masshealing']               = {9, 82},  
227
-  ['levitate']                  = {125, 81},  
228
-  ['berserk']                   = {21, 80},  
229
-  ['conjurebolt']               = {107, 79},  
230
-  ['desintegrate']              = {88, 78},  
231
-  ['stalagmite']                = {66, 77},  
232
-  ['magicrope']                 = {105, 76},  
233
-  ['ultimatelight']             = {115, 75},  
214
+  ['powerbolt']                 = {108, 95},
215
+  ['wildgrowth']                = {61, 94},
216
+  ['challenge']                 = {97, 93},
217
+  ['enchantstaff']              = {103, 92},
218
+  ['poisonbomb']                = {70, 91},
219
+  ['cancelinvisibility']        = {95, 90},
220
+  ['flamestrike']               = {26, 89},
221
+  ['energystrike']              = {29, 88},
222
+  ['deathstrike']               = {38, 87},
223
+  ['magicwall']                 = {72, 86},
224
+  ['healfriend']                = {8, 84},
225
+  ['animatedead']               = {93, 83},
226
+  ['masshealing']               = {9, 82},
227
+  ['levitate']                  = {125, 81},
228
+  ['berserk']                   = {21, 80},
229
+  ['conjurebolt']               = {107, 79},
230
+  ['desintegrate']              = {88, 78},
231
+  ['stalagmite']                = {66, 77},
232
+  ['magicrope']                 = {105, 76},
233
+  ['ultimatelight']             = {115, 75},
234 234
   -- [[ 71 - 64 TFS House Commands ]]
235 235
   -- [[ 63 - 70 Unknown ]]
236
-  ['annihilation']              = {24, 62},  
237
-  ['brutalstrike']              = {23, 61},  
236
+  ['annihilation']              = {24, 62},
237
+  ['brutalstrike']              = {23, 61},
238 238
   -- [[ 60 Unknown ]]
239 239
   ['frontsweep']                = {20, 59},
240 240
   -- [[ 58 Unknown ]]
241
-  ['strongetherealspear']       = {59, 57},  
242
-  ['wrathofnature']             = {48, 56},  
243
-  ['energybomb']                = {86, 55},  
244
-  ['paralyze']                  = {71, 54},  
241
+  ['strongetherealspear']       = {59, 57},
242
+  ['wrathofnature']             = {48, 56},
243
+  ['energybomb']                = {86, 55},
244
+  ['paralyze']                  = {71, 54},
245 245
   --  [[ 53 Unknown ]]
246 246
   --  [[ 52 TFS Retrieve Friend ]]
247
-  ['conjurearrow']              = {106, 51},  
248
-  ['soulfire']                  = {67, 50},  
249
-  ['explosivearrow']            = {109, 49},  
250
-  ['poisonedarrow']             = {111, 48},  
247
+  ['conjurearrow']              = {106, 51},
248
+  ['soulfire']                  = {67, 50},
249
+  ['explosivearrow']            = {109, 49},
250
+  ['poisonedarrow']             = {111, 48},
251 251
   -- [[ 46 / 47 Unknown ]]
252
-  ['invisible']                 = {94, 45},  
253
-  ['magicshield']               = {124, 44},  
254
-  ['strongicewave']             = {46, 43},  
255
-  ['food']                      = {99, 42},  
252
+  ['invisible']                 = {94, 45},
253
+  ['magicshield']               = {124, 44},
254
+  ['strongicewave']             = {46, 43},
255
+  ['food']                      = {99, 42},
256 256
   -- [[ 40 / 41 Unknown ]]
257
-  ['stronghaste']               = {102, 39},    
258
-  ['creatureillusion']          = {100, 38},    
257
+  ['stronghaste']               = {102, 39},
258
+  ['creatureillusion']          = {100, 38},
259 259
   -- [[ 37 TFS Move ]]
260
-  ['salvation']                 = {60, 36},    
261
-  -- [[ 34 / 35 Unknown ]]  
262
-  ['energywall']                = {84, 33},    
263
-  ['poisonwall']                = {68, 32},    
264
-  ['antidote']                  = {10, 31},  
265
-  ['destroyfield']              = {87, 30},    
266
-  ['curepoison']                = {10, 29},    
267
-  ['firewall']                  = {80, 28},    
268
-  ['energyfield']               = {85, 27},    
269
-  ['poisonfield']               = {69, 26},    
270
-  ['firefield']                 = {81, 25},    
271
-  ['hellscore']                 = {49, 24},    
272
-  ['greatenergybeam']           = {42, 23},    
273
-  ['energybeam']                = {41, 22},    
274
-  ['suddendeath']               = {64, 21},    
275
-  ['findperson']                = {114, 20},    
276
-  ['firewave']                  = {44, 19},    
277
-  ['explosion']                 = {83, 18},    
278
-  ['firebomb']                  = {82, 17},    
279
-  ['greatfireball']             = {78, 16},    
280
-  ['fireball']                  = {79, 15},    
281
-  ['chameleon']                 = {91, 14},    
282
-  ['energywave']                = {43, 13},    
283
-  ['convincecreature']          = {90, 12},    
284
-  ['greatlight']                = {116, 11},    
285
-  ['light']                     = {117, 10},    
286
-  ['summoncreature']            = {118, 9},    
287
-  ['heavymagicmissile']         = {77, 8},    
288
-  ['lightmagicmissile']         = {73, 7},    
289
-  ['haste']                     = {101, 6},    
290
-  ['ultimatehealingrune']       = {62, 5},    
291
-  ['intensehealingrune']        = {74, 4},    
292
-  ['ultimatehealing']           = {1, 3},    
293
-  ['intensehealing']            = {7, 2},    
294
-  ['lighthealing']              = {6, 1}  
260
+  ['salvation']                 = {60, 36},
261
+  -- [[ 34 / 35 Unknown ]]
262
+  ['energywall']                = {84, 33},
263
+  ['poisonwall']                = {68, 32},
264
+  ['antidote']                  = {10, 31},
265
+  ['destroyfield']              = {87, 30},
266
+  ['curepoison']                = {10, 29},
267
+  ['firewall']                  = {80, 28},
268
+  ['energyfield']               = {85, 27},
269
+  ['poisonfield']               = {69, 26},
270
+  ['firefield']                 = {81, 25},
271
+  ['hellscore']                 = {49, 24},
272
+  ['greatenergybeam']           = {42, 23},
273
+  ['energybeam']                = {41, 22},
274
+  ['suddendeath']               = {64, 21},
275
+  ['findperson']                = {114, 20},
276
+  ['firewave']                  = {44, 19},
277
+  ['explosion']                 = {83, 18},
278
+  ['firebomb']                  = {82, 17},
279
+  ['greatfireball']             = {78, 16},
280
+  ['fireball']                  = {79, 15},
281
+  ['chameleon']                 = {91, 14},
282
+  ['energywave']                = {43, 13},
283
+  ['convincecreature']          = {90, 12},
284
+  ['greatlight']                = {116, 11},
285
+  ['light']                     = {117, 10},
286
+  ['summoncreature']            = {118, 9},
287
+  ['heavymagicmissile']         = {77, 8},
288
+  ['lightmagicmissile']         = {73, 7},
289
+  ['haste']                     = {101, 6},
290
+  ['ultimatehealingrune']       = {62, 5},
291
+  ['intensehealingrune']        = {74, 4},
292
+  ['ultimatehealing']           = {1, 3},
293
+  ['intensehealing']            = {7, 2},
294
+  ['lighthealing']              = {6, 1}
295 295
 }
296 296
 
297 297
 VocationNames = {

+ 4
- 4
modules/gamelib/ui/uicreaturebutton.lua View File

@@ -43,17 +43,17 @@ end
43 43
 
44 44
 function UICreatureButton:setup(creature)
45 45
   self.creature = creature
46
-  
46
+
47 47
   local creatureWidget = self:getChildById('creature')
48 48
   local labelWidget = self:getChildById('label')
49 49
   local lifeBarWidget = self:getChildById('lifeBar')
50
-  
50
+
51 51
   labelWidget:setText(creature:getName())
52 52
   creatureWidget:setCreature(creature)
53
-  
53
+
54 54
   self:setId('CreatureButton_' .. creature:getName():gsub('%s','_'))
55 55
   self:setLifeBarPercent(creature:getHealthPercent())
56
-  
56
+
57 57
   self:updateSkull(creature:getSkull())
58 58
   self:updateEmblem(creature:getEmblem())
59 59
 end

+ 6
- 6
modules/gamelib/ui/uiminimap.lua View File

@@ -273,18 +273,18 @@ function UIMinimap:createFlagWindow(pos)
273 273
 
274 274
   flagRadioGroup:selectWidget(flagRadioGroup:getFirstWidget())
275 275
 
276
-  local successFunc = function() 
276
+  local successFunc = function()
277 277
     self:addFlag(pos, flagRadioGroup:getSelectedWidget().icon, description:getText())
278 278
     self:destroyFlagWindow()
279 279
   end
280
-  
281
-  local cancelFunc = function() 
282
-    self:destroyFlagWindow() 
280
+
281
+  local cancelFunc = function()
282
+    self:destroyFlagWindow()
283 283
   end
284
-  
284
+
285 285
   okButton.onClick = successFunc
286 286
   cancelButton.onClick = cancelFunc
287
-  
287
+
288 288
   self.flagWindow.onEnter = successFunc
289 289
   self.flagWindow.onEscape = cancelFunc
290 290
 

+ 1
- 1
src/client/houses.h View File

@@ -100,7 +100,7 @@ public:
100 100
     HouseList getHouseList() { return m_houses; }
101 101
     HouseList filterHouses(uint32 townId);
102 102
 
103
-private:    
103
+private:
104 104
     HouseList m_houses;
105 105
 
106 106
 protected:

+ 1
- 1
src/client/mapview.cpp View File

@@ -87,7 +87,7 @@ void MapView::draw(const Rect& rect)
87 87
     int drawFlags = 0;
88 88
     // First branch:
89 89
     // This is unlikely to be false because a lot of us
90
-    // don't wanna hear their GPU fan while playing a 
90
+    // don't wanna hear their GPU fan while playing a
91 91
     // 2D game.
92 92
     //
93 93
     // Second & Third branch:

+ 1
- 1
src/client/minimap.cpp View File

@@ -412,7 +412,7 @@ void Minimap::saveOtmm(const std::string& fileName)
412 412
                 fin->write(compressBuffer.data(), len);
413 413
             }
414 414
         }
415
-    
415
+
416 416
         // end of file
417 417
         Position invalidPos;
418 418
         fin->addU16(invalidPos.x);

+ 2
- 2
src/client/tile.cpp View File

@@ -161,7 +161,7 @@ void Tile::draw(const Point& dest, float scaleFactor, int drawFlags, LightView *
161 161
     if(drawFlags & Otc::DrawOnTop)
162 162
         for(const ThingPtr& thing : m_things)
163 163
             if(thing->isOnTop())
164
-                thing->draw(dest, scaleFactor, animate, lightView); 
164
+                thing->draw(dest, scaleFactor, animate, lightView);
165 165
 
166 166
     // draw translucent light (for tiles beneath holes)
167 167
     if(hasTranslucentLight() && lightView) {
@@ -482,7 +482,7 @@ ThingPtr Tile::getTopMultiUseThing()
482 482
         if(thing->isForceUse())
483 483
             return thing;
484 484
     }
485
-    
485
+
486 486
     for(uint i = 0; i < m_things.size(); ++i) {
487 487
         ThingPtr thing = m_things[i];
488 488
         if(!thing->isGround() && !thing->isGroundBorder() && !thing->isOnBottom() && !thing->isOnTop()) {

+ 1
- 1
src/client/uiminimap.cpp View File

@@ -65,7 +65,7 @@ bool UIMinimap::setZoom(int zoom)
65 65
     else
66 66
         m_scale = 1;
67 67
     m_layout->update();
68
-    
68
+
69 69
     onZoomChange(zoom, oldZoom);
70 70
     return true;
71 71
 }

+ 1
- 1
src/framework/CMakeLists.txt View File

@@ -237,7 +237,7 @@ set(framework_INCLUDE_DIRS ${framework_INCLUDE_DIRS}
237 237
     ${LUA_INCLUDE_DIR}
238 238
     ${PHYSFS_INCLUDE_DIR}
239 239
     ${OpenSSL_INCLUDE_DIR}
240
-    ${framework_INCLUDE_DIRS} 
240
+    ${framework_INCLUDE_DIRS}
241 241
 )
242 242
 
243 243
 if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")

+ 9
- 9
src/framework/cmake/FindDirectX.cmake View File

@@ -18,15 +18,15 @@
18 18
 if(WIN32) # The only platform it makes sense to check for DirectX SDK
19 19
   include(FindPkgMacros)
20 20
   findpkg_begin(DirectX)
21
-  
21
+
22 22
   # Get path, convert backslashes as ${ENV_DXSDK_DIR}
23 23
   getenv_path(DXSDK_DIR)
24 24
   getenv_path(DIRECTX_HOME)
25 25
   getenv_path(DIRECTX_ROOT)
26 26
   getenv_path(DIRECTX_BASE)
27
-  
27
+
28 28
   # construct search paths
29
-  set(DirectX_PREFIX_PATH 
29
+  set(DirectX_PREFIX_PATH
30 30
     "${DXSDK_DIR}" "${ENV_DXSDK_DIR}"
31 31
     "${DIRECTX_HOME}" "${ENV_DIRECTX_HOME}"
32 32
     "${DIRECTX_ROOT}" "${ENV_DIRECTX_ROOT}"
@@ -43,7 +43,7 @@ if(WIN32) # The only platform it makes sense to check for DirectX SDK
43 43
     DirectX_LIBRARY
44 44
   DirectX_INCLUDE_DIR
45 45
   )
46
-  
46
+
47 47
   find_path(DirectX_INCLUDE_DIR NAMES d3d9.h HINTS ${DirectX_INC_SEARCH_PATH})
48 48
   # dlls are in DirectX_ROOT_DIR/Developer Runtime/x64|x86
49 49
   # lib files are in DirectX_ROOT_DIR/Lib/x64|x86
@@ -61,7 +61,7 @@ if(WIN32) # The only platform it makes sense to check for DirectX SDK
61 61
 
62 62
   # look for dxgi (needed by both 10 and 11)
63 63
   find_library(DirectX_DXGI_LIBRARY NAMES dxgi HINTS ${DirectX_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX_LIBPATH_SUFFIX})
64
-  
64
+
65 65
   # look for d3dcompiler (needed by 11)
66 66
   find_library(DirectX_D3DCOMPILER_LIBRARY NAMES d3dcompiler HINTS ${DirectX_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX_LIBPATH_SUFFIX})
67 67
 
@@ -83,7 +83,7 @@ if(WIN32) # The only platform it makes sense to check for DirectX SDK
83 83
   get_filename_component(DirectX_LIBRARY_DIR "${DirectX_LIBRARY}" PATH)
84 84
   message(STATUS "DX lib dir: ${DirectX_LIBRARY_DIR}")
85 85
     find_library(DirectX_D3D11_LIBRARY NAMES d3d11 HINTS ${DirectX_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX_LIBPATH_SUFFIX})
86
-    find_library(DirectX_D3DX11_LIBRARY NAMES d3dx11 HINTS ${DirectX_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX_LIBPATH_SUFFIX})  
86
+    find_library(DirectX_D3DX11_LIBRARY NAMES d3dx11 HINTS ${DirectX_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX_LIBPATH_SUFFIX})
87 87
   if (DirectX_D3D11_INCLUDE_DIR AND DirectX_D3D11_LIBRARY)
88 88
     set(DirectX_D3D11_FOUND TRUE)
89 89
     set(DirectX_D3D11_INCLUDE_DIR ${DirectX_D3D11_INCLUDE_DIR})
@@ -93,10 +93,10 @@ if(WIN32) # The only platform it makes sense to check for DirectX SDK
93 93
       ${DirectX_DXGI_LIBRARY}
94 94
         ${DirectX_DXERR_LIBRARY}
95 95
         ${DirectX_DXGUID_LIBRARY}
96
-        ${DirectX_D3DCOMPILER_LIBRARY}            
97
-      ) 
96
+        ${DirectX_D3DCOMPILER_LIBRARY}
97
+      )
98 98
     endif ()
99 99
   mark_as_advanced(DirectX_D3D11_INCLUDE_DIR DirectX_D3D11_LIBRARY DirectX_D3DX11_LIBRARY)
100 100
   endif ()
101
-  
101
+
102 102
 endif(WIN32)

+ 1
- 1
src/framework/cmake/FindPkgMacros.cmake View File

@@ -93,7 +93,7 @@ macro(get_debug_names PREFIX)
93 93
   endforeach(i)
94 94
 endmacro(get_debug_names)
95 95
 
96
-# Add the parent dir from DIR to VAR 
96
+# Add the parent dir from DIR to VAR
97 97
 macro(add_parent_dir VAR DIR)
98 98
   get_filename_component(${DIR}_TEMP "${${DIR}}/.." ABSOLUTE)
99 99
   set(${VAR} ${${VAR}} ${${DIR}_TEMP})

+ 1
- 1
src/framework/platform/win32platform.cpp View File

@@ -275,7 +275,7 @@ std::string Platform::getOSName()
275 275
                  else
276 276
                     if(osvi.wProductType == VER_NT_WORKSTATION && osvi.dwMinorVersion == 2)
277 277
                         ret += "Windows 8 ";
278
-                    else 
278
+                    else
279 279
                         ret += "Windows Server 2008 R2 ";
280 280
             }
281 281
 

+ 3
- 3
src/framework/sound/soundmanager.cpp View File

@@ -242,7 +242,7 @@ SoundSourcePtr SoundManager::createSoundSource(const std::string& filename)
242 242
             m_streamFiles[streamSource] = g_asyncDispatcher.schedule([=]() -> SoundFilePtr {
243 243
                 stdext::timer a;
244 244
                 try {
245
-                    return SoundFile::loadSoundFile(filename); 
245
+                    return SoundFile::loadSoundFile(filename);
246 246
                 } catch(std::exception& e) {
247 247
                     g_logger.error(e.what());
248 248
                     return nullptr;
@@ -256,7 +256,7 @@ SoundSourcePtr SoundManager::createSoundSource(const std::string& filename)
256 256
             combinedSource->addSource(streamSource);
257 257
             m_streamFiles[streamSource] = g_asyncDispatcher.schedule([=]() -> SoundFilePtr {
258 258
                 try {
259
-                    return SoundFile::loadSoundFile(filename); 
259
+                    return SoundFile::loadSoundFile(filename);
260 260
                 } catch(std::exception& e) {
261 261
                     g_logger.error(e.what());
262 262
                     return nullptr;
@@ -268,7 +268,7 @@ SoundSourcePtr SoundManager::createSoundSource(const std::string& filename)
268 268
             StreamSoundSourcePtr streamSource(new StreamSoundSource);
269 269
             m_streamFiles[streamSource] = g_asyncDispatcher.schedule([=]() -> SoundFilePtr {
270 270
                 try {
271
-                    return SoundFile::loadSoundFile(filename); 
271
+                    return SoundFile::loadSoundFile(filename);
272 272
                 } catch(std::exception& e) {
273 273
                     g_logger.error(e.what());
274 274
                     return nullptr;

+ 1
- 1
src/framework/stdext/shared_object.h View File

@@ -66,7 +66,7 @@ public:
66 66
     typedef T element_type;
67 67
 
68 68
     shared_object_ptr(): px(nullptr) { }
69
-    shared_object_ptr(T* p, bool add_ref = true) : px(p) { 
69
+    shared_object_ptr(T* p, bool add_ref = true) : px(p) {
70 70
         static_assert(std::is_base_of<shared_object, T>::value, "classes using shared_object_ptr must be a derived of stdext::shared_object");
71 71
         if(px != nullptr && add_ref)
72 72
             this->add_ref();

+ 2
- 2
src/framework/stdext/shared_ptr.h View File

@@ -50,7 +50,7 @@ public:
50 50
     ~shared_base() { }
51 51
 
52 52
     void add_ref() { ++refs; }
53
-    void dec_ref() { 
53
+    void dec_ref() {
54 54
         if(--refs == 0) {
55 55
             delete px;
56 56
             px = nullptr;
@@ -116,7 +116,7 @@ public:
116 116
     T& operator*() const { assert(base != nullptr); return *base->get(); }
117 117
     T* operator->() const { assert(base != nullptr); return base->get(); }
118 118
 
119
-    template<class U> 
119
+    template<class U>
120 120
     shared_ptr& operator=(shared_ptr<U> const& rhs) { shared_ptr(rhs).swap(*this); return *this; }
121 121
     shared_ptr& operator=(shared_ptr const& rhs) { shared_ptr(rhs).swap(*this); return *this; }
122 122
     shared_ptr& operator=(T* rhs) { shared_ptr(rhs).swap(*this); return *this; }

+ 25
- 25
tools/tfs_extendedopcode.patch View File

@@ -3,7 +3,7 @@ index cd479e4..8d46b23 100644
3 3
 --- a/const.h
4 4
 +++ b/const.h
5 5
 @@ -21,9 +21,12 @@
6
- 
6
+
7 7
  enum OperatingSystem_t
8 8
  {
9 9
 -	CLIENTOS_LINUX		= 0x01,
@@ -16,7 +16,7 @@ index cd479e4..8d46b23 100644
16 16
 +	CLIENTOS_OTCLIENT_WINDOWS	= 0x0B,
17 17
 +	CLIENTOS_OTCLIENT_MAC		= 0x0C,
18 18
  };
19
- 
19
+
20 20
  enum ChannelEvent_t
21 21
 diff --git a/creatureevent.cpp b/creatureevent.cpp
22 22
 index 842b237..e9b2200 100644
@@ -28,7 +28,7 @@ index 842b237..e9b2200 100644
28 28
  		_type = CREATURE_EVENT_PREPAREDEATH;
29 29
 +	else if(type == "extendedopcode")
30 30
 +		_type = CREATURE_EVENT_EXTENDED_OPCODE;
31
- 
31
+
32 32
  	return _type;
33 33
  }
34 34
 @@ -330,6 +332,8 @@ std::string CreatureEvent::getScriptEventName() const
@@ -119,7 +119,7 @@ index f1ff4b2..cc5171c 100644
119 119
 +	CREATURE_EVENT_PREPAREDEATH,
120 120
 +	CREATURE_EVENT_EXTENDED_OPCODE // otclient additional network opcodes
121 121
  };
122
- 
122
+
123 123
  enum StatsChange_t
124 124
 @@ -150,6 +151,7 @@ class CreatureEvent : public Event
125 125
  		uint32_t executeKill(Creature* creature, Creature* target, const DeathEntry& entry);
@@ -127,14 +127,14 @@ index f1ff4b2..cc5171c 100644
127 127
  		uint32_t executePrepareDeath(Creature* creature, DeathList deathList);
128 128
 +		uint32_t executeExtendedOpcode(Creature* creature, uint8_t opcode, const std::string& buffer);
129 129
  		//
130
- 
130
+
131 131
  	protected:
132 132
 diff --git a/data/creaturescripts/creaturescripts.xml b/data/creaturescripts/creaturescripts.xml
133 133
 index 363c62b..c706f10 100644
134 134
 --- a/data/creaturescripts/creaturescripts.xml
135 135
 +++ b/data/creaturescripts/creaturescripts.xml
136 136
 @@ -14,4 +14,6 @@
137
- 
137
+
138 138
  	<event type="think" name="Idle" event="script" value="idle.lua"/>
139 139
  	<event type="think" name="SkullCheck" event="script" value="skullcheck.lua"/>
140 140
 +
@@ -164,7 +164,7 @@ index 2e4dc2c..7508591 100644
164 164
 --- a/game.cpp
165 165
 +++ b/game.cpp
166 166
 @@ -6951,3 +6951,12 @@ void Game::checkExpiredMarketOffers()
167
- 
167
+
168 168
  	Scheduler::getInstance().addEvent(createSchedulerTask(checkExpiredMarketOffersEachMinutes * 60 * 1000, boost::bind(&Game::checkExpiredMarketOffers, this)));
169 169
  }
170 170
 +
@@ -185,7 +185,7 @@ index 51fa397..7192549 100644
185 185
 @@ -646,6 +646,8 @@ class Game
186 186
  		std::map<Item*, int32_t> grounds;
187 187
  #endif
188
- 
188
+
189 189
 +		void parsePlayerExtendedOpcode(uint32_t playerId, uint8_t opcode, const std::string& buffer);
190 190
 +
191 191
  	protected:
@@ -198,7 +198,7 @@ index 4cb8c8d..4ed9391 100644
198 198
 @@ -2476,6 +2476,12 @@ void LuaInterface::registerFunctions()
199 199
  	//getConfigFile()
200 200
  	lua_register(m_luaState, "getConfigFile", LuaInterface::luaGetConfigFile);
201
- 
201
+
202 202
 +	//isPlayerUsingOtclient(cid)
203 203
 +	lua_register(m_luaState, "isPlayerUsingOtclient", LuaInterface::luaIsPlayerUsingOtclient);
204 204
 +
@@ -207,11 +207,11 @@ index 4cb8c8d..4ed9391 100644
207 207
 +
208 208
  	//getConfigValue(key)
209 209
  	lua_register(m_luaState, "getConfigValue", LuaInterface::luaGetConfigValue);
210
- 
210
+
211 211
 @@ -9471,6 +9477,32 @@ int32_t LuaInterface::luaGetMountInfo(lua_State* L)
212 212
  	return 1;
213 213
  }
214
- 
214
+
215 215
 +int32_t LuaInterface::luaIsPlayerUsingOtclient(lua_State* L)
216 216
 +{
217 217
 +	//isPlayerUsingOtclient(cid)
@@ -248,7 +248,7 @@ index 234091a..0a0046f 100644
248 248
 @@ -697,6 +697,9 @@ class LuaInterface
249 249
  		static int32_t luaDoPlayerSetMounted(lua_State* L);
250 250
  		static int32_t luaGetMountInfo(lua_State* L);
251
- 
251
+
252 252
 +		static int32_t luaIsPlayerUsingOtclient(lua_State* L);
253 253
 +		static int32_t luaDoSendPlayerExtendedOpcode(lua_State* L);
254 254
 +
@@ -262,7 +262,7 @@ index 917e36a..3671750 100644
262 262
 @@ -171,16 +171,16 @@ Position NetworkMessage::getPosition()
263 263
  	return pos;
264 264
  }
265
- 
265
+
266 266
 -void NetworkMessage::putString(const char* value, bool addSize/* = true*/)
267 267
 +void NetworkMessage::putString(const char* value, int length, bool addSize/* = true*/)
268 268
  {
@@ -270,10 +270,10 @@ index 917e36a..3671750 100644
270 270
 +	uint32_t size = (uint32_t)length;
271 271
  	if(!hasSpace(size + (addSize ? 2 : 0)) || size > 8192)
272 272
  		return;
273
- 
273
+
274 274
  	if(addSize)
275 275
  		put<uint16_t>(size);
276
- 
276
+
277 277
 -	strcpy((char*)(m_buffer + m_position), value);
278 278
 +	memcpy((char*)(m_buffer + m_position), value, length);
279 279
  	m_position += size;
@@ -286,14 +286,14 @@ index 6cf8ee1..615f094 100644
286 286
 @@ -80,8 +80,8 @@ class NetworkMessage
287 287
  			m_size += sizeof(T);
288 288
  		}
289
- 
289
+
290 290
 -		void putString(const std::string& value, bool addSize = true) {putString(value.c_str(), addSize);}
291 291
 -		void putString(const char* value, bool addSize = true);
292 292
 +		void putString(const std::string& value, bool addSize = true) {putString(value.c_str(), value.length(), addSize);}
293 293
 +		void putString(const char* value, int length, bool addSize = true);
294
- 
294
+
295 295
  		void putPadding(uint32_t amount);
296
- 
296
+
297 297
 diff --git a/player.h b/player.h
298 298
 index 63e9183..7cb8313 100644
299 299
 --- a/player.h
@@ -301,7 +301,7 @@ index 63e9183..7cb8313 100644
301 301
 @@ -228,6 +228,7 @@ class Player : public Creature, public Cylinder
302 302
  		bool hasPVPBlessing() const {return pvpBlessing;}
303 303
  		uint16_t getBlessings() const;
304
- 
304
+
305 305
 +		bool isUsingOtclient() const { return operatingSystem >= CLIENTOS_OTCLIENT_LINUX; }
306 306
  		OperatingSystem_t getOperatingSystem() const {return operatingSystem;}
307 307
  		void setOperatingSystem(OperatingSystem_t os) {operatingSystem = os;}
@@ -309,7 +309,7 @@ index 63e9183..7cb8313 100644
309 309
 @@ -580,6 +581,9 @@ class Player : public Creature, public Cylinder
310 310
  		void sendSpellGroupCooldown(SpellGroup_t groupId, uint32_t cooldown)
311 311
  			{if(client) client->sendSpellGroupCooldown(groupId, cooldown);}
312
- 
312
+
313 313
 +		void sendExtendedOpcode(uint8_t opcode, const std::string& buffer)
314 314
 +			{if(client) client->sendExtendedOpcode(opcode, buffer);}
315 315
 +
@@ -323,7 +323,7 @@ index b980be0..7a84f61 100644
323 323
 @@ -263,6 +263,11 @@ bool ProtocolGame::login(const std::string& name, uint32_t id, const std::string
324 324
  			return false;
325 325
  		}
326
- 
326
+
327 327
 +		if(player->isUsingOtclient())
328 328
 +		{
329 329
 +			player->registerCreatureEvent("ExtendedOpcode");
@@ -335,18 +335,18 @@ index b980be0..7a84f61 100644
335 335
 @@ -427,6 +432,10 @@ void ProtocolGame::onRecvFirstMessage(NetworkMessage& msg)
336 336
  	enableXTEAEncryption();
337 337
  	setXTEAKey(key);
338
- 
338
+
339 339
 +	// notifies to otclient that this server can receive extended game protocol opcodes
340 340
 +	if(operatingSystem >= CLIENTOS_OTCLIENT_LINUX)
341 341
 +		sendExtendedOpcode(0x00, std::string());
342 342
 +
343 343
  	bool gamemaster = (msg.get<char>() != (char)0);
344 344
  	std::string name = msg.getString(), character = msg.getString(), password = msg.getString();
345
- 
345
+
346 346
 @@ -578,6 +587,10 @@ void ProtocolGame::parsePacket(NetworkMessage &msg)
347 347
  				parseReceivePing(msg);
348 348
  				break;
349
- 
349
+
350 350
 +			case 0x32: // otclient extended opcode
351 351
 +				parseExtendedOpcode(msg);
352 352
 +				break;
@@ -390,7 +390,7 @@ index 7691174..48b9bf1 100644
390 390
 @@ -326,6 +326,9 @@ class ProtocolGame : public Protocol
391 391
  		//shop
392 392
  		void AddShopItem(NetworkMessage_ptr msg, const ShopInfo& item);
393
- 
393
+
394 394
 +		void parseExtendedOpcode(NetworkMessage& msg);
395 395
 +		void sendExtendedOpcode(uint8_t opcode, const std::string& buffer);
396 396
 +

Loading…
Cancel
Save