mirror of
https://github.com/edubart/otclient.git
synced 2025-09-14 23:03:34 +02:00
Compare commits
73 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 |
@@ -1,7 +1,7 @@
|
||||
cmake_minimum_required(VERSION 2.6)
|
||||
project(otclient)
|
||||
|
||||
set(VERSION "0.6.4")
|
||||
set(VERSION "0.6.5")
|
||||
|
||||
option(FRAMEWORK_SOUND "Use SOUND " ON)
|
||||
option(FRAMEWORK_GRAPHICS "Use GRAPHICS " ON)
|
||||
|
24
README.md
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.
|
||||
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
|
||||
|
||||
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
|
||||
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
|
||||
|
||||
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:
|
||||
* [Compiling on Windows](https://github.com/edubart/otclient/wiki/Compiling-on-Windows)
|
||||
* [Compiling on Linux](https://github.com/edubart/otclient/wiki/Compiling-on-Linux)
|
||||
|
||||
|
||||
|
||||
### Need help?
|
||||
|
||||
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
|
||||
to do whatever you want, commercial, non-commercial, closed or open.
|
||||
|
||||
|
BIN
data/images/game/combatmodes/mount.png
Normal file
BIN
data/images/game/combatmodes/mount.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.0 KiB |
BIN
data/images/game/combatmodes/redfistmode.png
Normal file
BIN
data/images/game/combatmodes/redfistmode.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
BIN
data/images/game/combatmodes/whitedovemode.png
Normal file
BIN
data/images/game/combatmodes/whitedovemode.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.9 KiB |
BIN
data/images/game/combatmodes/whitehandmode.png
Normal file
BIN
data/images/game/combatmodes/whitehandmode.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.0 KiB |
BIN
data/images/game/combatmodes/yellowhandmode.png
Normal file
BIN
data/images/game/combatmodes/yellowhandmode.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.0 KiB |
@@ -1,5 +1,7 @@
|
||||
-- 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 = {
|
||||
name = "es",
|
||||
charset = "cp1252",
|
||||
@@ -9,18 +11,18 @@ locale = {
|
||||
["1a) Offensive Name"] = "1a) Nombre ofensivo",
|
||||
["1b) Invalid Name Format"] = "1b) Formato invalido para nombre",
|
||||
["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",
|
||||
["2b) Spamming"] = "2b) Spamming",
|
||||
["2c) Illegal Advertising"] = "2c) Publicidad ilicita",
|
||||
["2d) Off-Topic Public Statement"] = "2d) Publicacion fuera de lugar",
|
||||
["2e) Non-English Public Statement"] = "2e) Publicacion fuera del ingles",
|
||||
["2f) Inciting Rule Violation"] = "2f) Incitar a una violacion al reglamento",
|
||||
["2c) Illegal Advertising"] = "2c) Publicidad il<EFBFBD>cita",
|
||||
["2d) Off-Topic Public Statement"] = "2d) Publicaci<EFBFBD>n fuera de lugar",
|
||||
["2e) Non-English Public Statement"] = "2e) Publicaci<EFBFBD>n fuera del ingles",
|
||||
["2f) Inciting Rule Violation"] = "2f) Incitar a una violaci<EFBFBD>n al reglamento",
|
||||
["3a) Bug Abuse"] = "3a) Abuso de error",
|
||||
["3b) Game Weakness Abuse"] = "3b) Abuso de debilidad del juego",
|
||||
["3c) Using Unofficial Software to Play"] = "3c) Usando software ilegal para jugar",
|
||||
["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",
|
||||
["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",
|
||||
@@ -28,7 +30,7 @@ locale = {
|
||||
["Accept"] = "Aceptar",
|
||||
["Account name"] = "Nombre de cuenta",
|
||||
["Account Status:"] = "Estado de cuenta:",
|
||||
["Action:"] = "Accion:",
|
||||
["Action:"] = "Acci<EFBFBD>n:",
|
||||
["Add"] = "A<EFBFBD>adir",
|
||||
["Add new VIP"] = "A<EFBFBD>adir nuevo VIP",
|
||||
["Addon 1"] = "Addon 1",
|
||||
@@ -36,46 +38,46 @@ locale = {
|
||||
["Addon 3"] = "Addon 1",
|
||||
["Add to VIP list"] = "A<EFBFBD>adir a lista VIP",
|
||||
["Adjust volume"] = "Ajustar volumen",
|
||||
["Alas! Brave adventurer, you have met a sad fate.\nBut do not despair, for the gods will bring you back\ninto this world in exchange for a small sacrifice\n\nSimply click on Ok to resume your journeys!"] = "<EFBFBD>Ay! Aventurero valiente, 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 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",
|
||||
["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%%",
|
||||
["Amount:"] = "Cantidad:",
|
||||
["Amount"] = "Cantidad",
|
||||
["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",
|
||||
["Author"] = "Autor",
|
||||
["Autoload"] = "Auto carga",
|
||||
["Autoload priority"] = "Auto carga prioritaria",
|
||||
["Auto login"] = "Auto iniciar",
|
||||
["Auto login selected character on next charlist load"] = "Auto cargar car<61>cter seleccionado en la carga charlist siguiente",
|
||||
["Axe Fighting"] = "Combate con acha",
|
||||
["Auto login"] = "Auto ingresar",
|
||||
["Auto login selected character on next charlist load"] = "Ingresar la siguiente vez que aparece el charlist con el personaje seleccionado",
|
||||
["Axe Fighting"] = "Combate con hacha",
|
||||
["Balance:"] = "Saldo:",
|
||||
["Banishment"] = "Banishment",
|
||||
["Banishment + Final Warning"] = "Banishment + Final Warning",
|
||||
["Battle"] = "Batalla",
|
||||
["Browse"] = "Navegar",
|
||||
["Bug report sent."] = "Reporte de error enviado.",
|
||||
["Button Assign"] = "Boton asignado",
|
||||
["Button Assign"] = "Bot<EFBFBD>n asignado",
|
||||
["Buy"] = "Compra",
|
||||
["Buy Now"] = "Compra ahora",
|
||||
["Buy Offers"] = "Comprar oferta",
|
||||
["Buy with backpack"] = "Comprar con backpack",
|
||||
["Buy with backpack"] = "Comprar con mochila",
|
||||
["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",
|
||||
["Capacity"] = "Capacidad",
|
||||
["Center"] = "Centrar",
|
||||
["Channels"] = "Canales",
|
||||
["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 Messages"] = "Limpiar mensaje",
|
||||
["Clear object"] = "Limpiar objeto",
|
||||
["Client needs update."] = "El cliente necesita actualizacion.",
|
||||
["Client needs update."] = "El cliente necesita una actualizaci<EFBFBD>n.",
|
||||
["Close"] = "Cerrar",
|
||||
["Close this channel"] = "Cerrar este canal",
|
||||
["Club Fighting"] = "Combate con mazo",
|
||||
@@ -99,28 +101,28 @@ locale = {
|
||||
["Delete mark"] = "Borrar Marca",
|
||||
["Description:"] = "Descripci<EFBFBD>n:",
|
||||
["Description"] = "Descripci<EFBFBD>n",
|
||||
["Destructive Behaviour"] = "Comportamiento agresivo",
|
||||
["Destructive Behaviour"] = "Comportamiento destructivo",
|
||||
["Detail"] = "Detalle",
|
||||
["Details"] = "Detalles",
|
||||
["Disable Shared Experience"] = "Desactivar experiencia compartida",
|
||||
["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",
|
||||
["Don\'t stretch/shrink Game Window"] = "No estirar ni reducir el tama<6D>o de ventana",
|
||||
["Edit hotkey text:"] = "Editar texto de hotkey:",
|
||||
["Edit List"] = "Editar lista",
|
||||
["Edit Text"] = "Editar texto",
|
||||
["Enable music"] = "Habilitar musica",
|
||||
["Enable music"] = "Habilitar m<EFBFBD>sica",
|
||||
["Enable Shared Experience"] = "Habilitar experiencia compartida",
|
||||
["Enable smart walking"] = "Habilitar caminado inteligente",
|
||||
["Enable vertical synchronization"] = "Habilitar sincronizaci<63>n vertical",
|
||||
["Enable walk booster"] = "Habilitar caminado turbo",
|
||||
["Enter Game"] = "Entrar al juego",
|
||||
["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",
|
||||
["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",
|
||||
["Exit"] = "Salir",
|
||||
["Experience"] = "Experiencia",
|
||||
@@ -132,71 +134,71 @@ locale = {
|
||||
["Follow"] = "Seguir",
|
||||
["Force Exit"] = "Forzar salida",
|
||||
["For Your Information"] = "Para tu informaci<63>n",
|
||||
["Free Account"] = "Account gratis",
|
||||
["Free Account"] = "Cuenta gratis",
|
||||
["Fullscreen"] = "Pantalla completa",
|
||||
["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 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",
|
||||
["Healing"] = "Curacion",
|
||||
["Health Info"] = "HP Info",
|
||||
["Health Information"] = "HP Informaci<63>n",
|
||||
["Hide monsters"] = "Ocultar monsters",
|
||||
["Hide non-skull players"] = "Ocultar no-skull players",
|
||||
["Healing"] = "Curaci<EFBFBD>n",
|
||||
["Health Info"] = "HP Info",--This can be better
|
||||
["Health Information"] = "HP Informaci<63>n",--This can be better
|
||||
["Hide monsters"] = "Ocultar monstruos",
|
||||
["Hide non-skull players"] = "Ocultar jugadores sin skull",
|
||||
["Hide Npcs"] = "Ocultar NPCs",
|
||||
["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 spells for higher exp. levels"] = "Ocultar spells para niveles mas altos que tu experiencia.",
|
||||
["Hide spells for other vocations"] = "Ocultar spells que sean para otra vocaci<63>n",
|
||||
["Hide spells for higher exp. levels"] = "Ocultar hechizos para niveles mas altos que tu experiencia.",
|
||||
["Hide spells for other vocations"] = "Ocultar hechizos que sean para otra vocaci<63>n",
|
||||
["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",
|
||||
["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 capacity"] = "Ignorar Capacidad",
|
||||
["Ignored players:"] = "Players ignorados:",
|
||||
["Ignore equipped"] = "Ignorar lo equipodo",
|
||||
["Ignored players:"] = "Jugadores ignorados:",
|
||||
["Ignore equipped"] = "Ignorar lo equipado",
|
||||
["Ignore List"] = "Ignorar lista",
|
||||
["Ignore players"] = "Ignorar players",
|
||||
["Ignore players"] = "Ignorar jugadores",
|
||||
["Ignore Private Messages"] = "Ignorar mensajes privados",
|
||||
["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",
|
||||
["Invite to Party"] = "Ivitar a party",
|
||||
["Invite to Party"] = "Ivitar al party",
|
||||
["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",
|
||||
["It is empty."] = "Est<EFBFBD> vasio.",
|
||||
["Join %s\'s Party"] = "Unir %s\'s party",
|
||||
["Leave Party"] = "Dejar party",
|
||||
["It is empty."] = "Est<EFBFBD> vaci<EFBFBD>.",
|
||||
["Join %s\'s Party"] = "Unirse al party de %s ",
|
||||
["Leave Party"] = "Dejar el party",
|
||||
["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",
|
||||
["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",
|
||||
["Load"] = "Cargar",
|
||||
["Logging out..."] = "Cerrando sesion...",
|
||||
["Logging out..."] = "Cerrando sesi<EFBFBD>n...",
|
||||
["Login"] = "Ingresar",
|
||||
["Login Error"] = "Error de ingreso",
|
||||
["Login Error"] = "Error de ingreso",
|
||||
["Logout"] = "Salir",
|
||||
["Look"] = "Mirar",
|
||||
["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",
|
||||
["Manage hotkeys:"] = "Administrador de hotkeys:",
|
||||
["Market"] = "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 %s"] = "Mensaje a %s",
|
||||
["Minimap"] = "Minimapa",
|
||||
["Module Manager"] = "Administrador de modulos",
|
||||
["Module name"] = "Nombre de modulo",
|
||||
["Mount"] = "Montura",
|
||||
["Module Manager"] = "Administrador de m<EFBFBD>dulos",
|
||||
["Module name"] = "Nombre del modulo",
|
||||
["Mount"] = "Montar", --Unique name?
|
||||
["Move Stackable Item"] = "Mover objeto apilable",
|
||||
["Move up"] = "Mover arriba",
|
||||
["My Offers"] = "Mis ofertas",
|
||||
@@ -205,7 +207,7 @@ locale = {
|
||||
["Name Report + Banishment"] = "Name Report + Banishment",
|
||||
["Name Report + Banishment + Final Warning"] = "Name Report + Banishment + Final Warning",
|
||||
["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 Mount"] = "No montura",
|
||||
["No Outfit"] = "No outfit",
|
||||
@@ -220,30 +222,30 @@ locale = {
|
||||
["on %s.\n"] = "en %s.\n",
|
||||
["Open"] = "Abierto",
|
||||
["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 new channel"] = "Abrir nuevo canal",
|
||||
["Options"] = "Opciones",
|
||||
["Overview"] = "Descripcion",
|
||||
["Overview"] = "Descripci<EFBFBD>n",
|
||||
["Pass Leadership to %s"] = "Pasar liderazgo a %s",
|
||||
["Password"] = "Contrase<EFBFBD>a",
|
||||
["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 Select"] = "Por favor selecciona",
|
||||
["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 wait"] = "Por favor espera",
|
||||
["Please Select"] = "Por favor seleccione",
|
||||
["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 espere",
|
||||
["Port"] = "Puerto",
|
||||
["Position:"] = "Posici<EFBFBD>n:",
|
||||
["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:",
|
||||
["Primary"] = "Primario",
|
||||
["Protocol"] = "Protocolo",
|
||||
["Quest Log"] = "Quest Log",
|
||||
["Quest Log"] = "Quest Log", --Unique name
|
||||
["Randomize"] = "Combinar",
|
||||
["Randomize characters outfit"] = "Combinar oufit del jugador",
|
||||
["Reason:"] = "Reason:",
|
||||
["Randomize characters outfit"] = "Combinar vestimenta del jugador",
|
||||
["Reason:"] = "Raz<EFBFBD>n:",
|
||||
["Refresh"] = "Refrescar",
|
||||
["Refresh Offers"] = "Refrescar ofertas",
|
||||
["Regeneration Time"] = "Tiempo de regeneraci<63>n",
|
||||
@@ -254,13 +256,13 @@ locale = {
|
||||
["Remove"] = "Remover",
|
||||
["Remove %s"] = "Remover %s",
|
||||
["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",
|
||||
["Revoke %s\'s Invitation"] = "Anular %s\'s invitaci<63>n",
|
||||
["Rotate"] = "Rotar",
|
||||
["Rule Violation"] = "Violacion de regla",
|
||||
["Save"] = "Salvar",
|
||||
["Save Messages"] = "Salvar mensaje",
|
||||
["Rule Violation"] = "Violaci<EFBFBD>n del reglamento",
|
||||
["Save"] = "Guardar",
|
||||
["Save Messages"] = "Guardar mensaje",
|
||||
["Search:"] = "Buscar:",
|
||||
["Search all items"] = "Buscar todos los objetos",
|
||||
["Secondary"] = "Secundario",
|
||||
@@ -268,24 +270,24 @@ locale = {
|
||||
["Select Outfit"] = "Seleccionar outfit",
|
||||
["Select your language"] = "Selectionar tu lenguaje",
|
||||
["Sell"] = "Vender",
|
||||
["Sell Now"] = "Vender ya",
|
||||
["Sell Now"] = "Vender ahora",
|
||||
["Sell Offers"] = "Ofertas de venta",
|
||||
["Send"] = "Enviar",
|
||||
["Send automatically"] = "Enviar automaticamente",
|
||||
["Send automatically"] = "Enviar autom<EFBFBD>ticamente",
|
||||
["Send Message"] = "Enviar mensaje",
|
||||
["Server"] = "Server",
|
||||
["Server Log"] = "Server Log",
|
||||
["Set Outfit"] = "Fijar outfit",
|
||||
["Server"] = "Server", --Unique name
|
||||
["Server Log"] = "Server Log", --Unique name
|
||||
["Set Outfit"] = "Escoger vestimenta",
|
||||
["Shielding"] = "Escudo",
|
||||
["Show all items"] = "Mostrar todos los objetos",
|
||||
["Show connection ping"] = "Mostrar ping de conexi<78>n",
|
||||
["Show Depot Only"] = "Mostrar solo el Depot",
|
||||
["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 left panel"] = "Mostrar panel izquierdo",
|
||||
["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 on screen"] = "Mostrar mensajes privados en pantalla",
|
||||
["Show Server Messages"] = "Mostrar mensajes del servidor",
|
||||
@@ -295,26 +297,26 @@ locale = {
|
||||
["Show your depot items only"] = "Mostrar solo tus objetos en depot",
|
||||
["Skills"] = "Habilidades",
|
||||
["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",
|
||||
["Speed"] = "Velocidad",
|
||||
["Spell Cooldowns"] = "Spells Cooldowns",
|
||||
["Spell List"] = "Lista de spells",
|
||||
["Stamina"] = "Stamina",
|
||||
["Spell Cooldowns"] = "Spells Cooldowns", --Could be "Tiempo de recarga para los hechizos".
|
||||
["Spell List"] = "Lista de hechizos",
|
||||
["Stamina"] = "Resistencia",
|
||||
["Statement:"] = "Comentario:",
|
||||
["Statement Report"] = "Statement Report",
|
||||
["Statistics"] = "Estadisticas",
|
||||
["Statement Report"] = "Statement Report", --Could be "reporte del comentario"
|
||||
["Statistics"] = "Estad<EFBFBD>sticas",
|
||||
["Stop Attack"] = "Detener ataque",
|
||||
["Stop Follow"] = "Detener persecucion",
|
||||
["Stop Follow"] = "Detener persecuci<EFBFBD>n",
|
||||
["Support"] = "Soporte",
|
||||
["%s: (use object)"] = "%s: (usar objeto)",
|
||||
["%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 with crosshair)"] = "%s: (usar objeto en aire)",
|
||||
["%s: (use object with crosshair)"] = "%s: (usar objeto con punto de mira)",
|
||||
["Sword Fighting"] = "Combate de espada",
|
||||
["Terminal"] = "Terminal",
|
||||
["There is no way."] = "No hay ninguna manera.",
|
||||
["Title"] = "T<EFBFBD>tulo",
|
||||
["Title"] = "Titulo",
|
||||
["Total Price:"] = "Total total:",
|
||||
["Trade"] = "Intercambio",
|
||||
["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 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-",
|
||||
["Unignore"] = "Desactivar ignorado",
|
||||
["Unignore"] = "Dejar de ignorar",
|
||||
["Unload"] = "No cargado",
|
||||
["Update needed"] = "Es necesario actualizar",
|
||||
["Use"] = "Uso",
|
||||
["Use on target"] = "Usar en un objetivo",
|
||||
["Use on yourself"] = "Usar en mi mismo",
|
||||
["Use with ..."] = "Usar en ...",
|
||||
["Version"] = "Version",
|
||||
["Version"] = "Versi<EFBFBD>n",
|
||||
["VIP List"] = "Lista Vip",
|
||||
["Voc."] = "Voc.",
|
||||
["Vocation"] = "Vocaci<EFBFBD>n",
|
||||
["Waiting List"] = "Lista de espera",
|
||||
["Website"] = "Sitio WEB",
|
||||
["Website"] = "Sitio Web",
|
||||
["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",
|
||||
["Yes"] = "Si",
|
||||
["You are bleeding"] = "Tu estas sangrado",
|
||||
["You are burning"] = "Tu estas quemado",
|
||||
["You are bleeding"] = "Te estas desangrando",
|
||||
["You are burning"] = "Te estas quemando",
|
||||
["You are cursed"] = "Tu estas maldecido",
|
||||
["You are dazzled"] = "Tu estas deslumbrado",
|
||||
["You are dead."] = "Tu estas muerto.",
|
||||
["You are dead"] = "Tu estas muerto",
|
||||
["You are drowning"] = "Tu estas ahotado",
|
||||
["You are drunk"] = "Tu estas borracho",
|
||||
["You are electrified"] = "Tu estas electrificado",
|
||||
["You are freezing"] = "Tu estas congelado",
|
||||
["You are hasted"] = "Tu estas rapido",
|
||||
["You are drowning"] = "Te estas ahogando",
|
||||
["You are drunk"] = "Tu estas ebrio",
|
||||
["You are electrified"] = "Tu estas electrocutado",
|
||||
["You are freezing"] = "Te estas congelando",
|
||||
["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 paralysed"] = "Tu estas paralizado",
|
||||
["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 within a protection zone"] = "Tu estas dentro de una zona segura",
|
||||
["You can enter new text."] = "Tu puedes introducir un texto nuevo.",
|
||||
["You have %s percent"] = "Tu tienes %s porciento",
|
||||
["You have %s percent to go"] = "Tu tienes %s porciento para ir",
|
||||
["You are within a protection zone"] = "Tu estas dentro de una zona de protecci<63>n",
|
||||
["You can enter new text."] = "Tu puedes ingresar un texto nuevo.",
|
||||
["You have %s percent"] = "Tu tienes %s por ciento",
|
||||
["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 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 valid server address and port."] = "Debes introducir una direcci<63>n v<>lida de servidor y el puerto.",
|
||||
["You must enter a comment."] = "Debes ingresar un comentario.",
|
||||
["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!",
|
||||
["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 on \n%s.\n"] = "Uno lee lo siguiente, escrito en \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"] = "Lees lo siguiente, escrito en \n%s\n",
|
||||
["Your Money:"] = "Tu dinero:",
|
||||
["Change language"] = "Cambiar idioma",
|
||||
["Don't stretch or shrink Game Window"] = "No estirar o encoger Ventana de Juego"
|
||||
|
@@ -1,7 +1,6 @@
|
||||
CheckBox < UICheckBox
|
||||
size: 16 16
|
||||
text-align: left
|
||||
text: aa
|
||||
text-offset: 16 0
|
||||
color: #aaaaaa
|
||||
image-color: #ffffffff
|
||||
|
2
init.lua
2
init.lua
@@ -48,7 +48,7 @@ g_modules.ensureModuleLoaded("game_interface")
|
||||
-- mods 1000-9999
|
||||
g_modules.autoLoadModules(9999)
|
||||
|
||||
local script = '/' .. g_app.getCompactName() .. 'rc'
|
||||
local script = '/' .. g_app.getCompactName() .. 'rc.lua'
|
||||
|
||||
if g_resources.fileExists(script) then
|
||||
dofile(script)
|
||||
|
@@ -14,7 +14,7 @@ function reloadScripts()
|
||||
g_textures.clearCache()
|
||||
g_modules.reloadModules()
|
||||
|
||||
local script = '/' .. g_app.getCompactName() .. 'rc'
|
||||
local script = '/' .. g_app.getCompactName() .. 'rc.lua'
|
||||
if g_resources.fileExists(script) then
|
||||
dofile(script)
|
||||
end
|
||||
|
@@ -79,6 +79,10 @@ function onConnect(protocol)
|
||||
post = post .. '&window_height=' .. g_window.getHeight()
|
||||
post = post .. '&player_name=' .. g_game.getCharacterName()
|
||||
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_revision=' .. g_app.getBuildRevision()
|
||||
post = post .. '&build_commit=' .. g_app.getBuildCommit()
|
||||
|
@@ -221,7 +221,7 @@ function toggle()
|
||||
if terminalWindow:isVisible() then
|
||||
hide()
|
||||
else
|
||||
if not firstShow then
|
||||
if not firstShown then
|
||||
local settings = g_settings.getNode('terminal-window')
|
||||
if settings then
|
||||
if settings.size then oldSize = size end
|
||||
|
@@ -16,6 +16,24 @@ local function updateMargins(tabBar, ignored)
|
||||
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 tabs = tabBar.tabs
|
||||
local currentMargin = 0
|
||||
@@ -33,10 +51,11 @@ local function updateIndexes(tabBar, tab, xoff)
|
||||
table.remove(tabs, table.find(tabs, tab))
|
||||
table.insert(tabs, newIndex, tab)
|
||||
end
|
||||
updateNavigation(tabBar)
|
||||
end
|
||||
|
||||
local function getMaxMargin(tabBar, tab)
|
||||
if #tabBar.tabs == 0 then return end
|
||||
if #tabBar.tabs == 0 then return 0 end
|
||||
|
||||
local maxMargin = 0
|
||||
for i = 1, #tabBar.tabs do
|
||||
@@ -44,7 +63,91 @@ local function getMaxMargin(tabBar, tab)
|
||||
maxMargin = maxMargin + tabBar.tabs[i]:getWidth()
|
||||
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
|
||||
|
||||
local function onTabMousePress(tab, mousePos, mouseButton)
|
||||
@@ -104,6 +207,14 @@ function UIMoveableTabBar.create()
|
||||
tabbar.selected = nil -- dragged tab
|
||||
tabbar.tabSpacing = 0
|
||||
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
|
||||
end
|
||||
|
||||
@@ -141,18 +252,26 @@ function UIMoveableTabBar:addTab(text, panel, menuCallback)
|
||||
tab.onDragMove = onTabDragMove
|
||||
tab.onDestroy = function() tab.tabPanel:destroy() end
|
||||
|
||||
table.insert(self.tabs, tab)
|
||||
if #self.tabs == 1 then
|
||||
if #self.tabs == 0 then
|
||||
self:selectTab(tab)
|
||||
tab:setMarginLeft(0)
|
||||
table.insert(self.tabs, tab)
|
||||
else
|
||||
local newMargin = self.tabSpacing * (#self.tabs - 1)
|
||||
for i = 1, #self.tabs - 1 do
|
||||
local newMargin = self.tabSpacing * #self.tabs
|
||||
for i = 1, #self.tabs do
|
||||
newMargin = newMargin + self.tabs[i]:getWidth()
|
||||
end
|
||||
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
|
||||
|
||||
updateNavigation(self)
|
||||
return tab
|
||||
end
|
||||
|
||||
@@ -183,17 +302,33 @@ function UIMoveableTabBar:onStyleApply(styleName, styleNode)
|
||||
end
|
||||
|
||||
function UIMoveableTabBar:removeTab(tab)
|
||||
local index = table.find(self.tabs, tab)
|
||||
if index == nil then return end
|
||||
local tabTables = {self.tabs, self.preTabs, self.postTabs}
|
||||
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
|
||||
self:selectPrevTab()
|
||||
if #self.tabs == 1 then
|
||||
self.currentTab = nil
|
||||
end
|
||||
end
|
||||
table.remove(self.tabs, index)
|
||||
table.remove(tabTable, index)
|
||||
if tab.blinkEvent then
|
||||
removeEvent(tab.blinkEvent)
|
||||
end
|
||||
tab:destroy()
|
||||
updateMargins(self)
|
||||
updateTabs(self)
|
||||
end
|
||||
|
||||
function UIMoveableTabBar:getTab(text)
|
||||
@@ -202,6 +337,16 @@ function UIMoveableTabBar:getTab(text)
|
||||
return tab
|
||||
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
|
||||
|
||||
function UIMoveableTabBar:selectTab(tab)
|
||||
@@ -226,23 +371,62 @@ function UIMoveableTabBar:selectTab(tab)
|
||||
|
||||
local parent = tab:getParent()
|
||||
parent:focusChild(tab, MouseFocusReason)
|
||||
updateNavigation(self)
|
||||
end
|
||||
|
||||
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)
|
||||
if index == nil then return end
|
||||
local nextTab = self.tabs[index + 1] or self.tabs[1]
|
||||
if not nextTab then return end
|
||||
if index == nil then
|
||||
return
|
||||
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)
|
||||
end
|
||||
|
||||
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)
|
||||
if index == nil then return end
|
||||
local prevTab = self.tabs[index - 1] or self.tabs[#self.tabs]
|
||||
if not prevTab then return end
|
||||
if index == nil then
|
||||
return
|
||||
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)
|
||||
end
|
||||
|
||||
@@ -265,3 +449,16 @@ end
|
||||
function UIMoveableTabBar:getCurrentTab()
|
||||
return self.currentTab
|
||||
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
|
@@ -5,7 +5,14 @@ fightBalancedBox = nil
|
||||
fightDefensiveBox = nil
|
||||
chaseModeButton = nil
|
||||
safeFightButton = nil
|
||||
whiteDoveBox = nil
|
||||
whiteHandBox = nil
|
||||
yellowHandBox = nil
|
||||
redFistBox = nil
|
||||
mountButton = nil
|
||||
pvpModesPanel = nil
|
||||
fightModeRadioGroup = nil
|
||||
pvpModeRadioGroup = nil
|
||||
|
||||
function init()
|
||||
combatControlsButton = modules.client_topmenu.addRightGameToggleButton('combatControlsButton', tr('Combat Controls'), '/images/topbuttons/combatcontrols', toggle)
|
||||
@@ -16,15 +23,33 @@ function init()
|
||||
fightOffensiveBox = combatControlsWindow:recursiveGetChildById('fightOffensiveBox')
|
||||
fightBalancedBox = combatControlsWindow:recursiveGetChildById('fightBalancedBox')
|
||||
fightDefensiveBox = combatControlsWindow:recursiveGetChildById('fightDefensiveBox')
|
||||
|
||||
chaseModeButton = combatControlsWindow:recursiveGetChildById('chaseModeBox')
|
||||
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:addWidget(fightOffensiveBox)
|
||||
fightModeRadioGroup:addWidget(fightBalancedBox)
|
||||
fightModeRadioGroup:addWidget(fightDefensiveBox)
|
||||
|
||||
pvpModeRadioGroup = UIRadioGroup.create()
|
||||
pvpModeRadioGroup:addWidget(whiteDoveBox)
|
||||
pvpModeRadioGroup:addWidget(whiteHandBox)
|
||||
pvpModeRadioGroup:addWidget(yellowHandBox)
|
||||
pvpModeRadioGroup:addWidget(redFistBox)
|
||||
|
||||
connect(fightModeRadioGroup, { onSelectionChange = onSetFightMode })
|
||||
connect(pvpModeRadioGroup, { onSelectionChange = onSetPVPMode })
|
||||
connect(chaseModeButton, { onCheckChange = onSetChaseMode })
|
||||
connect(safeFightButton, { onCheckChange = onSetSafeFight })
|
||||
connect(g_game, {
|
||||
@@ -33,9 +58,12 @@ function init()
|
||||
onFightModeChange = update,
|
||||
onChaseModeChange = update,
|
||||
onSafeFightChange = update,
|
||||
onPVPModeChange = update,
|
||||
onWalk = check,
|
||||
onAutoWalk = check
|
||||
})
|
||||
|
||||
connect(LocalPlayer, { onOutfitChange = onOutfitChange })
|
||||
|
||||
if g_game.isOnline() then
|
||||
online()
|
||||
@@ -50,6 +78,7 @@ function terminate()
|
||||
end
|
||||
|
||||
fightModeRadioGroup:destroy()
|
||||
pvpModeRadioGroup:destroy()
|
||||
combatControlsWindow:destroy()
|
||||
combatControlsButton:destroy()
|
||||
|
||||
@@ -59,9 +88,12 @@ function terminate()
|
||||
onFightModeChange = update,
|
||||
onChaseModeChange = update,
|
||||
onSafeFightChange = update,
|
||||
onPVPModeChange = update,
|
||||
onWalk = check,
|
||||
onAutoWalk = check
|
||||
})
|
||||
|
||||
disconnect(LocalPlayer, { onOutfitChange = onOutfitChange })
|
||||
end
|
||||
|
||||
function update()
|
||||
@@ -79,6 +111,14 @@ function update()
|
||||
|
||||
local safeFight = g_game.isSafeFight()
|
||||
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
|
||||
|
||||
function check()
|
||||
@@ -101,8 +141,26 @@ function online()
|
||||
g_game.setFightMode(lastCombatControls[char].fightMode)
|
||||
g_game.setChaseMode(lastCombatControls[char].chaseMode)
|
||||
g_game.setSafeFight(lastCombatControls[char].safeFight)
|
||||
if lastCombatControls[char].pvpMode then
|
||||
g_game.setPVPMode(lastCombatControls[char].pvpMode)
|
||||
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
|
||||
|
||||
update()
|
||||
@@ -123,6 +181,10 @@ function offline()
|
||||
safeFight = g_game.isSafeFight()
|
||||
}
|
||||
|
||||
if g_game.getFeature(GamePVPMode) then
|
||||
lastCombatControls[char].pvpMode = g_game.getPVPMode()
|
||||
end
|
||||
|
||||
-- save last combat control settings
|
||||
g_settings.setNode('LastCombatControls', lastCombatControls)
|
||||
end
|
||||
@@ -166,6 +228,55 @@ function onSetSafeFight(self, checked)
|
||||
g_game.setSafeFight(not checked)
|
||||
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()
|
||||
combatControlsButton:setOn(false)
|
||||
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
|
||||
size: 20 20
|
||||
image-clip: 0 0 20 20
|
||||
anchors.top: parent.top
|
||||
margin: 0 4
|
||||
$first:
|
||||
margin: 0 1
|
||||
$last:
|
||||
margin: 0 1
|
||||
margin: 2 4
|
||||
|
||||
$checked:
|
||||
image-clip: 0 20 20 20
|
||||
@@ -21,33 +16,78 @@ ChaseModeBox < CombatBox
|
||||
image-source: /images/game/combatmodes/chasemode
|
||||
SafeFightBox < CombatBox
|
||||
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
|
||||
id: combatControlsWindow
|
||||
!text: tr('Combat Controls')
|
||||
icon: /images/topbuttons/combatcontrols
|
||||
height: 48
|
||||
height: 49
|
||||
&save: true
|
||||
&simpleControlsHeight: 49
|
||||
&extendedControlsHeight: 72
|
||||
@onClose: modules.game_combatcontrols.onMiniWindowClose()
|
||||
|
||||
MiniWindowContents
|
||||
FightOffensiveBox
|
||||
id: fightOffensiveBox
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
margin: 2 1
|
||||
FightBalancedBox
|
||||
id: fightBalancedBox
|
||||
anchors.top: parent.top
|
||||
anchors.left: prev.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
FightDefensiveBox
|
||||
id: fightDefensiveBox
|
||||
anchors.top: parent.top
|
||||
anchors.left: prev.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
MountButton
|
||||
id: mountButton
|
||||
anchors.top: parent.top
|
||||
anchors.right: next.left
|
||||
ChaseModeBox
|
||||
id: chaseModeBox
|
||||
anchors.top: parent.top
|
||||
anchors.right: next.left
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
SafeFightBox
|
||||
id: safeFightBox
|
||||
anchors.top: parent.top
|
||||
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
|
@@ -124,9 +124,6 @@ function init()
|
||||
return true
|
||||
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+Down', function() navigateMessageHistory(-1) end, consolePanel)
|
||||
g_keyboard.bindKeyPress('Tab', function() consoleTabBar:selectNextTab() end, consolePanel)
|
||||
@@ -135,8 +132,7 @@ function init()
|
||||
g_keyboard.bindKeyPress('Ctrl+A', function() consoleTextEdit:clearText() end, consolePanel)
|
||||
|
||||
-- apply buttom functions after loaded
|
||||
consolePanel:getChildById('nextChannelButton').onClick = function() consoleTabBar:selectNextTab() end
|
||||
consolePanel:getChildById('prevChannelButton').onClick = function() consoleTabBar:selectPrevTab() end
|
||||
consoleTabBar:setNavigation(consolePanel:getChildById('prevChannelButton'), consolePanel:getChildById('nextChannelButton'))
|
||||
consoleTabBar.onTabChange = onTabChange
|
||||
|
||||
-- tibia like hotkeys
|
||||
@@ -146,6 +142,10 @@ function init()
|
||||
|
||||
consoleToggleChat = consolePanel:getChildById('toggleChat')
|
||||
load()
|
||||
|
||||
if g_game.isOnline() then
|
||||
online()
|
||||
end
|
||||
end
|
||||
|
||||
function toggleChat()
|
||||
@@ -287,8 +287,8 @@ function clear()
|
||||
end
|
||||
channels = {}
|
||||
|
||||
defaultTab.tabPanel:getChildById('consoleBuffer'):destroyChildren()
|
||||
serverTab.tabPanel:getChildById('consoleBuffer'):destroyChildren()
|
||||
consoleTabBar:removeTab(defaultTab)
|
||||
consoleTabBar:removeTab(serverTab)
|
||||
|
||||
local npcTab = consoleTabBar:getTab('NPCs')
|
||||
if npcTab then
|
||||
@@ -1233,6 +1233,9 @@ function onClickIgnoreButton()
|
||||
end
|
||||
|
||||
function online()
|
||||
defaultTab = addTab(tr('Default'), true)
|
||||
serverTab = addTab(tr('Server Log'), false)
|
||||
|
||||
if g_game.getProtocolVersion() < 862 then
|
||||
g_keyboard.bindKeyDown('Ctrl+R', openPlayerReportRuleViolationWindow)
|
||||
end
|
||||
|
@@ -80,6 +80,7 @@ Panel
|
||||
anchors.right: next.left
|
||||
margin-left: 5
|
||||
margin-top: 3
|
||||
margin-right: 5
|
||||
moveable: true
|
||||
|
||||
TabButton
|
||||
|
@@ -1,71 +1,117 @@
|
||||
modalDialog = nil
|
||||
|
||||
function init()
|
||||
g_ui.importStyle('modaldialog')
|
||||
|
||||
connect(g_game, { onModalDialog = onModalDialog,
|
||||
onGameEnd = destroy })
|
||||
onGameEnd = destroyDialog })
|
||||
|
||||
local dialog = rootWidget:recursiveGetChildById('modalDialog')
|
||||
if dialog then
|
||||
modalDialog = dialog
|
||||
end
|
||||
end
|
||||
|
||||
function terminate()
|
||||
disconnect(g_game, { onModalDialog = onModalDialog,
|
||||
onGameEnd = destroy })
|
||||
|
||||
destroy()
|
||||
onGameEnd = destroyDialog })
|
||||
end
|
||||
|
||||
function destroy()
|
||||
function destroyDialog()
|
||||
if modalDialog then
|
||||
modalDialog:destroy()
|
||||
modalDialog = nil
|
||||
end
|
||||
end
|
||||
|
||||
function onModalDialog(id, title, message, enterId, enterText, escapeId, escapeText, choices)
|
||||
if modalDialog then return end
|
||||
|
||||
function onModalDialog(id, title, message, buttons, enterButton, escapeButton, choices, priority)
|
||||
-- priority parameter is unused, not sure what its use is.
|
||||
if modalDialog then
|
||||
return
|
||||
end
|
||||
|
||||
modalDialog = g_ui.createWidget('ModalDialog', rootWidget)
|
||||
|
||||
local enterButton = modalDialog:getChildById('enterButton')
|
||||
local escapeButton = modalDialog:getChildById('escapeButton')
|
||||
local messageLabel = modalDialog:getChildById('messageLabel')
|
||||
local choiceList = modalDialog:getChildById('choiceList')
|
||||
local choiceScrollbar = modalDialog:getChildById('choiceScrollBar')
|
||||
local buttonList = modalDialog:getChildById('buttonList')
|
||||
|
||||
modalDialog:setText(title)
|
||||
messageLabel:setText(message)
|
||||
enterButton:setText(enterText)
|
||||
escapeButton:setText(escapeText)
|
||||
|
||||
local focusLabel = nil
|
||||
for k, v in pairs(choices) do
|
||||
local choiceId = v[1]
|
||||
local choiceName = v[2]
|
||||
local horizontalPadding = modalDialog:getPaddingLeft() + modalDialog:getPaddingRight()
|
||||
modalDialog:setWidth(math.min(modalDialog.maximumWidth, math.max(messageLabel:getWidth(), modalDialog.minimumWidth)))
|
||||
messageLabel:setWidth(math.min(modalDialog.maximumWidth, math.max(messageLabel:getWidth(), modalDialog.minimumWidth)) - horizontalPadding)
|
||||
|
||||
local labelHeight = nil
|
||||
for i = 1, #choices do
|
||||
local choiceId = choices[i][1]
|
||||
local choiceName = choices[i][2]
|
||||
|
||||
local label = g_ui.createWidget('ChoiceListLabel', choiceList)
|
||||
label.choiceId = choiceId
|
||||
label:setText(choiceName)
|
||||
label:setPhantom(false)
|
||||
|
||||
if not focusLabel then
|
||||
focusLabel = label
|
||||
if not labelHeight then
|
||||
labelHeight = label:getHeight()
|
||||
end
|
||||
end
|
||||
choiceList:focusChild(focusLabel)
|
||||
choiceList:focusNextChild()
|
||||
|
||||
for i = 1, #buttons do
|
||||
local buttonId = buttons[i][1]
|
||||
local buttonText = buttons[i][2]
|
||||
|
||||
local button = g_ui.createWidget('ModalButton', buttonList)
|
||||
button:setText(buttonText)
|
||||
button.onClick = function(self)
|
||||
local focusedChoice = choiceList:getFocusedChild()
|
||||
local choice = 0xFF
|
||||
if focusedChoice then
|
||||
choice = focusedChoice.choiceId
|
||||
end
|
||||
g_game.answerModalDialog(id, buttonId, choice)
|
||||
destroyDialog()
|
||||
end
|
||||
end
|
||||
|
||||
local additionalHeight = 0
|
||||
if #choices > 0 then
|
||||
choiceList:setVisible(true)
|
||||
choiceScrollbar:setVisible(true)
|
||||
|
||||
additionalHeight = math.min(modalDialog.maximumChoices, math.max(modalDialog.minimumChoices, #choices)) * labelHeight
|
||||
additionalHeight = additionalHeight + choiceList:getPaddingTop() + choiceList:getPaddingBottom()
|
||||
end
|
||||
modalDialog:setHeight(modalDialog:getHeight() + additionalHeight)
|
||||
|
||||
addEvent(function()
|
||||
modalDialog:setHeight(modalDialog:getHeight() + messageLabel:getHeight() - 14)
|
||||
end)
|
||||
|
||||
local enterFunc = function()
|
||||
g_game.answerModalDialog(id, enterId, choiceList:getFocusedChild().choiceId)
|
||||
destroy()
|
||||
local focusedChoice = choiceList:getFocusedChild()
|
||||
local choice = 0xFF
|
||||
if focusedChoice then
|
||||
choice = focusedChoice.choiceId
|
||||
end
|
||||
g_game.answerModalDialog(id, enterButton, choice)
|
||||
destroyDialog()
|
||||
end
|
||||
|
||||
local escapeFunc = function()
|
||||
g_game.answerModalDialog(id, escapeId, choiceList:getFocusedChild().choiceId)
|
||||
destroy()
|
||||
local focusedChoice = choiceList:getFocusedChild()
|
||||
local choice = 0xFF
|
||||
if focusedChoice then
|
||||
choice = focusedChoice.choiceId
|
||||
end
|
||||
g_game.answerModalDialog(id, escapeButton, choice)
|
||||
destroyDialog()
|
||||
end
|
||||
|
||||
choiceList.onDoubleClick = enterFunc
|
||||
|
||||
enterButton.onClick = enterFunc
|
||||
modalDialog.onEnter = enterFunc
|
||||
|
||||
escapeButton.onClick = escapeFunc
|
||||
modalDialog.onEscape = escapeFunc
|
||||
return
|
||||
end
|
@@ -8,52 +8,61 @@ ChoiceListLabel < Label
|
||||
background-color: #ffffff22
|
||||
color: #ffffff
|
||||
|
||||
ChoiceList < TextList
|
||||
id: choiceList
|
||||
vertical-scrollbar: choiceScrollBar
|
||||
anchors.fill: parent
|
||||
anchors.top: prev.bottom
|
||||
anchors.bottom: next.top
|
||||
padding: 1
|
||||
margin-top: 4
|
||||
margin-bottom: 10
|
||||
focusable: false
|
||||
visible: false
|
||||
|
||||
ChoiceScrollBar < VerticalScrollBar
|
||||
id: choiceScrollBar
|
||||
anchors.top: choiceList.top
|
||||
anchors.bottom: choiceList.bottom
|
||||
anchors.right: choiceList.right
|
||||
step: 14
|
||||
pixels-scroll: true
|
||||
visible: false
|
||||
|
||||
ModalButton < Button
|
||||
width: 60
|
||||
margin: 2
|
||||
|
||||
ModalDialog < MainWindow
|
||||
id: modalDialog
|
||||
!text: tr('Title')
|
||||
size: 280 230
|
||||
@onEscape: self:destroy()
|
||||
size: 280 97
|
||||
&minimumWidth: 200
|
||||
&maximumWidth: 500
|
||||
&minimumChoices: 4
|
||||
&maximumChoices: 10
|
||||
|
||||
Label
|
||||
id: messageLabel
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
text-align: left
|
||||
text: Message
|
||||
height: 60
|
||||
text-auto-resize: true
|
||||
text-wrap: true
|
||||
|
||||
TextList
|
||||
id: choiceList
|
||||
vertical-scrollbar: choiceScrollBar
|
||||
anchors.fill: parent
|
||||
anchors.top: prev.bottom
|
||||
anchors.bottom: next.top
|
||||
margin-bottom: 10
|
||||
margin-top: 10
|
||||
padding: 1
|
||||
focusable: false
|
||||
|
||||
Button
|
||||
id: enterButton
|
||||
!text: tr('Ok')
|
||||
anchors.top: next.top
|
||||
anchors.right: next.left
|
||||
margin-right: 8
|
||||
width: 60
|
||||
ChoiceList
|
||||
|
||||
Button
|
||||
id: escapeButton
|
||||
!text: tr('Cancel')
|
||||
anchors.bottom: parent.bottom
|
||||
HorizontalSeparator
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
margin-top: 10
|
||||
width: 60
|
||||
anchors.bottom: next.top
|
||||
|
||||
VerticalScrollBar
|
||||
id: choiceScrollBar
|
||||
anchors.top: choiceList.top
|
||||
anchors.bottom: choiceList.bottom
|
||||
anchors.right: choiceList.right
|
||||
step: 14
|
||||
pixels-scroll: true
|
||||
Panel
|
||||
id: buttonList
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
height: 24
|
||||
layout: horizontalBox
|
||||
align-right: true
|
||||
|
||||
ChoiceScrollBar
|
||||
|
@@ -94,7 +94,7 @@ function create(creatureOutfit, outfitList, creatureMount, mountList)
|
||||
addon.widget.onCheckChange = function(self) onAddonCheckChange(self, addon.value) end
|
||||
end
|
||||
|
||||
if outfit.addons > 0 then
|
||||
if outfit.addons and outfit.addons > 0 then
|
||||
for _, i in pairs(ADDON_SETS[outfit.addons]) do
|
||||
addons[i].widget:setChecked(true)
|
||||
end
|
||||
|
@@ -43,7 +43,7 @@ function init()
|
||||
reasonsTextList = ruleViolationWindow:getChildById('reasonList')
|
||||
actionsTextList = ruleViolationWindow:getChildById('actionList')
|
||||
|
||||
g_keyboard.bindKeyDown('Ctrl+Y', show)
|
||||
g_keyboard.bindKeyDown('Ctrl+Y', function() show() end)
|
||||
|
||||
if g_game.isOnline() then
|
||||
loadReasons()
|
||||
@@ -63,6 +63,7 @@ end
|
||||
|
||||
function loadReasons()
|
||||
reasonsTextList:destroyChildren()
|
||||
actionsTextList:destroyChildren()
|
||||
|
||||
local actions = g_game.getGMActions()
|
||||
for reason, actionFlags in pairs(actions) do
|
||||
@@ -100,7 +101,7 @@ function onSelectReason(reasonLabel, focused)
|
||||
if reasonLabel.actionFlags and focused then
|
||||
actionsTextList:destroyChildren()
|
||||
for actionBaseFlag = 0, #rvactions do
|
||||
actionFlagString = rvactions[actionBaseFlag]
|
||||
local actionFlagString = rvactions[actionBaseFlag]
|
||||
if bit32.band(reasonLabel.actionFlags, math.pow(2, actionBaseFlag)) > 0 then
|
||||
local label = g_ui.createWidget('RVListLabel', actionsTextList)
|
||||
label:setText(actionFlagString)
|
||||
@@ -111,9 +112,21 @@ function onSelectReason(reasonLabel, focused)
|
||||
end
|
||||
|
||||
function report()
|
||||
local reasonLabel = reasonsTextList:getFocusedChild()
|
||||
if not reasonLabel then
|
||||
displayErrorBox(tr("Error"), tr("You must select a reason."))
|
||||
return
|
||||
end
|
||||
|
||||
local actionLabel = actionsTextList:getFocusedChild()
|
||||
if not actionLabel then
|
||||
displayErrorBox(tr("Error"), tr("You must select an action."))
|
||||
return
|
||||
end
|
||||
|
||||
local target = ruleViolationWindow:getChildById('nameText'):getText()
|
||||
local reason = reasonsTextList:getFocusedChild().reasonId
|
||||
local action = actionsTextList:getFocusedChild().actionId
|
||||
local reason = reasonLabel.reasonId
|
||||
local action = actionLabel.actionId
|
||||
local comment = ruleViolationWindow:getChildById('commentText'):getText()
|
||||
local statement = ruleViolationWindow:getChildById('statementText'):getText()
|
||||
local statementId = 0 -- TODO: message unique id ?
|
||||
|
@@ -61,7 +61,7 @@ end
|
||||
|
||||
function terminate()
|
||||
disconnect(g_game, 'onTextMessage', displayMessage)
|
||||
disconnect(g_game, 'onGameEnd',clearMessages)
|
||||
disconnect(g_game, 'onGameEnd', clearMessages)
|
||||
clearMessages()
|
||||
messagesPanel:destroy()
|
||||
end
|
||||
|
@@ -23,7 +23,7 @@ function destroyWindows()
|
||||
windows = {}
|
||||
end
|
||||
|
||||
function onGameEditText(id, itemId, maxLength, text, writter, time)
|
||||
function onGameEditText(id, itemId, maxLength, text, writer, time)
|
||||
local textWindow = g_ui.createWidget('TextWindow', rootWidget)
|
||||
|
||||
local writeable = #text < maxLength and maxLength > 0
|
||||
@@ -42,8 +42,8 @@ function onGameEditText(id, itemId, maxLength, text, writter, time)
|
||||
textEdit:setCursorVisible(writeable)
|
||||
|
||||
local desc = ''
|
||||
if #writter > 0 then
|
||||
desc = tr('You read the following, written by \n%s\n', writter)
|
||||
if #writer > 0 then
|
||||
desc = tr('You read the following, written by \n%s\n', writer)
|
||||
if #time > 0 then
|
||||
desc = desc .. tr('on %s.\n', time)
|
||||
end
|
||||
|
@@ -47,6 +47,11 @@ FightDefensive = 3
|
||||
DontChase = 0
|
||||
ChaseOpponent = 1
|
||||
|
||||
PVPWhiteDove = 0
|
||||
PVPWhiteHand = 1
|
||||
PVPYellowHand = 2
|
||||
PVPRedFist = 3
|
||||
|
||||
GameProtocolChecksum = 1
|
||||
GameAccountNames = 2
|
||||
GameChallengeOnLogin = 3
|
||||
@@ -94,6 +99,7 @@ GameMesssageLevel = 46
|
||||
GameNewFluids = 47
|
||||
GamePlayerStateU16 = 48
|
||||
GameNewOutfitProtocol = 49
|
||||
GamePVPMode = 50
|
||||
|
||||
TextColors = {
|
||||
red = '#f55e5e', --'#c83200'
|
||||
|
@@ -48,11 +48,13 @@ end
|
||||
|
||||
function g_game.getSupportedClients()
|
||||
return {
|
||||
760, 810, 811, 840, 842, 850, 853,
|
||||
854, 860, 861, 862, 870, 910, 940,
|
||||
944, 953, 954, 960, 961, 963, 970,
|
||||
980, 981, 982, 983, 984, 985, 986,
|
||||
1001, 1002, 1010, 1020, 1021, 1022,
|
||||
760, 770, 772, 780, 781, 782, 790,
|
||||
792, 800, 810, 811, 840, 842, 850,
|
||||
853, 854, 860, 861, 862, 870, 910,
|
||||
940, 944, 953, 954, 960, 961, 963,
|
||||
970, 980, 981, 982, 983, 984, 985,
|
||||
986, 1001, 1002, 1010, 1020, 1021,
|
||||
1022, 1031
|
||||
}
|
||||
end
|
||||
|
||||
|
@@ -188,9 +188,5 @@ ClientOpcodes = {
|
||||
ClientMarketCreate = 246, -- 944
|
||||
ClientMarketCancel = 247, -- 944
|
||||
ClientMarketAccept = 248, -- 944
|
||||
ClientAnswerModalDialog = 249, -- 960
|
||||
|
||||
-- 760
|
||||
ClientEnterAccount760 = 513,
|
||||
ClientEnterGame760 = 522
|
||||
ClientAnswerModalDialog = 249 -- 960
|
||||
}
|
||||
|
@@ -27,13 +27,9 @@ end
|
||||
|
||||
function ProtocolLogin:sendLoginPacket()
|
||||
local msg = OutputMessage.create()
|
||||
if g_game.getProtocolVersion() == 760 then
|
||||
msg:addU16(ClientOpcodes.ClientEnterAccount760)
|
||||
else
|
||||
msg:addU8(ClientOpcodes.ClientEnterAccount)
|
||||
msg:addU16(g_game.getOs())
|
||||
end
|
||||
|
||||
msg:addU8(ClientOpcodes.ClientEnterAccount)
|
||||
msg:addU16(g_game.getOs())
|
||||
|
||||
msg:addU16(g_game.getProtocolVersion())
|
||||
|
||||
if g_game.getProtocolVersion() >= 971 then
|
||||
@@ -50,10 +46,9 @@ function ProtocolLogin:sendLoginPacket()
|
||||
|
||||
local offset = msg:getMessageSize()
|
||||
|
||||
-- first RSA byte must be 0
|
||||
msg:addU8(0)
|
||||
|
||||
if g_game.getProtocolVersion() >= 800 then
|
||||
if g_game.getProtocolVersion() >= 770 then
|
||||
-- first RSA byte must be 0
|
||||
msg:addU8(0)
|
||||
-- xtea key
|
||||
self:generateXteaKey()
|
||||
local xteaKey = self:getXteaKey()
|
||||
@@ -79,7 +74,7 @@ function ProtocolLogin:sendLoginPacket()
|
||||
local paddingBytes = g_crypt.rsaGetSize() - (msg:getMessageSize() - offset)
|
||||
assert(paddingBytes >= 0)
|
||||
msg:addPaddingBytes(paddingBytes, 0)
|
||||
if g_game.getProtocolVersion() >= 800 then
|
||||
if g_game.getProtocolVersion() >= 770 then
|
||||
msg:encryptRsa()
|
||||
end
|
||||
|
||||
@@ -88,7 +83,7 @@ function ProtocolLogin:sendLoginPacket()
|
||||
end
|
||||
|
||||
self:send(msg)
|
||||
if g_game.getProtocolVersion() >= 800 then
|
||||
if g_game.getProtocolVersion() >= 770 then
|
||||
self:enableXteaEncryption()
|
||||
end
|
||||
self:recv()
|
||||
|
@@ -273,11 +273,20 @@ function UIMinimap:createFlagWindow(pos)
|
||||
|
||||
flagRadioGroup:selectWidget(flagRadioGroup:getFirstWidget())
|
||||
|
||||
okButton.onClick = function()
|
||||
local successFunc = function()
|
||||
self:addFlag(pos, flagRadioGroup:getSelectedWidget().icon, description:getText())
|
||||
self:destroyFlagWindow()
|
||||
end
|
||||
cancelButton.onClick = function() self:destroyFlagWindow() end
|
||||
|
||||
local cancelFunc = function()
|
||||
self:destroyFlagWindow()
|
||||
end
|
||||
|
||||
okButton.onClick = successFunc
|
||||
cancelButton.onClick = cancelFunc
|
||||
|
||||
self.flagWindow.onEnter = successFunc
|
||||
self.flagWindow.onEscape = cancelFunc
|
||||
|
||||
self.flagWindow.onDestroy = function() flagRadioGroup:destroy() end
|
||||
end
|
||||
|
@@ -206,6 +206,13 @@ namespace Otc
|
||||
ChaseOpponent = 1
|
||||
};
|
||||
|
||||
enum PVPModes {
|
||||
WhiteDove = 0,
|
||||
WhiteHand = 1,
|
||||
YellowHand = 2,
|
||||
RedFist = 3
|
||||
};
|
||||
|
||||
enum PlayerSkulls {
|
||||
SkullNone = 0,
|
||||
SkullYellow,
|
||||
@@ -367,8 +374,8 @@ namespace Otc
|
||||
GamePlayerStateU16 = 48,
|
||||
GameNewOutfitProtocol = 49,
|
||||
GamePVPMode = 50,
|
||||
GameWritableDate = 51,
|
||||
|
||||
// 51-100 reserved to be defined in lua
|
||||
LastGameFeature = 101
|
||||
};
|
||||
|
||||
|
@@ -70,13 +70,13 @@ void Creature::draw(const Point& dest, float scaleFactor, bool animate, LightVie
|
||||
|
||||
if(m_showTimedSquare && animate) {
|
||||
g_painter->setColor(m_timedSquareColor);
|
||||
g_painter->drawBoundingRect(Rect(dest + (animationOffset - getDisplacement() + 2)*scaleFactor, Size(28, 28)*scaleFactor), std::max((int)(2*scaleFactor), 1));
|
||||
g_painter->drawBoundingRect(Rect(dest + (animationOffset - getDisplacement() + 2)*scaleFactor, Size(28, 28)*scaleFactor), std::max<int>((int)(2*scaleFactor), 1));
|
||||
g_painter->setColor(Color::white);
|
||||
}
|
||||
|
||||
if(m_showStaticSquare && animate) {
|
||||
g_painter->setColor(m_staticSquareColor);
|
||||
g_painter->drawBoundingRect(Rect(dest + (animationOffset - getDisplacement())*scaleFactor, Size(Otc::TILE_PIXELS, Otc::TILE_PIXELS)*scaleFactor), std::max((int)(2*scaleFactor), 1));
|
||||
g_painter->drawBoundingRect(Rect(dest + (animationOffset - getDisplacement())*scaleFactor, Size(Otc::TILE_PIXELS, Otc::TILE_PIXELS)*scaleFactor), std::max<int>((int)(2*scaleFactor), 1));
|
||||
g_painter->setColor(Color::white);
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ void Creature::internalDrawOutfit(Point dest, float scaleFactor, bool animateWal
|
||||
dest -= datType->getDisplacement() * scaleFactor;
|
||||
datType->draw(dest, scaleFactor, 0, xPattern, 0, 0, animationPhase, lightView);
|
||||
dest += getDisplacement() * scaleFactor;
|
||||
zPattern = std::min(1, getNumPatternZ() - 1);
|
||||
zPattern = std::min<int>(1, getNumPatternZ() - 1);
|
||||
}
|
||||
|
||||
PointF jumpOffset = m_jumpOffset * scaleFactor;
|
||||
@@ -171,7 +171,7 @@ void Creature::internalDrawOutfit(Point dest, float scaleFactor, bool animateWal
|
||||
// when creature is an effect we cant render the first and last animation phase,
|
||||
// instead we should loop in the phases between
|
||||
if(m_outfit.getCategory() == ThingCategoryEffect) {
|
||||
animationPhases = std::max(1, animationPhases-2);
|
||||
animationPhases = std::max<int>(1, animationPhases-2);
|
||||
animateTicks = Otc::INVISIBLE_TICKS_PER_FRAME;
|
||||
}
|
||||
|
||||
@@ -183,7 +183,7 @@ void Creature::internalDrawOutfit(Point dest, float scaleFactor, bool animateWal
|
||||
}
|
||||
|
||||
if(m_outfit.getCategory() == ThingCategoryEffect)
|
||||
animationPhase = std::min(animationPhase+1, animationPhases);
|
||||
animationPhase = std::min<int>(animationPhase+1, animationPhases);
|
||||
|
||||
type->draw(dest - (getDisplacement() * scaleFactor), scaleFactor, 0, 0, 0, 0, animationPhase, lightView);
|
||||
}
|
||||
@@ -372,7 +372,7 @@ void Creature::updateJump()
|
||||
|
||||
int nextT, i = 1;
|
||||
do {
|
||||
nextT = stdext::round((-b + std::sqrt(std::max(b*b + 4*a*(roundHeight+diff*i), 0.0)) * diff) / (2*a));
|
||||
nextT = stdext::round((-b + std::sqrt(std::max<int>(b*b + 4*a*(roundHeight+diff*i), 0.0)) * diff) / (2*a));
|
||||
++i;
|
||||
|
||||
if(nextT < halfJumpDuration)
|
||||
@@ -480,7 +480,7 @@ void Creature::updateWalkAnimation(int totalPixelsWalked)
|
||||
if(!self->m_walking || self->m_walkTimer.ticksElapsed() >= self->getStepDuration(true))
|
||||
self->m_walkAnimationPhase = 0;
|
||||
self->m_walkFinishAnimEvent = nullptr;
|
||||
}, std::min(footDelay, 200));
|
||||
}, std::min<int>(footDelay, 200));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -553,10 +553,10 @@ void Creature::nextWalkUpdate()
|
||||
void Creature::updateWalk()
|
||||
{
|
||||
float walkTicksPerPixel = getStepDuration(true) / 32;
|
||||
int totalPixelsWalked = std::min(m_walkTimer.ticksElapsed() / walkTicksPerPixel, 32.0f);
|
||||
int totalPixelsWalked = std::min<int>(m_walkTimer.ticksElapsed() / walkTicksPerPixel, 32.0f);
|
||||
|
||||
// needed for paralyze effect
|
||||
m_walkedPixels = std::max(m_walkedPixels, totalPixelsWalked);
|
||||
m_walkedPixels = std::max<int>(m_walkedPixels, totalPixelsWalked);
|
||||
|
||||
// update walk animation and offsets
|
||||
updateWalkAnimation(totalPixelsWalked);
|
||||
@@ -631,7 +631,7 @@ void Creature::setDirection(Otc::Direction direction)
|
||||
|
||||
void Creature::setOutfit(const Outfit& outfit)
|
||||
{
|
||||
Outfit oldOutfit = outfit;
|
||||
Outfit oldOutfit = m_outfit;
|
||||
if(outfit.getCategory() != ThingCategoryCreature) {
|
||||
if(!g_things.isValidDatId(outfit.getAuxId(), outfit.getCategory()))
|
||||
return;
|
||||
@@ -820,7 +820,7 @@ int Creature::getStepDuration(bool ignoreDiagonal, Otc::Direction dir)
|
||||
if(g_game.getFeature(Otc::GameNewSpeedLaw) && hasSpeedFormula()) {
|
||||
int formulatedSpeed = 1;
|
||||
if(speed > -m_speedFormula[Otc::SpeedFormulaB]) {
|
||||
formulatedSpeed = std::max(1, (int)floor((m_speedFormula[Otc::SpeedFormulaA] * log((speed / 2)
|
||||
formulatedSpeed = std::max<int>(1, (int)floor((m_speedFormula[Otc::SpeedFormulaA] * log((speed / 2)
|
||||
+ m_speedFormula[Otc::SpeedFormulaB]) + m_speedFormula[Otc::SpeedFormulaC]) + 0.5));
|
||||
}
|
||||
interval = std::floor(interval / (double)formulatedSpeed);
|
||||
@@ -835,7 +835,7 @@ int Creature::getStepDuration(bool ignoreDiagonal, Otc::Direction dir)
|
||||
if(g_game.getProtocolVersion() <= 810)
|
||||
factor = 2;
|
||||
|
||||
interval = std::max(interval, g_game.getServerBeat());
|
||||
interval = std::max<int>(interval, g_game.getServerBeat());
|
||||
|
||||
if(!ignoreDiagonal && (m_lastStepDirection == Otc::NorthWest || m_lastStepDirection == Otc::NorthEast ||
|
||||
m_lastStepDirection == Otc::SouthWest || m_lastStepDirection == Otc::SouthEast))
|
||||
@@ -887,7 +887,7 @@ int Creature::getExactSize(int layer, int xPattern, int yPattern, int zPattern,
|
||||
continue;
|
||||
|
||||
for(layer = 0; layer < getLayers(); ++layer)
|
||||
exactSize = std::max(exactSize, Thing::getExactSize(layer, xPattern, yPattern, zPattern, animationPhase));
|
||||
exactSize = std::max<int>(exactSize, Thing::getExactSize(layer, xPattern, yPattern, zPattern, animationPhase));
|
||||
}
|
||||
|
||||
return exactSize;
|
||||
|
@@ -101,8 +101,7 @@ void Spawn::save(TiXmlElement* node)
|
||||
for(const auto& pair : m_creatures) {
|
||||
const CreatureTypePtr& creature = pair.second;
|
||||
if(!(creatureNode = new TiXmlElement(creature->getRace() == CreatureRaceNpc ? "npc" : "monster")))
|
||||
stdext::throw_exception("oom?");
|
||||
|
||||
stdext::throw_exception("Spawn::save: Ran out of memory while allocating XML element! Terminating now.");
|
||||
|
||||
creatureNode->SetAttribute("name", creature->getName());
|
||||
creatureNode->SetAttribute("spawntime", creature->getSpawnTime());
|
||||
@@ -111,8 +110,8 @@ void Spawn::save(TiXmlElement* node)
|
||||
const Position& placePos = pair.first;
|
||||
assert(placePos.isValid());
|
||||
|
||||
creatureNode->SetAttribute("x", c.x - placePos.x);
|
||||
creatureNode->SetAttribute("y", c.y - placePos.y);
|
||||
creatureNode->SetAttribute("x", placePos.x - c.x);
|
||||
creatureNode->SetAttribute("y", placePos.y - c.y);
|
||||
creatureNode->SetAttribute("z", placePos.z);
|
||||
|
||||
node->LinkEndChild(creatureNode);
|
||||
@@ -369,6 +368,19 @@ SpawnPtr CreatureManager::getSpawn(const Position& centerPos)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
SpawnPtr CreatureManager::getSpawnForPlacePos(const Position& pos)
|
||||
{
|
||||
for (const auto& pair : m_spawns) {
|
||||
const Position& centerPos = pair.first;
|
||||
const SpawnPtr& spawn = pair.second;
|
||||
|
||||
if (isInZone(pos, centerPos, spawn->getRadius()))
|
||||
return spawn;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
SpawnPtr CreatureManager::addSpawn(const Position& centerPos, int radius)
|
||||
{
|
||||
auto iter = m_spawns.find(centerPos);
|
||||
|
@@ -121,6 +121,7 @@ public:
|
||||
const CreatureTypePtr& getCreatureByLook(int look);
|
||||
|
||||
SpawnPtr getSpawn(const Position& centerPos);
|
||||
SpawnPtr getSpawnForPlacePos(const Position& pos);
|
||||
SpawnPtr addSpawn(const Position& centerPos, int radius);
|
||||
|
||||
bool isLoaded() { return m_loaded; }
|
||||
|
@@ -31,7 +31,7 @@ void Effect::draw(const Point& dest, float scaleFactor, bool animate, LightView
|
||||
|
||||
int animationPhase = 0;
|
||||
if(animate)
|
||||
animationPhase = std::min((int)(m_animationTimer.ticksElapsed() / m_phaseDuration), getAnimationPhases() - 1);
|
||||
animationPhase = std::min<int>((int)(m_animationTimer.ticksElapsed() / m_phaseDuration), getAnimationPhases() - 1);
|
||||
rawGetThingType()->draw(dest, scaleFactor, 0, 0, 0, 0, animationPhase, lightView);
|
||||
}
|
||||
|
||||
|
@@ -51,6 +51,7 @@ Game::Game()
|
||||
m_canReportBugs = false;
|
||||
m_fightMode = Otc::FightBalanced;
|
||||
m_chaseMode = Otc::DontChase;
|
||||
m_pvpMode = Otc::WhiteDove;
|
||||
m_safeFight = true;
|
||||
}
|
||||
|
||||
@@ -76,6 +77,7 @@ void Game::resetGameStates()
|
||||
m_canReportBugs = false;
|
||||
m_fightMode = Otc::FightBalanced;
|
||||
m_chaseMode = Otc::DontChase;
|
||||
m_pvpMode = Otc::WhiteDove;
|
||||
m_safeFight = true;
|
||||
m_followingCreature = nullptr;
|
||||
m_attackingCreature = nullptr;
|
||||
@@ -176,7 +178,7 @@ void Game::processGameStart()
|
||||
m_online = true;
|
||||
|
||||
// synchronize fight modes with the server
|
||||
m_protocolGame->sendChangeFightModes(m_fightMode, m_chaseMode, m_safeFight);
|
||||
m_protocolGame->sendChangeFightModes(m_fightMode, m_chaseMode, m_safeFight, m_pvpMode);
|
||||
|
||||
// NOTE: the entire map description and local player information is not known yet (bot call is allowed here)
|
||||
enableBotCall();
|
||||
@@ -239,15 +241,17 @@ void Game::processPlayerHelpers(int helpers)
|
||||
g_lua.callGlobalField("g_game", "onPlayerHelpersUpdate", helpers);
|
||||
}
|
||||
|
||||
void Game::processPlayerModes(Otc::FightModes fightMode, Otc::ChaseModes chaseMode, bool safeMode)
|
||||
void Game::processPlayerModes(Otc::FightModes fightMode, Otc::ChaseModes chaseMode, bool safeMode, Otc::PVPModes pvpMode)
|
||||
{
|
||||
m_fightMode = fightMode;
|
||||
m_chaseMode = chaseMode;
|
||||
m_safeFight = safeMode;
|
||||
m_pvpMode = pvpMode;
|
||||
|
||||
g_lua.callGlobalField("g_game", "onFightModeChange", fightMode);
|
||||
g_lua.callGlobalField("g_game", "onChaseModeChange", chaseMode);
|
||||
g_lua.callGlobalField("g_game", "onSafeFightChange", safeMode);
|
||||
g_lua.callGlobalField("g_game", "onPVPModeChange", pvpMode);
|
||||
}
|
||||
|
||||
void Game::processPing()
|
||||
@@ -486,9 +490,9 @@ void Game::processCloseTrade()
|
||||
g_lua.callGlobalField("g_game", "onCloseTrade");
|
||||
}
|
||||
|
||||
void Game::processEditText(uint id, int itemId, int maxLength, const std::string& text, const std::string& writter, const std::string& date)
|
||||
void Game::processEditText(uint id, int itemId, int maxLength, const std::string& text, const std::string& writer, const std::string& date)
|
||||
{
|
||||
g_lua.callGlobalField("g_game", "onEditText", id, itemId, maxLength, text, writter, date);
|
||||
g_lua.callGlobalField("g_game", "onEditText", id, itemId, maxLength, text, writer, date);
|
||||
}
|
||||
|
||||
void Game::processEditList(uint id, int doorId, const std::string& text)
|
||||
@@ -506,9 +510,9 @@ void Game::processQuestLine(int questId, const std::vector<std::tuple<std::strin
|
||||
g_lua.callGlobalField("g_game", "onQuestLine", questId, questMissions);
|
||||
}
|
||||
|
||||
void Game::processModalDialog(uint32 id, std::string title, std::string message, int enterId, std::string enterText, int escapeId, std::string escapeText, std::vector<std::tuple<int, std::string> > choiceList)
|
||||
void Game::processModalDialog(uint32 id, std::string title, std::string message, std::vector<std::tuple<int, std::string> > buttonList, int enterButton, int escapeButton, std::vector<std::tuple<int, std::string> > choiceList, bool priority)
|
||||
{
|
||||
g_lua.callGlobalField("g_game", "onModalDialog", id, title, message, enterId, enterText, escapeId, escapeText, choiceList);
|
||||
g_lua.callGlobalField("g_game", "onModalDialog", id, title, message, buttonList, enterButton, escapeButton, choiceList, priority);
|
||||
}
|
||||
|
||||
void Game::processAttackCancel(uint seq)
|
||||
@@ -1195,7 +1199,7 @@ void Game::setChaseMode(Otc::ChaseModes chaseMode)
|
||||
if(m_chaseMode == chaseMode)
|
||||
return;
|
||||
m_chaseMode = chaseMode;
|
||||
m_protocolGame->sendChangeFightModes(m_fightMode, m_chaseMode, m_safeFight);
|
||||
m_protocolGame->sendChangeFightModes(m_fightMode, m_chaseMode, m_safeFight, m_pvpMode);
|
||||
g_lua.callGlobalField("g_game", "onChaseModeChange", chaseMode);
|
||||
}
|
||||
|
||||
@@ -1206,7 +1210,7 @@ void Game::setFightMode(Otc::FightModes fightMode)
|
||||
if(m_fightMode == fightMode)
|
||||
return;
|
||||
m_fightMode = fightMode;
|
||||
m_protocolGame->sendChangeFightModes(m_fightMode, m_chaseMode, m_safeFight);
|
||||
m_protocolGame->sendChangeFightModes(m_fightMode, m_chaseMode, m_safeFight, m_pvpMode);
|
||||
g_lua.callGlobalField("g_game", "onFightModeChange", fightMode);
|
||||
}
|
||||
|
||||
@@ -1217,10 +1221,23 @@ void Game::setSafeFight(bool on)
|
||||
if(m_safeFight == on)
|
||||
return;
|
||||
m_safeFight = on;
|
||||
m_protocolGame->sendChangeFightModes(m_fightMode, m_chaseMode, m_safeFight);
|
||||
m_protocolGame->sendChangeFightModes(m_fightMode, m_chaseMode, m_safeFight, m_pvpMode);
|
||||
g_lua.callGlobalField("g_game", "onSafeFightChange", on);
|
||||
}
|
||||
|
||||
void Game::setPVPMode(Otc::PVPModes pvpMode)
|
||||
{
|
||||
if(!canPerformGameAction())
|
||||
return;
|
||||
if(!getFeature(Otc::GamePVPMode))
|
||||
return;
|
||||
if(m_pvpMode == pvpMode)
|
||||
return;
|
||||
m_pvpMode = pvpMode;
|
||||
m_protocolGame->sendChangeFightModes(m_fightMode, m_chaseMode, m_safeFight, m_pvpMode);
|
||||
g_lua.callGlobalField("g_game", "onPVPModeChange", pvpMode);
|
||||
}
|
||||
|
||||
void Game::inspectNpcTrade(const ItemPtr& item)
|
||||
{
|
||||
if(!canPerformGameAction() || !item)
|
||||
@@ -1356,7 +1373,6 @@ void Game::mount(bool mount)
|
||||
{
|
||||
if(!canPerformGameAction())
|
||||
return;
|
||||
|
||||
m_protocolGame->sendMountStatus(mount);
|
||||
}
|
||||
|
||||
@@ -1371,7 +1387,6 @@ void Game::answerModalDialog(int dialog, int button, int choice)
|
||||
{
|
||||
if(!canPerformGameAction())
|
||||
return;
|
||||
|
||||
m_protocolGame->sendAnswerModalDialog(dialog, button, choice);
|
||||
}
|
||||
|
||||
@@ -1430,12 +1445,18 @@ void Game::setProtocolVersion(int version)
|
||||
if(isOnline())
|
||||
stdext::throw_exception("Unable to change protocol version while online");
|
||||
|
||||
if(version != 0 && version != 760 && (version < 810 || version > 1022))
|
||||
if(version != 0 && (version < 760 || version > 1031))
|
||||
stdext::throw_exception(stdext::format("Protocol version %d not supported", version));
|
||||
|
||||
m_features.reset();
|
||||
enableFeature(Otc::GameFormatCreatureName);
|
||||
|
||||
if(version >= 770)
|
||||
{
|
||||
enableFeature(Otc::GameLooktypeU16);
|
||||
enableFeature(Otc::GameMessageStatements);
|
||||
enableFeature(Otc::GameWritableDate); // might not be since 770
|
||||
}
|
||||
|
||||
if(version >= 780)
|
||||
{
|
||||
@@ -1443,9 +1464,7 @@ void Game::setProtocolVersion(int version)
|
||||
enableFeature(Otc::GamePlayerStamina);
|
||||
enableFeature(Otc::GameNewFluids);
|
||||
enableFeature(Otc::GameMessageLevel);
|
||||
enableFeature(Otc::GameMessageStatements);
|
||||
enableFeature(Otc::GamePlayerStateU16);
|
||||
enableFeature(Otc::GameLooktypeU16);
|
||||
enableFeature(Otc::GameNewOutfitProtocol);
|
||||
}
|
||||
|
||||
@@ -1453,16 +1472,13 @@ void Game::setProtocolVersion(int version)
|
||||
enableFeature(Otc::GameProtocolChecksum);
|
||||
enableFeature(Otc::GameChallengeOnLogin);
|
||||
enableFeature(Otc::GameAccountNames);
|
||||
enableFeature(Otc::GameDoubleFreeCapacity);
|
||||
}
|
||||
|
||||
if(version >= 780 && version <= 854) { // 780 might not be accurate
|
||||
enableFeature(Otc::GameChargeableItems);
|
||||
}
|
||||
|
||||
if(version >= 850) {
|
||||
enableFeature(Otc::GameDoubleFreeCapacity);
|
||||
}
|
||||
|
||||
if(version >= 854) {
|
||||
enableFeature(Otc::GameCreatureEmblems);
|
||||
}
|
||||
@@ -1537,7 +1553,7 @@ void Game::setClientVersion(int version)
|
||||
if(isOnline())
|
||||
stdext::throw_exception("Unable to change client version while online");
|
||||
|
||||
if(version != 0 && version != 760 && (version < 810 || version > 1022))
|
||||
if(version != 0 && (version < 760 || version > 1031))
|
||||
stdext::throw_exception(stdext::format("Client version %d not supported", version));
|
||||
|
||||
m_clientVersion = version;
|
||||
|
@@ -74,7 +74,7 @@ protected:
|
||||
void processWalkCancel(Otc::Direction direction);
|
||||
|
||||
void processPlayerHelpers(int helpers);
|
||||
void processPlayerModes(Otc::FightModes fightMode, Otc::ChaseModes chaseMode, bool safeMode);
|
||||
void processPlayerModes(Otc::FightModes fightMode, Otc::ChaseModes chaseMode, bool safeMode, Otc::PVPModes pvpMode);
|
||||
|
||||
// message related
|
||||
void processTextMessage(Otc::MessageMode mode, const std::string& text);
|
||||
@@ -124,7 +124,7 @@ protected:
|
||||
void processCloseTrade();
|
||||
|
||||
// edit text/list
|
||||
void processEditText(uint id, int itemId, int maxLength, const std::string& text, const std::string& writter, const std::string& date);
|
||||
void processEditText(uint id, int itemId, int maxLength, const std::string& text, const std::string& writer, const std::string& date);
|
||||
void processEditList(uint id, int doorId, const std::string& text);
|
||||
|
||||
// questlog
|
||||
@@ -132,7 +132,7 @@ protected:
|
||||
void processQuestLine(int questId, const std::vector<std::tuple<std::string, std::string> >& questMissions);
|
||||
|
||||
// modal dialogs >= 970
|
||||
void processModalDialog(uint32 id, std::string title, std::string message, int enterId, std::string enterText, int escapeId, std::string escapeText, std::vector<std::tuple<int, std::string> > choiceList);
|
||||
void processModalDialog(uint32 id, std::string title, std::string message, std::vector<std::tuple<int, std::string> > buttonList, int enterButton, int escapeButton, std::vector<std::tuple<int, std::string> > choiceList, bool priority);
|
||||
|
||||
friend class ProtocolGame;
|
||||
friend class Map;
|
||||
@@ -211,9 +211,11 @@ public:
|
||||
void setChaseMode(Otc::ChaseModes chaseMode);
|
||||
void setFightMode(Otc::FightModes fightMode);
|
||||
void setSafeFight(bool on);
|
||||
void setPVPMode(Otc::PVPModes pvpMode);
|
||||
Otc::ChaseModes getChaseMode() { return m_chaseMode; }
|
||||
Otc::FightModes getFightMode() { return m_fightMode; }
|
||||
bool isSafeFight() { return m_safeFight; }
|
||||
Otc::PVPModes getPVPMode() { return m_pvpMode; }
|
||||
|
||||
// npc trade related
|
||||
void inspectNpcTrade(const ItemPtr& item);
|
||||
@@ -287,7 +289,7 @@ public:
|
||||
bool isFollowing() { return !!m_followingCreature; }
|
||||
bool isConnectionOk() { return m_protocolGame && m_protocolGame->getElapsedTicksSinceLastRead() < 5000; }
|
||||
|
||||
int getPing() { return m_ping >= 0 ? std::max(m_ping, m_pingTimer.elapsed_millis()) : -1; }
|
||||
int getPing() { return m_ping >= 0 ? std::max<int>(m_ping, m_pingTimer.elapsed_millis()) : -1; }
|
||||
ContainerPtr getContainer(int index) { return m_containers[index]; }
|
||||
std::map<int, ContainerPtr> getContainers() { return m_containers; }
|
||||
std::map<int, Vip> getVips() { return m_vips; }
|
||||
@@ -336,6 +338,7 @@ private:
|
||||
int m_pingDelay;
|
||||
Otc::FightModes m_fightMode;
|
||||
Otc::ChaseModes m_chaseMode;
|
||||
Otc::PVPModes m_pvpMode;
|
||||
Otc::Direction m_lastWalkDir;
|
||||
bool m_safeFight;
|
||||
bool m_canReportBugs;
|
||||
|
@@ -221,6 +221,17 @@ void Item::serializeItem(const OutputBinaryTreePtr& out)
|
||||
out->addU16(uid);
|
||||
}
|
||||
|
||||
std::string text = getText();
|
||||
if(g_things.getItemType(m_serverId)->isWritable() && !text.empty()) {
|
||||
out->addU8(ATTR_TEXT);
|
||||
out->addString(text);
|
||||
}
|
||||
std::string desc = getDescription();
|
||||
if(!desc.empty()) {
|
||||
out->addU8(ATTR_DESC);
|
||||
out->addString(desc);
|
||||
}
|
||||
|
||||
out->endNode();
|
||||
for(auto i : m_containerItems)
|
||||
i->serializeItem(out);
|
||||
|
@@ -109,9 +109,19 @@ public:
|
||||
void setDoorId(uint8 doorId) { m_attribs.set(ATTR_HOUSEDOORID, doorId); }
|
||||
uint8 getDoorId() { return m_attribs.get<uint8>(ATTR_HOUSEDOORID); }
|
||||
|
||||
uint16 getUniqueId() { return m_attribs.get<uint16>(ATTR_ACTION_ID); }
|
||||
uint16 getActionId() { return m_attribs.get<uint16>(ATTR_UNIQUE_ID); }
|
||||
void setActionId(uint16 actionId) { m_attribs.set(ATTR_ACTION_ID, actionId); }
|
||||
void setUniqueId(uint16 uniqueId) { m_attribs.set(ATTR_UNIQUE_ID, uniqueId); }
|
||||
|
||||
std::string getText() { return m_attribs.get<std::string>(ATTR_TEXT); }
|
||||
std::string getDescription() { return m_attribs.get<std::string>(ATTR_DESC); }
|
||||
void setDescription(std::string desc) { m_attribs.set(ATTR_DESC, desc); }
|
||||
void setText(std::string txt) { m_attribs.set(ATTR_TEXT, txt); }
|
||||
|
||||
Position getTeleportDestination() { return m_attribs.get<Position>(ATTR_TELE_DEST); }
|
||||
void setTeleportDestination(const Position& pos) { m_attribs.set(ATTR_TELE_DEST, pos); }
|
||||
|
||||
void setAsync(bool enable) { m_async = enable; }
|
||||
|
||||
bool isHouseDoor() { return m_attribs.has(ATTR_HOUSEDOORID); }
|
||||
@@ -126,7 +136,11 @@ public:
|
||||
ItemPtr asItem() { return static_self_cast<Item>(); }
|
||||
bool isItem() { return true; }
|
||||
|
||||
ItemVector getContainerItems() { return m_containerItems; }
|
||||
ItemPtr getContainerItem(int slot) { return m_containerItems[slot]; }
|
||||
void addContainerItemIndexed(const ItemPtr& i, int slot) { m_containerItems[slot] = i; }
|
||||
void addContainerItem(const ItemPtr& i) { m_containerItems.push_back(i); }
|
||||
void removeContainerItem(int slot) { m_containerItems[slot] = nullptr; }
|
||||
void clearContainerItems() { m_containerItems.clear(); }
|
||||
|
||||
void calculatePatterns(int& xPattern, int& yPattern, int& zPattern);
|
||||
@@ -141,7 +155,7 @@ private:
|
||||
uint16 m_serverId;
|
||||
uint8 m_countOrSubType;
|
||||
stdext::packed_storage<uint8> m_attribs;
|
||||
ItemList m_containerItems;
|
||||
ItemVector m_containerItems;
|
||||
Color m_color;
|
||||
bool m_async;
|
||||
|
||||
|
@@ -82,6 +82,9 @@ void ItemType::unserialize(const BinaryTreePtr& node)
|
||||
case ItemTypeAttrName:
|
||||
setName(node->getString(len));
|
||||
break;
|
||||
case ItemTypeAttrWritable:
|
||||
m_attribs.set(ItemTypeAttrWritable, true);
|
||||
break;
|
||||
default:
|
||||
node->skip(len); // skip attribute
|
||||
break;
|
||||
|
@@ -148,6 +148,7 @@ public:
|
||||
std::string getDesc() { return m_attribs.get<std::string>(ItemTypeAttrDesc); }
|
||||
|
||||
bool isNull() { return m_null; }
|
||||
bool isWritable() { return m_attribs.get<bool>(ItemTypeAttrWritable); }
|
||||
|
||||
private:
|
||||
ItemCategory m_category;
|
||||
|
@@ -50,7 +50,7 @@ TexturePtr LightView::generateLightBubble(float centerFactor)
|
||||
for(int x = 0; x < bubbleDiameter; x++) {
|
||||
for(int y = 0; y < bubbleDiameter; y++) {
|
||||
float radius = std::sqrt((bubbleRadius - x)*(bubbleRadius - x) + (bubbleRadius - y)*(bubbleRadius - y));
|
||||
float intensity = std::max(std::min((bubbleRadius-radius)/(float)(bubbleRadius-centerRadius), 1.0f), 0.0f);
|
||||
float intensity = stdext::clamp<float>((bubbleRadius - radius) / (float)(bubbleRadius - centerRadius), 0.0f, 1.0f);
|
||||
|
||||
// light intensity varies inversely with the square of the distance
|
||||
intensity = intensity * intensity;
|
||||
|
@@ -58,7 +58,7 @@ LocalPlayer::LocalPlayer()
|
||||
|
||||
void LocalPlayer::lockWalk(int millis)
|
||||
{
|
||||
m_walkLockExpiration = std::max(m_walkLockExpiration, (ticks_t) g_clock.millis() + millis);
|
||||
m_walkLockExpiration = std::max<int>(m_walkLockExpiration, (ticks_t) g_clock.millis() + millis);
|
||||
}
|
||||
|
||||
bool LocalPlayer::canWalk(Otc::Direction direction)
|
||||
@@ -263,7 +263,7 @@ void LocalPlayer::updateWalk()
|
||||
{
|
||||
int stepDuration = getStepDuration();
|
||||
float walkTicksPerPixel = getStepDuration(true) / 32.0f;
|
||||
int totalPixelsWalked = std::min(m_walkTimer.ticksElapsed() / walkTicksPerPixel, 32.0f);
|
||||
int totalPixelsWalked = std::min<int>(m_walkTimer.ticksElapsed() / walkTicksPerPixel, 32.0f);
|
||||
|
||||
// update walk animation and offsets
|
||||
updateWalkAnimation(totalPixelsWalked);
|
||||
|
@@ -127,6 +127,8 @@ void Client::registerLuaFunctions()
|
||||
g_lua.bindSingletonFunction("g_map", "getSpawnFile", &Map::getSpawnFile, &g_map);
|
||||
g_lua.bindSingletonFunction("g_map", "setSpawnFile", &Map::setSpawnFile, &g_map);
|
||||
g_lua.bindSingletonFunction("g_map", "createTile", &Map::createTile, &g_map);
|
||||
g_lua.bindSingletonFunction("g_map", "setWidth", &Map::setWidth, &g_map);
|
||||
g_lua.bindSingletonFunction("g_map", "setHeight", &Map::setHeight, &g_map);
|
||||
g_lua.bindSingletonFunction("g_map", "getSize", &Map::getSize, &g_map);
|
||||
g_lua.bindSingletonFunction("g_map", "setDescription", &Map::setDescription, &g_map);
|
||||
g_lua.bindSingletonFunction("g_map", "getDescriptions", &Map::getDescriptions, &g_map);
|
||||
@@ -139,6 +141,10 @@ void Client::registerLuaFunctions()
|
||||
g_lua.bindSingletonFunction("g_map", "getZoneColor", &Map::getZoneColor, &g_map);
|
||||
g_lua.bindSingletonFunction("g_map", "showZones", &Map::showZones, &g_map);
|
||||
g_lua.bindSingletonFunction("g_map", "showZone", &Map::showZone, &g_map);
|
||||
g_lua.bindSingletonFunction("g_map", "setForceShowAnimations", &Map::setForceShowAnimations, &g_map);
|
||||
g_lua.bindSingletonFunction("g_map", "isForcingAnimations", &Map::isForcingAnimations, &g_map);
|
||||
g_lua.bindSingletonFunction("g_map", "isShowingAnimations", &Map::isShowingAnimations, &g_map);
|
||||
g_lua.bindSingletonFunction("g_map", "setShowAnimations", &Map::setShowAnimations, &g_map);
|
||||
g_lua.bindSingletonFunction("g_map", "beginGhostMode", &Map::beginGhostMode, &g_map);
|
||||
g_lua.bindSingletonFunction("g_map", "endGhostMode", &Map::endGhostMode, &g_map);
|
||||
g_lua.bindSingletonFunction("g_map", "findItemsById", &Map::findItemsById, &g_map);
|
||||
@@ -155,6 +161,7 @@ void Client::registerLuaFunctions()
|
||||
g_lua.bindSingletonFunction("g_creatures", "getCreatureByName", &CreatureManager::getCreatureByName, &g_creatures);
|
||||
g_lua.bindSingletonFunction("g_creatures", "getCreatureByLook", &CreatureManager::getCreatureByLook, &g_creatures);
|
||||
g_lua.bindSingletonFunction("g_creatures", "getSpawn", &CreatureManager::getSpawn, &g_creatures);
|
||||
g_lua.bindSingletonFunction("g_creatures", "getSpawnForPlacePos", &CreatureManager::getSpawnForPlacePos, &g_creatures);
|
||||
g_lua.bindSingletonFunction("g_creatures", "addSpawn", &CreatureManager::addSpawn, &g_creatures);
|
||||
g_lua.bindSingletonFunction("g_creatures", "loadMonsters", &CreatureManager::loadMonsters, &g_creatures);
|
||||
g_lua.bindSingletonFunction("g_creatures", "loadNpcs", &CreatureManager::loadNpcs, &g_creatures);
|
||||
@@ -218,9 +225,11 @@ void Client::registerLuaFunctions()
|
||||
g_lua.bindSingletonFunction("g_game", "removeVip", &Game::removeVip, &g_game);
|
||||
g_lua.bindSingletonFunction("g_game", "setChaseMode", &Game::setChaseMode, &g_game);
|
||||
g_lua.bindSingletonFunction("g_game", "setFightMode", &Game::setFightMode, &g_game);
|
||||
g_lua.bindSingletonFunction("g_game", "setPVPMode", &Game::setPVPMode, &g_game);
|
||||
g_lua.bindSingletonFunction("g_game", "setSafeFight", &Game::setSafeFight, &g_game);
|
||||
g_lua.bindSingletonFunction("g_game", "getChaseMode", &Game::getChaseMode, &g_game);
|
||||
g_lua.bindSingletonFunction("g_game", "getFightMode", &Game::getFightMode, &g_game);
|
||||
g_lua.bindSingletonFunction("g_game", "getPVPMode", &Game::getPVPMode, &g_game);
|
||||
g_lua.bindSingletonFunction("g_game", "isSafeFight", &Game::isSafeFight, &g_game);
|
||||
g_lua.bindSingletonFunction("g_game", "inspectNpcTrade", &Game::inspectNpcTrade, &g_game);
|
||||
g_lua.bindSingletonFunction("g_game", "buyItem", &Game::buyItem, &g_game);
|
||||
@@ -442,6 +451,7 @@ void Client::registerLuaFunctions()
|
||||
g_lua.registerClass<ItemType>();
|
||||
g_lua.bindClassMemberFunction<ItemType>("getServerId", &ItemType::getServerId);
|
||||
g_lua.bindClassMemberFunction<ItemType>("getClientId", &ItemType::getClientId);
|
||||
g_lua.bindClassMemberFunction<ItemType>("isWritable", &ItemType::isWritable);
|
||||
|
||||
g_lua.registerClass<ThingType>();
|
||||
g_lua.bindClassMemberFunction<ThingType>("getId", &ThingType::getId);
|
||||
@@ -453,11 +463,29 @@ void Client::registerLuaFunctions()
|
||||
g_lua.bindClassStaticFunction<Item>("create", &Item::create);
|
||||
g_lua.bindClassStaticFunction<Item>("createOtb", &Item::createFromOtb);
|
||||
g_lua.bindClassMemberFunction<Item>("clone", &Item::clone);
|
||||
g_lua.bindClassMemberFunction<Item>("getContainerItems", &Item::getContainerItems);
|
||||
g_lua.bindClassMemberFunction<Item>("getContainerItem", &Item::getContainerItem);
|
||||
g_lua.bindClassMemberFunction<Item>("addContainerItem", &Item::addContainerItem);
|
||||
g_lua.bindClassMemberFunction<Item>("addContainerItemIndexed", &Item::addContainerItemIndexed);
|
||||
g_lua.bindClassMemberFunction<Item>("removeContainerItem", &Item::removeContainerItem);
|
||||
g_lua.bindClassMemberFunction<Item>("clearContainerItems", &Item::clearContainerItems);
|
||||
g_lua.bindClassMemberFunction<Item>("getContainerItem", &Item::getContainerItem);
|
||||
g_lua.bindClassMemberFunction<Item>("setCount", &Item::setCount);
|
||||
g_lua.bindClassMemberFunction<Item>("getCount", &Item::getCount);
|
||||
g_lua.bindClassMemberFunction<Item>("getSubType", &Item::getSubType);
|
||||
g_lua.bindClassMemberFunction<Item>("getId", &Item::getId);
|
||||
g_lua.bindClassMemberFunction<Item>("getServerId", &Item::getServerId);
|
||||
g_lua.bindClassMemberFunction<Item>("getName", &Item::getName);
|
||||
g_lua.bindClassMemberFunction<Item>("getDescription", &Item::getDescription);
|
||||
g_lua.bindClassMemberFunction<Item>("getText", &Item::getText);
|
||||
g_lua.bindClassMemberFunction<Item>("setDescription", &Item::setDescription);
|
||||
g_lua.bindClassMemberFunction<Item>("setText", &Item::setText);
|
||||
g_lua.bindClassMemberFunction<Item>("getUniqueId", &Item::getUniqueId);
|
||||
g_lua.bindClassMemberFunction<Item>("getActionId", &Item::getActionId);
|
||||
g_lua.bindClassMemberFunction<Item>("setUniqueId", &Item::setUniqueId);
|
||||
g_lua.bindClassMemberFunction<Item>("setActionId", &Item::setActionId);
|
||||
g_lua.bindClassMemberFunction<Item>("getTeleportDestination", &Item::getTeleportDestination);
|
||||
g_lua.bindClassMemberFunction<Item>("setTeleportDestination", &Item::setTeleportDestination);
|
||||
g_lua.bindClassMemberFunction<Item>("isStackable", &Item::isStackable);
|
||||
g_lua.bindClassMemberFunction<Item>("isMarketable", &Item::isMarketable);
|
||||
g_lua.bindClassMemberFunction<Item>("isFluidContainer", &Item::isFluidContainer);
|
||||
@@ -557,6 +585,10 @@ void Client::registerLuaFunctions()
|
||||
g_lua.bindClassMemberFunction<Tile>("isClickable", &Tile::isClickable);
|
||||
g_lua.bindClassMemberFunction<Tile>("isPathable", &Tile::isPathable);
|
||||
g_lua.bindClassMemberFunction<Tile>("overwriteMinimapColor", &Tile::overwriteMinimapColor);
|
||||
g_lua.bindClassMemberFunction<Tile>("select", &Tile::select);
|
||||
g_lua.bindClassMemberFunction<Tile>("unselect", &Tile::unselect);
|
||||
g_lua.bindClassMemberFunction<Tile>("isSelected", &Tile::isSelected);
|
||||
g_lua.bindClassMemberFunction<Tile>("remFlag", &Tile::remFlag);
|
||||
g_lua.bindClassMemberFunction<Tile>("setFlag", &Tile::setFlag);
|
||||
g_lua.bindClassMemberFunction<Tile>("setFlags", &Tile::setFlags);
|
||||
g_lua.bindClassMemberFunction<Tile>("getFlags", &Tile::getFlags);
|
||||
@@ -605,6 +637,8 @@ void Client::registerLuaFunctions()
|
||||
g_lua.bindClassMemberFunction<UIMap>("setMaxZoomIn", &UIMap::setMaxZoomIn);
|
||||
g_lua.bindClassMemberFunction<UIMap>("setMaxZoomOut", &UIMap::setMaxZoomOut);
|
||||
g_lua.bindClassMemberFunction<UIMap>("setMultifloor", &UIMap::setMultifloor);
|
||||
g_lua.bindClassMemberFunction<UIMap>("lockVisibleFloor", &UIMap::lockVisibleFloor);
|
||||
g_lua.bindClassMemberFunction<UIMap>("unlockVisibleFloor", &UIMap::unlockVisibleFloor);
|
||||
g_lua.bindClassMemberFunction<UIMap>("setVisibleDimension", &UIMap::setVisibleDimension);
|
||||
g_lua.bindClassMemberFunction<UIMap>("setViewMode", &UIMap::setViewMode);
|
||||
g_lua.bindClassMemberFunction<UIMap>("setAutoViewMode", &UIMap::setAutoViewMode);
|
||||
|
@@ -25,13 +25,15 @@
|
||||
|
||||
int push_luavalue(const Outfit& outfit)
|
||||
{
|
||||
g_lua.newTable();
|
||||
g_lua.createTable(0, 8);
|
||||
g_lua.pushInteger(outfit.getId());
|
||||
g_lua.setField("type");
|
||||
g_lua.pushInteger(outfit.getAuxId());
|
||||
g_lua.setField("auxType");
|
||||
g_lua.pushInteger(outfit.getAddons());
|
||||
g_lua.setField("addons");
|
||||
if(g_game.getFeature(Otc::GamePlayerAddons)) {
|
||||
g_lua.pushInteger(outfit.getAddons());
|
||||
g_lua.setField("addons");
|
||||
}
|
||||
g_lua.pushInteger(outfit.getHead());
|
||||
g_lua.setField("head");
|
||||
g_lua.pushInteger(outfit.getBody());
|
||||
@@ -54,8 +56,10 @@ bool luavalue_cast(int index, Outfit& outfit)
|
||||
outfit.setId(g_lua.popInteger());
|
||||
g_lua.getField("auxType", index);
|
||||
outfit.setAuxId(g_lua.popInteger());
|
||||
g_lua.getField("addons", index);
|
||||
outfit.setAddons(g_lua.popInteger());
|
||||
if(g_game.getFeature(Otc::GamePlayerAddons)) {
|
||||
g_lua.getField("addons", index);
|
||||
outfit.setAddons(g_lua.popInteger());
|
||||
}
|
||||
g_lua.getField("head", index);
|
||||
outfit.setHead(g_lua.popInteger());
|
||||
g_lua.getField("body", index);
|
||||
@@ -76,7 +80,7 @@ bool luavalue_cast(int index, Outfit& outfit)
|
||||
int push_luavalue(const Position& pos)
|
||||
{
|
||||
if(pos.isValid()) {
|
||||
g_lua.newTable();
|
||||
g_lua.createTable(0, 3);
|
||||
g_lua.pushInteger(pos.x);
|
||||
g_lua.setField("x");
|
||||
g_lua.pushInteger(pos.y);
|
||||
@@ -104,7 +108,7 @@ bool luavalue_cast(int index, Position& pos)
|
||||
|
||||
int push_luavalue(const MarketData& data)
|
||||
{
|
||||
g_lua.newTable();
|
||||
g_lua.createTable(0, 6);
|
||||
g_lua.pushInteger(data.category);
|
||||
g_lua.setField("category");
|
||||
g_lua.pushString(data.name);
|
||||
|
@@ -39,6 +39,7 @@ TilePtr Map::m_nulltile;
|
||||
void Map::init()
|
||||
{
|
||||
resetAwareRange();
|
||||
m_animationFlags |= Animation_Show;
|
||||
}
|
||||
|
||||
void Map::terminate()
|
||||
@@ -138,7 +139,7 @@ void Map::addThing(const ThingPtr& thing, const Position& pos, int stackPos)
|
||||
int y = 12 - 48 * t / (float)Otc::ANIMATED_TEXT_DURATION;
|
||||
offset += Point(0, y);
|
||||
}
|
||||
offset.y = std::min(offset.y, 12);
|
||||
offset.y = std::min<int>(offset.y, 12);
|
||||
animatedText->setOffset(offset);
|
||||
}
|
||||
m_animatedTexts.push_back(animatedText);
|
||||
@@ -179,34 +180,34 @@ bool Map::removeThing(const ThingPtr& thing)
|
||||
if(!thing)
|
||||
return false;
|
||||
|
||||
notificateTileUpdate(thing->getPosition());
|
||||
|
||||
bool ret = false;
|
||||
if(thing->isMissile()) {
|
||||
MissilePtr missile = thing->static_self_cast<Missile>();
|
||||
int z = missile->getPosition().z;
|
||||
auto it = std::find(m_floorMissiles[z].begin(), m_floorMissiles[z].end(), missile);
|
||||
if(it != m_floorMissiles[z].end()) {
|
||||
m_floorMissiles[z].erase(it);
|
||||
return true;
|
||||
ret = true;
|
||||
}
|
||||
} else if(thing->isAnimatedText()) {
|
||||
AnimatedTextPtr animatedText = thing->static_self_cast<AnimatedText>();
|
||||
auto it = std::find(m_animatedTexts.begin(), m_animatedTexts.end(), animatedText);
|
||||
if(it != m_animatedTexts.end()) {
|
||||
m_animatedTexts.erase(it);
|
||||
return true;
|
||||
ret = true;
|
||||
}
|
||||
} else if(thing->isStaticText()) {
|
||||
StaticTextPtr staticText = thing->static_self_cast<StaticText>();
|
||||
auto it = std::find(m_staticTexts.begin(), m_staticTexts.end(), staticText);
|
||||
if(it != m_staticTexts.end()) {
|
||||
m_staticTexts.erase(it);
|
||||
return true;
|
||||
ret = true;
|
||||
}
|
||||
} else if(const TilePtr& tile = thing->getTile())
|
||||
return tile->removeThing(thing);
|
||||
ret = tile->removeThing(thing);
|
||||
|
||||
return false;
|
||||
notificateTileUpdate(thing->getPosition());
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool Map::removeThingByPos(const Position& pos, int stackPos)
|
||||
@@ -363,6 +364,34 @@ void Map::setZoneColor(tileflags_t zone, const Color& color)
|
||||
m_zoneColors[zone] = color;
|
||||
}
|
||||
|
||||
void Map::setForceShowAnimations(bool force)
|
||||
{
|
||||
if(force) {
|
||||
if(!(m_animationFlags & Animation_Force))
|
||||
m_animationFlags |= Animation_Force;
|
||||
} else
|
||||
m_animationFlags &= ~Animation_Force;
|
||||
}
|
||||
|
||||
bool Map::isForcingAnimations()
|
||||
{
|
||||
return (m_animationFlags & Animation_Force) == Animation_Force;
|
||||
}
|
||||
|
||||
bool Map::isShowingAnimations()
|
||||
{
|
||||
return (m_animationFlags & Animation_Show) == Animation_Show;
|
||||
}
|
||||
|
||||
void Map::setShowAnimations(bool show)
|
||||
{
|
||||
if(show) {
|
||||
if(!(m_animationFlags & Animation_Show))
|
||||
m_animationFlags |= Animation_Show;
|
||||
} else
|
||||
m_animationFlags &= ~Animation_Show;
|
||||
}
|
||||
|
||||
void Map::beginGhostMode(float opacity)
|
||||
{
|
||||
g_painter->setOpacity(opacity);
|
||||
@@ -615,7 +644,7 @@ int Map::getFirstAwareFloor()
|
||||
int Map::getLastAwareFloor()
|
||||
{
|
||||
if(m_centralPosition.z > Otc::SEA_FLOOR)
|
||||
return std::min(m_centralPosition.z+Otc::AWARE_UNDEGROUND_FLOOR_RANGE, (int)Otc::MAX_Z);
|
||||
return std::min<int>(m_centralPosition.z+Otc::AWARE_UNDEGROUND_FLOOR_RANGE, (int)Otc::MAX_Z);
|
||||
else
|
||||
return Otc::SEA_FLOOR;
|
||||
}
|
||||
|
@@ -93,6 +93,11 @@ enum {
|
||||
BLOCK_SIZE = 32
|
||||
};
|
||||
|
||||
enum : uint8 {
|
||||
Animation_Force,
|
||||
Animation_Show
|
||||
};
|
||||
|
||||
class TileBlock {
|
||||
public:
|
||||
TileBlock() { m_tiles.fill(nullptr); }
|
||||
@@ -151,6 +156,7 @@ public:
|
||||
void setHouseFile(const std::string& file) { m_attribs.set(OTBM_ATTR_HOUSE_FILE, file); }
|
||||
void setSpawnFile(const std::string& file) { m_attribs.set(OTBM_ATTR_SPAWN_FILE, file); }
|
||||
void setDescription(const std::string& desc) { m_attribs.set(OTBM_ATTR_DESCRIPTION, desc); }
|
||||
|
||||
void clearDescriptions() { m_attribs.remove(OTBM_ATTR_DESCRIPTION); }
|
||||
void setWidth(uint16 w) { m_attribs.set(OTBM_ATTR_WIDTH, w); }
|
||||
void setHeight(uint16 h) { m_attribs.set(OTBM_ATTR_HEIGHT, h); }
|
||||
@@ -194,6 +200,11 @@ public:
|
||||
bool showZones() { return m_zoneFlags != 0; }
|
||||
bool showZone(tileflags_t zone) { return (m_zoneFlags & zone) == zone; }
|
||||
|
||||
void setForceShowAnimations(bool force);
|
||||
bool isForcingAnimations();
|
||||
bool isShowingAnimations();
|
||||
void setShowAnimations(bool show);
|
||||
|
||||
void beginGhostMode(float opacity);
|
||||
void endGhostMode();
|
||||
|
||||
@@ -243,6 +254,7 @@ private:
|
||||
std::vector<MapViewPtr> m_mapViews;
|
||||
std::unordered_map<Position, std::string, PositionHasher> m_waypoints;
|
||||
|
||||
uint8 m_animationFlags;
|
||||
uint32 m_zoneFlags;
|
||||
std::array<Color, TILESTATE_LAST> m_zoneColors;
|
||||
float m_zoneOpacity;
|
||||
|
@@ -35,16 +35,20 @@
|
||||
void Map::loadOtbm(const std::string& fileName)
|
||||
{
|
||||
try {
|
||||
FileStreamPtr fin = g_resources.openFile(fileName);
|
||||
if(!fin)
|
||||
stdext::throw_exception(stdext::format("Unable to load map '%s'", fileName));
|
||||
|
||||
fin->cache();
|
||||
if(!g_things.isOtbLoaded())
|
||||
stdext::throw_exception("OTB isn't loaded yet to load a map.");
|
||||
|
||||
if(fin->getU32())
|
||||
stdext::throw_exception("Unknown file version detected");
|
||||
FileStreamPtr fin = g_resources.openFile(fileName);
|
||||
if(!fin)
|
||||
stdext::throw_exception(stdext::format("Unable to load map '%s'", fileName));
|
||||
fin->cache();
|
||||
|
||||
char identifier[4];
|
||||
if(fin->read(identifier, 1, 4) < 4)
|
||||
stdext::throw_exception("Could not read file identifier");
|
||||
|
||||
if(memcmp(identifier, "OTBM", 4) != 0 && memcmp(identifier, "\0\0\0\0", 4) != 0)
|
||||
stdext::throw_exception(stdext::format("Invalid file identifier detected: %s", identifier));
|
||||
|
||||
BinaryTreePtr root = fin->getBinaryTree();
|
||||
if(root->getU8())
|
||||
@@ -109,7 +113,7 @@ void Map::loadOtbm(const std::string& fileName)
|
||||
uint32 flags = TILESTATE_NONE;
|
||||
Position pos = basePos + nodeTile->getPoint();
|
||||
|
||||
if(type == OTBM_HOUSETILE) {
|
||||
if(type == OTBM_HOUSETILE) {
|
||||
uint32 hId = nodeTile->getU32();
|
||||
TilePtr tile = getOrCreateTile(pos);
|
||||
if(!(house = g_houses.getHouse(hId))) {
|
||||
@@ -136,9 +140,6 @@ void Map::loadOtbm(const std::string& fileName)
|
||||
|
||||
if((_flags & TILESTATE_REFRESH) == TILESTATE_REFRESH)
|
||||
flags |= TILESTATE_REFRESH;
|
||||
|
||||
if((_flags & TILESTATE_HOUSE) == TILESTATE_HOUSE)
|
||||
flags |= TILESTATE_HOUSE;
|
||||
break;
|
||||
}
|
||||
case OTBM_ATTR_ITEM: {
|
||||
@@ -179,9 +180,9 @@ void Map::loadOtbm(const std::string& fileName)
|
||||
}
|
||||
|
||||
if(const TilePtr& tile = getTile(pos)) {
|
||||
if(tile->hasFlag(TILESTATE_HOUSE))
|
||||
tile->setFlags(tile->getFlags() & ~TILESTATE_HOUSE);
|
||||
tile->setFlags((tileflags_t)flags);
|
||||
if(house)
|
||||
tile->setFlag(TILESTATE_HOUSE);
|
||||
tile->setFlag(flags);
|
||||
}
|
||||
}
|
||||
} else if(mapDataType == OTBM_TOWNS) {
|
||||
@@ -283,21 +284,12 @@ void Map::saveOtbm(const std::string& fileName)
|
||||
|
||||
root->startNode(OTBM_MAP_DATA);
|
||||
{
|
||||
// own description.
|
||||
for(const auto& desc : getDescriptions()) {
|
||||
root->addU8(OTBM_ATTR_DESCRIPTION);
|
||||
root->addString(desc);
|
||||
}
|
||||
|
||||
// special one
|
||||
root->addU8(OTBM_ATTR_DESCRIPTION);
|
||||
root->addString(stdext::format("Saved with %s v%s", g_app.getName(), g_app.getVersion()));
|
||||
root->addString(m_attribs.get<std::string>(OTBM_ATTR_DESCRIPTION));
|
||||
|
||||
// spawn file.
|
||||
root->addU8(OTBM_ATTR_SPAWN_FILE);
|
||||
root->addString(spawnFile);
|
||||
|
||||
// house file.
|
||||
root->addU8(OTBM_ATTR_HOUSE_FILE);
|
||||
root->addString(houseFile);
|
||||
|
||||
|
@@ -85,11 +85,22 @@ void MapView::draw(const Rect& rect)
|
||||
Position cameraPosition = getCameraPosition();
|
||||
|
||||
int drawFlags = 0;
|
||||
// First branch:
|
||||
// This is unlikely to be false because a lot of us
|
||||
// don't wanna hear their GPU fan while playing a
|
||||
// 2D game.
|
||||
//
|
||||
// Second & Third branch:
|
||||
// This is likely to be true since not many people have
|
||||
// low-end graphics cards.
|
||||
if(unlikely(g_map.isForcingAnimations()) || (likely(g_map.isShowingAnimations()) && m_viewMode == NEAR_VIEW))
|
||||
drawFlags = Otc::DrawAnimations;
|
||||
|
||||
if(m_viewMode == NEAR_VIEW)
|
||||
drawFlags = Otc::DrawGround | Otc::DrawGroundBorders | Otc::DrawWalls |
|
||||
Otc::DrawItems | Otc::DrawCreatures | Otc::DrawEffects | Otc::DrawMissiles | Otc::DrawAnimations;
|
||||
drawFlags |= Otc::DrawGround | Otc::DrawGroundBorders | Otc::DrawWalls |
|
||||
Otc::DrawItems | Otc::DrawCreatures | Otc::DrawEffects | Otc::DrawMissiles;
|
||||
else
|
||||
drawFlags = Otc::DrawGround | Otc::DrawGroundBorders | Otc::DrawWalls | Otc::DrawItems;
|
||||
drawFlags |= Otc::DrawGround | Otc::DrawGroundBorders | Otc::DrawWalls | Otc::DrawItems;
|
||||
|
||||
if(m_mustDrawVisibleTilesCache || (drawFlags & Otc::DrawAnimations)) {
|
||||
m_framebuffer->bind();
|
||||
@@ -159,7 +170,7 @@ void MapView::draw(const Rect& rect)
|
||||
}
|
||||
|
||||
if(m_shaderSwitchDone && m_shader && m_fadeInTime > 0)
|
||||
fadeOpacity = std::min(m_fadeTimer.timeElapsed() / m_fadeInTime, 1.0f);
|
||||
fadeOpacity = std::min<float>(m_fadeTimer.timeElapsed() / m_fadeInTime, 1.0f);
|
||||
|
||||
Rect srcRect = calcFramebufferSource(rect.size());
|
||||
Point drawOffset = srcRect.topLeft();
|
||||
@@ -311,7 +322,7 @@ void MapView::updateVisibleTilesCache(int start)
|
||||
// loop through / diagonals beginning at top left and going to top right
|
||||
for(int diagonal = 0; diagonal < numDiagonals && !stop; ++diagonal) {
|
||||
// loop current diagonal tiles
|
||||
int advance = std::max(diagonal - m_drawDimension.height(), 0);
|
||||
int advance = std::max<int>(diagonal - m_drawDimension.height(), 0);
|
||||
for(int iy = diagonal - advance, ix = advance; iy >= 0 && ix < m_drawDimension.width() && !stop; --iy, ++ix) {
|
||||
// only start really looking tiles in the desired start
|
||||
if(m_updateTilesPos < start) {
|
||||
@@ -364,10 +375,10 @@ void MapView::updateVisibleTilesCache(int start)
|
||||
};
|
||||
|
||||
for(int i=0;i<4;++i) {
|
||||
int sx = std::max(lines[i].left(), area.left());
|
||||
int ex = std::min(lines[i].right(), area.right());
|
||||
int sy = std::max(lines[i].top(), area.top());
|
||||
int ey = std::min(lines[i].bottom(), area.bottom());
|
||||
int sx = std::max<int>(lines[i].left(), area.left());
|
||||
int ex = std::min<int>(lines[i].right(), area.right());
|
||||
int sy = std::max<int>(lines[i].top(), area.top());
|
||||
int ey = std::min<int>(lines[i].bottom(), area.bottom());
|
||||
for(int qx=sx;qx<=ex;++qx)
|
||||
for(int qy=sy;qy<=ey;++qy)
|
||||
m_spiral[count++] = Point(qx, qy);
|
||||
@@ -566,8 +577,26 @@ Position MapView::getPosition(const Point& point, const Size& mapSize)
|
||||
|
||||
void MapView::move(int x, int y)
|
||||
{
|
||||
m_moveOffset.x = x;
|
||||
m_moveOffset.y = y;
|
||||
m_moveOffset.x += x;
|
||||
m_moveOffset.y += y;
|
||||
|
||||
int32_t tmp = m_moveOffset.x / 32;
|
||||
bool requestTilesUpdate = false;
|
||||
if(tmp != 0) {
|
||||
m_customCameraPosition.x += tmp;
|
||||
m_moveOffset.x %= 32;
|
||||
requestTilesUpdate = true;
|
||||
}
|
||||
|
||||
tmp = m_moveOffset.y / 32;
|
||||
if(tmp != 0) {
|
||||
m_customCameraPosition.y += tmp;
|
||||
m_moveOffset.y %= 32;
|
||||
requestTilesUpdate = true;
|
||||
}
|
||||
|
||||
if(requestTilesUpdate)
|
||||
requestVisibleTilesCacheUpdate();
|
||||
}
|
||||
|
||||
Rect MapView::calcFramebufferSource(const Size& destSize)
|
||||
@@ -608,7 +637,7 @@ int MapView::calcFirstVisibleFloor()
|
||||
|
||||
// limits to underground floors while under sea level
|
||||
if(cameraPosition.z > Otc::SEA_FLOOR)
|
||||
firstFloor = std::max(cameraPosition.z - Otc::AWARE_UNDEGROUND_FLOOR_RANGE, (int)Otc::UNDERGROUND_FLOOR);
|
||||
firstFloor = std::max<int>(cameraPosition.z - Otc::AWARE_UNDEGROUND_FLOOR_RANGE, (int)Otc::UNDERGROUND_FLOOR);
|
||||
|
||||
// loop in 3x3 tiles around the camera
|
||||
for(int ix = -1; ix <= 1 && firstFloor < cameraPosition.z; ++ix) {
|
||||
@@ -644,7 +673,7 @@ int MapView::calcFirstVisibleFloor()
|
||||
}
|
||||
|
||||
// just ensure the that the floor is in the valid range
|
||||
z = std::min(std::max(z, 0), (int)Otc::MAX_Z);
|
||||
z = stdext::clamp<int>(z, 0, (int)Otc::MAX_Z);
|
||||
return z;
|
||||
}
|
||||
|
||||
@@ -666,10 +695,10 @@ int MapView::calcLastVisibleFloor()
|
||||
}
|
||||
|
||||
if(m_lockedFirstVisibleFloor != -1)
|
||||
z = std::max(m_lockedFirstVisibleFloor, z);
|
||||
z = std::max<int>(m_lockedFirstVisibleFloor, z);
|
||||
|
||||
// just ensure the that the floor is in the valid range
|
||||
z = std::min(std::max(z, 0), (int)Otc::MAX_Z);
|
||||
z = stdext::clamp<int>(z, 0, (int)Otc::MAX_Z);
|
||||
return z;
|
||||
}
|
||||
|
||||
|
@@ -200,7 +200,7 @@ void Minimap::updateTile(const Position& pos, const TilePtr& tile)
|
||||
minimapTile.flags |= MinimapTileNotWalkable;
|
||||
if(!tile->isPathable())
|
||||
minimapTile.flags |= MinimapTileNotPathable;
|
||||
minimapTile.speed = std::min((int)std::ceil(tile->getGroundSpeed() / 10.0f), 255);
|
||||
minimapTile.speed = std::min<int>((int)std::ceil(tile->getGroundSpeed() / 10.0f), 255);
|
||||
}
|
||||
|
||||
if(minimapTile != MinimapTile()) {
|
||||
|
@@ -57,7 +57,7 @@ void buildMessageModesMap(int version) {
|
||||
messageModesMap[Otc::MessageFailure] = 20;
|
||||
messageModesMap[Otc::MessageBlue] = 21;
|
||||
messageModesMap[Otc::MessageRed] = 22;
|
||||
} else if(version >= 850) {
|
||||
} else if(version >= 840) {
|
||||
messageModesMap[Otc::MessageNone] = 0;
|
||||
messageModesMap[Otc::MessageSay] = 1;
|
||||
messageModesMap[Otc::MessageWhisper] = 2;
|
||||
|
@@ -145,7 +145,7 @@ namespace Proto {
|
||||
GameServerMarketLeave = 247, // 944
|
||||
GameServerMarketDetail = 248, // 944
|
||||
GameServerMarketBrowse = 249, // 944
|
||||
GameServerShowModalDialog = 250 // 960
|
||||
GameServerModalDialog = 250 // 960
|
||||
};
|
||||
|
||||
enum ClientOpcodes : uint8
|
||||
|
@@ -83,7 +83,7 @@ public:
|
||||
void sendCloseRuleViolation(const std::string& reporter);
|
||||
void sendCancelRuleViolation();
|
||||
void sendCloseNpcChannel();
|
||||
void sendChangeFightModes(Otc::FightModes fightMode, Otc::ChaseModes chaseMode, bool safeFight);
|
||||
void sendChangeFightModes(Otc::FightModes fightMode, Otc::ChaseModes chaseMode, bool safeFight, Otc::PVPModes pvpMode);
|
||||
void sendAttack(uint creatureId, uint seq);
|
||||
void sendFollow(uint creatureId, uint seq);
|
||||
void sendInviteToParty(uint creatureId);
|
||||
@@ -212,7 +212,7 @@ private:
|
||||
void parseChannelEvent(const InputMessagePtr& msg);
|
||||
void parseItemInfo(const InputMessagePtr& msg);
|
||||
void parsePlayerInventory(const InputMessagePtr& msg);
|
||||
void parseShowModalDialog(const InputMessagePtr& msg);
|
||||
void parseModalDialog(const InputMessagePtr& msg);
|
||||
void parseExtendedOpcode(const InputMessagePtr& msg);
|
||||
void parseChangeMapAwareRange(const InputMessagePtr& msg);
|
||||
void parseCreaturesMark(const InputMessagePtr& msg);
|
||||
|
@@ -316,8 +316,8 @@ void ProtocolGame::parseMessage(const InputMessagePtr& msg)
|
||||
parsePlayerInfo(msg);
|
||||
break;
|
||||
// PROTOCOL>=970
|
||||
case Proto::GameServerShowModalDialog:
|
||||
parseShowModalDialog(msg);
|
||||
case Proto::GameServerModalDialog:
|
||||
parseModalDialog(msg);
|
||||
break;
|
||||
// PROTOCOL>=980
|
||||
case Proto::GameServerLoginSuccess:
|
||||
@@ -407,7 +407,9 @@ void ProtocolGame::parseGMActions(const InputMessagePtr& msg)
|
||||
|
||||
int numViolationReasons;
|
||||
|
||||
if(g_game.getProtocolVersion() >= 850)
|
||||
if(g_game.getProtocolVersion() >= 840)
|
||||
numViolationReasons = 23;
|
||||
else if(g_game.getProtocolVersion() >= 850)
|
||||
numViolationReasons = 20;
|
||||
else
|
||||
numViolationReasons = 32;
|
||||
@@ -557,7 +559,7 @@ void ProtocolGame::parseTileAddThing(const InputMessagePtr& msg)
|
||||
Position pos = getPosition(msg);
|
||||
int stackPos = -1;
|
||||
|
||||
if(g_game.getProtocolVersion() >= 850)
|
||||
if(g_game.getProtocolVersion() >= 841)
|
||||
stackPos = msg->getU8();
|
||||
|
||||
ThingPtr thing = getThing(msg);
|
||||
@@ -995,10 +997,13 @@ void ProtocolGame::parseEditText(const InputMessagePtr& msg)
|
||||
|
||||
int maxLength = msg->getU16();
|
||||
std::string text = msg->getString();
|
||||
std::string writter = msg->getString();
|
||||
std::string date = msg->getString();
|
||||
|
||||
g_game.processEditText(id, itemId, maxLength, text, writter, date);
|
||||
std::string writer = msg->getString();
|
||||
std::string date = "";
|
||||
if(g_game.getFeature(Otc::GameWritableDate))
|
||||
date = msg->getString();
|
||||
|
||||
g_game.processEditText(id, itemId, maxLength, text, writer, date);
|
||||
}
|
||||
|
||||
void ProtocolGame::parseEditList(const InputMessagePtr& msg)
|
||||
@@ -1158,11 +1163,11 @@ void ProtocolGame::parsePlayerModes(const InputMessagePtr& msg)
|
||||
int chaseMode = msg->getU8();
|
||||
bool safeMode = msg->getU8();
|
||||
|
||||
//TODO: implement pvp modes
|
||||
int pvpMode = 0;
|
||||
if(g_game.getFeature(Otc::GamePVPMode))
|
||||
msg->getU8(); // pvp mode
|
||||
pvpMode = msg->getU8();
|
||||
|
||||
g_game.processPlayerModes((Otc::FightModes)fightMode, (Otc::ChaseModes)chaseMode, safeMode);
|
||||
g_game.processPlayerModes((Otc::FightModes)fightMode, (Otc::ChaseModes)chaseMode, safeMode, (Otc::PVPModes)pvpMode);
|
||||
}
|
||||
|
||||
void ProtocolGame::parseSpellCooldown(const InputMessagePtr& msg)
|
||||
@@ -1457,8 +1462,15 @@ void ProtocolGame::parseOpenOutfitWindow(const InputMessagePtr& msg)
|
||||
outfitList.push_back(std::make_tuple(outfitId, outfitName, outfitAddons));
|
||||
}
|
||||
} else {
|
||||
int outfitStart = msg->getU8();
|
||||
int outfitEnd = msg->getU8();
|
||||
int outfitStart, outfitEnd;
|
||||
if(g_game.getFeature(Otc::GameLooktypeU16)) {
|
||||
outfitStart = msg->getU16();
|
||||
outfitEnd = msg->getU16();
|
||||
} else {
|
||||
outfitStart = msg->getU8();
|
||||
outfitEnd = msg->getU8();
|
||||
}
|
||||
|
||||
for(int i = outfitStart; i <= outfitEnd; i++)
|
||||
outfitList.push_back(std::make_tuple(i, "", 0));
|
||||
}
|
||||
@@ -1596,18 +1608,18 @@ void ProtocolGame::parsePlayerInventory(const InputMessagePtr& msg)
|
||||
}
|
||||
}
|
||||
|
||||
void ProtocolGame::parseShowModalDialog(const InputMessagePtr& msg)
|
||||
void ProtocolGame::parseModalDialog(const InputMessagePtr& msg)
|
||||
{
|
||||
uint32 id = msg->getU32();
|
||||
std::string title = msg->getString();
|
||||
std::string message = msg->getString();
|
||||
|
||||
int sizeButtons = msg->getU8();
|
||||
std::map<int, std::string > buttonList;
|
||||
std::vector<std::tuple<int, std::string> > buttonList;
|
||||
for(int i = 0; i < sizeButtons; ++i) {
|
||||
std::string value = msg->getString();
|
||||
int id = msg->getU8();
|
||||
buttonList[id] = value;
|
||||
buttonList.push_back(std::make_tuple(id, value));
|
||||
}
|
||||
|
||||
int sizeChoices = msg->getU8();
|
||||
@@ -1628,21 +1640,9 @@ void ProtocolGame::parseShowModalDialog(const InputMessagePtr& msg)
|
||||
escapeButton = msg->getU8();
|
||||
}
|
||||
|
||||
msg->getU8(); // popup value (no clue what it is for)
|
||||
bool priority = msg->getU8() == 0x01;
|
||||
|
||||
std::map<int, std::string>::iterator itEnter = buttonList.find(enterButton);
|
||||
if(itEnter == buttonList.end()) {
|
||||
g_logger.info(stdext::format("Enter button does not exist for dialog id: %d", id));
|
||||
return;
|
||||
}
|
||||
|
||||
std::map<int, std::string >::iterator itEscape = buttonList.find(escapeButton);
|
||||
if(itEscape == buttonList.end()) {
|
||||
g_logger.info(stdext::format("Escape button does not exist for dialog id: %d", id));
|
||||
return;
|
||||
}
|
||||
|
||||
g_game.processModalDialog(id, title, message, itEnter->first, itEnter->second, itEscape->first, itEscape->second, choiceList);
|
||||
g_game.processModalDialog(id, title, message, buttonList, enterButton, escapeButton, choiceList, priority);
|
||||
}
|
||||
|
||||
void ProtocolGame::parseExtendedOpcode(const InputMessagePtr& msg)
|
||||
@@ -1701,7 +1701,7 @@ void ProtocolGame::setMapDescription(const InputMessagePtr& msg, int x, int y, i
|
||||
|
||||
if(z > Otc::SEA_FLOOR) {
|
||||
startz = z - Otc::AWARE_UNDEGROUND_FLOOR_RANGE;
|
||||
endz = std::min(z + Otc::AWARE_UNDEGROUND_FLOOR_RANGE, (int)Otc::MAX_Z);
|
||||
endz = std::min<int>(z + Otc::AWARE_UNDEGROUND_FLOOR_RANGE, (int)Otc::MAX_Z);
|
||||
zstep = 1;
|
||||
}
|
||||
else {
|
||||
|
@@ -52,16 +52,8 @@ void ProtocolGame::sendLoginPacket(uint challengeTimestamp, uint8 challengeRando
|
||||
{
|
||||
OutputMessagePtr msg(new OutputMessage);
|
||||
|
||||
if(g_game.getProtocolVersion() == 760)
|
||||
{
|
||||
msg->addU16(0x20A);
|
||||
msg->addU8(g_game.getOs());
|
||||
}
|
||||
else
|
||||
{
|
||||
msg->addU8(Proto::ClientPendingGame);
|
||||
msg->addU16(g_game.getOs());
|
||||
}
|
||||
msg->addU8(Proto::ClientPendingGame);
|
||||
msg->addU16(g_game.getOs());
|
||||
msg->addU16(g_game.getProtocolVersion());
|
||||
|
||||
if(g_game.getProtocolVersion() >= 971) {
|
||||
@@ -73,7 +65,7 @@ void ProtocolGame::sendLoginPacket(uint challengeTimestamp, uint8 challengeRando
|
||||
|
||||
msg->addU8(0); // first RSA byte must be 0
|
||||
|
||||
if(g_game.getProtocolVersion() >= 800)
|
||||
if(g_game.getProtocolVersion() >= 770)
|
||||
{
|
||||
// xtea key
|
||||
generateXteaKey();
|
||||
@@ -107,7 +99,7 @@ void ProtocolGame::sendLoginPacket(uint challengeTimestamp, uint8 challengeRando
|
||||
msg->addPaddingBytes(paddingBytes);
|
||||
|
||||
// encrypt with RSA
|
||||
if(g_game.getProtocolVersion() >= 800)
|
||||
if(g_game.getProtocolVersion() >= 770)
|
||||
msg->encryptRsa();
|
||||
|
||||
if(g_game.getFeature(Otc::GameProtocolChecksum))
|
||||
@@ -115,7 +107,7 @@ void ProtocolGame::sendLoginPacket(uint challengeTimestamp, uint8 challengeRando
|
||||
|
||||
send(msg);
|
||||
|
||||
if(g_game.getProtocolVersion() >= 800)
|
||||
if(g_game.getProtocolVersion() >= 770)
|
||||
enableXteaEncryption();
|
||||
}
|
||||
|
||||
@@ -573,7 +565,7 @@ void ProtocolGame::sendCloseNpcChannel()
|
||||
send(msg);
|
||||
}
|
||||
|
||||
void ProtocolGame::sendChangeFightModes(Otc::FightModes fightMode, Otc::ChaseModes chaseMode, bool safeFight)
|
||||
void ProtocolGame::sendChangeFightModes(Otc::FightModes fightMode, Otc::ChaseModes chaseMode, bool safeFight, Otc::PVPModes pvpMode)
|
||||
{
|
||||
OutputMessagePtr msg(new OutputMessage);
|
||||
msg->addU8(Proto::ClientChangeFightModes);
|
||||
@@ -581,9 +573,8 @@ void ProtocolGame::sendChangeFightModes(Otc::FightModes fightMode, Otc::ChaseMod
|
||||
msg->addU8(chaseMode);
|
||||
msg->addU8(safeFight ? 0x01: 0x00);
|
||||
|
||||
//TODO: implement pvp modes
|
||||
if(g_game.getFeature(Otc::GamePVPMode))
|
||||
msg->addU8(0); // pvp mode
|
||||
msg->addU8(pvpMode);
|
||||
|
||||
send(msg);
|
||||
}
|
||||
@@ -706,12 +697,16 @@ void ProtocolGame::sendChangeOutfit(const Outfit& outfit)
|
||||
{
|
||||
OutputMessagePtr msg(new OutputMessage);
|
||||
msg->addU8(Proto::ClientChangeOutfit);
|
||||
msg->addU16(outfit.getId());
|
||||
if(g_game.getFeature(Otc::GameLooktypeU16))
|
||||
msg->addU16(outfit.getId());
|
||||
else
|
||||
msg->addU8(outfit.getId());
|
||||
msg->addU8(outfit.getHead());
|
||||
msg->addU8(outfit.getBody());
|
||||
msg->addU8(outfit.getLegs());
|
||||
msg->addU8(outfit.getFeet());
|
||||
msg->addU8(outfit.getAddons());
|
||||
if(g_game.getFeature(Otc::GamePlayerAddons))
|
||||
msg->addU8(outfit.getAddons());
|
||||
if(g_game.getFeature(Otc::GamePlayerMounts))
|
||||
msg->addU16(outfit.getMount());
|
||||
send(msg);
|
||||
|
@@ -129,7 +129,7 @@ void ThingType::unserialize(uint16 clientId, ThingCategory category, const FileS
|
||||
uint8 width = fin->getU8();
|
||||
uint8 height = fin->getU8();
|
||||
m_size = Size(width, height);
|
||||
m_exactSize = (width > 1 || height > 1) ? std::min((int)fin->getU8(), std::max(width * 32, height * 32)) : 32;
|
||||
m_exactSize = (width > 1 || height > 1) ? std::min<int>((int)fin->getU8(), std::max<int>(width * 32, height * 32)) : 32;
|
||||
m_layers = fin->getU8();
|
||||
m_numPatternX = fin->getU8();
|
||||
m_numPatternY = fin->getU8();
|
||||
@@ -280,10 +280,10 @@ const TexturePtr& ThingType::getTexture(int animationPhase)
|
||||
for(int y = framePos.y; y < framePos.y + m_size.height() * Otc::TILE_PIXELS; ++y) {
|
||||
uint8 *p = fullImage->getPixel(x,y);
|
||||
if(p[3] != 0x00) {
|
||||
drawRect.setTop (std::min(y, (int)drawRect.top()));
|
||||
drawRect.setLeft (std::min(x, (int)drawRect.left()));
|
||||
drawRect.setBottom(std::max(y, (int)drawRect.bottom()));
|
||||
drawRect.setRight (std::max(x, (int)drawRect.right()));
|
||||
drawRect.setTop (std::min<int>(y, (int)drawRect.top()));
|
||||
drawRect.setLeft (std::min<int>(x, (int)drawRect.left()));
|
||||
drawRect.setBottom(std::max<int>(y, (int)drawRect.bottom()));
|
||||
drawRect.setRight (std::max<int>(x, (int)drawRect.right()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -362,5 +362,5 @@ int ThingType::getExactSize(int layer, int xPattern, int yPattern, int zPattern,
|
||||
getTexture(animationPhase); // we must calculate it anyway.
|
||||
int frameIndex = getTextureIndex(layer, xPattern, yPattern, zPattern);
|
||||
Size size = m_texturesFramesOriginRects[animationPhase][frameIndex].size() - m_texturesFramesOffsets[animationPhase][frameIndex].toSize();
|
||||
return std::max(size.width(), size.height());
|
||||
return std::max<int>(size.width(), size.height());
|
||||
}
|
||||
|
@@ -227,30 +227,29 @@ void ThingTypeManager::loadXml(const std::string& file)
|
||||
}
|
||||
}
|
||||
|
||||
void ThingTypeManager::parseItemType(uint16 id, TiXmlElement* elem)
|
||||
void ThingTypeManager::parseItemType(uint16 serverId, TiXmlElement* elem)
|
||||
{
|
||||
uint16 serverId = id;
|
||||
ItemTypePtr itemType = nullptr;
|
||||
|
||||
bool s;
|
||||
int d;
|
||||
|
||||
if(g_game.getProtocolVersion() < 960) {
|
||||
if(serverId > 20000 && serverId < 20100) {
|
||||
serverId -= 20000;
|
||||
|
||||
itemType = ItemTypePtr(new ItemType);
|
||||
itemType->setServerId(serverId);
|
||||
addItemType(itemType);
|
||||
} else
|
||||
itemType = getItemType(serverId);
|
||||
s = serverId > 20000 && serverId < 20100;
|
||||
d = 20000;
|
||||
} else {
|
||||
if(serverId > 30000 && serverId < 30100) {
|
||||
serverId -= 30000;
|
||||
|
||||
itemType = ItemTypePtr(new ItemType);
|
||||
itemType->setServerId(serverId);
|
||||
addItemType(itemType);
|
||||
} else
|
||||
itemType = getItemType(serverId);
|
||||
s = serverId > 30000 && serverId < 30100;
|
||||
d = 30000;
|
||||
}
|
||||
|
||||
if(s) {
|
||||
serverId -= d;
|
||||
itemType = ItemTypePtr(new ItemType);
|
||||
itemType->setServerId(serverId);
|
||||
addItemType(itemType);
|
||||
} else
|
||||
itemType = getItemType(serverId);
|
||||
|
||||
itemType->setName(elem->Attribute("name"));
|
||||
for(TiXmlElement* attrib = elem->FirstChildElement(); attrib; attrib = attrib->NextSiblingElement()) {
|
||||
std::string key = attrib->Attribute("key");
|
||||
|
@@ -49,7 +49,9 @@ void Tile::draw(const Point& dest, float scaleFactor, int drawFlags, LightView *
|
||||
TILESTATE_PROTECTIONZONE,
|
||||
TILESTATE_OPTIONALZONE,
|
||||
TILESTATE_HARDCOREZONE,
|
||||
TILESTATE_NOLOGOUT
|
||||
TILESTATE_REFRESH,
|
||||
TILESTATE_NOLOGOUT,
|
||||
TILESTATE_LAST
|
||||
};
|
||||
|
||||
// first bottom items
|
||||
@@ -71,6 +73,8 @@ void Tile::draw(const Point& dest, float scaleFactor, int drawFlags, LightView *
|
||||
}
|
||||
}
|
||||
}
|
||||
if(m_selected)
|
||||
g_painter->setColor(Color::teal);
|
||||
|
||||
if((thing->isGround() && drawFlags & Otc::DrawGround) ||
|
||||
(thing->isGroundBorder() && drawFlags & Otc::DrawGroundBorders) ||
|
||||
@@ -82,6 +86,8 @@ void Tile::draw(const Point& dest, float scaleFactor, int drawFlags, LightView *
|
||||
g_painter->resetColor();
|
||||
}
|
||||
}
|
||||
if(m_selected)
|
||||
g_painter->resetColor();
|
||||
|
||||
m_drawElevation += thing->getElevation();
|
||||
if(m_drawElevation > Otc::MAX_ELEVATION)
|
||||
@@ -101,8 +107,8 @@ void Tile::draw(const Point& dest, float scaleFactor, int drawFlags, LightView *
|
||||
thing->draw(dest - m_drawElevation*scaleFactor, scaleFactor, animate, lightView);
|
||||
|
||||
if(thing->isLyingCorpse()) {
|
||||
redrawPreviousTopW = std::max(thing->getWidth(), redrawPreviousTopW);
|
||||
redrawPreviousTopH = std::max(thing->getHeight(), redrawPreviousTopH);
|
||||
redrawPreviousTopW = std::max<int>(thing->getWidth(), redrawPreviousTopW);
|
||||
redrawPreviousTopH = std::max<int>(thing->getHeight(), redrawPreviousTopH);
|
||||
}
|
||||
|
||||
m_drawElevation += thing->getElevation();
|
||||
|
@@ -112,6 +112,7 @@ public:
|
||||
bool hasElevation(int elevation = 1);
|
||||
void overwriteMinimapColor(uint8 color) { m_minimapColor = color; }
|
||||
|
||||
void remFlag(uint32 flag) { m_flags &= ~flag; }
|
||||
void setFlag(uint32 flag) { m_flags |= flag; }
|
||||
void setFlags(uint32 flags) { m_flags = flags; }
|
||||
bool hasFlag(uint32 flag) { return (m_flags & flag) == flag; }
|
||||
@@ -121,6 +122,10 @@ public:
|
||||
uint32 getHouseId() { return m_houseId; }
|
||||
bool isHouseTile() const { return m_houseId != 0 && (m_flags & TILESTATE_HOUSE) == TILESTATE_HOUSE; }
|
||||
|
||||
void select() { m_selected = true; }
|
||||
void unselect() { m_selected = false; }
|
||||
bool isSelected() { return m_selected; }
|
||||
|
||||
TilePtr asTile() { return static_self_cast<Tile>(); }
|
||||
|
||||
private:
|
||||
@@ -133,6 +138,8 @@ private:
|
||||
uint8 m_drawElevation;
|
||||
uint8 m_minimapColor;
|
||||
uint32 m_flags, m_houseId;
|
||||
|
||||
stdext::boolean<false> m_selected;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -48,18 +48,18 @@ void UIItem::drawSelf(Fw::DrawPane drawPane)
|
||||
Rect drawRect = getPaddingRect();
|
||||
Point dest = drawRect.bottomRight() + Point(1,1);
|
||||
|
||||
int exactSize = std::max(32, m_item->getExactSize());
|
||||
int exactSize = std::max<int>(32, m_item->getExactSize());
|
||||
if(exactSize == 0)
|
||||
return;
|
||||
|
||||
float scaleFactor = std::min(drawRect.width() / (float)exactSize, drawRect.height() / (float)exactSize);
|
||||
float scaleFactor = std::min<float>(drawRect.width() / (float)exactSize, drawRect.height() / (float)exactSize);
|
||||
dest += (m_item->getDisplacement() - Point(32,32)) * scaleFactor;
|
||||
|
||||
g_painter->setColor(m_color);
|
||||
m_item->draw(dest, scaleFactor, true);
|
||||
|
||||
if(m_font && (m_item->isStackable() || m_item->isChargeable()) && m_item->getCountOrSubType() > 1) {
|
||||
std::string count = stdext::to_string(m_item->getCount());
|
||||
std::string count = stdext::to_string(m_item->getCountOrSubType());
|
||||
g_painter->setColor(Color(231, 231, 231));
|
||||
m_font->drawText(count, Rect(m_rect.topLeft(), m_rect.bottomRight() - Point(3, 0)), Fw::AlignBottomRight);
|
||||
}
|
||||
|
@@ -77,7 +77,7 @@ void UIMap::movePixels(int x, int y)
|
||||
|
||||
bool UIMap::setZoom(int zoom)
|
||||
{
|
||||
m_zoom = std::min(std::max(zoom, m_maxZoomIn), m_maxZoomOut);
|
||||
m_zoom = stdext::clamp<int>(zoom, m_maxZoomIn, m_maxZoomOut);
|
||||
updateVisibleDimension();
|
||||
return false;
|
||||
}
|
||||
|
@@ -47,6 +47,8 @@ public:
|
||||
void setMaxZoomIn(int maxZoomIn) { m_maxZoomIn = maxZoomIn; }
|
||||
void setMaxZoomOut(int maxZoomOut) { m_maxZoomOut = maxZoomOut; }
|
||||
void setMultifloor(bool enable) { m_mapView->setMultifloor(enable); }
|
||||
void lockVisibleFloor(int floor) { m_mapView->lockFirstVisibleFloor(floor); }
|
||||
void unlockVisibleFloor() { m_mapView->unlockFirstVisibleFloor(); }
|
||||
void setVisibleDimension(const Size& visibleDimension);
|
||||
void setViewMode(MapView::ViewMode viewMode) { m_mapView->setViewMode(viewMode); }
|
||||
void setAutoViewMode(bool enable) { m_mapView->setAutoViewMode(enable); }
|
||||
|
@@ -44,35 +44,35 @@ void UIProgressRect::drawSelf(Fw::DrawPane drawPane)
|
||||
// 0% - 12.5% (12.5)
|
||||
// triangle from top center, to top right (var x)
|
||||
if(m_percent < 12.5) {
|
||||
Point var = Point(std::max(m_percent - 0.0, 0.0) * (drawRect.right() - drawRect.horizontalCenter()) / 12.5, 0);
|
||||
Point var = Point(std::max<int>(m_percent - 0.0, 0.0) * (drawRect.right() - drawRect.horizontalCenter()) / 12.5, 0);
|
||||
g_painter->drawFilledTriangle(drawRect.center(), drawRect.topRight() + Point(1,0), drawRect.topCenter() + var);
|
||||
}
|
||||
|
||||
// 12.5% - 37.5% (25)
|
||||
// triangle from top right to bottom right (var y)
|
||||
if(m_percent < 37.5) {
|
||||
Point var = Point(0, std::max(m_percent - 12.5, 0.0) * (drawRect.bottom() - drawRect.top()) / 25.0);
|
||||
Point var = Point(0, std::max<int>(m_percent - 12.5, 0.0) * (drawRect.bottom() - drawRect.top()) / 25.0);
|
||||
g_painter->drawFilledTriangle(drawRect.center(), drawRect.bottomRight() + Point(1,1), drawRect.topRight() + var + Point(1,0));
|
||||
}
|
||||
|
||||
// 37.5% - 62.5% (25)
|
||||
// triangle from bottom right to bottom left (var x)
|
||||
if(m_percent < 62.5) {
|
||||
Point var = Point(std::max(m_percent - 37.5, 0.0) * (drawRect.right() - drawRect.left()) / 25.0, 0);
|
||||
Point var = Point(std::max<int>(m_percent - 37.5, 0.0) * (drawRect.right() - drawRect.left()) / 25.0, 0);
|
||||
g_painter->drawFilledTriangle(drawRect.center(), drawRect.bottomLeft() + Point(0,1), drawRect.bottomRight() - var + Point(1,1));
|
||||
}
|
||||
|
||||
// 62.5% - 87.5% (25)
|
||||
// triangle from bottom left to top left
|
||||
if(m_percent < 87.5) {
|
||||
Point var = Point(0, std::max(m_percent - 62.5, 0.0) * (drawRect.bottom() - drawRect.top()) / 25.0);
|
||||
Point var = Point(0, std::max<int>(m_percent - 62.5, 0.0) * (drawRect.bottom() - drawRect.top()) / 25.0);
|
||||
g_painter->drawFilledTriangle(drawRect.center(), drawRect.topLeft(), drawRect.bottomLeft() - var + Point(0,1));
|
||||
}
|
||||
|
||||
// 87.5% - 100% (12.5)
|
||||
// triangle from top left to top center
|
||||
if(m_percent < 100) {
|
||||
Point var = Point(std::max(m_percent - 87.5, 0.0) * (drawRect.horizontalCenter() - drawRect.left()) / 12.5, 0);
|
||||
Point var = Point(std::max<int>(m_percent - 87.5, 0.0) * (drawRect.horizontalCenter() - drawRect.left()) / 12.5, 0);
|
||||
g_painter->drawFilledTriangle(drawRect.center(), drawRect.topCenter(), drawRect.topLeft() + var);
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ void UIProgressRect::drawSelf(Fw::DrawPane drawPane)
|
||||
|
||||
void UIProgressRect::setPercent(float percent)
|
||||
{
|
||||
m_percent = std::max(std::min((double)percent, 100.0), 0.0);
|
||||
m_percent = stdext::clamp<float>((double)percent, 0.0, 100.0);
|
||||
}
|
||||
|
||||
void UIProgressRect::onStyleApply(const std::string& styleName, const OTMLNodePtr& styleNode)
|
||||
|
@@ -197,7 +197,7 @@ message(STATUS "Build revision: ${BUILD_REVISION}")
|
||||
add_definitions(-D"BUILD_REVISION=\\\"${BUILD_REVISION}\\\"")
|
||||
|
||||
# find boost
|
||||
set(REQUIRED_BOOST_COMPONENTS system thread chrono)
|
||||
set(REQUIRED_BOOST_COMPONENTS system thread filesystem chrono)
|
||||
if(WIN32)
|
||||
set(Boost_THREADAPI win32)
|
||||
set(framework_DEFINITIONS ${framework_DEFINITIONS} -DBOOST_THREAD_USE_LIB) # fix boost thread linkage
|
||||
|
@@ -89,7 +89,7 @@ bool AdaptativeFrameCounter::update()
|
||||
|
||||
void AdaptativeFrameCounter::setMaxFps(int maxFps)
|
||||
{
|
||||
maxFps = std::max(std::min(maxFps, 1000), 0);
|
||||
maxFps = stdext::clamp<int>(maxFps, 0, 1000);
|
||||
|
||||
if(maxFps != 0) {
|
||||
m_bestFrameDelay = 1000000 / maxFps;
|
||||
|
@@ -271,6 +271,37 @@ std::list<std::string> ResourceManager::listDirectoryFiles(const std::string& di
|
||||
return files;
|
||||
}
|
||||
|
||||
std::vector<std::string> ResourceManager::getDirectoryFiles(const std::string& path, bool filenameOnly, bool recursive)
|
||||
{
|
||||
if(!fs::exists(path))
|
||||
return std::vector<std::string>();
|
||||
|
||||
fs::path p(path);
|
||||
return discoverPath(p, filenameOnly, recursive);
|
||||
}
|
||||
|
||||
std::vector<std::string> ResourceManager::discoverPath(const fs::path& path, bool filenameOnly, bool recursive)
|
||||
{
|
||||
std::vector<std::string> files;
|
||||
|
||||
/* Before doing anything, we have to add this directory to search path,
|
||||
* this is needed so it works correctly when one wants to open a file. */
|
||||
addSearchPath(path.generic_string(), true);
|
||||
for (fs::directory_iterator it(path), end; it != end; ++it) {
|
||||
if(fs::is_directory(it->path().generic_string()) && recursive) {
|
||||
std::vector<std::string> subfiles = discoverPath(it->path(), filenameOnly, recursive);
|
||||
files.insert(files.end(), subfiles.begin(), subfiles.end());
|
||||
} else {
|
||||
if(filenameOnly)
|
||||
files.push_back(it->path().filename().string());
|
||||
else
|
||||
files.push_back(it->path().generic_string() + "/" + it->path().filename().string());
|
||||
}
|
||||
}
|
||||
|
||||
return files;
|
||||
}
|
||||
|
||||
std::string ResourceManager::resolvePath(const std::string& path)
|
||||
{
|
||||
std::string fullPath;
|
||||
|
@@ -25,6 +25,10 @@
|
||||
|
||||
#include "declarations.h"
|
||||
|
||||
#include <boost/filesystem.hpp>
|
||||
|
||||
namespace fs = boost::filesystem;
|
||||
|
||||
// @bindsingleton g_resources
|
||||
class ResourceManager
|
||||
{
|
||||
@@ -61,6 +65,7 @@ public:
|
||||
|
||||
bool makeDir(const std::string directory);
|
||||
std::list<std::string> listDirectoryFiles(const std::string& directoryPath = "");
|
||||
std::vector<std::string> getDirectoryFiles(const std::string& path, bool filenameOnly, bool recursive);
|
||||
|
||||
std::string resolvePath(const std::string& path);
|
||||
std::string getRealDir(const std::string& path);
|
||||
@@ -75,6 +80,9 @@ public:
|
||||
bool isFileType(const std::string& filename, const std::string& type);
|
||||
ticks_t getFileTime(const std::string& filename);
|
||||
|
||||
protected:
|
||||
std::vector<std::string> discoverPath(const fs::path& path, bool filenameOnly, bool recursive);
|
||||
|
||||
private:
|
||||
std::string m_workDir;
|
||||
std::string m_writeDir;
|
||||
|
@@ -209,7 +209,7 @@ const std::vector<Point>& BitmapFont::calculateGlyphsPositions(const std::string
|
||||
lineWidths[lines] += m_glyphsSize[glyph].width() ;
|
||||
if((i+1 != textLength && text[i+1] != '\n')) // only add space if letter is not the last or before a \n.
|
||||
lineWidths[lines] += m_glyphSpacing.width();
|
||||
maxLineWidth = std::max(maxLineWidth, lineWidths[lines]);
|
||||
maxLineWidth = std::max<int>(maxLineWidth, lineWidths[lines]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -149,8 +149,8 @@ Size FrameBuffer::getSize()
|
||||
{
|
||||
if(m_fbo == 0) {
|
||||
// the buffer size is limited by the window size
|
||||
return Size(std::min(m_texture->getWidth(), g_window.getWidth()),
|
||||
std::min(m_texture->getHeight(), g_window.getHeight()));
|
||||
return Size(std::min<int>(m_texture->getWidth(), g_window.getWidth()),
|
||||
std::min<int>(m_texture->getHeight(), g_window.getHeight()));
|
||||
}
|
||||
return m_texture->getSize();
|
||||
}
|
||||
|
@@ -170,7 +170,7 @@ bool Texture::setupSize(const Size& size, bool forcePowerOfTwo)
|
||||
glSize = size;
|
||||
|
||||
// checks texture max size
|
||||
if(std::max(glSize.width(), glSize.height()) > g_graphics.getMaxTextureSize()) {
|
||||
if(std::max<int>(glSize.width(), glSize.height()) > g_graphics.getMaxTextureSize()) {
|
||||
g_logger.error(stdext::format("loading texture with size %dx%d failed, "
|
||||
"the maximum size allowed by the graphics card is %dx%d,"
|
||||
"to prevent crashes the texture will be displayed as a blank texture",
|
||||
|
@@ -986,6 +986,11 @@ void LuaInterface::newTable()
|
||||
lua_newtable(L);
|
||||
}
|
||||
|
||||
void LuaInterface::createTable(int narr, int nrec)
|
||||
{
|
||||
lua_createtable(L, narr, nrec);
|
||||
}
|
||||
|
||||
void* LuaInterface::newUserdata(int size)
|
||||
{
|
||||
return lua_newuserdata(L, size);
|
||||
|
@@ -274,6 +274,7 @@ public:
|
||||
void rawSeti(int n, int index = -2);
|
||||
|
||||
void newTable();
|
||||
void createTable(int narr, int nrec);
|
||||
void* newUserdata(int size);
|
||||
|
||||
void pop(int n = 1);
|
||||
|
@@ -96,7 +96,7 @@ int push_luavalue(const LuaCppFunction& func)
|
||||
// color
|
||||
int push_luavalue(const Color& color)
|
||||
{
|
||||
g_lua.newTable();
|
||||
g_lua.createTable(0, 4);
|
||||
g_lua.pushInteger(color.r());
|
||||
g_lua.setField("r");
|
||||
g_lua.pushInteger(color.g());
|
||||
@@ -132,7 +132,7 @@ bool luavalue_cast(int index, Color& color)
|
||||
// rect
|
||||
int push_luavalue(const Rect& rect)
|
||||
{
|
||||
g_lua.newTable();
|
||||
g_lua.createTable(0, 4);
|
||||
g_lua.pushInteger(rect.x());
|
||||
g_lua.setField("x");
|
||||
g_lua.pushInteger(rect.y());
|
||||
@@ -168,7 +168,7 @@ bool luavalue_cast(int index, Rect& rect)
|
||||
// point
|
||||
int push_luavalue(const Point& point)
|
||||
{
|
||||
g_lua.newTable();
|
||||
g_lua.createTable(0, 2);
|
||||
g_lua.pushInteger(point.x);
|
||||
g_lua.setField("x");
|
||||
g_lua.pushInteger(point.y);
|
||||
@@ -196,7 +196,7 @@ bool luavalue_cast(int index, Point& point)
|
||||
// size
|
||||
int push_luavalue(const Size& size)
|
||||
{
|
||||
g_lua.newTable();
|
||||
g_lua.createTable(0, 2);
|
||||
g_lua.pushInteger(size.width());
|
||||
g_lua.setField("width");
|
||||
g_lua.pushInteger(size.height());
|
||||
|
@@ -287,7 +287,7 @@ luavalue_cast(int index, std::function<Ret(Args...)>& func) {
|
||||
|
||||
template<typename T>
|
||||
int push_luavalue(const std::list<T>& list) {
|
||||
g_lua.newTable();
|
||||
g_lua.createTable(list.size(), 0);
|
||||
int i = 1;
|
||||
for(const T& v : list) {
|
||||
push_internal_luavalue(v);
|
||||
@@ -315,7 +315,7 @@ bool luavalue_cast(int index, std::list<T>& list)
|
||||
|
||||
template<typename T>
|
||||
int push_luavalue(const std::vector<T>& vec) {
|
||||
g_lua.newTable();
|
||||
g_lua.createTable(vec.size(), 0);
|
||||
int i = 1;
|
||||
for(const T& v : vec) {
|
||||
push_internal_luavalue(v);
|
||||
@@ -343,7 +343,7 @@ bool luavalue_cast(int index, std::vector<T>& vec)
|
||||
|
||||
template<typename T>
|
||||
int push_luavalue(const std::deque<T>& vec) {
|
||||
g_lua.newTable();
|
||||
g_lua.createTable(vec.size(), 0);
|
||||
int i = 1;
|
||||
for(const T& v : vec) {
|
||||
push_internal_luavalue(v);
|
||||
|
@@ -189,6 +189,7 @@ void Application::registerLuaFunctions()
|
||||
g_lua.bindSingletonFunction("g_resources", "getWorkDir", &ResourceManager::getWorkDir, &g_resources);
|
||||
g_lua.bindSingletonFunction("g_resources", "getSearchPaths", &ResourceManager::getSearchPaths, &g_resources);
|
||||
g_lua.bindSingletonFunction("g_resources", "listDirectoryFiles", &ResourceManager::listDirectoryFiles, &g_resources);
|
||||
g_lua.bindSingletonFunction("g_resources", "getDirectoryFiles", &ResourceManager::getDirectoryFiles, &g_resources);
|
||||
g_lua.bindSingletonFunction("g_resources", "readFileContents", &ResourceManager::readFileContents, &g_resources);
|
||||
g_lua.bindSingletonFunction("g_resources", "guessFilePath", &ResourceManager::guessFilePath, &g_resources);
|
||||
g_lua.bindSingletonFunction("g_resources", "isFileType", &ResourceManager::isFileType, &g_resources);
|
||||
|
@@ -75,7 +75,7 @@ void Stacktrace(LPEXCEPTION_POINTERS e, std::stringstream& ss)
|
||||
pSym = (PIMAGEHLP_SYMBOL)symBuffer;
|
||||
|
||||
ZeroMemory(&sf, sizeof(sf));
|
||||
#ifdef __WIN64__
|
||||
#ifdef _WIN64
|
||||
sf.AddrPC.Offset = e->ContextRecord->Rip;
|
||||
sf.AddrStack.Offset = e->ContextRecord->Rsp;
|
||||
sf.AddrFrame.Offset = e->ContextRecord->Rbp;
|
||||
|
@@ -40,6 +40,7 @@
|
||||
#error "You need Visual Studio 2013 or greater to compile."
|
||||
#endif
|
||||
#pragma warning(disable:4244) // conversion from 'A' to 'B', possible loss of data
|
||||
#pragma warning(disable:4267) // '?' : conversion from 'A' to 'B', possible loss of data
|
||||
#pragma warning(disable:4305) // 'initializing' : truncation from 'A' to 'B'
|
||||
#pragma warning(disable:4146) // unary minus operator applied to unsigned type, result still unsigned
|
||||
#pragma warning(disable:4800) // 'A' : forcing value to bool 'true' or 'false' (performance warning)
|
||||
|
@@ -23,6 +23,10 @@
|
||||
#include "math.h"
|
||||
#include <random>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable:4267) // '?' : conversion from 'A' to 'B', possible loss of data
|
||||
#endif
|
||||
|
||||
namespace stdext {
|
||||
|
||||
uint32_t adler32(const uint8_t *buffer, size_t size) {
|
||||
|
@@ -23,6 +23,7 @@
|
||||
#ifndef STDEXT_MATH_H
|
||||
#define STDEXT_MATH_H
|
||||
|
||||
#include <algorithm>
|
||||
#include "types.h"
|
||||
|
||||
namespace stdext {
|
||||
@@ -45,6 +46,9 @@ float random_range(float min, float max);
|
||||
|
||||
double round(double r);
|
||||
|
||||
template<typename T>
|
||||
T clamp(T x, T min, T max) { return std::max<T>(min, std::min<T>(x, max)); }
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -26,6 +26,10 @@
|
||||
#include <ctype.h>
|
||||
#include <physfs.h>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable:4267) // '?' : conversion from 'A' to 'B', possible loss of data
|
||||
#endif
|
||||
|
||||
namespace stdext {
|
||||
|
||||
std::string resolve_path(const std::string& filePath, std::string sourcePath)
|
||||
|
@@ -66,10 +66,10 @@ bool UIHorizontalLayout::internalUpdate()
|
||||
pos.y = paddingRect.top() + widget->getMarginTop();
|
||||
} else if(widget->getTextAlign() & Fw::AlignBottom) {
|
||||
pos.y = paddingRect.bottom() - widget->getHeight() - widget->getMarginBottom();
|
||||
pos.y = std::max(pos.y, paddingRect.top());
|
||||
pos.y = std::max<int>(pos.y, paddingRect.top());
|
||||
} else { // center it
|
||||
pos.y = paddingRect.top() + (paddingRect.height() - (widget->getMarginTop() + widget->getHeight() + widget->getMarginBottom()))/2;
|
||||
pos.y = std::max(pos.y, paddingRect.top());
|
||||
pos.y = std::max<int>(pos.y, paddingRect.top());
|
||||
}
|
||||
} else {
|
||||
// expand height
|
||||
|
@@ -40,7 +40,7 @@ public:
|
||||
virtual void addWidget(const UIWidgetPtr& widget) { }
|
||||
virtual void removeWidget(const UIWidgetPtr& widget) { }
|
||||
void disableUpdates() { m_updateDisabled++; }
|
||||
void enableUpdates() { m_updateDisabled = std::max(m_updateDisabled-1,0); }
|
||||
void enableUpdates() { m_updateDisabled = std::max<int>(m_updateDisabled-1,0); }
|
||||
|
||||
void setParent(UIWidgetPtr parentWidget) { m_parentWidget = parentWidget; }
|
||||
UIWidgetPtr getParentWidget() { return m_parentWidget; }
|
||||
|
@@ -181,15 +181,15 @@ void UITextEdit::update(bool focusCursor)
|
||||
if(!virtualRect.contains(glyphRect.topLeft()) || !virtualRect.contains(glyphRect.bottomRight())) {
|
||||
// calculate where is the first glyph visible
|
||||
Point startGlyphPos;
|
||||
startGlyphPos.y = std::max(glyphRect.bottom() - virtualRect.height(), 0);
|
||||
startGlyphPos.x = std::max(glyphRect.right() - virtualRect.width(), 0);
|
||||
startGlyphPos.y = std::max<int>(glyphRect.bottom() - virtualRect.height(), 0);
|
||||
startGlyphPos.x = std::max<int>(glyphRect.right() - virtualRect.width(), 0);
|
||||
|
||||
// find that glyph
|
||||
for(pos = 0; pos < textLength; ++pos) {
|
||||
glyph = (uchar)text[pos];
|
||||
glyphRect = Rect(glyphsPositions[pos], glyphsSize[glyph]);
|
||||
glyphRect.setTop(std::max(glyphRect.top() - m_font->getYOffset() - m_font->getGlyphSpacing().height(), 0));
|
||||
glyphRect.setLeft(std::max(glyphRect.left() - m_font->getGlyphSpacing().width(), 0));
|
||||
glyphRect.setTop(std::max<int>(glyphRect.top() - m_font->getYOffset() - m_font->getGlyphSpacing().height(), 0));
|
||||
glyphRect.setLeft(std::max<int>(glyphRect.left() - m_font->getGlyphSpacing().width(), 0));
|
||||
|
||||
// first glyph entirely visible found
|
||||
if(glyphRect.topLeft() >= startGlyphPos) {
|
||||
@@ -358,8 +358,8 @@ void UITextEdit::setSelection(int start, int end)
|
||||
if(end == -1)
|
||||
end = m_text.length();
|
||||
|
||||
m_selectionStart = std::min(std::max(start, 0), (int)m_text.length());
|
||||
m_selectionEnd = std::min(std::max(end, 0), (int)m_text.length());
|
||||
m_selectionStart = stdext::clamp<int>(start, 0, (int)m_text.length());
|
||||
m_selectionEnd = stdext::clamp<int>(end, 0, (int)m_text.length());
|
||||
}
|
||||
|
||||
void UITextEdit::setTextHidden(bool hidden)
|
||||
|
@@ -68,10 +68,10 @@ bool UIVerticalLayout::internalUpdate()
|
||||
pos.x = paddingRect.left() + widget->getMarginLeft();
|
||||
} else if(widget->getTextAlign() & Fw::AlignLeft) {
|
||||
pos.x = paddingRect.bottom() - widget->getHeight() - widget->getMarginBottom();
|
||||
pos.x = std::max(pos.x, paddingRect.left());
|
||||
pos.x = std::max<int>(pos.x, paddingRect.left());
|
||||
} else {
|
||||
pos.x = paddingRect.left() + (paddingRect.width() - (widget->getMarginLeft() + widget->getWidth() + widget->getMarginRight()))/2;
|
||||
pos.x = std::max(pos.x, paddingRect.left());
|
||||
pos.x = std::max<int>(pos.x, paddingRect.left());
|
||||
}
|
||||
} else {
|
||||
// expand width
|
||||
|
@@ -192,7 +192,7 @@ void UIWidget::insertChild(int index, const UIWidgetPtr& child)
|
||||
|
||||
if(!(index >= 0 && (uint)index <= m_children.size())) {
|
||||
//g_logger.traceWarning("attempt to insert a child UIWidget into an invalid index, using nearest index...");
|
||||
index = std::min(std::max(index, 0), (int)m_children.size());
|
||||
index = stdext::clamp<int>(index, 0, (int)m_children.size());
|
||||
}
|
||||
|
||||
// retrieve child by index
|
||||
|
@@ -346,7 +346,7 @@ public:
|
||||
void setPaddingRight(int padding) { m_padding.right = padding; updateLayout(); }
|
||||
void setPaddingBottom(int padding) { m_padding.bottom = padding; updateLayout(); }
|
||||
void setPaddingLeft(int padding) { m_padding.left = padding; updateLayout(); }
|
||||
void setOpacity(float opacity) { m_opacity = std::min(std::max(opacity, 0.0f), 1.0f); }
|
||||
void setOpacity(float opacity) { m_opacity = stdext::clamp<float>(opacity, 0.0f, 1.0f); }
|
||||
void setRotation(float degrees) { m_rotation = degrees; }
|
||||
|
||||
int getX() { return m_rect.x(); }
|
||||
|
@@ -221,10 +221,10 @@ public:
|
||||
|
||||
TRect<T> united(const TRect<T> &r) const {
|
||||
TRect<T> tmp;
|
||||
tmp.x1 = std::min(x1, r.x1);
|
||||
tmp.x2 = std::max(x2, r.x2);
|
||||
tmp.y1 = std::min(y1, r.y1);
|
||||
tmp.y2 = std::max(y2, r.y2);
|
||||
tmp.x1 = std::min<T>(x1, r.x1);
|
||||
tmp.x2 = std::max<T>(x2, r.x2);
|
||||
tmp.y1 = std::min<T>(y1, r.y1);
|
||||
tmp.y2 = std::max<T>(y2, r.y2);
|
||||
return tmp;
|
||||
}
|
||||
|
||||
@@ -263,10 +263,10 @@ public:
|
||||
b2 = r.y2;
|
||||
|
||||
TRect<T> tmp;
|
||||
tmp.x1 = std::max(l1, l2);
|
||||
tmp.x2 = std::min(r1, r2);
|
||||
tmp.y1 = std::max(t1, t2);
|
||||
tmp.y2 = std::min(b1, b2);
|
||||
tmp.x1 = std::max<int>(l1, l2);
|
||||
tmp.x2 = std::min<int>(r1, r2);
|
||||
tmp.y1 = std::max<int>(t1, t2);
|
||||
tmp.y2 = std::min<int>(b1, b2);
|
||||
return tmp;
|
||||
}
|
||||
|
||||
|
@@ -70,8 +70,8 @@ public:
|
||||
bool operator==(const TSize<T>& other) const { return other.wd==wd && other.ht==ht; }
|
||||
bool operator!=(const TSize<T>& other) const { return other.wd!=wd || other.ht!=ht; }
|
||||
|
||||
TSize<T> expandedTo(const TSize<T>& other) const { return TSize<T>(std::max(wd,other.wd), std::max(ht,other.ht)); }
|
||||
TSize<T> boundedTo(const TSize<T>& other) const { return TSize<T>(std::min(wd,other.wd), std::min(ht,other.ht)); }
|
||||
TSize<T> expandedTo(const TSize<T>& other) const { return TSize<T>(std::max<T>(wd, other.wd), std::max<T>(ht, other.ht)); }
|
||||
TSize<T> boundedTo(const TSize<T>& other) const { return TSize<T>(std::min<T>(wd, other.wd), std::min<T>(ht, other.ht)); }
|
||||
|
||||
void scale(const TSize<T>& s, Fw::AspectRatioMode mode) {
|
||||
if(mode == Fw::IgnoreAspectRatio || wd == 0 || ht == 0) {
|
||||
|
@@ -86,37 +86,37 @@ fi
|
||||
make -j$makejobs || exit
|
||||
cd ..
|
||||
|
||||
# compile for win64dx9
|
||||
mkdir -p build.win64dx9
|
||||
cd build.win64dx9
|
||||
if $rebuild; then
|
||||
x86_64-w64-mingw32-cmake \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DBOT_PROTECTION=OFF \
|
||||
-DOPENGLES=2.0 \
|
||||
-DBUILD_REVISION=$revision \
|
||||
-DBUILD_COMMIT=$commit \
|
||||
-DEXTRA_LIBS="$WIN32_EXTRA_LIBS" \
|
||||
.. || exit
|
||||
fi
|
||||
make -j$makejobs || exit
|
||||
cd ..
|
||||
## compile for win64dx9
|
||||
#mkdir -p build.win64dx9
|
||||
#cd build.win64dx9
|
||||
#if $rebuild; then
|
||||
#x86_64-w64-mingw32-cmake \
|
||||
#-DCMAKE_BUILD_TYPE=Release \
|
||||
#-DBOT_PROTECTION=OFF \
|
||||
#-DOPENGLES=2.0 \
|
||||
#-DBUILD_REVISION=$revision \
|
||||
#-DBUILD_COMMIT=$commit \
|
||||
#-DEXTRA_LIBS="$WIN32_EXTRA_LIBS" \
|
||||
#.. || exit
|
||||
#fi
|
||||
#make -j$makejobs || exit
|
||||
#cd ..
|
||||
|
||||
# compile for win32dx9
|
||||
mkdir -p build.win32dx9
|
||||
cd build.win32dx9
|
||||
if $rebuild; then
|
||||
i686-w64-mingw32-cmake \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DBOT_PROTECTION=OFF \
|
||||
-DOPENGLES=2.0 \
|
||||
-DBUILD_REVISION=$revision \
|
||||
-DBUILD_COMMIT=$commit \
|
||||
-DEXTRA_LIBS="$WIN32_EXTRA_LIBS" \
|
||||
.. || exit
|
||||
fi
|
||||
make -j$makejobs || exit
|
||||
cd ..
|
||||
## compile for win32dx9
|
||||
#mkdir -p build.win32dx9
|
||||
#cd build.win32dx9
|
||||
#if $rebuild; then
|
||||
#i686-w64-mingw32-cmake \
|
||||
#-DCMAKE_BUILD_TYPE=Release \
|
||||
#-DBOT_PROTECTION=OFF \
|
||||
#-DOPENGLES=2.0 \
|
||||
#-DBUILD_REVISION=$revision \
|
||||
#-DBUILD_COMMIT=$commit \
|
||||
#-DEXTRA_LIBS="$WIN32_EXTRA_LIBS" \
|
||||
#.. || exit
|
||||
#fi
|
||||
#make -j$makejobs || exit
|
||||
#cd ..
|
||||
|
||||
# compile for linux64
|
||||
mkdir -p build.linux64
|
||||
@@ -156,9 +156,9 @@ cd ..
|
||||
|
||||
##################################################
|
||||
# create win32 package
|
||||
pkg_suffix="-linux32-$version"
|
||||
pkg_suffix="-linux-$version"
|
||||
pkgname="$name$pkg_suffix"
|
||||
pkgzip="$pkgname.tgz"
|
||||
pkgzip="$pkgname.tar.gz"
|
||||
cd $workdir
|
||||
rm -rf $pkgname
|
||||
mkdir $pkgname
|
||||
@@ -201,8 +201,8 @@ tar czf $pkgzip $pkgname
|
||||
echo "Package generated to $pkgzip"
|
||||
|
||||
##################################################
|
||||
# create win32 package
|
||||
pkg_suffix="-win32-$version"
|
||||
# create windows package
|
||||
pkg_suffix="-win-$version"
|
||||
pkgname="$name$pkg_suffix"
|
||||
pkgzip="$pkgname.zip"
|
||||
cd $workdir
|
||||
@@ -215,15 +215,15 @@ mkdir mods
|
||||
cp $workdir/otclient/mods/README.txt mods/
|
||||
cp -R $workdir/otclient/modules .
|
||||
cp -R $workdir/otclient/data .
|
||||
cp $mingwbin/libEGL.dll .
|
||||
cp $mingwbin/libGLESv2.dll .
|
||||
cp $mingwbin/d3dcompiler_43.dll .
|
||||
cp $mingwbin/d3dx9_43.dll .
|
||||
cp $mingwbin/wrap_oal.dll .
|
||||
#cp $mingwbin/libEGL.dll .
|
||||
#cp $mingwbin/libGLESv2.dll .
|
||||
#cp $mingwbin/d3dcompiler_43.dll .
|
||||
#cp $mingwbin/d3dx9_43.dll .
|
||||
#cp $mingwbin/wrap_oal.dll .
|
||||
cp $workdir/otclient/build.win32/otclient.exe otclient-32.exe
|
||||
cp $workdir/otclient/build.win32dx9/otclient.exe otclient_dx9-32.exe
|
||||
cp $workdir/otclient/build.win64/otclient.exe otclient-64.exe
|
||||
cp $workdir/otclient/build.winw64dx9/otclient.exe otclient_dx9-64.exe
|
||||
#cp $workdir/otclient/build.win32dx9/otclient.exe otclient_dx9-32.exe
|
||||
#cp $workdir/otclient/build.winw64dx9/otclient.exe otclient_dx9-64.exe
|
||||
cp $workdir/otclient/init.lua .
|
||||
cp $workdir/otclient/otclientrc.lua .
|
||||
cp $workdir/otclient/AUTHORS AUTHORS.txt
|
||||
|
@@ -8,13 +8,19 @@ EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{17A8F78F-1FFB-4128-A3B3-59CC6C19D89A}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{17A8F78F-1FFB-4128-A3B3-59CC6C19D89A}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{17A8F78F-1FFB-4128-A3B3-59CC6C19D89A}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{17A8F78F-1FFB-4128-A3B3-59CC6C19D89A}.Debug|x64.Build.0 = Debug|x64
|
||||
{17A8F78F-1FFB-4128-A3B3-59CC6C19D89A}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{17A8F78F-1FFB-4128-A3B3-59CC6C19D89A}.Release|Win32.Build.0 = Release|Win32
|
||||
{17A8F78F-1FFB-4128-A3B3-59CC6C19D89A}.Release|x64.ActiveCfg = Release|x64
|
||||
{17A8F78F-1FFB-4128-A3B3-59CC6C19D89A}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
@@ -5,10 +5,18 @@
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{17A8F78F-1FFB-4128-A3B3-59CC6C19D89A}</ProjectGuid>
|
||||
@@ -21,6 +29,12 @@
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
@@ -28,34 +42,77 @@
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<IncludePath>E:\DevFolder\C++ Libraries\glew-1.10.0\include;E:\DevFolder\C++ Libraries\boost_1_54_0\include;C:\Users\crille\Documents\GitHub\dalkon\otclient\src;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>E:\DevFolder\C++ Libraries\glew-1.10.0\lib;E:\DevFolder\C++ Libraries\boost_1_54_0\lib;$(LibraryPath)</LibraryPath>
|
||||
<IncludePath>D:\otclient-msvc13-libs\libogg-1.3.1\include;D:\otclient-msvc13-libs\libvorbis-1.3.3\include;D:\otclient-msvc13-libs\physfs-2.0.3\include;D:\otclient-msvc13-libs\OpenSSL-1.0.1e\include;D:\otclient-msvc13-libs\zlib-1.2.5\include;D:\otclient-msvc13-libs\OpenAL\include\AL;D:\otclient-msvc13-libs\glew-1.10.0\include;D:\otclient-msvc13-libs\LuaJIT-2.0.2\include;D:\otclient-msvc13-libs\boost_1_55_0\include;D:\otclient\src;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>D:\otclient-msvc13-libs\libogg-1.3.1\lib;D:\otclient-msvc13-libs\libvorbis-1.3.3\lib;D:\otclient-msvc13-libs\physfs-2.0.3\lib;D:\otclient-msvc13-libs\OpenSSL-1.0.1e\lib\VC;D:\otclient-msvc13-libs\zlib-1.2.5\lib;D:\otclient-msvc13-libs\OpenAL\lib;D:\otclient-msvc13-libs\LuaJIT-2.0.2\lib;D:\otclient-msvc13-libs\glew-1.10.0\lib;D:\otclient-msvc13-libs\boost_1_55_0\lib;$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<IncludePath>D:\otclient-msvc13-libs\libogg-1.3.1\include;D:\otclient-msvc13-libs\libvorbis-1.3.3\include;D:\otclient-msvc13-libs\physfs-2.0.3\include;D:\otclient-msvc13-libs\OpenSSL-1.0.1e\include;D:\otclient-msvc13-libs\zlib-1.2.5\include;D:\otclient-msvc13-libs\OpenAL\include\AL;D:\otclient-msvc13-libs\glew-1.10.0\include;D:\otclient-msvc13-libs\LuaJIT-2.0.2\include;D:\otclient-msvc13-libs\boost_1_55_0\include;D:\otclient\src;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>D:\otclient-msvc13-libs\libogg-1.3.1\lib;D:\otclient-msvc13-libs\libvorbis-1.3.3\lib;D:\otclient-msvc13-libs\physfs-2.0.3\lib;D:\otclient-msvc13-libs\OpenSSL-1.0.1e\lib\VC;D:\otclient-msvc13-libs\zlib-1.2.5\lib;D:\otclient-msvc13-libs\OpenAL\lib;D:\otclient-msvc13-libs\LuaJIT-2.0.2\lib;D:\otclient-msvc13-libs\glew-1.10.0\lib;D:\otclient-msvc13-libs\boost_1_55_0\lib;$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<IncludePath>D:\otclient-msvc13-libs\libogg-1.3.1\include;D:\otclient-msvc13-libs\libvorbis-1.3.3\include;D:\otclient-msvc13-libs\physfs-2.0.3\include;D:\otclient-msvc13-libs\OpenSSL-1.0.1e\include;D:\otclient-msvc13-libs\zlib-1.2.5\include;D:\otclient-msvc13-libs\OpenAL\include\AL;D:\otclient-msvc13-libs\glew-1.10.0\include;D:\otclient-msvc13-libs\LuaJIT-2.0.2\include;D:\otclient-msvc13-libs\boost_1_55_0\include;D:\otclient\src;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>D:\otclient-msvc13-libs\libogg-1.3.1\lib;D:\otclient-msvc13-libs\libvorbis-1.3.3\lib;D:\otclient-msvc13-libs\physfs-2.0.3\lib;D:\otclient-msvc13-libs\OpenSSL-1.0.1e\lib\VC;D:\otclient-msvc13-libs\zlib-1.2.5\lib;D:\otclient-msvc13-libs\OpenAL\lib;D:\otclient-msvc13-libs\LuaJIT-2.0.2\lib;D:\otclient-msvc13-libs\glew-1.10.0\lib;D:\otclient-msvc13-libs\boost_1_55_0\lib;$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<IncludePath>D:\otclient-msvc13-libs\libogg-1.3.1\include;D:\otclient-msvc13-libs\libvorbis-1.3.3\include;D:\otclient-msvc13-libs\physfs-2.0.3\include;D:\otclient-msvc13-libs\OpenSSL-1.0.1e\include;D:\otclient-msvc13-libs\zlib-1.2.5\include;D:\otclient-msvc13-libs\OpenAL\include\AL;D:\otclient-msvc13-libs\glew-1.10.0\include;D:\otclient-msvc13-libs\LuaJIT-2.0.2\include;D:\otclient-msvc13-libs\boost_1_55_0\include;D:\otclient\src;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>D:\otclient-msvc13-libs\libogg-1.3.1\lib;D:\otclient-msvc13-libs\libvorbis-1.3.3\lib;D:\otclient-msvc13-libs\physfs-2.0.3\lib;D:\otclient-msvc13-libs\OpenSSL-1.0.1e\lib\VC;D:\otclient-msvc13-libs\zlib-1.2.5\lib;D:\otclient-msvc13-libs\OpenAL\lib;D:\otclient-msvc13-libs\LuaJIT-2.0.2\lib;D:\otclient-msvc13-libs\glew-1.10.0\lib;D:\otclient-msvc13-libs\boost_1_55_0\lib;$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_WIN32_WINNT=0x0501;BOT_PROTECTION;CLIENT;CRASH_HANDLER;FW_GRAPHICS;FW_NET;FW_SOUND;FW_XML;"BUILD_TYPE=\"RelWithDebInfo\"";"BUILD_COMMIT=\"devel\"";"BUILD_REVISION=\"0\"";"VERSION=\"0.6.3\"";%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ObjectFileName>$(IntDir)/%(RelativeDir)/</ObjectFileName>
|
||||
<PreprocessorDefinitions>WIN32;_CRT_SECURE_NO_WARNINGS;_WIN32_WINNT=0x0501;BOT_PROTECTION;CLIENT;CRASH_HANDLER;FW_GRAPHICS;FW_NET;FW_SOUND;FW_XML;BUILD_TYPE="RelWithDebInfo";BUILD_COMMIT="devel";BUILD_REVISION="0";VERSION="0.6.3";"BUILD_REVISION=\"0\"";"VERSION=\"0.6.3\"";%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ObjectFileName>$(IntDir)\$(Platform)\src\%(RelativeDir)\</ObjectFileName>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<IgnoreSpecificDefaultLibraries>libcmt.lib</IgnoreSpecificDefaultLibraries>
|
||||
<AdditionalDependencies>glew32.lib;zlib1.lib;libeay32MD.lib;physfs.lib;openal32.lib;luajit.lib;libogg_static.lib;libvorbisfile_static.lib;libvorbis_static.lib;opengl32.lib;dbghelp.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<LargeAddressAware>true</LargeAddressAware>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_CRT_SECURE_NO_WARNINGS;_WIN32_WINNT=0x0501;BOT_PROTECTION;CLIENT;CRASH_HANDLER;FW_GRAPHICS;FW_NET;FW_SOUND;FW_XML;BUILD_TYPE="RelWithDebInfo";BUILD_COMMIT="devel";BUILD_REVISION="0";VERSION="0.6.3";"BUILD_REVISION=\"0\"";"VERSION=\"0.6.3\"";%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ObjectFileName>$(IntDir)\$(Platform)\src\%(RelativeDir)\</ObjectFileName>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<IgnoreSpecificDefaultLibraries>libcmt.lib</IgnoreSpecificDefaultLibraries>
|
||||
<AdditionalDependencies>glew32.lib;zlib1.lib;libeay32MD.lib;physfs.lib;openal32.lib;luajit.lib;libogg_static.lib;libvorbisfile_static.lib;libvorbis_static.lib;opengl32.lib;dbghelp.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<LargeAddressAware>true</LargeAddressAware>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
@@ -66,15 +123,40 @@
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_CRT_SECURE_NO_WARNINGS;_WIN32_WINNT=0x0501;BOT_PROTECTION;CLIENT;CRASH_HANDLER;FW_GRAPHICS;FW_NET;FW_SOUND;FW_XML;BUILD_TYPE="RelWithDebInfo";BUILD_COMMIT="devel";BUILD_REVISION="0";VERSION="0.6.3";%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MultiProcessorCompilation>false</MultiProcessorCompilation>
|
||||
<ObjectFileName>$(IntDir)/%(RelativeDir)/</ObjectFileName>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<ObjectFileName>$(IntDir)\$(Platform)\src\%(RelativeDir)\</ObjectFileName>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalDependencies>glew32.lib;zlib1.lib;libeay32MD.lib;physfs.lib;openal32.lib;luajit.lib;libogg_static.lib;libvorbisfile_static.lib;libvorbis_static.lib;opengl32.lib;dbghelp.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<SubSystem>NotSet</SubSystem>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>
|
||||
<IgnoreSpecificDefaultLibraries>libcmt.lib</IgnoreSpecificDefaultLibraries>
|
||||
<LargeAddressAware>true</LargeAddressAware>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_CRT_SECURE_NO_WARNINGS;_WIN32_WINNT=0x0501;BOT_PROTECTION;CLIENT;CRASH_HANDLER;FW_GRAPHICS;FW_NET;FW_SOUND;FW_XML;BUILD_TYPE="RelWithDebInfo";BUILD_COMMIT="devel";BUILD_REVISION="0";VERSION="0.6.3";%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<ObjectFileName>$(IntDir)\$(Platform)\src\%(RelativeDir)\</ObjectFileName>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalDependencies>glew32.lib;zlib1.lib;libeay32MD.lib;physfs.lib;openal32.lib;luajit.lib;libogg_static.lib;libvorbisfile_static.lib;libvorbis_static.lib;opengl32.lib;dbghelp.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EntryPointSymbol>mainCRTStartup</EntryPointSymbol>
|
||||
<IgnoreSpecificDefaultLibraries>libcmt.lib</IgnoreSpecificDefaultLibraries>
|
||||
<LargeAddressAware>true</LargeAddressAware>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
@@ -120,6 +202,8 @@
|
||||
<ClCompile Include="..\src\client\uisprite.cpp">
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
</ObjectFileName>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
</ObjectFileName>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\framework\core\adaptativeframecounter.cpp" />
|
||||
<ClCompile Include="..\src\framework\core\application.cpp" />
|
||||
@@ -129,6 +213,7 @@
|
||||
<ClCompile Include="..\src\framework\core\configmanager.cpp" />
|
||||
<ClCompile Include="..\src\framework\core\event.cpp">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">FW_GRAPHICS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">FW_GRAPHICS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\framework\core\eventdispatcher.cpp" />
|
||||
<ClCompile Include="..\src\framework\core\filestream.cpp" />
|
||||
@@ -173,6 +258,7 @@
|
||||
<ClCompile Include="..\src\framework\luaengine\luaobject.cpp" />
|
||||
<ClCompile Include="..\src\framework\luaengine\luavaluecasts.cpp">
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(InputDir)\$(IntDir)\</ObjectFileName>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(InputDir)\$(IntDir)\</ObjectFileName>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\framework\luafunctions.cpp" />
|
||||
<ClCompile Include="..\src\framework\net\connection.cpp" />
|
||||
|
Reference in New Issue
Block a user