177 Commits

Author SHA1 Message Date
BenDol
dbed09cb55 Update to 0.6.6 2014-11-03 12:57:19 +13:00
BenDol
9f3ebb0036 Fix #577 dash will now fire onWalk (with isDash parameter).
Also added missing client versions.
2014-11-03 12:23:00 +13:00
BenDol
ddb5e58057 Fix #569 finally had some free time. 2014-11-03 08:51:01 +13:00
Sam
4e5707720b Merge pull request #574 from diath/patch-console
Support upper and lower case letters for hotkeys starting with #s, #y and #w
2014-10-05 20:50:29 +02:00
Sam
e9628187f2 Merge pull request #573 from diath/patch-textwindow
Hide item image box when editing house lists
2014-10-05 20:50:03 +02:00
Kamil Chojnowski
c8f9cdd6fa Support upper and lower case letters for hotkeys starting with #s, #y and #w 2014-10-05 19:27:02 +02:00
Kamil Chojnowski
7cfa9c38e0 Hide item image box when editing house lists 2014-10-05 19:24:34 +02:00
Ben Dol
7cc368305f Merge pull request #571 from dominique120/master
Fix compilation problem when compiling without FW_SOUND flag.
2014-09-30 09:12:24 +13:00
Dominique Verellen
682694cc07 Update graphicalapplication.cpp 2014-09-29 11:28:13 -05:00
Konrad Kuśnierz
12c4677912 indentations fix 2014-09-15 16:28:25 +02:00
Konrad Kuśnierz
0e0ae6c083 Merge pull request #566 from cymruu/master
Corrected polish locales a bit
2014-09-15 16:24:42 +02:00
Filip Bachul
49d62b8225 corrected polish locales a bit 2014-09-15 14:42:10 +02:00
Eduardo Bart
0909e186a1 Merge pull request #559 from osmarjunior/master
Fix bug when drawing mounts while walking
2014-08-22 09:48:31 -03:00
osmarjunior
3557879361 Fix bug when drawing mounts while walking 2014-08-22 08:36:55 -03:00
Ben Dol
fa317c534d Merge pull request #548 from Shawak/master
string:contains()
2014-08-10 16:55:51 +12:00
Sam
119abec1cf Fix locales/es.lua, fixes #553 2014-08-08 16:46:35 +02:00
Sam
92beee10d3 Revert "Update locales/es.lua, fixes #533"
This reverts commit c110f32993.
2014-08-08 16:45:08 +02:00
Sam
c110f32993 Update locales/es.lua, fixes #533 2014-08-08 16:41:36 +02:00
Ben Dol
a18970dceb Merge pull request #549 from edubart/1050_impl
1050 Implementation and Fixes (excluding new animation features)
Can now login to Cipservers no problem.
2014-08-07 08:27:03 +12:00
BenDol
d3d3294277 Added missing premium trigger opcode. 2014-08-07 07:17:16 +12:00
BenDol
ef7f94ac76 Some minor changes/additions. 2014-08-07 06:40:56 +12:00
Sam
9fcc4c7355 Fix typo in gameinterface.lua 2014-08-05 19:37:09 +02:00
BenDol
751cb0ca8b Fix for #545 2014-08-06 02:40:13 +12:00
BenDol
3343919c92 Added GameEnhancedAnimations to lua 2014-08-04 00:13:23 +12:00
BenDol
4eb7668922 Can now login to official tibia servers. 2014-08-03 23:46:07 +12:00
BenDol
c706dc12fe Update PIC_SIGNATURE can now access the character list. 2014-08-03 23:38:25 +12:00
BenDol
1f272b7aba Added preview state packet. 2014-08-03 23:22:06 +12:00
BenDol
09d830d02e Fix build error 2014-08-03 10:10:33 +12:00
BenDol
d7429c201c Started 1050 implementation and fix ups:
* Dat now loads (new animations aren't yet functional).
* Fixed the way we reference client versions.

TODO: Write new animation functionality & find out protocol changes.
2014-08-03 10:02:28 +12:00
Shawak
939e16c59a string:contains() 2014-07-31 20:25:31 +02:00
Sam
fe585d27d8 Cleanup dat loading, fix version 8.6+ 2014-07-30 17:06:40 +02:00
Sam
e9352fe811 Update README.md 2014-07-30 16:43:46 +02:00
BenDol
a52c938fef Added missing protocol versions & made some style fixes. 2014-07-30 19:58:34 +12:00
Sam
153cf3e859 Container fix 2014-07-29 21:11:56 +02:00
Sam
6b46370d1a 7.4 .dat support, playing an actual server might not work yet 2014-07-29 21:11:17 +02:00
BenDol
c2ff89b2cf Some style fixes & menu-scroll to add server. 2014-07-26 21:56:51 +12:00
Sam
2a57a5f7d0 Browse field, locked & paginated container support 2014-07-15 23:27:44 +02:00
Henrique Santiago
32d1ed5c6a Merge pull request #542 from mathiasbynens/patch-1
README: Use SVG badge for Travis
2014-07-14 18:03:34 -03:00
Mathias Bynens
6d8d319557 README: Use SVG badge for Travis 2014-07-14 21:34:03 +02:00
BenDol
9e0ddb08e3 More debug prints and avoid null pointer. 2014-07-14 01:56:17 +12:00
BenDol
74979ca16a Remove debug print and redundant checks. 2014-07-13 23:12:56 +12:00
BenDol
0c77179c46 Should check the menu category before creating a separator. 2014-07-13 22:57:45 +12:00
BenDol
935b9e4cd6 Forgot removeMenuHook function. 2014-07-13 22:39:56 +12:00
BenDol
0f362f80e3 Added easy menu hooking, fixed terminal default size/pos & more:
* Added autowalk style option to Minimap style.
* Added onCreate for setting up variables before styling is applied etc.
2014-07-13 22:27:09 +12:00
BenDol
0b5654f870 Style fixes and added dontSignal to UIRadioGroup. 2014-07-13 07:38:44 +12:00
Sam
4ec5048730 Remove test statement 2014-07-12 18:47:35 +02:00
Sam
6b8e810466 Merge branch 'master' of https://github.com/edubart/otclient 2014-07-12 18:44:15 +02:00
Sam
9b3e0a324c Color adjustments and fixes 2014-07-12 18:44:02 +02:00
BenDol
f7531383f3 Fix an issue with the spinbox buttons. 2014-07-13 03:57:38 +12:00
BenDol
7724b8059d Forgot this from previous commit. 2014-07-13 02:10:30 +12:00
BenDol
2ada93db9c Should use the set minimum for these! 2014-07-13 02:08:33 +12:00
BenDol
d070711409 When reaching max or min scroll allow other scroll areas to scroll. 2014-07-13 02:06:36 +12:00
BenDol
5909634837 Avoid ending mouse scroll chain when scroll bar is 'off'.
Also added mouse-scroll style to UISpinBox.
2014-07-13 01:46:47 +12:00
BenDol
07ac5c27ca Added some missing lua functions. 2014-07-12 01:03:21 +12:00
BenDol
9f7aafac0b Fix a crash issue when attempting to draw invalid item.
This can happen when using UIItem as interfaces etc.
2014-07-11 16:19:30 +12:00
BenDol
12b3bd4ee0 Fix table.equals 2014-07-09 17:00:10 +12:00
BenDol
9e30c39035 Pointless storing a reference to super. 2014-07-09 05:51:17 +12:00
BenDol
3dbcb1daee Added basic table.equals, dontSignal param to combobox calls & spell methods. 2014-07-09 04:07:02 +12:00
Sam
a9d4fd5e1e Scrollmenu for Comboboxes, fixes #480 2014-07-03 18:15:38 +02:00
Eduardo Bart
07f8e6fca9 New skin from https://github.com/Mignari/otc-gray-skin 2014-07-02 13:20:02 -03:00
Henrique Santiago
f0ed0bad13 Merge pull request #538 from djayk1/master
Fix premium expiration protocol version
2014-06-29 13:43:56 -03:00
djayk1
8fccc1eb63 Little fix 2014-06-29 11:25:01 -03:00
Sam
62d2a22ab8 Merge pull request #537 from djayk1/master
1041 Login Support
2014-06-23 18:22:55 +02:00
djayk1
10438c21ff Update game.cpp 2014-06-23 12:20:12 -03:00
djayk1
ec99d35cee Update game.cpp 2014-06-23 12:19:12 -03:00
djayk1
85fe5867f3 Update protocolgameparse.cpp 2014-06-23 12:07:38 -03:00
djayk1
1a77473e13 Update const.h 2014-06-23 12:05:35 -03:00
djayk1
cc483fba5a Update game.cpp 2014-06-23 12:04:30 -03:00
djayk1
94686d3fe8 Update protocolgameparse.cpp 2014-06-23 11:39:43 -03:00
djayk1
468ac9cbd2 Update game.cpp 2014-06-23 11:38:15 -03:00
djayk1
9f8293a5a0 Update game.lua 2014-06-23 11:35:52 -03:00
BenDol
ce9e443c60 Remove redundant classes & added some Position methods. 2014-06-10 01:44:03 +12:00
BenDol
99b1ddf44c Must change UIMap class checks to UIGameMap. 2014-06-07 05:05:57 +12:00
BenDol
c083d02bef Some fixes for class names and queue (added base class). 2014-06-07 04:10:14 +12:00
BenDol
00253e46b3 Added Queue class for event queuing (see CandyBot for examples of this). 2014-06-04 02:17:49 +12:00
BenDol
d2b7de3801 Will stick to basic isInRange check function. 2014-06-02 11:43:29 +12:00
BenDol
adcf258551 Forgot to add this. 2014-06-02 10:05:26 +12:00
BenDol
2df51622ba Some improvements to some things. 2014-06-02 10:04:56 +12:00
BenDol
a7d7667491 Added gamelib for Position functions. 2014-06-01 18:11:52 +12:00
BenDol
0ad45d6826 Added 2 global functions for Position & g_map.getTiles(). 2014-05-31 15:47:18 +12:00
Sam
f23e70ff08 Fix battlelist square bug / Cleanup 2014-05-29 03:17:48 +02:00
Sam
b96be291bb Fix use-with issue #508 2014-05-10 17:10:07 +02:00
Henrique Santiago
72b3403728 Fix filestream read 2014-05-09 18:56:15 -03:00
Henrique Santiago
b1964a1c10 Merge pull request #522 from Mignari/master
Fix calculate patterns, closes #520
2014-04-21 00:24:22 -03:00
Nail
25fb3113fa Fix calculate patterns. 2014-04-20 23:58:26 -03:00
BenDol
24acf8855f Now possible to create effects and missiles via lua. 2014-04-20 13:26:05 +12:00
BenDol
06855dd1de Added subType for Player:getItem/getItems. 2014-04-20 07:45:10 +12:00
BenDol
65d556ef4e Fixed issue with isAttacking and isFollowing on older protocols.
Some protocols don't send a cancel attack/follow packet to the client when a creature dies.
2014-04-20 04:36:52 +12:00
BenDol
54b8e362d5 Fix missing reference for VS project. 2014-04-10 19:14:08 +12:00
BenDol
45b41b88bd Merge branch 'master' of https://github.com/edubart/otclient 2014-04-06 15:29:23 +12:00
BenDol
1baad726ae Just use g_configs.unload(config) to unload config files.
Avoids concurrent modification errors.
2014-04-06 15:29:02 +12:00
Henrique Santiago
b19fb22146 Merge pull request #514 from Mignari/master
Fix alpha at color key.
2014-04-04 16:54:37 -03:00
Nail
8dec9cd835 Fix alpha at color key. 2014-04-04 16:28:56 -03:00
Henrique Santiago
50d3f83fce Merge pull request #513 from Mignari/master
Per-pixel transparency, fix image blit.
2014-04-04 14:30:09 -03:00
Nail
41b2f9b911 Per-pixel transparency. 2014-04-04 12:58:12 -03:00
BenDol
a02c091376 Fix stop crashing with UIWidget::moveChildToIndex. 2014-04-04 11:33:17 +13:00
BenDol
01e6169cfb Fix to setText method. 2014-04-04 04:49:44 +13:00
BenDol
1074b6b787 Provide the option to suppress lua call in setText 2014-04-03 05:20:35 +13:00
BenDol
d45fbcb10f Fixed terminal size bug 2014-04-02 20:50:36 +13:00
Henrique Santiago
f334a03397 Merge pull request #510 from edubart/configs_impl
Implementing ability to load custom config files
2014-04-01 13:23:56 -03:00
BenDol
3ce37dacbd Removed onUnload from corelib and added more lua bindings for resources. 2014-04-02 05:20:18 +13:00
BenDol
166eb7614f Fix accidental cmake changes. 2014-04-02 03:04:10 +13:00
BenDol
8b3f3b11f0 Can now unload a Config by config:unload() 2014-04-02 02:34:12 +13:00
BenDol
2d84fae2c8 Can now create new configs on the fly using: local config = g_configs.create(file) 2014-04-02 01:54:13 +13:00
BenDol
5204e3ac03 Proper termination and initialization of the ConfigManager. 2014-04-02 00:30:17 +13:00
BenDol
547b18db9a Update copyright for 2014 2014-04-01 18:36:42 +13:00
BenDol
37f9d3e200 Fix building issues. 2014-04-01 18:09:25 +13:00
BenDol
4b24c78f0f Fix to the makesingleton function. 2014-04-01 17:22:00 +13:00
BenDol
994f49b3c1 Better implementation for forming the singleton wrapper. 2014-04-01 17:08:07 +13:00
BenDol
79ee0e34ea Keep g_settings as a 'static' variable rather than a direct object. 2014-04-01 16:51:38 +13:00
BenDol
b295053662 Finished stable implementation (as far as tested), still requires more testing. 2014-04-01 16:27:33 +13:00
BenDol
61059e66ec Started implementing ability to load custom config files (currently unstable).
Feel free to help out with this if you like :)
2014-04-01 05:43:31 +13:00
Eduardo Bart
f4de000646 Merge pull request #504 from Shawak/master
Ability to get buffer from inputmessage
2014-03-22 18:38:40 -03:00
Shawak
d20c263912 Ability to get buffer from inputmessage 2014-03-22 18:09:11 +01:00
Shawak
07e40afa3d Ability to get buffer from inputmessage 2014-03-22 18:07:13 +01:00
Shawak
8179915e06 Ability to get buffer from inputmessage 2014-03-22 18:05:32 +01:00
Sam
4f79a30689 Remove print from purse code 2014-03-13 00:13:39 +01:00
Sam
a58a3e90c8 Implement purse slot (closes #208), add version 10.37 (could not find protocol changes) 2014-03-12 15:46:35 +01:00
Sam
8d8f32b081 Partial 10.36 support, also fix #499 2014-03-12 06:39:20 +01:00
Sam
9d866a3616 Merge pull request #501 from conde2/master
Fix protocol erros and try to fix walk delay
2014-03-11 21:56:07 +01:00
conde2
0fbba70003 Fix protocol erros and try to fix walk delay
Not implemented CreaturesType, just fixed the protocol error reported in
#493, also try to fix #499 and #461
2014-03-11 17:18:50 -03:00
Henrique Santiago
598a7edf6b Merge pull request #497 from Faith2531/patch-1
Update game.cpp
2014-03-03 12:04:09 -03:00
Sam
b415b73b4a Fix creature marks. Thanks to @dalkon 2014-03-03 15:54:58 +01:00
Faith2531
b6d8ede854 Update game.cpp
changed max supported protocol to 10.35
2014-03-03 11:50:47 +01:00
Sam
d64a682e74 Merge pull request #490 from conde2/master
Support for newer versions and light draw fix
2014-02-24 19:44:57 +01:00
conde2
d080432e14 Support for newer versions and light draw fix
Avoid drawing light under covered tiles.
2014-02-24 15:33:29 -03:00
Sam
8bd1293be7 Tiny topmenu fix 2014-02-22 02:21:09 +01:00
Sam
ce411ec871 Merge pull request #484 from LordHepipud/patch-3
Fix Tile::getTopUseThing()
2014-02-18 16:34:21 +01:00
LordHepipud
82a5989f5c Fix Tile::getTopLookThing()
Fixing an issue which returned splash items instead of real usable items.
In case a blood splash is inside an open door, you are unable to close it. This patch will ignore splash items and return the real usable item correctly.

~~~~Lord Hepipud~~~~
2014-02-17 22:51:59 +01:00
Eduardo Bart
bb514d3acb Optimize path finding upto 100x performance again 2014-02-16 13:58:26 -03:00
Ahmed Samy
c96b717273 Fix library installation 2014-02-16 16:02:46 +02:00
Ahmed Samy
d245b7fb29 Revert "Build framework dynamically by default"
This reverts commit edde71fc09.
2014-02-13 17:43:03 +02:00
Ahmed Samy
edde71fc09 Build framework dynamically by default 2014-02-13 14:35:02 +02:00
Henrique Santiago
b7b8fdfd0c Fix BinaryTree skip, small otb changes 2014-02-13 00:42:06 -02:00
Ahmed Samy
8dc831088e CMake: Optional static/shared linkage for the framework lib 2014-02-12 22:31:18 +02:00
Ahmed Samy
c07d448aac CMake: Build framework independently from OTClient then link OTC against
it.

Now framework is built as a static library which should hopefully speed up
the build (in terms of compiling and linking).
2014-02-12 21:09:40 +02:00
Eduardo Bart
57a330e589 Fix path finding issue introduced by PR #470 2014-02-11 19:28:01 -02:00
Eduardo Bart
64437e4e1a Fix #476 2014-02-11 18:16:50 -02:00
Ahmed Samy
96f3bcb42b Merge https://github.com/shirayukikitsune/otclient
* https://github.com/shirayukikitsune/otclient:
  And do not delete curly brackets.
  Meh, spacing.
  Even more fixes
  Optimizations in Map::findPath
  More fixes in Map::findPath
  Fixes heap corruption in Map::findPath
2014-02-11 15:55:23 +02:00
Ahmed Samy
c8b4566194 TextEdit: If cursor pos reaches end, move to start, and the opposite 2014-02-10 08:05:45 +02:00
Sam
d30ff220f6 Fix market anchoring, closes #464 2014-02-06 14:04:22 +01:00
sakagushi
f0fbd4790f And do not delete curly brackets. 2014-02-06 04:36:39 -02:00
sakagushi
cb1f28a3a3 Meh, spacing. 2014-02-06 04:34:54 -02:00
sakagushi
cc1e3c534e Even more fixes
Forgot to clean the garbage generated in the last commit.
2014-02-06 04:34:04 -02:00
sakagushi
f4f79f47bd Optimizations in Map::findPath 2014-02-06 03:57:17 -02:00
sakagushi
ff617c3fab More fixes in Map::findPath
Fixed the styling, std::unique and removed the priority_queue comment
2014-02-06 03:36:19 -02:00
sakagushi
43524a9127 Fixes heap corruption in Map::findPath 2014-02-06 02:08:10 -02:00
Sam
48ff67dc06 Fix useWith issue 2014-01-25 22:14:01 +01:00
Sam
8bd154b604 Merge pull request #452 from conde2/master
Temporary fix for async
2014-01-24 10:26:28 -08:00
conde2
9da018fdff Temporary fix for async
This should be fixed in server side, until that we just don't need to
use.
2014-01-24 00:19:08 -02:00
Sam
4f4788c1c3 Fix WritableDate to correct version (at least I hope so), fixes #446 2014-01-21 23:13:07 +01:00
Sam
d0d8c9a081 Bind adjustments, some fixes 2014-01-21 22:12:50 +01:00
Henrique Santiago
f3b5adbf40 Merge pull request #447 from conde2/master
Fix compilation under MSVC, bind some fucntions
2014-01-21 13:01:56 -08:00
Sam
38c9b6b0b2 Luacasts for Light 2014-01-21 22:01:11 +01:00
conde2
79be0eca73 Fix compilation under MSVC, bind some fucntions 2014-01-21 18:33:22 -02:00
Sam
9bd02ca8ba Added method to export a ThingType as png :exportImage(fileName) 2014-01-21 12:11:19 +01:00
Sam
f12ecd8404 Implemented a function to save .dat file 2014-01-21 11:10:02 +01:00
Sam
53803b2218 Implemented a function to save .spr file 2014-01-20 23:51:15 +01:00
Sam
67c2453c82 savePNG method for Image 2014-01-20 23:04:49 +01:00
Sam
455000c02d Fix save_png definition / New UISprite function 2014-01-20 22:48:50 +01:00
Sam
a2684cce7c Update gamelib 2014-01-20 22:27:20 +01:00
Sam
27ae54d7d6 Lua call for loading .spr, .dat, .otb 2014-01-18 18:38:13 +01:00
Sam
aec577a4b4 Merge pull request #442 from d33tah/master
Get rid of trailing whitespace.
2014-01-18 08:11:03 -08:00
Ahmed Samy
6f467d5a1b Sort town/house names 2014-01-18 17:57:42 +02:00
Jacek Wielemborek
e6c9e78935 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'
2014-01-18 15:09:26 +01:00
Sam
3750a85c5f Fix for version 8.40 2014-01-17 22:41:58 +01:00
Sam
03de13d618 Duplicate lua function removed 2014-01-16 22:11:42 +01:00
Eduardo Bart
1588bc4cae Merge pull request #436 from diath/patch-tabs
Make tab navigation more intuitive
2014-01-15 05:48:07 -08:00
Kamil Chojnowski
b718ae0423 Update tabs navigation to take offscreen tabs into account 2014-01-15 04:56:42 +01:00
Eduardo Bart
a8f540cf29 Merge pull request #437 from diath/patch-hotkeys
Update hotkeys behavior
2014-01-14 18:16:54 -08:00
Kamil Chojnowski
e6a1fabdd3 Update hotkeys behavior 2014-01-15 02:54:50 +01:00
Kamil Chojnowski
291960d159 Make tab navigation more intuitive 2014-01-15 02:32:02 +01:00
Sam
20b68c6a42 Vip functionality, closes #83 2014-01-14 23:15:01 +01:00
Ahmed Samy
e4ba805e00 deleteSpawn() 2014-01-14 11:04:48 +02:00
Ahmed Samy
93be0f975f getCreatures / getSpawns 2014-01-14 01:47:43 +02:00
Sam
cbfeef39bc Effects now use x and y pattern, fixes #433 2014-01-13 16:03:42 +01:00
Sam
d7dfa2220e GMAction fix 2014-01-08 17:25:05 +01:00
464 changed files with 3822 additions and 1577 deletions

View File

@@ -1,7 +1,8 @@
cmake_minimum_required(VERSION 2.6)
project(otclient)
set(VERSION "0.6.5")
set(VERSION "0.6.6")
set(LIB_NAME "otc_framework")
option(FRAMEWORK_SOUND "Use SOUND " ON)
option(FRAMEWORK_GRAPHICS "Use GRAPHICS " ON)
@@ -35,11 +36,20 @@ endif()
add_definitions(-D"VERSION=\\"${VERSION}\\"")
# we want framework to be a library for faster compilation/linking
if(USE_STATIC_LIBS)
add_library(${LIB_NAME} ${framework_SOURCES})
else()
add_library(${LIB_NAME} SHARED ${framework_SOURCES})
message(STATUS "Linking to shared ${LIB_NAME}, make sure you copy the DLL/SO/dylib with the executable!")
endif()
target_link_libraries(${LIB_NAME} ${framework_LIBRARIES})
# add client executable
add_executable(${PROJECT_NAME} ${framework_SOURCES} ${client_SOURCES} ${executable_SOURCES})
add_executable(${PROJECT_NAME} ${client_SOURCES} ${executable_SOURCES})
# target link libraries
target_link_libraries(${PROJECT_NAME} ${framework_LIBRARIES})
target_link_libraries(${PROJECT_NAME} ${LIB_NAME})
if(USE_PCH)
include(cotire)
@@ -51,7 +61,10 @@ endif()
# installation
set(DATA_INSTALL_DIR share/${PROJECT_NAME})
install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin)
install(TARGETS ${PROJECT_NAME} ${LIB_NAME}
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
install(FILES README.md BUGS LICENSE AUTHORS init.lua ${PROJECT_NAME}rc.lua DESTINATION ${DATA_INSTALL_DIR})
install(DIRECTORY data modules DESTINATION ${DATA_INSTALL_DIR} PATTERN ".git" EXCLUDE)

View File

@@ -1,4 +1,4 @@
[![Build Status](https://secure.travis-ci.org/edubart/otclient.png?branch=master)](http://travis-ci.org/edubart/otclient)
[![Build Status](https://secure.travis-ci.org/edubart/otclient.svg?branch=master)](http://travis-ci.org/edubart/otclient)
### What is otclient?
Otclient is an alternative Tibia client for usage with otserv. It aims to be complete and flexible,
@@ -10,13 +10,15 @@ Otclient is written in C++2011, the upcoming C++ standard and heavily scripted i
### Where do I download?
The latest commits compiled for Windows can be found here.
* [Windows Builds](http://otland.net/threads/otclient-builds-windows.217977/)
Here is the latest v0.6.5 release compiled for both i686(32 bit) and x86_64(64 bit) machines, with OpenGL renderer.
This release is compatible with protocols ranges from 7.60 up to 10.31.
* [For Windows](https://www.dropbox.com/sh/se1okacemoqzjve/XFqFoSKLCg/otclient-win-0.6.5.zip)
* [For Linux](https://www.dropbox.com/sh/se1okacemoqzjve/xKJL7j6vEo/otclient-linux-0.6.5.tar.gz)
**NOTE:** You will need to download spr/dat files on your own and place them in `data/things/VER/` (i.e: `data/things/1031/Tibia.spr`)
**NOTE:** You will need to download spr/dat files on your own and place them in `data/things/VERSION/` (i.e: `data/things/1041/Tibia.spr`)
Older releases can be downloaded from [here](https://www.dropbox.com/sh/se1okacemoqzjve/-oWK4YFm03)

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 795 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 349 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 409 B

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 315 B

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 409 B

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 281 B

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 470 B

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 548 B

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 457 B

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 241 B

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 197 B

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 646 B

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 139 B

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 673 B

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 696 B

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 415 B

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 197 B

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

@@ -34,8 +34,8 @@ locale = {
["Add"] = "A<EFBFBD>adir",
["Add new VIP"] = "A<EFBFBD>adir nuevo VIP",
["Addon 1"] = "Addon 1",
["Addon 2"] = "Addon 1",
["Addon 3"] = "Addon 1",
["Addon 2"] = "Addon 2",
["Addon 3"] = "Addon 3",
["Add to VIP list"] = "A<EFBFBD>adir a lista VIP",
["Adjust volume"] = "Ajustar volumen",
["Alas! Brave adventurer, you have met a sad fate.\nBut do not despair, for the gods will bring you back\ninto this world in exchange for a small sacrifice\n\nSimply click on Ok to resume your journeys!"] = "<EFBFBD>Ay! Aventurero valiente, has conocido un triste destino. \nPero no se desespere, porque los dioses te llevar<61>n de vuelta \na este mundo a cambio de un peque<75>o sacrificio \n\nSimplemente haga clic en Aceptar para continuar con sus viajes!",

View File

@@ -63,16 +63,16 @@ locale = {
["Buy with backpack"] = "Kupuj z plecakami",
["Cancel"] = "Anuluj",
["Cannot login while already in game."] = "Nie mozna zalogowac gdy juz w grze",
["Cap"] = false,
["Cap"] = "Ladownosc",
["Capacity"] = "Ladownosc",
["Center"] = false,
["Center"] = "Wysrodkuj",
["Channels"] = "Kanaly",
["Character List"] = "Lista postaci",
["Classic control"] = "Klasyczne sterowaie",
["Clear current message window"] = false,
["Clear Messages"] = false,
["Clear current message window"] = "Wyczysc bierzace okno",
["Clear Messages"] = "Wyczysc wiadomosci",
["Clear object"] = "Wyczysc obiekt",
["Client needs update."] = false,
["Client needs update."] = "Klient wymaga aktalizacji",
["Close"] = "Zamknij",
["Close this channel"] = "Zamknij kanal",
["Club Fighting"] = "Walka obuchem",
@@ -81,7 +81,7 @@ locale = {
["Connecting to game server..."] = "Laczenie z serwerem gry...",
["Connecting to login server..."] = "Laczenie z serwerem logowania...",
["Console"] = "Konsola",
["Cooldowns"] = false,
["Cooldowns"] = "Czasy odnowienia",
["Copy message"] = "Kopiuj wiadomosc",
["Copy name"] = "Kopiuj imie",
["Copy Name"] = "Kopiuj Imie",
@@ -100,7 +100,7 @@ locale = {
["Detail"] = "Szczegoly",
["Details"] = "Szczegoly",
["Disable Shared Experience"] = "Wylacz Dzielenie Doswiadczenia",
["Dismount"] = false,
["Dismount"] = "Zejdz z wierzchowca",
["Display connection speed to the server (milliseconds)"] = "Wyswietl ping do serwera (ms)",
["Distance Fighting"] = "Walka na odleglosc",
["Don't stretch/shrink Game Window"] = "Nie rozszerzaj/zwezaj Okna Gry",
@@ -109,7 +109,7 @@ locale = {
["Edit Text"] = "Edytuj tekst",
["Enable music"] = "Odtwarzaj muzyke",
["Enable Shared Experience"] = "Wlacz dzielenie doswiadczenia",
["Enable smart walking"] = false,
["Enable smart walking"] = "Wlacz inteligentne chodzenie",
["Enable vertical synchronization"] = "Wlacz synchronizacje pionowa",
["Enable walk booster"] = false,
["Enter Game"] = "Wejdz do gry",
@@ -118,7 +118,7 @@ locale = {
["Error"] = "Blad",
["Excessive Unjustified Player Killing"] = "Nadmierne Nieusprawiedliwione Zabijanie Graczy",
["Exclude from private chat"] = "Wyrzuc w prywatnej konwersacji",
["Exit"] = false,
["Exit"] = "Wyjdz",
["Experience"] = "Doswiadczenie",
["Filter list to match your level"] = "Wyswietl tylko odpowiednie dla mojego poziomu",
["Filter list to match your vocation"] = "Wyswietl tylko odpowiednie dla mojej klasy",
@@ -127,7 +127,7 @@ locale = {
["Fist Fighting"] = "Walka wrecz",
["Follow"] = "Podazaj",
["Force Exit"] = "Wymus Zamkniecie",
["For Your Information"] = false,
["For Your Information"] = "Dla twojej informacji",
["Free Account"] = "Darmowe Konto",
["Fullscreen"] = "Pelen ekran",
["Game"] = "Gra",
@@ -136,9 +136,9 @@ locale = {
["Graphics card driver not detected"] = "Nie wykryto karty graficznej",
["Graphics Engine:"] = "Silnik graficzny:",
["Head"] = "Glowa",
["Healing"] = false,
["Health Info"] = false,
["Health Information"] = false,
["Healing"] = "Leczenie",
["Health Info"] = "Info o zyciu",
["Health Information"] = "Informacje o zyciu",
["Hide monsters"] = "Ukryj potwory",
["Hide non-skull players"] = "Ukryj graczy bez skulla",
["Hide Npcs"] = "Ukryj NPCe",
@@ -183,16 +183,16 @@ locale = {
["Magic Level"] = "Poziom Magiczny",
["Make sure that your client uses\nthe correct game protocol version"] = "Upewnij sie, ze twoj klient\nuzywa wlasciwego protokolu gry.",
["Mana"] = "Mana",
["Manage hotkeys:"] = "Skonfiguruj hotkeye:",
["Manage hotkeys:"] = "Zarzadzaj hotkeyami:",
["Market"] = false,
["Market Offers"] = false,
["Market Offers"] = "Oferty",
["Message of the day"] = "Wiadomosc dnia",
["Message to "] = "Wiadomosc do ",
["Message to %s"] = "Wiadomosc do %s",
["Minimap"] = "Minimapa",
["Module Manager"] = "Menedzer modulow",
["Module name"] = "Nazwa modulu",
["Mount"] = false,
["Mount"] = "Wierzchowiec",
["Move Stackable Item"] = "Przenies przedmiot",
["Move up"] = "Przenies wyzej",
["My Offers"] = "Moje Oferty",
@@ -221,13 +221,13 @@ locale = {
["Open new channel"] = "Otworz nowy kanal",
["Options"] = "Opcje",
["Overview"] = "Podsumowanie",
["Pass Leadership to %s"] = "Przekaz przywodztwo %s",
["Pass Leadership to %s"] = "Oddaj przywodztwo %s",
["Password"] = "Haslo",
["Piece Price:"] = false,
["Piece Price:"] = "Cena jednego przedmiotu",
["Please enter a character name:"] = "Podaj nazwe postaci:",
["Please, press the key you wish to add onto your hotkeys manager"] = "Nacisnij klawisz, ktory chcesz dodac do menedzera skrotow klawiszowych",
["Please Select"] = false,
["Please use this dialog to only report bugs. Do not report rule violations here!"] = false,
["Please Select"] = "Prosze wybrac",
["Please use this dialog to only report bugs. Do not report rule violations here!"] = "Zglaszaj tylko bledy gry, nie lamanie zasad",
["Please wait"] = "Prosze czekac",
["Port"] = "Port",
["Position:"] = "Pozycja:",
@@ -237,21 +237,21 @@ locale = {
["Primary"] = "Podstawowy",
["Protocol"] = "Protokol",
["Quest Log"] = "Dziennik Misji",
["Randomize"] = false,
["Randomize characters outfit"] = false,
["Randomize"] = "Losuj",
["Randomize characters outfit"] = "Ustaw losowy wyglad",
["Reason:"] = "Powod:",
["Refresh"] = "Odswiez",
["Refresh Offers"] = "Odswiez Oferty",
["Regeneration Time"] = "Czas Regeneracji",
["Reject"] = "Odrzuc",
["Reload All"] = "Przeladuj Wszystko",
["Reload All"] = "Zaladuj ponownie wszystko",
["Remember account and password when starts client"] = "Zapamietaj identyfikator konta oraz haslo",
["Remember password"] = "Zapamietaj haslo",
["Remove"] = "Usun",
["Remove %s"] = "Usun %s",
["Report Bug"] = "Zglos Blad",
["Reserved for more functionality later."] = "Zarezerowane dla przyszlych funkcjonalnosci.",
["Reset Market"] = false,
["Reset Market"] = "Zaladuj market ponownie",
["Revoke %s's Invitation"] = "Odmow na zaproszenie gracza %s",
["Rotate"] = "Obroc",
["Rule Violation"] = "Zlamanie Regul",
@@ -275,7 +275,7 @@ locale = {
["Shielding"] = "Obrona tarcza",
["Show all items"] = "Pokaz wszystkie przedmioty",
["Show connection ping"] = "Wyswietl ping",
["Show Depot Only"] = false,
["Show Depot Only"] = "Pokaz tylko przedmioty z depozytu",
["Show event messages in console"] = "Pokaz wydarzenia w konsoli",
["Show frame rate"] = "Pokaz FPS",
["Show info messages in console"] = "Pokaz informacje w konsoli",
@@ -288,17 +288,17 @@ locale = {
["Show status messages in console"] = "Pokaz status w konsoli",
["Show Text"] = "Pokaz Tekst",
["Show timestamps in console"] = "Pokaz znaczniki czasu w konsoli",
["Show your depot items only"] = false,
["Show your depot items only"] = "Pokaz tylko przedmioty z depozytu",
["Skills"] = "Umiejetnosci",
["Soul"] = "Dusze",
["Soul Points"] = "Punkty Duszy",
["Special"] = false,
["Soul Points"] = "Punktey Duszy",
["Special"] = "Specialne",
["Speed"] = "Predkosc",
["Spell Cooldowns"] = false,
["Spell Cooldowns"] = "Czas odnowienia czaru",
["Spell List"] = "Lista Zaklec",
["Stamina"] = "Wytrzymalosc",
["Statement:"] = false,
["Statement Report"] = false,
["Statement:"] = "Wyrazenie",
["Statement Report"] = "Reportuj wyrazenie",
["Statistics"] = "Statystki",
["Stop Attack"] = "Anuluj atak",
["Stop Follow"] = "Przestan podazac",
@@ -311,7 +311,7 @@ locale = {
["Terminal"] = "Terminal",
["There is no way."] = "Nie ma drogi.",
["Title"] = "Tytul",
["Total Price"] = "Cena sumaryczna",
["Total Price"] = "Cena calosci",
["Trade"] = "Handel",
["Trade with ..."] = "Handluj z ...",
["Trying to reconnect in %s seconds."] = "Ponowna proba laczenia za %s sekund.",
@@ -320,15 +320,15 @@ locale = {
["Unable to logout."] = "Nie mozna sie wylogowac.",
["Unignore"] = "Anuluj Ignorowanie",
["Unload"] = "Wylacz",
["Update needed"] = false,
["Update needed"] = "Wymagana aktualizacja",
["Use"] = "Uzyj",
["Use on target"] = "Uzyj na celu",
["Use on yourself"] = "Uzyj na sobie",
["Use with ..."] = "Uzyj z ...",
["Version"] = "Wersja",
["VIP List"] = "Lista VIP",
["Voc."] = false,
["Vocation"] = "Klasa",
["Voc."] = "Profesja",
["Vocation"] = "Profesja",
["Waiting List"] = "Lista Oczekujacych",
["Website"] = "Strona:",
["Weight:"] = "Waga:",
@@ -339,14 +339,14 @@ locale = {
["You are burning"] = "Palisz sie",
["You are cursed"] = "Jestes przeklety",
["You are dazzled"] = "Jestes oslepiony",
["You are dead."] = "Zginales marnie.",
["You are dead."] = "Jestes martwy.",
["You are dead"] = "Jestes martwy",
["You are drowning"] = "Topisz sie",
["You are drunk"] = "Caly swiat wiruje",
["You are drunk"] = "Jestes pijany",
["You are electrified"] = "Jestes porazony pradem",
["You are freezing"] = "Marzniesz",
["You are hasted"] = "Zapieprzasz",
["You are hungry"] = "Burczy ci w brzuchu",
["You are freezing"] = "Zamarzasz",
["You are hasted"] = "Masz zwiekszona predkosc ruchu",
["You are hungry"] = "Jestes glodny",
["You are paralysed"] = "Jestes sparalizowany",
["You are poisoned"] = "Jestes zatruty",
["You are protected by a magic shield"] = "Jestes chroniony magiczna tarcza",
@@ -363,16 +363,16 @@ locale = {
["Your Capacity:"] = "Twoja Ladownosc:",
["You read the following, written by \n%s\n"] = false,
["You read the following, written on \n%s.\n"] = false,
["Your Money:"] = false,
["Enable dash walking"] = false,
["Your Money:"] = "Twoje pieniadze",
["Enable dash walking"] = "Wlacz szybsze chodzenie (dash walking)",
["Will boost your walk on high speed characters"] = "Przyspieszy poruszanie sie postaci o wysokiej predkosci",
["Display creature names"] = "Wyswietlaj nazwy potworow",
["Display creature health bars"] = "Wyswietlaj paski zycia potworow",
["Display text messages"] = "Wyswietlaj wiadomosci tekstowe",
["Change language"] = "Zmien jezyk",
["Enable lights"] = "Odblokuj oswietlenie",
["Enable audio"] = "Odblokuj dzwiek",
["Enable music sound"] = "Odblokuj muzyke",
["Enable lights"] = "Wlacz oswietlenie",
["Enable audio"] = "Wlacz dzwiek",
["Enable music sound"] = "Wlacz muzyke",
["Music volume: %d"] = "Glosnosc muzyki: %d",
["Audio"] = "Dzwiek",
["Server List"] = "Lista serwerow",
@@ -391,18 +391,18 @@ locale = {
["Your Capacity"] = "Twoj udzwig",
["Search"] = "Szukaj",
["Sell All"] = "Sprzedaj wszystko",
["Statement"] = false,
["Statement"] = "Stanowisko",
["Reason"] = "Powod",
["Action"] = "Akcja",
["Comment"] = "Komentarz",
["Balance"] = false,
["Balance"] = "Stan konta",
["Offer Type"] = "Typ oferty",
["Piece Price"] = false,
["Piece Price"] = "Cena jednego",
["Find"] = "Szukaj",
["Formula"] = "Formula",
["Group"] = "Groupa",
["Type"] = "Typ",
["Cooldown"] = false,
["Cooldown"] = "Czas odnowienia",
["Premium"] = false,
["Any"] = "Dowolny",
["Sorcerer"] = "Czarodziej",

View File

@@ -1,44 +1,45 @@
Button < UIButton
font: verdana-11px-antialised
color: #f0ad4dff
size: 106 22
color: #dfdfdfff
size: 106 23
text-offset: 0 0
image-source: /images/ui/button_rounded
image-color: white
image-clip: 0 0 20 20
image-source: /images/ui/button
image-color: #dfdfdf
image-clip: 0 0 22 23
image-border: 3
padding: 5 10 5 10
$hover !disabled:
image-clip: 0 20 20 20
image-clip: 0 23 22 23
$pressed:
image-clip: 0 40 20 20
image-clip: 0 46 22 23
text-offset: 1 1
$disabled:
color: #f0ad4d88
color: #dfdfdf88
opacity: 0.8
TabButton < UIButton
size: 20 20
size: 22 23
image-source: /images/ui/tabbutton_rounded
image-color: white
image-clip: 0 0 20 20
image-color: #dfdfdf
image-clip: 0 0 22 23
image-border: 3
icon-color: white
color: #aaaaaa
icon-color: #dfdfdf
color: #dfdfdf
$hover !on:
image-clip: 0 20 20 20
color: white
image-clip: 0 23 22 23
color: #dfdfdf
$disabled:
image-color: #ffffff66
icon-color: #888888
image-color: #dfdfdf66
icon-color: #dfdfdf
$on:
image-clip: 0 40 20 20
color: #80c7f8
image-clip: 0 46 22 23
color: #dfdfdf
NextButton < UIButton
size: 12 21
@@ -52,7 +53,7 @@ NextButton < UIButton
image-clip: 12 21 12 21
$disabled:
image-color: #ffffff55
image-color: #dfdfdf55
PreviousButton < UIButton
size: 12 21
@@ -66,18 +67,18 @@ PreviousButton < UIButton
image-clip: 0 21 12 21
$disabled:
image-color: #ffffff55
image-color: #dfdfdf55
AddButton < UIButton
size: 20 20
image-source: /images/ui/icon_add
image-color: #ffffffff
image-color: #dfdfdfff
$hover !disabled:
image-color: #ffffff99
image-color: #dfdfdf99
$pressed:
image-color: #ffffff44
image-color: #dfdfdf44
$disabled:
image-color: #ffffff55
image-color: #dfdfdf55

View File

@@ -1,35 +1,35 @@
CheckBox < UICheckBox
size: 16 16
text-align: left
text-offset: 16 0
color: #aaaaaa
image-color: #ffffffff
image-rect: 0 0 12 12
image-offset: 0 2
text-offset: 18 1
color: #dfdfdf
image-color: #dfdfdfff
image-rect: 0 0 15 15
image-source: /images/ui/checkbox
$hover !disabled:
color: #cccccc
color: #ffffff
$!checked:
image-clip: 0 0 12 12
image-clip: 0 0 15 15
$hover !checked:
image-clip: 0 12 12 12
image-clip: 0 15 15 15
$checked:
image-clip: 0 24 12 12
image-clip: 0 30 15 15
$hover checked:
image-clip: 0 36 12 12
image-clip: 0 45 15 15
$disabled:
image-color: #ffffff88
color: #aaaaaa88
image-color: #dfdfdf88
color: #dfdfdf88
opacity: 0.8
ColorBox < UICheckBox
size: 16 16
image-color: #ffffffff
image-color: #dfdfdfff
image-source: /images/ui/colorbox
$checked:
@@ -40,26 +40,25 @@ ColorBox < UICheckBox
ButtonBox < UICheckBox
font: verdana-11px-antialised
color: #ffffffff
size: 106 22
color: #dfdfdfff
size: 106 23
text-offset: 0 0
text-align: center
image-source: /images/ui/tabbutton_rounded
image-color: white
image-clip: 0 0 20 20
image-source: /images/ui/button
image-color: #dfdfdf
image-clip: 0 0 22 23
image-border: 3
$hover !disabled:
image-clip: 0 20 20 20
image-clip: 0 23 22 23
$checked:
image-clip: 0 40 20 20
color: #80c7f8
image-clip: 0 46 22 23
color: #dfdfdf
$disabled:
color: #666666ff
image-color: #ffffff88
color: #dfdfdf88
image-color: #dfdfdf88
ButtonBoxRounded < ButtonBox
image-source: /images/ui/tabbutton_rounded
image-border: 2
image-source: /images/ui/button_rounded

View File

@@ -1,62 +1,106 @@
ComboBoxPopupMenuButton < UIButton
height: 20
ComboBoxPopupScrollMenuButton < UIButton
height: 23
font: verdana-11px-antialised
text-align: left
text-offset: 4 0
color: #aaaaaa
color: #dfdfdf
background-color: alpha
margin: 1
$hover !disabled:
color: #ffffff
background-color: #ffffff44
color: #dfdfdf
background-color: #355d89
$disabled:
color: #555555
color: #dfdfdf88
ComboBoxPopupScrollMenu < UIPopupScrollMenu
image-source: /images/ui/combobox_square
image-clip: 0 69 91 23
image-border: 1
ComboBoxPopupMenuButton < UIButton
height: 23
font: verdana-11px-antialised
text-align: left
text-offset: 4 0
color: #dfdfdf
background-color: alpha
margin: 1
$hover !disabled:
color: #dfdfdf
background-color: #355d89
$disabled:
color: #dfdfdf88
ComboBoxPopupMenu < UIPopupMenu
image-source: /images/ui/combobox_square
image-clip: 0 60 89 20
image-border-left: 1
image-border-right: 1
image-clip: 0 69 91 23
image-border: 1
ComboBox < UIComboBox
font: verdana-11px-antialised
color: #aaaaaa
size: 89 20
color: #dfdfdf
size: 91 23
text-offset: 3 0
text-align: left
image-source: /images/ui/combobox_square
image-border: 1
image-border-right: 17
image-clip: 0 0 89 20
image-border: 3
image-border-right: 19
image-clip: 0 0 91 23
$hover !disabled:
image-clip: 0 20 89 20
image-clip: 0 23 91 23
$on:
image-clip: 0 40 89 20
image-clip: 0 46 91 23
ComboBoxRoundedPopupMenuButton < UIButton
height: 20
$disabled:
color: #dfdfdf88
opacity: 0.8
ComboBoxRoundedPopupScrollMenuButton < UIButton
height: 23
font: verdana-11px-antialised
text-align: left
text-offset: 4 0
color: #aaaaaa
color: #dfdfdf
background-color: alpha
$hover !disabled:
color: #ffffff
background-color: #ffffff44
background-color: #355d89
$disabled:
color: #555555
color: #dfdfdf88
ComboBoxRoundedPopupScrollMenu < UIPopupScrollMenu
image-source: /images/ui/combobox_rounded
image-clip: 0 69 91 23
image-border: 3
ComboBoxRoundedPopupMenuButton < UIButton
height: 23
font: verdana-11px-antialised
text-align: left
text-offset: 4 0
color: #dfdfdf
background-color: alpha
$hover !disabled:
color: #ffffff
background-color: #355d89
$disabled:
color: #dfdfdf88
ComboBoxRoundedPopupMenu < UIPopupMenu
image-source: /images/ui/combobox_rounded
image-clip: 0 60 89 20
image-border-left: 1
image-border-right: 1
image-clip: 0 69 91 23
image-border: 3
ComboBoxRounded < ComboBox
image-source: /images/ui/combobox_rounded
image-border: 2
image-border: 3

View File

@@ -1,23 +1,23 @@
Label < UILabel
font: verdana-11px-antialised
color: #bbbbbb
color: #dfdfdf
$disabled:
color: #bbbbbb88
color: #dfdfdf88
FlatLabel < UILabel
font: verdana-11px-antialised
color: #aaaaaa
color: #dfdfdf
size: 86 20
text-offset: 3 3
image-source: /images/ui/panel_flat
image-border: 1
$disabled:
color: #aaaaaa88
color: #dfdfdf88
MenuLabel < Label
GameLabel < UILabel
font: verdana-11px-antialised
color: #bbbbbb
color: #dfdfdf

View File

@@ -1,19 +1,19 @@
TextList < UIScrollArea
layout: verticalBox
border-width: 1
border-color: #1d222b
background-color: #222833
border-color: #272727
background-color: #636363
padding: 1
auto-focus: none
HorizontalList < UIScrollArea
layout: horizontalBox
border-width: 1
border-color: #1d222b
background-color: #222833
border-color: #272727
background-color: #636363
VerticalList < UIScrollArea
layout: verticalBox
border-width: 1
border-color: #1d222b
background-color: #222833
border-color: #272727
background-color: #636363

View File

@@ -10,7 +10,6 @@ ScrollBarSlider < UIButton
image-clip: 13 26 13 13
$pressed:
image-clip: 26 26 13 13
image-color: #ffffff99
$disabled:
image-color: #ffffff66

View File

@@ -1,13 +1,13 @@
HorizontalSeparator < UIWidget
image-source: /images/ui/separator_horizontal
image-border-top: 2
image-border: 1
height: 2
phantom: true
focusable: false
VerticalSeparator < UIWidget
image-source: /images/ui/separator_vertical
image-border-left: 2
image-border: 1
width: 2
phantom: true
focusable: false

View File

@@ -1,15 +1,17 @@
TextEdit < UITextEdit
font: verdana-11px-antialised
color: #aaaaaa
size: 86 20
text-offset: 0 3
padding: 3
color: #272727
size: 86 22
text-offset: 0 4
opacity: 1
padding: 4
image-source: /images/ui/textedit
image-border: 1
selection-color: #111416
selection-background-color: #999999
selection-color: #272727
selection-background-color: #cccccc
$disabled:
color: #aaaaaa88
color: #27272788
opacity: 0.5
PasswordTextEdit < TextEdit
text-hidden: true

View File

@@ -2,20 +2,19 @@ Window < UIWindow
font: verdana-11px-antialised
size: 200 200
opacity: 1
color: white
text-offset: 0 4
color: #dfdfdf
text-offset: 0 6
text-align: top
image-source: /images/ui/window
image-border: 5
image-border-top: 22
opacity: 1
padding-top: 30
image-border: 6
image-border-top: 27
padding-top: 36
padding-left: 16
padding-right: 16
padding-bottom: 16
$disabled:
color: #aaaaaa88
color: #dfdfdf88
$dragging:
opacity: 0.8

View File

@@ -39,3 +39,45 @@ PopupMenu < UIPopupMenu
image-source: /images/ui/menubox
image-border: 3
padding: 3
PopupScrollMenuButton < UIButton
height: 18
size: 0 21
text-offset: 4 0
text-align: left
font: verdana-11px-antialised
color: #aaaaaa
background-color: alpha
$hover !disabled:
color: #ffffff
background-color: #ffffff44
image-clip: 0 40 20 20
$disabled:
color: #555555
PopupScrollMenuShortcutLabel < Label
font: verdana-11px-antialised
text-align: right
anchors.fill: parent
margin-right: 2
margin-left: 5
PopupScrollMenuSeparator < UIWidget
margin-left: 2
margin-right: 2
margin-bottom: 1
image-source: /images/ui/menubox
image-border-left: 1
image-border-right: 1
image-clip: 0 0 32 2
height: 2
phantom: true
PopupScrollMenu < UIPopupScrollMenu
width: 50
image-source: /images/ui/menubox
image-border: 3
padding: 3

View File

@@ -1,13 +1,13 @@
SpinBox < TextEdit
__class: UISpinBox
text-align: left
size: 86 20
size: 86 22
padding: 0
padding-left: 2
Button
id: up
size: 10 10
size: 11 11
image-source: /images/ui/spinbox_up
image-border: 1
image-clip: 0 0 10 10
@@ -21,7 +21,7 @@ SpinBox < TextEdit
Button
id: down
size: 10 10
size: 11 11
image-source: /images/ui/spinbox_down
image-border: 1
image-clip: 0 0 10 10

View File

@@ -1,47 +1,49 @@
MoveableTabBar < UIMoveableTabBar
size: 80 20
size: 80 21
MoveableTabBarPanel < Panel
MoveableTabBarButton < UIButton
size: 20 20
size: 20 21
image-source: /images/ui/tabbutton_square
image-color: white
image-clip: 0 0 20 20
image-color: #dfdfdf
image-clip: 0 0 20 21
image-border: 3
icon-color: white
color: #aaaaaa
image-border-bottom: 0
icon-color: #dfdfdf
color: #dfdfdf
anchors.top: parent.top
anchors.left: parent.left
padding: 5
$hover !checked:
image-clip: 0 20 20 20
color: white
image-clip: 0 21 20 21
color: #dfdfdf
$disabled:
image-color: #ffffff66
icon-color: #888888
image-color: #dfdfdf88
icon-color: #dfdfdf
$checked:
image-clip: 0 40 20 20
color: #D8E7F0
image-clip: 0 42 20 21
color: #dfdfdf
$on !checked:
color: #F55E5E
color: #dfdfdf
TabBar < UITabBar
size: 80 20
size: 80 21
Panel
id: buttonsPanel
anchors.fill: parent
TabBarPanel < Panel
TabBarButton < UIButton
size: 20 20
size: 22 23
image-source: /images/ui/tabbutton_square
image-color: white
image-clip: 0 0 20 20
image-color: #dfdfdf
image-clip: 0 0 22 23
image-border: 3
icon-color: white
color: #aaaaaa
image-border-bottom: 0
icon-color: #dfdfdf
color: #dfdfdf
anchors.top: parent.top
padding: 5
@@ -53,19 +55,19 @@ TabBarButton < UIButton
margin-left: 5
$hover !checked:
image-clip: 0 20 20 20
color: white
image-clip: 0 23 22 23
color: #dfdfdf
$disabled:
image-color: #ffffff66
icon-color: #888888
image-color: #dfdfdf88
icon-color: #dfdfdf
$checked:
image-clip: 0 40 20 20
color: #80c7f8
image-clip: 0 46 22 23
color: #dfdfdf
$on !checked:
color: #F55E5E
color: #dfdfdf
TabBarRounded < TabBar
TabBarRoundedPanel < TabBarPanel
@@ -107,7 +109,7 @@ TabBarVerticalButton < UIButton
margin-top: 10
$hover !checked:
color: white
icon-color: #cccccc
icon-color: #dfdfdf
$disabled:
icon-color: #333333
$checked:

View File

@@ -27,8 +27,8 @@ g_resources.setupUserWriteDir(g_app.getCompactName())
-- search all packages
g_resources.searchAndAddPackages('/', '.otpkg', true)
-- load configurations
g_configs.load("/config.otml")
-- load settings
g_configs.loadSettings("/config.otml")
g_modules.discoverModules()

View File

@@ -91,9 +91,9 @@ function init()
g_keyboard.bindKeyDown('Ctrl+Shift+R', reloadScripts)
-- generate machine uuid, this is a security measure for storing passwords
if not g_crypt.setMachineUUID(g_configs.get('uuid')) then
g_configs.set('uuid', g_crypt.getMachineUUID())
g_configs.save()
if not g_crypt.setMachineUUID(g_settings.get('uuid')) then
g_settings.set('uuid', g_crypt.getMachineUUID())
g_settings.save()
end
end

View File

@@ -35,7 +35,7 @@ end
local function onCharacterList(protocol, characters, account, otui)
-- Try add server to the server list
ServerList.add(G.host, G.port, g_game.getProtocolVersion())
ServerList.add(G.host, G.port, g_game.getClientVersion())
if enterGame:getChildById('rememberPasswordBox'):isChecked() then
local account = g_crypt.encrypt(G.account)
@@ -82,7 +82,7 @@ local function onUpdateNeeded(protocol, signature)
local cancelFunc = EnterGame.show
EnterGame.updateFunc(signature, continueFunc, cancelFunc)
else
local errorBox = displayErrorBox(tr('Update needed'), tr('Your client needs update, try redownloading it.'))
local errorBox = displayErrorBox(tr('Update needed'), tr('Your client needs updating, try redownloading it.'))
connect(errorBox, { onOk = EnterGame.show })
end
end
@@ -242,7 +242,7 @@ function EnterGame.doLogin()
g_game.chooseRsa(G.host)
g_game.setClientVersion(clientVersion)
g_game.setProtocolVersion(g_game.getProtocolVersionForClient(clientVersion))
g_game.setProtocolVersion(g_game.getClientProtocolVersion(clientVersion))
if modules.game_things.isLoaded() then
protocolLogin:login(G.host, G.port, G.account, G.password)

View File

@@ -92,6 +92,9 @@ EnterGameWindow
margin-top: 2
margin-right: 3
width: 90
menu-scroll: true
menu-height: 125
menu-scroll-step: 25
MenuLabel
id: portLabel

View File

@@ -14,7 +14,8 @@ function init()
g_keyboard.bindKeyPress('Up', function() moduleList:focusPreviousChild(KeyboardFocusReason) end, moduleManagerWindow)
g_keyboard.bindKeyPress('Down', function() moduleList:focusNextChild(KeyboardFocusReason) end, moduleManagerWindow)
moduleManagerButton = modules.client_topmenu.addLeftButton('moduleManagerButton', tr('Module Manager'), '/images/topbuttons/modulemanager', toggle)
moduleManagerButton = modules.client_topmenu.addLeftButton('moduleManagerButton',
tr('Module Manager'), '/images/topbuttons/modulemanager', toggle)
-- refresh modules only after all modules are loaded
addEvent(listModules)

View File

@@ -1,7 +1,7 @@
MainWindow
id: addServerWindow
!text: tr('New Server')
size: 180 180
size: 180 195
visible: false
@onEscape: AddServer.hide()
@onEnter: AddServer.add()
@@ -48,6 +48,9 @@ MainWindow
anchors.top: protocolLabel.bottom
anchors.left: protocolLabel.left
anchors.right: port.right
menu-scroll: true
menu-height: 125
menu-scroll-step: 25
@onSetup: |
for _, proto in pairs(g_game.getSupportedClients()) do
self:addOption(proto)

View File

@@ -202,9 +202,9 @@ function popWindow()
else
terminalWindow:breakAnchors()
terminalWindow:setOn(true)
local size = oldSize or { width = g_window.getWidth()/2, height = g_window.getHeight()/2 }
local size = oldSize or { width = g_window.getWidth()/2.5, height = g_window.getHeight()/4 }
terminalWindow:setSize(size)
local pos = oldPos or { x = (g_window.getWidth() - terminalWindow:getWidth())/2, y = (g_window.getHeight() - terminalWindow:getHeight())/2 }
local pos = oldPos or { x = 0, y = g_window.getHeight() }
terminalWindow:setPosition(pos)
terminalWindow:getChildById('bottomResizeBorder'):enable()
terminalWindow:getChildById('rightResizeBorder'):enable()
@@ -224,7 +224,7 @@ function toggle()
if not firstShown then
local settings = g_settings.getNode('terminal-window')
if settings then
if settings.size then oldSize = size end
if settings.size then oldSize = settings.size end
if settings.pos then oldPos = settings.pos end
if settings.poped then popWindow() end
end

View File

@@ -27,7 +27,7 @@ local function addButton(id, description, icon, callback, panel, toggle, front)
button:setTooltip(description)
button:setIcon(resolvepath(icon, 3))
button.onMouseRelease = function(widget, mousePos, mouseButton)
if widget:containsPoint(mousePos) and mouseButton ~= MouseMiddleButton then
if widget:containsPoint(mousePos) and mouseButton ~= MouseMidButton then
callback()
return true
end

View File

@@ -0,0 +1,73 @@
-- @docclass
local function convertSettingValue(value)
if type(value) == 'table' then
if value.x and value.width then
return recttostring(value)
elseif value.x then
return pointtostring(value)
elseif value.width then
return sizetostring(value)
elseif value.r then
return colortostring(value)
else
return value
end
elseif value == nil then
return ''
else
return tostring(value)
end
end
function Config:set(key, value)
self:setValue(key, convertSettingValue(value))
end
function Config:setDefault(key, value)
if self:exists(key) then return false end
self:set(key, value)
return true
end
function Config:get(key, default)
if not self:exists(key) and default ~= nil then
self:set(key, default)
end
return self:getValue(key)
end
function Config:getString(key, default)
return self:get(key, default)
end
function Config:getInteger(key, default)
local v = tonumber(self:get(key, default)) or 0
return v
end
function Config:getNumber(key, default)
local v = tonumber(self:get(key, default)) or 0
return v
end
function Config:getBoolean(key, default)
return toboolean(self:get(key, default))
end
function Config:getPoint(key, default)
return topoint(self:get(key, default))
end
function Config:getRect(key, default)
return torect(self:get(key, default))
end
function Config:getSize(key, default)
return tosize(self:get(key, default))
end
function Config:getColor(key, default)
return tocolor(self:get(key, default))
end

View File

@@ -14,11 +14,13 @@ Module
dofile 'const'
dofile 'util'
dofile 'globals'
dofile 'config'
dofile 'settings'
dofile 'keyboard'
dofile 'mouse'
dofile 'net'
dofiles 'classes'
dofiles 'ui'
dofile 'inputmessage'

View File

@@ -1,86 +1,3 @@
-- @docclass
g_settings = {}
g_settings = makesingleton(g_configs.getSettings())
g_settings.exists = g_configs.exists
g_settings.setNode = g_configs.setNode
g_settings.mergeNode = g_configs.mergeNode
g_settings.getNode = g_configs.getNode
g_settings.remove = g_configs.remove
g_settings.setList = g_configs.setList
g_settings.getList = g_configs.getList
g_settings.save = g_configs.save
local function convertSettingValue(value)
if type(value) == 'table' then
if value.x and value.width then
return recttostring(value)
elseif value.x then
return pointtostring(value)
elseif value.width then
return sizetostring(value)
elseif value.r then
return colortostring(value)
else
return value
end
elseif value == nil then
return ''
else
return tostring(value)
end
end
function g_settings.set(key, value)
g_configs.set(key, convertSettingValue(value))
end
function g_settings.setDefault(key, value)
if g_settings.exists(key) then return false end
g_settings.set(key, value)
return true
end
function g_settings.get(key, default)
if not g_settings.exists(key) and default ~= nil then
g_settings.set(key, default)
end
return g_configs.get(key)
end
function g_settings.getString(key, default)
return g_settings.get(key, default)
end
function g_settings.getInteger(key, default)
local v = tonumber(g_settings.get(key, default)) or 0
return v
end
function g_settings.getNumber(key, default)
local v = tonumber(g_settings.get(key, default)) or 0
return v
end
function g_settings.getBoolean(key, default)
return toboolean(g_settings.get(key, default))
end
function g_settings.getPoint(key, default)
return topoint(g_settings.get(key, default))
end
function g_settings.getRect(key, default)
return torect(g_settings.get(key, default))
end
function g_settings.getSize(key, default)
return tosize(g_settings.get(key, default))
end
function g_settings.getColor(key, default)
return tocolor(g_settings.get(key, default))
end
function g_settings.getColor(key, default)
return tocolor(g_settings.get(key, default))
end
-- Reserved for future functionality

View File

@@ -49,3 +49,11 @@ function string:explode(sep, limit)
table.insert(t, tmp)
return t
end
function string:contains(str, checkCase, start, plain)
if(not checkCase) then
self = self:lower()
str = str:lower()
end
return string.find(self, str, start and start or 1, plain == nil and true or false)
end

View File

@@ -157,6 +157,7 @@ function table.tostring(t)
local maxn = #t
local str = ""
for k,v in pairs(t) do
v = tostring(v)
if k == maxn and k ~= 1 then
str = str .. " and " .. v
elseif maxn > 1 and k ~= 1 then
@@ -181,3 +182,11 @@ function table.collect(t, func)
return res
end
function table.equals(t, comp)
if type(t) == "table" and type(comp) == "table" then
for k,v in pairs(t) do
if v ~= comp[k] then return false end
end
end
return true
end

View File

@@ -1,5 +1,5 @@
-- @docclass
UIButton = extends(UIWidget)
UIButton = extends(UIWidget, "UIButton")
function UIButton.create()
local button = UIButton.internalCreate()

View File

@@ -1,5 +1,5 @@
-- @docclass
UICheckBox = extends(UIWidget)
UICheckBox = extends(UIWidget, "UICheckBox")
function UICheckBox.create()
local checkbox = UICheckBox.internalCreate()

View File

@@ -1,5 +1,5 @@
-- @docclass
UIComboBox = extends(UIWidget)
UIComboBox = extends(UIWidget, "UIComboBox")
function UIComboBox.create()
local combobox = UIComboBox.internalCreate()
@@ -7,6 +7,9 @@ function UIComboBox.create()
combobox.options = {}
combobox.currentIndex = -1
combobox.mouseScroll = true
combobox.menuScroll = false
combobox.menuHeight = 100
combobox.menuScrollStep = 0
return combobox
end
@@ -25,25 +28,33 @@ function UIComboBox:getOption(text)
end
end
function UIComboBox:setCurrentOption(text)
function UIComboBox:setOption(text, dontSignal)
self:setCurrentOption(text, dontSignal)
end
function UIComboBox:setCurrentOption(text, dontSignal)
if not self.options then return end
for i,v in ipairs(self.options) do
if v.text == text and self.currentIndex ~= i then
self.currentIndex = i
self:setText(text)
if not dontSignal then
signalcall(self.onOptionChange, self, text, v.data)
end
return
end
end
end
function UIComboBox:setCurrentOptionByData(data)
function UIComboBox:setCurrentOptionByData(data, dontSignal)
if not self.options then return end
for i,v in ipairs(self.options) do
if v.data == data and self.currentIndex ~= i then
self.currentIndex = i
self:setText(v.text)
if not dontSignal then
signalcall(self.onOptionChange, self, v.text, v.data)
end
return
end
end
@@ -86,7 +97,16 @@ function UIComboBox:removeOption(text)
end
function UIComboBox:onMousePress(mousePos, mouseButton)
local menu = g_ui.createWidget(self:getStyleName() .. 'PopupMenu')
local menu
if self.menuScroll then
menu = g_ui.createWidget(self:getStyleName() .. 'PopupScrollMenu')
menu:setHeight(self.menuHeight)
if self.menuScrollStep > 0 then
menu:setScrollbarStep(self.menuScrollStep)
end
else
menu = g_ui.createWidget(self:getStyleName() .. 'PopupMenu')
end
menu:setId(self:getId() .. 'PopupMenu')
for i,v in ipairs(self.options) do
menu:addOption(v.text, function() self:setCurrentOption(v.text) end)
@@ -129,6 +149,12 @@ function UIComboBox:onStyleApply(styleName, styleNode)
for name,value in pairs(styleNode) do
if name == 'mouse-scroll' then
self.mouseScroll = value
elseif name == 'menu-scroll' then
self.menuScroll = value
elseif name == 'menu-height' then
self.menuHeight = value
elseif name == 'menu-scroll-step' then
self.menuScrollStep = value
end
end
end

View File

@@ -1,5 +1,5 @@
-- @docclass
UIImageView = extends(UIWidget)
UIImageView = extends(UIWidget, "UIImageView")
function UIImageView.create()
local imageView = UIImageView.internalCreate()

View File

@@ -1,7 +1,7 @@
if not UIWindow then dofile 'uiwindow' end
-- @docclass
UIInputBox = extends(UIWindow)
UIInputBox = extends(UIWindow, "UIInputBox")
function UIInputBox.create(title, okCallback, cancelCallback)
local inputBox = UIInputBox.internalCreate()

View File

@@ -1,5 +1,5 @@
-- @docclass
UILabel = extends(UIWidget)
UILabel = extends(UIWidget, "UILabel")
function UILabel.create()
local label = UILabel.internalCreate()

View File

@@ -1,7 +1,7 @@
if not UIWindow then dofile 'uiwindow' end
-- @docclass
UIMessageBox = extends(UIWindow)
UIMessageBox = extends(UIWindow, "UIMessageBox")
-- messagebox cannot be created from otui files
UIMessageBox.create = nil

View File

@@ -1,15 +1,11 @@
-- @docclass
UIMiniWindow = extends(UIWindow)
UIMiniWindow = extends(UIWindow, "UIMiniWindow")
function UIMiniWindow.create()
local miniwindow = UIMiniWindow.internalCreate()
return miniwindow
end
function UIMiniWindow:getClassName()
return 'UIMiniWindow'
end
function UIMiniWindow:open(dontSave)
self:setVisible(true)

View File

@@ -1,5 +1,5 @@
-- @docclass
UIMiniWindowContainer = extends(UIWidget)
UIMiniWindowContainer = extends(UIWidget, "UIMiniWindowContainer")
function UIMiniWindowContainer.create()
local container = UIMiniWindowContainer.internalCreate()
@@ -9,10 +9,6 @@ function UIMiniWindowContainer.create()
return container
end
function UIMiniWindowContainer:getClassName()
return 'UIMiniWindowContainer'
end
-- TODO: connect to window onResize event
-- TODO: try to resize another widget?
-- TODO: try to find another panel?

View File

@@ -1,5 +1,5 @@
-- @docclass
UIMoveableTabBar = extends(UIWidget)
UIMoveableTabBar = extends(UIWidget, "UIMoveableTabBar")
-- private functions
local function onTabClick(tab)
@@ -389,8 +389,16 @@ function UIMoveableTabBar:selectNextTab()
if #self.postTabs > 0 then
local widget = showPostTab(self)
self:selectTab(widget)
updateTabs(self)
else
if #self.preTabs > 0 then
for i = 1, #self.preTabs do
showPreTab(self)
end
end
self:selectTab(self.tabs[1])
end
updateTabs(self)
return
end
@@ -417,8 +425,16 @@ function UIMoveableTabBar:selectPrevTab()
if #self.preTabs > 0 then
local widget = showPreTab(self)
self:selectTab(widget)
updateTabs(self)
else
if #self.postTabs > 0 then
for i = 1, #self.postTabs do
showPostTab(self)
end
end
self:selectTab(self.tabs[#self.tabs])
end
updateTabs(self)
return
end

View File

@@ -1,5 +1,5 @@
-- @docclass
UIPopupMenu = extends(UIWidget)
UIPopupMenu = extends(UIWidget, "UIPopupMenu")
local currentMenu
@@ -56,9 +56,8 @@ end
function UIPopupMenu:addOption(optionName, optionCallback, shortcut)
local optionWidget = g_ui.createWidget(self:getStyleName() .. 'Button', self)
local lastOptionWidget = self:getLastChild()
optionWidget.onClick = function(self)
self:getParent():destroy()
optionWidget.onClick = function(widget)
self:destroy()
optionCallback()
end
optionWidget:setText(optionName)

View File

@@ -0,0 +1,129 @@
-- @docclass
UIPopupScrollMenu = extends(UIWidget, "UIPopupScrollMenu")
local currentMenu
function UIPopupScrollMenu.create()
local menu = UIPopupScrollMenu.internalCreate()
local scrollArea = g_ui.createWidget('UIScrollArea', menu)
scrollArea:setLayout(UIVerticalLayout.create(menu))
scrollArea:setId('scrollArea')
local scrollBar = g_ui.createWidget('VerticalScrollBar', menu)
scrollBar:setId('scrollBar')
scrollBar.pixelsScroll = false
scrollBar:addAnchor(AnchorRight, 'parent', AnchorRight)
scrollBar:addAnchor(AnchorTop, 'parent', AnchorTop)
scrollBar:addAnchor(AnchorBottom, 'parent', AnchorBottom)
scrollArea:addAnchor(AnchorLeft, 'parent', AnchorLeft)
scrollArea:addAnchor(AnchorTop, 'parent', AnchorTop)
scrollArea:addAnchor(AnchorBottom, 'parent', AnchorBottom)
scrollArea:addAnchor(AnchorRight, 'next', AnchorLeft)
scrollArea:setVerticalScrollBar(scrollBar)
menu.scrollArea = scrollArea
menu.scrollBar = scrollBar
return menu
end
function UIPopupScrollMenu:setScrollbarStep(step)
self.scrollBar:setStep(step)
end
function UIPopupScrollMenu:display(pos)
-- don't display if not options was added
if self.scrollArea:getChildCount() == 0 then
self:destroy()
return
end
if g_ui.isMouseGrabbed() then
self:destroy()
return
end
if currentMenu then
currentMenu:destroy()
end
if pos == nil then
pos = g_window.getMousePosition()
end
rootWidget:addChild(self)
self:setPosition(pos)
self:grabMouse()
currentMenu = self
end
function UIPopupScrollMenu:onGeometryChange(oldRect, newRect)
local parent = self:getParent()
if not parent then return end
local ymax = parent:getY() + parent:getHeight()
local xmax = parent:getX() + parent:getWidth()
if newRect.y + newRect.height > ymax then
local newy = newRect.y - newRect.height
if newy > 0 and newy + newRect.height < ymax then self:setY(newy) end
end
if newRect.x + newRect.width > xmax then
local newx = newRect.x - newRect.width
if newx > 0 and newx + newRect.width < xmax then self:setX(newx) end
end
self:bindRectToParent()
end
function UIPopupScrollMenu:addOption(optionName, optionCallback, shortcut)
local optionWidget = g_ui.createWidget(self:getStyleName() .. 'Button', self.scrollArea)
optionWidget.onClick = function(widget)
self:destroy()
optionCallback()
end
optionWidget:setText(optionName)
local width = optionWidget:getTextSize().width + optionWidget:getMarginLeft() + optionWidget:getMarginRight() + 15
if shortcut then
local shortcutLabel = g_ui.createWidget(self:getStyleName() .. 'ShortcutLabel', optionWidget)
shortcutLabel:setText(shortcut)
width = width + shortcutLabel:getTextSize().width + shortcutLabel:getMarginLeft() + shortcutLabel:getMarginRight()
end
self:setWidth(math.max(self:getWidth(), width))
end
function UIPopupScrollMenu:addSeparator()
g_ui.createWidget(self:getStyleName() .. 'Separator', self.scrollArea)
end
function UIPopupScrollMenu:onDestroy()
if currentMenu == self then
currentMenu = nil
end
self:ungrabMouse()
end
function UIPopupScrollMenu:onMousePress(mousePos, mouseButton)
-- clicks outside menu area destroys the menu
if not self:containsPoint(mousePos) then
self:destroy()
end
return true
end
function UIPopupScrollMenu:onKeyPress(keyCode, keyboardModifiers)
if keyCode == KeyEscape then
self:destroy()
return true
end
return false
end
-- close all menus when the window is resized
local function onRootGeometryUpdate()
if currentMenu then
currentMenu:destroy()
end
end
connect(rootWidget, { onGeometryChange = onRootGeometryUpdate} )

View File

@@ -1,5 +1,5 @@
-- @docclass
UIProgressBar = extends(UIWidget)
UIProgressBar = extends(UIWidget, "UIProgressBar")
function UIProgressBar.create()
local progressbar = UIProgressBar.internalCreate()

View File

@@ -1,5 +1,5 @@
-- @docclass
UIRadioGroup = newclass()
UIRadioGroup = newclass("UIRadioGroup")
function UIRadioGroup.create()
local radiogroup = UIRadioGroup.internalCreate()
@@ -28,7 +28,7 @@ function UIRadioGroup:removeWidget(widget)
table.removevalue(self.widgets, widget)
end
function UIRadioGroup:selectWidget(selectedWidget)
function UIRadioGroup:selectWidget(selectedWidget, dontSignal)
if selectedWidget == self.selectedWidget then return end
local previousSelectedWidget = self.selectedWidget
@@ -42,7 +42,9 @@ function UIRadioGroup:selectWidget(selectedWidget)
selectedWidget:setChecked(true)
end
if not dontSignal then
signalcall(self.onSelectionChange, self, selectedWidget, previousSelectedWidget)
end
end
function UIRadioGroup:clearSelected()

View File

@@ -1,5 +1,5 @@
-- @docclass
UIResizeBorder = extends(UIWidget)
UIResizeBorder = extends(UIWidget, "UIResizeBorder")
function UIResizeBorder.create()
local resizeborder = UIResizeBorder.internalCreate()

View File

@@ -1,5 +1,5 @@
-- @docclass
UIScrollArea = extends(UIWidget)
UIScrollArea = extends(UIWidget, "UIScrollArea")
-- public functions
function UIScrollArea.create()
@@ -107,15 +107,37 @@ end
function UIScrollArea:onMouseWheel(mousePos, mouseWheel)
if self.verticalScrollBar then
if not self.verticalScrollBar:isOn() then
return false
end
if mouseWheel == MouseWheelUp then
local minimum = self.verticalScrollBar:getMinimum()
if self.verticalScrollBar:getValue() <= minimum then
return false
end
self.verticalScrollBar:decrement()
else
local maximum = self.verticalScrollBar:getMaximum()
if self.verticalScrollBar:getValue() >= maximum then
return false
end
self.verticalScrollBar:increment()
end
elseif self.horizontalScrollBar then
if not self.horizontalScrollBar:isOn() then
return false
end
if mouseWheel == MouseWheelUp then
local maximum = self.horizontalScrollBar:getMaximum()
if self.horizontalScrollBar:getValue() >= maximum then
return false
end
self.horizontalScrollBar:increment()
else
local minimum = self.horizontalScrollBar:getMinimum()
if self.horizontalScrollBar:getValue() <= minimum then
return false
end
self.horizontalScrollBar:decrement()
end
end

View File

@@ -1,5 +1,5 @@
-- @docclass
UIScrollBar = extends(UIWidget)
UIScrollBar = extends(UIWidget, "UIScrollBar")
-- private functions
local function calcValues(self)
@@ -234,19 +234,23 @@ function UIScrollBar:onGeometryChange()
end
function UIScrollBar:onMouseWheel(mousePos, mouseWheel)
if not self.mouseScroll then
if not self.mouseScroll or not self:isOn() then
return false
end
if mouseWheel == MouseWheelUp then
if self.orientation == 'vertical' then
if self.value <= self.minimum then return false end
self:decrement()
else
if self.value >= self.maximum then return false end
self:increment()
end
else
if self.orientation == 'vertical' then
if self.value >= self.maximum then return false end
self:increment()
else
if self.value <= self.minimum then return false end
self:decrement()
end
end

View File

@@ -1,5 +1,5 @@
-- @docclass
UISpinBox = extends(UITextEdit)
UISpinBox = extends(UITextEdit, "UISpinBox")
function UISpinBox.create()
local spinbox = UISpinBox.internalCreate()
@@ -7,11 +7,13 @@ function UISpinBox.create()
spinbox:setValidCharacters('0123456789')
spinbox.displayButtons = true
spinbox.minimum = 0
spinbox.maximum = 0
spinbox.maximum = 1
spinbox.value = 0
spinbox.step = 1
spinbox.firstchange = true
spinbox.mouseScroll = true
spinbox:setText("0")
spinbox:setValue(1)
return spinbox
end
@@ -21,6 +23,9 @@ function UISpinBox:onSetup()
end
function UISpinBox:onMouseWheel(mousePos, direction)
if not self.mouseScroll then
return false
end
if direction == MouseWheelUp then
self:up()
elseif direction == MouseWheelDown then
@@ -70,6 +75,8 @@ function UISpinBox:onStyleApply(styleName, styleNode)
addEvent(function() self:setMaximum(value) end)
elseif name == 'minimum' then
addEvent(function() self:setMinimum(value) end)
elseif name == 'mouse-scroll' then
addEvent(function() self:setMouseScroll(value) end)
elseif name == 'buttons' then
addEvent(function()
if value then
@@ -157,3 +164,11 @@ end
function UISpinBox:setStep(step)
self.step = step or 1
end
function UISpinBox:setMouseScroll(mouseScroll)
self.mouseScroll = mouseScroll
end
function UISpinBox:getMouseScroll()
return self.mouseScroll
end

View File

@@ -1,5 +1,5 @@
-- @docclass
UISplitter = extends(UIWidget)
UISplitter = extends(UIWidget, "UISplitter")
function UISplitter.create()
local splitter = UISplitter.internalCreate()

View File

@@ -1,5 +1,5 @@
-- @docclass
UITabBar = extends(UIWidget)
UITabBar = extends(UIWidget, "UITabBar")
-- private functions
local function onTabClick(tab)

View File

@@ -5,7 +5,7 @@
* Get dynamic row heights working with text wrapping.
* Every second row different background color applied.
]]
UITable = extends(UIWidget)
UITable = extends(UIWidget, "UITable")
local HEADER_ID = 'row0'

View File

@@ -1,5 +1,5 @@
-- @docclass
UIWindow = extends(UIWidget)
UIWindow = extends(UIWidget, "UIWindow")
function UIWindow.create()
local window = UIWindow.internalCreate()
@@ -9,10 +9,6 @@ function UIWindow.create()
return window
end
function UIWindow:getClassName()
return 'UIWindow'
end
function UIWindow:onKeyDown(keyCode, keyboardModifiers)
if keyboardModifiers == KeyboardNoModifier then
if keyCode == KeyEnter then

View File

@@ -117,7 +117,11 @@ function disconnect(object, arg1, arg2)
end
end
function newclass()
function newclass(name)
if not name then
perror(debug.traceback('new class has no name.'))
end
local class = {}
function class.internalCreate()
local instance = {}
@@ -127,10 +131,16 @@ function newclass()
return instance
end
class.create = class.internalCreate
class.__class = name
class.getClassName = function() return name end
return class
end
function extends(base)
function extends(base, name)
if not name then
perror(debug.traceback('extended class has no name.'))
end
local derived = {}
function derived.internalCreate()
local instance = base.create()
@@ -140,6 +150,8 @@ function extends(base)
return instance
end
derived.create = derived.internalCreate
derived.__class = name
derived.getClassName = function() return name end
return derived
end
@@ -328,4 +340,16 @@ function getOppositeAnchor(anchor)
return anchor
end
function makesingleton(obj)
local singleton = {}
if obj.getClassName then
for key,value in pairs(_G[obj:getClassName()]) do
if type(value) == 'function' then
singleton[key] = function(...) return value(obj, ...) end
end
end
end
return singleton
end
-- @}

View File

@@ -214,38 +214,35 @@ function onChangeSortType(comboBox, option)
end
function onChangeSortOrder(comboBox, option)
setSortOrder(option:lower():gsub('[.]', '')) -- Replace dot in option name
-- Replace dot in option name
setSortOrder(option:lower():gsub('[.]', ''))
end
function checkCreatures()
removeAllCreatures()
local spectators = {}
local player = g_game.getLocalPlayer()
if g_game.isOnline() then
creatures = g_map.getSpectators(player:getPosition(), false)
for i, creature in ipairs(creatures) do
if creature ~= player and doCreatureFitFilters(creature) then
table.insert(spectators, creature)
end
end
if not g_game.isOnline() then
return
end
for i, v in pairs(spectators) do
addCreature(v)
local player = g_game.getLocalPlayer()
local spectators = g_map.getSpectators(player:getPosition(), false)
for _, creature in ipairs(spectators) do
if doCreatureFitFilters(creature) then
addCreature(creature)
end
end
end
function doCreatureFitFilters(creature)
local localPlayer = g_game.getLocalPlayer()
if creature == localPlayer then
if creature:isLocalPlayer() then
return false
end
local pos = creature:getPosition()
if not pos then return false end
local localPlayer = g_game.getLocalPlayer()
if pos.z ~= localPlayer:getPosition().z or not creature:canBeSeen() then return false end
local hidePlayers = hidePlayersButton:isChecked()
@@ -293,8 +290,8 @@ function onCreaturePositionChange(creature, newPos, oldPos)
-- Distance will change when moving, recalculate and move to correct index
if getSortType() == 'distance' then
local distanceList = {}
for id, creatureButton in pairs(battleButtonsByCreaturesList) do
table.insert(distanceList, {distance = getDistanceBetween(newPos, creatureButton.creature:getPosition()), widget = creatureButton})
for _, battleButton in pairs(battleButtonsByCreaturesList) do
table.insert(distanceList, {distance = getDistanceBetween(newPos, battleButton.creature:getPosition()), widget = battleButton})
end
if isSortAsc() then
@@ -308,8 +305,8 @@ function onCreaturePositionChange(creature, newPos, oldPos)
end
end
for id, creatureButton in pairs(battleButtonsByCreaturesList) do
addCreature(creatureButton.creature)
for _, battleButton in pairs(battleButtonsByCreaturesList) do
addCreature(battleButton.creature)
end
end
else
@@ -335,6 +332,12 @@ function onCreatureOutfitChange(creature, outfit, oldOutfit)
end
function onCreatureAppear(creature)
if creature:isLocalPlayer() then
addEvent(function()
updateStaticSquare()
end)
end
if doCreatureFitFilters(creature) then
addCreature(creature)
end
@@ -454,8 +457,8 @@ end
function removeAllCreatures()
creatureAgeList = {}
for i, v in pairs(battleButtonsByCreaturesList) do
removeCreature(v.creature)
for _, battleButton in pairs(battleButtonsByCreaturesList) do
removeCreature(battleButton.creature)
end
end
@@ -500,10 +503,10 @@ function onBattleButtonMouseRelease(self, mousePosition, mouseButton)
return false
end
function onBattleButtonHoverChange(widget, hovered)
if widget.isBattleButton then
widget.isHovered = hovered
updateBattleButton(widget)
function onBattleButtonHoverChange(battleButton, hovered)
if battleButton.isBattleButton then
battleButton.isHovered = hovered
updateBattleButton(battleButton)
end
end
@@ -523,6 +526,14 @@ function onFollow(creature)
end
end
function updateStaticSquare()
for _, battleButton in pairs(battleButtonsByCreaturesList) do
if battleButton.isTarget then
battleButton:update()
end
end
end
function updateCreatureSkull(creature, skullId)
local battleButton = battleButtonsByCreaturesList[creature:getId()]
if battleButton then

View File

@@ -324,7 +324,7 @@ end
function openHelp()
local helpChannel = 9
if g_game.getProtocolVersion() <= 810 then
if g_game.getClientVersion() <= 810 then
helpChannel = 8
end
g_game.joinChannel(helpChannel)
@@ -679,7 +679,7 @@ function sendMessage(message, tab)
local chatCommandMessage
-- player used yell command
chatCommandMessage = message:match("^%#y (.*)")
chatCommandMessage = message:match("^%#[y|Y] (.*)")
if chatCommandMessage ~= nil then
chatCommandSayMode = 'yell'
channel = 0
@@ -687,7 +687,7 @@ function sendMessage(message, tab)
end
-- player used whisper
local chatCommandMessage = message:match("^%#w (.*)")
local chatCommandMessage = message:match("^%#[w|W] (.*)")
if chatCommandMessage ~= nil then
chatCommandSayMode = 'whisper'
message = chatCommandMessage
@@ -695,7 +695,7 @@ function sendMessage(message, tab)
end
-- player say
local chatCommandMessage = message:match("^%#s (.*)")
local chatCommandMessage = message:match("^%#[s|S] (.*)")
if chatCommandMessage ~= nil then
chatCommandSayMode = 'say'
message = chatCommandMessage
@@ -1236,7 +1236,7 @@ function online()
defaultTab = addTab(tr('Default'), true)
serverTab = addTab(tr('Server Log'), false)
if g_game.getProtocolVersion() < 862 then
if g_game.getClientVersion() < 862 then
g_keyboard.bindKeyDown('Ctrl+R', openPlayerReportRuleViolationWindow)
end
-- open last channels
@@ -1259,7 +1259,7 @@ function online()
end
function offline()
if g_game.getProtocolVersion() < 862 then
if g_game.getClientVersion() < 862 then
g_keyboard.unbindKeyDown('Ctrl+R')
end
clear()

View File

@@ -1,3 +1,8 @@
PageButton < Button
size: 30 18
margin: 1
ContainerWindow < MiniWindow
height: 150
@@ -25,6 +30,35 @@ ContainerWindow < MiniWindow
$pressed:
image-clip: 42 28 14 14
Panel
id: pagePanel
anchors.left: parent.left
anchors.right: parent.right
anchors.top: miniwindowTopBar.bottom
height: 20
margin: 2 3 0 3
background: #00000066
visible: false
Label
id: pageLabel
anchors.top: parent.top
anchors.horizontalCenter: parent.horizontalCenter
margin-top: 2
text-auto-resize: true
PageButton
id: prevPageButton
text: <
anchors.top: parent.top
anchors.left: parent.left
PageButton
id: nextPageButton
text: >
anchors.top: parent.top
anchors.right: parent.right
MiniWindowContents
padding-right: 0
layout:

View File

@@ -3,9 +3,8 @@ function init()
connect(Container, { onOpen = onContainerOpen,
onClose = onContainerClose,
onAddItem = onContainerAddItem,
onUpdateItem = onContainerUpdateItem,
onRemoveItem = onContainerRemoveItem })
onSizeChange = onContainerChangeSize,
onUpdateItem = onContainerUpdateItem })
connect(Game, { onGameEnd = clean() })
reloadContainers()
@@ -14,9 +13,8 @@ end
function terminate()
disconnect(Container, { onOpen = onContainerOpen,
onClose = onContainerClose,
onAddItem = onContainerAddItem,
onUpdateItem = onContainerUpdateItem,
onRemoveItem = onContainerRemoveItem })
onSizeChange = onContainerChangeSize,
onUpdateItem = onContainerUpdateItem })
disconnect(Game, { onGameEnd = clean() })
end
@@ -46,6 +44,38 @@ function refreshContainerItems(container)
local itemWidget = container.itemsPanel:getChildById('item' .. slot)
itemWidget:setItem(container:getItem(slot))
end
if container:hasPages() then
refreshContainerPages(container)
end
end
function toggleContainerPages(containerWindow, pages)
containerWindow:getChildById('miniwindowScrollBar'):setMarginTop(pages and 42 or 22)
containerWindow:getChildById('contentsPanel'):setMarginTop(pages and 42 or 22)
containerWindow:getChildById('pagePanel'):setVisible(pages)
end
function refreshContainerPages(container)
local currentPage = 1 + math.floor(container:getFirstIndex() / container:getCapacity())
local pages = 1 + math.floor(math.max(0, (container:getSize() - 1)) / container:getCapacity())
container.window:recursiveGetChildById('pageLabel'):setText(string.format('Page %i of %i', currentPage, pages))
local prevPageButton = container.window:recursiveGetChildById('prevPageButton')
if currentPage == 1 then
prevPageButton:setEnabled(false)
else
prevPageButton:setEnabled(true)
prevPageButton.onClick = function() g_game.seekInContainer(container:getId(), container:getFirstIndex() - container:getCapacity()) end
end
local nextPageButton = container.window:recursiveGetChildById('nextPageButton')
if currentPage >= pages then
nextPageButton:setEnabled(false)
else
nextPageButton:setEnabled(true)
nextPageButton.onClick = function() g_game.seekInContainer(container:getId(), container:getFirstIndex() + container:getCapacity()) end
end
end
function onContainerOpen(container, previousContainer)
@@ -88,11 +118,18 @@ function onContainerOpen(container, previousContainer)
itemWidget:setItem(container:getItem(slot))
itemWidget:setMargin(0)
itemWidget.position = container:getSlotPosition(slot)
if not container:isUnlocked() then
itemWidget:setBorderColor('red')
end
end
container.window = containerWindow
container.itemsPanel = containerPanel
toggleContainerPages(containerWindow, container:hasPages())
refreshContainerPages(container)
local layout = containerPanel:getLayout()
local cellSize = layout:getCellSize()
containerWindow:setContentMinimumHeight(cellSize.height)
@@ -110,7 +147,7 @@ function onContainerClose(container)
destroy(container)
end
function onContainerAddItem(container, slot, item)
function onContainerChangeSize(container, size)
if not container.window then return end
refreshContainerItems(container)
end
@@ -120,8 +157,3 @@ function onContainerUpdateItem(container, slot, item, oldItem)
local itemWidget = container.itemsPanel:getChildById('item' .. slot)
itemWidget:setItem(item)
end
function onContainerRemoveItem(container, slot, item)
if not container.window then return end
refreshContainerItems(container)
end

View File

@@ -9,12 +9,16 @@ contentsPanel = nil
cooldownPanel = nil
lastPlayer = nil
cooldown = {}
groupCooldown = {}
function init()
connect(g_game, { onGameStart = online,
onSpellGroupCooldown = onSpellGroupCooldown,
onSpellCooldown = onSpellCooldown })
cooldownButton = modules.client_topmenu.addRightGameToggleButton('cooldownButton', tr('Cooldowns'), '/images/topbuttons/cooldowns', toggle)
cooldownButton = modules.client_topmenu.addRightGameToggleButton('cooldownButton',
tr('Cooldowns'), '/images/topbuttons/cooldowns', toggle)
cooldownButton:setOn(true)
cooldownButton:hide()
@@ -47,6 +51,7 @@ end
function loadIcon(iconId)
local spell, profile, spellName = Spells.getSpellByIcon(iconId)
if not spellName then return end
if not profile then return end
clientIconId = Spells.getClientId(spellName)
if not clientIconId then return end
@@ -57,8 +62,13 @@ function loadIcon(iconId)
icon:setId(iconId)
end
icon:setImageSource(SpelllistSettings[profile].iconFile)
local spellSettings = SpelllistSettings[profile]
if spellSettings then
icon:setImageSource(spellSettings.iconFile)
icon:setImageClip(Spells.getImageClip(clientIconId, profile))
else
icon = nil
end
return icon
end
@@ -133,12 +143,23 @@ function updateCooldown(progressRect, duration)
if progressRect:getPercent() < 100 then
removeEvent(progressRect.event)
progressRect.event = scheduleEvent(function() progressRect.callback[ProgressCallback.update]() end, 100)
progressRect.event = scheduleEvent(function()
progressRect.callback[ProgressCallback.update]()
end, 100)
else
progressRect.callback[ProgressCallback.finish]()
end
end
function isGroupCooldownIconActive(groupId)
return groupCooldown[groupId]
end
function isCooldownIconActive(iconId)
return cooldown[iconId]
end
function onSpellCooldown(iconId, duration)
local icon = loadIcon(iconId)
if not icon then
@@ -162,8 +183,10 @@ function onSpellCooldown(iconId, duration)
end
local finishFunc = function()
removeCooldown(progressRect)
cooldown[iconId] = false
end
initCooldown(progressRect, updateFunc, finishFunc)
cooldown[iconId] = true
end
function onSpellGroupCooldown(groupId, duration)
@@ -184,7 +207,9 @@ function onSpellGroupCooldown(groupId, duration)
end
local finishFunc = function()
turnOffCooldown(progressRect)
groupCooldown[groupId] = false
end
initCooldown(progressRect, updateFunc, finishFunc)
groupCooldown[groupId] = true
end
end

View File

@@ -96,5 +96,5 @@ MiniWindow
anchors.top: groupIconSpecial.bottom
anchors.left: parent.left
anchors.right: parent.right
background-color: #ffffff11
background-color: #00000022

Some files were not shown because too many files have changed in this diff Show More