Compare commits
291 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
59c3e4467a | ||
![]() |
117833addc | ||
![]() |
edf17a44ca | ||
![]() |
6db2458c1d | ||
![]() |
2556bfcbf2 | ||
![]() |
9bdce800d8 | ||
![]() |
9adab5f9bf | ||
![]() |
a6f998d406 | ||
![]() |
ab21558c47 | ||
![]() |
17c4d59b15 | ||
![]() |
d53f4dfa1e | ||
![]() |
da959aca28 | ||
![]() |
91c182d93d | ||
![]() |
6ecd49abe1 | ||
![]() |
6745bff132 | ||
![]() |
27db78567b | ||
![]() |
83dd92cfec | ||
![]() |
5605061435 | ||
![]() |
241b178ebc | ||
![]() |
d0288e23d8 | ||
![]() |
9d8cf33acc | ||
![]() |
6a4868f2b5 | ||
![]() |
aa84ee4362 | ||
![]() |
1e17919a26 | ||
![]() |
df3546b073 | ||
![]() |
24e26e190b | ||
![]() |
ad7cda534d | ||
![]() |
863bece70b | ||
![]() |
22f97aa00b | ||
![]() |
e32607b05c | ||
![]() |
1790eee1c6 | ||
![]() |
ec2518525a | ||
![]() |
eb4fb4ff41 | ||
![]() |
4f997a3826 | ||
![]() |
c54015a60d | ||
![]() |
57c432d3ea | ||
![]() |
bd8c883e13 | ||
![]() |
b5c3b37b3c | ||
![]() |
ece6507df2 | ||
![]() |
04515ffbb8 | ||
![]() |
ed24a0735a | ||
![]() |
2498129ff3 | ||
![]() |
066638e7c0 | ||
![]() |
95610de5f3 | ||
![]() |
9154c0a678 | ||
![]() |
772ec208c0 | ||
![]() |
7914832be9 | ||
![]() |
99500c9c91 | ||
![]() |
b9b9a32b83 | ||
![]() |
f615b80fbc | ||
![]() |
319f32cdaa | ||
![]() |
ba091c9f5b | ||
![]() |
3288711d16 | ||
![]() |
8b0509a5c3 | ||
![]() |
d7612e9304 | ||
![]() |
4dcb30110f | ||
![]() |
7ff73d1064 | ||
![]() |
ca2fe9cf45 | ||
![]() |
b61f509755 | ||
![]() |
ec012cb137 | ||
![]() |
69ae324676 | ||
![]() |
4d656f8bd1 | ||
![]() |
c98439ae65 | ||
![]() |
4f9f04206d | ||
![]() |
fc54a6e418 | ||
![]() |
25d3019d1a | ||
![]() |
1711d8bdaf | ||
![]() |
28d967ccce | ||
![]() |
f02d5e7975 | ||
![]() |
4bfe9b640e | ||
![]() |
ab1cc8c890 | ||
![]() |
d657a0482a | ||
![]() |
8562d38ca4 | ||
![]() |
28786a3570 | ||
![]() |
b07a77f705 | ||
![]() |
0d44942e8e | ||
![]() |
dd829395e3 | ||
![]() |
18fa54181a | ||
![]() |
5b8ff29fa3 | ||
![]() |
59e90e8f1e | ||
![]() |
5db37857bf | ||
![]() |
fc0297d6db | ||
![]() |
1060c6f78c | ||
![]() |
c9597d6682 | ||
![]() |
d3e97d33c7 | ||
![]() |
2b015d49d7 | ||
![]() |
f04b4a0b42 | ||
![]() |
ff5c22d4c0 | ||
![]() |
d6105a98d1 | ||
![]() |
0938e22eb9 | ||
![]() |
1868b235cb | ||
![]() |
9a30050340 | ||
![]() |
9d689f0c43 | ||
![]() |
2b34c0ea0a | ||
![]() |
d32f71c2b9 | ||
![]() |
3cff331723 | ||
![]() |
9894f0c0b9 | ||
![]() |
e60372fdea | ||
![]() |
d2473fd424 | ||
![]() |
7d7bd00a63 | ||
![]() |
c81a623c43 | ||
![]() |
8b165b95fd | ||
![]() |
6f9436dd60 | ||
![]() |
ae95f51346 | ||
![]() |
9b84570372 | ||
![]() |
38dec168ee | ||
![]() |
84b722f8c7 | ||
![]() |
b3717ceb93 | ||
![]() |
3340e06da6 | ||
![]() |
084ee45650 | ||
![]() |
7290ec3334 | ||
![]() |
971d90a596 | ||
![]() |
8230bf2af4 | ||
![]() |
241b54262a | ||
![]() |
63ce68b449 | ||
![]() |
f47ea05abc | ||
![]() |
de3160c90d | ||
![]() |
67bd00556d | ||
![]() |
778559c7b9 | ||
![]() |
3aac0ac0ec | ||
![]() |
4adfafc67e | ||
![]() |
1b27a095a9 | ||
![]() |
e6977b1b43 | ||
![]() |
5843b78e87 | ||
![]() |
7cf645e715 | ||
![]() |
537508021e | ||
![]() |
e741a62ce9 | ||
![]() |
56d6ef6642 | ||
![]() |
3db8f54aa9 | ||
![]() |
9234030c1b | ||
![]() |
520baa28ea | ||
![]() |
bbdeac2e33 | ||
![]() |
1f914351bb | ||
![]() |
eb68504dc1 | ||
![]() |
32647f11bf | ||
![]() |
644d4daeea | ||
![]() |
b27352c321 | ||
![]() |
a6be9ae525 | ||
![]() |
5df3ec8cf2 | ||
![]() |
00729bbc2e | ||
![]() |
3b2d8a2b5e | ||
![]() |
d5298c1011 | ||
![]() |
aaad8ab8a0 | ||
![]() |
efbd9ab693 | ||
![]() |
092209c0bb | ||
![]() |
05f7f6a4cf | ||
![]() |
2c36ca7215 | ||
![]() |
926eb9f01e | ||
![]() |
96bb28e806 | ||
![]() |
e15995e1eb | ||
![]() |
719debfeae | ||
![]() |
e7137c2535 | ||
![]() |
5eabf6f518 | ||
![]() |
5849136526 | ||
![]() |
0451fd6b58 | ||
![]() |
9cf878335a | ||
![]() |
529b646316 | ||
![]() |
1ea2b380ca | ||
![]() |
914fe249ab | ||
![]() |
4d498ed0d8 | ||
![]() |
9aa667da26 | ||
![]() |
e6db43ac3a | ||
![]() |
b5911cf1de | ||
![]() |
5fbb71157d | ||
![]() |
0ff36a1a0a | ||
![]() |
4a04a18835 | ||
![]() |
6fa9631d6a | ||
![]() |
261642190b | ||
![]() |
95abf2a1d2 | ||
![]() |
c4adf2d817 | ||
![]() |
c7c259ef80 | ||
![]() |
987c6d6c91 | ||
![]() |
c8185474de | ||
![]() |
be071c7103 | ||
![]() |
2f9e2c3e33 | ||
![]() |
b81590f297 | ||
![]() |
e062562888 | ||
![]() |
18d23653c4 | ||
![]() |
6c119627bb | ||
![]() |
d847a78a4d | ||
![]() |
0dccc870b5 | ||
![]() |
e4c7ca604b | ||
![]() |
d427560b98 | ||
![]() |
cc12db0d1f | ||
![]() |
1ce6df99ac | ||
![]() |
57bb6ff974 | ||
![]() |
9bae1b9e25 | ||
![]() |
1415de222c | ||
![]() |
34ceb3c95e | ||
![]() |
b43a196eac | ||
![]() |
a3a65d40ce | ||
![]() |
6ef3508362 | ||
![]() |
a71e07f063 | ||
![]() |
4bdd1e79fd | ||
![]() |
e9e4dcd71b | ||
![]() |
0891e2b30a | ||
![]() |
24664714bd | ||
![]() |
da51dd467e | ||
![]() |
64fc4570c9 | ||
![]() |
392acc0b43 | ||
![]() |
69f72b9c86 | ||
![]() |
489688e9fb | ||
![]() |
d911b38d68 | ||
![]() |
61be2103ed | ||
![]() |
a7b27ef8dd | ||
![]() |
10a16169a4 | ||
![]() |
44bf4dcb6e | ||
![]() |
9305053e34 | ||
![]() |
1dd558d57e | ||
![]() |
15ee7962f1 | ||
![]() |
8c016b143a | ||
![]() |
a85ca0fb17 | ||
![]() |
115bf08364 | ||
![]() |
71b5c5f2e4 | ||
![]() |
5396ea6231 | ||
![]() |
9955de573b | ||
![]() |
0be7bd5360 | ||
![]() |
c452e74e0c | ||
![]() |
bdbe065c23 | ||
![]() |
f4263384bc | ||
![]() |
f50c63e9e5 | ||
![]() |
48ac91d173 | ||
![]() |
8db85e4e3a | ||
![]() |
02d32565e9 | ||
![]() |
3980f859b7 | ||
![]() |
c392bcca90 | ||
![]() |
62921dee9b | ||
![]() |
3ca85cbe87 | ||
![]() |
32df317163 | ||
![]() |
a145ad282b | ||
![]() |
884102833e | ||
![]() |
50b6cc69e1 | ||
![]() |
8314b84f69 | ||
![]() |
e85afd4b63 | ||
![]() |
120c2b4231 | ||
![]() |
dad3026ba0 | ||
![]() |
9312d20a0f | ||
![]() |
425bfd998b | ||
![]() |
b804dd6959 | ||
![]() |
69e762385e | ||
![]() |
e528fcc8f8 | ||
![]() |
46aa0c005f | ||
![]() |
eb46b96ffa | ||
![]() |
ccbe491e3c | ||
![]() |
864ac3fdd9 | ||
![]() |
5f26303389 | ||
![]() |
0bf909d52f | ||
![]() |
ef20f59a98 | ||
![]() |
406c7bdae6 | ||
![]() |
41b81da76f | ||
![]() |
dc3559a5c0 | ||
![]() |
d0576da69d | ||
![]() |
2a225b99b7 | ||
![]() |
04f52d77d2 | ||
![]() |
06e2b6eca2 | ||
![]() |
a8c175452b | ||
![]() |
92228e9553 | ||
![]() |
67ed9e21ad | ||
![]() |
01126eee62 | ||
![]() |
8e9f65779c | ||
![]() |
2296e35174 | ||
![]() |
28e70516a4 | ||
![]() |
039c3072dc | ||
![]() |
f4f9e319d8 | ||
![]() |
035ce26728 | ||
![]() |
04c4943fa8 | ||
![]() |
09c937998f | ||
![]() |
e4e3d7d053 | ||
![]() |
5b573afdfc | ||
![]() |
90d2032e9e | ||
![]() |
3eeb5ae890 | ||
![]() |
9a54bfcc90 | ||
![]() |
f8b078ea91 | ||
![]() |
33ce0aa704 | ||
![]() |
bb304f9f4e | ||
![]() |
a84d0bbf11 | ||
![]() |
cb3f06358c | ||
![]() |
3b91c4d509 | ||
![]() |
f4c7d98bd5 | ||
![]() |
88c59afb8c | ||
![]() |
b61094c053 | ||
![]() |
3b9acab7a1 | ||
![]() |
6d456994f4 | ||
![]() |
e87e669c87 | ||
![]() |
59a5b8115a | ||
![]() |
67fc77d507 | ||
![]() |
28cdd6aa53 | ||
![]() |
4f423432fa | ||
![]() |
62f38d678d | ||
![]() |
07dd78002b | ||
![]() |
5fc1ac8051 |
73
.gitignore
vendored
@@ -1,4 +1,3 @@
|
|||||||
/modules/.project
|
|
||||||
build*
|
build*
|
||||||
CMakeCache.txt
|
CMakeCache.txt
|
||||||
CMakeFiles
|
CMakeFiles
|
||||||
@@ -37,3 +36,75 @@ otclient.layout
|
|||||||
LOCALTODO
|
LOCALTODO
|
||||||
tags
|
tags
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
|
.directory
|
||||||
|
src/framework/graphics/dx/
|
||||||
|
modules/.project/modules.sublime-workspace
|
||||||
|
|
||||||
|
#################
|
||||||
|
## Visual Studio
|
||||||
|
#################
|
||||||
|
|
||||||
|
## Ignore Visual Studio temporary files, build results, and
|
||||||
|
## files generated by popular Visual Studio add-ons.
|
||||||
|
|
||||||
|
# User-specific files
|
||||||
|
*.suo
|
||||||
|
*.user
|
||||||
|
*.sln.docstates
|
||||||
|
|
||||||
|
# Build results
|
||||||
|
|
||||||
|
[Dd]ebug/
|
||||||
|
[Rr]elease/
|
||||||
|
x64/
|
||||||
|
build/
|
||||||
|
[Bb]in/
|
||||||
|
[Oo]bj/
|
||||||
|
|
||||||
|
# MSTest test Results
|
||||||
|
[Tt]est[Rr]esult*/
|
||||||
|
[Bb]uild[Ll]og.*
|
||||||
|
|
||||||
|
*_i.c
|
||||||
|
*_p.c
|
||||||
|
*.ilk
|
||||||
|
*.meta
|
||||||
|
*.obj
|
||||||
|
*.pch
|
||||||
|
*.pdb
|
||||||
|
*.pgc
|
||||||
|
*.pgd
|
||||||
|
*.rsp
|
||||||
|
*.sbr
|
||||||
|
*.tlb
|
||||||
|
*.tli
|
||||||
|
*.tlh
|
||||||
|
*.tmp
|
||||||
|
*.tmp_proj
|
||||||
|
*.log
|
||||||
|
*.vspscc
|
||||||
|
*.vssscc
|
||||||
|
.builds
|
||||||
|
*.pidb
|
||||||
|
*.log
|
||||||
|
*.scc
|
||||||
|
|
||||||
|
# Visual C++ cache files
|
||||||
|
ipch/
|
||||||
|
*.aps
|
||||||
|
*.ncb
|
||||||
|
*.opensdf
|
||||||
|
*.sdf
|
||||||
|
*.cachefile
|
||||||
|
|
||||||
|
# Visual Studio profiler
|
||||||
|
*.psess
|
||||||
|
*.vsp
|
||||||
|
*.vspx
|
||||||
|
|
||||||
|
# Guidance Automation Toolkit
|
||||||
|
*.gpState
|
||||||
|
|
||||||
|
# ReSharper is a .NET coding add-in
|
||||||
|
_ReSharper*/
|
||||||
|
*.[Rr]e[Ss]harper
|
||||||
|
@@ -1,12 +1,14 @@
|
|||||||
cmake_minimum_required(VERSION 2.6)
|
cmake_minimum_required(VERSION 2.6)
|
||||||
project(otclient)
|
project(otclient)
|
||||||
|
|
||||||
set(VERSION "0.6.1")
|
set(VERSION "0.6.5")
|
||||||
|
|
||||||
|
option(FRAMEWORK_SOUND "Use SOUND " ON)
|
||||||
|
option(FRAMEWORK_GRAPHICS "Use GRAPHICS " ON)
|
||||||
|
option(FRAMEWORK_XML "Use XML " ON)
|
||||||
|
option(FRAMEWORK_NET "Use NET " ON)
|
||||||
|
option(FRAMEWORK_SQL "Use SQL" OFF)
|
||||||
|
|
||||||
set(FRAMEWORK_SOUND ON)
|
|
||||||
set(FRAMEWORK_GRAPHICS ON)
|
|
||||||
set(FRAMEWORK_XML ON)
|
|
||||||
set(FRAMEWORK_NET ON)
|
|
||||||
include(src/framework/CMakeLists.txt)
|
include(src/framework/CMakeLists.txt)
|
||||||
include(src/client/CMakeLists.txt)
|
include(src/client/CMakeLists.txt)
|
||||||
|
|
||||||
|
24
README.md
@@ -8,6 +8,18 @@ that each functionality is a separated module, giving the possibility to users m
|
|||||||
anything easily. Users can also create new mods and extend game interface for their own purposes.
|
anything easily. Users can also create new mods and extend game interface for their own purposes.
|
||||||
Otclient is written in C++2011, the upcoming C++ standard and heavily scripted in lua.
|
Otclient is written in C++2011, the upcoming C++ standard and heavily scripted in lua.
|
||||||
|
|
||||||
|
### Where do I download?
|
||||||
|
|
||||||
|
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`)
|
||||||
|
|
||||||
|
Older releases can be downloaded from [here](https://www.dropbox.com/sh/se1okacemoqzjve/-oWK4YFm03)
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
Beyond of it's flexibility with scripts, otclient comes with tons of other features that make possible
|
Beyond of it's flexibility with scripts, otclient comes with tons of other features that make possible
|
||||||
@@ -18,17 +30,18 @@ to port to mobile platforms. Otclient is also flexible enough to
|
|||||||
create tibia tools like map editors just using scripts, because it wasn't designed to be just a
|
create tibia tools like map editors just using scripts, because it wasn't designed to be just a
|
||||||
client, instead otclient was designed to be a combination of a framework and tibia APIs.
|
client, instead otclient was designed to be a combination of a framework and tibia APIs.
|
||||||
|
|
||||||
### Download
|
|
||||||
|
|
||||||
Stable versions of otclient master branch compiled for Windows and Linux is available
|
|
||||||
in the [downloads section](https://github.com/edubart/otclient/downloads) of the project's github page.
|
|
||||||
|
|
||||||
### Compiling
|
### Compiling
|
||||||
|
|
||||||
|
A package with all required libraries for compiling OTClient on Windows can be found here:
|
||||||
|
* [For MSVC 2013](https://www.dropbox.com/sh/se1okacemoqzjve/dI4ODbq7OT/otclient-msvc13-libs.zip)
|
||||||
|
* [For MingW32](https://www.dropbox.com/sh/se1okacemoqzjve/UAkRCiGXXR/otclient-libs_mingw32-dwarf2.zip)
|
||||||
|
|
||||||
In short, if you need to compile OTClient, follow these tutorials:
|
In short, if you need to compile OTClient, follow these tutorials:
|
||||||
* [Compiling on Windows](https://github.com/edubart/otclient/wiki/Compiling-on-Windows)
|
* [Compiling on Windows](https://github.com/edubart/otclient/wiki/Compiling-on-Windows)
|
||||||
* [Compiling on Linux](https://github.com/edubart/otclient/wiki/Compiling-on-Linux)
|
* [Compiling on Linux](https://github.com/edubart/otclient/wiki/Compiling-on-Linux)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Need help?
|
### Need help?
|
||||||
|
|
||||||
Try to ask questions in [otland](http://otland.net/f494/), now we have a board for the project there,
|
Try to ask questions in [otland](http://otland.net/f494/), now we have a board for the project there,
|
||||||
@@ -50,4 +63,3 @@ Talk directly with us at #otclient irc.freenode.net or send an email directly to
|
|||||||
|
|
||||||
Otclient is made available under the MIT License, thus this means that you are free
|
Otclient is made available under the MIT License, thus this means that you are free
|
||||||
to do whatever you want, commercial, non-commercial, closed or open.
|
to do whatever you want, commercial, non-commercial, closed or open.
|
||||||
|
|
||||||
|
8
data/fonts/terminus-10px.otfont
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
Font
|
||||||
|
name: terminus-10px
|
||||||
|
texture: terminus-10px
|
||||||
|
height: 12
|
||||||
|
y-offset: 0
|
||||||
|
glyph-size: 16 16
|
||||||
|
fixed-glyph-width: 6
|
||||||
|
space-width: 6
|
BIN
data/fonts/terminus-10px.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 1.3 MiB After Width: | Height: | Size: 1.3 MiB |
BIN
data/images/game/combatmodes/mount.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
data/images/game/combatmodes/redfistmode.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
data/images/game/combatmodes/whitedovemode.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
data/images/game/combatmodes/whitehandmode.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
data/images/game/combatmodes/yellowhandmode.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
data/images/game/dangerous.png
Normal file
After Width: | Height: | Size: 227 B |
BIN
data/images/game/emblems/emblem_member.png
Normal file
After Width: | Height: | Size: 333 B |
BIN
data/images/game/emblems/emblem_other.png
Normal file
After Width: | Height: | Size: 319 B |
BIN
data/images/game/minimap/cross.png
Normal file
After Width: | Height: | Size: 243 B |
BIN
data/images/game/shields/shield_gray.png
Normal file
After Width: | Height: | Size: 330 B |
BIN
data/images/game/summon_other.png
Normal file
After Width: | Height: | Size: 283 B |
BIN
data/images/game/summon_own.png
Normal file
After Width: | Height: | Size: 283 B |
BIN
data/images/ui/icon_add.png
Normal file
After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 661 B After Width: | Height: | Size: 646 B |
@@ -1,5 +1,7 @@
|
|||||||
-- special thanks for Shaday, who made these translations
|
-- special thanks for Shaday, who made these translations
|
||||||
|
--Dominique120 edits: I made some statements to sound more formal and appropriate as well as correcting a few words that were not translated. I also added a few notes for future translators to keep in mind.
|
||||||
|
|
||||||
|
|
||||||
locale = {
|
locale = {
|
||||||
name = "es",
|
name = "es",
|
||||||
charset = "cp1252",
|
charset = "cp1252",
|
||||||
@@ -9,18 +11,18 @@ locale = {
|
|||||||
["1a) Offensive Name"] = "1a) Nombre ofensivo",
|
["1a) Offensive Name"] = "1a) Nombre ofensivo",
|
||||||
["1b) Invalid Name Format"] = "1b) Formato invalido para nombre",
|
["1b) Invalid Name Format"] = "1b) Formato invalido para nombre",
|
||||||
["1c) Unsuitable Name"] = "1c) Nombre no adecuado",
|
["1c) Unsuitable Name"] = "1c) Nombre no adecuado",
|
||||||
["1d) Name Inciting Rule Violation"] = "1d) Nombre que incita una violacion al reglamento",
|
["1d) Name Inciting Rule Violation"] = "1d) Nombre que incita una violaci<EFBFBD>n al reglamento",
|
||||||
["2a) Offensive Statement"] = "2a) Comentario ofensivo",
|
["2a) Offensive Statement"] = "2a) Comentario ofensivo",
|
||||||
["2b) Spamming"] = "2b) Spamming",
|
["2b) Spamming"] = "2b) Spamming",
|
||||||
["2c) Illegal Advertising"] = "2c) Publicidad ilicita",
|
["2c) Illegal Advertising"] = "2c) Publicidad il<EFBFBD>cita",
|
||||||
["2d) Off-Topic Public Statement"] = "2d) Publicacion fuera de lugar",
|
["2d) Off-Topic Public Statement"] = "2d) Publicaci<EFBFBD>n fuera de lugar",
|
||||||
["2e) Non-English Public Statement"] = "2e) Publicacion fuera del ingles",
|
["2e) Non-English Public Statement"] = "2e) Publicaci<EFBFBD>n fuera del ingles",
|
||||||
["2f) Inciting Rule Violation"] = "2f) Incitar a una violacion al reglamento",
|
["2f) Inciting Rule Violation"] = "2f) Incitar a una violaci<EFBFBD>n al reglamento",
|
||||||
["3a) Bug Abuse"] = "3a) Abuso de error",
|
["3a) Bug Abuse"] = "3a) Abuso de error",
|
||||||
["3b) Game Weakness Abuse"] = "3b) Abuso de debilidad del juego",
|
["3b) Game Weakness Abuse"] = "3b) Abuso de debilidad del juego",
|
||||||
["3c) Using Unofficial Software to Play"] = "3c) Usando software ilegal para jugar",
|
["3c) Using Unofficial Software to Play"] = "3c) Usando software ilegal para jugar",
|
||||||
["3d) Hacking"] = "3d) Hackeo",
|
["3d) Hacking"] = "3d) Hackeo",
|
||||||
["3e) Multi-Clienting"] = "3e) Multiple Cliente",
|
["3e) Multi-Clienting"] = "3e) Uso de m<>ltiples clientes",
|
||||||
["3f) Account Trading or Sharing"] = "3f) Intercambio de cuenta",
|
["3f) Account Trading or Sharing"] = "3f) Intercambio de cuenta",
|
||||||
["4a) Threatening Gamemaster"] = "4a) Amenzar a un Gamemaster",
|
["4a) Threatening Gamemaster"] = "4a) Amenzar a un Gamemaster",
|
||||||
["4b) Pretending to Have Influence on Rule Enforcement"] = "4b) Pretender tener influencia en una parte del reglamento",
|
["4b) Pretending to Have Influence on Rule Enforcement"] = "4b) Pretender tener influencia en una parte del reglamento",
|
||||||
@@ -28,7 +30,7 @@ locale = {
|
|||||||
["Accept"] = "Aceptar",
|
["Accept"] = "Aceptar",
|
||||||
["Account name"] = "Nombre de cuenta",
|
["Account name"] = "Nombre de cuenta",
|
||||||
["Account Status:"] = "Estado de cuenta:",
|
["Account Status:"] = "Estado de cuenta:",
|
||||||
["Action:"] = "Accion:",
|
["Action:"] = "Acci<EFBFBD>n:",
|
||||||
["Add"] = "A<EFBFBD>adir",
|
["Add"] = "A<EFBFBD>adir",
|
||||||
["Add new VIP"] = "A<EFBFBD>adir nuevo VIP",
|
["Add new VIP"] = "A<EFBFBD>adir nuevo VIP",
|
||||||
["Addon 1"] = "Addon 1",
|
["Addon 1"] = "Addon 1",
|
||||||
@@ -36,46 +38,46 @@ locale = {
|
|||||||
["Addon 3"] = "Addon 1",
|
["Addon 3"] = "Addon 1",
|
||||||
["Add to VIP list"] = "A<EFBFBD>adir a lista VIP",
|
["Add to VIP list"] = "A<EFBFBD>adir a lista VIP",
|
||||||
["Adjust volume"] = "Ajustar volumen",
|
["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, que ha conocido a un triste destino. \nPero no se desespere, porque los dioses le llevar<61> de vuelta \na este mundo a cambio de un peque<75>o sacrificio \n\nSimply haga clic en Aceptar para continuar con sus viajes!",
|
["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!",
|
||||||
["All"] = "Todo",
|
["All"] = "Todo",
|
||||||
["All modules and scripts were reloaded."] = "Todos los m<>dulos y scripts se vuelven a cargar.",
|
["All modules and scripts were reloaded."] = "Todos los m<>dulos y scripts se vuelven a cargar.",
|
||||||
["Allow auto chase override"] = "Permitur auto persecuci<63>n override",
|
["Allow auto chase override"] = "Permitur auto persecuci<63>n override",
|
||||||
["Also known as dash in tibia community, recommended\nfor playing characters with high speed"] = "Conocido por la comunidad de tibia como dash.\nRecomenada para players de alto nivel.",
|
["Also known as dash in tibia community, recommended\nfor playing characters with high speed"] = "Conocido por la comunidad de tibia como dash.\nRecomenada para jugadores de alto nivel.",
|
||||||
["Ambient light: %s%%"] = "Ambiente de luz: %s%%",
|
["Ambient light: %s%%"] = "Ambiente de luz: %s%%",
|
||||||
["Amount:"] = "Cantidad:",
|
["Amount:"] = "Cantidad:",
|
||||||
["Amount"] = "Cantidad",
|
["Amount"] = "Cantidad",
|
||||||
["Anonymous"] = "An<EFBFBD>nimo",
|
["Anonymous"] = "An<EFBFBD>nimo",
|
||||||
["Are you sure you want to logout?"] = "<EFBFBD>Estas seguro de que quieres salir?",
|
["Are you sure you want to logout?"] = "<EFBFBD>Estas seguro de que deseas salir?",
|
||||||
["Attack"] = "Atacar",
|
["Attack"] = "Atacar",
|
||||||
["Author"] = "Autor",
|
["Author"] = "Autor",
|
||||||
["Autoload"] = "Auto carga",
|
["Autoload"] = "Auto carga",
|
||||||
["Autoload priority"] = "Auto carga prioritaria",
|
["Autoload priority"] = "Auto carga prioritaria",
|
||||||
["Auto login"] = "Auto iniciar",
|
["Auto login"] = "Auto ingresar",
|
||||||
["Auto login selected character on next charlist load"] = "Auto cargar car<61>cter seleccionado en la carga charlist siguiente",
|
["Auto login selected character on next charlist load"] = "Ingresar la siguiente vez que aparece el charlist con el personaje seleccionado",
|
||||||
["Axe Fighting"] = "Combate con acha",
|
["Axe Fighting"] = "Combate con hacha",
|
||||||
["Balance:"] = "Saldo:",
|
["Balance:"] = "Saldo:",
|
||||||
["Banishment"] = "Banishment",
|
["Banishment"] = "Banishment",
|
||||||
["Banishment + Final Warning"] = "Banishment + Final Warning",
|
["Banishment + Final Warning"] = "Banishment + Final Warning",
|
||||||
["Battle"] = "Batalla",
|
["Battle"] = "Batalla",
|
||||||
["Browse"] = "Navegar",
|
["Browse"] = "Navegar",
|
||||||
["Bug report sent."] = "Reporte de error enviado.",
|
["Bug report sent."] = "Reporte de error enviado.",
|
||||||
["Button Assign"] = "Boton asignado",
|
["Button Assign"] = "Bot<EFBFBD>n asignado",
|
||||||
["Buy"] = "Compra",
|
["Buy"] = "Compra",
|
||||||
["Buy Now"] = "Compra ahora",
|
["Buy Now"] = "Compra ahora",
|
||||||
["Buy Offers"] = "Comprar oferta",
|
["Buy Offers"] = "Comprar oferta",
|
||||||
["Buy with backpack"] = "Comprar con backpack",
|
["Buy with backpack"] = "Comprar con mochila",
|
||||||
["Cancel"] = "Cancelar",
|
["Cancel"] = "Cancelar",
|
||||||
["Cannot login while already in game."] = "No se puede iniciar sesi<73>n, mientras que estes en el juego.",
|
["Cannot login while already in game."] = "No se puede iniciar sesi<73>n, mientras que est<EFBFBD>s en el juego.",
|
||||||
["Cap"] = "Cap",
|
["Cap"] = "Cap",
|
||||||
["Capacity"] = "Capacidad",
|
["Capacity"] = "Capacidad",
|
||||||
["Center"] = "Centrar",
|
["Center"] = "Centrar",
|
||||||
["Channels"] = "Canales",
|
["Channels"] = "Canales",
|
||||||
["Character List"] = "Lista de car<61>cter",
|
["Character List"] = "Lista de car<61>cter",
|
||||||
["Classic control"] = "Control Clasico",
|
["Classic control"] = "Controles Cl<EFBFBD>sicos",
|
||||||
["Clear current message window"] = "Limpiar mensaje actual en ventana",
|
["Clear current message window"] = "Limpiar mensaje actual en ventana",
|
||||||
["Clear Messages"] = "Limpiar mensaje",
|
["Clear Messages"] = "Limpiar mensaje",
|
||||||
["Clear object"] = "Limpiar objeto",
|
["Clear object"] = "Limpiar objeto",
|
||||||
["Client needs update."] = "El cliente necesita actualizacion.",
|
["Client needs update."] = "El cliente necesita una actualizaci<EFBFBD>n.",
|
||||||
["Close"] = "Cerrar",
|
["Close"] = "Cerrar",
|
||||||
["Close this channel"] = "Cerrar este canal",
|
["Close this channel"] = "Cerrar este canal",
|
||||||
["Club Fighting"] = "Combate con mazo",
|
["Club Fighting"] = "Combate con mazo",
|
||||||
@@ -99,28 +101,28 @@ locale = {
|
|||||||
["Delete mark"] = "Borrar Marca",
|
["Delete mark"] = "Borrar Marca",
|
||||||
["Description:"] = "Descripci<EFBFBD>n:",
|
["Description:"] = "Descripci<EFBFBD>n:",
|
||||||
["Description"] = "Descripci<EFBFBD>n",
|
["Description"] = "Descripci<EFBFBD>n",
|
||||||
["Destructive Behaviour"] = "Comportamiento agresivo",
|
["Destructive Behaviour"] = "Comportamiento destructivo",
|
||||||
["Detail"] = "Detalle",
|
["Detail"] = "Detalle",
|
||||||
["Details"] = "Detalles",
|
["Details"] = "Detalles",
|
||||||
["Disable Shared Experience"] = "Desactivar experiencia compartida",
|
["Disable Shared Experience"] = "Desactivar experiencia compartida",
|
||||||
["Dismount"] = "Desmontar",
|
["Dismount"] = "Desmontar",
|
||||||
["Display connection speed to the server (milliseconds)"] = "Mostrar velocidad de conexion en el servidor (millisegundos)",
|
["Display connection speed to the server (milliseconds)"] = "Mostrar velocidad de conexi<EFBFBD>n en el servidor (millisegundos)",
|
||||||
["Distance Fighting"] = "Combate a distancia",
|
["Distance Fighting"] = "Combate a distancia",
|
||||||
["Don\'t stretch/shrink Game Window"] = "No estirar ni reducir el tama<6D>o de ventana",
|
["Don\'t stretch/shrink Game Window"] = "No estirar ni reducir el tama<6D>o de ventana",
|
||||||
["Edit hotkey text:"] = "Editar texto de hotkey:",
|
["Edit hotkey text:"] = "Editar texto de hotkey:",
|
||||||
["Edit List"] = "Editar lista",
|
["Edit List"] = "Editar lista",
|
||||||
["Edit Text"] = "Editar texto",
|
["Edit Text"] = "Editar texto",
|
||||||
["Enable music"] = "Habilitar musica",
|
["Enable music"] = "Habilitar m<EFBFBD>sica",
|
||||||
["Enable Shared Experience"] = "Habilitar experiencia compartida",
|
["Enable Shared Experience"] = "Habilitar experiencia compartida",
|
||||||
["Enable smart walking"] = "Habilitar caminado inteligente",
|
["Enable smart walking"] = "Habilitar caminado inteligente",
|
||||||
["Enable vertical synchronization"] = "Habilitar sincronizaci<63>n vertical",
|
["Enable vertical synchronization"] = "Habilitar sincronizaci<63>n vertical",
|
||||||
["Enable walk booster"] = "Habilitar caminado turbo",
|
["Enable walk booster"] = "Habilitar caminado turbo",
|
||||||
["Enter Game"] = "Entrar al juego",
|
["Enter Game"] = "Entrar al juego",
|
||||||
["Enter one name per line."] = "Introducir un nombre por linea.",
|
["Enter one name per line."] = "Introducir un nombre por linea.",
|
||||||
["Enter with your account again to update your client."] = "",
|
["Enter with your account again to update your client."] = "Ingrese con su cuenta nuevamente para actualizar el cliente.",
|
||||||
["Error"] = "Error",
|
["Error"] = "Error",
|
||||||
["Error"] = "Error",
|
["Error"] = "Error",
|
||||||
["Excessive Unjustified Player Killing"] = "Asesinato excesivo injustivicado de players",
|
["Excessive Unjustified Player Killing"] = "Asesinato excesivo injustificado de jugadores",
|
||||||
["Exclude from private chat"] = "Ejecutar desde un canal privado",
|
["Exclude from private chat"] = "Ejecutar desde un canal privado",
|
||||||
["Exit"] = "Salir",
|
["Exit"] = "Salir",
|
||||||
["Experience"] = "Experiencia",
|
["Experience"] = "Experiencia",
|
||||||
@@ -132,71 +134,71 @@ locale = {
|
|||||||
["Follow"] = "Seguir",
|
["Follow"] = "Seguir",
|
||||||
["Force Exit"] = "Forzar salida",
|
["Force Exit"] = "Forzar salida",
|
||||||
["For Your Information"] = "Para tu informaci<63>n",
|
["For Your Information"] = "Para tu informaci<63>n",
|
||||||
["Free Account"] = "Account gratis",
|
["Free Account"] = "Cuenta gratis",
|
||||||
["Fullscreen"] = "Pantalla completa",
|
["Fullscreen"] = "Pantalla completa",
|
||||||
["Game"] = "Juego",
|
["Game"] = "Juego",
|
||||||
["Game framerate limit: %s"] = "Imagenes por segundo en juego: %s",
|
["Game framerate limit: %s"] = "Limite de cuadros por segundo en el juego: %s",
|
||||||
["Graphics"] = "Gr<EFBFBD>ficos",
|
["Graphics"] = "Gr<EFBFBD>ficos",
|
||||||
["Graphics card driver not detected"] = "Controlador de tarjeta gr<67>fica de video no detectado",
|
["Graphics card driver not detected"] = "Controlador de tarjeta gr<67>fica de video no detectado",
|
||||||
["Graphics Engine:"] = "Motor Grafico:",
|
["Graphics Engine:"] = "Motor Gr<EFBFBD>fico:",
|
||||||
["Head"] = "Cabeza",
|
["Head"] = "Cabeza",
|
||||||
["Healing"] = "Curacion",
|
["Healing"] = "Curaci<EFBFBD>n",
|
||||||
["Health Info"] = "HP Info",
|
["Health Info"] = "HP Info",--This can be better
|
||||||
["Health Information"] = "HP Informaci<63>n",
|
["Health Information"] = "HP Informaci<63>n",--This can be better
|
||||||
["Hide monsters"] = "Ocultar monsters",
|
["Hide monsters"] = "Ocultar monstruos",
|
||||||
["Hide non-skull players"] = "Ocultar no-skull players",
|
["Hide non-skull players"] = "Ocultar jugadores sin skull",
|
||||||
["Hide Npcs"] = "Ocultar NPCs",
|
["Hide Npcs"] = "Ocultar NPCs",
|
||||||
["Hide Offline"] = "Ocultar fuera de linea",
|
["Hide Offline"] = "Ocultar fuera de linea",
|
||||||
["Hide party members"] = "Ocultar miembros de party",
|
["Hide party members"] = "Ocultar miembros del party",
|
||||||
["Hide players"] = "Ocultar players",
|
["Hide players"] = "Ocultar players",
|
||||||
["Hide spells for higher exp. levels"] = "Ocultar spells para niveles mas altos que tu experiencia.",
|
["Hide spells for higher exp. levels"] = "Ocultar hechizos para niveles mas altos que tu experiencia.",
|
||||||
["Hide spells for other vocations"] = "Ocultar spells que sean para otra vocaci<63>n",
|
["Hide spells for other vocations"] = "Ocultar hechizos que sean para otra vocaci<63>n",
|
||||||
["Hit Points"] = "Puntos de vida",
|
["Hit Points"] = "Puntos de vida",
|
||||||
["Hold left mouse button to navigate\nScroll mouse middle button to zoom\nRight mouse button to create map marks"] = "Mantenga pulsado el bot<6F>n derecho del rat<61>n para navegar\nScroll bot<6F>n central del rat<61>n para ampliar\nbot<EFBFBD>n derecho del mouse para crear marcas del mapa",
|
["Hold left mouse button to navigate\nScroll mouse middle button to zoom\nRight mouse button to create map marks"] = "Mantenga presionado el bot<6F>n derecho del rat<61>n para navegar\nDezplaze la rueda central del rat<61>n para ampliar\nbot<EFBFBD>n derecho del mouse para crear marcas del mapa",
|
||||||
["Hotkeys"] = "Hotkeys",
|
["Hotkeys"] = "Hotkeys",
|
||||||
["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.\nClick en 'Salir' si desea salir del programa sin tener que salir de tu personaje.",
|
["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.",
|
||||||
["Ignore"] = "Ignorar",
|
["Ignore"] = "Ignorar",
|
||||||
["Ignore capacity"] = "Ignorar Capacidad",
|
["Ignore capacity"] = "Ignorar Capacidad",
|
||||||
["Ignored players:"] = "Players ignorados:",
|
["Ignored players:"] = "Jugadores ignorados:",
|
||||||
["Ignore equipped"] = "Ignorar lo equipodo",
|
["Ignore equipped"] = "Ignorar lo equipado",
|
||||||
["Ignore List"] = "Ignorar lista",
|
["Ignore List"] = "Ignorar lista",
|
||||||
["Ignore players"] = "Ignorar players",
|
["Ignore players"] = "Ignorar jugadores",
|
||||||
["Ignore Private Messages"] = "Ignorar mensajes privados",
|
["Ignore Private Messages"] = "Ignorar mensajes privados",
|
||||||
["Ignore Yelling"] = "Ignorar gritos",
|
["Ignore Yelling"] = "Ignorar gritos",
|
||||||
["Interface framerate limit: %s"] = "Interface de imagenes por segundo: %s",
|
["Interface framerate limit: %s"] = "Interface de cuadros por segundo: %s",
|
||||||
["Inventory"] = "Inventario",
|
["Inventory"] = "Inventario",
|
||||||
["Invite to Party"] = "Ivitar a party",
|
["Invite to Party"] = "Ivitar al party",
|
||||||
["Invite to private chat"] = "Invitar a canal privado",
|
["Invite to private chat"] = "Invitar a canal privado",
|
||||||
["IP Address Banishment"] = "Banishment - Direccion IP",
|
["IP Address Banishment"] = "Banishment - Direcci<EFBFBD>n IP",
|
||||||
["Item Offers"] = "Ofertas de objetos",
|
["Item Offers"] = "Ofertas de objetos",
|
||||||
["It is empty."] = "Est<EFBFBD> vasio.",
|
["It is empty."] = "Est<EFBFBD> vaci<EFBFBD>.",
|
||||||
["Join %s\'s Party"] = "Unir %s\'s party",
|
["Join %s\'s Party"] = "Unirse al party de %s ",
|
||||||
["Leave Party"] = "Dejar party",
|
["Leave Party"] = "Dejar el party",
|
||||||
["Level"] = "Nivel",
|
["Level"] = "Nivel",
|
||||||
["Lifetime Premium Account"] = "Tiempo de Premium Account",
|
["Lifetime Premium Account"] = "Tiempo de Premium Account infinito",
|
||||||
["Limits FPS to 60"] = "Limites FPS a 60",
|
["Limits FPS to 60"] = "Limites FPS a 60",
|
||||||
["List of items that you're able to buy"] = "Lista de objetos que puedes de comprar",
|
["List of items that you're able to buy"] = "Lista de objetos que puedes de comprar",
|
||||||
["List of items that you're able to sell"] = "Lista de objetos que puedes de vender",
|
["List of items that you're able to sell"] = "Lista de objetos que puedes de vender",
|
||||||
["Load"] = "Cargar",
|
["Load"] = "Cargar",
|
||||||
["Logging out..."] = "Cerrando sesion...",
|
["Logging out..."] = "Cerrando sesi<EFBFBD>n...",
|
||||||
["Login"] = "Ingresar",
|
["Login"] = "Ingresar",
|
||||||
["Login Error"] = "Error de ingreso",
|
["Login Error"] = "Error de ingreso",
|
||||||
["Login Error"] = "Error de ingreso",
|
["Login Error"] = "Error de ingreso",
|
||||||
["Logout"] = "Salir",
|
["Logout"] = "Salir",
|
||||||
["Look"] = "Mirar",
|
["Look"] = "Mirar",
|
||||||
["Magic Level"] = "Nivel m<>gico",
|
["Magic Level"] = "Nivel m<>gico",
|
||||||
["Make sure that your client uses\nthe correct game protocol version"] = "Aseg<EFBFBD>rese de que el cliente utiliza\nes el correcto de versi<EFBFBD>n del protocolo",
|
["Make sure that your client uses\nthe correct game protocol version"] = "Aseg<EFBFBD>rese de que el cliente este utilizando\nes el versi<73>n del protocolo adecuado",
|
||||||
["Mana"] = "Mana",
|
["Mana"] = "Mana",
|
||||||
["Manage hotkeys:"] = "Administrador de hotkeys:",
|
["Manage hotkeys:"] = "Administrador de hotkeys:",
|
||||||
["Market"] = "Mercado",
|
["Market"] = "Mercado",
|
||||||
["Market Offers"] = "Ofertas en mercado",
|
["Market Offers"] = "Ofertas en mercado",
|
||||||
["Message of the day"] = "Mensaje del dia",
|
["Message of the day"] = "Mensaje del d<EFBFBD>a",
|
||||||
["Message to "] = "Mensaje a",
|
["Message to "] = "Mensaje a",
|
||||||
["Message to %s"] = "Mensaje a %s",
|
["Message to %s"] = "Mensaje a %s",
|
||||||
["Minimap"] = "Minimapa",
|
["Minimap"] = "Minimapa",
|
||||||
["Module Manager"] = "Administrador de modulos",
|
["Module Manager"] = "Administrador de m<EFBFBD>dulos",
|
||||||
["Module name"] = "Nombre de modulo",
|
["Module name"] = "Nombre del modulo",
|
||||||
["Mount"] = "Montura",
|
["Mount"] = "Montar", --Unique name?
|
||||||
["Move Stackable Item"] = "Mover objeto apilable",
|
["Move Stackable Item"] = "Mover objeto apilable",
|
||||||
["Move up"] = "Mover arriba",
|
["Move up"] = "Mover arriba",
|
||||||
["My Offers"] = "Mis ofertas",
|
["My Offers"] = "Mis ofertas",
|
||||||
@@ -205,7 +207,7 @@ locale = {
|
|||||||
["Name Report + Banishment"] = "Name Report + Banishment",
|
["Name Report + Banishment"] = "Name Report + Banishment",
|
||||||
["Name Report + Banishment + Final Warning"] = "Name Report + Banishment + Final Warning",
|
["Name Report + Banishment + Final Warning"] = "Name Report + Banishment + Final Warning",
|
||||||
["No"] = "No",
|
["No"] = "No",
|
||||||
["No graphics card detected, everything will be drawn using the CPU,\nthus the performance will be really bad.\nPlease update your graphics driver to have a better performance."] = "No graphics card detected, everything will be drawn using the CPU,\npor lo tanto el rendimiento va a ser muy malo.\nPor favor, actualice su controlador de gr<67>ficos para tener un mejor rendimiento.",
|
["No graphics card detected, everything will be drawn using the CPU,\nthus the performance will be really bad.\nPlease update your graphics driver to have a better performance."] = "No se ha detectado una tarjeta gr<67>fica y todo sera procesado por tu procesador,\npor lo tanto el rendimiento va a ser muy malo.\nPor favor, actualice su controlador de gr<67>ficos para tener un rendimiento optimo.",
|
||||||
["No item selected."] = "No hay elemento seleccionado.",
|
["No item selected."] = "No hay elemento seleccionado.",
|
||||||
["No Mount"] = "No montura",
|
["No Mount"] = "No montura",
|
||||||
["No Outfit"] = "No outfit",
|
["No Outfit"] = "No outfit",
|
||||||
@@ -220,30 +222,30 @@ locale = {
|
|||||||
["on %s.\n"] = "en %s.\n",
|
["on %s.\n"] = "en %s.\n",
|
||||||
["Open"] = "Abierto",
|
["Open"] = "Abierto",
|
||||||
["Open a private message channel:"] = "Abrir mensaje en canal privado:",
|
["Open a private message channel:"] = "Abrir mensaje en canal privado:",
|
||||||
["Open charlist automatically when starting client"] = "Abrir lista de players automaticamente al iniciar el cliente",
|
["Open charlist automatically when starting client"] = "Abrir lista de jugadores autom<EFBFBD>ticamente al iniciar el cliente",
|
||||||
["Open in new window"] = "Abrir en nueva ventana",
|
["Open in new window"] = "Abrir en nueva ventana",
|
||||||
["Open new channel"] = "Abrir nuevo canal",
|
["Open new channel"] = "Abrir nuevo canal",
|
||||||
["Options"] = "Opciones",
|
["Options"] = "Opciones",
|
||||||
["Overview"] = "Descripcion",
|
["Overview"] = "Descripci<EFBFBD>n",
|
||||||
["Pass Leadership to %s"] = "Pasar liderazgo a %s",
|
["Pass Leadership to %s"] = "Pasar liderazgo a %s",
|
||||||
["Password"] = "Contrase<EFBFBD>a",
|
["Password"] = "Contrase<EFBFBD>a",
|
||||||
["Piece Price:"] = "Precio por pieza:",
|
["Piece Price:"] = "Precio por pieza:",
|
||||||
["Please enter a character name:"] = "Por favor ingresar nombre del player:",
|
["Please enter a character name:"] = "Por favor ingresar nombre del jugador:",
|
||||||
["Please, press the key you wish to add onto your hotkeys manager"] = "Por favor, presiona la tecla que desees para que sea registrada en\nel administrador de hotkeys",
|
["Please, press the key you wish to add onto your hotkeys manager"] = "Por favor, presiona la tecla que desees para que sea registrada en\nel administrador de hotkeys",
|
||||||
["Please Select"] = "Por favor selecciona",
|
["Please Select"] = "Por favor seleccione",
|
||||||
["Please use this dialog to only report bugs. Do not report rule violations here!"] = "Por favor usa estos dialogos solo para reportar errores.\n<EFBFBD>No reportar violaciones al reglamento aqu<71>!",
|
["Please use this dialog to only report bugs. Do not report rule violations here!"] = "Por favor usa este di<EFBFBD>logo solo para reportar errores.\n<EFBFBD>No reportar violaciones del reglamento aqu<71>!",
|
||||||
["Please wait"] = "Por favor espera",
|
["Please wait"] = "Por favor espere",
|
||||||
["Port"] = "Puerto",
|
["Port"] = "Puerto",
|
||||||
["Position:"] = "Posici<EFBFBD>n:",
|
["Position:"] = "Posici<EFBFBD>n:",
|
||||||
["Position: %i %i %i"] = "Posici<EFBFBD>n: %i %i %i",
|
["Position: %i %i %i"] = "Posici<EFBFBD>n: %i %i %i",
|
||||||
["Premium Account (%s) days left"] = "Premium Accoun restan dias (%s)",
|
["Premium Account (%s) days left"] = "Tienes (%s) d<>as de Premium Account restantes",
|
||||||
["Price:"] = "Precio:",
|
["Price:"] = "Precio:",
|
||||||
["Primary"] = "Primario",
|
["Primary"] = "Primario",
|
||||||
["Protocol"] = "Protocolo",
|
["Protocol"] = "Protocolo",
|
||||||
["Quest Log"] = "Quest Log",
|
["Quest Log"] = "Quest Log", --Unique name
|
||||||
["Randomize"] = "Combinar",
|
["Randomize"] = "Combinar",
|
||||||
["Randomize characters outfit"] = "Combinar oufit del jugador",
|
["Randomize characters outfit"] = "Combinar vestimenta del jugador",
|
||||||
["Reason:"] = "Reason:",
|
["Reason:"] = "Raz<EFBFBD>n:",
|
||||||
["Refresh"] = "Refrescar",
|
["Refresh"] = "Refrescar",
|
||||||
["Refresh Offers"] = "Refrescar ofertas",
|
["Refresh Offers"] = "Refrescar ofertas",
|
||||||
["Regeneration Time"] = "Tiempo de regeneraci<63>n",
|
["Regeneration Time"] = "Tiempo de regeneraci<63>n",
|
||||||
@@ -254,13 +256,13 @@ locale = {
|
|||||||
["Remove"] = "Remover",
|
["Remove"] = "Remover",
|
||||||
["Remove %s"] = "Remover %s",
|
["Remove %s"] = "Remover %s",
|
||||||
["Report Bug"] = "Reportar error",
|
["Report Bug"] = "Reportar error",
|
||||||
["Reserved for more functionality later."] = "eservado para una funcion futura.",
|
["Reserved for more functionality later."] = "Reservado para una funci<EFBFBD>n futura.",
|
||||||
["Reset Market"] = "Reiniciar mercado",
|
["Reset Market"] = "Reiniciar mercado",
|
||||||
["Revoke %s\'s Invitation"] = "Anular %s\'s invitaci<63>n",
|
["Revoke %s\'s Invitation"] = "Anular %s\'s invitaci<63>n",
|
||||||
["Rotate"] = "Rotar",
|
["Rotate"] = "Rotar",
|
||||||
["Rule Violation"] = "Violacion de regla",
|
["Rule Violation"] = "Violaci<EFBFBD>n del reglamento",
|
||||||
["Save"] = "Salvar",
|
["Save"] = "Guardar",
|
||||||
["Save Messages"] = "Salvar mensaje",
|
["Save Messages"] = "Guardar mensaje",
|
||||||
["Search:"] = "Buscar:",
|
["Search:"] = "Buscar:",
|
||||||
["Search all items"] = "Buscar todos los objetos",
|
["Search all items"] = "Buscar todos los objetos",
|
||||||
["Secondary"] = "Secundario",
|
["Secondary"] = "Secundario",
|
||||||
@@ -268,24 +270,24 @@ locale = {
|
|||||||
["Select Outfit"] = "Seleccionar outfit",
|
["Select Outfit"] = "Seleccionar outfit",
|
||||||
["Select your language"] = "Selectionar tu lenguaje",
|
["Select your language"] = "Selectionar tu lenguaje",
|
||||||
["Sell"] = "Vender",
|
["Sell"] = "Vender",
|
||||||
["Sell Now"] = "Vender ya",
|
["Sell Now"] = "Vender ahora",
|
||||||
["Sell Offers"] = "Ofertas de venta",
|
["Sell Offers"] = "Ofertas de venta",
|
||||||
["Send"] = "Enviar",
|
["Send"] = "Enviar",
|
||||||
["Send automatically"] = "Enviar automaticamente",
|
["Send automatically"] = "Enviar autom<EFBFBD>ticamente",
|
||||||
["Send Message"] = "Enviar mensaje",
|
["Send Message"] = "Enviar mensaje",
|
||||||
["Server"] = "Server",
|
["Server"] = "Server", --Unique name
|
||||||
["Server Log"] = "Server Log",
|
["Server Log"] = "Server Log", --Unique name
|
||||||
["Set Outfit"] = "Fijar outfit",
|
["Set Outfit"] = "Escoger vestimenta",
|
||||||
["Shielding"] = "Escudo",
|
["Shielding"] = "Escudo",
|
||||||
["Show all items"] = "Mostrar todos los objetos",
|
["Show all items"] = "Mostrar todos los objetos",
|
||||||
["Show connection ping"] = "Mostrar ping de conexi<78>n",
|
["Show connection ping"] = "Mostrar ping de conexi<78>n",
|
||||||
["Show Depot Only"] = "Mostrar solo el Depot",
|
["Show Depot Only"] = "Mostrar solo el Depot",
|
||||||
["Show event messages in console"] = "Mostrar mensajes de evento en consola",
|
["Show event messages in console"] = "Mostrar mensajes de evento en consola",
|
||||||
["Show frame rate"] = "Mostrar velocidad por cuadro",
|
["Show frame rate"] = "Mostrar informaci<EFBFBD>n de cuadros por secundo",
|
||||||
["Show info messages in console"] = "Mostrar mensajes de informaci<63>n en consola",
|
["Show info messages in console"] = "Mostrar mensajes de informaci<63>n en consola",
|
||||||
["Show left panel"] = "Mostrar panel izquierdo",
|
["Show left panel"] = "Mostrar panel izquierdo",
|
||||||
["Show levels in console"] = "Mostrar niveles en consola",
|
["Show levels in console"] = "Mostrar niveles en consola",
|
||||||
["Show Offline"] = "Mostrar offLine",
|
["Show Offline"] = "Mostrar Desconectados",
|
||||||
["Show private messages in console"] = "Mostrar mensajes privados en consola",
|
["Show private messages in console"] = "Mostrar mensajes privados en consola",
|
||||||
["Show private messages on screen"] = "Mostrar mensajes privados en pantalla",
|
["Show private messages on screen"] = "Mostrar mensajes privados en pantalla",
|
||||||
["Show Server Messages"] = "Mostrar mensajes del servidor",
|
["Show Server Messages"] = "Mostrar mensajes del servidor",
|
||||||
@@ -295,26 +297,26 @@ locale = {
|
|||||||
["Show your depot items only"] = "Mostrar solo tus objetos en depot",
|
["Show your depot items only"] = "Mostrar solo tus objetos en depot",
|
||||||
["Skills"] = "Habilidades",
|
["Skills"] = "Habilidades",
|
||||||
["Soul"] = "Soul",
|
["Soul"] = "Soul",
|
||||||
["Soul Points"] = "Puntos de Soul",
|
["Soul Points"] = "Puntos de Soul", --I'm leaving these as is because its a unique name, if you want to change it it can be "Alma" or "Esp<73>ritu"
|
||||||
["Special"] = "Especial",
|
["Special"] = "Especial",
|
||||||
["Speed"] = "Velocidad",
|
["Speed"] = "Velocidad",
|
||||||
["Spell Cooldowns"] = "Spells Cooldowns",
|
["Spell Cooldowns"] = "Spells Cooldowns", --Could be "Tiempo de recarga para los hechizos".
|
||||||
["Spell List"] = "Lista de spells",
|
["Spell List"] = "Lista de hechizos",
|
||||||
["Stamina"] = "Stamina",
|
["Stamina"] = "Resistencia",
|
||||||
["Statement:"] = "Comentario:",
|
["Statement:"] = "Comentario:",
|
||||||
["Statement Report"] = "Statement Report",
|
["Statement Report"] = "Statement Report", --Could be "reporte del comentario"
|
||||||
["Statistics"] = "Estadisticas",
|
["Statistics"] = "Estad<EFBFBD>sticas",
|
||||||
["Stop Attack"] = "Detener ataque",
|
["Stop Attack"] = "Detener ataque",
|
||||||
["Stop Follow"] = "Detener persecucion",
|
["Stop Follow"] = "Detener persecuci<EFBFBD>n",
|
||||||
["Support"] = "Soporte",
|
["Support"] = "Soporte",
|
||||||
["%s: (use object)"] = "%s: (usar objeto)",
|
["%s: (use object)"] = "%s: (usar objeto)",
|
||||||
["%s: (use object on target)"] = "%s: (usar objeto en un objetivo)",
|
["%s: (use object on target)"] = "%s: (usar objeto en un objetivo)",
|
||||||
["%s: (use object on yourself)"] = "%s: (usar objeto en mi mismo)",
|
["%s: (use object on yourself)"] = "%s: (usar objeto en mi mismo)",
|
||||||
["%s: (use object with crosshair)"] = "%s: (usar objeto en aire)",
|
["%s: (use object with crosshair)"] = "%s: (usar objeto con punto de mira)",
|
||||||
["Sword Fighting"] = "Combate de espada",
|
["Sword Fighting"] = "Combate de espada",
|
||||||
["Terminal"] = "Terminal",
|
["Terminal"] = "Terminal",
|
||||||
["There is no way."] = "No hay ninguna manera.",
|
["There is no way."] = "No hay ninguna manera.",
|
||||||
["Title"] = "T<EFBFBD>tulo",
|
["Title"] = "Titulo",
|
||||||
["Total Price:"] = "Total total:",
|
["Total Price:"] = "Total total:",
|
||||||
["Trade"] = "Intercambio",
|
["Trade"] = "Intercambio",
|
||||||
["Trade with ..."] = "Intercambiar con ...",
|
["Trade with ..."] = "Intercambiar con ...",
|
||||||
@@ -322,51 +324,51 @@ locale = {
|
|||||||
["Unable to load dat file, please place a valid dat in '%s'"] = "No se puede cargar el archivo dat, por favor coloque un dat v<>lido en '%s'",
|
["Unable to load dat file, please place a valid dat in '%s'"] = "No se puede cargar el archivo dat, por favor coloque un dat v<>lido en '%s'",
|
||||||
["Unable to load spr file, please place a valid spr in '%s'"] = "No se puede cargar el archivo spr, por favor coloque un spr v<>lido en '%s'",
|
["Unable to load spr file, please place a valid spr in '%s'"] = "No se puede cargar el archivo spr, por favor coloque un spr v<>lido en '%s'",
|
||||||
["Unable to logout."] = "No se puede cerrar sesi<73>n-",
|
["Unable to logout."] = "No se puede cerrar sesi<73>n-",
|
||||||
["Unignore"] = "Desactivar ignorado",
|
["Unignore"] = "Dejar de ignorar",
|
||||||
["Unload"] = "No cargado",
|
["Unload"] = "No cargado",
|
||||||
["Update needed"] = "Es necesario actualizar",
|
["Update needed"] = "Es necesario actualizar",
|
||||||
["Use"] = "Uso",
|
["Use"] = "Uso",
|
||||||
["Use on target"] = "Usar en un objetivo",
|
["Use on target"] = "Usar en un objetivo",
|
||||||
["Use on yourself"] = "Usar en mi mismo",
|
["Use on yourself"] = "Usar en mi mismo",
|
||||||
["Use with ..."] = "Usar en ...",
|
["Use with ..."] = "Usar en ...",
|
||||||
["Version"] = "Version",
|
["Version"] = "Versi<EFBFBD>n",
|
||||||
["VIP List"] = "Lista Vip",
|
["VIP List"] = "Lista Vip",
|
||||||
["Voc."] = "Voc.",
|
["Voc."] = "Voc.",
|
||||||
["Vocation"] = "Vocaci<EFBFBD>n",
|
["Vocation"] = "Vocaci<EFBFBD>n",
|
||||||
["Waiting List"] = "Lista de espera",
|
["Waiting List"] = "Lista de espera",
|
||||||
["Website"] = "Sitio WEB",
|
["Website"] = "Sitio Web",
|
||||||
["Weight:"] = "Peso:",
|
["Weight:"] = "Peso:",
|
||||||
["Will detect when to use diagonal step based on the\nkeys you are pressing"] = "Detectar cuando se camina en diagonal usando las flechas",
|
["Will detect when to use diagonal step based on the\nkeys you are pressing"] = "Detectara cuando se camina en diagonal usando las flechas",
|
||||||
["With crosshair"] = "Con punto de mira",
|
["With crosshair"] = "Con punto de mira",
|
||||||
["Yes"] = "Si",
|
["Yes"] = "Si",
|
||||||
["You are bleeding"] = "Tu estas sangrado",
|
["You are bleeding"] = "Te estas desangrando",
|
||||||
["You are burning"] = "Tu estas quemado",
|
["You are burning"] = "Te estas quemando",
|
||||||
["You are cursed"] = "Tu estas maldecido",
|
["You are cursed"] = "Tu estas maldecido",
|
||||||
["You are dazzled"] = "Tu estas deslumbrado",
|
["You are dazzled"] = "Tu estas deslumbrado",
|
||||||
["You are dead."] = "Tu estas muerto.",
|
["You are dead."] = "Tu estas muerto.",
|
||||||
["You are dead"] = "Tu estas muerto",
|
["You are dead"] = "Tu estas muerto",
|
||||||
["You are drowning"] = "Tu estas ahotado",
|
["You are drowning"] = "Te estas ahogando",
|
||||||
["You are drunk"] = "Tu estas borracho",
|
["You are drunk"] = "Tu estas ebrio",
|
||||||
["You are electrified"] = "Tu estas electrificado",
|
["You are electrified"] = "Tu estas electrocutado",
|
||||||
["You are freezing"] = "Tu estas congelado",
|
["You are freezing"] = "Te estas congelando",
|
||||||
["You are hasted"] = "Tu estas rapido",
|
["You are hasted"] = "Tu estas r<EFBFBD>pido", --I dont know what is the best way to translate this so I'm leaving it as I found it.
|
||||||
["You are hungry"] = "Tu estas hambriento",
|
["You are hungry"] = "Tu estas hambriento",
|
||||||
["You are paralysed"] = "Tu estas paralizado",
|
["You are paralysed"] = "Tu estas paralizado",
|
||||||
["You are poisoned"] = "Tu estas envenedado",
|
["You are poisoned"] = "Tu estas envenedado",
|
||||||
["You are protected by a magic shield"] = "Tu estas protegido por un campo magico",
|
["You are protected by a magic shield"] = "Tu estas protegido por un escudo m<EFBFBD>gico",
|
||||||
["You are strengthened"] = "Tu estas reforzado",
|
["You are strengthened"] = "Tu estas reforzado",
|
||||||
["You are within a protection zone"] = "Tu estas dentro de una zona segura",
|
["You are within a protection zone"] = "Tu estas dentro de una zona de protecci<63>n",
|
||||||
["You can enter new text."] = "Tu puedes introducir un texto nuevo.",
|
["You can enter new text."] = "Tu puedes ingresar un texto nuevo.",
|
||||||
["You have %s percent"] = "Tu tienes %s porciento",
|
["You have %s percent"] = "Tu tienes %s por ciento",
|
||||||
["You have %s percent to go"] = "Tu tienes %s porciento para ir",
|
["You have %s percent to go"] = "Tu tienes %s por ciento para ir",
|
||||||
["You may not logout during a fight"] = "No puedes salir durante una pelea",
|
["You may not logout during a fight"] = "No puedes salir durante una pelea",
|
||||||
["You may not logout or enter a protection zone"] = "No puedes salir o entrar en una zona de protecci<63>n",
|
["You may not logout or enter a protection zone"] = "No puedes salir o entrar en una zona de protecci<63>n",
|
||||||
["You must enter a comment."] = "Debes introducir un comentario.",
|
["You must enter a comment."] = "Debes ingresar un comentario.",
|
||||||
["You must enter a valid server address and port."] = "Debes introducir una direcci<63>n v<>lida de servidor y el puerto.",
|
["You must enter a valid server address and port."] = "Debes ingresar una direcci<63>n v<>lida de servidor y el puerto.",
|
||||||
["You must select a character to login!"] = "<EFBFBD>Debes seleccionar un personaje para ingresar!",
|
["You must select a character to login!"] = "<EFBFBD>Debes seleccionar un personaje para ingresar!",
|
||||||
["Your Capacity:"] = "Tu capacidad:",
|
["Your Capacity:"] = "Tu capacidad:",
|
||||||
["You read the following, written by \n%s\n"] = "Uno lee lo siguiente, escrito por \n%s\n",
|
["You read the following, written by \n%s\n"] = "Lees lo siguiente, escrito por \n%s\n",
|
||||||
["You read the following, written on \n%s.\n"] = "Uno lee lo siguiente, escrito en \n%s\n",
|
["You read the following, written on \n%s.\n"] = "Lees lo siguiente, escrito en \n%s\n",
|
||||||
["Your Money:"] = "Tu dinero:",
|
["Your Money:"] = "Tu dinero:",
|
||||||
["Change language"] = "Cambiar idioma",
|
["Change language"] = "Cambiar idioma",
|
||||||
["Don't stretch or shrink Game Window"] = "No estirar o encoger Ventana de Juego"
|
["Don't stretch or shrink Game Window"] = "No estirar o encoger Ventana de Juego"
|
||||||
|
@@ -1,36 +1,31 @@
|
|||||||
-- by Don Daniello
|
|
||||||
-- 09 June 2012
|
|
||||||
-- http://DonDaniello.com
|
|
||||||
-- http://otland.net/members/Don+Daniello
|
|
||||||
|
|
||||||
locale = {
|
locale = {
|
||||||
name = "pl",
|
name = "pl",
|
||||||
languageName = "Polski",
|
languageName = "Polski",
|
||||||
|
|
||||||
translation = {
|
translation = {
|
||||||
["1a) Offensive Name"] = false,
|
["1a) Offensive Name"] = "1a) Obrazliwe Imie",
|
||||||
["1b) Invalid Name Format"] = false,
|
["1b) Invalid Name Format"] = "1b) Niepoprawny Format Imienia",
|
||||||
["1c) Unsuitable Name"] = false,
|
["1c) Unsuitable Name"] = "1c) Nieodpowiednie Imie",
|
||||||
["1d) Name Inciting Rule Violation"] = false,
|
["1d) Name Inciting Rule Violation"] = "1d) Imie Nawolujace Do Lamania Regulaminu",
|
||||||
["2a) Offensive Statement"] = false,
|
["2a) Offensive Statement"] = "2a) Obrazliwa wypowiedz",
|
||||||
["2b) Spamming"] = false,
|
["2b) Spamming"] = "2b) Spamowanie",
|
||||||
["2c) Illegal Advertising"] = false,
|
["2c) Illegal Advertising"] = "2c) Nielegalne Reklamy",
|
||||||
["2d) Off-Topic Public Statement"] = false,
|
["2d) Off-Topic Public Statement"] = "2d) Publiczne Wypowiadanie Sie Nie Na Temat",
|
||||||
["2e) Non-English Public Statement"] = false,
|
["2e) Non-English Public Statement"] = "2e) Publiczne wypowiadanie Sie W Jezyku Innym Niz Angielski",
|
||||||
["2f) Inciting Rule Violation"] = false,
|
["2f) Inciting Rule Violation"] = "2f) Nawolywanie Do Lamania Regulaminu ",
|
||||||
["3a) Bug Abuse"] = false,
|
["3a) Bug Abuse"] = "3a) Wykorzystywanie Bledow",
|
||||||
["3b) Game Weakness Abuse"] = false,
|
["3b) Game Weakness Abuse"] = "3b) Wykorzystanie Slabosci Gry",
|
||||||
["3c) Using Unofficial Software to Play"] = false,
|
["3c) Using Unofficial Software to Play"] = "3c) Gra Przy Uzyciu Nieoficjalnego Oprogramowania",
|
||||||
["3d) Hacking"] = false,
|
["3d) Hacking"] = "3d) Wlamywanie Sie",
|
||||||
["3e) Multi-Clienting"] = false,
|
["3e) Multi-Clienting"] = "3e) Uzycie Multi-Klienta",
|
||||||
["3f) Account Trading or Sharing"] = false,
|
["3f) Account Trading or Sharing"] = "3f) Handel Lub Udostepnianie Kont",
|
||||||
["4a) Threatening Gamemaster"] = false,
|
["4a) Threatening Gamemaster"] = "4a) Grozby Pod Adresem Mistrza Gry",
|
||||||
["4b) Pretending to Have Influence on Rule Enforcement"] = false,
|
["4b) Pretending to Have Influence on Rule Enforcement"] = "4b) Udawanie Wplywu na Ustanawianie Regul Gry",
|
||||||
["4c) False Report to Gamemaster"] = false,
|
["4c) False Report to Gamemaster"] = "4c) Wyslanie Falszywego Raportu Mistrzowi Gry",
|
||||||
["Accept"] = false,
|
["Accept"] = "Akceptuj",
|
||||||
["Account name"] = "Numer konta",
|
["Account name"] = "Numer konta",
|
||||||
["Account Status:"] = false,
|
["Account Status:"] = "Status Konta:",
|
||||||
["Action:"] = false,
|
["Action:"] = "Akcja:",
|
||||||
["Add"] = "Dodaj",
|
["Add"] = "Dodaj",
|
||||||
["Add new VIP"] = "Nowy VIP",
|
["Add new VIP"] = "Nowy VIP",
|
||||||
["Addon 1"] = "Addon 1",
|
["Addon 1"] = "Addon 1",
|
||||||
@@ -39,15 +34,15 @@ locale = {
|
|||||||
["Add to VIP list"] = "Dodaj do VIPow",
|
["Add to VIP list"] = "Dodaj do VIPow",
|
||||||
["Adjust volume"] = "Zmien glosnosc",
|
["Adjust volume"] = "Zmien glosnosc",
|
||||||
["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!"] = false,
|
["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!"] = false,
|
||||||
["All"] = false,
|
["All"] = "Wszystkie",
|
||||||
["All modules and scripts were reloaded."] = "Wszystkie moduly ",
|
["All modules and scripts were reloaded."] = "Wszystkie moduly ",
|
||||||
["Allow auto chase override"] = false,
|
["Allow auto chase override"] = false,
|
||||||
["Also known as dash in tibia community, recommended\nfor playing characters with high speed"] = false,
|
["Also known as dash in tibia community, recommended\nfor playing characters with high speed"] = false,
|
||||||
["Ambient light: %s%%"] = false,
|
["Ambient light: %s%%"] = "Swiatlo tla: %s%%",
|
||||||
["Amount:"] = "Ilosc:",
|
["Amount:"] = "Ilosc:",
|
||||||
["Amount"] = false,
|
["Amount"] = "Ilosc",
|
||||||
["Anonymous"] = false,
|
["Anonymous"] = "Anonimowy",
|
||||||
["Are you sure you want to logout?"] = false,
|
["Are you sure you want to logout?"] = "Czy jestes pewien, ze sie chcesz wylogowac?",
|
||||||
["Attack"] = "Atak",
|
["Attack"] = "Atak",
|
||||||
["Author"] = "Autor",
|
["Author"] = "Autor",
|
||||||
["Autoload"] = "Autoladowanie",
|
["Autoload"] = "Autoladowanie",
|
||||||
@@ -59,17 +54,17 @@ locale = {
|
|||||||
["Banishment"] = false,
|
["Banishment"] = false,
|
||||||
["Banishment + Final Warning"] = false,
|
["Banishment + Final Warning"] = false,
|
||||||
["Battle"] = "Bitwa",
|
["Battle"] = "Bitwa",
|
||||||
["Browse"] = false,
|
["Browse"] = "Przegladaj",
|
||||||
["Bug report sent."] = false,
|
["Bug report sent."] = "Raport o bledzie zostal wyslany.",
|
||||||
["Button Assign"] = "Przypisanie Klawisza",
|
["Button Assign"] = "Przypisanie Klawisza",
|
||||||
["Buy"] = "Kup",
|
["Buy"] = "Kup",
|
||||||
["Buy Now"] = false,
|
["Buy Now"] = "Kup Teraz",
|
||||||
["Buy Offers"] = false,
|
["Buy Offers"] = "Oferty Kupna",
|
||||||
["Buy with backpack"] = "Kupuj z plecakami",
|
["Buy with backpack"] = "Kupuj z plecakami",
|
||||||
["Cancel"] = "Anuluj",
|
["Cancel"] = "Anuluj",
|
||||||
["Cannot login while already in game."] = false,
|
["Cannot login while already in game."] = "Nie mozna zalogowac gdy juz w grze",
|
||||||
["Cap"] = false,
|
["Cap"] = false,
|
||||||
["Capacity"] = "Capacidad",
|
["Capacity"] = "Ladownosc",
|
||||||
["Center"] = false,
|
["Center"] = false,
|
||||||
["Channels"] = "Kanaly",
|
["Channels"] = "Kanaly",
|
||||||
["Character List"] = "Lista postaci",
|
["Character List"] = "Lista postaci",
|
||||||
@@ -82,65 +77,64 @@ locale = {
|
|||||||
["Close this channel"] = "Zamknij kanal",
|
["Close this channel"] = "Zamknij kanal",
|
||||||
["Club Fighting"] = "Walka obuchem",
|
["Club Fighting"] = "Walka obuchem",
|
||||||
["Combat Controls"] = "Kontrola walki",
|
["Combat Controls"] = "Kontrola walki",
|
||||||
["Comment:"] = false,
|
["Comment:"] = "Komentarz:",
|
||||||
["Connecting to game server..."] = "Laczenie z serwerem gry...",
|
["Connecting to game server..."] = "Laczenie z serwerem gry...",
|
||||||
["Connecting to login server..."] = "Laczenie z serwerem logowania...",
|
["Connecting to login server..."] = "Laczenie z serwerem logowania...",
|
||||||
["Console"] = false,
|
["Console"] = "Konsola",
|
||||||
["Cooldowns"] = false,
|
["Cooldowns"] = false,
|
||||||
["Copy message"] = false,
|
["Copy message"] = "Kopiuj wiadomosc",
|
||||||
["Copy name"] = false,
|
["Copy name"] = "Kopiuj imie",
|
||||||
["Copy Name"] = "Kopiuj Nick",
|
["Copy Name"] = "Kopiuj Imie",
|
||||||
["Create Map Mark"] = false,
|
["Create Map Mark"] = "Utworz Znacznik na Mapie",
|
||||||
["Create mark"] = false,
|
["Create mark"] = "Utworz znacznik",
|
||||||
["Create New Offer"] = false,
|
["Create New Offer"] = "Utworz Nowa Oferte",
|
||||||
["Create Offer"] = false,
|
["Create Offer"] = "Utworz Oferte",
|
||||||
["Current hotkeys:"] = "Aktualny hotkey:",
|
["Current hotkeys:"] = "Aktualny hotkey:",
|
||||||
["Current hotkey to add: %s"] = "Aktualny hotkey do dodania: %s",
|
["Current hotkey to add: %s"] = "Aktualny hotkey do dodania: %s",
|
||||||
["Current Offers"] = false,
|
["Current Offers"] = "Obecne Oferty",
|
||||||
["Default"] = "Domyslny",
|
["Default"] = "Domyslny",
|
||||||
["Delete mark"] = false,
|
["Delete mark"] = "Usun znacznik",
|
||||||
["Description:"] = false,
|
["Description:"] = "Opis:",
|
||||||
["Description"] = "Opis",
|
["Description"] = "Opis",
|
||||||
["Destructive Behaviour"] = false,
|
["Destructive Behaviour"] = "Destrukcyjne Zachowanie",
|
||||||
["Detail"] = "Szczegoly",
|
["Detail"] = "Szczegoly",
|
||||||
["Details"] = false,
|
["Details"] = "Szczegoly",
|
||||||
["Disable Shared Experience"] = "Wylacz Dzielenie Doswiadczenia",
|
["Disable Shared Experience"] = "Wylacz Dzielenie Doswiadczenia",
|
||||||
["Dismount"] = false,
|
["Dismount"] = false,
|
||||||
["Display connection speed to the server (milliseconds)"] = false,
|
["Display connection speed to the server (milliseconds)"] = "Wyswietl ping do serwera (ms)",
|
||||||
["Distance Fighting"] = "Walka na odleglosc",
|
["Distance Fighting"] = "Walka na odleglosc",
|
||||||
["Don't stretch/shrink Game Window"] = false,
|
["Don't stretch/shrink Game Window"] = "Nie rozszerzaj/zwezaj Okna Gry",
|
||||||
["Edit hotkey text:"] = "Edytuj tresc hotkeya:",
|
["Edit hotkey text:"] = "Edytuj tresc hotkeya:",
|
||||||
["Edit List"] = false,
|
["Edit List"] = "Lista Edycji",
|
||||||
["Edit Text"] = "Edytuj tekst",
|
["Edit Text"] = "Edytuj tekst",
|
||||||
["Enable music"] = false,
|
["Enable music"] = "Odtwarzaj muzyke",
|
||||||
["Enable Shared Experience"] = "Wlacz dzielenie doswiadczenia",
|
["Enable Shared Experience"] = "Wlacz dzielenie doswiadczenia",
|
||||||
["Enable smart walking"] = false,
|
["Enable smart walking"] = false,
|
||||||
["Enable vertical synchronization"] = "Wlacz synchronizacje pionowa",
|
["Enable vertical synchronization"] = "Wlacz synchronizacje pionowa",
|
||||||
["Enable walk booster"] = false,
|
["Enable walk booster"] = false,
|
||||||
["Enter Game"] = "Wejdz do gry",
|
["Enter Game"] = "Wejdz do gry",
|
||||||
["Enter one name per line."] = false,
|
["Enter one name per line."] = "Wprowadz jedno imie na linie",
|
||||||
["Enter with your account again to update your client."] = false,
|
["Enter with your account again to update your client."] = "Zaloguj sie ponownie by zaktualizowac klienta",
|
||||||
["Error"] = "Blad",
|
["Error"] = "Blad",
|
||||||
["Error"] = "Blad",
|
["Excessive Unjustified Player Killing"] = "Nadmierne Nieusprawiedliwione Zabijanie Graczy",
|
||||||
["Excessive Unjustified Player Killing"] = false,
|
|
||||||
["Exclude from private chat"] = "Wyrzuc w prywatnej konwersacji",
|
["Exclude from private chat"] = "Wyrzuc w prywatnej konwersacji",
|
||||||
["Exit"] = false,
|
["Exit"] = false,
|
||||||
["Experience"] = "Doswiadczenie",
|
["Experience"] = "Doswiadczenie",
|
||||||
["Filter list to match your level"] = false,
|
["Filter list to match your level"] = "Wyswietl tylko odpowiednie dla mojego poziomu",
|
||||||
["Filter list to match your vocation"] = false,
|
["Filter list to match your vocation"] = "Wyswietl tylko odpowiednie dla mojej klasy",
|
||||||
["Find:"] = false,
|
["Find:"] = "Szukaj:",
|
||||||
["Fishing"] = "Wedkarstwo",
|
["Fishing"] = "Wedkarstwo",
|
||||||
["Fist Fighting"] = "Walka wrecz",
|
["Fist Fighting"] = "Walka wrecz",
|
||||||
["Follow"] = "Podazaj",
|
["Follow"] = "Podazaj",
|
||||||
["Force Exit"] = false,
|
["Force Exit"] = "Wymus Zamkniecie",
|
||||||
["For Your Information"] = false,
|
["For Your Information"] = false,
|
||||||
["Free Account"] = false,
|
["Free Account"] = "Darmowe Konto",
|
||||||
["Fullscreen"] = "Pelen ekran",
|
["Fullscreen"] = "Pelen ekran",
|
||||||
["Game"] = false,
|
["Game"] = "Gra",
|
||||||
["Game framerate limit: %s"] = false,
|
["Game framerate limit: %s"] = "Limit FPS: %s",
|
||||||
["Graphics"] = "Grafika",
|
["Graphics"] = "Grafika",
|
||||||
["Graphics card driver not detected"] = false,
|
["Graphics card driver not detected"] = "Nie wykryto karty graficznej",
|
||||||
["Graphics Engine:"] = false,
|
["Graphics Engine:"] = "Silnik graficzny:",
|
||||||
["Head"] = "Glowa",
|
["Head"] = "Glowa",
|
||||||
["Healing"] = false,
|
["Healing"] = false,
|
||||||
["Health Info"] = false,
|
["Health Info"] = false,
|
||||||
@@ -148,43 +142,43 @@ locale = {
|
|||||||
["Hide monsters"] = "Ukryj potwory",
|
["Hide monsters"] = "Ukryj potwory",
|
||||||
["Hide non-skull players"] = "Ukryj graczy bez skulla",
|
["Hide non-skull players"] = "Ukryj graczy bez skulla",
|
||||||
["Hide Npcs"] = "Ukryj NPCe",
|
["Hide Npcs"] = "Ukryj NPCe",
|
||||||
["Hide Offline"] = false,
|
["Hide Offline"] = "Ukryj Niedostepnych",
|
||||||
["Hide party members"] = "Ukryj czlonkow zabawy",
|
["Hide party members"] = "Ukryj czlonkow druzyny",
|
||||||
["Hide players"] = "Ukryj graczy",
|
["Hide players"] = "Ukryj graczy",
|
||||||
["Hide spells for higher exp. levels"] = false,
|
["Hide spells for higher exp. levels"] = "Ukryj zaklecia wyzszych poziomow postaci",
|
||||||
["Hide spells for other vocations"] = false,
|
["Hide spells for other vocations"] = "Ukryj zaklecia innych klas",
|
||||||
["Hit Points"] = "Punkty uderzen",
|
["Hit Points"] = "Punkty uderzen",
|
||||||
["Hold left mouse button to navigate\nScroll mouse middle button to zoom\nRight mouse button to create map marks"] = false,
|
["Hold left mouse button to navigate\nScroll mouse middle button to zoom\nRight mouse button to create map marks"] = false,
|
||||||
["Hotkeys"] = "Hotkeye",
|
["Hotkeys"] = "Hotkeye",
|
||||||
["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."] = false,
|
["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."] = false,
|
||||||
["Ignore"] = false,
|
["Ignore"] = "Ignoruj",
|
||||||
["Ignore capacity"] = "Ignoruj pojemnosc",
|
["Ignore capacity"] = "Ignoruj pojemnosc",
|
||||||
["Ignored players:"] = false,
|
["Ignored players:"] = "Ignorowani gracze:",
|
||||||
["Ignore equipped"] = "Ignoruj ekwipunek",
|
["Ignore equipped"] = "Ignoruj ekwipunek",
|
||||||
["Ignore List"] = false,
|
["Ignore List"] = "Lista Ignorowanych",
|
||||||
["Ignore players"] = false,
|
["Ignore players"] = "Ignoruj graczy",
|
||||||
["Ignore Private Messages"] = false,
|
["Ignore Private Messages"] = "Ignoruj Prywatne Wiadomosci",
|
||||||
["Ignore Yelling"] = false,
|
["Ignore Yelling"] = "Ignoruj Krzyki",
|
||||||
["Interface framerate limit: %s"] = false,
|
["Interface framerate limit: %s"] = "Limit FPS interfejsu: %s",
|
||||||
["Inventory"] = "Inwentarz",
|
["Inventory"] = "Ekwipunek",
|
||||||
["Invite to Party"] = "Zapros do zabawy",
|
["Invite to Party"] = "Zapros do druzyny",
|
||||||
["Invite to private chat"] = "Zapros do prywatnej konwersacji",
|
["Invite to private chat"] = "Zapros do prywatnej konwersacji",
|
||||||
["IP Address Banishment"] = false,
|
["IP Address Banishment"] = "Blokada adresu IP",
|
||||||
["Item Offers"] = false,
|
["Item Offers"] = "Oferty Przedmiotow",
|
||||||
["It is empty."] = false,
|
["It is empty."] = "To jest puste.",
|
||||||
["Join %s's Party"] = false,
|
["Join %s's Party"] = "Dolacz do druzyny gracza %s",
|
||||||
["Leave Party"] = "Opusc zabawe",
|
["Leave Party"] = "Opusc druzyne",
|
||||||
["Level"] = "Poziom",
|
["Level"] = "Poziom",
|
||||||
["Lifetime Premium Account"] = false,
|
["Lifetime Premium Account"] = "Konto Premium na Stale",
|
||||||
["Limits FPS to 60"] = "Ogranicz FPS do 60",
|
["Limits FPS to 60"] = "Ogranicz FPS do 60",
|
||||||
["List of items that you're able to buy"] = "Lista przedmiotow, ktore mozesz kupic",
|
["List of items that you're able to buy"] = "Lista przedmiotow, ktore mozesz kupic",
|
||||||
["List of items that you're able to sell"] = "Lista przedmiotow, ktore mozesz sprzedac",
|
["List of items that you're able to sell"] = "Lista przedmiotow, ktore mozesz sprzedac",
|
||||||
["Load"] = "Wczytaj",
|
["Load"] = "Wczytaj",
|
||||||
["Logging out..."] = false,
|
["Logging out..."] = "Wylogowuje...",
|
||||||
["Login"] = "Zaloguj",
|
["Login"] = "Zaloguj",
|
||||||
["Login Error"] = "Blad Logowania",
|
["Login Error"] = "Blad Logowania",
|
||||||
["Login Error"] = "Blad Logowania",
|
["Login Error"] = "Blad Logowania",
|
||||||
["Logout"] = false,
|
["Logout"] = "Wyloguj",
|
||||||
["Look"] = "Spojrz",
|
["Look"] = "Spojrz",
|
||||||
["Magic Level"] = "Poziom Magiczny",
|
["Magic Level"] = "Poziom Magiczny",
|
||||||
["Make sure that your client uses\nthe correct game protocol version"] = "Upewnij sie, ze twoj klient\nuzywa wlasciwego protokolu gry.",
|
["Make sure that your client uses\nthe correct game protocol version"] = "Upewnij sie, ze twoj klient\nuzywa wlasciwego protokolu gry.",
|
||||||
@@ -193,7 +187,7 @@ locale = {
|
|||||||
["Market"] = false,
|
["Market"] = false,
|
||||||
["Market Offers"] = false,
|
["Market Offers"] = false,
|
||||||
["Message of the day"] = "Wiadomosc dnia",
|
["Message of the day"] = "Wiadomosc dnia",
|
||||||
["Message to "] = false,
|
["Message to "] = "Wiadomosc do ",
|
||||||
["Message to %s"] = "Wiadomosc do %s",
|
["Message to %s"] = "Wiadomosc do %s",
|
||||||
["Minimap"] = "Minimapa",
|
["Minimap"] = "Minimapa",
|
||||||
["Module Manager"] = "Menedzer modulow",
|
["Module Manager"] = "Menedzer modulow",
|
||||||
@@ -201,32 +195,32 @@ locale = {
|
|||||||
["Mount"] = false,
|
["Mount"] = false,
|
||||||
["Move Stackable Item"] = "Przenies przedmiot",
|
["Move Stackable Item"] = "Przenies przedmiot",
|
||||||
["Move up"] = "Przenies wyzej",
|
["Move up"] = "Przenies wyzej",
|
||||||
["My Offers"] = false,
|
["My Offers"] = "Moje Oferty",
|
||||||
["Name:"] = "Nazwa:",
|
["Name:"] = "Nazwa:",
|
||||||
["Name Report"] = false,
|
["Name Report"] = false,
|
||||||
["Name Report + Banishment"] = false,
|
["Name Report + Banishment"] = false,
|
||||||
["Name Report + Banishment + Final Warning"] = false,
|
["Name Report + Banishment + Final Warning"] = false,
|
||||||
["No"] = false,
|
["No"] = "Nie",
|
||||||
["No graphics card detected, everything will be drawn using the CPU,\nthus the performance will be really bad.\nPlease update your graphics driver to have a better performance."] = false,
|
["No graphics card detected, everything will be drawn using the CPU,\nthus the performance will be really bad.\nPlease update your graphics driver to have a better performance."] = false,
|
||||||
["No item selected."] = false,
|
["No item selected."] = "Nie wybrano przedmiotu.",
|
||||||
["No Mount"] = false,
|
["No Mount"] = "Brak wierzchowca",
|
||||||
["No Outfit"] = false,
|
["No Outfit"] = "Brak stroju",
|
||||||
["No statement has been selected."] = false,
|
["No statement has been selected."] = false,
|
||||||
["Notation"] = false,
|
["Notation"] = false,
|
||||||
["NPC Trade"] = "Handel NPC",
|
["NPC Trade"] = "Handel NPC",
|
||||||
["Offer History"] = false,
|
["Offer History"] = "Historia Ofert",
|
||||||
["Offers"] = false,
|
["Offers"] = "Oferty",
|
||||||
["Offer Type:"] = false,
|
["Offer Type:"] = "Typ Oferty:",
|
||||||
["Offline Training"] = false,
|
["Offline Training"] = "Trening Offline",
|
||||||
["Ok"] = "Ok",
|
["Ok"] = "Ok",
|
||||||
["on %s.\n"] = false,
|
["on %s.\n"] = false,
|
||||||
["Open"] = "Otworz",
|
["Open"] = "Otworz",
|
||||||
["Open a private message channel:"] = "Otworz prywatny kanal:",
|
["Open a private message channel:"] = "Otworz prywatny kanal:",
|
||||||
["Open charlist automatically when starting client"] = false,
|
["Open charlist automatically when starting client"] = "Automatycznie otworz liste postaci przy starcie gry",
|
||||||
["Open in new window"] = "Otworz w nowym oknie",
|
["Open in new window"] = "Otworz w nowym oknie",
|
||||||
["Open new channel"] = "Otworz nowy kanal",
|
["Open new channel"] = "Otworz nowy kanal",
|
||||||
["Options"] = "Opcje",
|
["Options"] = "Opcje",
|
||||||
["Overview"] = false,
|
["Overview"] = "Podsumowanie",
|
||||||
["Pass Leadership to %s"] = "Przekaz przywodztwo %s",
|
["Pass Leadership to %s"] = "Przekaz przywodztwo %s",
|
||||||
["Password"] = "Haslo",
|
["Password"] = "Haslo",
|
||||||
["Piece Price:"] = false,
|
["Piece Price:"] = false,
|
||||||
@@ -236,79 +230,79 @@ locale = {
|
|||||||
["Please use this dialog to only report bugs. Do not report rule violations here!"] = false,
|
["Please use this dialog to only report bugs. Do not report rule violations here!"] = false,
|
||||||
["Please wait"] = "Prosze czekac",
|
["Please wait"] = "Prosze czekac",
|
||||||
["Port"] = "Port",
|
["Port"] = "Port",
|
||||||
["Position:"] = false,
|
["Position:"] = "Pozycja:",
|
||||||
["Position: %i %i %i"] = false,
|
["Position: %i %i %i"] = "Pozycja: %i %i %i",
|
||||||
["Premium Account (%s) days left"] = false,
|
["Premium Account (%s) days left"] = "Konto Premium (%s) dni",
|
||||||
["Price:"] = "Cena:",
|
["Price:"] = "Cena:",
|
||||||
["Primary"] = "Podstawowy",
|
["Primary"] = "Podstawowy",
|
||||||
["Protocol"] = false,
|
["Protocol"] = "Protokol",
|
||||||
["Quest Log"] = false,
|
["Quest Log"] = "Dziennik Misji",
|
||||||
["Randomize"] = false,
|
["Randomize"] = false,
|
||||||
["Randomize characters outfit"] = false,
|
["Randomize characters outfit"] = false,
|
||||||
["Reason:"] = false,
|
["Reason:"] = "Powod:",
|
||||||
["Refresh"] = "Odswiez",
|
["Refresh"] = "Odswiez",
|
||||||
["Refresh Offers"] = false,
|
["Refresh Offers"] = "Odswiez Oferty",
|
||||||
["Regeneration Time"] = false,
|
["Regeneration Time"] = "Czas Regeneracji",
|
||||||
["Reject"] = false,
|
["Reject"] = "Odrzuc",
|
||||||
["Reload All"] = "Przeladuj Wszystko",
|
["Reload All"] = "Przeladuj Wszystko",
|
||||||
["Remember account and password when starts client"] = false,
|
["Remember account and password when starts client"] = "Zapamietaj identyfikator konta oraz haslo",
|
||||||
["Remember password"] = "Zapamietaj haslo",
|
["Remember password"] = "Zapamietaj haslo",
|
||||||
["Remove"] = "Usun",
|
["Remove"] = "Usun",
|
||||||
["Remove %s"] = "Usun %s",
|
["Remove %s"] = "Usun %s",
|
||||||
["Report Bug"] = false,
|
["Report Bug"] = "Zglos Blad",
|
||||||
["Reserved for more functionality later."] = false,
|
["Reserved for more functionality later."] = "Zarezerowane dla przyszlych funkcjonalnosci.",
|
||||||
["Reset Market"] = false,
|
["Reset Market"] = false,
|
||||||
["Revoke %s's Invitation"] = false,
|
["Revoke %s's Invitation"] = "Odmow na zaproszenie gracza %s",
|
||||||
["Rotate"] = "Obroc",
|
["Rotate"] = "Obroc",
|
||||||
["Rule Violation"] = false,
|
["Rule Violation"] = "Zlamanie Regul",
|
||||||
["Save"] = false,
|
["Save"] = "Zapisz",
|
||||||
["Save Messages"] = false,
|
["Save Messages"] = "Zapisz Wiadomosci",
|
||||||
["Search:"] = "Szukaj:",
|
["Search:"] = "Szukaj:",
|
||||||
["Search all items"] = false,
|
["Search all items"] = "Znajdz wszystkie przedmioty",
|
||||||
["Secondary"] = "Drugorzedny",
|
["Secondary"] = "Drugorzedny",
|
||||||
["Select object"] = "Wybierz obiekt",
|
["Select object"] = "Wybierz obiekt",
|
||||||
["Select Outfit"] = "Wybierz outfit",
|
["Select Outfit"] = "Wybierz outfit",
|
||||||
["Select your language"] = false,
|
["Select your language"] = "Wybierz jezyk",
|
||||||
["Sell"] = "Sprzedaj",
|
["Sell"] = "Sprzedaj",
|
||||||
["Sell Now"] = false,
|
["Sell Now"] = "Sprzedaj Teraz",
|
||||||
["Sell Offers"] = false,
|
["Sell Offers"] = "Oferty Sprzedazy",
|
||||||
["Send"] = false,
|
["Send"] = "Wyslij",
|
||||||
["Send automatically"] = "Wyslij automatycznie",
|
["Send automatically"] = "Wyslij automatycznie",
|
||||||
["Send Message"] = false,
|
["Send Message"] = "Wyslij Wiadomosc",
|
||||||
["Server"] = "Serwer",
|
["Server"] = "Serwer",
|
||||||
["Server Log"] = "Log Serwera",
|
["Server Log"] = "Log Serwera",
|
||||||
["Set Outfit"] = "Ustaw outfit",
|
["Set Outfit"] = "Ustaw outfit",
|
||||||
["Shielding"] = "Obrona tarcza",
|
["Shielding"] = "Obrona tarcza",
|
||||||
["Show all items"] = "Pokaz wszystkie przedmioty",
|
["Show all items"] = "Pokaz wszystkie przedmioty",
|
||||||
["Show connection ping"] = false,
|
["Show connection ping"] = "Wyswietl ping",
|
||||||
["Show Depot Only"] = false,
|
["Show Depot Only"] = false,
|
||||||
["Show event messages in console"] = "Pokaz wydarzenia w konsoli",
|
["Show event messages in console"] = "Pokaz wydarzenia w konsoli",
|
||||||
["Show frame rate"] = "Pokaz ilosc FPS",
|
["Show frame rate"] = "Pokaz FPS",
|
||||||
["Show info messages in console"] = "Pokaz informacje w konsoli",
|
["Show info messages in console"] = "Pokaz informacje w konsoli",
|
||||||
["Show left panel"] = false,
|
["Show left panel"] = "Pokaz lewy panel",
|
||||||
["Show levels in console"] = "Pokaz poziomy w konsoli",
|
["Show levels in console"] = "Pokaz poziomy w konsoli",
|
||||||
["Show Offline"] = false,
|
["Show Offline"] = "Pokaz Niedostepnych",
|
||||||
["Show private messages in console"] = "Pokaz prywatne wiadomosci w konsoli",
|
["Show private messages in console"] = "Pokaz prywatne wiadomosci w konsoli",
|
||||||
["Show private messages on screen"] = false,
|
["Show private messages on screen"] = "Pokaz prywatne wiadomosci na ekranie",
|
||||||
["Show Server Messages"] = false,
|
["Show Server Messages"] = "Pokaz Wiadomosci Serwera",
|
||||||
["Show status messages in console"] = "Pokaz status w konsoli",
|
["Show status messages in console"] = "Pokaz status w konsoli",
|
||||||
["Show Text"] = false,
|
["Show Text"] = "Pokaz Tekst",
|
||||||
["Show timestamps in console"] = "Pokaz znaczniki czasu w konsoli",
|
["Show timestamps in console"] = "Pokaz znaczniki czasu w konsoli",
|
||||||
["Show your depot items only"] = false,
|
["Show your depot items only"] = false,
|
||||||
["Skills"] = "Umiejetnosci",
|
["Skills"] = "Umiejetnosci",
|
||||||
["Soul"] = false,
|
["Soul"] = "Dusze",
|
||||||
["Soul Points"] = "Punkty Duszy",
|
["Soul Points"] = "Punkty Duszy",
|
||||||
["Special"] = false,
|
["Special"] = false,
|
||||||
["Speed"] = false,
|
["Speed"] = "Predkosc",
|
||||||
["Spell Cooldowns"] = false,
|
["Spell Cooldowns"] = false,
|
||||||
["Spell List"] = false,
|
["Spell List"] = "Lista Zaklec",
|
||||||
["Stamina"] = "Wytrzymalosc",
|
["Stamina"] = "Wytrzymalosc",
|
||||||
["Statement:"] = false,
|
["Statement:"] = false,
|
||||||
["Statement Report"] = false,
|
["Statement Report"] = false,
|
||||||
["Statistics"] = false,
|
["Statistics"] = "Statystki",
|
||||||
["Stop Attack"] = "Zatrzymaj atak",
|
["Stop Attack"] = "Anuluj atak",
|
||||||
["Stop Follow"] = "Zatrzymaj podazanie",
|
["Stop Follow"] = "Przestan podazac",
|
||||||
["Support"] = false,
|
["Support"] = "Wsparcie",
|
||||||
["%s: (use object)"] = "%s: (uzyj obiekt)",
|
["%s: (use object)"] = "%s: (uzyj obiekt)",
|
||||||
["%s: (use object on target)"] = "%s: (uzyj obiektu na celu)",
|
["%s: (use object on target)"] = "%s: (uzyj obiektu na celu)",
|
||||||
["%s: (use object on yourself)"] = "%s: (uzyj obiektu na sobie)",
|
["%s: (use object on yourself)"] = "%s: (uzyj obiektu na sobie)",
|
||||||
@@ -316,15 +310,15 @@ locale = {
|
|||||||
["Sword Fighting"] = "Atak mieczem",
|
["Sword Fighting"] = "Atak mieczem",
|
||||||
["Terminal"] = "Terminal",
|
["Terminal"] = "Terminal",
|
||||||
["There is no way."] = "Nie ma drogi.",
|
["There is no way."] = "Nie ma drogi.",
|
||||||
["Title"] = false,
|
["Title"] = "Tytul",
|
||||||
["Total Price:"] = false,
|
["Total Price"] = "Cena sumaryczna",
|
||||||
["Trade"] = "Handel",
|
["Trade"] = "Handel",
|
||||||
["Trade with ..."] = "Handluj z ...",
|
["Trade with ..."] = "Handluj z ...",
|
||||||
["Trying to reconnect in %s seconds."] = false,
|
["Trying to reconnect in %s seconds."] = "Ponowna proba laczenia za %s sekund.",
|
||||||
["Unable to load dat file, please place a valid dat in '%s'"] = false,
|
["Unable to load dat file, please place a valid dat in '%s'"] = "Nie mozna zaladowac pliku .dat z '%s'",
|
||||||
["Unable to load spr file, please place a valid spr in '%s'"] = false,
|
["Unable to load spr file, please place a valid spr in '%s'"] = "Nie mozna zaladowac pliku .spr z '%s'",
|
||||||
["Unable to logout."] = "Nie mozna sie wylogowac.",
|
["Unable to logout."] = "Nie mozna sie wylogowac.",
|
||||||
["Unignore"] = false,
|
["Unignore"] = "Anuluj Ignorowanie",
|
||||||
["Unload"] = "Wylacz",
|
["Unload"] = "Wylacz",
|
||||||
["Update needed"] = false,
|
["Update needed"] = false,
|
||||||
["Use"] = "Uzyj",
|
["Use"] = "Uzyj",
|
||||||
@@ -334,42 +328,87 @@ locale = {
|
|||||||
["Version"] = "Wersja",
|
["Version"] = "Wersja",
|
||||||
["VIP List"] = "Lista VIP",
|
["VIP List"] = "Lista VIP",
|
||||||
["Voc."] = false,
|
["Voc."] = false,
|
||||||
["Vocation"] = false,
|
["Vocation"] = "Klasa",
|
||||||
["Waiting List"] = false,
|
["Waiting List"] = "Lista Oczekujacych",
|
||||||
["Website"] = "Strona:",
|
["Website"] = "Strona:",
|
||||||
["Weight:"] = "Waga:",
|
["Weight:"] = "Waga:",
|
||||||
["Will detect when to use diagonal step based on the\nkeys you are pressing"] = false,
|
["Will detect when to use diagonal step based on the\nkeys you are pressing"] = false,
|
||||||
["With crosshair"] = "Z celownikiem",
|
["With crosshair"] = "Z celownikiem",
|
||||||
["Yes"] = false,
|
["Yes"] = "Tak",
|
||||||
["You are bleeding"] = false,
|
["You are bleeding"] = "Krwawisz",
|
||||||
["You are burning"] = "Palisz sie",
|
["You are burning"] = "Palisz sie",
|
||||||
["You are cursed"] = "Jestes przeklety",
|
["You are cursed"] = "Jestes przeklety",
|
||||||
["You are dazzled"] = "Jestes oslepiony",
|
["You are dazzled"] = "Jestes oslepiony",
|
||||||
["You are dead."] = "Zginales marnie.",
|
["You are dead."] = "Zginales marnie.",
|
||||||
["You are dead"] = false,
|
["You are dead"] = "Jestes martwy",
|
||||||
["You are drowning"] = "Topisz sie",
|
["You are drowning"] = "Topisz sie",
|
||||||
["You are drunk"] = false,
|
["You are drunk"] = "Caly swiat wiruje",
|
||||||
["You are electrified"] = "Jestes porazony pradem",
|
["You are electrified"] = "Jestes porazony pradem",
|
||||||
["You are freezing"] = "Marzniesz",
|
["You are freezing"] = "Marzniesz",
|
||||||
["You are hasted"] = "Zapieprzasz",
|
["You are hasted"] = "Zapieprzasz",
|
||||||
["You are hungry"] = false,
|
["You are hungry"] = "Burczy ci w brzuchu",
|
||||||
["You are paralysed"] = "Jestes sparalizowany",
|
["You are paralysed"] = "Jestes sparalizowany",
|
||||||
["You are poisoned"] = "Jestes zatruty",
|
["You are poisoned"] = "Jestes zatruty",
|
||||||
["You are protected by a magic shield"] = "Jestes chroniony magiczna tarcza",
|
["You are protected by a magic shield"] = "Jestes chroniony magiczna tarcza",
|
||||||
["You are strengthened"] = "Jestes wzmocniony",
|
["You are strengthened"] = "Jestes wzmocniony",
|
||||||
["You are within a protection zone"] = "Jestes w strefie ochronnej",
|
["You are within a protection zone"] = "Jestes w strefie ochronnej",
|
||||||
["You can enter new text."] = false,
|
["You can enter new text."] = "Mozesz wprowadzic nowy tekst.",
|
||||||
["You have %s percent"] = "Masz %s procent",
|
["You have %s percent"] = "Masz %s procent",
|
||||||
["You have %s percent to go"] = "Brakuje Ci %s procent",
|
["You have %s percent to go"] = "Brakuje Ci %s procent",
|
||||||
["You may not logout during a fight"] = "Nie mozesz sie wylogowac w trakcie walki",
|
["You may not logout during a fight"] = "Nie mozesz sie wylogowac w trakcie walki",
|
||||||
["You may not logout or enter a protection zone"] = "Nie mozesz sie wylogowac ani wejsc do strefy ochronnej",
|
["You may not logout or enter a protection zone"] = "Nie mozesz sie wylogowac ani wejsc do strefy ochronnej",
|
||||||
["You must enter a comment."] = false,
|
["You must enter a comment."] = "Prosze wprowadzic komentarz",
|
||||||
["You must enter a valid server address and port."] = false,
|
["You must enter a valid server address and port."] = "Prosze wprowadzic poprawny adres i port.",
|
||||||
["You must select a character to login!"] = "Musisz wybrac postac aby sie zalogowac!",
|
["You must select a character to login!"] = "Musisz wybrac postac aby sie zalogowac!",
|
||||||
["Your Capacity:"] = false,
|
["Your Capacity:"] = "Twoja Ladownosc:",
|
||||||
["You read the following, written by \n%s\n"] = false,
|
["You read the following, written by \n%s\n"] = false,
|
||||||
["You read the following, written on \n%s.\n"] = false,
|
["You read the following, written on \n%s.\n"] = false,
|
||||||
["Your Money:"] = false,
|
["Your Money:"] = false,
|
||||||
|
["Enable dash walking"] = false,
|
||||||
|
["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",
|
||||||
|
["Music volume: %d"] = "Glosnosc muzyki: %d",
|
||||||
|
["Audio"] = "Dzwiek",
|
||||||
|
["Server List"] = "Lista serwerow",
|
||||||
|
["Server list"] = "Lista serwerow",
|
||||||
|
["Client Version"] = "Wersja klienta",
|
||||||
|
["Add new server"] = "Dodaj nowy serwer",
|
||||||
|
["Select"] = "Wybierz",
|
||||||
|
["New Server"] = "Nowy serwer",
|
||||||
|
["Host"] = false,
|
||||||
|
["Reset All"] = "Ustaw domyslne",
|
||||||
|
["Disable chat mode, allow to walk using ASDW"] = "Zablokuj tryb rozmow, zezwol na poruszanie sie za pomoca klawiszy ADSW",
|
||||||
|
["Name"] = "Imie",
|
||||||
|
["Price"] = "Cena",
|
||||||
|
["Your Money"] = "Twoje fundusze",
|
||||||
|
["Weight"] = "Waga",
|
||||||
|
["Your Capacity"] = "Twoj udzwig",
|
||||||
|
["Search"] = "Szukaj",
|
||||||
|
["Sell All"] = "Sprzedaj wszystko",
|
||||||
|
["Statement"] = false,
|
||||||
|
["Reason"] = "Powod",
|
||||||
|
["Action"] = "Akcja",
|
||||||
|
["Comment"] = "Komentarz",
|
||||||
|
["Balance"] = false,
|
||||||
|
["Offer Type"] = "Typ oferty",
|
||||||
|
["Piece Price"] = false,
|
||||||
|
["Find"] = "Szukaj",
|
||||||
|
["Formula"] = "Formula",
|
||||||
|
["Group"] = "Groupa",
|
||||||
|
["Type"] = "Typ",
|
||||||
|
["Cooldown"] = false,
|
||||||
|
["Premium"] = false,
|
||||||
|
["Any"] = "Dowolny",
|
||||||
|
["Sorcerer"] = "Czarodziej",
|
||||||
|
["Druid"] = false,
|
||||||
|
["Paladin"] = "Paladyn",
|
||||||
|
["Knight"] = "Rycerz"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -5,6 +5,7 @@ locale = {
|
|||||||
|
|
||||||
-- As tradu<64><75>es devem vir sempre em ordem alfab<61>tica.
|
-- As tradu<64><75>es devem vir sempre em ordem alfab<61>tica.
|
||||||
translation = {
|
translation = {
|
||||||
|
["%d of experience per hour"] = "%d de experi<72>ncia por hora",
|
||||||
["%s of experience left"] = "%s de experi<72>ncia faltando",
|
["%s of experience left"] = "%s de experi<72>ncia faltando",
|
||||||
["%s: (use object on target)"] = "%s: (usar objeto no alvo)",
|
["%s: (use object on target)"] = "%s: (usar objeto no alvo)",
|
||||||
["%s: (use object on yourself)"] = "%s: (usar objeto em si)",
|
["%s: (use object on yourself)"] = "%s: (usar objeto em si)",
|
||||||
@@ -33,6 +34,7 @@ locale = {
|
|||||||
["Account name"] = "Nome da conta",
|
["Account name"] = "Nome da conta",
|
||||||
["Account Status"] = "Estado da Conta",
|
["Account Status"] = "Estado da Conta",
|
||||||
["Action"] = "A<EFBFBD><EFBFBD>o",
|
["Action"] = "A<EFBFBD><EFBFBD>o",
|
||||||
|
["Add new server"] = "Adicionar novo servidor",
|
||||||
["Add new VIP"] = "Adicionar nova VIP",
|
["Add new VIP"] = "Adicionar nova VIP",
|
||||||
["Add to VIP list"] = "Adicionar a lista VIP",
|
["Add to VIP list"] = "Adicionar a lista VIP",
|
||||||
["Add"] = "Adicionar",
|
["Add"] = "Adicionar",
|
||||||
@@ -89,6 +91,7 @@ locale = {
|
|||||||
["Comment"] = "Coment<EFBFBD>rio",
|
["Comment"] = "Coment<EFBFBD>rio",
|
||||||
["Connecting to game server..."] = "Conectando no servidor do jogo...",
|
["Connecting to game server..."] = "Conectando no servidor do jogo...",
|
||||||
["Connecting to login server..."] = "Conectando no servidor de autentica<63><61>o...",
|
["Connecting to login server..."] = "Conectando no servidor de autentica<63><61>o...",
|
||||||
|
["Connection Error"] = "Erro de Conex<65>o",
|
||||||
["Console"] = "Console",
|
["Console"] = "Console",
|
||||||
["Cooldown"] = "Cooldown",
|
["Cooldown"] = "Cooldown",
|
||||||
["Cooldowns"] = "Cooldowns",
|
["Cooldowns"] = "Cooldowns",
|
||||||
@@ -122,6 +125,7 @@ locale = {
|
|||||||
["Edit List"] = "Editar lista",
|
["Edit List"] = "Editar lista",
|
||||||
["Edit Text"] = "Editar Texto",
|
["Edit Text"] = "Editar Texto",
|
||||||
["Enable audio"] = "Ativar <20>udio",
|
["Enable audio"] = "Ativar <20>udio",
|
||||||
|
["Enable dash walking"] = "Ativar andar r<>pido",
|
||||||
["Enable lights"] = "Ativar luzes",
|
["Enable lights"] = "Ativar luzes",
|
||||||
["Enable music sound"] = "Ativar m<>sica",
|
["Enable music sound"] = "Ativar m<>sica",
|
||||||
["Enable music"] = "Ativar musica",
|
["Enable music"] = "Ativar musica",
|
||||||
@@ -169,6 +173,7 @@ locale = {
|
|||||||
["Hide spells for other vocations"] = "Esconder feiti<74>os de outras voca<63><61>es",
|
["Hide spells for other vocations"] = "Esconder feiti<74>os de outras voca<63><61>es",
|
||||||
["Hit Points"] = "Pontos de Vida",
|
["Hit Points"] = "Pontos de Vida",
|
||||||
["Hold left mouse button to navigate\nScroll mouse middle button to zoom\nRight mouse button to create map marks"] = "Segure o bot<6F>o esquerdo para navegar\nGire o bot<6F>o do centro do mouse para ampliar\nClique com o bot<6F>o direito do mouse para criar marcas",
|
["Hold left mouse button to navigate\nScroll mouse middle button to zoom\nRight mouse button to create map marks"] = "Segure o bot<6F>o esquerdo para navegar\nGire o bot<6F>o do centro do mouse para ampliar\nClique com o bot<6F>o direito do mouse para criar marcas",
|
||||||
|
["Host"] = "Host",
|
||||||
["Hotkeys"] = "Atalhos",
|
["Hotkeys"] = "Atalhos",
|
||||||
["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."] = "Se voc<6F> desligar o programa o seu personagem pode continuar no jogo.\nClique em 'Sair' para assegurar que seu personagem saia do jogo adequadamente.\nClique em 'For<6F>ar Saida' para fechar o programa sem desconectar seu personagem.",
|
["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."] = "Se voc<6F> desligar o programa o seu personagem pode continuar no jogo.\nClique em 'Sair' para assegurar que seu personagem saia do jogo adequadamente.\nClique em 'For<6F>ar Saida' para fechar o programa sem desconectar seu personagem.",
|
||||||
["Ignore capacity"] = "Ignorar capacidade",
|
["Ignore capacity"] = "Ignorar capacidade",
|
||||||
@@ -221,6 +226,8 @@ locale = {
|
|||||||
["Name Report + Banishment"] = "Reportar Nome + Banimento",
|
["Name Report + Banishment"] = "Reportar Nome + Banimento",
|
||||||
["Name Report"] = "Reportar Nome",
|
["Name Report"] = "Reportar Nome",
|
||||||
["Name"] = "Nome",
|
["Name"] = "Nome",
|
||||||
|
["New Server"] = "Novo Servidor",
|
||||||
|
["Next level in %d hours and %d minutes"] = "Pr<EFBFBD>ximo n<>vel em %d horas e %d minutos",
|
||||||
["No graphics card detected, everything will be drawn using the CPU,\nthus the performance will be really bad.\nPlease update your graphics driver to have a better performance."] = false,
|
["No graphics card detected, everything will be drawn using the CPU,\nthus the performance will be really bad.\nPlease update your graphics driver to have a better performance."] = false,
|
||||||
["No item selected."] = "Nenhum item selecionado",
|
["No item selected."] = "Nenhum item selecionado",
|
||||||
["No Mount"] = "Sem montaria",
|
["No Mount"] = "Sem montaria",
|
||||||
@@ -287,12 +294,16 @@ locale = {
|
|||||||
["Select object"] = "Selecionar objeto",
|
["Select object"] = "Selecionar objeto",
|
||||||
["Select Outfit"] = "Selecionar Roupa",
|
["Select Outfit"] = "Selecionar Roupa",
|
||||||
["Select your language"] = "Selecione sua l<>ngua",
|
["Select your language"] = "Selecione sua l<>ngua",
|
||||||
|
["Select"] = "Selecionar",
|
||||||
|
["Sell All"] = "Vender Todos",
|
||||||
["Sell Now"] = "Vender agora",
|
["Sell Now"] = "Vender agora",
|
||||||
["Sell Offers"] = "Ofertas de venda",
|
["Sell Offers"] = "Ofertas de venda",
|
||||||
["Sell"] = "Vender",
|
["Sell"] = "Vender",
|
||||||
["Send automatically"] = "Enviar automaticamente",
|
["Send automatically"] = "Enviar automaticamente",
|
||||||
["Send Message"] = "Enviar Mensagem",
|
["Send Message"] = "Enviar Mensagem",
|
||||||
["Send"] = "Enviar",
|
["Send"] = "Enviar",
|
||||||
|
["Server List"] = "Lista de Servidores",
|
||||||
|
["Server list"] = "Lista de servidores",
|
||||||
["Server Log"] = "Registro do servidor",
|
["Server Log"] = "Registro do servidor",
|
||||||
["Server"] = "Servidor",
|
["Server"] = "Servidor",
|
||||||
["Set Outfit"] = "Escolher Roupa",
|
["Set Outfit"] = "Escolher Roupa",
|
||||||
@@ -337,8 +348,9 @@ locale = {
|
|||||||
["Trade"] = "Trocar",
|
["Trade"] = "Trocar",
|
||||||
["Trying to reconnect in %s seconds."] = "Tentando reconectar em %s segundos.",
|
["Trying to reconnect in %s seconds."] = "Tentando reconectar em %s segundos.",
|
||||||
["Type"] = "Tipo",
|
["Type"] = "Tipo",
|
||||||
["Unable to load dat file, please place a valid dat in '%s'"] = "N<EFBFBD>o foi poss<73>vel carregar o arquivo dat, por favor coloque um arquivo v<>lido em %s",
|
["Unable to establish a connection. (err: %d)"] = "N<EFBFBD>o foi poss<73>vel estabilizar a conex<65>. (err: %d)",
|
||||||
["Unable to load spr file, please place a valid spr in '%s'"] = "N<EFBFBD>o foi poss<73>vel carregar o arquivo spr, por favor coloque um arquivo v<>lido em %s",
|
["Unable to load dat file, please place a valid dat in '%s'"] = "N<EFBFBD>o foi poss<73>vel carregar o arquivo DAT, por favor coloque um arquivo v<>lido em %s",
|
||||||
|
["Unable to load spr file, please place a valid spr in '%s'"] = "N<EFBFBD>o foi poss<73>vel carregar o arquivo SPR, por favor coloque um arquivo v<>lido em %s",
|
||||||
["Unable to logout."] = "N<EFBFBD>o <20> possivel sair",
|
["Unable to logout."] = "N<EFBFBD>o <20> possivel sair",
|
||||||
["Unignore"] = "Designorar",
|
["Unignore"] = "Designorar",
|
||||||
["Unload"] = "Descarregar",
|
["Unload"] = "Descarregar",
|
||||||
@@ -354,6 +366,7 @@ locale = {
|
|||||||
["Waiting List"] = "Lista de espera",
|
["Waiting List"] = "Lista de espera",
|
||||||
["Website"] = "Website",
|
["Website"] = "Website",
|
||||||
["Weight"] = "Peso",
|
["Weight"] = "Peso",
|
||||||
|
["Will boost your walk on high speed characters"] = "Ir<EFBFBD> melhorar o andar de persnagens r<>pidos",
|
||||||
["Will detect when to use diagonal step based on the\nkeys you are pressing"] = "Detectar quando usar o passo diagonal\nbaseado nas teclas pressionadas",
|
["Will detect when to use diagonal step based on the\nkeys you are pressing"] = "Detectar quando usar o passo diagonal\nbaseado nas teclas pressionadas",
|
||||||
["With crosshair"] = "Com mira",
|
["With crosshair"] = "Com mira",
|
||||||
["Yes"] = "Sim",
|
["Yes"] = "Sim",
|
||||||
@@ -388,6 +401,7 @@ locale = {
|
|||||||
["Your Capacity"] = "Sua capacidade",
|
["Your Capacity"] = "Sua capacidade",
|
||||||
["Your character health is %d out of %d."] = "A vida do seu personagem <20> %d de %d.",
|
["Your character health is %d out of %d."] = "A vida do seu personagem <20> %d de %d.",
|
||||||
["Your character mana is %d out of %d."] = "A mana do seu personagem <20> %d de %d.",
|
["Your character mana is %d out of %d."] = "A mana do seu personagem <20> %d de %d.",
|
||||||
|
["Your connection has been lost. (err: %d)"] = "A sua conex<65>o foi perdida. (err: %d)",
|
||||||
["Your Money"] = "Seu dinheiro",
|
["Your Money"] = "Seu dinheiro",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -66,4 +66,18 @@ PreviousButton < UIButton
|
|||||||
image-clip: 0 21 12 21
|
image-clip: 0 21 12 21
|
||||||
|
|
||||||
$disabled:
|
$disabled:
|
||||||
image-color: #ffffff55
|
image-color: #ffffff55
|
||||||
|
|
||||||
|
AddButton < UIButton
|
||||||
|
size: 20 20
|
||||||
|
image-source: /images/ui/icon_add
|
||||||
|
image-color: #ffffffff
|
||||||
|
|
||||||
|
$hover !disabled:
|
||||||
|
image-color: #ffffff99
|
||||||
|
|
||||||
|
$pressed:
|
||||||
|
image-color: #ffffff44
|
||||||
|
|
||||||
|
$disabled:
|
||||||
|
image-color: #ffffff55
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
CheckBox < UICheckBox
|
CheckBox < UICheckBox
|
||||||
size: 16 16
|
size: 16 16
|
||||||
text-align: left
|
text-align: left
|
||||||
text: aa
|
|
||||||
text-offset: 16 0
|
text-offset: 16 0
|
||||||
color: #aaaaaa
|
color: #aaaaaa
|
||||||
image-color: #ffffffff
|
image-color: #ffffffff
|
||||||
|
@@ -38,7 +38,7 @@ CreatureButton < UICreatureButton
|
|||||||
margin-left: 2
|
margin-left: 2
|
||||||
phantom: true
|
phantom: true
|
||||||
|
|
||||||
ProgressBar
|
LifeProgressBar
|
||||||
id: lifeBar
|
id: lifeBar
|
||||||
height: 5
|
height: 5
|
||||||
anchors.left: spacer.right
|
anchors.left: spacer.right
|
||||||
|
@@ -4,3 +4,7 @@ Item < UIItem
|
|||||||
image-source: /images/ui/item
|
image-source: /images/ui/item
|
||||||
font: verdana-11px-rounded
|
font: verdana-11px-rounded
|
||||||
border-color: white
|
border-color: white
|
||||||
|
color: white
|
||||||
|
|
||||||
|
$disabled:
|
||||||
|
color: #646464
|
||||||
|
@@ -21,45 +21,3 @@ MenuLabel < Label
|
|||||||
GameLabel < UILabel
|
GameLabel < UILabel
|
||||||
font: verdana-11px-antialised
|
font: verdana-11px-antialised
|
||||||
color: #bbbbbb
|
color: #bbbbbb
|
||||||
|
|
||||||
FrameCounterLabel < Label
|
|
||||||
font: verdana-11px-rounded
|
|
||||||
@onSetup: |
|
|
||||||
self.updateEvent = cycleEvent(function()
|
|
||||||
local text = 'FPS: ' .. g_app.getBackgroundPaneFps()
|
|
||||||
self:setText(text)
|
|
||||||
end, 1000)
|
|
||||||
@onDestroy: self.updateEvent:cancel()
|
|
||||||
|
|
||||||
PingLabel < Label
|
|
||||||
font: verdana-11px-rounded
|
|
||||||
@onSetup: |
|
|
||||||
self.updateEvent = cycleEvent(function()
|
|
||||||
if g_game.isOnline() and modules.client_options.getOption('showPing') then
|
|
||||||
local ping = -1
|
|
||||||
if g_game.getFeature(GameClientPing) or g_game.getFeature(GameExtendedClientPing) then
|
|
||||||
ping = g_game.getPing()
|
|
||||||
else
|
|
||||||
ping = g_game.getLocalPlayer():getWalkPing()
|
|
||||||
end
|
|
||||||
local text = 'Ping: '
|
|
||||||
if ping < 0 then
|
|
||||||
text = text .. "??"
|
|
||||||
self:setColor('yellow')
|
|
||||||
else
|
|
||||||
text = text .. ping .. ' ms'
|
|
||||||
if ping >= 500 then
|
|
||||||
self:setColor('red')
|
|
||||||
elseif ping >= 250 then
|
|
||||||
self:setColor('yellow')
|
|
||||||
else
|
|
||||||
self:setColor('green')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
self:setText(text)
|
|
||||||
self:show()
|
|
||||||
else
|
|
||||||
self:hide()
|
|
||||||
end
|
|
||||||
end, 1000)
|
|
||||||
@onDestroy: self.updateEvent:cancel()
|
|
||||||
|
@@ -11,3 +11,9 @@ HorizontalList < UIScrollArea
|
|||||||
border-width: 1
|
border-width: 1
|
||||||
border-color: #1d222b
|
border-color: #1d222b
|
||||||
background-color: #222833
|
background-color: #222833
|
||||||
|
|
||||||
|
VerticalList < UIScrollArea
|
||||||
|
layout: verticalBox
|
||||||
|
border-width: 1
|
||||||
|
border-color: #1d222b
|
||||||
|
background-color: #222833
|
@@ -1,12 +1,10 @@
|
|||||||
ProgressBar < UIProgressBar
|
ProgressBar < UIProgressBar
|
||||||
height: 16
|
height: 16
|
||||||
background-color: red
|
background-color: red
|
||||||
border: 1 black
|
|
||||||
image-source: /images/ui/progressbar
|
image-source: /images/ui/progressbar
|
||||||
image-border: 1
|
image-border: 1
|
||||||
font: verdana-11px-rounded
|
font: verdana-11px-rounded
|
||||||
text-offset: 0 2
|
text-offset: 0 2
|
||||||
on: true
|
|
||||||
|
|
||||||
$!on:
|
$!on:
|
||||||
visible: false
|
visible: false
|
||||||
@@ -14,6 +12,14 @@ ProgressBar < UIProgressBar
|
|||||||
margin-bottom: 0
|
margin-bottom: 0
|
||||||
height: 0
|
height: 0
|
||||||
|
|
||||||
|
LifeProgressBar < UIProgressBar
|
||||||
|
height: 16
|
||||||
|
background-color: green
|
||||||
|
border: 1 black
|
||||||
|
font: verdana-11px-rounded
|
||||||
|
text-offset: 0 2
|
||||||
|
margin: 2
|
||||||
|
|
||||||
ProgressRect < UIProgressRect
|
ProgressRect < UIProgressRect
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
phantom: true
|
phantom: true
|
||||||
|
@@ -5,7 +5,7 @@ ScrollBarSlider < UIButton
|
|||||||
image-source: /images/ui/scrollbar
|
image-source: /images/ui/scrollbar
|
||||||
image-clip: 0 26 13 13
|
image-clip: 0 26 13 13
|
||||||
image-border: 2
|
image-border: 2
|
||||||
image-color: #ffffffbb
|
image-color: #ffffffff
|
||||||
$hover:
|
$hover:
|
||||||
image-clip: 13 26 13 13
|
image-clip: 13 26 13 13
|
||||||
$pressed:
|
$pressed:
|
||||||
@@ -14,6 +14,12 @@ ScrollBarSlider < UIButton
|
|||||||
$disabled:
|
$disabled:
|
||||||
image-color: #ffffff66
|
image-color: #ffffff66
|
||||||
|
|
||||||
|
ScrollBarValueLabel < Label
|
||||||
|
id: valueLabel
|
||||||
|
anchors.fill: parent
|
||||||
|
color: white
|
||||||
|
text-align: center
|
||||||
|
|
||||||
VerticalScrollBar < UIScrollBar
|
VerticalScrollBar < UIScrollBar
|
||||||
orientation: vertical
|
orientation: vertical
|
||||||
width: 13
|
width: 13
|
||||||
@@ -55,6 +61,8 @@ VerticalScrollBar < UIScrollBar
|
|||||||
|
|
||||||
ScrollBarSlider
|
ScrollBarSlider
|
||||||
|
|
||||||
|
ScrollBarValueLabel
|
||||||
|
|
||||||
HorizontalScrollBar < UIScrollBar
|
HorizontalScrollBar < UIScrollBar
|
||||||
orientation: horizontal
|
orientation: horizontal
|
||||||
height: 13
|
height: 13
|
||||||
@@ -97,3 +105,5 @@ HorizontalScrollBar < UIScrollBar
|
|||||||
image-color: #ffffff66
|
image-color: #ffffff66
|
||||||
|
|
||||||
ScrollBarSlider
|
ScrollBarSlider
|
||||||
|
|
||||||
|
ScrollBarValueLabel
|
||||||
|
@@ -1,7 +1,9 @@
|
|||||||
SpinBox < TextEdit
|
SpinBox < TextEdit
|
||||||
__class: UISpinBox
|
__class: UISpinBox
|
||||||
|
text-align: left
|
||||||
size: 86 20
|
size: 86 20
|
||||||
padding: 0
|
padding: 0
|
||||||
|
padding-left: 2
|
||||||
|
|
||||||
Button
|
Button
|
||||||
id: up
|
id: up
|
||||||
@@ -11,7 +13,6 @@ SpinBox < TextEdit
|
|||||||
image-clip: 0 0 10 10
|
image-clip: 0 0 10 10
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
@onClick: self:getParent():up()
|
|
||||||
|
|
||||||
$hover:
|
$hover:
|
||||||
image-clip: 0 10 10 10
|
image-clip: 0 10 10 10
|
||||||
@@ -26,7 +27,6 @@ SpinBox < TextEdit
|
|||||||
image-clip: 0 0 10 10
|
image-clip: 0 0 10 10
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
@onClick: self:getParent():down()
|
|
||||||
|
|
||||||
$hover:
|
$hover:
|
||||||
image-clip: 0 10 10 10
|
image-clip: 0 10 10 10
|
||||||
|
@@ -46,7 +46,11 @@ TopMenuPanel < Panel
|
|||||||
image-repeated: true
|
image-repeated: true
|
||||||
focusable: false
|
focusable: false
|
||||||
|
|
||||||
TopMenuFrameCounterLabel < FrameCounterLabel
|
TopMenuFrameCounterLabel < Label
|
||||||
|
font: verdana-11px-rounded
|
||||||
color: white
|
color: white
|
||||||
margin-top: 4
|
margin-top: 4
|
||||||
margin-left: 5
|
margin-left: 5
|
||||||
|
|
||||||
|
TopMenuPingLabel < Label
|
||||||
|
font: verdana-11px-rounded
|
||||||
|
@@ -1,8 +1,9 @@
|
|||||||
MessageBoxLabel < Label
|
MessageBoxLabel < Label
|
||||||
id: messageBoxLabel
|
id: messageBoxLabel
|
||||||
text-auto-resize: true
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
|
text-wrap: true
|
||||||
|
text-auto-resize: true
|
||||||
|
|
||||||
MessageBoxButtonHolder < UIWidget
|
MessageBoxButtonHolder < UIWidget
|
||||||
id: buttonHolder
|
id: buttonHolder
|
||||||
|
@@ -1,10 +1,12 @@
|
|||||||
MinimapFlag < UIWidget
|
MinimapFlag < UIWidget
|
||||||
size: 11 11
|
size: 11 11
|
||||||
anchors.left: parent.left
|
focusable: false
|
||||||
anchors.top: parent.top
|
|
||||||
|
|
||||||
MinimapFlags < UIWidget
|
MinimapCross < UIWidget
|
||||||
anchors.fill: parent
|
focusable: false
|
||||||
|
phantom: true
|
||||||
|
image: /images/game/minimap/cross
|
||||||
|
size: 16 16
|
||||||
|
|
||||||
MinimapFloorUpButton < Button
|
MinimapFloorUpButton < Button
|
||||||
size: 20 20
|
size: 20 20
|
||||||
@@ -61,12 +63,7 @@ Minimap < UIMinimap
|
|||||||
draggable: true
|
draggable: true
|
||||||
focusable: false
|
focusable: false
|
||||||
cross: true
|
cross: true
|
||||||
@onGeometryChange: self:updateFlags()
|
color: black
|
||||||
|
|
||||||
MinimapFlags
|
|
||||||
id: flags
|
|
||||||
phantom: true
|
|
||||||
focusable: false
|
|
||||||
|
|
||||||
MinimapFloorUpButton
|
MinimapFloorUpButton
|
||||||
id: floorUp
|
id: floorUp
|
||||||
@@ -245,22 +242,3 @@ MinimapFlagWindow < MainWindow
|
|||||||
width: 64
|
width: 64
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
|
|
||||||
// Minimap Full Panel
|
|
||||||
|
|
||||||
MinimapFullPanel < FlatPanel
|
|
||||||
phantom: false
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.top: topMenu.bottom
|
|
||||||
|
|
||||||
ImageView
|
|
||||||
id: image
|
|
||||||
anchors.fill: parent
|
|
||||||
|
|
||||||
Button
|
|
||||||
!text: tr('Close')
|
|
||||||
margin-right: 4
|
|
||||||
margin-top: 4
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.top: parent.top
|
|
||||||
@onClick: self:getParent():destroy()
|
|
||||||
|
2
init.lua
@@ -48,7 +48,7 @@ g_modules.ensureModuleLoaded("game_interface")
|
|||||||
-- mods 1000-9999
|
-- mods 1000-9999
|
||||||
g_modules.autoLoadModules(9999)
|
g_modules.autoLoadModules(9999)
|
||||||
|
|
||||||
local script = '/' .. g_app.getCompactName() .. 'rc'
|
local script = '/' .. g_app.getCompactName() .. 'rc.lua'
|
||||||
|
|
||||||
if g_resources.fileExists(script) then
|
if g_resources.fileExists(script) then
|
||||||
dofile(script)
|
dofile(script)
|
||||||
|
10
modules/.project/modules.sublime-project
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"folders":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"path": "..",
|
||||||
|
"folder_exclude_patterns": [".*", "*.*~"],
|
||||||
|
"file_exclude_patterns": [".*", "*.*~"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@@ -11,10 +11,10 @@ function setMusic(filename)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function reloadScripts()
|
function reloadScripts()
|
||||||
g_textures.clearTexturesCache()
|
g_textures.clearCache()
|
||||||
g_modules.reloadModules()
|
g_modules.reloadModules()
|
||||||
|
|
||||||
local script = '/' .. g_app.getCompactName() .. 'rc'
|
local script = '/' .. g_app.getCompactName() .. 'rc.lua'
|
||||||
if g_resources.fileExists(script) then
|
if g_resources.fileExists(script) then
|
||||||
dofile(script)
|
dofile(script)
|
||||||
end
|
end
|
||||||
@@ -55,7 +55,7 @@ end
|
|||||||
function init()
|
function init()
|
||||||
connect(g_app, { onRun = startup,
|
connect(g_app, { onRun = startup,
|
||||||
onExit = exit })
|
onExit = exit })
|
||||||
|
|
||||||
g_window.setMinimumSize({ width = 600, height = 480 })
|
g_window.setMinimumSize({ width = 600, height = 480 })
|
||||||
g_sounds.preload(musicFilename)
|
g_sounds.preload(musicFilename)
|
||||||
|
|
||||||
@@ -104,11 +104,6 @@ function terminate()
|
|||||||
g_settings.set('window-size', g_window.getUnmaximizedSize())
|
g_settings.set('window-size', g_window.getUnmaximizedSize())
|
||||||
g_settings.set('window-pos', g_window.getUnmaximizedPos())
|
g_settings.set('window-pos', g_window.getUnmaximizedPos())
|
||||||
g_settings.set('window-maximized', g_window.isMaximized())
|
g_settings.set('window-maximized', g_window.isMaximized())
|
||||||
|
|
||||||
local protocolVersion = g_game.getProtocolVersion()
|
|
||||||
if protocolVersion ~= 0 then
|
|
||||||
g_settings.set('protocol-version', protocolVersion)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function exit()
|
function exit()
|
||||||
|
@@ -12,11 +12,11 @@ Module
|
|||||||
load-later:
|
load-later:
|
||||||
- client_styles
|
- client_styles
|
||||||
- client_locales
|
- client_locales
|
||||||
//- client_particles
|
|
||||||
- client_topmenu
|
- client_topmenu
|
||||||
- client_background
|
- client_background
|
||||||
- client_entergame
|
|
||||||
- client_options
|
- client_options
|
||||||
|
- client_entergame
|
||||||
- client_terminal
|
- client_terminal
|
||||||
- client_modulemanager
|
- client_modulemanager
|
||||||
//- client_stats
|
- client_serverlist
|
||||||
|
- client_stats
|
||||||
|
@@ -1,18 +1,19 @@
|
|||||||
-- private variables
|
-- private variables
|
||||||
local background
|
local background
|
||||||
|
local clientVersionLabel
|
||||||
|
|
||||||
-- public functions
|
-- public functions
|
||||||
function init()
|
function init()
|
||||||
background = g_ui.displayUI('background')
|
background = g_ui.displayUI('background')
|
||||||
background:lower()
|
background:lower()
|
||||||
|
|
||||||
local clientVersionLabel = background:getChildById('clientVersionLabel')
|
clientVersionLabel = background:getChildById('clientVersionLabel')
|
||||||
clientVersionLabel:setText(g_app.getName() .. ' ' .. g_app.getVersion() .. '\n' ..
|
clientVersionLabel:setText(g_app.getName() .. ' ' .. g_app.getVersion() .. '\n' ..
|
||||||
'Rev ' .. g_app.getBuildRevision() .. ' ('.. g_app.getBuildCommit() .. ')\n' ..
|
'Rev ' .. g_app.getBuildRevision() .. ' ('.. g_app.getBuildCommit() .. ')\n' ..
|
||||||
'Built on ' .. g_app.getBuildDate())
|
'Built on ' .. g_app.getBuildDate())
|
||||||
|
|
||||||
if not g_game.isOnline() then
|
if not g_game.isOnline() then
|
||||||
g_effects.fadeIn(clientVersionLabel, 1500)
|
addEvent(function() g_effects.fadeIn(clientVersionLabel, 1500) end)
|
||||||
end
|
end
|
||||||
|
|
||||||
connect(g_game, { onGameStart = hide })
|
connect(g_game, { onGameStart = hide })
|
||||||
@@ -40,3 +41,7 @@ end
|
|||||||
function hideVersionLabel()
|
function hideVersionLabel()
|
||||||
background:getChildById('clientVersionLabel'):hide()
|
background:getChildById('clientVersionLabel'):hide()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function setVersionText(text)
|
||||||
|
clientVersionLabel:setText(text)
|
||||||
|
end
|
||||||
|
@@ -111,7 +111,8 @@ end
|
|||||||
|
|
||||||
function onGameConnectionError(message, code)
|
function onGameConnectionError(message, code)
|
||||||
CharacterList.destroyLoadBox()
|
CharacterList.destroyLoadBox()
|
||||||
errorBox = displayErrorBox(tr("Login Error"), message)
|
local text = translateNetworkError(code, g_game.getProtocolGame() and g_game.getProtocolGame():isConnecting(), message)
|
||||||
|
errorBox = displayErrorBox(tr("Connection Error"), text)
|
||||||
errorBox.onOk = function()
|
errorBox.onOk = function()
|
||||||
errorBox = nil
|
errorBox = nil
|
||||||
CharacterList.showAgain()
|
CharacterList.showAgain()
|
||||||
|
@@ -6,8 +6,9 @@ local enterGame
|
|||||||
local motdWindow
|
local motdWindow
|
||||||
local motdButton
|
local motdButton
|
||||||
local enterGameButton
|
local enterGameButton
|
||||||
local protocolBox
|
local clientBox
|
||||||
local protocolLogin
|
local protocolLogin
|
||||||
|
local motdEnabled = true
|
||||||
|
|
||||||
-- private functions
|
-- private functions
|
||||||
local function onError(protocol, message, errorCode)
|
local function onError(protocol, message, errorCode)
|
||||||
@@ -27,15 +28,31 @@ end
|
|||||||
local function onMotd(protocol, motd)
|
local function onMotd(protocol, motd)
|
||||||
G.motdNumber = tonumber(motd:sub(0, motd:find("\n")))
|
G.motdNumber = tonumber(motd:sub(0, motd:find("\n")))
|
||||||
G.motdMessage = motd:sub(motd:find("\n") + 1, #motd)
|
G.motdMessage = motd:sub(motd:find("\n") + 1, #motd)
|
||||||
motdButton:show()
|
if motdEnabled then
|
||||||
|
motdButton:show()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function onCharacterList(protocol, characters, account, otui)
|
local function onCharacterList(protocol, characters, account, otui)
|
||||||
|
-- Try add server to the server list
|
||||||
|
ServerList.add(G.host, G.port, g_game.getProtocolVersion())
|
||||||
|
|
||||||
if enterGame:getChildById('rememberPasswordBox'):isChecked() then
|
if enterGame:getChildById('rememberPasswordBox'):isChecked() then
|
||||||
g_settings.set('account', g_crypt.encrypt(G.account))
|
local account = g_crypt.encrypt(G.account)
|
||||||
g_settings.set('password', g_crypt.encrypt(G.password))
|
local password = g_crypt.encrypt(G.password)
|
||||||
|
|
||||||
|
g_settings.set('account', account)
|
||||||
|
g_settings.set('password', password)
|
||||||
|
|
||||||
|
ServerList.setServerAccount(G.host, account)
|
||||||
|
ServerList.setServerPassword(G.host, password)
|
||||||
|
|
||||||
g_settings.set('autologin', enterGame:getChildById('autoLoginBox'):isChecked())
|
g_settings.set('autologin', enterGame:getChildById('autoLoginBox'):isChecked())
|
||||||
else
|
else
|
||||||
|
-- reset server list account/password
|
||||||
|
ServerList.setServerAccount(G.host, '')
|
||||||
|
ServerList.setServerPassword(G.host, '')
|
||||||
|
|
||||||
EnterGame.clearAccountFields()
|
EnterGame.clearAccountFields()
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -45,20 +62,17 @@ local function onCharacterList(protocol, characters, account, otui)
|
|||||||
CharacterList.create(characters, account, otui)
|
CharacterList.create(characters, account, otui)
|
||||||
CharacterList.show()
|
CharacterList.show()
|
||||||
|
|
||||||
local lastMotdNumber = g_settings.getNumber("motd")
|
if motdEnabled then
|
||||||
if G.motdNumber and G.motdNumber ~= lastMotdNumber then
|
local lastMotdNumber = g_settings.getNumber("motd")
|
||||||
g_settings.set("motd", motdNumber)
|
if G.motdNumber and G.motdNumber ~= lastMotdNumber then
|
||||||
motdWindow = displayInfoBox(tr('Message of the day'), G.motdMessage)
|
g_settings.set("motd", motdNumber)
|
||||||
connect(motdWindow, { onOk = function() CharacterList.show() motdWindow = nil end })
|
motdWindow = displayInfoBox(tr('Message of the day'), G.motdMessage)
|
||||||
CharacterList.hide()
|
connect(motdWindow, { onOk = function() CharacterList.show() motdWindow = nil end })
|
||||||
|
CharacterList.hide()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function onChangeProtocol(combobox, option)
|
|
||||||
local clients = g_game.getSupportedClients(option)
|
|
||||||
protocolBox:setTooltip("Supports Client" .. (#clients > 1 and "s" or "") .. ": " .. table.tostring(clients))
|
|
||||||
end
|
|
||||||
|
|
||||||
local function onUpdateNeeded(protocol, signature)
|
local function onUpdateNeeded(protocol, signature)
|
||||||
loadBox:destroy()
|
loadBox:destroy()
|
||||||
loadBox = nil
|
loadBox = nil
|
||||||
@@ -81,36 +95,32 @@ function EnterGame.init()
|
|||||||
motdButton:hide()
|
motdButton:hide()
|
||||||
g_keyboard.bindKeyDown('Ctrl+G', EnterGame.openWindow)
|
g_keyboard.bindKeyDown('Ctrl+G', EnterGame.openWindow)
|
||||||
|
|
||||||
if G.motdNumber then
|
if motdEnabled and G.motdNumber then
|
||||||
motdButton:show()
|
motdButton:show()
|
||||||
end
|
end
|
||||||
|
|
||||||
local account = g_crypt.decrypt(g_settings.get('account'))
|
local account = g_settings.get('account')
|
||||||
local password = g_crypt.decrypt(g_settings.get('password'))
|
local password = g_settings.get('password')
|
||||||
local host = g_settings.get('host')
|
local host = g_settings.get('host')
|
||||||
local port = g_settings.get('port')
|
local port = g_settings.get('port')
|
||||||
local autologin = g_settings.getBoolean('autologin')
|
local autologin = g_settings.getBoolean('autologin')
|
||||||
local protocolVersion = g_settings.getInteger('protocol-version')
|
local clientVersion = g_settings.getInteger('client-version')
|
||||||
|
if clientVersion == 0 then clientVersion = 860 end
|
||||||
|
|
||||||
if port == nil or port == 0 then port = 7171 end
|
if port == nil or port == 0 then port = 7171 end
|
||||||
|
|
||||||
enterGame:getChildById('accountNameTextEdit'):setText(account)
|
EnterGame.setAccountName(account)
|
||||||
enterGame:getChildById('accountNameTextEdit'):setCursorPos(-1)
|
EnterGame.setPassword(password)
|
||||||
enterGame:getChildById('accountPasswordTextEdit'):setText(password)
|
|
||||||
enterGame:getChildById('serverHostTextEdit'):setText(host)
|
enterGame:getChildById('serverHostTextEdit'):setText(host)
|
||||||
enterGame:getChildById('serverPortTextEdit'):setText(port)
|
enterGame:getChildById('serverPortTextEdit'):setText(port)
|
||||||
enterGame:getChildById('autoLoginBox'):setChecked(autologin)
|
enterGame:getChildById('autoLoginBox'):setChecked(autologin)
|
||||||
enterGame:getChildById('rememberPasswordBox'):setChecked(#account > 0)
|
|
||||||
|
|
||||||
protocolBox = enterGame:getChildById('protocolComboBox')
|
clientBox = enterGame:getChildById('clientComboBox')
|
||||||
protocolBox.onOptionChange = onChangeProtocol
|
for _, proto in pairs(g_game.getSupportedClients()) do
|
||||||
for _i, proto in pairs(g_game.getSupportedProtocols()) do
|
clientBox:addOption(proto)
|
||||||
protocolBox:addOption(proto)
|
|
||||||
end
|
|
||||||
|
|
||||||
if protocolVersion then
|
|
||||||
protocolBox:setCurrentOption(protocolVersion)
|
|
||||||
end
|
end
|
||||||
|
clientBox:setCurrentOption(clientVersion)
|
||||||
|
|
||||||
enterGame:hide()
|
enterGame:hide()
|
||||||
|
|
||||||
@@ -127,18 +137,20 @@ function EnterGame.firstShow()
|
|||||||
local host = g_settings.get('host')
|
local host = g_settings.get('host')
|
||||||
local autologin = g_settings.getBoolean('autologin')
|
local autologin = g_settings.getBoolean('autologin')
|
||||||
if #host > 0 and #password > 0 and #account > 0 and autologin then
|
if #host > 0 and #password > 0 and #account > 0 and autologin then
|
||||||
autoLoginEvent = addEvent(EnterGame.doLogin)
|
addEvent(function()
|
||||||
|
if not g_settings.getBoolean('autologin') then return end
|
||||||
|
EnterGame.doLogin()
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function EnterGame.terminate()
|
function EnterGame.terminate()
|
||||||
g_keyboard.unbindKeyDown('Ctrl+G')
|
g_keyboard.unbindKeyDown('Ctrl+G')
|
||||||
removeEvent(autoLoginEvent)
|
|
||||||
enterGame:destroy()
|
enterGame:destroy()
|
||||||
enterGame = nil
|
enterGame = nil
|
||||||
enterGameButton:destroy()
|
enterGameButton:destroy()
|
||||||
enterGameButton = nil
|
enterGameButton = nil
|
||||||
protocolBox = nil
|
clientBox = nil
|
||||||
if motdWindow then
|
if motdWindow then
|
||||||
motdWindow:destroy()
|
motdWindow:destroy()
|
||||||
motdWindow = nil
|
motdWindow = nil
|
||||||
@@ -177,6 +189,18 @@ function EnterGame.openWindow()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function EnterGame.setAccountName(account)
|
||||||
|
local account = g_crypt.decrypt(account)
|
||||||
|
enterGame:getChildById('accountNameTextEdit'):setText(account)
|
||||||
|
enterGame:getChildById('accountNameTextEdit'):setCursorPos(-1)
|
||||||
|
enterGame:getChildById('rememberPasswordBox'):setChecked(#account > 0)
|
||||||
|
end
|
||||||
|
|
||||||
|
function EnterGame.setPassword(password)
|
||||||
|
local password = g_crypt.decrypt(password)
|
||||||
|
enterGame:getChildById('accountPasswordTextEdit'):setText(password)
|
||||||
|
end
|
||||||
|
|
||||||
function EnterGame.clearAccountFields()
|
function EnterGame.clearAccountFields()
|
||||||
enterGame:getChildById('accountNameTextEdit'):clearText()
|
enterGame:getChildById('accountNameTextEdit'):clearText()
|
||||||
enterGame:getChildById('accountPasswordTextEdit'):clearText()
|
enterGame:getChildById('accountPasswordTextEdit'):clearText()
|
||||||
@@ -186,13 +210,11 @@ function EnterGame.clearAccountFields()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function EnterGame.doLogin()
|
function EnterGame.doLogin()
|
||||||
autoLoginEvent = nil
|
|
||||||
G.account = enterGame:getChildById('accountNameTextEdit'):getText()
|
G.account = enterGame:getChildById('accountNameTextEdit'):getText()
|
||||||
G.password = enterGame:getChildById('accountPasswordTextEdit'):getText()
|
G.password = enterGame:getChildById('accountPasswordTextEdit'):getText()
|
||||||
G.host = enterGame:getChildById('serverHostTextEdit'):getText()
|
G.host = enterGame:getChildById('serverHostTextEdit'):getText()
|
||||||
G.port = tonumber(enterGame:getChildById('serverPortTextEdit'):getText())
|
G.port = tonumber(enterGame:getChildById('serverPortTextEdit'):getText())
|
||||||
local protocolVersion = tonumber(protocolBox:getText())
|
local clientVersion = tonumber(clientBox:getText())
|
||||||
local clientVersions = g_game.getSupportedClients(protocolVersion)
|
|
||||||
EnterGame.hide()
|
EnterGame.hide()
|
||||||
|
|
||||||
if g_game.isOnline() then
|
if g_game.isOnline() then
|
||||||
@@ -203,9 +225,10 @@ function EnterGame.doLogin()
|
|||||||
|
|
||||||
g_settings.set('host', G.host)
|
g_settings.set('host', G.host)
|
||||||
g_settings.set('port', G.port)
|
g_settings.set('port', G.port)
|
||||||
|
g_settings.set('client-version', clientVersion)
|
||||||
|
|
||||||
protocolLogin = ProtocolLogin.create()
|
protocolLogin = ProtocolLogin.create()
|
||||||
protocolLogin.onError = onError
|
protocolLogin.onLoginError = onError
|
||||||
protocolLogin.onMotd = onMotd
|
protocolLogin.onMotd = onMotd
|
||||||
protocolLogin.onCharacterList = onCharacterList
|
protocolLogin.onCharacterList = onCharacterList
|
||||||
protocolLogin.onUpdateNeeded = onUpdateNeeded
|
protocolLogin.onUpdateNeeded = onUpdateNeeded
|
||||||
@@ -218,10 +241,8 @@ function EnterGame.doLogin()
|
|||||||
end })
|
end })
|
||||||
|
|
||||||
g_game.chooseRsa(G.host)
|
g_game.chooseRsa(G.host)
|
||||||
g_game.setProtocolVersion(protocolVersion)
|
g_game.setClientVersion(clientVersion)
|
||||||
if #clientVersions > 0 then
|
g_game.setProtocolVersion(g_game.getProtocolVersionForClient(clientVersion))
|
||||||
g_game.setClientVersion(clientVersions[#clientVersions])
|
|
||||||
end
|
|
||||||
|
|
||||||
if modules.game_things.isLoaded() then
|
if modules.game_things.isLoaded() then
|
||||||
protocolLogin:login(G.host, G.port, G.account, G.password)
|
protocolLogin:login(G.host, G.port, G.account, G.password)
|
||||||
@@ -242,20 +263,16 @@ end
|
|||||||
function EnterGame.setDefaultServer(host, port, protocol)
|
function EnterGame.setDefaultServer(host, port, protocol)
|
||||||
local hostTextEdit = enterGame:getChildById('serverHostTextEdit')
|
local hostTextEdit = enterGame:getChildById('serverHostTextEdit')
|
||||||
local portTextEdit = enterGame:getChildById('serverPortTextEdit')
|
local portTextEdit = enterGame:getChildById('serverPortTextEdit')
|
||||||
local protocolLabel = enterGame:getChildById('protocolLabel')
|
local clientLabel = enterGame:getChildById('clientLabel')
|
||||||
local accountTextEdit = enterGame:getChildById('accountNameTextEdit')
|
local accountTextEdit = enterGame:getChildById('accountNameTextEdit')
|
||||||
local passwordTextEdit = enterGame:getChildById('accountPasswordTextEdit')
|
local passwordTextEdit = enterGame:getChildById('accountPasswordTextEdit')
|
||||||
|
|
||||||
if hostTextEdit:getText() ~= host then
|
if hostTextEdit:getText() ~= host then
|
||||||
hostTextEdit:setText(host)
|
hostTextEdit:setText(host)
|
||||||
portTextEdit:setText(port)
|
portTextEdit:setText(port)
|
||||||
protocolBox:setCurrentOption(protocol)
|
clientBox:setCurrentOption(protocol)
|
||||||
accountTextEdit:setText('')
|
accountTextEdit:setText('')
|
||||||
passwordTextEdit:setText('')
|
passwordTextEdit:setText('')
|
||||||
|
|
||||||
if autoLoginEvent then
|
|
||||||
autoLoginEvent:cancel()
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -269,9 +286,9 @@ function EnterGame.setUniqueServer(host, port, protocol, windowWidth, windowHeig
|
|||||||
portTextEdit:setVisible(false)
|
portTextEdit:setVisible(false)
|
||||||
portTextEdit:setHeight(0)
|
portTextEdit:setHeight(0)
|
||||||
|
|
||||||
protocolBox:setCurrentOption(protocol)
|
clientBox:setCurrentOption(protocol)
|
||||||
protocolBox:setVisible(false)
|
clientBox:setVisible(false)
|
||||||
protocolBox:setHeight(0)
|
clientBox:setHeight(0)
|
||||||
|
|
||||||
local serverLabel = enterGame:getChildById('serverLabel')
|
local serverLabel = enterGame:getChildById('serverLabel')
|
||||||
serverLabel:setVisible(false)
|
serverLabel:setVisible(false)
|
||||||
@@ -279,9 +296,14 @@ function EnterGame.setUniqueServer(host, port, protocol, windowWidth, windowHeig
|
|||||||
local portLabel = enterGame:getChildById('portLabel')
|
local portLabel = enterGame:getChildById('portLabel')
|
||||||
portLabel:setVisible(false)
|
portLabel:setVisible(false)
|
||||||
portLabel:setHeight(0)
|
portLabel:setHeight(0)
|
||||||
local protocolLabel = enterGame:getChildById('protocolLabel')
|
local clientLabel = enterGame:getChildById('clientLabel')
|
||||||
protocolLabel:setVisible(false)
|
clientLabel:setVisible(false)
|
||||||
protocolLabel:setHeight(0)
|
clientLabel:setHeight(0)
|
||||||
|
|
||||||
|
local serverListButton = enterGame:getChildById('serverListButton')
|
||||||
|
serverListButton:setVisible(false)
|
||||||
|
serverListButton:setHeight(0)
|
||||||
|
serverListButton:setWidth(0)
|
||||||
|
|
||||||
local rememberPasswordBox = enterGame:getChildById('rememberPasswordBox')
|
local rememberPasswordBox = enterGame:getChildById('rememberPasswordBox')
|
||||||
rememberPasswordBox:setMarginTop(-5)
|
rememberPasswordBox:setMarginTop(-5)
|
||||||
@@ -297,3 +319,7 @@ function EnterGame.setServerInfo(message)
|
|||||||
label:setText(message)
|
label:setText(message)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function EnterGame.disableMotd()
|
||||||
|
motdEnabled = false
|
||||||
|
motdButton:hide()
|
||||||
|
end
|
||||||
|
@@ -1,9 +1,26 @@
|
|||||||
EnterGameWindow < MainWindow
|
EnterGameWindow < MainWindow
|
||||||
|
!text: tr('Enter Game')
|
||||||
|
size: 236 274
|
||||||
|
|
||||||
|
EnterGameButton < Button
|
||||||
|
width: 64
|
||||||
|
|
||||||
|
ServerListButton < UIButton
|
||||||
|
size: 17 17
|
||||||
|
image-source: /images/topbuttons/minimap
|
||||||
|
image-color: #ffffffff
|
||||||
|
|
||||||
|
$hover !disabled:
|
||||||
|
image-color: #ffffff99
|
||||||
|
|
||||||
|
$pressed:
|
||||||
|
image-color: #ffffff44
|
||||||
|
|
||||||
|
$disabled:
|
||||||
|
image-color: #ffffff55
|
||||||
|
|
||||||
EnterGameWindow
|
EnterGameWindow
|
||||||
id: enterGame
|
id: enterGame
|
||||||
!text: tr('Enter Game')
|
|
||||||
size: 236 274
|
|
||||||
@onEnter: EnterGame.doLogin()
|
@onEnter: EnterGame.doLogin()
|
||||||
|
|
||||||
MenuLabel
|
MenuLabel
|
||||||
@@ -41,17 +58,26 @@ EnterGameWindow
|
|||||||
margin-top: 8
|
margin-top: 8
|
||||||
text-auto-resize: true
|
text-auto-resize: true
|
||||||
|
|
||||||
TextEdit
|
ServerListButton
|
||||||
id: serverHostTextEdit
|
id: serverListButton
|
||||||
!tooltip: tr('Make sure that your client uses\nthe correct game protocol version')
|
!tooltip: tr('Server list')
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.top: serverLabel.bottom
|
anchors.top: serverLabel.bottom
|
||||||
|
margin-top: 3
|
||||||
|
@onClick: ServerList.show()
|
||||||
|
|
||||||
|
TextEdit
|
||||||
|
id: serverHostTextEdit
|
||||||
|
!tooltip: tr('Make sure that your client uses\nthe correct game client version')
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: serverListButton.left
|
||||||
|
anchors.top: serverLabel.bottom
|
||||||
margin-top: 2
|
margin-top: 2
|
||||||
|
margin-right: 4
|
||||||
|
|
||||||
MenuLabel
|
MenuLabel
|
||||||
id: protocolLabel
|
id: clientLabel
|
||||||
!text: tr('Protocol')
|
!text: tr('Client Version')
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.top: serverHostTextEdit.bottom
|
anchors.top: serverHostTextEdit.bottom
|
||||||
text-auto-resize: true
|
text-auto-resize: true
|
||||||
@@ -59,10 +85,10 @@ EnterGameWindow
|
|||||||
margin-top: 8
|
margin-top: 8
|
||||||
|
|
||||||
ComboBox
|
ComboBox
|
||||||
id: protocolComboBox
|
id: clientComboBox
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.horizontalCenter
|
anchors.right: parent.horizontalCenter
|
||||||
anchors.top: protocolLabel.bottom
|
anchors.top: clientLabel.bottom
|
||||||
margin-top: 2
|
margin-top: 2
|
||||||
margin-right: 3
|
margin-right: 3
|
||||||
width: 90
|
width: 90
|
||||||
@@ -80,7 +106,7 @@ EnterGameWindow
|
|||||||
text: 7171
|
text: 7171
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.left: parent.horizontalCenter
|
anchors.left: parent.horizontalCenter
|
||||||
anchors.top: protocolComboBox.top
|
anchors.top: clientComboBox.top
|
||||||
margin-left: 3
|
margin-left: 3
|
||||||
|
|
||||||
CheckBox
|
CheckBox
|
||||||
@@ -103,9 +129,8 @@ EnterGameWindow
|
|||||||
anchors.top: prev.bottom
|
anchors.top: prev.bottom
|
||||||
margin-top: 2
|
margin-top: 2
|
||||||
|
|
||||||
Button
|
EnterGameButton
|
||||||
!text: tr('Ok')
|
!text: tr('Ok')
|
||||||
width: 64
|
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
@onClick: EnterGame.doLogin()
|
@onClick: EnterGame.doLogin()
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
MainWindow
|
MainWindow
|
||||||
id: waitingWindow
|
id: waitingWindow
|
||||||
!text: tr('Waiting List')
|
!text: tr('Waiting List')
|
||||||
size: 260 160
|
size: 260 180
|
||||||
@onEscape: CharacterList.cancelWait()
|
@onEscape: CharacterList.cancelWait()
|
||||||
|
|
||||||
Label
|
Label
|
||||||
|
@@ -121,7 +121,7 @@ function installLocale(locale)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if updatesNeeded > 0 then
|
if updatesNeeded > 0 then
|
||||||
pwarning('Locale \'' .. locale.name .. '\' is missing ' .. updatesNeeded .. ' translations.')
|
pdebug('Locale \'' .. locale.name .. '\' is missing ' .. updatesNeeded .. ' translations.')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -146,6 +146,9 @@ function setLocale(name)
|
|||||||
pwarning("Locale " .. name .. ' does not exist.')
|
pwarning("Locale " .. name .. ' does not exist.')
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
if currentLocale then
|
||||||
|
sendLocale(locale.name)
|
||||||
|
end
|
||||||
currentLocale = locale
|
currentLocale = locale
|
||||||
g_settings.set('locale', name)
|
g_settings.set('locale', name)
|
||||||
if onLocaleChanged then onLocaleChanged(name) end
|
if onLocaleChanged then onLocaleChanged(name) end
|
||||||
@@ -179,7 +182,7 @@ function _G.tr(text, ...)
|
|||||||
if not translation then
|
if not translation then
|
||||||
if translation == nil then
|
if translation == nil then
|
||||||
if currentLocale.name ~= defaultLocaleName then
|
if currentLocale.name ~= defaultLocaleName then
|
||||||
pwarning('Unable to translate: \"' .. text .. '\"')
|
pdebug('Unable to translate: \"' .. text .. '\"')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
translation = text
|
translation = text
|
||||||
|
@@ -5,6 +5,5 @@ Module
|
|||||||
website: www.otclient.info
|
website: www.otclient.info
|
||||||
sandboxed: true
|
sandboxed: true
|
||||||
scripts: [ locales ]
|
scripts: [ locales ]
|
||||||
dependencies: [ client_topmenu ]
|
|
||||||
@onLoad: init()
|
@onLoad: init()
|
||||||
@onUnload: terminate()
|
@onUnload: terminate()
|
||||||
|
@@ -137,7 +137,7 @@ function unloadCurrentModule()
|
|||||||
local module = g_modules.getModule(focusedChild:getText())
|
local module = g_modules.getModule(focusedChild:getText())
|
||||||
if module then
|
if module then
|
||||||
module:unload()
|
module:unload()
|
||||||
if ModuleManager == nil then return end
|
if modules.client_modulemanager == nil then return end
|
||||||
updateModuleInfo(module:getName())
|
updateModuleInfo(module:getName())
|
||||||
refreshLoadedModules()
|
refreshLoadedModules()
|
||||||
end
|
end
|
||||||
|
@@ -1,11 +1,3 @@
|
|||||||
VolumeScrollbar < HorizontalScrollBar
|
|
||||||
step: 1
|
|
||||||
@onValueChange: modules.client_options.setOption(self:getId(), self:getValue())
|
|
||||||
@onSetup: |
|
|
||||||
UIScrollBar.onSetup(self)
|
|
||||||
local value = modules.client_options.getOption(self:getId())
|
|
||||||
self:setValue(value)
|
|
||||||
|
|
||||||
Panel
|
Panel
|
||||||
OptionCheckBox
|
OptionCheckBox
|
||||||
id: enableAudio
|
id: enableAudio
|
||||||
@@ -26,7 +18,7 @@ Panel
|
|||||||
local value = modules.client_options.getOption('musicSoundVolume')
|
local value = modules.client_options.getOption('musicSoundVolume')
|
||||||
self:setText(tr('Music volume: %d', value))
|
self:setText(tr('Music volume: %d', value))
|
||||||
|
|
||||||
VolumeScrollbar
|
OptionScrollbar
|
||||||
id: musicSoundVolume
|
id: musicSoundVolume
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
@@ -12,6 +12,11 @@ Panel
|
|||||||
!text: tr('Enable smart walking')
|
!text: tr('Enable smart walking')
|
||||||
!tooltip: tr('Will detect when to use diagonal step based on the\nkeys you are pressing')
|
!tooltip: tr('Will detect when to use diagonal step based on the\nkeys you are pressing')
|
||||||
|
|
||||||
|
OptionCheckBox
|
||||||
|
id: dashWalk
|
||||||
|
!text: tr('Enable dash walking')
|
||||||
|
!tooltip: tr('Will boost your walk on high speed characters')
|
||||||
|
|
||||||
OptionCheckBox
|
OptionCheckBox
|
||||||
id: showPing
|
id: showPing
|
||||||
!text: tr('Show connection ping')
|
!text: tr('Show connection ping')
|
||||||
|
@@ -1,12 +1,3 @@
|
|||||||
FrameRateScrollbar < HorizontalScrollBar
|
|
||||||
step: 1
|
|
||||||
@onValueChange: modules.client_options.setOption(self:getId(), self:getValue())
|
|
||||||
@onSetup: |
|
|
||||||
UIScrollBar.onSetup(self)
|
|
||||||
local value = modules.client_options.getOption(self:getId())
|
|
||||||
if value == 0 then value = self:getMaximum() end
|
|
||||||
self:setValue(value)
|
|
||||||
|
|
||||||
Panel
|
Panel
|
||||||
ButtonBox
|
ButtonBox
|
||||||
id: opengl1
|
id: opengl1
|
||||||
@@ -48,6 +39,10 @@ Panel
|
|||||||
id: fullscreen
|
id: fullscreen
|
||||||
!text: tr('Fullscreen')
|
!text: tr('Fullscreen')
|
||||||
tooltip: Ctrl+Shift+F
|
tooltip: Ctrl+Shift+F
|
||||||
|
|
||||||
|
OptionCheckBox
|
||||||
|
id: dontStretchShrink
|
||||||
|
!text: tr('Don\'t stretch/shrink Game Window')
|
||||||
|
|
||||||
Label
|
Label
|
||||||
id: backgroundFrameRateLabel
|
id: backgroundFrameRateLabel
|
||||||
@@ -55,7 +50,7 @@ Panel
|
|||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.top: prev.bottom
|
anchors.top: prev.bottom
|
||||||
margin-top: 6
|
margin-top: 12
|
||||||
@onSetup: |
|
@onSetup: |
|
||||||
local value = modules.client_options.getOption('backgroundFrameRate')
|
local value = modules.client_options.getOption('backgroundFrameRate')
|
||||||
local text = value
|
local text = value
|
||||||
@@ -65,7 +60,7 @@ Panel
|
|||||||
|
|
||||||
self:setText(tr('Game framerate limit: %s', text))
|
self:setText(tr('Game framerate limit: %s', text))
|
||||||
|
|
||||||
FrameRateScrollbar
|
OptionScrollbar
|
||||||
id: backgroundFrameRate
|
id: backgroundFrameRate
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
@@ -89,7 +84,7 @@ Panel
|
|||||||
|
|
||||||
self:setText(tr('Interface framerate limit: %s', text))
|
self:setText(tr('Interface framerate limit: %s', text))
|
||||||
|
|
||||||
FrameRateScrollbar
|
OptionScrollbar
|
||||||
id: foregroundFrameRate
|
id: foregroundFrameRate
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
@@ -108,7 +103,7 @@ Panel
|
|||||||
local value = modules.client_options.getOption('ambientLight')
|
local value = modules.client_options.getOption('ambientLight')
|
||||||
self:setText(tr('Ambient light: %s%%', value))
|
self:setText(tr('Ambient light: %s%%', value))
|
||||||
|
|
||||||
FrameRateScrollbar
|
OptionScrollbar
|
||||||
id: ambientLight
|
id: ambientLight
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
@@ -5,6 +5,7 @@ local defaultOptions = {
|
|||||||
fullscreen = false,
|
fullscreen = false,
|
||||||
classicControl = false,
|
classicControl = false,
|
||||||
smartWalk = false,
|
smartWalk = false,
|
||||||
|
dashWalk = false,
|
||||||
autoChaseOverride = true,
|
autoChaseOverride = true,
|
||||||
showStatusMessagesInConsole = true,
|
showStatusMessagesInConsole = true,
|
||||||
showEventMessagesInConsole = true,
|
showEventMessagesInConsole = true,
|
||||||
@@ -24,7 +25,8 @@ local defaultOptions = {
|
|||||||
ambientLight = 25,
|
ambientLight = 25,
|
||||||
displayNames = true,
|
displayNames = true,
|
||||||
displayHealth = true,
|
displayHealth = true,
|
||||||
displayText = true
|
displayText = true,
|
||||||
|
dontStretchShrink = false
|
||||||
}
|
}
|
||||||
|
|
||||||
local optionsWindow
|
local optionsWindow
|
||||||
@@ -81,45 +83,20 @@ local function setupGraphicsEngines()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function init()
|
function init()
|
||||||
|
for k,v in pairs(defaultOptions) do
|
||||||
|
g_settings.setDefault(k, v)
|
||||||
|
options[k] = v
|
||||||
|
end
|
||||||
|
|
||||||
optionsWindow = g_ui.displayUI('options')
|
optionsWindow = g_ui.displayUI('options')
|
||||||
optionsWindow:hide()
|
optionsWindow:hide()
|
||||||
optionsButton = modules.client_topmenu.addLeftButton('optionsButton', tr('Options'), '/images/topbuttons/options', toggle)
|
|
||||||
|
|
||||||
optionsTabBar = optionsWindow:getChildById('optionsTabBar')
|
optionsTabBar = optionsWindow:getChildById('optionsTabBar')
|
||||||
optionsTabBar:setContentWidget(optionsWindow:getChildById('optionsTabContent'))
|
optionsTabBar:setContentWidget(optionsWindow:getChildById('optionsTabContent'))
|
||||||
|
|
||||||
addEvent(function() setup() end)
|
|
||||||
|
|
||||||
g_keyboard.bindKeyDown('Ctrl+Shift+F', function() toggleOption('fullscreen') end)
|
g_keyboard.bindKeyDown('Ctrl+Shift+F', function() toggleOption('fullscreen') end)
|
||||||
g_keyboard.bindKeyDown('Ctrl+N', toggleDisplays)
|
g_keyboard.bindKeyDown('Ctrl+N', toggleDisplays)
|
||||||
|
|
||||||
audioButton = modules.client_topmenu.addLeftButton('audioButton', tr('Audio'), '/images/topbuttons/audio', function() toggleOption('enableAudio') end)
|
|
||||||
end
|
|
||||||
|
|
||||||
function terminate()
|
|
||||||
g_keyboard.unbindKeyDown('Ctrl+Shift+F')
|
|
||||||
g_keyboard.unbindKeyDown('Ctrl+N')
|
|
||||||
optionsWindow:destroy()
|
|
||||||
optionsButton:destroy()
|
|
||||||
audioButton:destroy()
|
|
||||||
optionsTabBar = nil
|
|
||||||
generalPanel = nil
|
|
||||||
consolePanel = nil
|
|
||||||
graphicsPanel = nil
|
|
||||||
audioPanel = nil
|
|
||||||
end
|
|
||||||
|
|
||||||
function setup()
|
|
||||||
-- load options
|
|
||||||
for k,v in pairs(defaultOptions) do
|
|
||||||
g_settings.setDefault(k, v)
|
|
||||||
if type(v) == 'boolean' then
|
|
||||||
setOption(k, g_settings.getBoolean(k))
|
|
||||||
elseif type(v) == 'number' then
|
|
||||||
setOption(k, g_settings.getNumber(k))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
generalPanel = g_ui.loadUI('game')
|
generalPanel = g_ui.loadUI('game')
|
||||||
optionsTabBar:addTab(tr('Game'), generalPanel, '/images/optionstab/game')
|
optionsTabBar:addTab(tr('Game'), generalPanel, '/images/optionstab/game')
|
||||||
|
|
||||||
@@ -132,7 +109,31 @@ function setup()
|
|||||||
audioPanel = g_ui.loadUI('audio')
|
audioPanel = g_ui.loadUI('audio')
|
||||||
optionsTabBar:addTab(tr('Audio'), audioPanel, '/images/optionstab/audio')
|
optionsTabBar:addTab(tr('Audio'), audioPanel, '/images/optionstab/audio')
|
||||||
|
|
||||||
|
optionsButton = modules.client_topmenu.addLeftButton('optionsButton', tr('Options'), '/images/topbuttons/options', toggle)
|
||||||
|
audioButton = modules.client_topmenu.addLeftButton('audioButton', tr('Audio'), '/images/topbuttons/audio', function() toggleOption('enableAudio') end)
|
||||||
|
|
||||||
|
addEvent(function() setup() end)
|
||||||
|
end
|
||||||
|
|
||||||
|
function terminate()
|
||||||
|
g_keyboard.unbindKeyDown('Ctrl+Shift+F')
|
||||||
|
g_keyboard.unbindKeyDown('Ctrl+N')
|
||||||
|
optionsWindow:destroy()
|
||||||
|
optionsButton:destroy()
|
||||||
|
audioButton:destroy()
|
||||||
|
end
|
||||||
|
|
||||||
|
function setup()
|
||||||
setupGraphicsEngines()
|
setupGraphicsEngines()
|
||||||
|
|
||||||
|
-- load options
|
||||||
|
for k,v in pairs(defaultOptions) do
|
||||||
|
if type(v) == 'boolean' then
|
||||||
|
setOption(k, g_settings.getBoolean(k), true)
|
||||||
|
elseif type(v) == 'number' then
|
||||||
|
setOption(k, g_settings.getNumber(k), true)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function toggle()
|
function toggle()
|
||||||
@@ -171,106 +172,74 @@ function toggleOption(key)
|
|||||||
setOption(key, not getOption(key))
|
setOption(key, not getOption(key))
|
||||||
end
|
end
|
||||||
|
|
||||||
function setOption(key, value)
|
function setOption(key, value, force)
|
||||||
if options[key] == value then return end
|
if not force and options[key] == value then return end
|
||||||
local gameMapPanel = modules.game_interface.getMapPanel()
|
local gameMapPanel = modules.game_interface.getMapPanel()
|
||||||
|
|
||||||
local panel = nil
|
|
||||||
if key == 'vsync' then
|
if key == 'vsync' then
|
||||||
g_window.setVerticalSync(value)
|
g_window.setVerticalSync(value)
|
||||||
elseif key == 'showFps' then
|
elseif key == 'showFps' then
|
||||||
addEvent(function()
|
modules.client_topmenu.setFpsVisible(value)
|
||||||
local frameCounter = rootWidget:recursiveGetChildById('frameCounter')
|
|
||||||
if frameCounter then frameCounter:setVisible(value) end
|
|
||||||
end)
|
|
||||||
elseif key == 'showPing' then
|
elseif key == 'showPing' then
|
||||||
addEvent(function()
|
modules.client_topmenu.setPingVisible(value)
|
||||||
local ping = rootWidget:recursiveGetChildById('pingLabel')
|
|
||||||
if ping then ping:setVisible(value) end
|
|
||||||
end)
|
|
||||||
elseif key == 'fullscreen' then
|
elseif key == 'fullscreen' then
|
||||||
g_window.setFullscreen(value)
|
g_window.setFullscreen(value)
|
||||||
panel = graphicsPanel
|
|
||||||
elseif key == 'enableAudio' then
|
elseif key == 'enableAudio' then
|
||||||
g_sounds.setAudioEnabled(value)
|
g_sounds.setAudioEnabled(value)
|
||||||
addEvent(function()
|
if value then
|
||||||
if value then
|
audioButton:setIcon('/images/topbuttons/audio')
|
||||||
audioButton:setIcon('/images/topbuttons/audio')
|
else
|
||||||
else
|
audioButton:setIcon('/images/topbuttons/audio_mute')
|
||||||
audioButton:setIcon('/images/topbuttons/audio_mute')
|
end
|
||||||
end
|
|
||||||
end)
|
|
||||||
panel = audioPanel
|
|
||||||
elseif key == 'enableMusicSound' then
|
elseif key == 'enableMusicSound' then
|
||||||
g_sounds.getChannel(SoundChannels.Music):setEnabled(value)
|
g_sounds.getChannel(SoundChannels.Music):setEnabled(value)
|
||||||
elseif key == 'musicSoundVolume' then
|
elseif key == 'musicSoundVolume' then
|
||||||
g_sounds.getChannel(SoundChannels.Music):setGain(value/100)
|
g_sounds.getChannel(SoundChannels.Music):setGain(value/100)
|
||||||
if audioPanel then
|
audioPanel:getChildById('musicSoundVolumeLabel'):setText(tr('Music volume: %d', value))
|
||||||
audioPanel:getChildById('musicSoundVolumeLabel'):setText(tr('Music volume: %d', value))
|
|
||||||
end
|
|
||||||
elseif key == 'showLeftPanel' then
|
elseif key == 'showLeftPanel' then
|
||||||
addEvent(function()
|
modules.game_interface.getLeftPanel():setOn(value)
|
||||||
modules.game_interface.getLeftPanel():setOn(value)
|
|
||||||
end)
|
|
||||||
elseif key == 'backgroundFrameRate' then
|
elseif key == 'backgroundFrameRate' then
|
||||||
local text = value
|
local text, v = value, value
|
||||||
if value <= 0 or value >= 201 then
|
if value <= 0 or value >= 201 then text = 'max' v = 0 end
|
||||||
text = 'max'
|
graphicsPanel:getChildById('backgroundFrameRateLabel'):setText(tr('Game framerate limit: %s', text))
|
||||||
value = 0
|
g_app.setBackgroundPaneMaxFps(v)
|
||||||
end
|
|
||||||
|
|
||||||
if graphicsPanel then
|
|
||||||
graphicsPanel:getChildById('backgroundFrameRateLabel'):setText(tr('Game framerate limit: %s', text))
|
|
||||||
end
|
|
||||||
g_app.setBackgroundPaneMaxFps(value)
|
|
||||||
elseif key == 'foregroundFrameRate' then
|
elseif key == 'foregroundFrameRate' then
|
||||||
local text = value
|
local text, v = value, value
|
||||||
if value <= 0 or value >= 61 then
|
if value <= 0 or value >= 61 then text = 'max' v = 0 end
|
||||||
text = 'max'
|
graphicsPanel:getChildById('foregroundFrameRateLabel'):setText(tr('Interface framerate limit: %s', text))
|
||||||
value = 0
|
g_app.setForegroundPaneMaxFps(v)
|
||||||
end
|
|
||||||
|
|
||||||
if graphicsPanel then
|
|
||||||
graphicsPanel:getChildById('foregroundFrameRateLabel'):setText(tr('Interface framerate limit: %s', text))
|
|
||||||
end
|
|
||||||
g_app.setForegroundPaneMaxFps(value)
|
|
||||||
elseif key == 'enableLights' then
|
elseif key == 'enableLights' then
|
||||||
addEvent(function()
|
gameMapPanel:setDrawLights(value and options['ambientLight'] < 100)
|
||||||
local map = modules.game_interface.getMapPanel()
|
graphicsPanel:getChildById('ambientLight'):setEnabled(value)
|
||||||
map:setDrawLights(value and options['ambientLight'] < 100)
|
graphicsPanel:getChildById('ambientLightLabel'):setEnabled(value)
|
||||||
|
|
||||||
if graphicsPanel then
|
|
||||||
graphicsPanel:getChildById('ambientLight'):setEnabled(value)
|
|
||||||
graphicsPanel:getChildById('ambientLightLabel'):setEnabled(value)
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
elseif key == 'ambientLight' then
|
elseif key == 'ambientLight' then
|
||||||
addEvent(function()
|
graphicsPanel:getChildById('ambientLightLabel'):setText(tr('Ambient light: %s%%', value))
|
||||||
local map = modules.game_interface.getMapPanel()
|
gameMapPanel:setMinimumAmbientLight(value/100)
|
||||||
if graphicsPanel then
|
gameMapPanel:setDrawLights(options['enableLights'] and value < 100)
|
||||||
graphicsPanel:getChildById('ambientLightLabel'):setText(tr('Ambient light: %s%%', value))
|
|
||||||
end
|
|
||||||
map:setMinimumAmbientLight(value/100)
|
|
||||||
map:setDrawLights(options['enableLights'] and value < 100)
|
|
||||||
end)
|
|
||||||
elseif key == 'painterEngine' then
|
elseif key == 'painterEngine' then
|
||||||
g_graphics.selectPainterEngine(value)
|
g_graphics.selectPainterEngine(value)
|
||||||
elseif key == 'displayNames' then
|
elseif key == 'displayNames' then
|
||||||
gameMapPanel:setDrawNames(value)
|
gameMapPanel:setDrawNames(value)
|
||||||
panel = generalPanel
|
|
||||||
elseif key == 'displayHealth' then
|
elseif key == 'displayHealth' then
|
||||||
gameMapPanel:setDrawHealthBars(value)
|
gameMapPanel:setDrawHealthBars(value)
|
||||||
panel = generalPanel
|
|
||||||
elseif key == 'displayText' then
|
elseif key == 'displayText' then
|
||||||
gameMapPanel:setDrawTexts(value)
|
gameMapPanel:setDrawTexts(value)
|
||||||
panel = generalPanel
|
elseif key == 'dontStretchShrink' then
|
||||||
|
addEvent(function()
|
||||||
|
modules.game_interface.updateStretchShrink()
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- change value for keybind updates
|
-- change value for keybind updates
|
||||||
if panel then
|
for _,panel in pairs(optionsTabBar:getTabsPanel()) do
|
||||||
local widget = panel:recursiveGetChildById(key)
|
local widget = panel:recursiveGetChildById(key)
|
||||||
if widget and widget:getStyle().__class == 'UICheckBox' then
|
if widget then
|
||||||
widget:setChecked(value)
|
if widget:getStyle().__class == 'UICheckBox' then
|
||||||
|
widget:setChecked(value)
|
||||||
|
elseif widget:getStyle().__class == 'UIScrollBar' then
|
||||||
|
widget:setValue(value)
|
||||||
|
end
|
||||||
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@@ -4,7 +4,6 @@ Module
|
|||||||
author: edubart, BeniS
|
author: edubart, BeniS
|
||||||
website: www.otclient.info
|
website: www.otclient.info
|
||||||
sandboxed: true
|
sandboxed: true
|
||||||
dependencies: [ client_topmenu ]
|
|
||||||
scripts: [ options ]
|
scripts: [ options ]
|
||||||
@onLoad: init()
|
@onLoad: init()
|
||||||
@onUnload: terminate()
|
@onUnload: terminate()
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
OptionCheckBox < CheckBox
|
OptionCheckBox < CheckBox
|
||||||
@onCheckChange: modules.client_options.setOption(self:getId(), self:isChecked())
|
@onCheckChange: modules.client_options.setOption(self:getId(), self:isChecked())
|
||||||
@onSetup: self:setChecked(modules.client_options.getOption(self:getId()))
|
|
||||||
height: 16
|
height: 16
|
||||||
|
|
||||||
$first:
|
$first:
|
||||||
@@ -14,6 +13,10 @@ OptionCheckBox < CheckBox
|
|||||||
anchors.top: prev.bottom
|
anchors.top: prev.bottom
|
||||||
margin-top: 2
|
margin-top: 2
|
||||||
|
|
||||||
|
OptionScrollbar < HorizontalScrollBar
|
||||||
|
step: 1
|
||||||
|
@onValueChange: modules.client_options.setOption(self:getId(), self:getValue())
|
||||||
|
|
||||||
MainWindow
|
MainWindow
|
||||||
id: optionsWindow
|
id: optionsWindow
|
||||||
!text: tr('Options')
|
!text: tr('Options')
|
||||||
|
38
modules/client_serverlist/addserver.lua
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
AddServer = {}
|
||||||
|
|
||||||
|
-- private variables
|
||||||
|
local addServerWindow = nil
|
||||||
|
|
||||||
|
-- public functions
|
||||||
|
function AddServer.init()
|
||||||
|
addServerWindow = g_ui.displayUI('addserver')
|
||||||
|
end
|
||||||
|
|
||||||
|
function AddServer.terminate()
|
||||||
|
addServerWindow:destroy()
|
||||||
|
end
|
||||||
|
|
||||||
|
function AddServer.add()
|
||||||
|
local host = addServerWindow:getChildById('host'):getText()
|
||||||
|
local port = addServerWindow:getChildById('port'):getText()
|
||||||
|
local protocol = addServerWindow:getChildById('protocol'):getCurrentOption().text
|
||||||
|
|
||||||
|
local added, error = ServerList.add(host, port, protocol)
|
||||||
|
if not added then
|
||||||
|
displayErrorBox(tr('Add Error'), tr(error))
|
||||||
|
else
|
||||||
|
AddServer.hide()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function AddServer.show()
|
||||||
|
addServerWindow:show()
|
||||||
|
addServerWindow:raise()
|
||||||
|
addServerWindow:focus()
|
||||||
|
addServerWindow:lock()
|
||||||
|
end
|
||||||
|
|
||||||
|
function AddServer.hide()
|
||||||
|
addServerWindow:hide()
|
||||||
|
addServerWindow:unlock()
|
||||||
|
end
|
72
modules/client_serverlist/addserver.otui
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
MainWindow
|
||||||
|
id: addServerWindow
|
||||||
|
!text: tr('New Server')
|
||||||
|
size: 180 180
|
||||||
|
visible: false
|
||||||
|
@onEscape: AddServer.hide()
|
||||||
|
@onEnter: AddServer.add()
|
||||||
|
|
||||||
|
Label
|
||||||
|
id: hostLabel
|
||||||
|
!text: tr('Host') .. ':'
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.left: parent.left
|
||||||
|
margin-bottom: 2
|
||||||
|
|
||||||
|
TextEdit
|
||||||
|
id: host
|
||||||
|
anchors.top: hostLabel.bottom
|
||||||
|
anchors.left: hostLabel.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
auto-focus: first
|
||||||
|
|
||||||
|
Label
|
||||||
|
id: portLabel
|
||||||
|
!text: tr('Port') .. ':'
|
||||||
|
anchors.top: host.bottom
|
||||||
|
anchors.left: host.left
|
||||||
|
margin-top: 3
|
||||||
|
margin-bottom: 2
|
||||||
|
|
||||||
|
TextEdit
|
||||||
|
id: port
|
||||||
|
text: 7171
|
||||||
|
anchors.top: portLabel.bottom
|
||||||
|
anchors.left: portLabel.left
|
||||||
|
anchors.right: host.right
|
||||||
|
|
||||||
|
Label
|
||||||
|
id: protocolLabel
|
||||||
|
!text: tr('Protocol') .. ':'
|
||||||
|
anchors.top: port.bottom
|
||||||
|
anchors.left: port.left
|
||||||
|
margin-top: 3
|
||||||
|
margin-bottom: 2
|
||||||
|
|
||||||
|
ComboBox
|
||||||
|
id: protocol
|
||||||
|
anchors.top: protocolLabel.bottom
|
||||||
|
anchors.left: protocolLabel.left
|
||||||
|
anchors.right: port.right
|
||||||
|
@onSetup: |
|
||||||
|
for _, proto in pairs(g_game.getSupportedClients()) do
|
||||||
|
self:addOption(proto)
|
||||||
|
end
|
||||||
|
|
||||||
|
Button
|
||||||
|
id: buttonAdd
|
||||||
|
!text: tr('Add')
|
||||||
|
width: 64
|
||||||
|
anchors.right: parent.horizontalCenter
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
margin-right: 2
|
||||||
|
@onClick: AddServer.add()
|
||||||
|
|
||||||
|
Button
|
||||||
|
id: buttonCancel
|
||||||
|
!text: tr('Cancel')
|
||||||
|
width: 64
|
||||||
|
anchors.left: parent.horizontalCenter
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
margin-left: 2
|
||||||
|
@onClick: AddServer.hide()
|
128
modules/client_serverlist/serverlist.lua
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
ServerList = {}
|
||||||
|
|
||||||
|
-- private variables
|
||||||
|
local serverListWindow = nil
|
||||||
|
local serverTextList = nil
|
||||||
|
local removeWindow = nil
|
||||||
|
local servers = {}
|
||||||
|
|
||||||
|
-- public functions
|
||||||
|
function ServerList.init()
|
||||||
|
serverListWindow = g_ui.displayUI('serverlist')
|
||||||
|
serverTextList = serverListWindow:getChildById('serverList')
|
||||||
|
|
||||||
|
servers = g_settings.getNode('ServerList') or {}
|
||||||
|
ServerList.load()
|
||||||
|
end
|
||||||
|
|
||||||
|
function ServerList.terminate()
|
||||||
|
ServerList.destroy()
|
||||||
|
|
||||||
|
g_settings.setNode('ServerList', servers)
|
||||||
|
|
||||||
|
ServerList = nil
|
||||||
|
end
|
||||||
|
|
||||||
|
function ServerList.load()
|
||||||
|
for k,server in pairs(servers) do
|
||||||
|
ServerList.add(k, server.port, server.protocol, true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function ServerList.select()
|
||||||
|
local selected = serverTextList:getFocusedChild()
|
||||||
|
if selected then
|
||||||
|
local server = servers[selected:getId()]
|
||||||
|
if server then
|
||||||
|
EnterGame.setDefaultServer(selected:getId(), server.port, server.protocol)
|
||||||
|
EnterGame.setAccountName(server.account)
|
||||||
|
EnterGame.setPassword(server.password)
|
||||||
|
ServerList.hide()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function ServerList.add(host, port, protocol, load)
|
||||||
|
if not load and servers[host] then
|
||||||
|
return false, 'Server already exists'
|
||||||
|
elseif host == '' or port == '' then
|
||||||
|
return false, 'Required fields are missing'
|
||||||
|
end
|
||||||
|
local widget = g_ui.createWidget('ServerWidget', serverTextList)
|
||||||
|
widget:setId(host)
|
||||||
|
|
||||||
|
if not load then
|
||||||
|
servers[host] = {
|
||||||
|
port = port,
|
||||||
|
protocol = protocol,
|
||||||
|
account = '',
|
||||||
|
password = ''
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
local details = widget:getChildById('details')
|
||||||
|
details:setText(host..':'..port)
|
||||||
|
|
||||||
|
local proto = widget:getChildById('protocol')
|
||||||
|
proto:setText(protocol)
|
||||||
|
|
||||||
|
connect(widget, { onDoubleClick = function () ServerList.select() return true end } )
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
function ServerList.remove(widget)
|
||||||
|
local host = widget:getId()
|
||||||
|
|
||||||
|
if removeWindow then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local yesCallback = function()
|
||||||
|
widget:destroy()
|
||||||
|
servers[host] = nil
|
||||||
|
removeWindow:destroy()
|
||||||
|
removeWindow=nil
|
||||||
|
end
|
||||||
|
local noCallback = function()
|
||||||
|
removeWindow:destroy()
|
||||||
|
removeWindow=nil
|
||||||
|
end
|
||||||
|
|
||||||
|
removeWindow = displayGeneralBox(tr('Remove'), tr('Remove '..host..'?'), {
|
||||||
|
{ text=tr('Yes'), callback=yesCallback },
|
||||||
|
{ text=tr('No'), callback=noCallback },
|
||||||
|
anchor=AnchorHorizontalCenter}, yesCallback, noCallback)
|
||||||
|
end
|
||||||
|
|
||||||
|
function ServerList.destroy()
|
||||||
|
if serverListWindow then
|
||||||
|
serverTextList = nil
|
||||||
|
serverListWindow:destroy()
|
||||||
|
serverListWindow = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function ServerList.show()
|
||||||
|
if g_game.isOnline() then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
serverListWindow:show()
|
||||||
|
serverListWindow:raise()
|
||||||
|
serverListWindow:focus()
|
||||||
|
end
|
||||||
|
|
||||||
|
function ServerList.hide()
|
||||||
|
serverListWindow:hide()
|
||||||
|
end
|
||||||
|
|
||||||
|
function ServerList.setServerAccount(host, account)
|
||||||
|
if servers[host] then
|
||||||
|
servers[host].account = account
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function ServerList.setServerPassword(host, password)
|
||||||
|
if servers[host] then
|
||||||
|
servers[host].password = password
|
||||||
|
end
|
||||||
|
end
|
18
modules/client_serverlist/serverlist.otmod
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
Module
|
||||||
|
name: client_serverlist
|
||||||
|
description: Manages a server list of previously entered servers
|
||||||
|
author: BeniS
|
||||||
|
website: www.otclient.info
|
||||||
|
|
||||||
|
dependencies:
|
||||||
|
- client_entergame
|
||||||
|
|
||||||
|
@onLoad: |
|
||||||
|
dofile 'serverlist'
|
||||||
|
dofile 'addserver'
|
||||||
|
ServerList.init()
|
||||||
|
AddServer.init()
|
||||||
|
|
||||||
|
@onUnload: |
|
||||||
|
ServerList.terminate()
|
||||||
|
AddServer.terminate()
|
110
modules/client_serverlist/serverlist.otui
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
ServerWidget < UIWidget
|
||||||
|
height: 14
|
||||||
|
background-color: alpha
|
||||||
|
&updateOnStates: |
|
||||||
|
function(self)
|
||||||
|
local children = self:getChildren()
|
||||||
|
for i=1,#children do
|
||||||
|
children[i]:setOn(self:isFocused())
|
||||||
|
end
|
||||||
|
end
|
||||||
|
@onFocusChange: self:updateOnStates()
|
||||||
|
@onSetup: self:updateOnStates()
|
||||||
|
|
||||||
|
$focus:
|
||||||
|
background-color: #ffffff22
|
||||||
|
|
||||||
|
Label
|
||||||
|
id: details
|
||||||
|
color: #aaaaaa
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.left: parent.left
|
||||||
|
font: verdana-11px-monochrome
|
||||||
|
text-auto-resize: true
|
||||||
|
background-color: alpha
|
||||||
|
text-offset: 2 0
|
||||||
|
|
||||||
|
$on:
|
||||||
|
color: #ffffff
|
||||||
|
|
||||||
|
Label
|
||||||
|
id: protocol
|
||||||
|
color: #ffffff
|
||||||
|
color: #aaaaaa
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.right: next.left
|
||||||
|
margin-right: 5
|
||||||
|
font: verdana-11px-monochrome
|
||||||
|
text-auto-resize: true
|
||||||
|
background-color: alpha
|
||||||
|
&baseText: '(%s)'
|
||||||
|
|
||||||
|
$on:
|
||||||
|
color: #ffffff
|
||||||
|
|
||||||
|
Button
|
||||||
|
id: remove
|
||||||
|
text: x
|
||||||
|
width: 12
|
||||||
|
height: 12
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.right: parent.right
|
||||||
|
margin-right: 4
|
||||||
|
margin-top: 1
|
||||||
|
@onClick: ServerList.remove(self:getParent())
|
||||||
|
|
||||||
|
MainWindow
|
||||||
|
id: serverListWindow
|
||||||
|
!text: tr('Server List')
|
||||||
|
size: 340 290
|
||||||
|
visible: false
|
||||||
|
@onEnter: ServerList.select()
|
||||||
|
@onEscape: ServerList.hide()
|
||||||
|
@onSetup: |
|
||||||
|
g_keyboard.bindKeyPress('Up', function() self:getChildById('serverList'):focusPreviousChild(KeyboardFocusReason) end, self)
|
||||||
|
g_keyboard.bindKeyPress('Down', function() self:getChildById('serverList'):focusNextChild(KeyboardFocusReason) end, self)
|
||||||
|
|
||||||
|
TextList
|
||||||
|
id: serverList
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: serverListScrollBar.left
|
||||||
|
anchors.bottom: buttonOk.top
|
||||||
|
margin-bottom: 5
|
||||||
|
padding: 1
|
||||||
|
focusable: false
|
||||||
|
vertical-scrollbar: serverListScrollBar
|
||||||
|
auto-focus: first
|
||||||
|
|
||||||
|
VerticalScrollBar
|
||||||
|
id: serverListScrollBar
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.bottom: buttonOk.top
|
||||||
|
anchors.right: parent.right
|
||||||
|
margin-bottom: 5
|
||||||
|
step: 14
|
||||||
|
pixels-scroll: true
|
||||||
|
|
||||||
|
AddButton
|
||||||
|
id: buttonAdd
|
||||||
|
!tooltip: tr('Add new server')
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
@onClick: AddServer.show()
|
||||||
|
|
||||||
|
Button
|
||||||
|
id: buttonOk
|
||||||
|
!text: tr('Select')
|
||||||
|
width: 64
|
||||||
|
anchors.right: next.left
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
margin-right: 10
|
||||||
|
@onClick: ServerList.select()
|
||||||
|
|
||||||
|
Button
|
||||||
|
id: buttonCancel
|
||||||
|
!text: tr('Cancel')
|
||||||
|
width: 64
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
@onClick: ServerList.hide()
|
@@ -25,6 +25,8 @@ end
|
|||||||
function terminate()
|
function terminate()
|
||||||
disconnect(g_game, { onGameStart = onGameStart,
|
disconnect(g_game, { onGameStart = onGameStart,
|
||||||
onGameEnd = onGameEnd })
|
onGameEnd = onGameEnd })
|
||||||
|
removeEvent(firstReportEvent)
|
||||||
|
removeEvent(sendReportEvent)
|
||||||
end
|
end
|
||||||
|
|
||||||
function configure(host, port, delay)
|
function configure(host, port, delay)
|
||||||
@@ -45,13 +47,15 @@ end
|
|||||||
|
|
||||||
function onGameStart()
|
function onGameStart()
|
||||||
if not HOST then return end
|
if not HOST then return end
|
||||||
|
removeEvent(firstReportEvent)
|
||||||
|
removeEvent(sendReportEvent)
|
||||||
firstReportEvent = addEvent(sendReport, FIRST_REPORT_DELAY*1000)
|
firstReportEvent = addEvent(sendReport, FIRST_REPORT_DELAY*1000)
|
||||||
sendReportEvent = cycleEvent(sendReport, REPORT_DELAY*1000)
|
sendReportEvent = cycleEvent(sendReport, REPORT_DELAY*1000)
|
||||||
end
|
end
|
||||||
|
|
||||||
function onGameEnd()
|
function onGameEnd()
|
||||||
removeEvent(sendReportEvent)
|
|
||||||
removeEvent(firstReportEvent)
|
removeEvent(firstReportEvent)
|
||||||
|
removeEvent(sendReportEvent)
|
||||||
end
|
end
|
||||||
|
|
||||||
function onConnect(protocol)
|
function onConnect(protocol)
|
||||||
@@ -75,6 +79,10 @@ function onConnect(protocol)
|
|||||||
post = post .. '&window_height=' .. g_window.getHeight()
|
post = post .. '&window_height=' .. g_window.getHeight()
|
||||||
post = post .. '&player_name=' .. g_game.getCharacterName()
|
post = post .. '&player_name=' .. g_game.getCharacterName()
|
||||||
post = post .. '&world_name=' .. g_game.getWorldName()
|
post = post .. '&world_name=' .. g_game.getWorldName()
|
||||||
|
post = post .. '&otserv_host=' .. G.host
|
||||||
|
post = post .. '&otserv_port=' .. G.port
|
||||||
|
post = post .. '&otserv_protocol=' .. g_game.getProtocolVersion()
|
||||||
|
post = post .. '&otserv_client=' .. g_game.getClientVersion()
|
||||||
post = post .. '&build_version=' .. g_app.getVersion()
|
post = post .. '&build_version=' .. g_app.getVersion()
|
||||||
post = post .. '&build_revision=' .. g_app.getBuildRevision()
|
post = post .. '&build_revision=' .. g_app.getBuildRevision()
|
||||||
post = post .. '&build_commit=' .. g_app.getBuildCommit()
|
post = post .. '&build_commit=' .. g_app.getBuildCommit()
|
||||||
@@ -84,6 +92,7 @@ function onConnect(protocol)
|
|||||||
post = post .. '&cpu=' .. g_platform.getCPUName()
|
post = post .. '&cpu=' .. g_platform.getCPUName()
|
||||||
post = post .. '&mem=' .. g_platform.getTotalSystemMemory()
|
post = post .. '&mem=' .. g_platform.getTotalSystemMemory()
|
||||||
post = post .. '&os_name=' .. g_platform.getOSName()
|
post = post .. '&os_name=' .. g_platform.getOSName()
|
||||||
|
post = post .. getAdditionalData()
|
||||||
|
|
||||||
local message = ''
|
local message = ''
|
||||||
message = message .. "POST /report HTTP/1.1\r\n"
|
message = message .. "POST /report HTTP/1.1\r\n"
|
||||||
@@ -98,6 +107,10 @@ function onConnect(protocol)
|
|||||||
protocol:recv()
|
protocol:recv()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function getAdditionalData()
|
||||||
|
return ''
|
||||||
|
end
|
||||||
|
|
||||||
function onRecv(protocol, message)
|
function onRecv(protocol, message)
|
||||||
if string.find(message, 'HTTP/1.1 200 OK') then
|
if string.find(message, 'HTTP/1.1 200 OK') then
|
||||||
--pinfo('Stats sent to server successfully!')
|
--pinfo('Stats sent to server successfully!')
|
||||||
|
@@ -1,94 +1,177 @@
|
|||||||
function dumpWidgets(widget, level)
|
local function pcolored(text, color)
|
||||||
widget = widget or rootWidget
|
color = color or 'white'
|
||||||
level = level or 0
|
modules.client_terminal.addLine(tostring(text), color)
|
||||||
for i=1,widget:getChildCount() do
|
end
|
||||||
local child = widget:getChildByIndex(i)
|
|
||||||
if child:isVisible() then
|
function draw_debug_boxes()
|
||||||
local name = child:getId()
|
g_ui.setDebugBoxesDrawing(not g_ui.isDrawingDebugBoxes())
|
||||||
if name:match('widget%d+') == nil then
|
end
|
||||||
print(string.rep(' ', level) .. name)
|
|
||||||
end
|
function hide_map()
|
||||||
if child:getId() ~= 'terminalBuffer' then
|
modules.game_interface.getMapPanel():hide()
|
||||||
dumpWidgets(child, level+1)
|
end
|
||||||
end
|
|
||||||
|
function show_map()
|
||||||
|
modules.game_interface.getMapPanel():show()
|
||||||
|
end
|
||||||
|
|
||||||
|
function live_textures_reload()
|
||||||
|
g_textures.liveReload()
|
||||||
|
end
|
||||||
|
|
||||||
|
function live_module_reload(name)
|
||||||
|
if not name then
|
||||||
|
pcolored('ERROR: missing module name', 'red')
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local module = g_modules.getModule(name)
|
||||||
|
if not module then
|
||||||
|
pcolored('ERROR: unable to find module ' .. name, 'red')
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
if not module:isReloadble() then
|
||||||
|
pcolored('ERROR: that module is not reloadable', 'red')
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
if not module:canReload() then
|
||||||
|
pcolored('ERROR: some other modules requires this module, cannot reload now', 'red')
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local files = {}
|
||||||
|
local hasFile = false
|
||||||
|
for _,file in pairs(g_resources.listDirectoryFiles('/' .. name)) do
|
||||||
|
local filepath = '/' .. name .. '/' .. file
|
||||||
|
local time = g_resources.getFileTime(filepath)
|
||||||
|
if time > 0 then
|
||||||
|
files[filepath] = time
|
||||||
|
hasFile = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
function drawDebugBoxes(enable)
|
if not hasFile then
|
||||||
if enable == nil then enable = true end
|
pcolored('ERROR: unable to find any file for module', 'red')
|
||||||
g_ui.setDebugBoxesDrawing(enable)
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
function hideMap()
|
cycleEvent(function()
|
||||||
local map = rootWidget:recursiveGetChildById('gameMapPanel')
|
for filepath,time in pairs(files) do
|
||||||
if map then map:hide() end
|
local newtime = g_resources.getFileTime(filepath)
|
||||||
end
|
if newtime > time then
|
||||||
|
pcolored('Reloading ' .. name, 'green')
|
||||||
|
modules.client_terminal.flushLines()
|
||||||
|
module:reload()
|
||||||
|
files[filepath] = newtime
|
||||||
|
|
||||||
function showMap()
|
if name == 'client_terminal' then
|
||||||
local map = rootWidget:recursiveGetChildById('gameMapPanel')
|
modules.client_terminal.show()
|
||||||
if map then map:show() end
|
end
|
||||||
end
|
break
|
||||||
|
|
||||||
function debugContainersItems()
|
|
||||||
function UIItem:onHoverChange(hovered)
|
|
||||||
if hovered then
|
|
||||||
local item = self:getItem()
|
|
||||||
if item then
|
|
||||||
local text = "id: " ..item:getId() ..
|
|
||||||
"\n stackable: " ..tostring(item:isStackable()) ..
|
|
||||||
"\n marketable: " ..tostring(item:isMarketable()) ..
|
|
||||||
"\n vocation: "..(item:getMarketData() and item:getMarketData().restrictVocation or 'none') ..
|
|
||||||
"\n cloth slot: " ..item:getClothSlot()
|
|
||||||
g_tooltip.display(text)
|
|
||||||
end
|
end
|
||||||
else
|
end
|
||||||
g_tooltip.hide()
|
end, 1000)
|
||||||
|
end
|
||||||
|
|
||||||
|
function live_sprites_reload()
|
||||||
|
local files = {}
|
||||||
|
for _,file in pairs(g_resources.listDirectoryFiles('/things')) do
|
||||||
|
local filepath = '/things/' .. file
|
||||||
|
local time = g_resources.getFileTime(filepath)
|
||||||
|
if time > 0 then
|
||||||
|
files[filepath] = time
|
||||||
|
hasFile = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if not hasFile then
|
||||||
|
pcolored('ERROR: unable to find things file for module', 'red')
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
cycleEvent(function()
|
||||||
|
for filepath,time in pairs(files) do
|
||||||
|
local newtime = g_resources.getFileTime(filepath)
|
||||||
|
if newtime > time then
|
||||||
|
pcolored('Reloading sprites...', 'green')
|
||||||
|
modules.client_terminal.flushLines()
|
||||||
|
modules.game_things.load()
|
||||||
|
files[filepath] = newtime
|
||||||
|
|
||||||
|
if name == 'client_terminal' then
|
||||||
|
modules.client_terminal.show()
|
||||||
|
end
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end, 1000)
|
||||||
end
|
end
|
||||||
|
|
||||||
function debugPosition(enable)
|
local pinging = false
|
||||||
if enable == nil then enable = true end
|
local function pingBack(ping)
|
||||||
local label = rootWidget:getChildById('debugPositionLabel')
|
if ping < 300 then color = 'green'
|
||||||
if not label then
|
elseif ping < 600 then color = 'yellow'
|
||||||
label = g_ui.createWidget('GameLabel', rootWidget)
|
else color = 'red' end
|
||||||
label:setColor('pink')
|
pcolored(g_game.getWorldName() .. ' => ' .. ping .. ' ms', color)
|
||||||
label:setFont('terminus-14px-bold')
|
end
|
||||||
label:setId('debugPositionLabel')
|
function ping()
|
||||||
label:setPosition({x= 10, y = 40 })
|
if pinging then
|
||||||
label:setPhantom(true)
|
pcolored('Ping stopped.')
|
||||||
label:setTextAutoResize(true)
|
g_game.setPingDelay(1000)
|
||||||
end
|
disconnect(g_game, 'onPingBack', pingBack)
|
||||||
if enable then
|
|
||||||
label.event = cycleEvent(function()
|
|
||||||
local player = g_game.getLocalPlayer()
|
|
||||||
if player then
|
|
||||||
local pos = g_game.getLocalPlayer():getPosition()
|
|
||||||
label:show()
|
|
||||||
label:setText('x: ' .. pos.x .. '\ny: ' .. pos.y .. '\nz: ' .. pos.z)
|
|
||||||
else
|
|
||||||
label:hide()
|
|
||||||
end
|
|
||||||
end, 100)
|
|
||||||
else
|
else
|
||||||
removeEvent(label.event)
|
if not (g_game.getFeature(GameClientPing) or g_game.getFeature(GameExtendedClientPing)) then
|
||||||
label.event = nil
|
pcolored('this server does not support ping', 'red')
|
||||||
label:hide()
|
return
|
||||||
|
elseif not g_game.isOnline() then
|
||||||
|
pcolored('ping command is only allowed when online', 'red')
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
pcolored('Starting ping...')
|
||||||
|
g_game.setPingDelay(0)
|
||||||
|
connect(g_game, 'onPingBack', pingBack)
|
||||||
|
end
|
||||||
|
pinging = not pinging
|
||||||
|
end
|
||||||
|
|
||||||
|
function clear()
|
||||||
|
modules.client_terminal.clear()
|
||||||
|
end
|
||||||
|
|
||||||
|
function ls(path)
|
||||||
|
path = path or '/'
|
||||||
|
local files = g_resources.listDirectoryFiles(path)
|
||||||
|
for k,v in pairs(files) do
|
||||||
|
if g_resources.directoryExists(path .. v) then
|
||||||
|
pcolored(path .. v, 'blue')
|
||||||
|
else
|
||||||
|
pcolored(path .. v)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function autoReloadModule(name)
|
function about_version()
|
||||||
local function reloadEvent()
|
pcolored(g_app.getName() .. ' ' .. g_app.getVersion() .. '\n' ..
|
||||||
reloadModule(name)
|
'Rev ' .. g_app.getBuildRevision() .. ' ('.. g_app.getBuildCommit() .. ')\n' ..
|
||||||
scheduleEvent(reloadEvent, 1000)
|
'Built on ' .. g_app.getBuildDate())
|
||||||
end
|
|
||||||
reloadEvent()
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function createDebugUIItem(id)
|
function about_graphics()
|
||||||
local uiitem = g_ui.createWidget('Item', rootWidget)
|
pcolored('Vendor ' .. g_graphics.getVendor() )
|
||||||
uiitem:setPosition({x= 200, y = 200 })
|
pcolored('Renderer' .. g_graphics.getRenderer())
|
||||||
uiitem:setItemId(id)
|
pcolored('Version' .. g_graphics.getVersion())
|
||||||
uiitem:show()
|
end
|
||||||
|
|
||||||
|
function about_modules()
|
||||||
|
for k,m in pairs(g_modules.getModules()) do
|
||||||
|
local loadedtext
|
||||||
|
if m:isLoaded() then
|
||||||
|
pcolored(m:getName() .. ' => loaded', 'green')
|
||||||
|
else
|
||||||
|
pcolored(m:getName() .. ' => not loaded', 'red')
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@@ -1,21 +1,32 @@
|
|||||||
-- configs
|
-- configs
|
||||||
local LogColors = { [LogInfo] = 'white',
|
local LogColors = { [LogDebug] = 'pink',
|
||||||
|
[LogInfo] = 'white',
|
||||||
[LogWarning] = 'yellow',
|
[LogWarning] = 'yellow',
|
||||||
[LogError] = 'red' }
|
[LogError] = 'red' }
|
||||||
local MaxLogLines = 80
|
local MaxLogLines = 128
|
||||||
local LabelHeight = 16
|
|
||||||
local MaxHistory = 1000
|
local MaxHistory = 1000
|
||||||
|
|
||||||
|
local oldenv = getfenv(0)
|
||||||
|
setfenv(0, _G)
|
||||||
|
_G.commandEnv = runinsandbox('commands')
|
||||||
|
setfenv(0, oldenv)
|
||||||
|
|
||||||
-- private variables
|
-- private variables
|
||||||
local terminalWindow
|
local terminalWindow
|
||||||
local terminalButton
|
local terminalButton
|
||||||
local logLocked = false
|
local logLocked = false
|
||||||
local commandEnv = {}
|
|
||||||
setmetatable(commandEnv, { __index = getfenv() } )
|
|
||||||
local commandTextEdit
|
local commandTextEdit
|
||||||
local terminalBuffer
|
local terminalBuffer
|
||||||
local commandHistory = { }
|
local commandHistory = { }
|
||||||
local currentHistoryIndex = 0
|
local currentHistoryIndex = 0
|
||||||
|
local poped = false
|
||||||
|
local oldPos
|
||||||
|
local oldSize
|
||||||
|
local firstShown = false
|
||||||
|
local flushEvent
|
||||||
|
local cachedLines = {}
|
||||||
|
local disabled = false
|
||||||
|
local allLines = {}
|
||||||
|
|
||||||
-- private functions
|
-- private functions
|
||||||
local function navigateCommand(step)
|
local function navigateCommand(step)
|
||||||
@@ -96,9 +107,7 @@ local function doCommand()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function onLog(level, message, time)
|
local function onLog(level, message, time)
|
||||||
-- debug messages are ignored
|
if disabled then return end
|
||||||
if level == LogDebug then return end
|
|
||||||
|
|
||||||
-- avoid logging while reporting logs (would cause a infinite loop)
|
-- avoid logging while reporting logs (would cause a infinite loop)
|
||||||
if logLocked then return end
|
if logLocked then return end
|
||||||
|
|
||||||
@@ -112,22 +121,7 @@ function init()
|
|||||||
terminalWindow = g_ui.displayUI('terminal')
|
terminalWindow = g_ui.displayUI('terminal')
|
||||||
terminalWindow:setVisible(false)
|
terminalWindow:setVisible(false)
|
||||||
|
|
||||||
local poped = false
|
terminalWindow.onDoubleClick = popWindow
|
||||||
terminalWindow.onDoubleClick = function(self)
|
|
||||||
if poped then
|
|
||||||
self:fill('parent')
|
|
||||||
self:getChildById('bottomResizeBorder'):disable()
|
|
||||||
self:getChildById('rightResizeBorder'):disable()
|
|
||||||
poped = false
|
|
||||||
else
|
|
||||||
self:breakAnchors()
|
|
||||||
self:resize(g_window.getWidth()/2, g_window.getHeight()/2)
|
|
||||||
self:move(g_window.getWidth()/2, g_window.getHeight()/2)
|
|
||||||
self:getChildById('bottomResizeBorder'):enable()
|
|
||||||
self:getChildById('rightResizeBorder'):enable()
|
|
||||||
poped = true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
terminalButton = modules.client_topmenu.addLeftButton('terminalButton', tr('Terminal') .. ' (Ctrl + T)', '/images/topbuttons/terminal', toggle)
|
terminalButton = modules.client_topmenu.addLeftButton('terminalButton', tr('Terminal') .. ' (Ctrl + T)', '/images/topbuttons/terminal', toggle)
|
||||||
g_keyboard.bindKeyDown('Ctrl+T', toggle)
|
g_keyboard.bindKeyDown('Ctrl+T', toggle)
|
||||||
@@ -137,32 +131,105 @@ function init()
|
|||||||
commandTextEdit = terminalWindow:getChildById('commandTextEdit')
|
commandTextEdit = terminalWindow:getChildById('commandTextEdit')
|
||||||
g_keyboard.bindKeyPress('Up', function() navigateCommand(1) end, commandTextEdit)
|
g_keyboard.bindKeyPress('Up', function() navigateCommand(1) end, commandTextEdit)
|
||||||
g_keyboard.bindKeyPress('Down', function() navigateCommand(-1) end, commandTextEdit)
|
g_keyboard.bindKeyPress('Down', function() navigateCommand(-1) end, commandTextEdit)
|
||||||
|
g_keyboard.bindKeyPress('Ctrl+C',
|
||||||
|
function()
|
||||||
|
if commandTextEdit:hasSelection() or not terminalSelectText:hasSelection() then return false end
|
||||||
|
g_window.setClipboardText(terminalSelectText:getSelection())
|
||||||
|
return true
|
||||||
|
end, commandTextEdit)
|
||||||
g_keyboard.bindKeyDown('Tab', completeCommand, commandTextEdit)
|
g_keyboard.bindKeyDown('Tab', completeCommand, commandTextEdit)
|
||||||
g_keyboard.bindKeyDown('Enter', doCommand, commandTextEdit)
|
g_keyboard.bindKeyDown('Enter', doCommand, commandTextEdit)
|
||||||
g_keyboard.bindKeyDown('Escape', hide, terminalWindow)
|
g_keyboard.bindKeyDown('Escape', hide, terminalWindow)
|
||||||
|
|
||||||
terminalBuffer = terminalWindow:getChildById('terminalBuffer')
|
terminalBuffer = terminalWindow:getChildById('terminalBuffer')
|
||||||
|
terminalSelectText = terminalWindow:getChildById('terminalSelectText')
|
||||||
|
terminalSelectText.onDoubleClick = popWindow
|
||||||
|
terminalSelectText.onMouseWheel = function(a,b,c) terminalBuffer:onMouseWheel(b,c) end
|
||||||
|
terminalBuffer.onScrollChange = function(self, value) terminalSelectText:setTextVirtualOffset(value) end
|
||||||
|
|
||||||
g_logger.setOnLog(onLog)
|
g_logger.setOnLog(onLog)
|
||||||
g_logger.fireOldMessages()
|
|
||||||
|
if not g_app.isRunning() then
|
||||||
|
g_logger.fireOldMessages()
|
||||||
|
elseif _G.terminalLines then
|
||||||
|
for _,line in pairs(_G.terminalLines) do
|
||||||
|
addLine(line.text, line.color)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function terminate()
|
function terminate()
|
||||||
g_settings.setList('terminal-history', commandHistory)
|
g_settings.setList('terminal-history', commandHistory)
|
||||||
|
|
||||||
|
removeEvent(flushEvent)
|
||||||
|
|
||||||
|
if poped then
|
||||||
|
oldPos = terminalWindow:getPosition()
|
||||||
|
oldSize = terminalWindow:getSize()
|
||||||
|
end
|
||||||
|
local settings = {
|
||||||
|
size = oldSize,
|
||||||
|
pos = oldPos,
|
||||||
|
poped = poped
|
||||||
|
}
|
||||||
|
g_settings.setNode('terminal-window', settings)
|
||||||
|
|
||||||
g_keyboard.unbindKeyDown('Ctrl+T')
|
g_keyboard.unbindKeyDown('Ctrl+T')
|
||||||
g_logger.setOnLog(nil)
|
g_logger.setOnLog(nil)
|
||||||
terminalWindow:destroy()
|
terminalWindow:destroy()
|
||||||
terminalButton:destroy()
|
terminalButton:destroy()
|
||||||
commandEnv = nil
|
commandEnv = nil
|
||||||
|
_G.terminalLines = allLines
|
||||||
end
|
end
|
||||||
|
|
||||||
function hideButton()
|
function hideButton()
|
||||||
terminalButton:hide()
|
terminalButton:hide()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function popWindow()
|
||||||
|
if poped then
|
||||||
|
oldPos = terminalWindow:getPosition()
|
||||||
|
oldSize = terminalWindow:getSize()
|
||||||
|
terminalWindow:fill('parent')
|
||||||
|
terminalWindow:setOn(false)
|
||||||
|
terminalWindow:getChildById('bottomResizeBorder'):disable()
|
||||||
|
terminalWindow:getChildById('rightResizeBorder'):disable()
|
||||||
|
terminalWindow:getChildById('titleBar'):hide()
|
||||||
|
terminalWindow:getChildById('terminalScroll'):setMarginTop(0)
|
||||||
|
terminalWindow:getChildById('terminalScroll'):setMarginBottom(0)
|
||||||
|
terminalWindow:getChildById('terminalScroll'):setMarginRight(0)
|
||||||
|
poped = false
|
||||||
|
else
|
||||||
|
terminalWindow:breakAnchors()
|
||||||
|
terminalWindow:setOn(true)
|
||||||
|
local size = oldSize or { width = g_window.getWidth()/2, height = g_window.getHeight()/2 }
|
||||||
|
terminalWindow:setSize(size)
|
||||||
|
local pos = oldPos or { x = (g_window.getWidth() - terminalWindow:getWidth())/2, y = (g_window.getHeight() - terminalWindow:getHeight())/2 }
|
||||||
|
terminalWindow:setPosition(pos)
|
||||||
|
terminalWindow:getChildById('bottomResizeBorder'):enable()
|
||||||
|
terminalWindow:getChildById('rightResizeBorder'):enable()
|
||||||
|
terminalWindow:getChildById('titleBar'):show()
|
||||||
|
terminalWindow:getChildById('terminalScroll'):setMarginTop(18)
|
||||||
|
terminalWindow:getChildById('terminalScroll'):setMarginBottom(1)
|
||||||
|
terminalWindow:getChildById('terminalScroll'):setMarginRight(1)
|
||||||
|
terminalWindow:bindRectToParent()
|
||||||
|
poped = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function toggle()
|
function toggle()
|
||||||
if terminalWindow:isVisible() then
|
if terminalWindow:isVisible() then
|
||||||
hide()
|
hide()
|
||||||
else
|
else
|
||||||
|
if not firstShown then
|
||||||
|
local settings = g_settings.getNode('terminal-window')
|
||||||
|
if settings then
|
||||||
|
if settings.size then oldSize = size end
|
||||||
|
if settings.pos then oldPos = settings.pos end
|
||||||
|
if settings.poped then popWindow() end
|
||||||
|
end
|
||||||
|
firstShown = true
|
||||||
|
end
|
||||||
show()
|
show()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -180,36 +247,56 @@ end
|
|||||||
function disable()
|
function disable()
|
||||||
terminalButton:hide()
|
terminalButton:hide()
|
||||||
g_keyboard.unbindKeyDown('Ctrl+T')
|
g_keyboard.unbindKeyDown('Ctrl+T')
|
||||||
|
disabled = true
|
||||||
|
end
|
||||||
|
|
||||||
|
function flushLines()
|
||||||
|
local numLines = terminalBuffer:getChildCount() + #cachedLines
|
||||||
|
local fulltext = terminalSelectText:getText()
|
||||||
|
|
||||||
|
for _,line in pairs(cachedLines) do
|
||||||
|
-- delete old lines if needed
|
||||||
|
if numLines > MaxLogLines then
|
||||||
|
local firstChild = terminalBuffer:getChildByIndex(1)
|
||||||
|
if firstChild then
|
||||||
|
local len = #firstChild:getText()
|
||||||
|
firstChild:destroy()
|
||||||
|
table.remove(allLines, 1)
|
||||||
|
fulltext = string.sub(fulltext, len)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local label = g_ui.createWidget('TerminalLabel', terminalBuffer)
|
||||||
|
label:setId('terminalLabel' .. numLines)
|
||||||
|
label:setText(line.text)
|
||||||
|
label:setColor(line.color)
|
||||||
|
|
||||||
|
table.insert(allLines, {text=line.text,color=line.color})
|
||||||
|
|
||||||
|
fulltext = fulltext .. '\n' .. line.text
|
||||||
|
end
|
||||||
|
|
||||||
|
terminalSelectText:setText(fulltext)
|
||||||
|
|
||||||
|
cachedLines = {}
|
||||||
|
removeEvent(flushEvent)
|
||||||
|
flushEvent = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
function addLine(text, color)
|
function addLine(text, color)
|
||||||
-- delete old lines if needed
|
if not flushEvent then
|
||||||
local numLines = terminalBuffer:getChildCount() + 1
|
flushEvent = scheduleEvent(flushLines, 10)
|
||||||
if numLines > MaxLogLines then
|
|
||||||
terminalBuffer:getChildByIndex(1):destroy()
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- create new line label
|
text = string.gsub(text, '\t', ' ')
|
||||||
local label = g_ui.createWidget('TerminalLabel', terminalBuffer)
|
table.insert(cachedLines, {text=text, color=color})
|
||||||
label:setId('terminalLabel' .. numLines)
|
|
||||||
label:setText(text)
|
|
||||||
label:setColor(color)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function executeCommand(command)
|
function executeCommand(command)
|
||||||
if command == nil or #command == 0 then return end
|
if command == nil or #command == 0 then return end
|
||||||
|
|
||||||
logLocked = true
|
-- add command line
|
||||||
g_logger.log(LogInfo, '> ' .. command)
|
addLine("> " .. command, "#ffffff")
|
||||||
logLocked = false
|
|
||||||
|
|
||||||
-- detect and convert commands with simple syntax
|
|
||||||
local realCommand
|
|
||||||
if string.sub(command, 1, 1) == '=' then
|
|
||||||
realCommand = 'print(' .. string.sub(command,2) .. ')'
|
|
||||||
else
|
|
||||||
realCommand = command
|
|
||||||
end
|
|
||||||
|
|
||||||
-- reset current history index
|
-- reset current history index
|
||||||
currentHistoryIndex = 0
|
currentHistoryIndex = 0
|
||||||
@@ -222,15 +309,33 @@ function executeCommand(command)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- add command line
|
-- detect and convert commands with simple syntax
|
||||||
--addLine(">> " .. command, "#ffffff")
|
local realCommand
|
||||||
|
if string.sub(command, 1, 1) == '=' then
|
||||||
|
realCommand = 'print(' .. string.sub(command,2) .. ')'
|
||||||
|
else
|
||||||
|
realCommand = command
|
||||||
|
end
|
||||||
|
|
||||||
-- load command buffer
|
|
||||||
local func, err = loadstring(realCommand, "@")
|
local func, err = loadstring(realCommand, "@")
|
||||||
|
|
||||||
|
-- detect terminal commands
|
||||||
|
if not func then
|
||||||
|
local command_name = command:match('^([%w_]+)[%s]*.*')
|
||||||
|
if command_name then
|
||||||
|
local args = string.split(command:match('^[%w_]+[%s]*(.*)'), ' ')
|
||||||
|
if commandEnv[command_name] and type(commandEnv[command_name]) == 'function' then
|
||||||
|
func = function() modules.client_terminal.commandEnv[command_name](unpack(args)) end
|
||||||
|
elseif command_name == command then
|
||||||
|
addLine('ERROR: command not found', 'red')
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- check for syntax errors
|
-- check for syntax errors
|
||||||
if not func then
|
if not func then
|
||||||
g_logger.log(LogError, 'incorrect lua syntax: ' .. err:sub(5))
|
addLine('ERROR: incorrect lua syntax: ' .. err:sub(5), 'red')
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -241,8 +346,15 @@ function executeCommand(command)
|
|||||||
local ok, ret = pcall(func)
|
local ok, ret = pcall(func)
|
||||||
if ok then
|
if ok then
|
||||||
-- if the command returned a value, print it
|
-- if the command returned a value, print it
|
||||||
if ret then print(ret) end
|
if ret then addLine(ret, 'white') end
|
||||||
else
|
else
|
||||||
g_logger.log(LogError, 'command failed: ' .. ret)
|
addLine('ERROR: command failed: ' .. ret, 'red')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function clear()
|
||||||
|
terminalBuffer:destroyChildren()
|
||||||
|
terminalSelectText:setText('')
|
||||||
|
cachedLines = {}
|
||||||
|
allLines = {}
|
||||||
|
end
|
||||||
|
@@ -3,7 +3,7 @@ Module
|
|||||||
description: Terminal for executing lua functions
|
description: Terminal for executing lua functions
|
||||||
author: edubart
|
author: edubart
|
||||||
website: www.otclient.info
|
website: www.otclient.info
|
||||||
scripts: [ terminal, commands ]
|
scripts: [ terminal ]
|
||||||
sandboxed: true
|
sandboxed: true
|
||||||
@onLoad: init()
|
@onLoad: init()
|
||||||
@onUnload: terminate()
|
@onUnload: terminate()
|
||||||
|
@@ -1,7 +1,21 @@
|
|||||||
TerminalLabel < UILabel
|
TerminalLabel < UILabel
|
||||||
font: terminus-14px-bold
|
font: terminus-10px
|
||||||
text-wrap: true
|
text-wrap: true
|
||||||
text-auto-resize: true
|
text-auto-resize: true
|
||||||
|
phantom: true
|
||||||
|
|
||||||
|
TerminalSelectText < UITextEdit
|
||||||
|
font: terminus-10px
|
||||||
|
text-wrap: true
|
||||||
|
text-align: bottomLeft
|
||||||
|
editable: false
|
||||||
|
change-cursor-image: false
|
||||||
|
cursor-visible: false
|
||||||
|
selection-color: black
|
||||||
|
selection-background-color: white
|
||||||
|
color: alpha
|
||||||
|
focusable: false
|
||||||
|
auto-scroll: false
|
||||||
|
|
||||||
UIWindow
|
UIWindow
|
||||||
id: terminalWindow
|
id: terminalWindow
|
||||||
@@ -9,36 +23,69 @@ UIWindow
|
|||||||
opacity: 0.85
|
opacity: 0.85
|
||||||
clipping: true
|
clipping: true
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
border: 0 white
|
||||||
|
$on:
|
||||||
|
border: 1 black
|
||||||
|
|
||||||
Panel
|
Label
|
||||||
id: terminalBuffer
|
id: titleBar
|
||||||
layout:
|
!text: tr('Terminal')
|
||||||
type: verticalBox
|
border: 1 black
|
||||||
fit-children: true
|
color: white
|
||||||
focusable: false
|
anchors.top: parent.top
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
background-color: #ffffff11
|
||||||
|
text-align: left
|
||||||
|
text-offset: 4 0
|
||||||
|
height: 18
|
||||||
|
visible: false
|
||||||
|
|
||||||
|
ScrollablePanel
|
||||||
|
id: terminalBuffer
|
||||||
|
focusable: false
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: terminalScroll.left
|
||||||
|
anchors.top: terminalScroll.top
|
||||||
anchors.bottom: commandSymbolLabel.top
|
anchors.bottom: commandSymbolLabel.top
|
||||||
|
layout:
|
||||||
|
type: verticalBox
|
||||||
|
align-bottom: true
|
||||||
|
vertical-scrollbar: terminalScroll
|
||||||
|
inverted-scroll: true
|
||||||
margin-left: 2
|
margin-left: 2
|
||||||
|
|
||||||
|
TerminalSelectText
|
||||||
|
id: terminalSelectText
|
||||||
|
anchors.fill: terminalBuffer
|
||||||
|
focusable: false
|
||||||
|
|
||||||
|
VerticalScrollBar
|
||||||
|
id: terminalScroll
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.right: parent.right
|
||||||
|
step: 48
|
||||||
|
pixels-scroll: true
|
||||||
|
|
||||||
UILabel
|
UILabel
|
||||||
id: commandSymbolLabel
|
id: commandSymbolLabel
|
||||||
size: 12 16
|
size: 12 12
|
||||||
fixed-size: true
|
fixed-size: true
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
margin-left: 2
|
margin-left: 2
|
||||||
font: terminus-14px-bold
|
font: terminus-10px
|
||||||
text: >
|
text: >
|
||||||
|
|
||||||
UITextEdit
|
UITextEdit
|
||||||
id: commandTextEdit
|
id: commandTextEdit
|
||||||
height: 16
|
height: 12
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.left: commandSymbolLabel.right
|
anchors.left: commandSymbolLabel.right
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
margin-left: 5
|
margin-left: 1
|
||||||
font: terminus-14px-bold
|
font: terminus-10px
|
||||||
selection-color: black
|
selection-color: black
|
||||||
selection-background-color: white
|
selection-background-color: white
|
||||||
|
|
||||||
|
@@ -37,8 +37,10 @@ end
|
|||||||
|
|
||||||
-- public functions
|
-- public functions
|
||||||
function init()
|
function init()
|
||||||
connect(g_game, { onGameStart = showGameButtons,
|
connect(g_game, { onGameStart = online,
|
||||||
onGameEnd = hideGameButtons })
|
onGameEnd = offline,
|
||||||
|
onPingBack = updatePing })
|
||||||
|
connect(g_app, { onFps = updateFps })
|
||||||
|
|
||||||
topMenu = g_ui.displayUI('topmenu')
|
topMenu = g_ui.displayUI('topmenu')
|
||||||
|
|
||||||
@@ -46,20 +48,73 @@ function init()
|
|||||||
rightButtonsPanel = topMenu:getChildById('rightButtonsPanel')
|
rightButtonsPanel = topMenu:getChildById('rightButtonsPanel')
|
||||||
leftGameButtonsPanel = topMenu:getChildById('leftGameButtonsPanel')
|
leftGameButtonsPanel = topMenu:getChildById('leftGameButtonsPanel')
|
||||||
rightGameButtonsPanel = topMenu:getChildById('rightGameButtonsPanel')
|
rightGameButtonsPanel = topMenu:getChildById('rightGameButtonsPanel')
|
||||||
|
pingLabel = topMenu:getChildById('pingLabel')
|
||||||
|
fpsLabel = topMenu:getChildById('fpsLabel')
|
||||||
|
|
||||||
if g_game.isOnline() then
|
if g_game.isOnline() then
|
||||||
leftGameButtonsPanel:show()
|
online()
|
||||||
rightGameButtonsPanel:show()
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function terminate()
|
function terminate()
|
||||||
disconnect(g_game, { onGameStart = showGameButtons,
|
disconnect(g_game, { onGameStart = online,
|
||||||
onGameEnd = hideGameButtons })
|
onGameEnd = offline,
|
||||||
|
onPingBack = updatePing })
|
||||||
|
disconnect(g_app, { onFps = updateFps })
|
||||||
|
|
||||||
topMenu:destroy()
|
topMenu:destroy()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function online()
|
||||||
|
showGameButtons()
|
||||||
|
|
||||||
|
addEvent(function()
|
||||||
|
if modules.client_options.getOption('showPing') and (g_game.getFeature(GameClientPing) or g_game.getFeature(GameExtendedClientPing)) then
|
||||||
|
pingLabel:show()
|
||||||
|
else
|
||||||
|
pingLabel:hide()
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
function offline()
|
||||||
|
hideGameButtons()
|
||||||
|
pingLabel:hide()
|
||||||
|
end
|
||||||
|
|
||||||
|
function updateFps(fps)
|
||||||
|
text = 'FPS: ' .. fps
|
||||||
|
fpsLabel:setText(text)
|
||||||
|
end
|
||||||
|
|
||||||
|
function updatePing(ping)
|
||||||
|
local text = 'Ping: '
|
||||||
|
local color
|
||||||
|
if ping < 0 then
|
||||||
|
text = text .. "??"
|
||||||
|
color = 'yellow'
|
||||||
|
else
|
||||||
|
text = text .. ping .. ' ms'
|
||||||
|
if ping >= 500 then
|
||||||
|
color = 'red'
|
||||||
|
elseif ping >= 250 then
|
||||||
|
color = 'yellow'
|
||||||
|
else
|
||||||
|
color = 'green'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
pingLabel:setColor(color)
|
||||||
|
pingLabel:setText(text)
|
||||||
|
end
|
||||||
|
|
||||||
|
function setPingVisible(enable)
|
||||||
|
pingLabel:setVisible(enable)
|
||||||
|
end
|
||||||
|
|
||||||
|
function setFpsVisible(enable)
|
||||||
|
fpsLabel:setVisible(enable)
|
||||||
|
end
|
||||||
|
|
||||||
function addLeftButton(id, description, icon, callback, front)
|
function addLeftButton(id, description, icon, callback, front)
|
||||||
return addButton(id, description, icon, callback, leftButtonsPanel, false, front)
|
return addButton(id, description, icon, callback, leftButtonsPanel, false, front)
|
||||||
end
|
end
|
||||||
@@ -92,16 +147,16 @@ function addRightGameToggleButton(id, description, icon, callback, front)
|
|||||||
return addButton(id, description, icon, callback, rightGameButtonsPanel, true, front)
|
return addButton(id, description, icon, callback, rightGameButtonsPanel, true, front)
|
||||||
end
|
end
|
||||||
|
|
||||||
function hideGameButtons()
|
|
||||||
leftGameButtonsPanel:hide()
|
|
||||||
rightGameButtonsPanel:hide()
|
|
||||||
end
|
|
||||||
|
|
||||||
function showGameButtons()
|
function showGameButtons()
|
||||||
leftGameButtonsPanel:show()
|
leftGameButtonsPanel:show()
|
||||||
rightGameButtonsPanel:show()
|
rightGameButtonsPanel:show()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function hideGameButtons()
|
||||||
|
leftGameButtonsPanel:hide()
|
||||||
|
rightGameButtonsPanel:hide()
|
||||||
|
end
|
||||||
|
|
||||||
function getButton(id)
|
function getButton(id)
|
||||||
return topMenu:recursiveGetChildById(id)
|
return topMenu:recursiveGetChildById(id)
|
||||||
end
|
end
|
||||||
|
@@ -18,17 +18,17 @@ TopMenuPanel
|
|||||||
visible: false
|
visible: false
|
||||||
|
|
||||||
TopMenuFrameCounterLabel
|
TopMenuFrameCounterLabel
|
||||||
id: frameCounter
|
id: fpsLabel
|
||||||
text-auto-resize: true
|
text-auto-resize: true
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.left: leftGameButtonsPanel.right
|
anchors.left: leftGameButtonsPanel.right
|
||||||
|
|
||||||
PingLabel
|
TopMenuPingLabel
|
||||||
color: white
|
color: white
|
||||||
id: pingLabel
|
id: pingLabel
|
||||||
text-auto-resize: true
|
text-auto-resize: true
|
||||||
anchors.top: frameCounter.bottom
|
anchors.top: fpsLabel.bottom
|
||||||
anchors.left: frameCounter.left
|
anchors.left: fpsLabel.left
|
||||||
|
|
||||||
TopMenuButtonsPanel
|
TopMenuButtonsPanel
|
||||||
id: rightButtonsPanel
|
id: rightButtonsPanel
|
||||||
|
@@ -317,4 +317,5 @@ NetworkMessageTypes = {
|
|||||||
SoundChannels = {
|
SoundChannels = {
|
||||||
Music = 1,
|
Music = 1,
|
||||||
Ambient = 2,
|
Ambient = 2,
|
||||||
|
Effect = 3,
|
||||||
}
|
}
|
||||||
|
@@ -17,6 +17,7 @@ Module
|
|||||||
dofile 'settings'
|
dofile 'settings'
|
||||||
dofile 'keyboard'
|
dofile 'keyboard'
|
||||||
dofile 'mouse'
|
dofile 'mouse'
|
||||||
|
dofile 'net'
|
||||||
|
|
||||||
dofiles 'ui'
|
dofiles 'ui'
|
||||||
|
|
||||||
|
@@ -4,7 +4,6 @@ g_keyboard = {}
|
|||||||
-- private functions
|
-- private functions
|
||||||
function translateKeyCombo(keyCombo)
|
function translateKeyCombo(keyCombo)
|
||||||
if not keyCombo or #keyCombo == 0 then return nil end
|
if not keyCombo or #keyCombo == 0 then return nil end
|
||||||
table.sort(keyCombo)
|
|
||||||
local keyComboDesc = ''
|
local keyComboDesc = ''
|
||||||
for k,v in pairs(keyCombo) do
|
for k,v in pairs(keyCombo) do
|
||||||
local keyDesc = KeyCodeDescs[v]
|
local keyDesc = KeyCodeDescs[v]
|
||||||
@@ -65,47 +64,29 @@ function determineKeyComboDesc(keyCode, keyboardModifiers)
|
|||||||
end
|
end
|
||||||
table.insert(keyCombo, keyCode)
|
table.insert(keyCombo, keyCode)
|
||||||
end
|
end
|
||||||
table.sort(keyCombo)
|
|
||||||
return translateKeyCombo(keyCombo)
|
return translateKeyCombo(keyCombo)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function onWidgetKeyDown(widget, keyCode, keyboardModifiers)
|
local function onWidgetKeyDown(widget, keyCode, keyboardModifiers)
|
||||||
if keyCode == KeyUnknown then return false end
|
if keyCode == KeyUnknown then return false end
|
||||||
local callback = widget.boundAloneKeyDownCombos[determineKeyComboDesc(keyCode, KeyboardNoModifier)]
|
local callback = widget.boundAloneKeyDownCombos[determineKeyComboDesc(keyCode, KeyboardNoModifier)]
|
||||||
if callback then
|
signalcall(callback, widget, keyCode)
|
||||||
callback(widget, keyCode)
|
|
||||||
end
|
|
||||||
callback = widget.boundKeyDownCombos[determineKeyComboDesc(keyCode, keyboardModifiers)]
|
callback = widget.boundKeyDownCombos[determineKeyComboDesc(keyCode, keyboardModifiers)]
|
||||||
if callback then
|
return signalcall(callback, widget, keyCode)
|
||||||
callback(widget, keyCode)
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
return false
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local function onWidgetKeyUp(widget, keyCode, keyboardModifiers)
|
local function onWidgetKeyUp(widget, keyCode, keyboardModifiers)
|
||||||
if keyCode == KeyUnknown then return false end
|
if keyCode == KeyUnknown then return false end
|
||||||
local callback = widget.boundAloneKeyUpCombos[determineKeyComboDesc(keyCode, KeyboardNoModifier)]
|
local callback = widget.boundAloneKeyUpCombos[determineKeyComboDesc(keyCode, KeyboardNoModifier)]
|
||||||
if callback then
|
signalcall(callback, widget, keyCode)
|
||||||
callback(widget, keyCode)
|
|
||||||
end
|
|
||||||
callback = widget.boundKeyUpCombos[determineKeyComboDesc(keyCode, keyboardModifiers)]
|
callback = widget.boundKeyUpCombos[determineKeyComboDesc(keyCode, keyboardModifiers)]
|
||||||
if callback then
|
return signalcall(callback, widget, keyCode)
|
||||||
callback(widget, keyCode)
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
return false
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local function onWidgetKeyPress(widget, keyCode, keyboardModifiers, autoRepeatTicks)
|
local function onWidgetKeyPress(widget, keyCode, keyboardModifiers, autoRepeatTicks)
|
||||||
if keyCode == KeyUnknown then return false end
|
if keyCode == KeyUnknown then return false end
|
||||||
local keyComboDesc = determineKeyComboDesc(keyCode, keyboardModifiers)
|
local callback = widget.boundKeyPressCombos[determineKeyComboDesc(keyCode, keyboardModifiers)]
|
||||||
local comboConf = widget.boundKeyPressCombos[keyComboDesc]
|
return signalcall(callback, widget, keyCode, autoRepeatTicks)
|
||||||
if comboConf and (autoRepeatTicks >= comboConf.autoRepeatDelay or autoRepeatTicks == 0) and comboConf.callback then
|
|
||||||
comboConf.callback(widget, keyCode)
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
return false
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local function connectKeyDownEvent(widget)
|
local function connectKeyDownEvent(widget)
|
||||||
@@ -133,13 +114,10 @@ function g_keyboard.bindKeyDown(keyComboDesc, callback, widget, alone)
|
|||||||
widget = widget or rootWidget
|
widget = widget or rootWidget
|
||||||
connectKeyDownEvent(widget)
|
connectKeyDownEvent(widget)
|
||||||
local keyComboDesc = retranslateKeyComboDesc(keyComboDesc)
|
local keyComboDesc = retranslateKeyComboDesc(keyComboDesc)
|
||||||
if widget.boundKeyDownCombos[keyComboDesc] then
|
|
||||||
pwarning('KeyDown event \'' .. keyComboDesc .. '\' redefined on widget ' .. widget:getId())
|
|
||||||
end
|
|
||||||
if alone then
|
if alone then
|
||||||
widget.boundAloneKeyDownCombos[keyComboDesc] = callback
|
connect(widget.boundAloneKeyDownCombos, keyComboDesc, callback)
|
||||||
else
|
else
|
||||||
widget.boundKeyDownCombos[keyComboDesc] = callback
|
connect(widget.boundKeyDownCombos, keyComboDesc, callback)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -147,53 +125,50 @@ function g_keyboard.bindKeyUp(keyComboDesc, callback, widget, alone)
|
|||||||
widget = widget or rootWidget
|
widget = widget or rootWidget
|
||||||
connectKeyUpEvent(widget)
|
connectKeyUpEvent(widget)
|
||||||
local keyComboDesc = retranslateKeyComboDesc(keyComboDesc)
|
local keyComboDesc = retranslateKeyComboDesc(keyComboDesc)
|
||||||
if widget.boundKeyUpCombos[keyComboDesc] then
|
|
||||||
pwarning('KeyUp event \'' .. keyComboDesc .. '\' redefined on widget ' .. widget:getId())
|
|
||||||
end
|
|
||||||
if alone then
|
if alone then
|
||||||
widget.boundAloneKeyUpCombos[keyComboDesc] = callback
|
connect(widget.boundAloneKeyUpCombos, keyComboDesc, callback)
|
||||||
else
|
else
|
||||||
widget.boundKeyUpCombos[keyComboDesc] = callback
|
connect(widget.boundKeyUpCombos, keyComboDesc, callback)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function g_keyboard.bindKeyPress(keyComboDesc, callback, widget, autoRepeatDelay)
|
function g_keyboard.bindKeyPress(keyComboDesc, callback, widget)
|
||||||
autoRepeatDelay = autoRepeatDelay or 500
|
|
||||||
widget = widget or rootWidget
|
widget = widget or rootWidget
|
||||||
connectKeyPressEvent(widget)
|
connectKeyPressEvent(widget)
|
||||||
local keyComboDesc = retranslateKeyComboDesc(keyComboDesc)
|
local keyComboDesc = retranslateKeyComboDesc(keyComboDesc)
|
||||||
if widget.boundKeyPressCombos[keyComboDesc] then
|
connect(widget.boundKeyPressCombos, keyComboDesc, callback)
|
||||||
pwarning('KeyPress event \'' .. keyComboDesc .. '\' redefined on widget ' .. widget:getId())
|
|
||||||
end
|
|
||||||
widget.boundKeyPressCombos[keyComboDesc] = { callback = callback, autoRepeatDelay = autoRepeatDelay }
|
|
||||||
widget:setAutoRepeatDelay(math.min(autoRepeatDelay, widget:getAutoRepeatDelay()))
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function g_keyboard.unbindKeyDown(keyComboDesc, widget)
|
local function getUnbindArgs(arg1, arg2)
|
||||||
|
local callback
|
||||||
|
local widget
|
||||||
|
if type(arg1) == 'function' then callback = arg1
|
||||||
|
elseif type(arg2) == 'function' then callback = arg2 end
|
||||||
|
if type(arg1) == 'userdata' then widget = arg1
|
||||||
|
elseif type(arg2) == 'userdata' then widget = arg2 end
|
||||||
widget = widget or rootWidget
|
widget = widget or rootWidget
|
||||||
|
return callback, widget
|
||||||
|
end
|
||||||
|
|
||||||
|
function g_keyboard.unbindKeyDown(keyComboDesc, arg1, arg2)
|
||||||
|
local callback, widget = getUnbindArgs(arg1, arg2)
|
||||||
if widget.boundKeyDownCombos == nil then return end
|
if widget.boundKeyDownCombos == nil then return end
|
||||||
local keyComboDesc = retranslateKeyComboDesc(keyComboDesc)
|
local keyComboDesc = retranslateKeyComboDesc(keyComboDesc)
|
||||||
if keyComboDesc then
|
disconnect(widget.boundKeyDownCombos, keyComboDesc, callback)
|
||||||
widget.boundKeyDownCombos[keyComboDesc] = nil
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function g_keyboard.unbindKeyUp(keyComboDesc, widget)
|
function g_keyboard.unbindKeyUp(keyComboDesc, arg1, arg2)
|
||||||
widget = widget or rootWidget
|
local callback, widget = getUnbindArgs(arg1, arg2)
|
||||||
if widget.boundKeyUpCombos == nil then return end
|
if widget.boundKeyUpCombos == nil then return end
|
||||||
local keyComboDesc = retranslateKeyComboDesc(keyComboDesc)
|
local keyComboDesc = retranslateKeyComboDesc(keyComboDesc)
|
||||||
if keyComboDesc then
|
disconnect(widget.boundKeyUpCombos, keyComboDesc, callback)
|
||||||
widget.boundKeyUpCombos[keyComboDesc] = nil
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function g_keyboard.unbindKeyPress(keyComboDesc, widget)
|
function g_keyboard.unbindKeyPress(keyComboDesc, arg1, arg2)
|
||||||
widget = widget or rootWidget
|
local callback, widget = getUnbindArgs(arg1, arg2)
|
||||||
if widget.boundKeyPressCombos == nil then return end
|
if widget.boundKeyPressCombos == nil then return end
|
||||||
local keyComboDesc = retranslateKeyComboDesc(keyComboDesc)
|
local keyComboDesc = retranslateKeyComboDesc(keyComboDesc)
|
||||||
if keyComboDesc then
|
disconnect(widget.boundKeyPressCombos, keyComboDesc, callback)
|
||||||
widget.boundKeyPressCombos[keyComboDesc] = nil
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function g_keyboard.getModifiers()
|
function g_keyboard.getModifiers()
|
||||||
|
16
modules/corelib/net.lua
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
function translateNetworkError(errcode, connecting, errdesc)
|
||||||
|
local text
|
||||||
|
if errcode == 111 then
|
||||||
|
text = tr('Connection refused, the server might be offline or restarting.\nPlease try again later.')
|
||||||
|
elseif errcode == 110 then
|
||||||
|
text = tr('Connection timed out. Either your network is failing or the server is offline.')
|
||||||
|
elseif errcode == 1 then
|
||||||
|
text = tr('Connection failed, the server address does not exist.')
|
||||||
|
elseif connecting then
|
||||||
|
text = tr('Connection failed.')
|
||||||
|
else
|
||||||
|
text = tr('Your connection has been lost.\nEither your network or the server went down.')
|
||||||
|
end
|
||||||
|
text = text .. ' ' .. tr('(ERROR %d)', errcode)
|
||||||
|
return text
|
||||||
|
end
|
@@ -20,8 +20,8 @@ function string:starts(start)
|
|||||||
return string.sub(self, 1, #start) == start
|
return string.sub(self, 1, #start) == start
|
||||||
end
|
end
|
||||||
|
|
||||||
function string.ends(s, test)
|
function string:ends(test)
|
||||||
return test =='' or string.sub(s,-string.len(test)) == test
|
return test =='' or string.sub(self,-string.len(test)) == test
|
||||||
end
|
end
|
||||||
|
|
||||||
function string:trim()
|
function string:trim()
|
||||||
|
@@ -13,6 +13,12 @@ function table.dump(t, depth)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function table.clear(t)
|
||||||
|
for k,v in pairs(t) do
|
||||||
|
t[k] = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function table.copy(t)
|
function table.copy(t)
|
||||||
local res = {}
|
local res = {}
|
||||||
for k,v in pairs(t) do
|
for k,v in pairs(t) do
|
||||||
@@ -138,6 +144,15 @@ function table.findbyfield(t, fieldname, fieldvalue)
|
|||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function table.size(t)
|
||||||
|
local size = 0
|
||||||
|
for i, n in pairs(t) do
|
||||||
|
size = size + 1
|
||||||
|
end
|
||||||
|
|
||||||
|
return size
|
||||||
|
end
|
||||||
|
|
||||||
function table.tostring(t)
|
function table.tostring(t)
|
||||||
local maxn = #t
|
local maxn = #t
|
||||||
local str = ""
|
local str = ""
|
||||||
@@ -152,3 +167,17 @@ function table.tostring(t)
|
|||||||
end
|
end
|
||||||
return str
|
return str
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function table.collect(t, func)
|
||||||
|
local res = {}
|
||||||
|
for k,v in pairs(t) do
|
||||||
|
local a,b = func(k,v)
|
||||||
|
if a and b then
|
||||||
|
res[a] = b
|
||||||
|
elseif a ~= nil then
|
||||||
|
table.insert(res,a)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return res
|
||||||
|
end
|
||||||
|
|
||||||
|
@@ -166,9 +166,10 @@ end
|
|||||||
|
|
||||||
function UIMiniWindow:onDragLeave(droppedWidget, mousePos)
|
function UIMiniWindow:onDragLeave(droppedWidget, mousePos)
|
||||||
if self.movedWidget then
|
if self.movedWidget then
|
||||||
self.setMovedChildMargin(0)
|
self.setMovedChildMargin(self.movedOldMargin or 0)
|
||||||
self.movedWidget = nil
|
self.movedWidget = nil
|
||||||
self.setMovedChildMargin = nil
|
self.setMovedChildMargin = nil
|
||||||
|
self.movedOldMargin = nil
|
||||||
self.movedIndex = nil
|
self.movedIndex = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -190,14 +191,16 @@ function UIMiniWindow:onDragMove(mousePos, mouseMoved)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if self.movedWidget then
|
if self.movedWidget then
|
||||||
self.setMovedChildMargin(0)
|
self.setMovedChildMargin(self.movedOldMargin or 0)
|
||||||
self.setMovedChildMargin = nil
|
self.setMovedChildMargin = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
if mousePos.y < childCenterY then
|
if mousePos.y < childCenterY then
|
||||||
|
self.movedOldMargin = child:getMarginTop()
|
||||||
self.setMovedChildMargin = function(v) child:setMarginTop(v) end
|
self.setMovedChildMargin = function(v) child:setMarginTop(v) end
|
||||||
self.movedIndex = 0
|
self.movedIndex = 0
|
||||||
else
|
else
|
||||||
|
self.movedOldMargin = child:getMarginBottom()
|
||||||
self.setMovedChildMargin = function(v) child:setMarginBottom(v) end
|
self.setMovedChildMargin = function(v) child:setMarginBottom(v) end
|
||||||
self.movedIndex = 1
|
self.movedIndex = 1
|
||||||
end
|
end
|
||||||
@@ -209,7 +212,7 @@ function UIMiniWindow:onDragMove(mousePos, mouseMoved)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if not overAnyWidget and self.movedWidget then
|
if not overAnyWidget and self.movedWidget then
|
||||||
self.setMovedChildMargin(0)
|
self.setMovedChildMargin(self.movedOldMargin or 0)
|
||||||
self.movedWidget = nil
|
self.movedWidget = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@@ -127,7 +127,7 @@ end
|
|||||||
function UIMiniWindowContainer:scheduleInsert(widget, index)
|
function UIMiniWindowContainer:scheduleInsert(widget, index)
|
||||||
if index - 1 > self:getChildCount() then
|
if index - 1 > self:getChildCount() then
|
||||||
if self.scheduledWidgets[index] then
|
if self.scheduledWidgets[index] then
|
||||||
pwarning('replacing scheduled widget id ' .. widget:getId())
|
pdebug('replacing scheduled widget id ' .. widget:getId())
|
||||||
end
|
end
|
||||||
self.scheduledWidgets[index] = widget
|
self.scheduledWidgets[index] = widget
|
||||||
else
|
else
|
||||||
|
@@ -16,6 +16,24 @@ local function updateMargins(tabBar, ignored)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function updateNavigation(tabBar)
|
||||||
|
if prevNavigation then
|
||||||
|
if #tabBar.preTabs > 0 or table.find(tabBar.tabs, tabBar.currentTab) ~= 1 then
|
||||||
|
prevNavigation:enable()
|
||||||
|
else
|
||||||
|
prevNavigation:disable()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if nextNavigation then
|
||||||
|
if #tabBar.postTabs > 0 or table.find(tabBar.tabs, tabBar.currentTab) ~= #tabBar.tabs then
|
||||||
|
nextNavigation:enable()
|
||||||
|
else
|
||||||
|
nextNavigation:disable()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local function updateIndexes(tabBar, tab, xoff)
|
local function updateIndexes(tabBar, tab, xoff)
|
||||||
local tabs = tabBar.tabs
|
local tabs = tabBar.tabs
|
||||||
local currentMargin = 0
|
local currentMargin = 0
|
||||||
@@ -33,10 +51,11 @@ local function updateIndexes(tabBar, tab, xoff)
|
|||||||
table.remove(tabs, table.find(tabs, tab))
|
table.remove(tabs, table.find(tabs, tab))
|
||||||
table.insert(tabs, newIndex, tab)
|
table.insert(tabs, newIndex, tab)
|
||||||
end
|
end
|
||||||
|
updateNavigation(tabBar)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function getMaxMargin(tabBar, tab)
|
local function getMaxMargin(tabBar, tab)
|
||||||
if #tabBar.tabs == 0 then return end
|
if #tabBar.tabs == 0 then return 0 end
|
||||||
|
|
||||||
local maxMargin = 0
|
local maxMargin = 0
|
||||||
for i = 1, #tabBar.tabs do
|
for i = 1, #tabBar.tabs do
|
||||||
@@ -44,7 +63,91 @@ local function getMaxMargin(tabBar, tab)
|
|||||||
maxMargin = maxMargin + tabBar.tabs[i]:getWidth()
|
maxMargin = maxMargin + tabBar.tabs[i]:getWidth()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return maxMargin + tabBar.tabSpacing * (#tabBar.tabs- 1)
|
return maxMargin + tabBar.tabSpacing * (#tabBar.tabs - 1)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function updateTabs(tabBar)
|
||||||
|
if #tabBar.postTabs > 0 then
|
||||||
|
local i = 1
|
||||||
|
while i <= #tabBar.postTabs do
|
||||||
|
local tab = tabBar.postTabs[i]
|
||||||
|
if getMaxMargin(tabBar) + tab:getWidth() > tabBar:getWidth() then
|
||||||
|
break
|
||||||
|
end
|
||||||
|
|
||||||
|
table.remove(tabBar.postTabs, i)
|
||||||
|
table.insert(tabBar.tabs, tab)
|
||||||
|
tab:setVisible(true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if #tabBar.preTabs > 0 then
|
||||||
|
for i = #tabBar.preTabs, 1, -1 do
|
||||||
|
local tab = tabBar.preTabs[i]
|
||||||
|
if getMaxMargin(tabBar) + tab:getWidth() > tabBar:getWidth() then
|
||||||
|
break
|
||||||
|
end
|
||||||
|
|
||||||
|
table.remove(tabBar.preTabs, i)
|
||||||
|
table.insert(tabBar.tabs, 1, tab)
|
||||||
|
tab:setVisible(true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
updateNavigation(tabBar)
|
||||||
|
updateMargins(tabBar)
|
||||||
|
|
||||||
|
if not tabBar.currentTab and #tabBar.tabs > 0 then
|
||||||
|
tabBar:selectTab(tabBar.tabs[1])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function hideTabs(tabBar, fromBack, toArray, width)
|
||||||
|
while #tabBar.tabs > 0 and getMaxMargin(tabBar) + width > tabBar:getWidth() do
|
||||||
|
local index = fromBack and #tabBar.tabs or 1
|
||||||
|
local tab = tabBar.tabs[index]
|
||||||
|
table.remove(tabBar.tabs, index)
|
||||||
|
if fromBack then
|
||||||
|
table.insert(toArray, 1, tab)
|
||||||
|
else
|
||||||
|
table.insert(toArray, tab)
|
||||||
|
end
|
||||||
|
if tabBar.currentTab == tab then
|
||||||
|
if #tabBar.tabs > 0 then
|
||||||
|
tabBar:selectTab(tabBar.tabs[#tabBar.tabs])
|
||||||
|
else
|
||||||
|
tabBar.currentTab:setChecked(false)
|
||||||
|
tabBar.currentTab = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
tab:setVisible(false)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function showPreTab(tabBar)
|
||||||
|
if #tabBar.preTabs == 0 then
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
local tmpTab = tabBar.preTabs[#tabBar.preTabs]
|
||||||
|
hideTabs(tabBar, true, tabBar.postTabs, tmpTab:getWidth())
|
||||||
|
|
||||||
|
table.remove(tabBar.preTabs, #tabBar.preTabs)
|
||||||
|
table.insert(tabBar.tabs, 1, tmpTab)
|
||||||
|
tmpTab:setVisible(true)
|
||||||
|
return tmpTab
|
||||||
|
end
|
||||||
|
|
||||||
|
local function showPostTab(tabBar)
|
||||||
|
if #tabBar.postTabs == 0 then
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
local tmpTab = tabBar.postTabs[1]
|
||||||
|
hideTabs(tabBar, false, tabBar.preTabs, tmpTab:getWidth())
|
||||||
|
|
||||||
|
table.remove(tabBar.postTabs, 1)
|
||||||
|
table.insert(tabBar.tabs, tmpTab)
|
||||||
|
tmpTab:setVisible(true)
|
||||||
|
return tmpTab
|
||||||
end
|
end
|
||||||
|
|
||||||
local function onTabMousePress(tab, mousePos, mouseButton)
|
local function onTabMousePress(tab, mousePos, mouseButton)
|
||||||
@@ -83,10 +186,17 @@ local function onTabDragMove(tab, mousePos, mouseMoved)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function tabBlink(tab)
|
local function tabBlink(tab, step)
|
||||||
if not tab.blinking then return end
|
step = step or 0
|
||||||
tab:setOn(not tab:isOn())
|
tab:setOn(not tab:isOn())
|
||||||
tab.blinkEvent = scheduleEvent(function() tabBlink(tab) end, 500)
|
|
||||||
|
removeEvent(tab.blinkEvent)
|
||||||
|
if step < 4 then
|
||||||
|
tab.blinkEvent = scheduleEvent(function() tabBlink(tab, step+1) end, 500)
|
||||||
|
else
|
||||||
|
tab:setOn(true)
|
||||||
|
tab.blinkEvent = nil
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- public functions
|
-- public functions
|
||||||
@@ -97,6 +207,14 @@ function UIMoveableTabBar.create()
|
|||||||
tabbar.selected = nil -- dragged tab
|
tabbar.selected = nil -- dragged tab
|
||||||
tabbar.tabSpacing = 0
|
tabbar.tabSpacing = 0
|
||||||
tabbar.tabsMoveable = false
|
tabbar.tabsMoveable = false
|
||||||
|
tabbar.preTabs = {}
|
||||||
|
tabbar.postTabs = {}
|
||||||
|
tabbar.prevNavigation = nil
|
||||||
|
tabbar.nextNavigation = nil
|
||||||
|
tabbar.onGeometryChange = function()
|
||||||
|
hideTabs(tabbar, true, tabbar.postTabs, 0)
|
||||||
|
updateTabs(tabbar)
|
||||||
|
end
|
||||||
return tabbar
|
return tabbar
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -134,18 +252,26 @@ function UIMoveableTabBar:addTab(text, panel, menuCallback)
|
|||||||
tab.onDragMove = onTabDragMove
|
tab.onDragMove = onTabDragMove
|
||||||
tab.onDestroy = function() tab.tabPanel:destroy() end
|
tab.onDestroy = function() tab.tabPanel:destroy() end
|
||||||
|
|
||||||
table.insert(self.tabs, tab)
|
if #self.tabs == 0 then
|
||||||
if #self.tabs == 1 then
|
|
||||||
self:selectTab(tab)
|
self:selectTab(tab)
|
||||||
tab:setMarginLeft(0)
|
tab:setMarginLeft(0)
|
||||||
|
table.insert(self.tabs, tab)
|
||||||
else
|
else
|
||||||
local newMargin = self.tabSpacing * (#self.tabs - 1)
|
local newMargin = self.tabSpacing * #self.tabs
|
||||||
for i = 1, #self.tabs - 1 do
|
for i = 1, #self.tabs do
|
||||||
newMargin = newMargin + self.tabs[i]:getWidth()
|
newMargin = newMargin + self.tabs[i]:getWidth()
|
||||||
end
|
end
|
||||||
tab:setMarginLeft(newMargin)
|
tab:setMarginLeft(newMargin)
|
||||||
|
|
||||||
|
hideTabs(self, true, self.postTabs, tab:getWidth())
|
||||||
|
table.insert(self.tabs, tab)
|
||||||
|
if #self.tabs == 1 then
|
||||||
|
self:selectTab(tab)
|
||||||
|
end
|
||||||
|
updateMargins(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
updateNavigation(self)
|
||||||
return tab
|
return tab
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -176,17 +302,33 @@ function UIMoveableTabBar:onStyleApply(styleName, styleNode)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function UIMoveableTabBar:removeTab(tab)
|
function UIMoveableTabBar:removeTab(tab)
|
||||||
local index = table.find(self.tabs, tab)
|
local tabTables = {self.tabs, self.preTabs, self.postTabs}
|
||||||
if index == nil then return end
|
local index = nil
|
||||||
|
local tabTable = nil
|
||||||
|
for i = 1, #tabTables do
|
||||||
|
index = table.find(tabTables[i], tab)
|
||||||
|
if index ~= nil then
|
||||||
|
tabTable = tabTables[i]
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if tabTable == nil then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
if self.currentTab == tab then
|
if self.currentTab == tab then
|
||||||
self:selectPrevTab()
|
self:selectPrevTab()
|
||||||
|
if #self.tabs == 1 then
|
||||||
|
self.currentTab = nil
|
||||||
|
end
|
||||||
end
|
end
|
||||||
table.remove(self.tabs, index)
|
table.remove(tabTable, index)
|
||||||
if tab.blinkEvent then
|
if tab.blinkEvent then
|
||||||
removeEvent(tab.blinkEvent)
|
removeEvent(tab.blinkEvent)
|
||||||
end
|
end
|
||||||
tab:destroy()
|
tab:destroy()
|
||||||
updateMargins(self)
|
updateTabs(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
function UIMoveableTabBar:getTab(text)
|
function UIMoveableTabBar:getTab(text)
|
||||||
@@ -195,6 +337,16 @@ function UIMoveableTabBar:getTab(text)
|
|||||||
return tab
|
return tab
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
for k,tab in pairs(self.preTabs) do
|
||||||
|
if tab:getText():lower() == text:lower() then
|
||||||
|
return tab
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for k,tab in pairs(self.postTabs) do
|
||||||
|
if tab:getText():lower() == text:lower() then
|
||||||
|
return tab
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function UIMoveableTabBar:selectTab(tab)
|
function UIMoveableTabBar:selectTab(tab)
|
||||||
@@ -219,28 +371,67 @@ function UIMoveableTabBar:selectTab(tab)
|
|||||||
|
|
||||||
local parent = tab:getParent()
|
local parent = tab:getParent()
|
||||||
parent:focusChild(tab, MouseFocusReason)
|
parent:focusChild(tab, MouseFocusReason)
|
||||||
|
updateNavigation(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
function UIMoveableTabBar:selectNextTab()
|
function UIMoveableTabBar:selectNextTab()
|
||||||
if self.currentTab == nil then return end
|
if self.currentTab == nil then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
local index = table.find(self.tabs, self.currentTab)
|
local index = table.find(self.tabs, self.currentTab)
|
||||||
if index == nil then return end
|
if index == nil then
|
||||||
local nextTab = self.tabs[index + 1] or self.tabs[1]
|
return
|
||||||
if not nextTab then return end
|
end
|
||||||
|
|
||||||
|
local newIndex = index + 1
|
||||||
|
if newIndex > #self.tabs then
|
||||||
|
if #self.postTabs > 0 then
|
||||||
|
local widget = showPostTab(self)
|
||||||
|
self:selectTab(widget)
|
||||||
|
updateTabs(self)
|
||||||
|
end
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local nextTab = self.tabs[newIndex]
|
||||||
|
if not nextTab then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
self:selectTab(nextTab)
|
self:selectTab(nextTab)
|
||||||
end
|
end
|
||||||
|
|
||||||
function UIMoveableTabBar:selectPrevTab()
|
function UIMoveableTabBar:selectPrevTab()
|
||||||
if self.currentTab == nil then return end
|
if self.currentTab == nil then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
local index = table.find(self.tabs, self.currentTab)
|
local index = table.find(self.tabs, self.currentTab)
|
||||||
if index == nil then return end
|
if index == nil then
|
||||||
local prevTab = self.tabs[index - 1] or self.tabs[#self.tabs]
|
return
|
||||||
if not prevTab then return end
|
end
|
||||||
|
|
||||||
|
local newIndex = index - 1
|
||||||
|
if newIndex <= 0 then
|
||||||
|
if #self.preTabs > 0 then
|
||||||
|
local widget = showPreTab(self)
|
||||||
|
self:selectTab(widget)
|
||||||
|
updateTabs(self)
|
||||||
|
end
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local prevTab = self.tabs[newIndex]
|
||||||
|
if not prevTab then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
self:selectTab(prevTab)
|
self:selectTab(prevTab)
|
||||||
end
|
end
|
||||||
|
|
||||||
function UIMoveableTabBar:blinkTab(tab)
|
function UIMoveableTabBar:blinkTab(tab)
|
||||||
if tab:isChecked() or tab.blinking then return end
|
if tab:isChecked() then return end
|
||||||
tab.blinking = true
|
tab.blinking = true
|
||||||
tabBlink(tab)
|
tabBlink(tab)
|
||||||
end
|
end
|
||||||
@@ -258,3 +449,16 @@ end
|
|||||||
function UIMoveableTabBar:getCurrentTab()
|
function UIMoveableTabBar:getCurrentTab()
|
||||||
return self.currentTab
|
return self.currentTab
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function UIMoveableTabBar:setNavigation(prevButton, nextButton)
|
||||||
|
prevNavigation = prevButton
|
||||||
|
nextNavigation = nextButton
|
||||||
|
|
||||||
|
if prevNavigation then
|
||||||
|
prevNavigation.onClick = function() self:selectPrevTab() end
|
||||||
|
end
|
||||||
|
if nextNavigation then
|
||||||
|
nextNavigation.onClick = function() self:selectNextTab() end
|
||||||
|
end
|
||||||
|
updateNavigation(self)
|
||||||
|
end
|
@@ -4,6 +4,7 @@ UIProgressBar = extends(UIWidget)
|
|||||||
function UIProgressBar.create()
|
function UIProgressBar.create()
|
||||||
local progressbar = UIProgressBar.internalCreate()
|
local progressbar = UIProgressBar.internalCreate()
|
||||||
progressbar:setFocusable(false)
|
progressbar:setFocusable(false)
|
||||||
|
progressbar:setOn(true)
|
||||||
progressbar.min = 0
|
progressbar.min = 0
|
||||||
progressbar.max = 100
|
progressbar.max = 100
|
||||||
progressbar.value = 0
|
progressbar.value = 0
|
||||||
|
@@ -73,23 +73,23 @@ end
|
|||||||
|
|
||||||
function UIScrollArea:setVerticalScrollBar(scrollbar)
|
function UIScrollArea:setVerticalScrollBar(scrollbar)
|
||||||
self.verticalScrollBar = scrollbar
|
self.verticalScrollBar = scrollbar
|
||||||
self.verticalScrollBar.onValueChange = function(scrollbar, value)
|
connect(self.verticalScrollBar, 'onValueChange', function(scrollbar, value)
|
||||||
local virtualOffset = self:getVirtualOffset()
|
local virtualOffset = self:getVirtualOffset()
|
||||||
virtualOffset.y = value
|
virtualOffset.y = value
|
||||||
self:setVirtualOffset(virtualOffset)
|
self:setVirtualOffset(virtualOffset)
|
||||||
if self.onScrollbarChange then self:onScrollbarChange(value) end
|
signalcall(self.onScrollChange, self, virtualOffset)
|
||||||
end
|
end)
|
||||||
self:updateScrollBars()
|
self:updateScrollBars()
|
||||||
end
|
end
|
||||||
|
|
||||||
function UIScrollArea:setHorizontalScrollBar(scrollbar)
|
function UIScrollArea:setHorizontalScrollBar(scrollbar)
|
||||||
self.horizontalScrollBar = scrollbar
|
self.horizontalScrollBar = scrollbar
|
||||||
self.horizontalScrollBar.onValueChange = function(scrollbar, value)
|
connect(self.horizontalScrollBar, 'onValueChange', function(scrollbar, value)
|
||||||
local virtualOffset = self:getVirtualOffset()
|
local virtualOffset = self:getVirtualOffset()
|
||||||
virtualOffset.x = value
|
virtualOffset.x = value
|
||||||
self:setVirtualOffset(virtualOffset)
|
self:setVirtualOffset(virtualOffset)
|
||||||
if self.onScrollbarChange then self:onScrollbarChange(value) end
|
signalcall(self.onScrollChange, self, virtualOffset)
|
||||||
end
|
end)
|
||||||
self:updateScrollBars()
|
self:updateScrollBars()
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -135,7 +135,7 @@ function UIScrollArea:ensureChildVisible(child)
|
|||||||
if deltaY > 0 then
|
if deltaY > 0 then
|
||||||
self.verticalScrollBar:increment(deltaY)
|
self.verticalScrollBar:increment(deltaY)
|
||||||
end
|
end
|
||||||
else
|
elseif self.horizontalScrollBar then
|
||||||
local deltaX = paddingRect.x - child:getX()
|
local deltaX = paddingRect.x - child:getX()
|
||||||
if deltaX > 0 then
|
if deltaX > 0 then
|
||||||
self.horizontalScrollBar:decrement(deltaX)
|
self.horizontalScrollBar:decrement(deltaX)
|
||||||
|
@@ -55,8 +55,7 @@ local function updateValueDisplay(widget)
|
|||||||
if widget == nil then return end
|
if widget == nil then return end
|
||||||
|
|
||||||
if widget:getShowValue() then
|
if widget:getShowValue() then
|
||||||
local symbol = widget:getSymbol()
|
widget:setText(widget:getValue() .. (widget:getSymbol() or ''))
|
||||||
widget:setText(widget:getValue()..(symbol and symbol or ''))
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -171,7 +170,10 @@ end
|
|||||||
|
|
||||||
function UIScrollBar:setMaximum(maximum)
|
function UIScrollBar:setMaximum(maximum)
|
||||||
if maximum == self.maximum then return end
|
if maximum == self.maximum then return end
|
||||||
self.maximum = maximum
|
self.maximum = maximum
|
||||||
|
if self.minimum > maximum then
|
||||||
|
self:setMinimum(maximum)
|
||||||
|
end
|
||||||
if self.value > maximum then
|
if self.value > maximum then
|
||||||
self:setValue(maximum)
|
self:setValue(maximum)
|
||||||
else
|
else
|
||||||
@@ -182,6 +184,9 @@ end
|
|||||||
function UIScrollBar:setMinimum(minimum)
|
function UIScrollBar:setMinimum(minimum)
|
||||||
if minimum == self.minimum then return end
|
if minimum == self.minimum then return end
|
||||||
self.minimum = minimum
|
self.minimum = minimum
|
||||||
|
if self.maximum < minimum then
|
||||||
|
self:setMaximum(minimum)
|
||||||
|
end
|
||||||
if self.value < minimum then
|
if self.value < minimum then
|
||||||
self:setValue(minimum)
|
self:setValue(minimum)
|
||||||
else
|
else
|
||||||
@@ -217,6 +222,13 @@ function UIScrollBar:setOrientation(orientation)
|
|||||||
self.orientation = orientation
|
self.orientation = orientation
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function UIScrollBar:setText(text)
|
||||||
|
local valueLabel = self:getChildById('valueLabel')
|
||||||
|
if valueLabel then
|
||||||
|
valueLabel:setText(text)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function UIScrollBar:onGeometryChange()
|
function UIScrollBar:onGeometryChange()
|
||||||
updateSlider(self)
|
updateSlider(self)
|
||||||
end
|
end
|
||||||
@@ -225,7 +237,7 @@ function UIScrollBar:onMouseWheel(mousePos, mouseWheel)
|
|||||||
if not self.mouseScroll then
|
if not self.mouseScroll then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
if mouseWheel == MouseWheelDown then
|
if mouseWheel == MouseWheelUp then
|
||||||
if self.orientation == 'vertical' then
|
if self.orientation == 'vertical' then
|
||||||
self:decrement()
|
self:decrement()
|
||||||
else
|
else
|
||||||
|
@@ -15,6 +15,11 @@ function UISpinBox.create()
|
|||||||
return spinbox
|
return spinbox
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function UISpinBox:onSetup()
|
||||||
|
g_mouse.bindAutoPress(self:getChildById('up'), function() self:up() end, 300)
|
||||||
|
g_mouse.bindAutoPress(self:getChildById('down'), function() self:down() end, 300)
|
||||||
|
end
|
||||||
|
|
||||||
function UISpinBox:onMouseWheel(mousePos, direction)
|
function UISpinBox:onMouseWheel(mousePos, direction)
|
||||||
if direction == MouseWheelUp then
|
if direction == MouseWheelUp then
|
||||||
self:up()
|
self:up()
|
||||||
|
@@ -110,7 +110,9 @@ function UITabBar:selectTab(tab)
|
|||||||
tab:setOn(false)
|
tab:setOn(false)
|
||||||
|
|
||||||
local parent = tab:getParent()
|
local parent = tab:getParent()
|
||||||
parent:focusChild(tab, MouseFocusReason)
|
if parent then
|
||||||
|
parent:focusChild(tab, MouseFocusReason)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function UITabBar:selectNextTab()
|
function UITabBar:selectNextTab()
|
||||||
@@ -144,3 +146,11 @@ end
|
|||||||
function UITabBar:getCurrentTab()
|
function UITabBar:getCurrentTab()
|
||||||
return self.currentTab
|
return self.currentTab
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function UITabBar:getTabs()
|
||||||
|
return self.tabs
|
||||||
|
end
|
||||||
|
|
||||||
|
function UITabBar:getTabsPanel()
|
||||||
|
return table.collect(self.tabs, function(_,tab) return tab.tabPanel end)
|
||||||
|
end
|
||||||
|
@@ -19,14 +19,15 @@ function UITextEdit:onMouseWheel(mousePos, mouseWheel)
|
|||||||
else
|
else
|
||||||
self.verticalScrollBar:increment()
|
self.verticalScrollBar:increment()
|
||||||
end
|
end
|
||||||
|
return true
|
||||||
elseif self.horizontalScrollBar then
|
elseif self.horizontalScrollBar then
|
||||||
if mouseWheel == MouseWheelUp then
|
if mouseWheel == MouseWheelUp then
|
||||||
self.horizontalScrollBar:increment()
|
self.horizontalScrollBar:increment()
|
||||||
else
|
else
|
||||||
self.horizontalScrollBar:decrement()
|
self.horizontalScrollBar:decrement()
|
||||||
end
|
end
|
||||||
|
return true
|
||||||
end
|
end
|
||||||
return true
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function UITextEdit:onTextAreaUpdate(virtualOffset, virtualSize, totalSize)
|
function UITextEdit:onTextAreaUpdate(virtualOffset, virtualSize, totalSize)
|
||||||
|
@@ -67,6 +67,11 @@ function connect(object, arg1, arg2, arg3)
|
|||||||
elseif type(object[signal]) == 'function' then
|
elseif type(object[signal]) == 'function' then
|
||||||
object[signal] = { object[signal] }
|
object[signal] = { object[signal] }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if type(slot) ~= 'function' then
|
||||||
|
perror(debug.traceback('unable to connect a non function value'))
|
||||||
|
end
|
||||||
|
|
||||||
if type(object[signal]) == 'table' then
|
if type(object[signal]) == 'table' then
|
||||||
if pushFront then
|
if pushFront then
|
||||||
table.insert(object[signal], 1, slot)
|
table.insert(object[signal], 1, slot)
|
||||||
@@ -80,9 +85,15 @@ end
|
|||||||
function disconnect(object, arg1, arg2)
|
function disconnect(object, arg1, arg2)
|
||||||
local signalsAndSlots
|
local signalsAndSlots
|
||||||
if type(arg1) == 'string' then
|
if type(arg1) == 'string' then
|
||||||
|
if arg2 == nil then
|
||||||
|
object[arg1] = nil
|
||||||
|
return
|
||||||
|
end
|
||||||
signalsAndSlots = { [arg1] = arg2 }
|
signalsAndSlots = { [arg1] = arg2 }
|
||||||
else
|
elseif type(arg1) == 'table' then
|
||||||
signalsAndSlots = arg1
|
signalsAndSlots = arg1
|
||||||
|
else
|
||||||
|
perror(debug.traceback('unable to disconnect'))
|
||||||
end
|
end
|
||||||
|
|
||||||
for signal,slot in pairs(signalsAndSlots) do
|
for signal,slot in pairs(signalsAndSlots) do
|
||||||
|
@@ -1,11 +1,16 @@
|
|||||||
battleWindow = nil
|
battleWindow = nil
|
||||||
battleButton = nil
|
battleButton = nil
|
||||||
battlePanel = nil
|
battlePanel = nil
|
||||||
|
filterPanel = nil
|
||||||
|
toggleFilterButton = nil
|
||||||
lastBattleButtonSwitched = nil
|
lastBattleButtonSwitched = nil
|
||||||
battleButtonsByCreaturesList = {}
|
battleButtonsByCreaturesList = {}
|
||||||
|
creatureAgeList = {}
|
||||||
|
|
||||||
mouseWidget = nil
|
mouseWidget = nil
|
||||||
|
|
||||||
|
sortTypeBox = nil
|
||||||
|
sortOrderBox = nil
|
||||||
hidePlayersButton = nil
|
hidePlayersButton = nil
|
||||||
hideNPCsButton = nil
|
hideNPCsButton = nil
|
||||||
hideMonstersButton = nil
|
hideMonstersButton = nil
|
||||||
@@ -25,6 +30,15 @@ function init()
|
|||||||
|
|
||||||
battlePanel = battleWindow:recursiveGetChildById('battlePanel')
|
battlePanel = battleWindow:recursiveGetChildById('battlePanel')
|
||||||
|
|
||||||
|
filterPanel = battleWindow:recursiveGetChildById('filterPanel')
|
||||||
|
toggleFilterButton = battleWindow:recursiveGetChildById('toggleFilterButton')
|
||||||
|
|
||||||
|
if isHidingFilters() then
|
||||||
|
hideFilterPanel()
|
||||||
|
end
|
||||||
|
|
||||||
|
sortTypeBox = battleWindow:recursiveGetChildById('sortTypeBox')
|
||||||
|
sortOrderBox = battleWindow:recursiveGetChildById('sortOrderBox')
|
||||||
hidePlayersButton = battleWindow:recursiveGetChildById('hidePlayers')
|
hidePlayersButton = battleWindow:recursiveGetChildById('hidePlayers')
|
||||||
hideNPCsButton = battleWindow:recursiveGetChildById('hideNPCs')
|
hideNPCsButton = battleWindow:recursiveGetChildById('hideNPCs')
|
||||||
hideMonstersButton = battleWindow:recursiveGetChildById('hideMonsters')
|
hideMonstersButton = battleWindow:recursiveGetChildById('hideMonsters')
|
||||||
@@ -38,6 +52,18 @@ function init()
|
|||||||
|
|
||||||
battleWindow:setContentMinimumHeight(80)
|
battleWindow:setContentMinimumHeight(80)
|
||||||
|
|
||||||
|
sortTypeBox:addOption('Name', 'name')
|
||||||
|
sortTypeBox:addOption('Distance', 'distance')
|
||||||
|
sortTypeBox:addOption('Age', 'age')
|
||||||
|
sortTypeBox:addOption('Health', 'health')
|
||||||
|
sortTypeBox:setCurrentOptionByData(getSortType())
|
||||||
|
sortTypeBox.onOptionChange = onChangeSortType
|
||||||
|
|
||||||
|
sortOrderBox:addOption('Asc.', 'asc')
|
||||||
|
sortOrderBox:addOption('Desc.', 'desc')
|
||||||
|
sortOrderBox:setCurrentOptionByData(getSortOrder())
|
||||||
|
sortOrderBox.onOptionChange = onChangeSortOrder
|
||||||
|
|
||||||
connect(Creature, {
|
connect(Creature, {
|
||||||
onSkullChange = updateCreatureSkull,
|
onSkullChange = updateCreatureSkull,
|
||||||
onEmblemChange = updateCreatureEmblem,
|
onEmblemChange = updateCreatureEmblem,
|
||||||
@@ -47,6 +73,10 @@ function init()
|
|||||||
onAppear = onCreatureAppear,
|
onAppear = onCreatureAppear,
|
||||||
onDisappear = onCreatureDisappear
|
onDisappear = onCreatureDisappear
|
||||||
})
|
})
|
||||||
|
|
||||||
|
connect(LocalPlayer, {
|
||||||
|
onPositionChange = onCreaturePositionChange
|
||||||
|
})
|
||||||
|
|
||||||
connect(g_game, {
|
connect(g_game, {
|
||||||
onAttackingCreatureChange = onAttack,
|
onAttackingCreatureChange = onAttack,
|
||||||
@@ -75,6 +105,10 @@ function terminate()
|
|||||||
onDisappear = onCreatureDisappear
|
onDisappear = onCreatureDisappear
|
||||||
})
|
})
|
||||||
|
|
||||||
|
disconnect(LocalPlayer, {
|
||||||
|
onPositionChange = onCreaturePositionChange
|
||||||
|
})
|
||||||
|
|
||||||
disconnect(g_game, {
|
disconnect(g_game, {
|
||||||
onAttackingCreatureChange = onAttack,
|
onAttackingCreatureChange = onAttack,
|
||||||
onFollowingCreatureChange = onFollow,
|
onFollowingCreatureChange = onFollow,
|
||||||
@@ -96,6 +130,93 @@ function onMiniWindowClose()
|
|||||||
battleButton:setOn(false)
|
battleButton:setOn(false)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function getSortType()
|
||||||
|
local settings = g_settings.getNode('BattleList')
|
||||||
|
if not settings then
|
||||||
|
return 'name'
|
||||||
|
end
|
||||||
|
return settings['sortType']
|
||||||
|
end
|
||||||
|
|
||||||
|
function setSortType(state)
|
||||||
|
settings = {}
|
||||||
|
settings['sortType'] = state
|
||||||
|
g_settings.mergeNode('BattleList', settings)
|
||||||
|
|
||||||
|
checkCreatures()
|
||||||
|
end
|
||||||
|
|
||||||
|
function getSortOrder()
|
||||||
|
local settings = g_settings.getNode('BattleList')
|
||||||
|
if not settings then
|
||||||
|
return 'asc'
|
||||||
|
end
|
||||||
|
return settings['sortOrder']
|
||||||
|
end
|
||||||
|
|
||||||
|
function setSortOrder(state)
|
||||||
|
settings = {}
|
||||||
|
settings['sortOrder'] = state
|
||||||
|
g_settings.mergeNode('BattleList', settings)
|
||||||
|
|
||||||
|
checkCreatures()
|
||||||
|
end
|
||||||
|
|
||||||
|
function isSortAsc()
|
||||||
|
return getSortOrder() == 'asc'
|
||||||
|
end
|
||||||
|
|
||||||
|
function isSortDesc()
|
||||||
|
return getSortOrder() == 'desc'
|
||||||
|
end
|
||||||
|
|
||||||
|
function isHidingFilters()
|
||||||
|
local settings = g_settings.getNode('BattleList')
|
||||||
|
if not settings then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
return settings['hidingFilters']
|
||||||
|
end
|
||||||
|
|
||||||
|
function setHidingFilters(state)
|
||||||
|
settings = {}
|
||||||
|
settings['hidingFilters'] = state
|
||||||
|
g_settings.mergeNode('BattleList', settings)
|
||||||
|
end
|
||||||
|
|
||||||
|
function hideFilterPanel()
|
||||||
|
filterPanel.originalHeight = filterPanel:getHeight()
|
||||||
|
filterPanel:setHeight(0)
|
||||||
|
toggleFilterButton:getParent():setMarginTop(0)
|
||||||
|
toggleFilterButton:setImageClip(torect("0 0 21 12"))
|
||||||
|
setHidingFilters(true)
|
||||||
|
filterPanel:setVisible(false)
|
||||||
|
end
|
||||||
|
|
||||||
|
function showFilterPanel()
|
||||||
|
toggleFilterButton:getParent():setMarginTop(5)
|
||||||
|
filterPanel:setHeight(filterPanel.originalHeight)
|
||||||
|
toggleFilterButton:setImageClip(torect("21 0 21 12"))
|
||||||
|
setHidingFilters(false)
|
||||||
|
filterPanel:setVisible(true)
|
||||||
|
end
|
||||||
|
|
||||||
|
function toggleFilterPanel()
|
||||||
|
if filterPanel:isVisible() then
|
||||||
|
hideFilterPanel()
|
||||||
|
else
|
||||||
|
showFilterPanel()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function onChangeSortType(comboBox, option)
|
||||||
|
setSortType(option:lower())
|
||||||
|
end
|
||||||
|
|
||||||
|
function onChangeSortOrder(comboBox, option)
|
||||||
|
setSortOrder(option:lower():gsub('[.]', '')) -- Replace dot in option name
|
||||||
|
end
|
||||||
|
|
||||||
function checkCreatures()
|
function checkCreatures()
|
||||||
removeAllCreatures()
|
removeAllCreatures()
|
||||||
|
|
||||||
@@ -151,15 +272,42 @@ end
|
|||||||
function onCreatureHealthPercentChange(creature, health)
|
function onCreatureHealthPercentChange(creature, health)
|
||||||
local battleButton = battleButtonsByCreaturesList[creature:getId()]
|
local battleButton = battleButtonsByCreaturesList[creature:getId()]
|
||||||
if battleButton then
|
if battleButton then
|
||||||
|
if getSortType() == 'health' then
|
||||||
|
removeCreature(creature)
|
||||||
|
addCreature(creature)
|
||||||
|
return
|
||||||
|
end
|
||||||
battleButton:setLifeBarPercent(creature:getHealthPercent())
|
battleButton:setLifeBarPercent(creature:getHealthPercent())
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function getDistanceBetween(p1, p2)
|
||||||
|
return math.max(math.abs(p1.x - p2.x), math.abs(p1.y - p2.y))
|
||||||
|
end
|
||||||
|
|
||||||
function onCreaturePositionChange(creature, newPos, oldPos)
|
function onCreaturePositionChange(creature, newPos, oldPos)
|
||||||
if creature:isLocalPlayer() then
|
if creature:isLocalPlayer() then
|
||||||
if oldPos and newPos and newPos.z ~= oldPos.z then
|
if oldPos and newPos and newPos.z ~= oldPos.z then
|
||||||
checkCreatures()
|
checkCreatures()
|
||||||
else
|
else
|
||||||
|
-- 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})
|
||||||
|
end
|
||||||
|
|
||||||
|
if isSortAsc() then
|
||||||
|
table.sort(distanceList, function(a, b) return a.distance < b.distance end)
|
||||||
|
else
|
||||||
|
table.sort(distanceList, function(a, b) return a.distance > b.distance end)
|
||||||
|
end
|
||||||
|
|
||||||
|
for i = 1, #distanceList do
|
||||||
|
battlePanel:moveChildToIndex(distanceList[i].widget, i)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
for id, creatureButton in pairs(battleButtonsByCreaturesList) do
|
for id, creatureButton in pairs(battleButtonsByCreaturesList) do
|
||||||
addCreature(creatureButton.creature)
|
addCreature(creatureButton.creature)
|
||||||
end
|
end
|
||||||
@@ -170,6 +318,9 @@ function onCreaturePositionChange(creature, newPos, oldPos)
|
|||||||
if has and not fit then
|
if has and not fit then
|
||||||
removeCreature(creature)
|
removeCreature(creature)
|
||||||
elseif fit then
|
elseif fit then
|
||||||
|
if has and getSortType() == 'distance' then
|
||||||
|
removeCreature(creature)
|
||||||
|
end
|
||||||
addCreature(creature)
|
addCreature(creature)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -201,8 +352,13 @@ function addCreature(creature)
|
|||||||
local creatureId = creature:getId()
|
local creatureId = creature:getId()
|
||||||
local battleButton = battleButtonsByCreaturesList[creatureId]
|
local battleButton = battleButtonsByCreaturesList[creatureId]
|
||||||
|
|
||||||
|
-- Register when creature is added to battlelist for the first time
|
||||||
|
if not creatureAgeList[creatureId] then
|
||||||
|
creatureAgeList[creatureId] = os.time()
|
||||||
|
end
|
||||||
|
|
||||||
if not battleButton then
|
if not battleButton then
|
||||||
battleButton = g_ui.createWidget('BattleButton', battlePanel)
|
battleButton = g_ui.createWidget('BattleButton')
|
||||||
battleButton:setup(creature)
|
battleButton:setup(creature)
|
||||||
|
|
||||||
battleButton.onHoverChange = onBattleButtonHoverChange
|
battleButton.onHoverChange = onBattleButtonHoverChange
|
||||||
@@ -217,6 +373,77 @@ function addCreature(creature)
|
|||||||
if creature == g_game.getFollowingCreature() then
|
if creature == g_game.getFollowingCreature() then
|
||||||
onFollow(creature)
|
onFollow(creature)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local inserted = false
|
||||||
|
local nameLower = creature:getName():lower()
|
||||||
|
local healthPercent = creature:getHealthPercent()
|
||||||
|
local playerPosition = g_game.getLocalPlayer():getPosition()
|
||||||
|
local distance = getDistanceBetween(playerPosition, creature:getPosition())
|
||||||
|
local age = creatureAgeList[creatureId]
|
||||||
|
|
||||||
|
local childCount = battlePanel:getChildCount()
|
||||||
|
for i = 1, childCount do
|
||||||
|
local child = battlePanel:getChildByIndex(i)
|
||||||
|
local childName = child:getCreature():getName():lower()
|
||||||
|
local equal = false
|
||||||
|
if getSortType() == 'age' then
|
||||||
|
local childAge = creatureAgeList[child:getCreature():getId()]
|
||||||
|
if (age < childAge and isSortAsc()) or (age > childAge and isSortDesc()) then
|
||||||
|
battlePanel:insertChild(i, battleButton)
|
||||||
|
inserted = true
|
||||||
|
break
|
||||||
|
elseif age == childAge then
|
||||||
|
equal = true
|
||||||
|
end
|
||||||
|
elseif getSortType() == 'distance' then
|
||||||
|
local childDistance = getDistanceBetween(child:getCreature():getPosition(), playerPosition)
|
||||||
|
if (distance < childDistance and isSortAsc()) or (distance > childDistance and isSortDesc()) then
|
||||||
|
battlePanel:insertChild(i, battleButton)
|
||||||
|
inserted = true
|
||||||
|
break
|
||||||
|
elseif childDistance == distance then
|
||||||
|
equal = true
|
||||||
|
end
|
||||||
|
elseif getSortType() == 'health' then
|
||||||
|
local childHealth = child:getCreature():getHealthPercent()
|
||||||
|
if (healthPercent < childHealth and isSortAsc()) or (healthPercent > childHealth and isSortDesc()) then
|
||||||
|
battlePanel:insertChild(i, battleButton)
|
||||||
|
inserted = true
|
||||||
|
break
|
||||||
|
elseif healthPercent == childHealth then
|
||||||
|
equal = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- If any other sort type is selected and values are equal, sort it by name also
|
||||||
|
if getSortType() == 'name' or equal then
|
||||||
|
local length = math.min(childName:len(), nameLower:len())
|
||||||
|
for j=1,length do
|
||||||
|
if (nameLower:byte(j) < childName:byte(j) and isSortAsc()) or (nameLower:byte(j) > childName:byte(j) and isSortDesc()) then
|
||||||
|
battlePanel:insertChild(i, battleButton)
|
||||||
|
inserted = true
|
||||||
|
break
|
||||||
|
elseif (nameLower:byte(j) > childName:byte(j) and isSortAsc()) or (nameLower:byte(j) < childName:byte(j) and isSortDesc()) then
|
||||||
|
break
|
||||||
|
elseif j == nameLower:len() and isSortAsc() then
|
||||||
|
battlePanel:insertChild(i, battleButton)
|
||||||
|
inserted = true
|
||||||
|
elseif j == childName:len() and isSortDesc() then
|
||||||
|
battlePanel:insertChild(i, battleButton)
|
||||||
|
inserted = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if inserted then
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Insert at the end if no other place is found
|
||||||
|
if not inserted then
|
||||||
|
battlePanel:insertChild(childCount + 1, battleButton)
|
||||||
|
end
|
||||||
else
|
else
|
||||||
battleButton:setLifeBarPercent(creature:getHealthPercent())
|
battleButton:setLifeBarPercent(creature:getHealthPercent())
|
||||||
end
|
end
|
||||||
@@ -226,6 +453,7 @@ function addCreature(creature)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function removeAllCreatures()
|
function removeAllCreatures()
|
||||||
|
creatureAgeList = {}
|
||||||
for i, v in pairs(battleButtonsByCreaturesList) do
|
for i, v in pairs(battleButtonsByCreaturesList) do
|
||||||
removeCreature(v.creature)
|
removeCreature(v.creature)
|
||||||
end
|
end
|
||||||
|
@@ -45,11 +45,12 @@ MiniWindow
|
|||||||
&save: true
|
&save: true
|
||||||
|
|
||||||
Panel
|
Panel
|
||||||
|
id: filterPanel
|
||||||
margin-top: 26
|
margin-top: 26
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: miniwindowScrollBar.left
|
anchors.right: miniwindowScrollBar.left
|
||||||
height: 20
|
height: 45
|
||||||
|
|
||||||
Panel
|
Panel
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
@@ -85,16 +86,56 @@ MiniWindow
|
|||||||
!tooltip: tr('Hide party members')
|
!tooltip: tr('Hide party members')
|
||||||
@onCheckChange: modules.game_battle.checkCreatures()
|
@onCheckChange: modules.game_battle.checkCreatures()
|
||||||
|
|
||||||
HorizontalSeparator
|
Panel
|
||||||
|
anchors.top: prev.bottom
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
height: 20
|
||||||
|
width: 128
|
||||||
|
margin-top: 6
|
||||||
|
|
||||||
|
ComboBox
|
||||||
|
id: sortTypeBox
|
||||||
|
width: 74
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.left: prev.right
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
margin-left: -28
|
||||||
|
|
||||||
|
ComboBox
|
||||||
|
id: sortOrderBox
|
||||||
|
width: 54
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.left: prev.right
|
||||||
|
margin-left: 4
|
||||||
|
|
||||||
|
Panel
|
||||||
|
height: 18
|
||||||
anchors.top: prev.bottom
|
anchors.top: prev.bottom
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: miniwindowScrollBar.left
|
anchors.right: miniwindowScrollBar.left
|
||||||
margin-right: 1
|
margin-top: 5
|
||||||
margin-top: 4
|
|
||||||
|
|
||||||
|
UIWidget
|
||||||
|
id: toggleFilterButton
|
||||||
|
anchors.top: prev.top
|
||||||
|
width: 21
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
image-source: /images/ui/arrow_vertical
|
||||||
|
image-rect: 0 0 21 12
|
||||||
|
image-clip: 21 0 21 12
|
||||||
|
@onClick: modules.game_battle.toggleFilterPanel()
|
||||||
|
phantom: false
|
||||||
|
|
||||||
|
HorizontalSeparator
|
||||||
|
anchors.top: prev.top
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: miniwindowScrollBar.left
|
||||||
|
margin-right: 1
|
||||||
|
margin-top: 11
|
||||||
|
|
||||||
MiniWindowContents
|
MiniWindowContents
|
||||||
anchors.top: prev.bottom
|
anchors.top: prev.bottom
|
||||||
margin-top: 0
|
margin-top: 6
|
||||||
|
|
||||||
Panel
|
Panel
|
||||||
id: battlePanel
|
id: battlePanel
|
||||||
|
@@ -5,7 +5,14 @@ fightBalancedBox = nil
|
|||||||
fightDefensiveBox = nil
|
fightDefensiveBox = nil
|
||||||
chaseModeButton = nil
|
chaseModeButton = nil
|
||||||
safeFightButton = nil
|
safeFightButton = nil
|
||||||
|
whiteDoveBox = nil
|
||||||
|
whiteHandBox = nil
|
||||||
|
yellowHandBox = nil
|
||||||
|
redFistBox = nil
|
||||||
|
mountButton = nil
|
||||||
|
pvpModesPanel = nil
|
||||||
fightModeRadioGroup = nil
|
fightModeRadioGroup = nil
|
||||||
|
pvpModeRadioGroup = nil
|
||||||
|
|
||||||
function init()
|
function init()
|
||||||
combatControlsButton = modules.client_topmenu.addRightGameToggleButton('combatControlsButton', tr('Combat Controls'), '/images/topbuttons/combatcontrols', toggle)
|
combatControlsButton = modules.client_topmenu.addRightGameToggleButton('combatControlsButton', tr('Combat Controls'), '/images/topbuttons/combatcontrols', toggle)
|
||||||
@@ -16,15 +23,33 @@ function init()
|
|||||||
fightOffensiveBox = combatControlsWindow:recursiveGetChildById('fightOffensiveBox')
|
fightOffensiveBox = combatControlsWindow:recursiveGetChildById('fightOffensiveBox')
|
||||||
fightBalancedBox = combatControlsWindow:recursiveGetChildById('fightBalancedBox')
|
fightBalancedBox = combatControlsWindow:recursiveGetChildById('fightBalancedBox')
|
||||||
fightDefensiveBox = combatControlsWindow:recursiveGetChildById('fightDefensiveBox')
|
fightDefensiveBox = combatControlsWindow:recursiveGetChildById('fightDefensiveBox')
|
||||||
|
|
||||||
chaseModeButton = combatControlsWindow:recursiveGetChildById('chaseModeBox')
|
chaseModeButton = combatControlsWindow:recursiveGetChildById('chaseModeBox')
|
||||||
safeFightButton = combatControlsWindow:recursiveGetChildById('safeFightBox')
|
safeFightButton = combatControlsWindow:recursiveGetChildById('safeFightBox')
|
||||||
|
|
||||||
|
mountButton = combatControlsWindow:recursiveGetChildById('mountButton')
|
||||||
|
mountButton.onClick = onMountButtonClick
|
||||||
|
|
||||||
|
pvpModesPanel = combatControlsWindow:recursiveGetChildById('pvpModesPanel')
|
||||||
|
|
||||||
|
whiteDoveBox = combatControlsWindow:recursiveGetChildById('whiteDoveBox')
|
||||||
|
whiteHandBox = combatControlsWindow:recursiveGetChildById('whiteHandBox')
|
||||||
|
yellowHandBox = combatControlsWindow:recursiveGetChildById('yellowHandBox')
|
||||||
|
redFistBox = combatControlsWindow:recursiveGetChildById('redFistBox')
|
||||||
|
|
||||||
fightModeRadioGroup = UIRadioGroup.create()
|
fightModeRadioGroup = UIRadioGroup.create()
|
||||||
fightModeRadioGroup:addWidget(fightOffensiveBox)
|
fightModeRadioGroup:addWidget(fightOffensiveBox)
|
||||||
fightModeRadioGroup:addWidget(fightBalancedBox)
|
fightModeRadioGroup:addWidget(fightBalancedBox)
|
||||||
fightModeRadioGroup:addWidget(fightDefensiveBox)
|
fightModeRadioGroup:addWidget(fightDefensiveBox)
|
||||||
|
|
||||||
|
pvpModeRadioGroup = UIRadioGroup.create()
|
||||||
|
pvpModeRadioGroup:addWidget(whiteDoveBox)
|
||||||
|
pvpModeRadioGroup:addWidget(whiteHandBox)
|
||||||
|
pvpModeRadioGroup:addWidget(yellowHandBox)
|
||||||
|
pvpModeRadioGroup:addWidget(redFistBox)
|
||||||
|
|
||||||
connect(fightModeRadioGroup, { onSelectionChange = onSetFightMode })
|
connect(fightModeRadioGroup, { onSelectionChange = onSetFightMode })
|
||||||
|
connect(pvpModeRadioGroup, { onSelectionChange = onSetPVPMode })
|
||||||
connect(chaseModeButton, { onCheckChange = onSetChaseMode })
|
connect(chaseModeButton, { onCheckChange = onSetChaseMode })
|
||||||
connect(safeFightButton, { onCheckChange = onSetSafeFight })
|
connect(safeFightButton, { onCheckChange = onSetSafeFight })
|
||||||
connect(g_game, {
|
connect(g_game, {
|
||||||
@@ -33,9 +58,12 @@ function init()
|
|||||||
onFightModeChange = update,
|
onFightModeChange = update,
|
||||||
onChaseModeChange = update,
|
onChaseModeChange = update,
|
||||||
onSafeFightChange = update,
|
onSafeFightChange = update,
|
||||||
|
onPVPModeChange = update,
|
||||||
onWalk = check,
|
onWalk = check,
|
||||||
onAutoWalk = check
|
onAutoWalk = check
|
||||||
})
|
})
|
||||||
|
|
||||||
|
connect(LocalPlayer, { onOutfitChange = onOutfitChange })
|
||||||
|
|
||||||
if g_game.isOnline() then
|
if g_game.isOnline() then
|
||||||
online()
|
online()
|
||||||
@@ -50,6 +78,7 @@ function terminate()
|
|||||||
end
|
end
|
||||||
|
|
||||||
fightModeRadioGroup:destroy()
|
fightModeRadioGroup:destroy()
|
||||||
|
pvpModeRadioGroup:destroy()
|
||||||
combatControlsWindow:destroy()
|
combatControlsWindow:destroy()
|
||||||
combatControlsButton:destroy()
|
combatControlsButton:destroy()
|
||||||
|
|
||||||
@@ -59,9 +88,12 @@ function terminate()
|
|||||||
onFightModeChange = update,
|
onFightModeChange = update,
|
||||||
onChaseModeChange = update,
|
onChaseModeChange = update,
|
||||||
onSafeFightChange = update,
|
onSafeFightChange = update,
|
||||||
|
onPVPModeChange = update,
|
||||||
onWalk = check,
|
onWalk = check,
|
||||||
onAutoWalk = check
|
onAutoWalk = check
|
||||||
})
|
})
|
||||||
|
|
||||||
|
disconnect(LocalPlayer, { onOutfitChange = onOutfitChange })
|
||||||
end
|
end
|
||||||
|
|
||||||
function update()
|
function update()
|
||||||
@@ -79,6 +111,14 @@ function update()
|
|||||||
|
|
||||||
local safeFight = g_game.isSafeFight()
|
local safeFight = g_game.isSafeFight()
|
||||||
safeFightButton:setChecked(not safeFight)
|
safeFightButton:setChecked(not safeFight)
|
||||||
|
|
||||||
|
if g_game.getFeature(GamePVPMode) then
|
||||||
|
local pvpMode = g_game.getPVPMode()
|
||||||
|
local pvpWidget = getPVPBoxByMode(pvpMode)
|
||||||
|
if pvpWidget then
|
||||||
|
pvpModeRadioGroup:selectWidget(pvpWidget)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function check()
|
function check()
|
||||||
@@ -101,8 +141,26 @@ function online()
|
|||||||
g_game.setFightMode(lastCombatControls[char].fightMode)
|
g_game.setFightMode(lastCombatControls[char].fightMode)
|
||||||
g_game.setChaseMode(lastCombatControls[char].chaseMode)
|
g_game.setChaseMode(lastCombatControls[char].chaseMode)
|
||||||
g_game.setSafeFight(lastCombatControls[char].safeFight)
|
g_game.setSafeFight(lastCombatControls[char].safeFight)
|
||||||
|
if lastCombatControls[char].pvpMode then
|
||||||
|
g_game.setPVPMode(lastCombatControls[char].pvpMode)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if g_game.getFeature(GamePlayerMounts) then
|
||||||
|
mountButton:setVisible(true)
|
||||||
|
mountButton:setChecked(player:isMounted())
|
||||||
|
else
|
||||||
|
mountButton:setVisible(false)
|
||||||
|
end
|
||||||
|
|
||||||
|
if g_game.getFeature(GamePVPMode) then
|
||||||
|
pvpModesPanel:setVisible(true)
|
||||||
|
combatControlsWindow:setHeight(combatControlsWindow.extendedControlsHeight)
|
||||||
|
else
|
||||||
|
pvpModesPanel:setVisible(false)
|
||||||
|
combatControlsWindow:setHeight(combatControlsWindow.simpleControlsHeight)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
update()
|
update()
|
||||||
@@ -123,6 +181,10 @@ function offline()
|
|||||||
safeFight = g_game.isSafeFight()
|
safeFight = g_game.isSafeFight()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if g_game.getFeature(GamePVPMode) then
|
||||||
|
lastCombatControls[char].pvpMode = g_game.getPVPMode()
|
||||||
|
end
|
||||||
|
|
||||||
-- save last combat control settings
|
-- save last combat control settings
|
||||||
g_settings.setNode('LastCombatControls', lastCombatControls)
|
g_settings.setNode('LastCombatControls', lastCombatControls)
|
||||||
end
|
end
|
||||||
@@ -166,6 +228,55 @@ function onSetSafeFight(self, checked)
|
|||||||
g_game.setSafeFight(not checked)
|
g_game.setSafeFight(not checked)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function onSetPVPMode(self, selectedPVPButton)
|
||||||
|
if selectedPVPButton == nil then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local buttonId = selectedPVPButton:getId()
|
||||||
|
local pvpMode = PVPWhiteDove
|
||||||
|
if buttonId == 'whiteDoveBox' then
|
||||||
|
pvpMode = PVPWhiteDove
|
||||||
|
elseif buttonId == 'whiteHandBox' then
|
||||||
|
pvpMode = PVPWhiteHand
|
||||||
|
elseif buttonId == 'yellowHandBox' then
|
||||||
|
pvpMode = PVPYellowHand
|
||||||
|
elseif buttonId == 'redFistBox' then
|
||||||
|
pvpMode = PVPRedFist
|
||||||
|
end
|
||||||
|
|
||||||
|
g_game.setPVPMode(pvpMode)
|
||||||
|
end
|
||||||
|
|
||||||
function onMiniWindowClose()
|
function onMiniWindowClose()
|
||||||
combatControlsButton:setOn(false)
|
combatControlsButton:setOn(false)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function onMountButtonClick(self, mousePos)
|
||||||
|
local player = g_game.getLocalPlayer()
|
||||||
|
if player then
|
||||||
|
player:toggleMount()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function onOutfitChange(localPlayer, outfit, oldOutfit)
|
||||||
|
if outfit.mount == oldOutfit.mount then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
mountButton:setChecked(outfit.mount ~= nil and outfit.mount > 0)
|
||||||
|
end
|
||||||
|
|
||||||
|
function getPVPBoxByMode(mode)
|
||||||
|
local widget = nil
|
||||||
|
if mode == PVPWhiteDove then
|
||||||
|
widget = whiteDoveBox
|
||||||
|
elseif mode == PVPWhiteHand then
|
||||||
|
widget = whiteHandBox
|
||||||
|
elseif mode == PVPYellowHand then
|
||||||
|
widget = yellowHandBox
|
||||||
|
elseif mode == PVPRedFist then
|
||||||
|
widget = redFistBox
|
||||||
|
end
|
||||||
|
return widget
|
||||||
|
end
|
||||||
|
@@ -1,12 +1,7 @@
|
|||||||
CombatBox < UICheckBox
|
CombatBox < UICheckBox
|
||||||
size: 20 20
|
size: 20 20
|
||||||
image-clip: 0 0 20 20
|
image-clip: 0 0 20 20
|
||||||
anchors.top: parent.top
|
margin: 2 4
|
||||||
margin: 0 4
|
|
||||||
$first:
|
|
||||||
margin: 0 1
|
|
||||||
$last:
|
|
||||||
margin: 0 1
|
|
||||||
|
|
||||||
$checked:
|
$checked:
|
||||||
image-clip: 0 20 20 20
|
image-clip: 0 20 20 20
|
||||||
@@ -21,33 +16,78 @@ ChaseModeBox < CombatBox
|
|||||||
image-source: /images/game/combatmodes/chasemode
|
image-source: /images/game/combatmodes/chasemode
|
||||||
SafeFightBox < CombatBox
|
SafeFightBox < CombatBox
|
||||||
image-source: /images/game/combatmodes/safefight
|
image-source: /images/game/combatmodes/safefight
|
||||||
|
|
||||||
|
MountButton < CombatBox
|
||||||
|
image-source: /images/game/combatmodes/mount
|
||||||
|
|
||||||
|
WhiteDoveBox < CombatBox
|
||||||
|
image-source: /images/game/combatmodes/whitedovemode
|
||||||
|
WhiteHandBox < CombatBox
|
||||||
|
image-source: /images/game/combatmodes/whitehandmode
|
||||||
|
YellowHandBox < CombatBox
|
||||||
|
image-source: /images/game/combatmodes/yellowhandmode
|
||||||
|
RedFistBox < CombatBox
|
||||||
|
image-source: /images/game/combatmodes/redfistmode
|
||||||
|
|
||||||
MiniWindow
|
MiniWindow
|
||||||
id: combatControlsWindow
|
id: combatControlsWindow
|
||||||
!text: tr('Combat Controls')
|
!text: tr('Combat Controls')
|
||||||
icon: /images/topbuttons/combatcontrols
|
icon: /images/topbuttons/combatcontrols
|
||||||
height: 48
|
height: 49
|
||||||
&save: true
|
&save: true
|
||||||
|
&simpleControlsHeight: 49
|
||||||
|
&extendedControlsHeight: 72
|
||||||
@onClose: modules.game_combatcontrols.onMiniWindowClose()
|
@onClose: modules.game_combatcontrols.onMiniWindowClose()
|
||||||
|
|
||||||
MiniWindowContents
|
MiniWindowContents
|
||||||
FightOffensiveBox
|
FightOffensiveBox
|
||||||
id: fightOffensiveBox
|
id: fightOffensiveBox
|
||||||
|
anchors.top: parent.top
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
margin: 2 1
|
||||||
FightBalancedBox
|
FightBalancedBox
|
||||||
id: fightBalancedBox
|
id: fightBalancedBox
|
||||||
|
anchors.top: parent.top
|
||||||
anchors.left: prev.right
|
anchors.left: prev.right
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
FightDefensiveBox
|
FightDefensiveBox
|
||||||
id: fightDefensiveBox
|
id: fightDefensiveBox
|
||||||
|
anchors.top: parent.top
|
||||||
anchors.left: prev.right
|
anchors.left: prev.right
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
MountButton
|
||||||
|
id: mountButton
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.right: next.left
|
||||||
ChaseModeBox
|
ChaseModeBox
|
||||||
id: chaseModeBox
|
id: chaseModeBox
|
||||||
|
anchors.top: parent.top
|
||||||
anchors.right: next.left
|
anchors.right: next.left
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
SafeFightBox
|
SafeFightBox
|
||||||
id: safeFightBox
|
id: safeFightBox
|
||||||
|
anchors.top: parent.top
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
margin: 2 1
|
||||||
|
|
||||||
|
Panel
|
||||||
|
id: pvpModesPanel
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
height: 20
|
||||||
|
|
||||||
|
WhiteDoveBox
|
||||||
|
id: whiteDoveBox
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
margin: 2 1
|
||||||
|
WhiteHandBox
|
||||||
|
id: whiteHandBox
|
||||||
|
anchors.left: prev.right
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
YellowHandBox
|
||||||
|
id: yellowHandBox
|
||||||
|
anchors.left: prev.right
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
RedFistBox
|
||||||
|
id: redFistBox
|
||||||
|
anchors.left: prev.right
|
||||||
|
anchors.bottom: parent.bottom
|
206
modules/game_console/communicationwindow.otui
Normal file
@@ -0,0 +1,206 @@
|
|||||||
|
IgnoreListLabel < Label
|
||||||
|
font: verdana-11px-monochrome
|
||||||
|
background-color: alpha
|
||||||
|
text-offset: 2 0
|
||||||
|
focusable: true
|
||||||
|
phantom: false
|
||||||
|
|
||||||
|
$focus:
|
||||||
|
background-color: #ffffff22
|
||||||
|
color: #ffffff
|
||||||
|
|
||||||
|
WhiteListLabel < Label
|
||||||
|
font: verdana-11px-monochrome
|
||||||
|
background-color: alpha
|
||||||
|
text-offset: 2 0
|
||||||
|
focusable: true
|
||||||
|
phantom: false
|
||||||
|
|
||||||
|
$focus:
|
||||||
|
background-color: #ffffff22
|
||||||
|
color: #ffffff
|
||||||
|
|
||||||
|
|
||||||
|
MainWindow
|
||||||
|
id: communicationWindow
|
||||||
|
!text: tr('Ignore List')
|
||||||
|
size: 515 410
|
||||||
|
@onEscape: self:destroy()
|
||||||
|
|
||||||
|
CheckBox
|
||||||
|
id: checkboxUseIgnoreList
|
||||||
|
!text: tr('Activate ignorelist')
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.top: parent.top
|
||||||
|
width: 180
|
||||||
|
|
||||||
|
Label
|
||||||
|
!text: tr('Ignored Players:')
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.top: prev.bottom
|
||||||
|
margin-top: 10
|
||||||
|
|
||||||
|
TextList
|
||||||
|
id: ignoreList
|
||||||
|
vertical-scrollbar: ignoreListScrollBar
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.top: prev.bottom
|
||||||
|
height: 150
|
||||||
|
width: 230
|
||||||
|
margin-bottom: 10
|
||||||
|
margin-top: 3
|
||||||
|
padding: 1
|
||||||
|
focusable: false
|
||||||
|
|
||||||
|
TextEdit
|
||||||
|
id: ignoreNameEdit
|
||||||
|
anchors.top: prev.bottom
|
||||||
|
anchors.left: parent.left
|
||||||
|
width: 110
|
||||||
|
margin-top: 5
|
||||||
|
|
||||||
|
Button
|
||||||
|
id: buttonIgnoreAdd
|
||||||
|
!text: tr('Add')
|
||||||
|
width: 48
|
||||||
|
height: 20
|
||||||
|
margin-left: 5
|
||||||
|
anchors.top: prev.top
|
||||||
|
anchors.left: prev.right
|
||||||
|
|
||||||
|
Button
|
||||||
|
id: buttonIgnoreRemove
|
||||||
|
!text: tr('Remove')
|
||||||
|
width: 64
|
||||||
|
height: 20
|
||||||
|
margin-left: 5
|
||||||
|
anchors.top: prev.top
|
||||||
|
anchors.left: prev.right
|
||||||
|
|
||||||
|
Label
|
||||||
|
!text: tr('Global ignore settings')
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.top: prev.bottom
|
||||||
|
margin-top: 20
|
||||||
|
|
||||||
|
CheckBox
|
||||||
|
id: checkboxIgnorePrivateMessages
|
||||||
|
!text: tr('Ignore Private Messages')
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.top: prev.bottom
|
||||||
|
width: 180
|
||||||
|
margin-top: 5
|
||||||
|
|
||||||
|
CheckBox
|
||||||
|
id: checkboxIgnoreYelling
|
||||||
|
!text: tr('Ignore Yelling')
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.top: prev.bottom
|
||||||
|
width: 180
|
||||||
|
margin-top: 5
|
||||||
|
|
||||||
|
CheckBox
|
||||||
|
id: checkboxUseWhiteList
|
||||||
|
!text: tr('Activate whitelist')
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.left: ignoreList.right
|
||||||
|
margin-left: 20
|
||||||
|
width: 180
|
||||||
|
|
||||||
|
Label
|
||||||
|
!text: tr('Allowed Players:')
|
||||||
|
anchors.top: prev.bottom
|
||||||
|
anchors.left: prev.left
|
||||||
|
margin-top: 10
|
||||||
|
|
||||||
|
TextList
|
||||||
|
id: whiteList
|
||||||
|
vertical-scrollbar: whiteListScrollBar
|
||||||
|
anchors.left: prev.left
|
||||||
|
anchors.top: prev.bottom
|
||||||
|
height: 150
|
||||||
|
width: 230
|
||||||
|
margin-bottom: 10
|
||||||
|
margin-top: 3
|
||||||
|
padding: 1
|
||||||
|
focusable: false
|
||||||
|
|
||||||
|
TextEdit
|
||||||
|
id: whitelistNameEdit
|
||||||
|
anchors.top: prev.bottom
|
||||||
|
anchors.left: prev.left
|
||||||
|
width: 110
|
||||||
|
margin-top: 5
|
||||||
|
|
||||||
|
Button
|
||||||
|
id: buttonWhitelistAdd
|
||||||
|
!text: tr('Add')
|
||||||
|
width: 48
|
||||||
|
height: 20
|
||||||
|
margin-left: 5
|
||||||
|
anchors.top: prev.top
|
||||||
|
anchors.left: prev.right
|
||||||
|
|
||||||
|
Button
|
||||||
|
id: buttonWhitelistRemove
|
||||||
|
!text: tr('Remove')
|
||||||
|
width: 64
|
||||||
|
height: 20
|
||||||
|
margin-left: 5
|
||||||
|
anchors.top: prev.top
|
||||||
|
anchors.left: prev.right
|
||||||
|
|
||||||
|
Label
|
||||||
|
!text: tr('Global whitelist settings')
|
||||||
|
anchors.left: whiteList.left
|
||||||
|
anchors.top: prev.bottom
|
||||||
|
margin-top: 20
|
||||||
|
|
||||||
|
CheckBox
|
||||||
|
id: checkboxAllowVIPs
|
||||||
|
!text: tr('Allow VIPs to message you')
|
||||||
|
anchors.left: prev.left
|
||||||
|
anchors.top: prev.bottom
|
||||||
|
width: 180
|
||||||
|
margin-top: 5
|
||||||
|
|
||||||
|
Panel
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
height: 30
|
||||||
|
|
||||||
|
Panel
|
||||||
|
size: 160 30
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
|
||||||
|
Button
|
||||||
|
id: buttonSave
|
||||||
|
!text: tr('Save')
|
||||||
|
width: 75
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.left: parent.left
|
||||||
|
|
||||||
|
Button
|
||||||
|
id: buttonCancel
|
||||||
|
!text: tr('Cancel')
|
||||||
|
width: 75
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.left: prev.right
|
||||||
|
margin-left: 10
|
||||||
|
|
||||||
|
VerticalScrollBar
|
||||||
|
id: ignoreListScrollBar
|
||||||
|
anchors.top: ignoreList.top
|
||||||
|
anchors.bottom: ignoreList.bottom
|
||||||
|
anchors.right: ignoreList.right
|
||||||
|
step: 14
|
||||||
|
pixels-scroll: true
|
||||||
|
|
||||||
|
VerticalScrollBar
|
||||||
|
id: whiteListScrollBar
|
||||||
|
anchors.top: whiteList.top
|
||||||
|
anchors.bottom: whiteList.bottom
|
||||||
|
anchors.right: whiteList.right
|
||||||
|
step: 14
|
||||||
|
pixels-scroll: true
|
@@ -51,7 +51,7 @@ SayModes = {
|
|||||||
[3] = { speakTypeDesc = 'yell', icon = '/images/game/console/yell' }
|
[3] = { speakTypeDesc = 'yell', icon = '/images/game/console/yell' }
|
||||||
}
|
}
|
||||||
|
|
||||||
MAX_HISTORY = 1000
|
MAX_HISTORY = 500
|
||||||
MAX_LINES = 100
|
MAX_LINES = 100
|
||||||
HELP_CHANNEL = 9
|
HELP_CHANNEL = 9
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ consoleTabBar = nil
|
|||||||
consoleTextEdit = nil
|
consoleTextEdit = nil
|
||||||
channels = nil
|
channels = nil
|
||||||
channelsWindow = nil
|
channelsWindow = nil
|
||||||
ignoreWindow = nil
|
communicationWindow = nil
|
||||||
ownPrivateName = nil
|
ownPrivateName = nil
|
||||||
messageHistory = {}
|
messageHistory = {}
|
||||||
currentMessageIndex = 0
|
currentMessageIndex = 0
|
||||||
@@ -72,26 +72,33 @@ violationsChannelId = nil
|
|||||||
violationWindow = nil
|
violationWindow = nil
|
||||||
violationReportTab = nil
|
violationReportTab = nil
|
||||||
ignoredChannels = {}
|
ignoredChannels = {}
|
||||||
|
filters = {}
|
||||||
|
|
||||||
local ignoreSettings = {
|
local communicationSettings = {
|
||||||
|
useIgnoreList = true,
|
||||||
|
useWhiteList = true,
|
||||||
privateMessages = false,
|
privateMessages = false,
|
||||||
yelling = false,
|
yelling = false,
|
||||||
players = {}
|
allowVIPs = false,
|
||||||
|
ignoredPlayers = {},
|
||||||
|
whitelistedPlayers = {}
|
||||||
}
|
}
|
||||||
|
|
||||||
function init()
|
function init()
|
||||||
connect(g_game, { onTalk = onTalk,
|
connect(g_game, {
|
||||||
onChannelList = onChannelList,
|
onTalk = onTalk,
|
||||||
onOpenChannel = onOpenChannel,
|
onChannelList = onChannelList,
|
||||||
onOpenPrivateChannel = onOpenPrivateChannel,
|
onOpenChannel = onOpenChannel,
|
||||||
onOpenOwnPrivateChannel = onOpenOwnPrivateChannel,
|
onOpenPrivateChannel = onOpenPrivateChannel,
|
||||||
onCloseChannel = onCloseChannel,
|
onOpenOwnPrivateChannel = onOpenOwnPrivateChannel,
|
||||||
onRuleViolationChannel = onRuleViolationChannel,
|
onCloseChannel = onCloseChannel,
|
||||||
onRuleViolationRemove = onRuleViolationRemove,
|
onRuleViolationChannel = onRuleViolationChannel,
|
||||||
onRuleViolationCancel = onRuleViolationCancel,
|
onRuleViolationRemove = onRuleViolationRemove,
|
||||||
onRuleViolationLock = onRuleViolationLock,
|
onRuleViolationCancel = onRuleViolationCancel,
|
||||||
onGameStart = online,
|
onRuleViolationLock = onRuleViolationLock,
|
||||||
onGameEnd = offline })
|
onGameStart = online,
|
||||||
|
onGameEnd = offline
|
||||||
|
})
|
||||||
|
|
||||||
consolePanel = g_ui.loadUI('console', modules.game_interface.getBottomPanel())
|
consolePanel = g_ui.loadUI('console', modules.game_interface.getBottomPanel())
|
||||||
consoleTextEdit = consolePanel:getChildById('consoleTextEdit')
|
consoleTextEdit = consolePanel:getChildById('consoleTextEdit')
|
||||||
@@ -117,9 +124,6 @@ function init()
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
defaultTab = addTab(tr('Default'), true)
|
|
||||||
serverTab = addTab(tr('Server Log'), false)
|
|
||||||
|
|
||||||
g_keyboard.bindKeyPress('Shift+Up', function() navigateMessageHistory(1) end, consolePanel)
|
g_keyboard.bindKeyPress('Shift+Up', function() navigateMessageHistory(1) end, consolePanel)
|
||||||
g_keyboard.bindKeyPress('Shift+Down', function() navigateMessageHistory(-1) end, consolePanel)
|
g_keyboard.bindKeyPress('Shift+Down', function() navigateMessageHistory(-1) end, consolePanel)
|
||||||
g_keyboard.bindKeyPress('Tab', function() consoleTabBar:selectNextTab() end, consolePanel)
|
g_keyboard.bindKeyPress('Tab', function() consoleTabBar:selectNextTab() end, consolePanel)
|
||||||
@@ -128,32 +132,86 @@ function init()
|
|||||||
g_keyboard.bindKeyPress('Ctrl+A', function() consoleTextEdit:clearText() end, consolePanel)
|
g_keyboard.bindKeyPress('Ctrl+A', function() consoleTextEdit:clearText() end, consolePanel)
|
||||||
|
|
||||||
-- apply buttom functions after loaded
|
-- apply buttom functions after loaded
|
||||||
consolePanel:getChildById('nextChannelButton').onClick = function() consoleTabBar:selectNextTab() end
|
consoleTabBar:setNavigation(consolePanel:getChildById('prevChannelButton'), consolePanel:getChildById('nextChannelButton'))
|
||||||
consolePanel:getChildById('prevChannelButton').onClick = function() consoleTabBar:selectPrevTab() end
|
|
||||||
consoleTabBar.onTabChange = onTabChange
|
consoleTabBar.onTabChange = onTabChange
|
||||||
|
|
||||||
-- tibia like hotkeys
|
-- tibia like hotkeys
|
||||||
g_keyboard.bindKeyDown('Ctrl+O', g_game.requestChannels)
|
g_keyboard.bindKeyDown('Ctrl+O', g_game.requestChannels)
|
||||||
g_keyboard.bindKeyDown('Ctrl+E', removeCurrentTab)
|
g_keyboard.bindKeyDown('Ctrl+E', removeCurrentTab)
|
||||||
g_keyboard.bindKeyDown('Ctrl+H', openHelp)
|
g_keyboard.bindKeyDown('Ctrl+H', openHelp)
|
||||||
|
|
||||||
|
consoleToggleChat = consolePanel:getChildById('toggleChat')
|
||||||
|
load()
|
||||||
|
|
||||||
|
if g_game.isOnline() then
|
||||||
|
online()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function toggleChat()
|
||||||
|
if consoleToggleChat:isChecked() then
|
||||||
|
disableChat()
|
||||||
|
else
|
||||||
|
enableChat()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function enableChat()
|
||||||
|
local gameInterface = modules.game_interface
|
||||||
|
|
||||||
|
consoleTextEdit:setVisible(true)
|
||||||
|
consoleTextEdit:setText("")
|
||||||
|
|
||||||
|
g_keyboard.unbindKeyUp("Space")
|
||||||
|
g_keyboard.unbindKeyUp("Enter")
|
||||||
|
|
||||||
|
gameInterface.unbindWalkKey("W")
|
||||||
|
gameInterface.unbindWalkKey("D")
|
||||||
|
gameInterface.unbindWalkKey("S")
|
||||||
|
gameInterface.unbindWalkKey("A")
|
||||||
|
|
||||||
|
consoleToggleChat:setTooltip(tr("Disable chat mode, allow to walk using ASDW"))
|
||||||
|
end
|
||||||
|
|
||||||
|
function disableChat()
|
||||||
|
local gameInterface = modules.game_interface
|
||||||
|
|
||||||
-- Ignore List
|
consoleTextEdit:setVisible(false)
|
||||||
loadIgnoreSettings()
|
consoleTextEdit:setText("")
|
||||||
|
|
||||||
|
local quickFunc = function()
|
||||||
|
if consoleToggleChat:isChecked() then
|
||||||
|
consoleToggleChat:setChecked(false)
|
||||||
|
end
|
||||||
|
enableChat()
|
||||||
|
end
|
||||||
|
g_keyboard.bindKeyUp("Space", quickFunc)
|
||||||
|
g_keyboard.bindKeyUp("Enter", quickFunc)
|
||||||
|
|
||||||
|
gameInterface.bindWalkKey("W", North)
|
||||||
|
gameInterface.bindWalkKey("D", East)
|
||||||
|
gameInterface.bindWalkKey("S", South)
|
||||||
|
gameInterface.bindWalkKey("A", West)
|
||||||
|
|
||||||
|
consoleToggleChat:setTooltip(tr("Enable chat mode"))
|
||||||
end
|
end
|
||||||
|
|
||||||
function terminate()
|
function terminate()
|
||||||
disconnect(g_game, { onTalk = onTalk,
|
save()
|
||||||
onChannelList = onChannelList,
|
disconnect(g_game, {
|
||||||
onOpenChannel = onOpenChannel,
|
onTalk = onTalk,
|
||||||
onOpenPrivateChannel = onOpenPrivateChannel,
|
onChannelList = onChannelList,
|
||||||
onOpenOwnPrivateChannel = onOpenPrivateChannel,
|
onOpenChannel = onOpenChannel,
|
||||||
onCloseChannel = onCloseChannel,
|
onOpenPrivateChannel = onOpenPrivateChannel,
|
||||||
onRuleViolationChannel = onRuleViolationChannel,
|
onOpenOwnPrivateChannel = onOpenPrivateChannel,
|
||||||
onRuleViolationRemove = onRuleViolationRemove,
|
onCloseChannel = onCloseChannel,
|
||||||
onRuleViolationCancel = onRuleViolationCancel,
|
onRuleViolationChannel = onRuleViolationChannel,
|
||||||
onRuleViolationLock = onRuleViolationLock,
|
onRuleViolationRemove = onRuleViolationRemove,
|
||||||
onGameStart = online,
|
onRuleViolationCancel = onRuleViolationCancel,
|
||||||
onGameEnd = offline })
|
onRuleViolationLock = onRuleViolationLock,
|
||||||
|
onGameStart = online,
|
||||||
|
onGameEnd = offline
|
||||||
|
})
|
||||||
|
|
||||||
if g_game.isOnline() then clear() end
|
if g_game.isOnline() then clear() end
|
||||||
|
|
||||||
@@ -161,14 +219,14 @@ function terminate()
|
|||||||
g_keyboard.unbindKeyDown('Ctrl+E')
|
g_keyboard.unbindKeyDown('Ctrl+E')
|
||||||
g_keyboard.unbindKeyDown('Ctrl+H')
|
g_keyboard.unbindKeyDown('Ctrl+H')
|
||||||
|
|
||||||
saveIgnoreSettings()
|
saveCommunicationSettings()
|
||||||
|
|
||||||
if channelsWindow then
|
if channelsWindow then
|
||||||
channelsWindow:destroy()
|
channelsWindow:destroy()
|
||||||
end
|
end
|
||||||
|
|
||||||
if ignoreWindow then
|
if communicationWindow then
|
||||||
ignoreWindow:destroy()
|
communicationWindow:destroy()
|
||||||
end
|
end
|
||||||
|
|
||||||
if violationWindow then
|
if violationWindow then
|
||||||
@@ -181,6 +239,20 @@ function terminate()
|
|||||||
Console = nil
|
Console = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function save()
|
||||||
|
local settings = {}
|
||||||
|
settings.messageHistory = messageHistory
|
||||||
|
g_settings.setNode('game_console', settings)
|
||||||
|
end
|
||||||
|
|
||||||
|
function load()
|
||||||
|
local settings = g_settings.getNode('game_console')
|
||||||
|
if settings then
|
||||||
|
messageHistory = settings.messageHistory or {}
|
||||||
|
end
|
||||||
|
loadCommunicationSettings()
|
||||||
|
end
|
||||||
|
|
||||||
function onTabChange(tabBar, tab)
|
function onTabChange(tabBar, tab)
|
||||||
if tab == defaultTab or tab == serverTab then
|
if tab == defaultTab or tab == serverTab then
|
||||||
consolePanel:getChildById('closeChannelButton'):disable()
|
consolePanel:getChildById('closeChannelButton'):disable()
|
||||||
@@ -215,8 +287,8 @@ function clear()
|
|||||||
end
|
end
|
||||||
channels = {}
|
channels = {}
|
||||||
|
|
||||||
defaultTab.tabPanel:getChildById('consoleBuffer'):destroyChildren()
|
consoleTabBar:removeTab(defaultTab)
|
||||||
serverTab.tabPanel:getChildById('consoleBuffer'):destroyChildren()
|
consoleTabBar:removeTab(serverTab)
|
||||||
|
|
||||||
local npcTab = consoleTabBar:getTab('NPCs')
|
local npcTab = consoleTabBar:getTab('NPCs')
|
||||||
if npcTab then
|
if npcTab then
|
||||||
@@ -243,7 +315,6 @@ end
|
|||||||
|
|
||||||
function clearChannel(consoleTabBar)
|
function clearChannel(consoleTabBar)
|
||||||
consoleTabBar:getCurrentTab().tabPanel:getChildById('consoleBuffer'):destroyChildren()
|
consoleTabBar:getCurrentTab().tabPanel:getChildById('consoleBuffer'):destroyChildren()
|
||||||
consoleTabBar:getCurrentTab().tabPanel:getChildById('consoleBufferHighlight'):destroyChildren()
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function setTextEditText(text)
|
function setTextEditText(text)
|
||||||
@@ -271,6 +342,7 @@ function openPlayerReportRuleViolationWindow()
|
|||||||
g_game.talkChannel(MessageModes.RVRChannel, 0, text)
|
g_game.talkChannel(MessageModes.RVRChannel, 0, text)
|
||||||
violationReportTab = addTab(tr('Report Rule') .. '...', true)
|
violationReportTab = addTab(tr('Report Rule') .. '...', true)
|
||||||
addTabText(tr('Please wait patiently for a gamemaster to reply') .. '.', SpeakTypesSettings.privateRed, violationReportTab)
|
addTabText(tr('Please wait patiently for a gamemaster to reply') .. '.', SpeakTypesSettings.privateRed, violationReportTab)
|
||||||
|
addTabText(applyMessagePrefixies(g_game.getCharacterName(), 0, text), SpeakTypesSettings.say, violationReportTab, g_game.getCharacterName())
|
||||||
violationReportTab.locked = true
|
violationReportTab.locked = true
|
||||||
violationWindow:destroy()
|
violationWindow:destroy()
|
||||||
violationWindow = nil
|
violationWindow = nil
|
||||||
@@ -295,15 +367,17 @@ function removeTab(tab)
|
|||||||
tab = consoleTabBar:getTab(tab)
|
tab = consoleTabBar:getTab(tab)
|
||||||
end
|
end
|
||||||
|
|
||||||
if tab == defaultTab or tab == serverTab then return end
|
if tab == defaultTab or tab == serverTab then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
if tab == violationReportTab then
|
if tab == violationReportTab then
|
||||||
g_game.cancelRuleViolation()
|
g_game.cancelRuleViolation()
|
||||||
violationReportTab = nil
|
violationReportTab = nil
|
||||||
elseif tab.violationChatName then
|
elseif tab.violationChatName then
|
||||||
g_game.closeRuleViolation(tab.violationChatName)
|
g_game.closeRuleViolation(tab.violationChatName)
|
||||||
-- notificate the server that we are leaving the channel
|
|
||||||
elseif tab.channelId then
|
elseif tab.channelId then
|
||||||
|
-- notificate the server that we are leaving the channel
|
||||||
for k, v in pairs(channels) do
|
for k, v in pairs(channels) do
|
||||||
if (k == tab.channelId) then channels[k] = nil end
|
if (k == tab.channelId) then channels[k] = nil end
|
||||||
end
|
end
|
||||||
@@ -316,8 +390,7 @@ function removeTab(tab)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function removeCurrentTab()
|
function removeCurrentTab()
|
||||||
local tab = consoleTabBar:getCurrentTab()
|
removeTab(consoleTabBar:getCurrentTab())
|
||||||
removeTab(tab)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function getTab(name)
|
function getTab(name)
|
||||||
@@ -433,21 +506,20 @@ function addTabText(text, speaktype, tab, creatureName)
|
|||||||
consoleTabBar:blinkTab(tab)
|
consoleTabBar:blinkTab(tab)
|
||||||
|
|
||||||
-- Overlay for consoleBuffer which shows highlighted words only
|
-- Overlay for consoleBuffer which shows highlighted words only
|
||||||
local consoleBufferHighlight = panel:getChildById('consoleBufferHighlight')
|
|
||||||
local labelHighlight = g_ui.createWidget('ConsolePhantomLabel', consoleBufferHighlight)
|
|
||||||
|
|
||||||
labelHighlight:setId('consoleLabel' .. consoleBufferHighlight:getChildCount())
|
if speaktype.npcChat and (g_game.getCharacterName() ~= creatureName or g_game.getCharacterName() == 'Account Manager') then
|
||||||
labelHighlight:setColor("#1f9ffe")
|
|
||||||
|
|
||||||
if speaktype.npcChat and (g_game.getCharacterName() ~= creatureName or g_game.getCharacterName() == 'Account Manager') then -- Check if it is the npc who is talking
|
|
||||||
local highlightData = getHighlightedText(text)
|
local highlightData = getHighlightedText(text)
|
||||||
if #highlightData == 0 then
|
if #highlightData > 0 then
|
||||||
labelHighlight:setText("")
|
local labelHighlight = g_ui.createWidget('ConsolePhantomLabel', label)
|
||||||
else
|
labelHighlight:fill('parent')
|
||||||
|
|
||||||
|
labelHighlight:setId('consoleLabelHighlight' .. consoleBuffer:getChildCount())
|
||||||
|
labelHighlight:setColor("#1f9ffe")
|
||||||
|
|
||||||
-- Remove the curly braces
|
-- Remove the curly braces
|
||||||
for i = 1, #highlightData / 3 do
|
for i = 1, #highlightData / 3 do
|
||||||
local dataBlock = { _start = highlightData[(i-1)*3+1], _end = highlightData[(i-1)*3+2], words = highlightData[(i-1)*3+3] }
|
local dataBlock = { _start = highlightData[(i-1)*3+1], _end = highlightData[(i-1)*3+2], words = highlightData[(i-1)*3+3] }
|
||||||
text = text:gsub("{"..dataBlock.words.."}", dataBlock.words)
|
text = text:gsub("%{(.-)%}", dataBlock.words, 1)
|
||||||
|
|
||||||
-- Recalculate positions as braces are removed
|
-- Recalculate positions as braces are removed
|
||||||
highlightData[(i-1)*3+1] = dataBlock._start - ((i-1) * 2)
|
highlightData[(i-1)*3+1] = dataBlock._start - ((i-1) * 2)
|
||||||
@@ -482,8 +554,6 @@ function addTabText(text, speaktype, tab, creatureName)
|
|||||||
|
|
||||||
labelHighlight:setText(tmpText)
|
labelHighlight:setText(tmpText)
|
||||||
end
|
end
|
||||||
else
|
|
||||||
labelHighlight:setText("")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
label.name = creatureName
|
label.name = creatureName
|
||||||
@@ -494,10 +564,6 @@ function addTabText(text, speaktype, tab, creatureName)
|
|||||||
if consoleBuffer:getChildCount() > MAX_LINES then
|
if consoleBuffer:getChildCount() > MAX_LINES then
|
||||||
consoleBuffer:getFirstChild():destroy()
|
consoleBuffer:getFirstChild():destroy()
|
||||||
end
|
end
|
||||||
|
|
||||||
if consoleBufferHighlight:getChildCount() > MAX_LINES then
|
|
||||||
consoleBufferHighlight:getFirstChild():destroy()
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function removeTabLabelByName(tab, name)
|
function removeTabLabelByName(tab, name)
|
||||||
@@ -579,10 +645,24 @@ function sendCurrentMessage()
|
|||||||
sendMessage(message)
|
sendMessage(message)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function addFilter(filter)
|
||||||
|
table.insert(filters, filter)
|
||||||
|
end
|
||||||
|
|
||||||
|
function removeFilter(filter)
|
||||||
|
table.removevalue(filters, filter)
|
||||||
|
end
|
||||||
|
|
||||||
function sendMessage(message, tab)
|
function sendMessage(message, tab)
|
||||||
local tab = tab or getCurrentTab()
|
local tab = tab or getCurrentTab()
|
||||||
if not tab then return end
|
if not tab then return end
|
||||||
|
|
||||||
|
for k,func in pairs(filters) do
|
||||||
|
if func(message) then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- when talking on server log, the message goes to default channel
|
-- when talking on server log, the message goes to default channel
|
||||||
local name = tab:getText()
|
local name = tab:getText()
|
||||||
if tab == serverTab or tab == getRuleViolationsTab() then
|
if tab == serverTab or tab == getRuleViolationsTab() then
|
||||||
@@ -591,18 +671,36 @@ function sendMessage(message, tab)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- handling chat commands
|
-- handling chat commands
|
||||||
|
local channel = tab.channelId
|
||||||
local originalMessage = message
|
local originalMessage = message
|
||||||
local chatCommandSayMode
|
local chatCommandSayMode
|
||||||
local chatCommandPrivate
|
local chatCommandPrivate
|
||||||
local chatCommandPrivateReady
|
local chatCommandPrivateReady
|
||||||
|
local chatCommandMessage
|
||||||
|
|
||||||
local chatCommandMessage = message:match("^%#y (.*)")
|
-- player used yell command
|
||||||
if chatCommandMessage ~= nil then chatCommandSayMode = 'yell' end -- player used yell command
|
chatCommandMessage = message:match("^%#y (.*)")
|
||||||
message = chatCommandMessage or message
|
if chatCommandMessage ~= nil then
|
||||||
|
chatCommandSayMode = 'yell'
|
||||||
|
channel = 0
|
||||||
|
message = chatCommandMessage
|
||||||
|
end
|
||||||
|
|
||||||
|
-- player used whisper
|
||||||
local chatCommandMessage = message:match("^%#w (.*)")
|
local chatCommandMessage = message:match("^%#w (.*)")
|
||||||
if chatCommandMessage ~= nil then chatCommandSayMode = 'whisper' end -- player used whisper
|
if chatCommandMessage ~= nil then
|
||||||
message = chatCommandMessage or message
|
chatCommandSayMode = 'whisper'
|
||||||
|
message = chatCommandMessage
|
||||||
|
channel = 0
|
||||||
|
end
|
||||||
|
|
||||||
|
-- player say
|
||||||
|
local chatCommandMessage = message:match("^%#s (.*)")
|
||||||
|
if chatCommandMessage ~= nil then
|
||||||
|
chatCommandSayMode = 'say'
|
||||||
|
message = chatCommandMessage
|
||||||
|
channel = 0
|
||||||
|
end
|
||||||
|
|
||||||
local findIni, findEnd, chatCommandInitial, chatCommandPrivate, chatCommandEnd, chatCommandMessage = message:find("([%*%@])(.+)([%*%@])(.*)")
|
local findIni, findEnd, chatCommandInitial, chatCommandPrivate, chatCommandEnd, chatCommandMessage = message:find("([%*%@])(.+)([%*%@])(.*)")
|
||||||
if findIni ~= nil and findIni == 1 then -- player used private chat command
|
if findIni ~= nil and findIni == 1 then -- player used private chat command
|
||||||
@@ -629,15 +727,15 @@ function sendMessage(message, tab)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local speaktypedesc
|
local speaktypedesc
|
||||||
if (tab.channelId or tab == defaultTab) and not chatCommandPrivateReady then
|
if (channel or tab == defaultTab) and not chatCommandPrivateReady then
|
||||||
if tab == defaultTab then
|
if tab == defaultTab then
|
||||||
speaktypedesc = chatCommandSayMode or SayModes[consolePanel:getChildById('sayModeButton').sayMode].speakTypeDesc
|
speaktypedesc = chatCommandSayMode or SayModes[consolePanel:getChildById('sayModeButton').sayMode].speakTypeDesc
|
||||||
if speaktypedesc ~= 'say' then sayModeChange(2) end -- head back to say mode
|
if speaktypedesc ~= 'say' then sayModeChange(2) end -- head back to say mode
|
||||||
else
|
else
|
||||||
speaktypedesc = 'channelYellow'
|
speaktypedesc = chatCommandSayMode or 'channelYellow'
|
||||||
end
|
end
|
||||||
|
|
||||||
g_game.talkChannel(SpeakTypesSettings[speaktypedesc].speakType, tab.channelId, message)
|
g_game.talkChannel(SpeakTypesSettings[speaktypedesc].speakType, channel, message)
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
local isPrivateCommand = false
|
local isPrivateCommand = false
|
||||||
@@ -650,6 +748,10 @@ function sendMessage(message, tab)
|
|||||||
elseif tab.npcChat then
|
elseif tab.npcChat then
|
||||||
speaktypedesc = 'privatePlayerToNpc'
|
speaktypedesc = 'privatePlayerToNpc'
|
||||||
elseif tab == violationReportTab then
|
elseif tab == violationReportTab then
|
||||||
|
if violationReportTab.locked then
|
||||||
|
modules.game_textmessage.displayFailureMessage('Wait for a gamemaster reply.')
|
||||||
|
return
|
||||||
|
end
|
||||||
speaktypedesc = 'rvrContinue'
|
speaktypedesc = 'rvrContinue'
|
||||||
tabname = tr('Report Rule') .. '...'
|
tabname = tr('Report Rule') .. '...'
|
||||||
elseif tab.violationChatName then
|
elseif tab.violationChatName then
|
||||||
@@ -730,7 +832,11 @@ function onTalk(name, level, mode, message, channelId, creaturePos)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if name ~= g_game.getCharacterName() then
|
local localPlayer = g_game.getLocalPlayer()
|
||||||
|
if name ~= g_game.getCharacterName()
|
||||||
|
and isUsingIgnoreList()
|
||||||
|
and not(isUsingWhiteList()) or (isUsingWhiteList() and not(isWhitelisted(name)) and not(isAllowingVIPs() and localPlayer:hasVip(name))) then
|
||||||
|
|
||||||
if mode == MessageModes.Yell and isIgnoringYelling() then
|
if mode == MessageModes.Yell and isIgnoringYelling() then
|
||||||
return
|
return
|
||||||
elseif speaktype.private and isIgnoringPrivate() and mode ~= MessageModes.NpcFrom then
|
elseif speaktype.private and isIgnoringPrivate() and mode ~= MessageModes.NpcFrom then
|
||||||
@@ -857,6 +963,7 @@ end
|
|||||||
|
|
||||||
function onRuleViolationLock()
|
function onRuleViolationLock()
|
||||||
if not violationReportTab then return end
|
if not violationReportTab then return end
|
||||||
|
violationReportTab.locked = false
|
||||||
addTabText(tr('Your request has been closed') .. '.', SpeakTypesSettings.privateRed, violationReportTab)
|
addTabText(tr('Your request has been closed') .. '.', SpeakTypesSettings.privateRed, violationReportTab)
|
||||||
violationReportTab.locked = true
|
violationReportTab.locked = true
|
||||||
end
|
end
|
||||||
@@ -907,111 +1014,228 @@ function onChannelList(channelList)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function loadIgnoreSettings()
|
function loadCommunicationSettings()
|
||||||
|
communicationSettings.whitelistedPlayers = {}
|
||||||
|
communicationSettings.ignoredPlayers = {}
|
||||||
|
|
||||||
local ignoreNode = g_settings.getNode('IgnorePlayers')
|
local ignoreNode = g_settings.getNode('IgnorePlayers')
|
||||||
if ignoreNode then
|
if ignoreNode then
|
||||||
for i = 1, #ignoreNode do
|
for i = 1, #ignoreNode do
|
||||||
table.insert(ignoreSettings.players, ignoreNode[i])
|
table.insert(communicationSettings.ignoredPlayers, ignoreNode[i])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
ignoreSettings.privateMessages = g_settings.getBoolean('IgnorePrivateMessages')
|
|
||||||
ignoreSettings.yelling = g_settings.getBoolean('IgnoreYelling')
|
|
||||||
end
|
|
||||||
|
|
||||||
function saveIgnoreSettings()
|
local whitelistNode = g_settings.getNode('WhitelistedPlayers')
|
||||||
local tmpSettings = {}
|
if whitelistNode then
|
||||||
for i = 1, #ignoreSettings.players do
|
for i = 1, #whitelistNode do
|
||||||
table.insert(tmpSettings, ignoreSettings.players[i])
|
table.insert(communicationSettings.whitelistedPlayers, whitelistNode[i])
|
||||||
|
end
|
||||||
end
|
end
|
||||||
g_settings.set('IgnorePrivateMessages', ignoreSettings.privateMessages)
|
|
||||||
g_settings.set('IgnoreYelling', ignoreSettings.yelling)
|
communicationSettings.useIgnoreList = g_settings.getBoolean('UseIgnoreList')
|
||||||
g_settings.setNode('IgnorePlayers', tmpSettings)
|
communicationSettings.useWhiteList = g_settings.getBoolean('UseWhiteList')
|
||||||
|
communicationSettings.privateMessages = g_settings.getBoolean('IgnorePrivateMessages')
|
||||||
|
communicationSettings.yelling = g_settings.getBoolean('IgnoreYelling')
|
||||||
|
communicationSettings.allowVIPs = g_settings.getBoolean('AllowVIPs')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function saveCommunicationSettings()
|
||||||
|
local tmpIgnoreList = {}
|
||||||
|
local ignoredPlayers = getIgnoredPlayers()
|
||||||
|
for i = 1, #ignoredPlayers do
|
||||||
|
table.insert(tmpIgnoreList, ignoredPlayers[i])
|
||||||
|
end
|
||||||
|
|
||||||
|
local tmpWhiteList = {}
|
||||||
|
local whitelistedPlayers = getWhitelistedPlayers()
|
||||||
|
for i = 1, #whitelistedPlayers do
|
||||||
|
table.insert(tmpWhiteList, whitelistedPlayers[i])
|
||||||
|
end
|
||||||
|
|
||||||
|
g_settings.set('UseIgnoreList', communicationSettings.useIgnoreList)
|
||||||
|
g_settings.set('UseWhiteList', communicationSettings.useWhiteList)
|
||||||
|
g_settings.set('IgnorePrivateMessages', communicationSettings.privateMessages)
|
||||||
|
g_settings.set('IgnoreYelling', communicationSettings.yelling)
|
||||||
|
g_settings.setNode('IgnorePlayers', tmpIgnoreList)
|
||||||
|
g_settings.setNode('WhitelistedPlayers', tmpWhiteList)
|
||||||
|
end
|
||||||
|
|
||||||
|
function getIgnoredPlayers()
|
||||||
|
return communicationSettings.ignoredPlayers
|
||||||
|
end
|
||||||
|
|
||||||
|
function getWhitelistedPlayers()
|
||||||
|
return communicationSettings.whitelistedPlayers
|
||||||
|
end
|
||||||
|
|
||||||
|
function isUsingIgnoreList()
|
||||||
|
return communicationSettings.useIgnoreList
|
||||||
|
end
|
||||||
|
|
||||||
|
function isUsingWhiteList()
|
||||||
|
return communicationSettings.useWhiteList
|
||||||
|
end
|
||||||
function isIgnored(name)
|
function isIgnored(name)
|
||||||
return table.find(ignoreSettings.players, name, true)
|
return table.find(communicationSettings.ignoredPlayers, name, true)
|
||||||
end
|
end
|
||||||
|
|
||||||
function addIgnoredPlayer(name)
|
function addIgnoredPlayer(name)
|
||||||
if not isIgnored(name) then
|
if isIgnored(name) then return end
|
||||||
table.insert(ignoreSettings.players, name)
|
table.insert(communicationSettings.ignoredPlayers, name)
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function removeIgnoredPlayer(name)
|
function removeIgnoredPlayer(name)
|
||||||
table.removevalue(ignoreSettings.players, name)
|
table.removevalue(communicationSettings.ignoredPlayers, name)
|
||||||
|
end
|
||||||
|
|
||||||
|
function isWhitelisted(name)
|
||||||
|
return table.find(communicationSettings.whitelistedPlayers, name, true)
|
||||||
|
end
|
||||||
|
|
||||||
|
function addWhitelistedPlayer(name)
|
||||||
|
if isWhitelisted(name) then return end
|
||||||
|
table.insert(communicationSettings.whitelistedPlayers, name)
|
||||||
|
end
|
||||||
|
|
||||||
|
function removeWhitelistedPlayer(name)
|
||||||
|
table.removevalue(communicationSettings.whitelistedPlayers, name)
|
||||||
end
|
end
|
||||||
|
|
||||||
function isIgnoringPrivate()
|
function isIgnoringPrivate()
|
||||||
return ignoreSettings.privateMessages
|
return communicationSettings.privateMessages
|
||||||
end
|
end
|
||||||
|
|
||||||
function isIgnoringYelling()
|
function isIgnoringYelling()
|
||||||
return ignoreSettings.yelling
|
return communicationSettings.yelling
|
||||||
|
end
|
||||||
|
|
||||||
|
function isAllowingVIPs()
|
||||||
|
return communicationSettings.allowVIPs
|
||||||
end
|
end
|
||||||
|
|
||||||
function onClickIgnoreButton()
|
function onClickIgnoreButton()
|
||||||
if ignoreWindow then return end
|
if communicationWindow then return end
|
||||||
ignoreWindow = g_ui.displayUI('ignorewindow')
|
communicationWindow = g_ui.displayUI('communicationwindow')
|
||||||
local ignoreListPanel = ignoreWindow:getChildById('ignoreList')
|
local ignoreListPanel = communicationWindow:getChildById('ignoreList')
|
||||||
ignoreWindow.onDestroy = function() ignoreWindow = nil end
|
local whiteListPanel = communicationWindow:getChildById('whiteList')
|
||||||
|
communicationWindow.onDestroy = function() communicationWindow = nil end
|
||||||
|
|
||||||
local removeButton = ignoreWindow:getChildById('buttonRemove')
|
local useIgnoreListBox = communicationWindow:getChildById('checkboxUseIgnoreList')
|
||||||
removeButton:disable()
|
useIgnoreListBox:setChecked(communicationSettings.useIgnoreList)
|
||||||
ignoreListPanel.onChildFocusChange = function() removeButton:enable() end
|
local useWhiteListBox = communicationWindow:getChildById('checkboxUseWhiteList')
|
||||||
removeButton.onClick = function()
|
useWhiteListBox:setChecked(communicationSettings.useWhiteList)
|
||||||
local selection = ignoreListPanel:getFocusedChild()
|
|
||||||
if selection then
|
local removeIgnoreButton = communicationWindow:getChildById('buttonIgnoreRemove')
|
||||||
ignoreListPanel:removeChild(selection)
|
removeIgnoreButton:disable()
|
||||||
selection:destroy()
|
ignoreListPanel.onChildFocusChange = function() removeIgnoreButton:enable() end
|
||||||
end
|
removeIgnoreButton.onClick = function()
|
||||||
if ignoreListPanel:getChildCount() == 0 then
|
local selection = ignoreListPanel:getFocusedChild()
|
||||||
removeButton:disable()
|
if selection then
|
||||||
end
|
ignoreListPanel:removeChild(selection)
|
||||||
end
|
selection:destroy()
|
||||||
|
end
|
||||||
|
removeIgnoreButton:disable()
|
||||||
|
end
|
||||||
|
|
||||||
|
local removeWhitelistButton = communicationWindow:getChildById('buttonWhitelistRemove')
|
||||||
|
removeWhitelistButton:disable()
|
||||||
|
whiteListPanel.onChildFocusChange = function() removeWhitelistButton:enable() end
|
||||||
|
removeWhitelistButton.onClick = function()
|
||||||
|
local selection = whiteListPanel:getFocusedChild()
|
||||||
|
if selection then
|
||||||
|
whiteListPanel:removeChild(selection)
|
||||||
|
selection:destroy()
|
||||||
|
end
|
||||||
|
removeWhitelistButton:disable()
|
||||||
|
end
|
||||||
|
|
||||||
local newlyIgnoredPlayers = {}
|
local newlyIgnoredPlayers = {}
|
||||||
local addName = ignoreWindow:getChildById('ignoreNameEdit')
|
local addIgnoreName = communicationWindow:getChildById('ignoreNameEdit')
|
||||||
local addButton = ignoreWindow:getChildById('buttonAdd')
|
local addIgnoreButton = communicationWindow:getChildById('buttonIgnoreAdd')
|
||||||
local addFunction = function()
|
local addIgnoreFunction = function()
|
||||||
if addName:getText() == '' then return end
|
local newEntry = addIgnoreName:getText()
|
||||||
if table.find(ignoreSettings.players, addName:getText()) then return end
|
if newEntry == '' then return end
|
||||||
if table.find(newlyIgnoredPlayers, addName:getText()) then return end
|
if table.find(getIgnoredPlayers(), newEntry) then return end
|
||||||
local label = g_ui.createWidget('IgnoreListLabel', ignoreListPanel)
|
if table.find(newlyIgnoredPlayers, newEntry) then return end
|
||||||
label:setText(addName:getText())
|
|
||||||
table.insert(newlyIgnoredPlayers, addName:getText())
|
|
||||||
label:setPhantom(false)
|
|
||||||
addName:setText('')
|
|
||||||
end
|
|
||||||
addButton.onClick = addFunction
|
|
||||||
ignoreWindow.onEnter = addFunction
|
|
||||||
|
|
||||||
local ignorePrivateMessageBox = ignoreWindow:getChildById('checkboxIgnorePrivateMessages')
|
|
||||||
ignorePrivateMessageBox:setChecked(ignoreSettings.privateMessages)
|
|
||||||
local ignoreYellingBox = ignoreWindow:getChildById('checkboxIgnoreYelling')
|
|
||||||
ignoreYellingBox:setChecked(ignoreSettings.yelling)
|
|
||||||
|
|
||||||
local saveButton = ignoreWindow:getChildById('buttonSave')
|
|
||||||
saveButton.onClick = function()
|
|
||||||
ignoreSettings.players = {}
|
|
||||||
for i = 1, ignoreListPanel:getChildCount() do
|
|
||||||
addIgnoredPlayer(ignoreListPanel:getChildByIndex(i):getText())
|
|
||||||
--table.insert(ignoreSettings.players, ignoreListPanel:getChildByIndex(i):getText())
|
|
||||||
end
|
|
||||||
|
|
||||||
ignoreSettings.yelling = ignoreYellingBox:isChecked()
|
|
||||||
ignoreSettings.privateMessages = ignorePrivateMessageBox:isChecked()
|
|
||||||
ignoreWindow:destroy()
|
|
||||||
end
|
|
||||||
|
|
||||||
for _, name in pairs(ignoreSettings.players) do
|
|
||||||
local label = g_ui.createWidget('IgnoreListLabel', ignoreListPanel)
|
local label = g_ui.createWidget('IgnoreListLabel', ignoreListPanel)
|
||||||
label:setText(name)
|
label:setText(newEntry)
|
||||||
label:setPhantom(false)
|
table.insert(newlyIgnoredPlayers, newEntry)
|
||||||
|
addIgnoreName:setText('')
|
||||||
|
end
|
||||||
|
addIgnoreButton.onClick = addIgnoreFunction
|
||||||
|
|
||||||
|
local newlyWhitelistedPlayers = {}
|
||||||
|
local addWhitelistName = communicationWindow:getChildById('whitelistNameEdit')
|
||||||
|
local addWhitelistButton = communicationWindow:getChildById('buttonWhitelistAdd')
|
||||||
|
local addWhitelistFunction = function()
|
||||||
|
local newEntry = addWhitelistName:getText()
|
||||||
|
if newEntry == '' then return end
|
||||||
|
if table.find(getWhitelistedPlayers(), newEntry) then return end
|
||||||
|
if table.find(newlyWhitelistedPlayers, newEntry) then return end
|
||||||
|
local label = g_ui.createWidget('WhiteListLabel', whiteListPanel)
|
||||||
|
label:setText(newEntry)
|
||||||
|
table.insert(newlyWhitelistedPlayers, newEntry)
|
||||||
|
addWhitelistName:setText('')
|
||||||
|
end
|
||||||
|
addWhitelistButton.onClick = addWhitelistFunction
|
||||||
|
|
||||||
|
communicationWindow.onEnter = function()
|
||||||
|
if addWhitelistName:isFocused() then
|
||||||
|
addWhitelistFunction()
|
||||||
|
elseif addIgnoreName:isFocused() then
|
||||||
|
addIgnoreFunction()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local ignorePrivateMessageBox = communicationWindow:getChildById('checkboxIgnorePrivateMessages')
|
||||||
|
ignorePrivateMessageBox:setChecked(communicationSettings.privateMessages)
|
||||||
|
local ignoreYellingBox = communicationWindow:getChildById('checkboxIgnoreYelling')
|
||||||
|
ignoreYellingBox:setChecked(communicationSettings.yelling)
|
||||||
|
local allowVIPsBox = communicationWindow:getChildById('checkboxAllowVIPs')
|
||||||
|
allowVIPsBox:setChecked(communicationSettings.allowVIPs)
|
||||||
|
|
||||||
|
local saveButton = communicationWindow:recursiveGetChildById('buttonSave')
|
||||||
|
saveButton.onClick = function()
|
||||||
|
communicationSettings.ignoredPlayers = {}
|
||||||
|
for i = 1, ignoreListPanel:getChildCount() do
|
||||||
|
addIgnoredPlayer(ignoreListPanel:getChildByIndex(i):getText())
|
||||||
|
end
|
||||||
|
|
||||||
|
communicationSettings.whitelistedPlayers = {}
|
||||||
|
for i = 1, whiteListPanel:getChildCount() do
|
||||||
|
addWhitelistedPlayer(whiteListPanel:getChildByIndex(i):getText())
|
||||||
|
end
|
||||||
|
|
||||||
|
communicationSettings.useIgnoreList = useIgnoreListBox:isChecked()
|
||||||
|
communicationSettings.useWhiteList = useWhiteListBox:isChecked()
|
||||||
|
communicationSettings.yelling = ignoreYellingBox:isChecked()
|
||||||
|
communicationSettings.privateMessages = ignorePrivateMessageBox:isChecked()
|
||||||
|
communicationSettings.allowVIPs = allowVIPsBox:isChecked()
|
||||||
|
communicationWindow:destroy()
|
||||||
|
end
|
||||||
|
|
||||||
|
local cancelButton = communicationWindow:recursiveGetChildById('buttonCancel')
|
||||||
|
cancelButton.onClick = function()
|
||||||
|
communicationWindow:destroy()
|
||||||
|
end
|
||||||
|
|
||||||
|
local ignoredPlayers = getIgnoredPlayers()
|
||||||
|
for i = 1, #ignoredPlayers do
|
||||||
|
local label = g_ui.createWidget('IgnoreListLabel', ignoreListPanel)
|
||||||
|
label:setText(ignoredPlayers[i])
|
||||||
|
end
|
||||||
|
|
||||||
|
local whitelistedPlayers = getWhitelistedPlayers()
|
||||||
|
for i = 1, #whitelistedPlayers do
|
||||||
|
local label = g_ui.createWidget('WhiteListLabel', whiteListPanel)
|
||||||
|
label:setText(whitelistedPlayers[i])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function online()
|
function online()
|
||||||
|
defaultTab = addTab(tr('Default'), true)
|
||||||
|
serverTab = addTab(tr('Server Log'), false)
|
||||||
|
|
||||||
if g_game.getProtocolVersion() < 862 then
|
if g_game.getProtocolVersion() < 862 then
|
||||||
g_keyboard.bindKeyDown('Ctrl+R', openPlayerReportRuleViolationWindow)
|
g_keyboard.bindKeyDown('Ctrl+R', openPlayerReportRuleViolationWindow)
|
||||||
end
|
end
|
||||||
@@ -1039,4 +1263,4 @@ function offline()
|
|||||||
g_keyboard.unbindKeyDown('Ctrl+R')
|
g_keyboard.unbindKeyDown('Ctrl+R')
|
||||||
end
|
end
|
||||||
clear()
|
clear()
|
||||||
end
|
end
|
@@ -15,13 +15,14 @@ ConsolePhantomLabel < UILabel
|
|||||||
font: verdana-11px-antialised
|
font: verdana-11px-antialised
|
||||||
height: 14
|
height: 14
|
||||||
color: yellow
|
color: yellow
|
||||||
margin-left: 2
|
|
||||||
text-wrap: true
|
text-wrap: true
|
||||||
text-auto-resize: true
|
text-auto-resize: true
|
||||||
selection-color: #111416
|
selection-color: #111416
|
||||||
selection-background-color: #999999
|
selection-background-color: #999999
|
||||||
|
|
||||||
ConsoleTabBar < MoveableTabBar
|
ConsoleTabBar < MoveableTabBar
|
||||||
|
height: 28
|
||||||
|
|
||||||
ConsoleTabBarPanel < MoveableTabBarPanel
|
ConsoleTabBarPanel < MoveableTabBarPanel
|
||||||
id: consoleTab
|
id: consoleTab
|
||||||
|
|
||||||
@@ -39,29 +40,6 @@ ConsoleTabBarPanel < MoveableTabBarPanel
|
|||||||
inverted-scroll: true
|
inverted-scroll: true
|
||||||
padding: 1
|
padding: 1
|
||||||
|
|
||||||
ScrollablePanel
|
|
||||||
id: consoleBufferHighlight
|
|
||||||
anchors.fill: parent
|
|
||||||
margin-right: 12
|
|
||||||
vertical-scrollbar: consoleScrollBarHighlight
|
|
||||||
layout:
|
|
||||||
type: verticalBox
|
|
||||||
align-bottom: true
|
|
||||||
inverted-scroll: true
|
|
||||||
padding: 1
|
|
||||||
@onScrollbarChange: |
|
|
||||||
local consoleScrollBar = self:getParent():getChildById('consoleScrollBar')
|
|
||||||
local consoleScrollBarHighlight = self:getParent():getChildById('consoleScrollBarHighlight')
|
|
||||||
consoleScrollBar:setValue(consoleScrollBarHighlight:getValue())
|
|
||||||
|
|
||||||
VerticalScrollBar
|
|
||||||
id: consoleScrollBarHighlight
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
anchors.right: parent.right
|
|
||||||
step: 14
|
|
||||||
pixels-scroll: true
|
|
||||||
|
|
||||||
VerticalScrollBar
|
VerticalScrollBar
|
||||||
id: consoleScrollBar
|
id: consoleScrollBar
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
@@ -78,22 +56,31 @@ Panel
|
|||||||
id: consolePanel
|
id: consolePanel
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
|
CheckBox
|
||||||
|
id: toggleChat
|
||||||
|
!tooltip: tr('Disable chat mode, allow to walk using ASDW')
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.top: parent.top
|
||||||
|
margin-left: 13
|
||||||
|
margin-top: 8
|
||||||
|
@onCheckChange: toggleChat()
|
||||||
|
|
||||||
TabButton
|
TabButton
|
||||||
id: prevChannelButton
|
id: prevChannelButton
|
||||||
icon: /images/game/console/leftarrow
|
icon: /images/game/console/leftarrow
|
||||||
anchors.left: parent.left
|
anchors.left: toggleChat.right
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
margin-left: 6
|
margin-left: 3
|
||||||
margin-top: 6
|
margin-top: 6
|
||||||
|
|
||||||
ConsoleTabBar
|
ConsoleTabBar
|
||||||
id: consoleTabBar
|
id: consoleTabBar
|
||||||
height: 28
|
|
||||||
anchors.left: prev.right
|
anchors.left: prev.right
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.right: next.left
|
anchors.right: next.left
|
||||||
margin-left: 5
|
margin-left: 5
|
||||||
margin-top: 3
|
margin-top: 3
|
||||||
|
margin-right: 5
|
||||||
moveable: true
|
moveable: true
|
||||||
|
|
||||||
TabButton
|
TabButton
|
||||||
|
@@ -1,98 +0,0 @@
|
|||||||
IgnoreListLabel < Label
|
|
||||||
font: verdana-11px-monochrome
|
|
||||||
background-color: alpha
|
|
||||||
text-offset: 2 0
|
|
||||||
focusable: true
|
|
||||||
|
|
||||||
$focus:
|
|
||||||
background-color: #ffffff22
|
|
||||||
color: #ffffff
|
|
||||||
|
|
||||||
MainWindow
|
|
||||||
id: ignoreWindow
|
|
||||||
!text: tr('Ignore List')
|
|
||||||
size: 500 240
|
|
||||||
@onEscape: self:destroy()
|
|
||||||
|
|
||||||
Label
|
|
||||||
!text: tr('Ignored players:')
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.top: parent.top
|
|
||||||
|
|
||||||
TextList
|
|
||||||
id: ignoreList
|
|
||||||
vertical-scrollbar: ignoreListScrollBar
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.top: prev.bottom
|
|
||||||
height: 150
|
|
||||||
width: 230
|
|
||||||
margin-bottom: 10
|
|
||||||
margin-top: 3
|
|
||||||
padding: 1
|
|
||||||
focusable: false
|
|
||||||
|
|
||||||
Button
|
|
||||||
id: buttonRemove
|
|
||||||
!text: tr('Remove')
|
|
||||||
width: 64
|
|
||||||
anchors.right: prev.right
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
|
|
||||||
TextEdit
|
|
||||||
id: ignoreNameEdit
|
|
||||||
anchors.left: ignoreList.right
|
|
||||||
anchors.top: ignoreList.top
|
|
||||||
width: 180
|
|
||||||
margin-left: 8
|
|
||||||
margin-right: 3
|
|
||||||
|
|
||||||
Button
|
|
||||||
id: buttonAdd
|
|
||||||
!text: tr('Add')
|
|
||||||
width: 48
|
|
||||||
height: 20
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.top: prev.top
|
|
||||||
|
|
||||||
CheckBox
|
|
||||||
id: checkboxIgnorePrivateMessages
|
|
||||||
!text: tr('Ignore Private Messages')
|
|
||||||
anchors.left: ignoreList.right
|
|
||||||
anchors.top: ignoreList.top
|
|
||||||
width: 180
|
|
||||||
margin-top: 25
|
|
||||||
margin-left: 8
|
|
||||||
|
|
||||||
CheckBox
|
|
||||||
id: checkboxIgnoreYelling
|
|
||||||
!text: tr('Ignore Yelling')
|
|
||||||
anchors.left: ignoreList.right
|
|
||||||
anchors.top: prev.top
|
|
||||||
width: 180
|
|
||||||
margin-top: 25
|
|
||||||
margin-left: 8
|
|
||||||
|
|
||||||
Button
|
|
||||||
id: buttonSave
|
|
||||||
!text: tr('Save')
|
|
||||||
width: 64
|
|
||||||
anchors.right: next.left
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
margin-right: 10
|
|
||||||
@onClick: self:getParent():onEnter()
|
|
||||||
|
|
||||||
Button
|
|
||||||
id: buttonCancel
|
|
||||||
!text: tr('Cancel')
|
|
||||||
width: 64
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
@onClick: self:getParent():destroy()
|
|
||||||
|
|
||||||
VerticalScrollBar
|
|
||||||
id: ignoreListScrollBar
|
|
||||||
anchors.top: ignoreList.top
|
|
||||||
anchors.bottom: ignoreList.bottom
|
|
||||||
anchors.right: ignoreList.right
|
|
||||||
step: 14
|
|
||||||
pixels-scroll: true
|
|
@@ -13,12 +13,14 @@ MainWindow
|
|||||||
|
|
||||||
TextEdit
|
TextEdit
|
||||||
id: text
|
id: text
|
||||||
|
text-wrap: true
|
||||||
multiline: true
|
multiline: true
|
||||||
anchors.top: prev.bottom
|
anchors.top: prev.bottom
|
||||||
anchors.bottom: next.top
|
anchors.bottom: next.top
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
margin: 8 0
|
margin: 8 0
|
||||||
|
max-length: 255
|
||||||
|
|
||||||
Button
|
Button
|
||||||
id: buttonOk
|
id: buttonOk
|
||||||
|
@@ -29,11 +29,15 @@ end
|
|||||||
|
|
||||||
function clean()
|
function clean()
|
||||||
for containerid,container in pairs(g_game.getContainers()) do
|
for containerid,container in pairs(g_game.getContainers()) do
|
||||||
if container.window then
|
destroy(container)
|
||||||
container.window:destroy()
|
end
|
||||||
container.window = nil
|
end
|
||||||
container.itemsPanel = nil
|
|
||||||
end
|
function destroy(container)
|
||||||
|
if container.window then
|
||||||
|
container.window:destroy()
|
||||||
|
container.window = nil
|
||||||
|
container.itemsPanel = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -103,7 +107,7 @@ function onContainerOpen(container, previousContainer)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function onContainerClose(container)
|
function onContainerClose(container)
|
||||||
if container.window then container.window:destroy() end
|
destroy(container)
|
||||||
end
|
end
|
||||||
|
|
||||||
function onContainerAddItem(container, slot, item)
|
function onContainerAddItem(container, slot, item)
|
||||||
|
@@ -6,7 +6,7 @@ local ProgressCallback = {
|
|||||||
cooldownWindow = nil
|
cooldownWindow = nil
|
||||||
cooldownButton = nil
|
cooldownButton = nil
|
||||||
contentsPanel = nil
|
contentsPanel = nil
|
||||||
spellCooldownPanel = nil
|
cooldownPanel = nil
|
||||||
lastPlayer = nil
|
lastPlayer = nil
|
||||||
|
|
||||||
function init()
|
function init()
|
||||||
@@ -23,7 +23,12 @@ function init()
|
|||||||
cooldownWindow:setup()
|
cooldownWindow:setup()
|
||||||
|
|
||||||
contentsPanel = cooldownWindow:getChildById('contentsPanel')
|
contentsPanel = cooldownWindow:getChildById('contentsPanel')
|
||||||
spellCooldownPanel = contentsPanel:getChildById('spellCooldownPanel')
|
cooldownPanel = contentsPanel:getChildById('cooldownPanel')
|
||||||
|
|
||||||
|
-- preload cooldown images
|
||||||
|
for k,v in pairs(SpelllistSettings) do
|
||||||
|
g_textures.preload(v.iconFile)
|
||||||
|
end
|
||||||
|
|
||||||
if g_game.isOnline() then
|
if g_game.isOnline() then
|
||||||
online()
|
online()
|
||||||
@@ -39,6 +44,24 @@ function terminate()
|
|||||||
cooldownButton:destroy()
|
cooldownButton:destroy()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function loadIcon(iconId)
|
||||||
|
local spell, profile, spellName = Spells.getSpellByIcon(iconId)
|
||||||
|
if not spellName then return end
|
||||||
|
|
||||||
|
clientIconId = Spells.getClientId(spellName)
|
||||||
|
if not clientIconId then return end
|
||||||
|
|
||||||
|
local icon = cooldownPanel:getChildById(iconId)
|
||||||
|
if not icon then
|
||||||
|
icon = g_ui.createWidget('SpellIcon')
|
||||||
|
icon:setId(iconId)
|
||||||
|
end
|
||||||
|
|
||||||
|
icon:setImageSource(SpelllistSettings[profile].iconFile)
|
||||||
|
icon:setImageClip(Spells.getImageClip(clientIconId, profile))
|
||||||
|
return icon
|
||||||
|
end
|
||||||
|
|
||||||
function onMiniWindowClose()
|
function onMiniWindowClose()
|
||||||
cooldownButton:setOn(false)
|
cooldownButton:setOn(false)
|
||||||
end
|
end
|
||||||
@@ -68,7 +91,7 @@ function online()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function refresh()
|
function refresh()
|
||||||
spellCooldownPanel:destroyChildren()
|
cooldownPanel:destroyChildren()
|
||||||
end
|
end
|
||||||
|
|
||||||
function removeCooldown(progressRect)
|
function removeCooldown(progressRect)
|
||||||
@@ -105,36 +128,28 @@ function initCooldown(progressRect, updateCallback, finishCallback)
|
|||||||
updateCallback()
|
updateCallback()
|
||||||
end
|
end
|
||||||
|
|
||||||
function updateCooldown(progressRect, interval)
|
function updateCooldown(progressRect, duration)
|
||||||
progressRect:setPercent(progressRect:getPercent() + 5)
|
progressRect:setPercent(progressRect:getPercent() + 10000/duration)
|
||||||
|
|
||||||
if progressRect:getPercent() < 100 then
|
if progressRect:getPercent() < 100 then
|
||||||
removeEvent(progressRect.event)
|
removeEvent(progressRect.event)
|
||||||
progressRect.event = scheduleEvent(function() progressRect.callback[ProgressCallback.update]() end, interval)
|
progressRect.event = scheduleEvent(function() progressRect.callback[ProgressCallback.update]() end, 100)
|
||||||
else
|
else
|
||||||
progressRect.callback[ProgressCallback.finish]()
|
progressRect.callback[ProgressCallback.finish]()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function onSpellCooldown(iconId, duration)
|
function onSpellCooldown(iconId, duration)
|
||||||
local spell, profile, spellName = Spells.getSpellByIcon(iconId)
|
local icon = loadIcon(iconId)
|
||||||
if not spellName then return end
|
|
||||||
|
|
||||||
clientIconId = Spells.getClientId(spellName)
|
|
||||||
if not clientIconId then return end
|
|
||||||
|
|
||||||
local icon = spellCooldownPanel:getChildById(spellName)
|
|
||||||
if not icon then
|
if not icon then
|
||||||
icon = g_ui.createWidget('SpellIcon', spellCooldownPanel)
|
return
|
||||||
icon:setId(spellName)
|
|
||||||
end
|
end
|
||||||
icon:setImageSource('/images/game/spells/' .. SpelllistSettings[profile].iconFile)
|
icon:setParent(cooldownPanel)
|
||||||
icon:setImageClip(Spells.getImageClip(clientIconId, profile))
|
|
||||||
|
|
||||||
local progressRect = icon:getChildById(spellName)
|
local progressRect = icon:getChildById(iconId)
|
||||||
if not progressRect then
|
if not progressRect then
|
||||||
progressRect = g_ui.createWidget('SpellProgressRect', icon)
|
progressRect = g_ui.createWidget('SpellProgressRect', icon)
|
||||||
progressRect:setId(spellName)
|
progressRect:setId(iconId)
|
||||||
progressRect.icon = icon
|
progressRect.icon = icon
|
||||||
progressRect:fill('parent')
|
progressRect:fill('parent')
|
||||||
else
|
else
|
||||||
@@ -143,7 +158,7 @@ function onSpellCooldown(iconId, duration)
|
|||||||
progressRect:setTooltip(spellName)
|
progressRect:setTooltip(spellName)
|
||||||
|
|
||||||
local updateFunc = function()
|
local updateFunc = function()
|
||||||
updateCooldown(progressRect, duration/19)
|
updateCooldown(progressRect, duration)
|
||||||
end
|
end
|
||||||
local finishFunc = function()
|
local finishFunc = function()
|
||||||
removeCooldown(progressRect)
|
removeCooldown(progressRect)
|
||||||
@@ -165,7 +180,7 @@ function onSpellGroupCooldown(groupId, duration)
|
|||||||
if progressRect then
|
if progressRect then
|
||||||
removeEvent(progressRect.event)
|
removeEvent(progressRect.event)
|
||||||
local updateFunc = function()
|
local updateFunc = function()
|
||||||
updateCooldown(progressRect, duration/19)
|
updateCooldown(progressRect, duration)
|
||||||
end
|
end
|
||||||
local finishFunc = function()
|
local finishFunc = function()
|
||||||
turnOffCooldown(progressRect)
|
turnOffCooldown(progressRect)
|
||||||
|
@@ -87,7 +87,7 @@ MiniWindow
|
|||||||
!tooltip: tr('Special')
|
!tooltip: tr('Special')
|
||||||
|
|
||||||
Panel
|
Panel
|
||||||
id: spellCooldownPanel
|
id: cooldownPanel
|
||||||
layout:
|
layout:
|
||||||
type: horizontalBox
|
type: horizontalBox
|
||||||
height: 30
|
height: 30
|
||||||
@@ -98,4 +98,3 @@ MiniWindow
|
|||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
background-color: #ffffff11
|
background-color: #ffffff11
|
||||||
|
|
||||||
|
|
||||||
|
@@ -48,6 +48,11 @@ function init()
|
|||||||
soulLabel = healthInfoWindow:recursiveGetChildById('soulLabel')
|
soulLabel = healthInfoWindow:recursiveGetChildById('soulLabel')
|
||||||
capLabel = healthInfoWindow:recursiveGetChildById('capLabel')
|
capLabel = healthInfoWindow:recursiveGetChildById('capLabel')
|
||||||
|
|
||||||
|
-- load condition icons
|
||||||
|
for k,v in pairs(Icons) do
|
||||||
|
g_textures.preload(v.path)
|
||||||
|
end
|
||||||
|
|
||||||
if g_game.isOnline() then
|
if g_game.isOnline() then
|
||||||
local localPlayer = g_game.getLocalPlayer()
|
local localPlayer = g_game.getLocalPlayer()
|
||||||
onHealthChange(localPlayer, localPlayer:getHealth(), localPlayer:getMaxHealth())
|
onHealthChange(localPlayer, localPlayer:getHealth(), localPlayer:getMaxHealth())
|
||||||
@@ -92,13 +97,19 @@ function toggleIcon(bitChanged)
|
|||||||
if icon then
|
if icon then
|
||||||
icon:destroy()
|
icon:destroy()
|
||||||
else
|
else
|
||||||
icon = g_ui.createWidget('ConditionWidget', content)
|
icon = loadIcon(bitChanged)
|
||||||
icon:setId(Icons[bitChanged].id)
|
icon:setParent(content)
|
||||||
icon:setImageSource(Icons[bitChanged].path)
|
|
||||||
icon:setTooltip(Icons[bitChanged].tooltip)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function loadIcon(bitChanged)
|
||||||
|
local icon = g_ui.createWidget('ConditionWidget', content)
|
||||||
|
icon:setId(Icons[bitChanged].id)
|
||||||
|
icon:setImageSource(Icons[bitChanged].path)
|
||||||
|
icon:setTooltip(Icons[bitChanged].tooltip)
|
||||||
|
return icon
|
||||||
|
end
|
||||||
|
|
||||||
function offline()
|
function offline()
|
||||||
healthInfoWindow:recursiveGetChildById('conditionPanel'):destroyChildren()
|
healthInfoWindow:recursiveGetChildById('conditionPanel'):destroyChildren()
|
||||||
end
|
end
|
||||||
@@ -164,12 +175,27 @@ end
|
|||||||
|
|
||||||
function setHealthTooltip(tooltip)
|
function setHealthTooltip(tooltip)
|
||||||
healthTooltip = tooltip
|
healthTooltip = tooltip
|
||||||
|
|
||||||
|
local localPlayer = g_game.getLocalPlayer()
|
||||||
|
if localPlayer then
|
||||||
|
healthBar:setTooltip(tr(healthTooltip, localPlayer:getHealth(), localPlayer:getMaxHealth()))
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function setManaTooltip(tooltip)
|
function setManaTooltip(tooltip)
|
||||||
manaTooltip = tooltip
|
manaTooltip = tooltip
|
||||||
|
|
||||||
|
local localPlayer = g_game.getLocalPlayer()
|
||||||
|
if localPlayer then
|
||||||
|
manaBar:setTooltip(tr(manaTooltip, localPlayer:getMana(), localPlayer:getMaxMana()))
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function setExperienceTooltip(tooltip)
|
function setExperienceTooltip(tooltip)
|
||||||
experienceTooltip = tooltip
|
experienceTooltip = tooltip
|
||||||
|
|
||||||
|
local localPlayer = g_game.getLocalPlayer()
|
||||||
|
if localPlayer then
|
||||||
|
experienceBar:setTooltip(tr(experienceTooltip, localPlayer:getLevelPercent(), localPlayer:getLevel()+1))
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@@ -4,6 +4,7 @@ HealthBar < ProgressBar
|
|||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
margin: 1
|
||||||
|
|
||||||
ManaBar < ProgressBar
|
ManaBar < ProgressBar
|
||||||
id: manaBar
|
id: manaBar
|
||||||
@@ -11,6 +12,7 @@ ManaBar < ProgressBar
|
|||||||
anchors.top: prev.bottom
|
anchors.top: prev.bottom
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
margin: 1
|
||||||
margin-top: 3
|
margin-top: 3
|
||||||
|
|
||||||
ExperienceBar < ProgressBar
|
ExperienceBar < ProgressBar
|
||||||
@@ -19,9 +21,8 @@ ExperienceBar < ProgressBar
|
|||||||
anchors.top: prev.bottom
|
anchors.top: prev.bottom
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
margin: 1
|
||||||
margin-top: 3
|
margin-top: 3
|
||||||
//margin-top: 6
|
|
||||||
//height: 12
|
|
||||||
|
|
||||||
SoulLabel < GameLabel
|
SoulLabel < GameLabel
|
||||||
id: soulLabel
|
id: soulLabel
|
||||||
@@ -66,7 +67,7 @@ MiniWindow
|
|||||||
icon: /images/topbuttons/healthinfo
|
icon: /images/topbuttons/healthinfo
|
||||||
id: healthInfoWindow
|
id: healthInfoWindow
|
||||||
!text: tr('Health Info')
|
!text: tr('Health Info')
|
||||||
height: 121
|
height: 123
|
||||||
@onClose: modules.game_healthinfo.onMiniWindowClose()
|
@onClose: modules.game_healthinfo.onMiniWindowClose()
|
||||||
&save: true
|
&save: true
|
||||||
|
|
||||||
|
@@ -34,6 +34,7 @@ perCharacter = true
|
|||||||
mouseGrabberWidget = nil
|
mouseGrabberWidget = nil
|
||||||
useRadioGroup = nil
|
useRadioGroup = nil
|
||||||
currentHotkeys = nil
|
currentHotkeys = nil
|
||||||
|
boundCombosCallback = {}
|
||||||
hotkeysList = {}
|
hotkeysList = {}
|
||||||
|
|
||||||
-- public functions
|
-- public functions
|
||||||
@@ -75,6 +76,8 @@ function init()
|
|||||||
onGameStart = online,
|
onGameStart = online,
|
||||||
onGameEnd = offline
|
onGameEnd = offline
|
||||||
})
|
})
|
||||||
|
|
||||||
|
load()
|
||||||
end
|
end
|
||||||
|
|
||||||
function terminate()
|
function terminate()
|
||||||
@@ -95,6 +98,7 @@ end
|
|||||||
function configure(savePerServer, savePerCharacter)
|
function configure(savePerServer, savePerCharacter)
|
||||||
perServer = savePerServer
|
perServer = savePerServer
|
||||||
perCharacter = savePerCharacter
|
perCharacter = savePerCharacter
|
||||||
|
reload()
|
||||||
end
|
end
|
||||||
|
|
||||||
function online()
|
function online()
|
||||||
@@ -108,6 +112,9 @@ function offline()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function show()
|
function show()
|
||||||
|
if not g_game.isOnline() then
|
||||||
|
return
|
||||||
|
end
|
||||||
hotkeysWindow:show()
|
hotkeysWindow:show()
|
||||||
hotkeysWindow:raise()
|
hotkeysWindow:raise()
|
||||||
hotkeysWindow:focus()
|
hotkeysWindow:focus()
|
||||||
@@ -138,7 +145,7 @@ end
|
|||||||
function load(forceDefaults)
|
function load(forceDefaults)
|
||||||
hotkeysManagerLoaded = false
|
hotkeysManagerLoaded = false
|
||||||
|
|
||||||
local hotkeySettings = g_settings.getNode('hotkeys')
|
local hotkeySettings = g_settings.getNode('game_hotkeys')
|
||||||
local hotkeys = {}
|
local hotkeys = {}
|
||||||
|
|
||||||
if not table.empty(hotkeySettings) then hotkeys = hotkeySettings end
|
if not table.empty(hotkeySettings) then hotkeys = hotkeySettings end
|
||||||
@@ -149,6 +156,7 @@ function load(forceDefaults)
|
|||||||
if not forceDefaults then
|
if not forceDefaults then
|
||||||
if not table.empty(hotkeys) then
|
if not table.empty(hotkeys) then
|
||||||
for keyCombo, setting in pairs(hotkeys) do
|
for keyCombo, setting in pairs(hotkeys) do
|
||||||
|
keyCombo = tostring(keyCombo)
|
||||||
addKeyCombo(keyCombo, setting)
|
addKeyCombo(keyCombo, setting)
|
||||||
hotkeyList[keyCombo] = setting
|
hotkeyList[keyCombo] = setting
|
||||||
end
|
end
|
||||||
@@ -163,12 +171,13 @@ function load(forceDefaults)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function unload()
|
function unload()
|
||||||
for _,child in pairs(currentHotkeys:getChildren()) do
|
for keyCombo,callback in pairs(boundCombosCallback) do
|
||||||
g_keyboard.unbindKeyPress(child.keyCombo)
|
g_keyboard.unbindKeyPress(keyCombo, callback)
|
||||||
end
|
end
|
||||||
|
boundCombosCallback = {}
|
||||||
currentHotkeys:destroyChildren()
|
currentHotkeys:destroyChildren()
|
||||||
currentHotkeyLabel = nil
|
currentHotkeyLabel = nil
|
||||||
updateHotkeyForm()
|
updateHotkeyForm(true)
|
||||||
hotkeyList = {}
|
hotkeyList = {}
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -183,31 +192,39 @@ function reload()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function save()
|
function save()
|
||||||
local hotkeySettings = g_settings.getNode('hotkeys') or {}
|
local hotkeySettings = g_settings.getNode('game_hotkeys') or {}
|
||||||
local hotkeys = hotkeySettings
|
local hotkeys = hotkeySettings
|
||||||
|
|
||||||
if perServer then
|
if perServer then
|
||||||
hotkeys[G.host] = {}
|
if not hotkeys[G.host] then
|
||||||
|
hotkeys[G.host] = {}
|
||||||
|
end
|
||||||
hotkeys = hotkeys[G.host]
|
hotkeys = hotkeys[G.host]
|
||||||
end
|
end
|
||||||
|
|
||||||
if perCharacter then
|
if perCharacter then
|
||||||
hotkeys[g_game.getCharacterName()] = {}
|
local char = g_game.getCharacterName()
|
||||||
hotkeys = hotkeys[g_game.getCharacterName()]
|
if not hotkeys[char] then
|
||||||
|
hotkeys[char] = {}
|
||||||
|
end
|
||||||
|
hotkeys = hotkeys[char]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
table.clear(hotkeys)
|
||||||
|
|
||||||
for _,child in pairs(currentHotkeys:getChildren()) do
|
for _,child in pairs(currentHotkeys:getChildren()) do
|
||||||
hotkeys[child.keyCombo] = {
|
hotkeys[child.keyCombo] = {
|
||||||
autoSend = child.autoSend,
|
autoSend = child.autoSend,
|
||||||
itemId = child.itemId,
|
itemId = child.itemId,
|
||||||
|
subType = child.subType,
|
||||||
useType = child.useType,
|
useType = child.useType,
|
||||||
value = child.value
|
value = child.value
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
hotkeyList = hotkeys
|
hotkeyList = hotkeys
|
||||||
g_settings.setNode('hotkeys', hotkeySettings)
|
g_settings.setNode('game_hotkeys', hotkeySettings)
|
||||||
--g_settings.save()
|
g_settings.save()
|
||||||
end
|
end
|
||||||
|
|
||||||
function loadDefautComboKeys()
|
function loadDefautComboKeys()
|
||||||
@@ -250,6 +267,9 @@ function onChooseItemMouseRelease(self, mousePosition, mouseButton)
|
|||||||
|
|
||||||
if item and currentHotkeyLabel then
|
if item and currentHotkeyLabel then
|
||||||
currentHotkeyLabel.itemId = item:getId()
|
currentHotkeyLabel.itemId = item:getId()
|
||||||
|
if item:isFluidContainer() then
|
||||||
|
currentHotkeyLabel.subType = item:getSubType()
|
||||||
|
end
|
||||||
if item:isMultiUse() then
|
if item:isMultiUse() then
|
||||||
currentHotkeyLabel.useType = HOTKEY_MANAGER_USEWITH
|
currentHotkeyLabel.useType = HOTKEY_MANAGER_USEWITH
|
||||||
else
|
else
|
||||||
@@ -258,7 +278,7 @@ function onChooseItemMouseRelease(self, mousePosition, mouseButton)
|
|||||||
currentHotkeyLabel.value = nil
|
currentHotkeyLabel.value = nil
|
||||||
currentHotkeyLabel.autoSend = false
|
currentHotkeyLabel.autoSend = false
|
||||||
updateHotkeyLabel(currentHotkeyLabel)
|
updateHotkeyLabel(currentHotkeyLabel)
|
||||||
updateHotkeyForm()
|
updateHotkeyForm(true)
|
||||||
end
|
end
|
||||||
|
|
||||||
show()
|
show()
|
||||||
@@ -277,11 +297,12 @@ end
|
|||||||
|
|
||||||
function clearObject()
|
function clearObject()
|
||||||
currentHotkeyLabel.itemId = nil
|
currentHotkeyLabel.itemId = nil
|
||||||
|
currentHotkeyLabel.subType = nil
|
||||||
currentHotkeyLabel.useType = nil
|
currentHotkeyLabel.useType = nil
|
||||||
currentHotkeyLabel.autoSend = nil
|
currentHotkeyLabel.autoSend = nil
|
||||||
currentHotkeyLabel.value = nil
|
currentHotkeyLabel.value = nil
|
||||||
updateHotkeyLabel(currentHotkeyLabel)
|
updateHotkeyLabel(currentHotkeyLabel)
|
||||||
updateHotkeyForm()
|
updateHotkeyForm(true)
|
||||||
end
|
end
|
||||||
|
|
||||||
function addHotkey()
|
function addHotkey()
|
||||||
@@ -294,6 +315,7 @@ function addHotkey()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function addKeyCombo(keyCombo, keySettings, focus)
|
function addKeyCombo(keyCombo, keySettings, focus)
|
||||||
|
if keyCombo == nil or #keyCombo == 0 then return end
|
||||||
if not keyCombo then return end
|
if not keyCombo then return end
|
||||||
local hotkeyLabel = currentHotkeys:getChildById(keyCombo)
|
local hotkeyLabel = currentHotkeys:getChildById(keyCombo)
|
||||||
if not hotkeyLabel then
|
if not hotkeyLabel then
|
||||||
@@ -321,27 +343,30 @@ function addKeyCombo(keyCombo, keySettings, focus)
|
|||||||
if keySettings then
|
if keySettings then
|
||||||
currentHotkeyLabel = hotkeyLabel
|
currentHotkeyLabel = hotkeyLabel
|
||||||
hotkeyLabel.keyCombo = keyCombo
|
hotkeyLabel.keyCombo = keyCombo
|
||||||
hotkeyLabel.autoSend = keySettings.autoSend
|
hotkeyLabel.autoSend = toboolean(keySettings.autoSend)
|
||||||
hotkeyLabel.itemId = keySettings.itemId
|
hotkeyLabel.itemId = tonumber(keySettings.itemId)
|
||||||
|
hotkeyLabel.subType = tonumber(keySettings.subType)
|
||||||
hotkeyLabel.useType = tonumber(keySettings.useType)
|
hotkeyLabel.useType = tonumber(keySettings.useType)
|
||||||
hotkeyLabel.value = keySettings.value
|
if keySettings.value then hotkeyLabel.value = tostring(keySettings.value) end
|
||||||
else
|
else
|
||||||
hotkeyLabel.keyCombo = keyCombo
|
hotkeyLabel.keyCombo = keyCombo
|
||||||
hotkeyLabel.autoSend = nil
|
hotkeyLabel.autoSend = false
|
||||||
hotkeyLabel.itemId = nil
|
hotkeyLabel.itemId = nil
|
||||||
|
hotkeyLabel.subType = nil
|
||||||
hotkeyLabel.useType = nil
|
hotkeyLabel.useType = nil
|
||||||
hotkeyLabel.value = nil
|
hotkeyLabel.value = ''
|
||||||
end
|
end
|
||||||
|
|
||||||
updateHotkeyLabel(hotkeyLabel)
|
updateHotkeyLabel(hotkeyLabel)
|
||||||
|
|
||||||
g_keyboard.bindKeyPress(keyCombo, function() doKeyCombo(keyCombo) end, nil, 350)
|
boundCombosCallback[keyCombo] = function() doKeyCombo(keyCombo) end
|
||||||
|
g_keyboard.bindKeyPress(keyCombo, boundCombosCallback[keyCombo])
|
||||||
end
|
end
|
||||||
|
|
||||||
if focus then
|
if focus then
|
||||||
currentHotkeys:focusChild(hotkeyLabel)
|
currentHotkeys:focusChild(hotkeyLabel)
|
||||||
currentHotkeys:ensureChildVisible(hotkeyLabel)
|
currentHotkeys:ensureChildVisible(hotkeyLabel)
|
||||||
updateHotkeyForm()
|
updateHotkeyForm(true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -357,15 +382,42 @@ function doKeyCombo(keyCombo)
|
|||||||
modules.game_console.setTextEditText(hotKey.value)
|
modules.game_console.setTextEditText(hotKey.value)
|
||||||
end
|
end
|
||||||
elseif hotKey.useType == HOTKEY_MANAGER_USE then
|
elseif hotKey.useType == HOTKEY_MANAGER_USE then
|
||||||
g_game.useInventoryItemWith(hotKey.itemId)
|
if g_game.getProtocolVersion() < 780 or hotKey.subType then
|
||||||
|
local item = g_game.findPlayerItem(hotKey.itemId, hotKey.subType or -1)
|
||||||
|
if item then
|
||||||
|
g_game.use(item)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
g_game.useInventoryItem(hotKey.itemId)
|
||||||
|
end
|
||||||
elseif hotKey.useType == HOTKEY_MANAGER_USEONSELF then
|
elseif hotKey.useType == HOTKEY_MANAGER_USEONSELF then
|
||||||
g_game.useInventoryItemWith(hotKey.itemId, g_game.getLocalPlayer())
|
if g_game.getProtocolVersion() < 780 or hotKey.subType then
|
||||||
|
local item = g_game.findPlayerItem(hotKey.itemId, hotKey.subType or -1)
|
||||||
|
if item then
|
||||||
|
g_game.useWith(item, g_game.getLocalPlayer())
|
||||||
|
end
|
||||||
|
else
|
||||||
|
g_game.useInventoryItemWith(hotKey.itemId, g_game.getLocalPlayer())
|
||||||
|
end
|
||||||
elseif hotKey.useType == HOTKEY_MANAGER_USEONTARGET then
|
elseif hotKey.useType == HOTKEY_MANAGER_USEONTARGET then
|
||||||
local attackingCreature = g_game.getAttackingCreature()
|
local attackingCreature = g_game.getAttackingCreature()
|
||||||
if not attackingCreature then return end
|
if not attackingCreature then return end
|
||||||
g_game.useInventoryItemWith(hotKey.itemId, attackingCreature)
|
if not attackingCreature:getTile() then return end
|
||||||
|
if g_game.getProtocolVersion() < 780 or hotKey.subType then
|
||||||
|
local item = g_game.findPlayerItem(hotKey.itemId, hotKey.subType or -1)
|
||||||
|
if item then
|
||||||
|
g_game.useWith(item, attackingCreature)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
g_game.useInventoryItemWith(hotKey.itemId, attackingCreature)
|
||||||
|
end
|
||||||
elseif hotKey.useType == HOTKEY_MANAGER_USEWITH then
|
elseif hotKey.useType == HOTKEY_MANAGER_USEWITH then
|
||||||
local item = Item.create(hotKey.itemId)
|
local item = Item.create(hotKey.itemId)
|
||||||
|
if g_game.getProtocolVersion() < 780 or hotKey.subType then
|
||||||
|
local tmpItem = g_game.findPlayerItem(hotKey.itemId, hotKey.subType or -1)
|
||||||
|
if not tmpItem then return true end
|
||||||
|
item = tmpItem
|
||||||
|
end
|
||||||
modules.game_interface.startUseWith(item)
|
modules.game_interface.startUseWith(item)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -398,7 +450,7 @@ function updateHotkeyLabel(hotkeyLabel)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function updateHotkeyForm()
|
function updateHotkeyForm(reset)
|
||||||
if currentHotkeyLabel then
|
if currentHotkeyLabel then
|
||||||
removeHotkeyButton:enable()
|
removeHotkeyButton:enable()
|
||||||
if currentHotkeyLabel.itemId ~= nil then
|
if currentHotkeyLabel.itemId ~= nil then
|
||||||
@@ -410,6 +462,9 @@ function updateHotkeyForm()
|
|||||||
selectObjectButton:disable()
|
selectObjectButton:disable()
|
||||||
clearObjectButton:enable()
|
clearObjectButton:enable()
|
||||||
currentItemPreview:setItemId(currentHotkeyLabel.itemId)
|
currentItemPreview:setItemId(currentHotkeyLabel.itemId)
|
||||||
|
if currentHotkeyLabel.subType then
|
||||||
|
currentItemPreview:setItemSubType(currentHotkeyLabel.subType)
|
||||||
|
end
|
||||||
if currentItemPreview:getItem():isMultiUse() then
|
if currentItemPreview:getItem():isMultiUse() then
|
||||||
useOnSelf:enable()
|
useOnSelf:enable()
|
||||||
useOnTarget:enable()
|
useOnTarget:enable()
|
||||||
@@ -435,8 +490,10 @@ function updateHotkeyForm()
|
|||||||
hotkeyText:enable()
|
hotkeyText:enable()
|
||||||
hotkeyText:focus()
|
hotkeyText:focus()
|
||||||
hotKeyTextLabel:enable()
|
hotKeyTextLabel:enable()
|
||||||
|
if reset then
|
||||||
|
hotkeyText:setCursorPos(-1)
|
||||||
|
end
|
||||||
hotkeyText:setText(currentHotkeyLabel.value)
|
hotkeyText:setText(currentHotkeyLabel.value)
|
||||||
hotkeyText:setCursorPos(-1)
|
|
||||||
sendAutomatically:setChecked(currentHotkeyLabel.autoSend)
|
sendAutomatically:setChecked(currentHotkeyLabel.autoSend)
|
||||||
sendAutomatically:setEnabled(currentHotkeyLabel.value and #currentHotkeyLabel.value > 0)
|
sendAutomatically:setEnabled(currentHotkeyLabel.value and #currentHotkeyLabel.value > 0)
|
||||||
selectObjectButton:enable()
|
selectObjectButton:enable()
|
||||||
@@ -461,7 +518,8 @@ end
|
|||||||
|
|
||||||
function removeHotkey()
|
function removeHotkey()
|
||||||
if currentHotkeyLabel == nil then return end
|
if currentHotkeyLabel == nil then return end
|
||||||
g_keyboard.unbindKeyPress(currentHotkeyLabel.keyCombo)
|
g_keyboard.unbindKeyPress(currentHotkeyLabel.keyCombo, boundCombosCallback[currentHotkeyLabel.keyCombo])
|
||||||
|
boundCombosCallback[currentHotkeyLabel.keyCombo] = nil
|
||||||
currentHotkeyLabel:destroy()
|
currentHotkeyLabel:destroy()
|
||||||
currentHotkeyLabel = nil
|
currentHotkeyLabel = nil
|
||||||
end
|
end
|
||||||
@@ -504,7 +562,7 @@ end
|
|||||||
|
|
||||||
function onSelectHotkeyLabel(hotkeyLabel)
|
function onSelectHotkeyLabel(hotkeyLabel)
|
||||||
currentHotkeyLabel = hotkeyLabel
|
currentHotkeyLabel = hotkeyLabel
|
||||||
updateHotkeyForm()
|
updateHotkeyForm(true)
|
||||||
end
|
end
|
||||||
|
|
||||||
function hotkeyCapture(assignWindow, keyCode, keyboardModifiers)
|
function hotkeyCapture(assignWindow, keyCode, keyboardModifiers)
|
||||||
|
@@ -1,4 +1,3 @@
|
|||||||
WALK_REPEAT_DELAY = 90
|
|
||||||
WALK_STEPS_RETRY = 10
|
WALK_STEPS_RETRY = 10
|
||||||
|
|
||||||
gameRootPanel = nil
|
gameRootPanel = nil
|
||||||
@@ -12,20 +11,19 @@ countWindow = nil
|
|||||||
logoutWindow = nil
|
logoutWindow = nil
|
||||||
exitWindow = nil
|
exitWindow = nil
|
||||||
bottomSplitter = nil
|
bottomSplitter = nil
|
||||||
limitZoom = false
|
limitedZoom = false
|
||||||
currentViewMode = 0
|
currentViewMode = 0
|
||||||
smartWalkDirs = {}
|
smartWalkDirs = {}
|
||||||
smartWalkDir = nil
|
smartWalkDir = nil
|
||||||
walkFunction = g_game.walk
|
walkFunction = nil
|
||||||
|
|
||||||
function init()
|
function init()
|
||||||
g_ui.importStyle('styles/countwindow')
|
g_ui.importStyle('styles/countwindow')
|
||||||
|
|
||||||
connect(g_game, {
|
connect(g_game, {
|
||||||
onGameStart = onGameStart,
|
onGameStart = onGameStart,
|
||||||
onGMActions = onGMActions,
|
|
||||||
onGameEnd = onGameEnd,
|
onGameEnd = onGameEnd,
|
||||||
onLoginAdvice = onLoginAdvice
|
onLoginAdvice = onLoginAdvice,
|
||||||
}, true)
|
}, true)
|
||||||
|
|
||||||
gameRootPanel = g_ui.displayUI('gameinterface')
|
gameRootPanel = g_ui.displayUI('gameinterface')
|
||||||
@@ -44,11 +42,13 @@ function init()
|
|||||||
gameBottomPanel = gameRootPanel:getChildById('gameBottomPanel')
|
gameBottomPanel = gameRootPanel:getChildById('gameBottomPanel')
|
||||||
connect(gameLeftPanel, { onVisibilityChange = onLeftPanelVisibilityChange })
|
connect(gameLeftPanel, { onVisibilityChange = onLeftPanelVisibilityChange })
|
||||||
|
|
||||||
logoutButton = modules.client_topmenu.addLeftButton('logoutButton', tr('Exit'), '/images/topbuttons/logout', tryLogout, true)
|
logoutButton = modules.client_topmenu.addLeftButton('logoutButton', tr('Exit'),
|
||||||
|
'/images/topbuttons/logout', tryLogout, true)
|
||||||
|
|
||||||
setupViewMode(0)
|
setupViewMode(0)
|
||||||
|
|
||||||
bindKeys()
|
bindKeys()
|
||||||
|
load()
|
||||||
|
|
||||||
if g_game.isOnline() then
|
if g_game.isOnline() then
|
||||||
show()
|
show()
|
||||||
@@ -56,68 +56,58 @@ function init()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function bindKeys()
|
function bindKeys()
|
||||||
g_keyboard.bindKeyDown('Up', function() changeWalkDir(North) end, gameRootPanel, true)
|
gameRootPanel:setAutoRepeatDelay(250)
|
||||||
g_keyboard.bindKeyDown('Right', function() changeWalkDir(East) end, gameRootPanel, true)
|
|
||||||
g_keyboard.bindKeyDown('Down', function() changeWalkDir(South) end, gameRootPanel, true)
|
|
||||||
g_keyboard.bindKeyDown('Left', function() changeWalkDir(West) end, gameRootPanel, true)
|
|
||||||
g_keyboard.bindKeyDown('Numpad8', function() changeWalkDir(North) end, gameRootPanel, true)
|
|
||||||
g_keyboard.bindKeyDown('Numpad9', function() changeWalkDir(NorthEast) end, gameRootPanel, true)
|
|
||||||
g_keyboard.bindKeyDown('Numpad6', function() changeWalkDir(East) end, gameRootPanel, true)
|
|
||||||
g_keyboard.bindKeyDown('Numpad3', function() changeWalkDir(SouthEast) end, gameRootPanel, true)
|
|
||||||
g_keyboard.bindKeyDown('Numpad2', function() changeWalkDir(South) end, gameRootPanel, true)
|
|
||||||
g_keyboard.bindKeyDown('Numpad1', function() changeWalkDir(SouthWest) end, gameRootPanel, true)
|
|
||||||
g_keyboard.bindKeyDown('Numpad4', function() changeWalkDir(West) end, gameRootPanel, true)
|
|
||||||
g_keyboard.bindKeyDown('Numpad7', function() changeWalkDir(NorthWest) end, gameRootPanel, true)
|
|
||||||
g_keyboard.bindKeyUp('Up', function() changeWalkDir(North, true) end, gameRootPanel, true)
|
|
||||||
g_keyboard.bindKeyUp('Right', function() changeWalkDir(East, true) end, gameRootPanel, true)
|
|
||||||
g_keyboard.bindKeyUp('Down', function() changeWalkDir(South, true) end, gameRootPanel, true)
|
|
||||||
g_keyboard.bindKeyUp('Left', function() changeWalkDir(West, true) end, gameRootPanel, true)
|
|
||||||
g_keyboard.bindKeyUp('Numpad8', function() changeWalkDir(North, true) end, gameRootPanel, true)
|
|
||||||
g_keyboard.bindKeyUp('Numpad9', function() changeWalkDir(NorthEast, true) end, gameRootPanel, true)
|
|
||||||
g_keyboard.bindKeyUp('Numpad6', function() changeWalkDir(East, true) end, gameRootPanel, true)
|
|
||||||
g_keyboard.bindKeyUp('Numpad3', function() changeWalkDir(SouthEast, true) end, gameRootPanel, true)
|
|
||||||
g_keyboard.bindKeyUp('Numpad2', function() changeWalkDir(South, true) end, gameRootPanel, true)
|
|
||||||
g_keyboard.bindKeyUp('Numpad1', function() changeWalkDir(SouthWest, true) end, gameRootPanel, true)
|
|
||||||
g_keyboard.bindKeyUp('Numpad4', function() changeWalkDir(West, true) end, gameRootPanel, true)
|
|
||||||
g_keyboard.bindKeyUp('Numpad7', function() changeWalkDir(NorthWest, true) end, gameRootPanel, true)
|
|
||||||
g_keyboard.bindKeyPress('Up', function() smartWalk(North) end, gameRootPanel, WALK_AUTO_REPEAT_DELAY)
|
|
||||||
g_keyboard.bindKeyPress('Right', function() smartWalk(East) end, gameRootPanel, WALK_AUTO_REPEAT_DELAY)
|
|
||||||
g_keyboard.bindKeyPress('Down', function() smartWalk(South) end, gameRootPanel, WALK_AUTO_REPEAT_DELAY)
|
|
||||||
g_keyboard.bindKeyPress('Left', function() smartWalk(West) end, gameRootPanel, WALK_AUTO_REPEAT_DELAY)
|
|
||||||
g_keyboard.bindKeyPress('Numpad8', function() smartWalk(North) end, gameRootPanel, WALK_AUTO_REPEAT_DELAY)
|
|
||||||
g_keyboard.bindKeyPress('Numpad9', function() smartWalk(NorthEast) end, gameRootPanel, WALK_AUTO_REPEAT_DELAY)
|
|
||||||
g_keyboard.bindKeyPress('Numpad6', function() smartWalk(East) end, gameRootPanel, WALK_AUTO_REPEAT_DELAY)
|
|
||||||
g_keyboard.bindKeyPress('Numpad3', function() smartWalk(SouthEast) end, gameRootPanel, WALK_AUTO_REPEAT_DELAY)
|
|
||||||
g_keyboard.bindKeyPress('Numpad2', function() smartWalk(South) end, gameRootPanel, WALK_AUTO_REPEAT_DELAY)
|
|
||||||
g_keyboard.bindKeyPress('Numpad1', function() smartWalk(SouthWest) end, gameRootPanel, WALK_AUTO_REPEAT_DELAY)
|
|
||||||
g_keyboard.bindKeyPress('Numpad4', function() smartWalk(West) end, gameRootPanel, WALK_AUTO_REPEAT_DELAY)
|
|
||||||
g_keyboard.bindKeyPress('Numpad7', function() smartWalk(NorthWest) end, gameRootPanel, WALK_AUTO_REPEAT_DELAY)
|
|
||||||
|
|
||||||
g_keyboard.bindKeyPress('Ctrl+Up', function() g_game.turn(North) changeWalkDir(North) end, gameRootPanel, WALK_AUTO_REPEAT_DELAY)
|
bindWalkKey('Up', North)
|
||||||
g_keyboard.bindKeyPress('Ctrl+Right', function() g_game.turn(East) changeWalkDir(East) end, gameRootPanel, WALK_AUTO_REPEAT_DELAY)
|
bindWalkKey('Right', East)
|
||||||
g_keyboard.bindKeyPress('Ctrl+Down', function() g_game.turn(South) changeWalkDir(South) end, gameRootPanel, WALK_AUTO_REPEAT_DELAY)
|
bindWalkKey('Down', South)
|
||||||
g_keyboard.bindKeyPress('Ctrl+Left', function() g_game.turn(West) changeWalkDir(West) end, gameRootPanel, WALK_AUTO_REPEAT_DELAY)
|
bindWalkKey('Left', West)
|
||||||
g_keyboard.bindKeyPress('Ctrl+Numpad8', function() g_game.turn(North) changeWalkDir(North) end, gameRootPanel, WALK_AUTO_REPEAT_DELAY)
|
bindWalkKey('Numpad8', North)
|
||||||
g_keyboard.bindKeyPress('Ctrl+Numpad6', function() g_game.turn(East) changeWalkDir(East) end, gameRootPanel, WALK_AUTO_REPEAT_DELAY)
|
bindWalkKey('Numpad9', NorthEast)
|
||||||
g_keyboard.bindKeyPress('Ctrl+Numpad2', function() g_game.turn(South) changeWalkDir(South) end, gameRootPanel, WALK_AUTO_REPEAT_DELAY)
|
bindWalkKey('Numpad6', East)
|
||||||
g_keyboard.bindKeyPress('Ctrl+Numpad4', function() g_game.turn(West) changeWalkDir(West) end, gameRootPanel, WALK_AUTO_REPEAT_DELAY)
|
bindWalkKey('Numpad3', SouthEast)
|
||||||
g_keyboard.bindKeyPress('Escape', function() g_game.cancelAttackAndFollow() end, gameRootPanel, WALK_AUTO_REPEAT_DELAY)
|
bindWalkKey('Numpad2', South)
|
||||||
g_keyboard.bindKeyPress('Ctrl+=', function() gameMapPanel:zoomIn() end, gameRootPanel, 250)
|
bindWalkKey('Numpad1', SouthWest)
|
||||||
g_keyboard.bindKeyPress('Ctrl+-', function() gameMapPanel:zoomOut() end, gameRootPanel, 250)
|
bindWalkKey('Numpad4', West)
|
||||||
g_keyboard.bindKeyDown('Ctrl+Q', logout, gameRootPanel)
|
bindWalkKey('Numpad7', NorthWest)
|
||||||
g_keyboard.bindKeyDown('Ctrl+L', logout, gameRootPanel)
|
|
||||||
|
g_keyboard.bindKeyPress('Ctrl+Up', function() g_game.turn(North) changeWalkDir(North) end, gameRootPanel)
|
||||||
|
g_keyboard.bindKeyPress('Ctrl+Right', function() g_game.turn(East) changeWalkDir(East) end, gameRootPanel)
|
||||||
|
g_keyboard.bindKeyPress('Ctrl+Down', function() g_game.turn(South) changeWalkDir(South) end, gameRootPanel)
|
||||||
|
g_keyboard.bindKeyPress('Ctrl+Left', function() g_game.turn(West) changeWalkDir(West) end, gameRootPanel)
|
||||||
|
g_keyboard.bindKeyPress('Ctrl+Numpad8', function() g_game.turn(North) changeWalkDir(North) end, gameRootPanel)
|
||||||
|
g_keyboard.bindKeyPress('Ctrl+Numpad6', function() g_game.turn(East) changeWalkDir(East) end, gameRootPanel)
|
||||||
|
g_keyboard.bindKeyPress('Ctrl+Numpad2', function() g_game.turn(South) changeWalkDir(South) end, gameRootPanel)
|
||||||
|
g_keyboard.bindKeyPress('Ctrl+Numpad4', function() g_game.turn(West) changeWalkDir(West) end, gameRootPanel)
|
||||||
|
g_keyboard.bindKeyPress('Escape', function() g_game.cancelAttackAndFollow() end, gameRootPanel)
|
||||||
|
g_keyboard.bindKeyPress('Ctrl+=', function() gameMapPanel:zoomIn() end, gameRootPanel)
|
||||||
|
g_keyboard.bindKeyPress('Ctrl+-', function() gameMapPanel:zoomOut() end, gameRootPanel)
|
||||||
|
g_keyboard.bindKeyDown('Ctrl+Q', function() tryLogout(false) end, gameRootPanel)
|
||||||
|
g_keyboard.bindKeyDown('Ctrl+L', function() tryLogout(false) end, gameRootPanel)
|
||||||
g_keyboard.bindKeyDown('Ctrl+W', function() g_map.cleanTexts() modules.game_textmessage.clearMessages() end, gameRootPanel)
|
g_keyboard.bindKeyDown('Ctrl+W', function() g_map.cleanTexts() modules.game_textmessage.clearMessages() end, gameRootPanel)
|
||||||
g_keyboard.bindKeyDown('Ctrl+.', nextViewMode, gameRootPanel)
|
g_keyboard.bindKeyDown('Ctrl+.', nextViewMode, gameRootPanel)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function bindWalkKey(key, dir)
|
||||||
|
g_keyboard.bindKeyDown(key, function() changeWalkDir(dir) end, gameRootPanel, true)
|
||||||
|
g_keyboard.bindKeyUp(key, function() changeWalkDir(dir, true) end, gameRootPanel, true)
|
||||||
|
g_keyboard.bindKeyPress(key, function() smartWalk(dir) end, gameRootPanel)
|
||||||
|
end
|
||||||
|
|
||||||
|
function unbindWalkKey(key)
|
||||||
|
g_keyboard.unbindKeyDown(key, gameRootPanel)
|
||||||
|
g_keyboard.unbindKeyUp(key, gameRootPanel)
|
||||||
|
g_keyboard.unbindKeyPress(key, gameRootPanel)
|
||||||
|
end
|
||||||
|
|
||||||
function terminate()
|
function terminate()
|
||||||
|
save()
|
||||||
hide()
|
hide()
|
||||||
|
|
||||||
stopSmartWalk()
|
stopSmartWalk()
|
||||||
|
|
||||||
disconnect(g_game, {
|
disconnect(g_game, {
|
||||||
onGameStart = onGameStart,
|
onGameStart = onGameStart,
|
||||||
onGMActions = onGMActions,
|
|
||||||
onGameEnd = onGameEnd,
|
onGameEnd = onGameEnd,
|
||||||
onLoginAdvice = onLoginAdvice
|
onLoginAdvice = onLoginAdvice
|
||||||
})
|
})
|
||||||
@@ -150,11 +140,19 @@ function show()
|
|||||||
gameRootPanel:show()
|
gameRootPanel:show()
|
||||||
gameRootPanel:focus()
|
gameRootPanel:focus()
|
||||||
gameMapPanel:followCreature(g_game.getLocalPlayer())
|
gameMapPanel:followCreature(g_game.getLocalPlayer())
|
||||||
gameMapPanel:setMaxZoomOut(11)
|
|
||||||
gameMapPanel:setLimitVisibleRange(true)
|
|
||||||
setupViewMode(0)
|
setupViewMode(0)
|
||||||
updateStretchShrink()
|
updateStretchShrink()
|
||||||
logoutButton:setTooltip(tr('Logout'))
|
logoutButton:setTooltip(tr('Logout'))
|
||||||
|
|
||||||
|
addEvent(function()
|
||||||
|
if not limitedZoom or g_game.isGM() then
|
||||||
|
gameMapPanel:setMaxZoomOut(513)
|
||||||
|
gameMapPanel:setLimitVisibleRange(false)
|
||||||
|
else
|
||||||
|
gameMapPanel:setMaxZoomOut(11)
|
||||||
|
gameMapPanel:setLimitVisibleRange(true)
|
||||||
|
end
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function hide()
|
function hide()
|
||||||
@@ -177,11 +175,27 @@ function hide()
|
|||||||
modules.client_background.show()
|
modules.client_background.show()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function save()
|
||||||
|
local settings = {}
|
||||||
|
settings.splitterMarginBottom = bottomSplitter:getMarginBottom()
|
||||||
|
g_settings.setNode('game_interface', settings)
|
||||||
|
end
|
||||||
|
|
||||||
|
function load()
|
||||||
|
local settings = g_settings.getNode('game_interface')
|
||||||
|
if settings then
|
||||||
|
if settings.splitterMarginBottom then
|
||||||
|
bottomSplitter:setMarginBottom(settings.splitterMarginBottom)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function onLoginAdvice(message)
|
function onLoginAdvice(message)
|
||||||
displayInfoBox(tr("For Your Information"), message)
|
displayInfoBox(tr("For Your Information"), message)
|
||||||
end
|
end
|
||||||
|
|
||||||
function forceExit()
|
function forceExit()
|
||||||
|
g_game.cancelLogin()
|
||||||
scheduleEvent(exit, 10)
|
scheduleEvent(exit, 10)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@@ -191,8 +205,8 @@ function tryExit()
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
local exitFunc = function() logout() forceExit() end
|
local exitFunc = function() g_game.safeLogout() forceExit() end
|
||||||
local logoutFunc = function() logout() exitWindow:destroy() exitWindow = nil end
|
local logoutFunc = function() g_game.safeLogout() exitWindow:destroy() exitWindow = nil end
|
||||||
local cancelFunc = function() exitWindow:destroy() exitWindow = nil end
|
local cancelFunc = function() exitWindow:destroy() exitWindow = nil end
|
||||||
|
|
||||||
exitWindow = displayGeneralBox(tr('Exit'), tr("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."),
|
exitWindow = displayGeneralBox(tr('Exit'), tr("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."),
|
||||||
@@ -204,29 +218,55 @@ function tryExit()
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
function logout()
|
function tryLogout(prompt)
|
||||||
if g_game.isOnline() then
|
if type(prompt) ~= "boolean" then
|
||||||
g_game.safeLogout()
|
prompt = true
|
||||||
return true
|
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
function tryLogout()
|
|
||||||
if not g_game.isOnline() then
|
if not g_game.isOnline() then
|
||||||
exit()
|
exit()
|
||||||
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if logoutWindow then
|
if logoutWindow then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local yesCallback = function() logout() logoutWindow:destroy() logoutWindow=nil end
|
local msg, yesCallback
|
||||||
local noCallback = function() logoutWindow:destroy() logoutWindow=nil end
|
if not g_game.isConnectionOk() then
|
||||||
|
msg = 'Your connection is failing, if you logout now your character will be still online, do you want to force logout?'
|
||||||
|
|
||||||
logoutWindow = displayGeneralBox(tr('Logout'), tr('Are you sure you want to logout?'), {
|
yesCallback = function()
|
||||||
{ text=tr('Yes'), callback=yesCallback },
|
g_game.forceLogout()
|
||||||
{ text=tr('No'), callback=noCallback },
|
if logoutWindow then
|
||||||
anchor=AnchorHorizontalCenter}, yesCallback, noCallback)
|
logoutWindow:destroy()
|
||||||
|
logoutWindow=nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
msg = 'Are you sure you want to logout?'
|
||||||
|
|
||||||
|
yesCallback = function()
|
||||||
|
g_game.safeLogout()
|
||||||
|
if logoutWindow then
|
||||||
|
logoutWindow:destroy()
|
||||||
|
logoutWindow=nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local noCallback = function()
|
||||||
|
logoutWindow:destroy()
|
||||||
|
logoutWindow=nil
|
||||||
|
end
|
||||||
|
|
||||||
|
if prompt then
|
||||||
|
logoutWindow = displayGeneralBox(tr('Logout'), tr(msg), {
|
||||||
|
{ text=tr('Yes'), callback=yesCallback },
|
||||||
|
{ text=tr('No'), callback=noCallback },
|
||||||
|
anchor=AnchorHorizontalCenter}, yesCallback, noCallback)
|
||||||
|
else
|
||||||
|
yesCallback()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function stopSmartWalk()
|
function stopSmartWalk()
|
||||||
@@ -267,11 +307,16 @@ end
|
|||||||
|
|
||||||
function smartWalk(dir)
|
function smartWalk(dir)
|
||||||
if g_keyboard.getModifiers() == KeyboardNoModifier then
|
if g_keyboard.getModifiers() == KeyboardNoModifier then
|
||||||
if smartWalkDir then
|
local func = walkFunction
|
||||||
walkFunction(smartWalkDir)
|
if not func then
|
||||||
else
|
if modules.client_options.getOption('dashWalk') then
|
||||||
walkFunction(dir)
|
func = g_game.dashWalk
|
||||||
|
else
|
||||||
|
func = g_game.walk
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
local dire = smartWalkDir or dir
|
||||||
|
func(dire)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
@@ -433,17 +478,20 @@ function createThingMenu(menuPosition, lookThing, useThing, creatureThing)
|
|||||||
end
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
|
local localPosition = localPlayer:getPosition()
|
||||||
if not classic then shortcut = '(Alt)' else shortcut = nil end
|
if not classic then shortcut = '(Alt)' else shortcut = nil end
|
||||||
if g_game.getAttackingCreature() ~= creatureThing then
|
if creatureThing:getPosition().z == localPosition.z then
|
||||||
menu:addOption(tr('Attack'), function() g_game.attack(creatureThing) end, shortcut)
|
if g_game.getAttackingCreature() ~= creatureThing then
|
||||||
else
|
menu:addOption(tr('Attack'), function() g_game.attack(creatureThing) end, shortcut)
|
||||||
menu:addOption(tr('Stop Attack'), function() g_game.cancelAttack() end, shortcut)
|
else
|
||||||
end
|
menu:addOption(tr('Stop Attack'), function() g_game.cancelAttack() end, shortcut)
|
||||||
|
end
|
||||||
if g_game.getFollowingCreature() ~= creatureThing then
|
|
||||||
menu:addOption(tr('Follow'), function() g_game.follow(creatureThing) end)
|
if g_game.getFollowingCreature() ~= creatureThing then
|
||||||
else
|
menu:addOption(tr('Follow'), function() g_game.follow(creatureThing) end)
|
||||||
menu:addOption(tr('Stop Follow'), function() g_game.cancelFollow() end)
|
else
|
||||||
|
menu:addOption(tr('Stop Follow'), function() g_game.cancelFollow() end)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if creatureThing:isPlayer() then
|
if creatureThing:isPlayer() then
|
||||||
@@ -489,7 +537,7 @@ function createThingMenu(menuPosition, lookThing, useThing, creatureThing)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if modules.game_ruleviolation.hasWindowAccess() then
|
if modules.game_ruleviolation.hasWindowAccess() and creatureThing:isPlayer() then
|
||||||
menu:addSeparator()
|
menu:addSeparator()
|
||||||
menu:addOption(tr('Rule Violation'), function() modules.game_ruleviolation.show(creatureThing:getName()) end)
|
menu:addOption(tr('Rule Violation'), function() modules.game_ruleviolation.show(creatureThing:getName()) end)
|
||||||
end
|
end
|
||||||
@@ -501,7 +549,7 @@ function createThingMenu(menuPosition, lookThing, useThing, creatureThing)
|
|||||||
menu:display(menuPosition)
|
menu:display(menuPosition)
|
||||||
end
|
end
|
||||||
|
|
||||||
function processMouseAction(menuPosition, mouseButton, autoWalkPos, lookThing, useThing, creatureThing)
|
function processMouseAction(menuPosition, mouseButton, autoWalkPos, lookThing, useThing, creatureThing, attackCreature)
|
||||||
local keyboardModifiers = g_keyboard.getModifiers()
|
local keyboardModifiers = g_keyboard.getModifiers()
|
||||||
|
|
||||||
if not modules.client_options.getOption('classicControl') then
|
if not modules.client_options.getOption('classicControl') then
|
||||||
@@ -527,7 +575,10 @@ function processMouseAction(menuPosition, mouseButton, autoWalkPos, lookThing, u
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
elseif creatureThing and g_keyboard.isAltPressed() and (mouseButton == MouseLeftButton or mouseButton == MouseRightButton) then
|
elseif attackCreature and g_keyboard.isAltPressed() and (mouseButton == MouseLeftButton or mouseButton == MouseRightButton) then
|
||||||
|
g_game.attack(attackCreature)
|
||||||
|
return true
|
||||||
|
elseif creatureThing and creatureThing:getPosition().z == autoWalkPos.z and g_keyboard.isAltPressed() and (mouseButton == MouseLeftButton or mouseButton == MouseRightButton) then
|
||||||
g_game.attack(creatureThing)
|
g_game.attack(creatureThing)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@@ -536,7 +587,10 @@ function processMouseAction(menuPosition, mouseButton, autoWalkPos, lookThing, u
|
|||||||
else
|
else
|
||||||
if useThing and keyboardModifiers == KeyboardNoModifier and mouseButton == MouseRightButton and not g_mouse.isPressed(MouseLeftButton) then
|
if useThing and keyboardModifiers == KeyboardNoModifier and mouseButton == MouseRightButton and not g_mouse.isPressed(MouseLeftButton) then
|
||||||
local player = g_game.getLocalPlayer()
|
local player = g_game.getLocalPlayer()
|
||||||
if creatureThing and creatureThing ~= player then
|
if attackCreature and attackCreature ~= player then
|
||||||
|
g_game.attack(attackCreature)
|
||||||
|
return true
|
||||||
|
elseif creatureThing and creatureThing ~= player and creatureThing:getPosition().z == autoWalkPos.z then
|
||||||
g_game.attack(creatureThing)
|
g_game.attack(creatureThing)
|
||||||
return true
|
return true
|
||||||
elseif useThing:isContainer() then
|
elseif useThing:isContainer() then
|
||||||
@@ -564,7 +618,10 @@ function processMouseAction(menuPosition, mouseButton, autoWalkPos, lookThing, u
|
|||||||
elseif useThing and keyboardModifiers == KeyboardCtrlModifier and (mouseButton == MouseLeftButton or mouseButton == MouseRightButton) then
|
elseif useThing and keyboardModifiers == KeyboardCtrlModifier and (mouseButton == MouseLeftButton or mouseButton == MouseRightButton) then
|
||||||
createThingMenu(menuPosition, lookThing, useThing, creatureThing)
|
createThingMenu(menuPosition, lookThing, useThing, creatureThing)
|
||||||
return true
|
return true
|
||||||
elseif creatureThing and g_keyboard.isAltPressed() and (mouseButton == MouseLeftButton or mouseButton == MouseRightButton) then
|
elseif attackCreature and g_keyboard.isAltPressed() and (mouseButton == MouseLeftButton or mouseButton == MouseRightButton) then
|
||||||
|
g_game.attack(attackCreature)
|
||||||
|
return true
|
||||||
|
elseif creatureThing and creatureThing:getPosition().z == autoWalkPos.z and g_keyboard.isAltPressed() and (mouseButton == MouseLeftButton or mouseButton == MouseRightButton) then
|
||||||
g_game.attack(creatureThing)
|
g_game.attack(creatureThing)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@@ -574,7 +631,6 @@ function processMouseAction(menuPosition, mouseButton, autoWalkPos, lookThing, u
|
|||||||
player:stopAutoWalk()
|
player:stopAutoWalk()
|
||||||
|
|
||||||
if autoWalkPos and keyboardModifiers == KeyboardNoModifier and mouseButton == MouseLeftButton then
|
if autoWalkPos and keyboardModifiers == KeyboardNoModifier and mouseButton == MouseLeftButton then
|
||||||
player.onAutoWalkFail = function() modules.game_textmessage.displayFailureMessage(tr('There is no way.')) end
|
|
||||||
player:autoWalk(autoWalkPos)
|
player:autoWalk(autoWalkPos)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@@ -626,6 +682,8 @@ function moveStackableItem(item, toPos)
|
|||||||
end
|
end
|
||||||
g_keyboard.bindKeyPress("Up", function() check() spinbox:up() end, spinbox)
|
g_keyboard.bindKeyPress("Up", function() check() spinbox:up() end, spinbox)
|
||||||
g_keyboard.bindKeyPress("Down", function() check() spinbox:down() end, spinbox)
|
g_keyboard.bindKeyPress("Down", function() check() spinbox:down() end, spinbox)
|
||||||
|
g_keyboard.bindKeyPress("Right", function() check() spinbox:up() end, spinbox)
|
||||||
|
g_keyboard.bindKeyPress("Left", function() check() spinbox:down() end, spinbox)
|
||||||
g_keyboard.bindKeyPress("PageUp", function() check() spinbox:setValue(spinbox:getValue()+10) end, spinbox)
|
g_keyboard.bindKeyPress("PageUp", function() check() spinbox:setValue(spinbox:getValue()+10) end, spinbox)
|
||||||
g_keyboard.bindKeyPress("PageDown", function() check() spinbox:setValue(spinbox:getValue()-10) end, spinbox)
|
g_keyboard.bindKeyPress("PageDown", function() check() spinbox:setValue(spinbox:getValue()-10) end, spinbox)
|
||||||
|
|
||||||
@@ -717,7 +775,7 @@ function setupViewMode(mode)
|
|||||||
gameMapPanel:setZoom(11)
|
gameMapPanel:setZoom(11)
|
||||||
gameMapPanel:setVisibleDimension({ width = 15, height = 11 })
|
gameMapPanel:setVisibleDimension({ width = 15, height = 11 })
|
||||||
elseif mode == 2 then
|
elseif mode == 2 then
|
||||||
local limit = limitZoom and not g_game.isGM()
|
local limit = limitedZoom and not g_game.isGM()
|
||||||
gameMapPanel:setLimitVisibleRange(limit)
|
gameMapPanel:setLimitVisibleRange(limit)
|
||||||
gameMapPanel:setZoom(11)
|
gameMapPanel:setZoom(11)
|
||||||
gameMapPanel:setVisibleDimension({ width = 15, height = 11 })
|
gameMapPanel:setVisibleDimension({ width = 15, height = 11 })
|
||||||
@@ -742,11 +800,5 @@ function setupViewMode(mode)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function limitZoom()
|
function limitZoom()
|
||||||
limitZoom = true
|
limitedZoom = true
|
||||||
end
|
|
||||||
|
|
||||||
function onGMActions()
|
|
||||||
if not limitZoom then return end
|
|
||||||
gameMapPanel:setMaxZoomOut(513)
|
|
||||||
gameMapPanel:setLimitVisibleRange(false)
|
|
||||||
end
|
end
|
||||||
|
@@ -6,11 +6,11 @@ CountWindow < MainWindow
|
|||||||
SpinBox
|
SpinBox
|
||||||
id: spinBox
|
id: spinBox
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.top: parent.bottom
|
anchors.top: parent.top
|
||||||
width: 0
|
width: 1
|
||||||
height: 0
|
height: 1
|
||||||
phantom: true
|
phantom: true
|
||||||
padding-bottom: -40
|
margin-top: 2
|
||||||
focusable: true
|
focusable: true
|
||||||
|
|
||||||
Item
|
Item
|
||||||
|
@@ -78,15 +78,21 @@ function UIGameMap:onMouseRelease(mousePosition, mouseButton)
|
|||||||
local useThing
|
local useThing
|
||||||
local creatureThing
|
local creatureThing
|
||||||
local multiUseThing
|
local multiUseThing
|
||||||
|
local attackCreature
|
||||||
|
|
||||||
local tile = self:getTile(mousePosition)
|
local tile = self:getTile(mousePosition)
|
||||||
if tile then
|
if tile then
|
||||||
lookThing = tile:getTopLookThing()
|
lookThing = tile:getTopLookThing()
|
||||||
useThing = tile:getTopUseThing()
|
useThing = tile:getTopUseThing()
|
||||||
creatureThing = tile:getTopCreature()
|
creatureThing = tile:getTopCreature()
|
||||||
|
end
|
||||||
|
|
||||||
|
local autoWalkTile = g_map.getTile(autoWalkPos)
|
||||||
|
if autoWalkTile then
|
||||||
|
attackCreature = autoWalkTile:getTopCreature()
|
||||||
end
|
end
|
||||||
|
|
||||||
local ret = modules.game_interface.processMouseAction(mousePosition, mouseButton, autoWalkPos, lookThing, useThing, creatureThing)
|
local ret = modules.game_interface.processMouseAction(mousePosition, mouseButton, autoWalkPos, lookThing, useThing, creatureThing, attackCreature)
|
||||||
if ret then
|
if ret then
|
||||||
self.allowNextRelease = false
|
self.allowNextRelease = false
|
||||||
end
|
end
|
||||||
|
@@ -86,7 +86,7 @@ function UIItem:onMouseRelease(mousePosition, mouseButton)
|
|||||||
g_game.look(item)
|
g_game.look(item)
|
||||||
self.cancelNextRelease = true
|
self.cancelNextRelease = true
|
||||||
return true
|
return true
|
||||||
elseif modules.game_interface.processMouseAction(mousePosition, mouseButton, nil, item, item, nil, item) then
|
elseif modules.game_interface.processMouseAction(mousePosition, mouseButton, nil, item, item, nil, nil) then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
|