diff --git a/.gitignore b/.gitignore index c83ecaee..e98c2cac 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,4 @@ otclient.map otclient.layout LOCALTODO tags +Thumbs.db diff --git a/data/fonts/sans-bold-16px.otfont b/data/fonts/sans-bold-16px.otfont new file mode 100644 index 00000000..bdf5cf44 --- /dev/null +++ b/data/fonts/sans-bold-16px.otfont @@ -0,0 +1,6 @@ +Font + name: sans-bold-16px + texture: sans-bold-16px_cp1252 + height: 20 + glyph-size: 24 24 + space-width: 3 diff --git a/data/fonts/sans-bold-16px_cp1252.png b/data/fonts/sans-bold-16px_cp1252.png new file mode 100644 index 00000000..eef9474e Binary files /dev/null and b/data/fonts/sans-bold-16px_cp1252.png differ diff --git a/modules/client_skins/skins/default/fonts/terminus-14px-bold.otfont b/data/fonts/terminus-14px-bold.otfont similarity index 77% rename from modules/client_skins/skins/default/fonts/terminus-14px-bold.otfont rename to data/fonts/terminus-14px-bold.otfont index 030c131e..0814f4a2 100644 --- a/modules/client_skins/skins/default/fonts/terminus-14px-bold.otfont +++ b/data/fonts/terminus-14px-bold.otfont @@ -1,6 +1,6 @@ Font name: terminus-14px-bold - texture: terminus-14px-bold.png + texture: terminus-14px-bold height: 16 y-offset: 2 glyph-size: 16 16 diff --git a/modules/client_skins/skins/default/fonts/terminus-14px-bold.png b/data/fonts/terminus-14px-bold.png similarity index 100% rename from modules/client_skins/skins/default/fonts/terminus-14px-bold.png rename to data/fonts/terminus-14px-bold.png diff --git a/modules/client_skins/skins/default/fonts/verdana-11px-antialised.otfont b/data/fonts/verdana-11px-antialised.otfont similarity index 60% rename from modules/client_skins/skins/default/fonts/verdana-11px-antialised.otfont rename to data/fonts/verdana-11px-antialised.otfont index 70e00556..c6cac896 100644 --- a/modules/client_skins/skins/default/fonts/verdana-11px-antialised.otfont +++ b/data/fonts/verdana-11px-antialised.otfont @@ -1,6 +1,7 @@ Font name: verdana-11px-antialised - texture: verdana-11px-antialised_cp1252.png + texture: verdana-11px-antialised_cp1252 height: 14 glyph-size: 16 16 space-width: 4 + default: true diff --git a/modules/client_skins/skins/default/fonts/verdana-11px-antialised_cp1250.png b/data/fonts/verdana-11px-antialised_cp1250.png similarity index 100% rename from modules/client_skins/skins/default/fonts/verdana-11px-antialised_cp1250.png rename to data/fonts/verdana-11px-antialised_cp1250.png diff --git a/modules/client_skins/skins/default/fonts/verdana-11px-antialised_cp1252.png b/data/fonts/verdana-11px-antialised_cp1252.png similarity index 100% rename from modules/client_skins/skins/default/fonts/verdana-11px-antialised_cp1252.png rename to data/fonts/verdana-11px-antialised_cp1252.png diff --git a/modules/client_skins/skins/default/fonts/verdana-11px-monochrome.otfont b/data/fonts/verdana-11px-monochrome.otfont similarity index 65% rename from modules/client_skins/skins/default/fonts/verdana-11px-monochrome.otfont rename to data/fonts/verdana-11px-monochrome.otfont index 15575969..e39cf0ba 100644 --- a/modules/client_skins/skins/default/fonts/verdana-11px-monochrome.otfont +++ b/data/fonts/verdana-11px-monochrome.otfont @@ -1,6 +1,6 @@ Font name: verdana-11px-monochrome - texture: verdana-11px-monochrome_cp1252.png + texture: verdana-11px-monochrome_cp1252 height: 14 glyph-size: 16 16 space-width: 3 diff --git a/modules/client_skins/skins/default/fonts/verdana-11px-monochrome_cp1250.png b/data/fonts/verdana-11px-monochrome_cp1250.png similarity index 100% rename from modules/client_skins/skins/default/fonts/verdana-11px-monochrome_cp1250.png rename to data/fonts/verdana-11px-monochrome_cp1250.png diff --git a/modules/client_skins/skins/default/fonts/verdana-11px-monochrome_cp1252.png b/data/fonts/verdana-11px-monochrome_cp1252.png similarity index 100% rename from modules/client_skins/skins/default/fonts/verdana-11px-monochrome_cp1252.png rename to data/fonts/verdana-11px-monochrome_cp1252.png diff --git a/modules/client_skins/skins/default/fonts/verdana-11px-rounded.otfont b/data/fonts/verdana-11px-rounded.otfont similarity index 72% rename from modules/client_skins/skins/default/fonts/verdana-11px-rounded.otfont rename to data/fonts/verdana-11px-rounded.otfont index ad29af94..9c18e235 100644 --- a/modules/client_skins/skins/default/fonts/verdana-11px-rounded.otfont +++ b/data/fonts/verdana-11px-rounded.otfont @@ -1,6 +1,6 @@ Font name: verdana-11px-rounded - texture: verdana-11px-rounded_cp1252.png + texture: verdana-11px-rounded_cp1252 height: 16 glyph-size: 16 16 y-offset: -2 diff --git a/modules/client_skins/skins/default/fonts/verdana-11px-rounded_cp1250.png b/data/fonts/verdana-11px-rounded_cp1250.png similarity index 100% rename from modules/client_skins/skins/default/fonts/verdana-11px-rounded_cp1250.png rename to data/fonts/verdana-11px-rounded_cp1250.png diff --git a/modules/client_skins/skins/default/fonts/verdana-11px-rounded_cp1252.png b/data/fonts/verdana-11px-rounded_cp1252.png similarity index 100% rename from modules/client_skins/skins/default/fonts/verdana-11px-rounded_cp1252.png rename to data/fonts/verdana-11px-rounded_cp1252.png diff --git a/modules/client_background/background.png b/data/images/background.png similarity index 100% rename from modules/client_background/background.png rename to data/images/background.png diff --git a/modules/client/clienticon.png b/data/images/clienticon.png similarity index 100% rename from modules/client/clienticon.png rename to data/images/clienticon.png diff --git a/modules/client_skins/skins/default/cursors/horizontal.png b/data/images/cursors/horizontal.png similarity index 100% rename from modules/client_skins/skins/default/cursors/horizontal.png rename to data/images/cursors/horizontal.png diff --git a/modules/client_skins/skins/default/cursors/targetcursor.png b/data/images/cursors/targetcursor.png similarity index 100% rename from modules/client_skins/skins/default/cursors/targetcursor.png rename to data/images/cursors/targetcursor.png diff --git a/modules/client_skins/skins/default/cursors/text.png b/data/images/cursors/text.png similarity index 100% rename from modules/client_skins/skins/default/cursors/text.png rename to data/images/cursors/text.png diff --git a/modules/client_skins/skins/default/cursors/vertical.png b/data/images/cursors/vertical.png similarity index 100% rename from modules/client_skins/skins/default/cursors/vertical.png rename to data/images/cursors/vertical.png diff --git a/data/images/flags/en.png b/data/images/flags/en.png new file mode 100644 index 00000000..f36a6882 Binary files /dev/null and b/data/images/flags/en.png differ diff --git a/data/images/flags/es.png b/data/images/flags/es.png new file mode 100644 index 00000000..fda8ccc8 Binary files /dev/null and b/data/images/flags/es.png differ diff --git a/data/images/flags/pt.png b/data/images/flags/pt.png new file mode 100644 index 00000000..b0c7a22e Binary files /dev/null and b/data/images/flags/pt.png differ diff --git a/modules/game_battle/images/battle_monsters.png b/data/images/game/battle/battle_monsters.png similarity index 100% rename from modules/game_battle/images/battle_monsters.png rename to data/images/game/battle/battle_monsters.png diff --git a/modules/game_battle/images/battle_npcs.png b/data/images/game/battle/battle_npcs.png similarity index 100% rename from modules/game_battle/images/battle_npcs.png rename to data/images/game/battle/battle_npcs.png diff --git a/modules/game_battle/images/battle_party.png b/data/images/game/battle/battle_party.png similarity index 100% rename from modules/game_battle/images/battle_party.png rename to data/images/game/battle/battle_party.png diff --git a/modules/game_battle/images/battle_players.png b/data/images/game/battle/battle_players.png similarity index 100% rename from modules/game_battle/images/battle_players.png rename to data/images/game/battle/battle_players.png diff --git a/modules/game_battle/images/battle_skulls.png b/data/images/game/battle/battle_skulls.png similarity index 100% rename from modules/game_battle/images/battle_skulls.png rename to data/images/game/battle/battle_skulls.png diff --git a/modules/game_combatcontrols/icons/chasemode.png b/data/images/game/combatmodes/chasemode.png similarity index 100% rename from modules/game_combatcontrols/icons/chasemode.png rename to data/images/game/combatmodes/chasemode.png diff --git a/modules/game_combatcontrols/icons/fightbalanced.png b/data/images/game/combatmodes/fightbalanced.png similarity index 100% rename from modules/game_combatcontrols/icons/fightbalanced.png rename to data/images/game/combatmodes/fightbalanced.png diff --git a/modules/game_combatcontrols/icons/fightdefensive.png b/data/images/game/combatmodes/fightdefensive.png similarity index 100% rename from modules/game_combatcontrols/icons/fightdefensive.png rename to data/images/game/combatmodes/fightdefensive.png diff --git a/modules/game_combatcontrols/icons/fightoffensive.png b/data/images/game/combatmodes/fightoffensive.png similarity index 100% rename from modules/game_combatcontrols/icons/fightoffensive.png rename to data/images/game/combatmodes/fightoffensive.png diff --git a/modules/game_combatcontrols/icons/safefight.png b/data/images/game/combatmodes/safefight.png similarity index 100% rename from modules/game_combatcontrols/icons/safefight.png rename to data/images/game/combatmodes/safefight.png diff --git a/modules/game_console/icons/channels.png b/data/images/game/console/channels.png similarity index 100% rename from modules/game_console/icons/channels.png rename to data/images/game/console/channels.png diff --git a/modules/game_console/icons/clearchannel.png b/data/images/game/console/clearchannel.png similarity index 100% rename from modules/game_console/icons/clearchannel.png rename to data/images/game/console/clearchannel.png diff --git a/modules/game_console/icons/closechannel.png b/data/images/game/console/closechannel.png similarity index 100% rename from modules/game_console/icons/closechannel.png rename to data/images/game/console/closechannel.png diff --git a/modules/game_console/icons/ignore.png b/data/images/game/console/ignore.png similarity index 100% rename from modules/game_console/icons/ignore.png rename to data/images/game/console/ignore.png diff --git a/modules/game_console/icons/leftarrow.png b/data/images/game/console/leftarrow.png similarity index 100% rename from modules/game_console/icons/leftarrow.png rename to data/images/game/console/leftarrow.png diff --git a/modules/game_console/icons/rightarrow.png b/data/images/game/console/rightarrow.png similarity index 100% rename from modules/game_console/icons/rightarrow.png rename to data/images/game/console/rightarrow.png diff --git a/modules/game_console/icons/say.png b/data/images/game/console/say.png similarity index 100% rename from modules/game_console/icons/say.png rename to data/images/game/console/say.png diff --git a/modules/game_console/icons/whisper.png b/data/images/game/console/whisper.png similarity index 100% rename from modules/game_console/icons/whisper.png rename to data/images/game/console/whisper.png diff --git a/modules/game_console/icons/yell.png b/data/images/game/console/yell.png similarity index 100% rename from modules/game_console/icons/yell.png rename to data/images/game/console/yell.png diff --git a/modules/gamelib/icons/emblem_blue.png b/data/images/game/emblems/emblem_blue.png similarity index 100% rename from modules/gamelib/icons/emblem_blue.png rename to data/images/game/emblems/emblem_blue.png diff --git a/modules/gamelib/icons/emblem_green.png b/data/images/game/emblems/emblem_green.png similarity index 100% rename from modules/gamelib/icons/emblem_green.png rename to data/images/game/emblems/emblem_green.png diff --git a/modules/gamelib/icons/emblem_red.png b/data/images/game/emblems/emblem_red.png similarity index 100% rename from modules/gamelib/icons/emblem_red.png rename to data/images/game/emblems/emblem_red.png diff --git a/modules/game_minimap/images/flagcheckbox.png b/data/images/game/minimap/flagcheckbox.png similarity index 100% rename from modules/game_minimap/images/flagcheckbox.png rename to data/images/game/minimap/flagcheckbox.png diff --git a/modules/game_minimap/images/floor_down.png b/data/images/game/minimap/floor_down.png similarity index 100% rename from modules/game_minimap/images/floor_down.png rename to data/images/game/minimap/floor_down.png diff --git a/modules/game_minimap/images/floor_up.png b/data/images/game/minimap/floor_up.png similarity index 100% rename from modules/game_minimap/images/floor_up.png rename to data/images/game/minimap/floor_up.png diff --git a/modules/game_minimap/images/mapflags.png b/data/images/game/minimap/mapflags.png similarity index 100% rename from modules/game_minimap/images/mapflags.png rename to data/images/game/minimap/mapflags.png diff --git a/modules/game_minimap/images/zoom_in.png b/data/images/game/minimap/zoom_in.png similarity index 100% rename from modules/game_minimap/images/zoom_in.png rename to data/images/game/minimap/zoom_in.png diff --git a/modules/game_minimap/images/zoom_out.png b/data/images/game/minimap/zoom_out.png similarity index 100% rename from modules/game_minimap/images/zoom_out.png rename to data/images/game/minimap/zoom_out.png diff --git a/modules/gamelib/icons/shield_blue.png b/data/images/game/shields/shield_blue.png similarity index 100% rename from modules/gamelib/icons/shield_blue.png rename to data/images/game/shields/shield_blue.png diff --git a/modules/gamelib/icons/shield_blue_not_shared.png b/data/images/game/shields/shield_blue_not_shared.png similarity index 100% rename from modules/gamelib/icons/shield_blue_not_shared.png rename to data/images/game/shields/shield_blue_not_shared.png diff --git a/modules/gamelib/icons/shield_blue_shared.png b/data/images/game/shields/shield_blue_shared.png similarity index 100% rename from modules/gamelib/icons/shield_blue_shared.png rename to data/images/game/shields/shield_blue_shared.png diff --git a/modules/gamelib/icons/shield_blue_white.png b/data/images/game/shields/shield_blue_white.png similarity index 100% rename from modules/gamelib/icons/shield_blue_white.png rename to data/images/game/shields/shield_blue_white.png diff --git a/modules/gamelib/icons/shield_yellow.png b/data/images/game/shields/shield_yellow.png similarity index 100% rename from modules/gamelib/icons/shield_yellow.png rename to data/images/game/shields/shield_yellow.png diff --git a/modules/gamelib/icons/shield_yellow_not_shared.png b/data/images/game/shields/shield_yellow_not_shared.png similarity index 100% rename from modules/gamelib/icons/shield_yellow_not_shared.png rename to data/images/game/shields/shield_yellow_not_shared.png diff --git a/modules/gamelib/icons/shield_yellow_shared.png b/data/images/game/shields/shield_yellow_shared.png similarity index 100% rename from modules/gamelib/icons/shield_yellow_shared.png rename to data/images/game/shields/shield_yellow_shared.png diff --git a/modules/gamelib/icons/shield_yellow_white.png b/data/images/game/shields/shield_yellow_white.png similarity index 100% rename from modules/gamelib/icons/shield_yellow_white.png rename to data/images/game/shields/shield_yellow_white.png diff --git a/modules/gamelib/icons/skull_black.png b/data/images/game/skulls/skull_black.png similarity index 100% rename from modules/gamelib/icons/skull_black.png rename to data/images/game/skulls/skull_black.png diff --git a/modules/gamelib/icons/skull_green.png b/data/images/game/skulls/skull_green.png similarity index 100% rename from modules/gamelib/icons/skull_green.png rename to data/images/game/skulls/skull_green.png diff --git a/modules/gamelib/icons/skull_orange.png b/data/images/game/skulls/skull_orange.png similarity index 100% rename from modules/gamelib/icons/skull_orange.png rename to data/images/game/skulls/skull_orange.png diff --git a/modules/gamelib/icons/skull_red.png b/data/images/game/skulls/skull_red.png similarity index 100% rename from modules/gamelib/icons/skull_red.png rename to data/images/game/skulls/skull_red.png diff --git a/modules/gamelib/icons/skull_white.png b/data/images/game/skulls/skull_white.png similarity index 100% rename from modules/gamelib/icons/skull_white.png rename to data/images/game/skulls/skull_white.png diff --git a/modules/gamelib/icons/skull_yellow.png b/data/images/game/skulls/skull_yellow.png similarity index 100% rename from modules/gamelib/icons/skull_yellow.png rename to data/images/game/skulls/skull_yellow.png diff --git a/modules/game_inventory/slots/ammo.png b/data/images/game/slots/ammo.png similarity index 100% rename from modules/game_inventory/slots/ammo.png rename to data/images/game/slots/ammo.png diff --git a/modules/game_inventory/slots/back.png b/data/images/game/slots/back.png similarity index 100% rename from modules/game_inventory/slots/back.png rename to data/images/game/slots/back.png diff --git a/modules/game_inventory/slots/body.png b/data/images/game/slots/body.png similarity index 100% rename from modules/game_inventory/slots/body.png rename to data/images/game/slots/body.png diff --git a/modules/game_inventory/slots/feet.png b/data/images/game/slots/feet.png similarity index 100% rename from modules/game_inventory/slots/feet.png rename to data/images/game/slots/feet.png diff --git a/modules/game_inventory/slots/finger.png b/data/images/game/slots/finger.png similarity index 100% rename from modules/game_inventory/slots/finger.png rename to data/images/game/slots/finger.png diff --git a/modules/game_inventory/slots/head.png b/data/images/game/slots/head.png similarity index 100% rename from modules/game_inventory/slots/head.png rename to data/images/game/slots/head.png diff --git a/modules/game_inventory/slots/left-hand.png b/data/images/game/slots/left-hand.png similarity index 100% rename from modules/game_inventory/slots/left-hand.png rename to data/images/game/slots/left-hand.png diff --git a/modules/game_inventory/slots/legs.png b/data/images/game/slots/legs.png similarity index 100% rename from modules/game_inventory/slots/legs.png rename to data/images/game/slots/legs.png diff --git a/modules/game_inventory/slots/neck.png b/data/images/game/slots/neck.png similarity index 100% rename from modules/game_inventory/slots/neck.png rename to data/images/game/slots/neck.png diff --git a/modules/game_inventory/slots/right-hand.png b/data/images/game/slots/right-hand.png similarity index 100% rename from modules/game_inventory/slots/right-hand.png rename to data/images/game/slots/right-hand.png diff --git a/modules/game_cooldown/icons/cooldownIcons.png b/data/images/game/spells/cooldowns.png similarity index 100% rename from modules/game_cooldown/icons/cooldownIcons.png rename to data/images/game/spells/cooldowns.png diff --git a/modules/game_cooldown/icons/icons.png b/data/images/game/spells/defaultspells.png similarity index 100% rename from modules/game_cooldown/icons/icons.png rename to data/images/game/spells/defaultspells.png diff --git a/modules/game_healthinfo/icons/bleeding.png b/data/images/game/states/bleeding.png similarity index 100% rename from modules/game_healthinfo/icons/bleeding.png rename to data/images/game/states/bleeding.png diff --git a/modules/game_healthinfo/icons/burning.png b/data/images/game/states/burning.png similarity index 100% rename from modules/game_healthinfo/icons/burning.png rename to data/images/game/states/burning.png diff --git a/modules/game_healthinfo/icons/cursed.png b/data/images/game/states/cursed.png similarity index 100% rename from modules/game_healthinfo/icons/cursed.png rename to data/images/game/states/cursed.png diff --git a/modules/game_healthinfo/icons/dazzled.png b/data/images/game/states/dazzled.png similarity index 100% rename from modules/game_healthinfo/icons/dazzled.png rename to data/images/game/states/dazzled.png diff --git a/modules/game_healthinfo/icons/drowning.png b/data/images/game/states/drowning.png similarity index 100% rename from modules/game_healthinfo/icons/drowning.png rename to data/images/game/states/drowning.png diff --git a/modules/game_healthinfo/icons/drunk.png b/data/images/game/states/drunk.png similarity index 100% rename from modules/game_healthinfo/icons/drunk.png rename to data/images/game/states/drunk.png diff --git a/modules/game_healthinfo/icons/electrified.png b/data/images/game/states/electrified.png similarity index 100% rename from modules/game_healthinfo/icons/electrified.png rename to data/images/game/states/electrified.png diff --git a/modules/game_healthinfo/icons/freezing.png b/data/images/game/states/freezing.png similarity index 100% rename from modules/game_healthinfo/icons/freezing.png rename to data/images/game/states/freezing.png diff --git a/modules/game_healthinfo/icons/haste.png b/data/images/game/states/haste.png similarity index 100% rename from modules/game_healthinfo/icons/haste.png rename to data/images/game/states/haste.png diff --git a/modules/game_healthinfo/icons/hungry.png b/data/images/game/states/hungry.png similarity index 100% rename from modules/game_healthinfo/icons/hungry.png rename to data/images/game/states/hungry.png diff --git a/modules/game_healthinfo/icons/logout_block.png b/data/images/game/states/logout_block.png similarity index 100% rename from modules/game_healthinfo/icons/logout_block.png rename to data/images/game/states/logout_block.png diff --git a/modules/game_healthinfo/icons/magic_shield.png b/data/images/game/states/magic_shield.png similarity index 100% rename from modules/game_healthinfo/icons/magic_shield.png rename to data/images/game/states/magic_shield.png diff --git a/modules/game_healthinfo/icons/poisoned.png b/data/images/game/states/poisoned.png similarity index 100% rename from modules/game_healthinfo/icons/poisoned.png rename to data/images/game/states/poisoned.png diff --git a/modules/game_healthinfo/icons/protection_zone.png b/data/images/game/states/protection_zone.png similarity index 100% rename from modules/game_healthinfo/icons/protection_zone.png rename to data/images/game/states/protection_zone.png diff --git a/modules/game_healthinfo/icons/protection_zone_block.png b/data/images/game/states/protection_zone_block.png similarity index 100% rename from modules/game_healthinfo/icons/protection_zone_block.png rename to data/images/game/states/protection_zone_block.png diff --git a/modules/game_healthinfo/icons/slowed.png b/data/images/game/states/slowed.png similarity index 100% rename from modules/game_healthinfo/icons/slowed.png rename to data/images/game/states/slowed.png diff --git a/modules/game_healthinfo/icons/strengthened.png b/data/images/game/states/strengthened.png similarity index 100% rename from modules/game_healthinfo/icons/strengthened.png rename to data/images/game/states/strengthened.png diff --git a/data/images/optionstab/audio.png b/data/images/optionstab/audio.png new file mode 100644 index 00000000..e3aee23e Binary files /dev/null and b/data/images/optionstab/audio.png differ diff --git a/data/images/optionstab/console.png b/data/images/optionstab/console.png new file mode 100644 index 00000000..d9ce1dbd Binary files /dev/null and b/data/images/optionstab/console.png differ diff --git a/data/images/optionstab/game.png b/data/images/optionstab/game.png new file mode 100644 index 00000000..40892e4d Binary files /dev/null and b/data/images/optionstab/game.png differ diff --git a/data/images/optionstab/graphics.png b/data/images/optionstab/graphics.png new file mode 100644 index 00000000..ace46d88 Binary files /dev/null and b/data/images/optionstab/graphics.png differ diff --git a/data/images/topbuttons/audio.png b/data/images/topbuttons/audio.png new file mode 100644 index 00000000..7bac9e91 Binary files /dev/null and b/data/images/topbuttons/audio.png differ diff --git a/data/images/topbuttons/audio_mute.png b/data/images/topbuttons/audio_mute.png new file mode 100644 index 00000000..998f051d Binary files /dev/null and b/data/images/topbuttons/audio_mute.png differ diff --git a/modules/game_battle/battle.png b/data/images/topbuttons/battle.png similarity index 100% rename from modules/game_battle/battle.png rename to data/images/topbuttons/battle.png diff --git a/modules/game_combatcontrols/combatcontrols.png b/data/images/topbuttons/combatcontrols.png similarity index 100% rename from modules/game_combatcontrols/combatcontrols.png rename to data/images/topbuttons/combatcontrols.png diff --git a/modules/game_cooldown/cooldown.png b/data/images/topbuttons/cooldowns.png similarity index 100% rename from modules/game_cooldown/cooldown.png rename to data/images/topbuttons/cooldowns.png diff --git a/modules/game_healthinfo/healthinfo.png b/data/images/topbuttons/healthinfo.png similarity index 100% rename from modules/game_healthinfo/healthinfo.png rename to data/images/topbuttons/healthinfo.png diff --git a/modules/game_hotkeys/icon.png b/data/images/topbuttons/hotkeys.png similarity index 100% rename from modules/game_hotkeys/icon.png rename to data/images/topbuttons/hotkeys.png diff --git a/modules/game_inventory/inventory.png b/data/images/topbuttons/inventory.png similarity index 100% rename from modules/game_inventory/inventory.png rename to data/images/topbuttons/inventory.png diff --git a/modules/client_entergame/login.png b/data/images/topbuttons/login.png similarity index 100% rename from modules/client_entergame/login.png rename to data/images/topbuttons/login.png diff --git a/modules/client_skins/skins/default/images/logout.png b/data/images/topbuttons/logout.png similarity index 100% rename from modules/client_skins/skins/default/images/logout.png rename to data/images/topbuttons/logout.png diff --git a/modules/game_minimap/minimap.png b/data/images/topbuttons/minimap.png similarity index 100% rename from modules/game_minimap/minimap.png rename to data/images/topbuttons/minimap.png diff --git a/modules/client_modulemanager/modulemanager.png b/data/images/topbuttons/modulemanager.png similarity index 100% rename from modules/client_modulemanager/modulemanager.png rename to data/images/topbuttons/modulemanager.png diff --git a/modules/client_entergame/motd.png b/data/images/topbuttons/motd.png similarity index 100% rename from modules/client_entergame/motd.png rename to data/images/topbuttons/motd.png diff --git a/modules/client_options/options.png b/data/images/topbuttons/options.png similarity index 100% rename from modules/client_options/options.png rename to data/images/topbuttons/options.png diff --git a/modules/client_particles/particles.png b/data/images/topbuttons/particles.png similarity index 100% rename from modules/client_particles/particles.png rename to data/images/topbuttons/particles.png diff --git a/modules/game_questlog/questlog.png b/data/images/topbuttons/questlog.png similarity index 100% rename from modules/game_questlog/questlog.png rename to data/images/topbuttons/questlog.png diff --git a/modules/game_skills/skills.png b/data/images/topbuttons/skills.png similarity index 100% rename from modules/game_skills/skills.png rename to data/images/topbuttons/skills.png diff --git a/modules/game_spelllist/spelllist.png b/data/images/topbuttons/spelllist.png similarity index 100% rename from modules/game_spelllist/spelllist.png rename to data/images/topbuttons/spelllist.png diff --git a/modules/client_terminal/terminal.png b/data/images/topbuttons/terminal.png similarity index 100% rename from modules/client_terminal/terminal.png rename to data/images/topbuttons/terminal.png diff --git a/modules/game_viplist/viplist.png b/data/images/topbuttons/viplist.png similarity index 100% rename from modules/game_viplist/viplist.png rename to data/images/topbuttons/viplist.png diff --git a/data/images/ui/arrow_horizontal.png b/data/images/ui/arrow_horizontal.png new file mode 100644 index 00000000..9cd5aacd Binary files /dev/null and b/data/images/ui/arrow_horizontal.png differ diff --git a/data/images/ui/arrow_vertical.png b/data/images/ui/arrow_vertical.png new file mode 100644 index 00000000..a5de15ef Binary files /dev/null and b/data/images/ui/arrow_vertical.png differ diff --git a/modules/client_skins/skins/default/images/button_rounded.png b/data/images/ui/button.png similarity index 100% rename from modules/client_skins/skins/default/images/button_rounded.png rename to data/images/ui/button.png diff --git a/modules/client_skins/skins/default/images/menubutton.png b/data/images/ui/button_popupmenu.png similarity index 100% rename from modules/client_skins/skins/default/images/menubutton.png rename to data/images/ui/button_popupmenu.png diff --git a/data/images/ui/button_rounded.png b/data/images/ui/button_rounded.png new file mode 100644 index 00000000..49c45dbd Binary files /dev/null and b/data/images/ui/button_rounded.png differ diff --git a/modules/client_skins/skins/default/images/button_square.png b/data/images/ui/button_square.png similarity index 100% rename from modules/client_skins/skins/default/images/button_square.png rename to data/images/ui/button_square.png diff --git a/modules/client_topmenu/images/top_button.png b/data/images/ui/button_top.png similarity index 100% rename from modules/client_topmenu/images/top_button.png rename to data/images/ui/button_top.png diff --git a/data/images/ui/button_topgame.png b/data/images/ui/button_topgame.png new file mode 100644 index 00000000..7820d506 Binary files /dev/null and b/data/images/ui/button_topgame.png differ diff --git a/modules/client_skins/skins/default/images/checkbox.png b/data/images/ui/checkbox.png similarity index 100% rename from modules/client_skins/skins/default/images/checkbox.png rename to data/images/ui/checkbox.png diff --git a/modules/client_skins/skins/default/images/colorbox.png b/data/images/ui/colorbox.png similarity index 100% rename from modules/client_skins/skins/default/images/colorbox.png rename to data/images/ui/colorbox.png diff --git a/modules/client_skins/skins/default/images/combobox_rounded.png b/data/images/ui/combobox.png similarity index 100% rename from modules/client_skins/skins/default/images/combobox_rounded.png rename to data/images/ui/combobox.png diff --git a/modules/client_skins/skins/default/images/arrow_up.png b/data/images/ui/combobox_rounded.png similarity index 74% rename from modules/client_skins/skins/default/images/arrow_up.png rename to data/images/ui/combobox_rounded.png index 8fef8c79..a3d9c62b 100644 Binary files a/modules/client_skins/skins/default/images/arrow_up.png and b/data/images/ui/combobox_rounded.png differ diff --git a/modules/client_skins/skins/default/images/combobox_square.png b/data/images/ui/combobox_square.png similarity index 100% rename from modules/client_skins/skins/default/images/combobox_square.png rename to data/images/ui/combobox_square.png diff --git a/modules/client_skins/skins/default/images/item.png b/data/images/ui/item.png similarity index 100% rename from modules/client_skins/skins/default/images/item.png rename to data/images/ui/item.png diff --git a/modules/client_skins/skins/default/images/menubox.png b/data/images/ui/menubox.png similarity index 100% rename from modules/client_skins/skins/default/images/menubox.png rename to data/images/ui/menubox.png diff --git a/modules/client_skins/skins/default/images/miniwindow.png b/data/images/ui/miniwindow.png similarity index 100% rename from modules/client_skins/skins/default/images/miniwindow.png rename to data/images/ui/miniwindow.png diff --git a/modules/client_skins/skins/default/images/miniwindowbuttons.png b/data/images/ui/miniwindow_buttons.png similarity index 100% rename from modules/client_skins/skins/default/images/miniwindowbuttons.png rename to data/images/ui/miniwindow_buttons.png diff --git a/modules/client_skins/skins/default/images/bottompanel.png b/data/images/ui/panel_bottom.png similarity index 100% rename from modules/client_skins/skins/default/images/bottompanel.png rename to data/images/ui/panel_bottom.png diff --git a/modules/client_skins/skins/default/images/container_bg.png b/data/images/ui/panel_container.png similarity index 100% rename from modules/client_skins/skins/default/images/container_bg.png rename to data/images/ui/panel_container.png diff --git a/modules/client_skins/skins/default/images/contentpanel.png b/data/images/ui/panel_content.png similarity index 100% rename from modules/client_skins/skins/default/images/contentpanel.png rename to data/images/ui/panel_content.png diff --git a/modules/client_skins/skins/default/images/panel_flat.png b/data/images/ui/panel_flat.png similarity index 100% rename from modules/client_skins/skins/default/images/panel_flat.png rename to data/images/ui/panel_flat.png diff --git a/modules/client_skins/skins/default/images/panel_lightflat.png b/data/images/ui/panel_lightflat.png similarity index 100% rename from modules/client_skins/skins/default/images/panel_lightflat.png rename to data/images/ui/panel_lightflat.png diff --git a/modules/client_skins/skins/default/images/mappanel.png b/data/images/ui/panel_map.png similarity index 100% rename from modules/client_skins/skins/default/images/mappanel.png rename to data/images/ui/panel_map.png diff --git a/modules/client_skins/skins/default/images/sidepanel.png b/data/images/ui/panel_side.png similarity index 100% rename from modules/client_skins/skins/default/images/sidepanel.png rename to data/images/ui/panel_side.png diff --git a/modules/client_topmenu/images/top_panel.png b/data/images/ui/panel_top.png similarity index 100% rename from modules/client_topmenu/images/top_panel.png rename to data/images/ui/panel_top.png diff --git a/modules/client_skins/skins/default/images/progressbar.png b/data/images/ui/progressbar.png similarity index 100% rename from modules/client_skins/skins/default/images/progressbar.png rename to data/images/ui/progressbar.png diff --git a/modules/client_skins/skins/default/images/scrollbar.png b/data/images/ui/scrollbar.png similarity index 100% rename from modules/client_skins/skins/default/images/scrollbar.png rename to data/images/ui/scrollbar.png diff --git a/modules/client_skins/skins/default/images/horizontal_separator.png b/data/images/ui/separator_horizontal.png similarity index 100% rename from modules/client_skins/skins/default/images/horizontal_separator.png rename to data/images/ui/separator_horizontal.png diff --git a/modules/client_skins/skins/default/images/vertical_separator.png b/data/images/ui/separator_vertical.png similarity index 100% rename from modules/client_skins/skins/default/images/vertical_separator.png rename to data/images/ui/separator_vertical.png diff --git a/data/images/ui/spinbox.png b/data/images/ui/spinbox.png new file mode 100644 index 00000000..635fb32a Binary files /dev/null and b/data/images/ui/spinbox.png differ diff --git a/modules/client_skins/skins/default/images/spinbox_down.png b/data/images/ui/spinbox_down.png similarity index 100% rename from modules/client_skins/skins/default/images/spinbox_down.png rename to data/images/ui/spinbox_down.png diff --git a/modules/client_skins/skins/default/images/spinbox_up.png b/data/images/ui/spinbox_up.png similarity index 100% rename from modules/client_skins/skins/default/images/spinbox_up.png rename to data/images/ui/spinbox_up.png diff --git a/modules/client_skins/skins/default/images/tabbutton_rounded.png b/data/images/ui/tabbutton_rounded.png similarity index 100% rename from modules/client_skins/skins/default/images/tabbutton_rounded.png rename to data/images/ui/tabbutton_rounded.png diff --git a/modules/client_skins/skins/default/images/tabbutton_square.png b/data/images/ui/tabbutton_square.png similarity index 100% rename from modules/client_skins/skins/default/images/tabbutton_square.png rename to data/images/ui/tabbutton_square.png diff --git a/modules/client_skins/skins/default/images/textedit.png b/data/images/ui/textedit.png similarity index 100% rename from modules/client_skins/skins/default/images/textedit.png rename to data/images/ui/textedit.png diff --git a/modules/client_skins/skins/default/images/window.png b/data/images/ui/window.png similarity index 100% rename from modules/client_skins/skins/default/images/window.png rename to data/images/ui/window.png diff --git a/data/images/ui/window_headless.png b/data/images/ui/window_headless.png new file mode 100644 index 00000000..846dfe1b Binary files /dev/null and b/data/images/ui/window_headless.png differ diff --git a/modules/client_locales/locales/en.lua b/data/locales/en.lua similarity index 79% rename from modules/client_locales/locales/en.lua rename to data/locales/en.lua index 155c24f7..3bcf03a7 100644 --- a/modules/client_locales/locales/en.lua +++ b/data/locales/en.lua @@ -7,4 +7,4 @@ locale = { translation = {} } -Locales.installLocale(locale) +modules.client_locales.installLocale(locale) diff --git a/modules/client_locales/locales/es.lua b/data/locales/es.lua similarity index 83% rename from modules/client_locales/locales/es.lua rename to data/locales/es.lua index 69a9421b..c19cc95b 100644 --- a/modules/client_locales/locales/es.lua +++ b/data/locales/es.lua @@ -3,7 +3,7 @@ locale = { name = "es", charset = "cp1252", - languageName = "Español", + languageName = "Espa�ol", translation = { ["1a) Offensive Name"] = false, @@ -28,17 +28,17 @@ locale = { ["Accept"] = false, ["Account name"] = "Nombre de la cuenta", ["Account Status:\nFree Account"] = "Estado de la cuenta:\nGratis", - ["Account Status:\nPremium Account (%s) days left"] = "Estado de la cuenta:\nCuenta premium (%s) días restantes", + ["Account Status:\nPremium Account (%s) days left"] = "Estado de la cuenta:\nCuenta premium (%s) d�as restantes", ["Action:"] = false, - ["Add"] = "Añadir", - ["Add new VIP"] = "Añadir nuevo VIP", + ["Add"] = "A�adir", + ["Add new VIP"] = "A�adir nuevo VIP", ["Addon 1"] = "Addon 1", ["Addon 2"] = "Addon 2", ["Addon 3"] = "Addon 3", - ["Add to VIP list"] = "Añadir a lista VIP", - ["Adjust volume"] = "Ajustar volúmen", + ["Add to VIP list"] = "A�adir a lista VIP", + ["Adjust volume"] = "Ajustar vol�men", ["Alas! Brave adventurer, you have met a sad fate.\nBut do not despair, for the gods will bring you back\ninto this world in exchange for a small sacrifice\n\nSimply click on Ok to resume your journeys!"] = false, - ["All modules and scripts were reloaded."] = "Todos los módulos y scripts han sido reiniciados", + ["All modules and scripts were reloaded."] = "Todos los m�dulos y scripts han sido reiniciados", ["Allow auto chase override"] = false, ["Amount:"] = "Cantidad:", ["Amount"] = false, @@ -46,10 +46,10 @@ locale = { ["Are you sure you want to logout?"] = false, ["Attack"] = "Atacar", ["Author"] = "Autor", - ["Autoload"] = "Cargar automáticamente", + ["Autoload"] = "Cargar autom�ticamente", ["Autoload priority"] = "Prioridad de carga", - ["Auto login"] = "Entrar automáticamente", - ["Auto login selected character on next charlist load"] = "Entrar automáticamente con un personage cuando se vuelva a abrir la lista de personajes", + ["Auto login"] = "Entrar autom�ticamente", + ["Auto login selected character on next charlist load"] = "Entrar autom�ticamente con un personage cuando se vuelva a abrir la lista de personajes", ["Axe Fighting"] = "Combate con Hacha", ["Balance:"] = false, ["Banishment"] = false, @@ -57,7 +57,7 @@ locale = { ["Battle"] = "Batalla", ["Browse"] = false, ["Bug report sent."] = false, - ["Button Assign"] = "Seleccionar Botón", + ["Button Assign"] = "Seleccionar Bot�n", ["Buy"] = "Comprar", ["Buy Now"] = false, ["Buy Offers"] = false, @@ -69,7 +69,7 @@ locale = { ["Center"] = false, ["Channels"] = "Canales", ["Character List"] = "Lista de personajes", - ["Classic control"] = "Control clásico", + ["Classic control"] = "Control cl�sico", ["Clear current message window"] = false, ["Clear object"] = "Limpiar objeto", ["Client needs update."] = false, @@ -79,17 +79,17 @@ locale = { ["Combat Controls"] = "Controles de combate", ["Comment:"] = false, ["Connecting to game server..."] = "Conectando al servidor de juego...", - ["Connecting to login server..."] = "Conectando al servidor de autentificación...", + ["Connecting to login server..."] = "Conectando al servidor de autentificaci�n...", ["Copy message"] = false, ["Copy name"] = false, ["Copy Name"] = "Copiar Nombre", ["Create New Offer"] = false, ["Create Offer"] = false, ["Current hotkeys:"] = "Atajos actuales", - ["Current hotkey to add: %s"] = "Atajo actual para añadir: %s", + ["Current hotkey to add: %s"] = "Atajo actual para a�adir: %s", ["Current Offers"] = false, ["Default"] = "Principal", - ["Description"] = "Descripción", + ["Description"] = "Descripci�n", ["Destructive Behaviour"] = false, ["Detail"] = "Detalle", ["Details"] = false, @@ -100,7 +100,7 @@ locale = { ["Edit Text"] = "Editar Texto", ["Enable music"] = false, ["Enable Shared Experience"] = "Activar experiencia compartida", - ["Enable vertical synchronization"] = "Activar sincronización vertical", + ["Enable vertical synchronization"] = "Activar sincronizaci�n vertical", ["Enter Game"] = "Entrar al juego", ["Enter one name per line."] = false, ["Error"] = "Error", @@ -112,12 +112,12 @@ locale = { ["Filter list to match your level"] = false, ["Filter list to match your vocation"] = false, ["Fishing"] = "Pesca", - ["Fist Fighting"] = "Combate con Puños", + ["Fist Fighting"] = "Combate con Pu�os", ["Follow"] = "Seguir", ["Fullscreen"] = "Pantalla Completa", ["Game framerate limit: %s"] = false, ["General"] = "General", - ["Graphics"] = "Gráficos", + ["Graphics"] = "Gr�ficos", ["Graphics Engine:"] = false, ["Head"] = "Cabeza", ["Health Info"] = false, @@ -150,22 +150,22 @@ locale = { ["Location"] = false, ["Logging out..."] = false, ["Login"] = "Entrar", - ["Login Error"] = "Error de Autentificación", - ["Login Error"] = "Error de Autentificación", + ["Login Error"] = "Error de Autentificaci�n", + ["Login Error"] = "Error de Autentificaci�n", ["Logout"] = false, ["Look"] = "Ver", - ["Magic Level"] = "Nivel Mágico", + ["Magic Level"] = "Nivel M�gico", ["Make sure that your client uses\nthe correct game protocol version"] = "Compruebe que tu cliente use\nuse el mismo protocolo que el servidor de juego", ["Mana"] = "Mana", ["Manage hotkeys:"] = "Configurar atajos:", ["Market"] = false, ["Market Offers"] = false, - ["Message of the day"] = "Mensaje del día", + ["Message of the day"] = "Mensaje del d�a", ["Message to "] = false, ["Message to %s"] = "Mandar mensaje a %s", ["Minimap"] = "Minimapa", - ["Module Manager"] = "Administrador de Módulos", - ["Module name"] = "Nombre del módulo", + ["Module Manager"] = "Administrador de M�dulos", + ["Module name"] = "Nombre del m�dulo", ["Move Stackable Item"] = "Mover objeto contable", ["Move up"] = "Mover arriba", ["My Offers"] = false, @@ -195,11 +195,11 @@ locale = { ["Options"] = "Opciones", ["Particles Manager"] = false, ["Pass Leadership to %s"] = "Pasar el liderazgo a %s", - ["Password"] = "Contraseña", + ["Password"] = "Contrase�a", ["Pause"] = false, ["Piece Price:"] = false, ["Please enter a character name:"] = "Por favor, introduce el nombre de un personaje:", - ["Please, press the key you wish to add onto your hotkeys manager"] = "Por favor, presione la tecla que desee para\nañadir a tu administrador de atajos", + ["Please, press the key you wish to add onto your hotkeys manager"] = "Por favor, presione la tecla que desee para\na�adir a tu administrador de atajos", ["Please Select"] = false, ["Please use this dialog to only report bugs. Do not report rule violations here!"] = false, ["Please wait"] = "Por favor, espere", @@ -217,8 +217,8 @@ locale = { ["Reject"] = false, ["Reload"] = false, ["Reload All"] = "Recargar Todos", - ["Remember account and password when starts otclient"] = "Recordar cuenta y contraseña cuando inicie otclient", - ["Remember password"] = "Recordar contraseña", + ["Remember account and password when starts otclient"] = "Recordar cuenta y contrase�a cuando inicie otclient", + ["Remember password"] = "Recordar contrase�a", ["Remove"] = "Quitar", ["Remove %s"] = "Quitar %s", ["Report Bug"] = false, @@ -234,7 +234,7 @@ locale = { ["Sell Now"] = false, ["Sell Offers"] = false, ["Send"] = false, - ["Send automatically"] = "Enviar automáticamente", + ["Send automatically"] = "Enviar autom�ticamente", ["Server"] = "Servidor", ["Server Log"] = "Registro del servidor", ["Set Outfit"] = "Escoger Traje", @@ -281,7 +281,7 @@ locale = { ["Use on target"] = "Usar en objetivo", ["Use on yourself"] = "Usar en ti mismo", ["Use with ..."] = "Usar en ...", - ["Version"] = "Versión", + ["Version"] = "Versi�n", ["VIP list"] = "Lista VIP", ["VIP List"] = "Lista VIP", ["Voc."] = false, @@ -291,27 +291,27 @@ locale = { ["With crosshair"] = "Con mirilla", ["Yes"] = false, ["You are bleeding"] = false, - ["You are burning"] = "Estás quemando", - ["You are cursed"] = "Estás maldito", - ["You are dazzled"] = "Estás deslumbrado", + ["You are burning"] = "Est�s quemando", + ["You are cursed"] = "Est�s maldito", + ["You are dazzled"] = "Est�s deslumbrado", ["You are dead."] = "Has muerto.", ["You are dead"] = false, - ["You are drowing"] = "Te estás ahogando", + ["You are drowing"] = "Te est�s ahogando", ["You are drunk"] = false, - ["You are electrified"] = "Estás electrocutado", - ["You are freezing"] = "Estás congelado", + ["You are electrified"] = "Est�s electrocutado", + ["You are freezing"] = "Est�s congelado", ["You are hasted"] = "Vas con prisa", ["You are hungry"] = false, - ["You are paralysed"] = "Estás paralizado", - ["You are poisoned"] = "Estás envenenado", - ["You are protected by a magic shield"] = "Estás protegido por un escudo mágico", - ["You are strengthened"] = "Estás reforzado", - ["You are within a protection zone"] = "Estás en una zona de protección", + ["You are paralysed"] = "Est�s paralizado", + ["You are poisoned"] = "Est�s envenenado", + ["You are protected by a magic shield"] = "Est�s protegido por un escudo m�gico", + ["You are strengthened"] = "Est�s reforzado", + ["You are within a protection zone"] = "Est�s en una zona de protecci�n", ["You can enter new text."] = false, ["You have %s percent"] = "Tienes %s por ciento", ["You have %s percent to go"] = "Te falta %s por ciento para avanzar", - ["You may not logout during a fight"] = "No puedes salir mientras estás en un combate", - ["You may not logout or enter a protection zone"] = "No puedes salir o entrar en una zona de protección", + ["You may not logout during a fight"] = "No puedes salir mientras est�s en un combate", + ["You may not logout or enter a protection zone"] = "No puedes salir o entrar en una zona de protecci�n", ["You must enter a comment."] = false, ["You must enter an account name and password."] = false, ["You must enter a valid server address and port."] = false, @@ -323,4 +323,4 @@ locale = { } } -Locales.installLocale(locale) +modules.client_locales.installLocale(locale) diff --git a/modules/client_locales/locales/pl.lua b/data/locales/pl.lua similarity index 99% rename from modules/client_locales/locales/pl.lua rename to data/locales/pl.lua index 0da6be3b..f2f2f0af 100644 --- a/modules/client_locales/locales/pl.lua +++ b/data/locales/pl.lua @@ -326,4 +326,4 @@ locale = { } } -Locales.installLocale(locale) +modules.client_locales.installLocale(locale) diff --git a/modules/client_locales/locales/pt.lua b/data/locales/pt.lua similarity index 62% rename from modules/client_locales/locales/pt.lua rename to data/locales/pt.lua index d5b09df3..a28e576d 100644 --- a/modules/client_locales/locales/pt.lua +++ b/data/locales/pt.lua @@ -1,35 +1,35 @@ locale = { name = "pt", charset = "cp1252", - languageName = "Português", + languageName = "Portugu�s", - -- As traduções devem vir sempre em ordem alfabética. + -- As tradu��es devem vir sempre em ordem alfab�tica. translation = { ["1a) Offensive Name"] = "1a) Nome ofensivo", - ["1b) Invalid Name Format"] = "1b) Nome com formato inválido", - ["1c) Unsuitable Name"] = "1c) Nome não adequado", - ["1d) Name Inciting Rule Violation"] = "1d) Nome estimulando violação de regra", - ["2a) Offensive Statement"] = "2a) Afirmação ofensiva", + ["1b) Invalid Name Format"] = "1b) Nome com formato inv�lido", + ["1c) Unsuitable Name"] = "1c) Nome n�o adequado", + ["1d) Name Inciting Rule Violation"] = "1d) Nome estimulando viola��o de regra", + ["2a) Offensive Statement"] = "2a) Afirma��o ofensiva", ["2b) Spamming"] = "2b) Spamming", - ["2c) Illegal Advertising"] = "2c) Anúncio ilegal", - ["2d) Off-Topic Public Statement"] = "2d) Afirmação pública fora de contexto", - ["2e) Non-English Public Statement"] = "2e) Afirmação pública em lingua não inglesa", - ["2f) Inciting Rule Violation"] = "2f) Estimulando violação de regra", + ["2c) Illegal Advertising"] = "2c) An�ncio ilegal", + ["2d) Off-Topic Public Statement"] = "2d) Afirma��o p�blica fora de contexto", + ["2e) Non-English Public Statement"] = "2e) Afirma��o p�blica em lingua n�o inglesa", + ["2f) Inciting Rule Violation"] = "2f) Estimulando viola��o de regra", ["3a) Bug Abuse"] = "3a) Abuso de falhas", ["3b) Game Weakness Abuse"] = "3b) Abuso de falhas no jogo", ["3c) Using Unofficial Software to Play"] = "3c) Uso de programas ilegais para jogar", ["3d) Hacking"] = "3d) Hacking", ["3e) Multi-Clienting"] = "3e) Uso de mais de um cliente para jogar", ["3f) Account Trading or Sharing"] = "3f) Troca de contas ou compartilhamento", - ["4a) Threatening Gamemaster"] = "4a) Ameaçar Gamemaster", - ["4b) Pretending to Have Influence on Rule Enforcement"] = "4b) Fingir ter influencia sobre a execução de regras", - ["4c) False Report to Gamemaster"] = "4c) Relatório falso para Gamemaster", + ["4a) Threatening Gamemaster"] = "4a) Amea�ar Gamemaster", + ["4b) Pretending to Have Influence on Rule Enforcement"] = "4b) Fingir ter influencia sobre a execu��o de regras", + ["4c) False Report to Gamemaster"] = "4c) Relat�rio falso para Gamemaster", ["Abilities"] = "Abilidades", ["Accept"] = "Aceitar", ["Account name"] = "Nome da conta", - ["Account Status:\nFree Account"] = "Estado da conta:\nGrátis", + ["Account Status:\nFree Account"] = "Estado da conta:\nGr�tis", ["Account Status:\nPremium Account (%s) days left"] = "Estado da conta:\nConta premium (%s) dias faltando", - ["Action:"] = "Ação:", + ["Action:"] = "A��o:", ["Add"] = "Adicionar", ["Add new VIP"] = "Adicionar nova VIP", ["Addon 1"] = "Addon 1", @@ -39,13 +39,13 @@ locale = { ["Adjust volume"] = "Ajustar volume", ["Alas! Brave adventurer, you have met a sad fate.\nBut do not despair, for the gods will bring you back\ninto this world in exchange for a small sacrifice\n\nSimply click on Ok to resume your journeys!"] = false, ["All"] = "Todos", - ["All modules and scripts were reloaded."] = "Todos módulos e scripts foram recarregados.", - ["Allow auto chase override"] = "Permitir sobrescrever o modo de perseguição", - ["Also known as dash in tibia community, recommended\nfor playing characters with high speed"] = "Também conhecido como dash na comunidade tibiana, recomendado\npara jogar com personagem que possuam velocidade alta", + ["All modules and scripts were reloaded."] = "Todos m�dulos e scripts foram recarregados.", + ["Allow auto chase override"] = "Permitir sobrescrever o modo de persegui��o", + ["Also known as dash in tibia community, recommended\nfor playing characters with high speed"] = "Tamb�m conhecido como dash na comunidade tibiana, recomendado\npara jogar com personagem que possuam velocidade alta", ["Amount:"] = "Quantidade:", ["Amount"] = "Quantidade", - ["Anonymous"] = "Anônimo", - ["Are you sure you want to logout?"] = "Você tem certeza que quer sair?", + ["Anonymous"] = "An�nimo", + ["Are you sure you want to logout?"] = "Voc� tem certeza que quer sair?", ["Attack"] = "Atacar", ["Author"] = "Autor", ["Autoload"] = "Carregar automaticamente", @@ -59,19 +59,19 @@ locale = { ["Battle"] = "Batalha", ["Browse"] = "Navegar", ["Bug report sent."] = "Reporte de bug enviado.", - ["Button Assign"] = "Selecionar botão", + ["Button Assign"] = "Selecionar bot�o", ["Buy"] = "Comprar", ["Buy Now"] = "Comparar agora", ["Buy Offers"] = "Ofertas de compra", ["Buy with backpack"] = "Comprar com mochila", ["Cancel"] = "Cancelar", - ["Cannot login while already in game."] = "Não é possivel logar enquanto já estiver jogando.", + ["Cannot login while already in game."] = "N�o � possivel logar enquanto j� estiver jogando.", ["Cap"] = "Cap", ["Capacity"] = "Capacidade", ["Center"] = "Centro", ["Channels"] = "Canais", ["Character List"] = "Lista de personagens", - ["Classic control"] = "Controle clássico", + ["Classic control"] = "Controle cl�ssico", ["Clear current message window"] = "Apagar mensagens", ["Clear object"] = "Limpar objeto", ["Client needs update."] = "O client do jogo precisa ser atualizado", @@ -79,9 +79,9 @@ locale = { ["Close this channel"] = "Fechar esse canal", ["Club Fighting"] = "Combate com Porrete", ["Combat Controls"] = "Controles de combate", - ["Comment:"] = "Comentário:", + ["Comment:"] = "Coment�rio:", ["Connecting to game server..."] = "Conectando no servidor do jogo...", - ["Connecting to login server..."] = "Conectando no servidor de autenticação...", + ["Connecting to login server..."] = "Conectando no servidor de autentica��o...", ["Console"] = "Console", ["Copy message"] = "Copiar mensagem", ["Copy name"] = "Copiar nome", @@ -92,21 +92,21 @@ locale = { ["Current hotkeys:"] = "Atalhos atuais", ["Current hotkey to add: %s"] = "Atalho atual para adicionar: %s", ["Current Offers"] = "Ofertas atuais", - ["Default"] = "Padrão", - ["Description"] = "Descrição", + ["Default"] = "Padr�o", + ["Description"] = "Descri��o", ["Destructive Behaviour"] = "Comportamento destrutivo", ["Detail"] = "Detalhe", ["Details"] = "Detalhes", - ["Disable Shared Experience"] = "Desativar experiência compartilhada", - ["Display connection speed to the server (milliseconds)"] = "Exibir a velocidade de conexão com o servidor (milisegundos)", - ["Distance Fighting"] = "Combate a Distância", + ["Disable Shared Experience"] = "Desativar experi�ncia compartilhada", + ["Display connection speed to the server (milliseconds)"] = "Exibir a velocidade de conex�o com o servidor (milisegundos)", + ["Distance Fighting"] = "Combate a Dist�ncia", ["Edit hotkey text:"] = "Editar texto do atalho", ["Edit List"] = "Editar lista", ["Edit Text"] = "Editar Texto", ["Enable music"] = "Ativar musica", ["Enable smart walking"] = "Ativar andar inteligente", - ["Enable Shared Experience"] = "Ativar experiência compartilhada", - ["Enable vertical synchronization"] = "Ativar sincronização vertical", + ["Enable Shared Experience"] = "Ativar experi�ncia compartilhada", + ["Enable vertical synchronization"] = "Ativar sincroniza��o vertical", ["Enable walk booster"] = "Ativar andar intensificado", ["Enter Game"] = "Entrar no jogo", ["Enter one name per line."] = "Entre somente um nome por linha.", @@ -115,56 +115,56 @@ locale = { ["Excessive Unjustified Player Killing"] = "Assassinato em excesso, sem justificativa, de jogadores", ["Exclude from private chat"] = "Excluir do canal privado", ["Exit"] = "Sair", - ["Experience"] = "Experiência", + ["Experience"] = "Experi�ncia", ["Filter list to match your level"] = "Filtrar a lista para o seu level", - ["Filter list to match your vocation"] = "Filtrar a lista para a sua vocação", + ["Filter list to match your vocation"] = "Filtrar a lista para a sua voca��o", ["Find:"] = "Procurar", ["Fishing"] = "Pesca", ["Fist Fighting"] = "Porrada", ["Follow"] = "Seguir", - ["Force Exit"] = "Forçar Saida", + ["Force Exit"] = "For�ar Saida", ["Fullscreen"] = "Tela cheia", ["Game"] = "Jogo", ["Game framerate limit: %s"] = "Limite da taxa de quadros do jogo: %s", ["General"] = "Geral", - ["Graphics"] = "Gráficos", - ["Graphics Engine:"] = "Motor Gráfico:", - ["Head"] = "Cabeça", + ["Graphics"] = "Gr�ficos", + ["Graphics Engine:"] = "Motor Gr�fico:", + ["Head"] = "Cabe�a", ["Health Info"] = "Barra de Vida", - ["Health Information"] = "Informação de vida", + ["Health Information"] = "Informa��o de vida", ["Hide monsters"] = "Esconder montros", ["Hide non-skull players"] = "Esconder jogadores sem caveira", ["Hide Npcs"] = "Esconder NPCs", ["Hide party members"] = "Esconder membros do grupo", ["Hide players"] = "Esconder jogadores", ["Hit Points"] = "Pontos de Vida", - ["Hold right mouse button to navigate\nScroll mouse middle button to zoom"] = "Segure o botão direito do mouse para navegar\nRole o botão central do mouse para mudar o zoom", + ["Hold right mouse button to navigate\nScroll mouse middle button to zoom"] = "Segure o bot�o direito do mouse para navegar\nRole o bot�o central do mouse para mudar o zoom", ["Hotkeys"] = "Atalhos", - ["If you shut down the program, your character might stay in the game.\nClick on 'Logout' to ensure that you character leaves the game properly.\nClick on 'Exit' if you want to exit the program without logging out your character."] = "Se você desligar o programa o seu personagem pode continuar no jogo.\nClique em 'Sair' para assegurar que seu personagem saia do jogo adequadamente.\nClique em 'Forçar Saida' para fechar o programa sem desconectar seu personagem.", + ["If you shut down the program, your character might stay in the game.\nClick on 'Logout' to ensure that you character leaves the game properly.\nClick on 'Exit' if you want to exit the program without logging out your character."] = "Se voc� desligar o programa o seu personagem pode continuar no jogo.\nClique em 'Sair' para assegurar que seu personagem saia do jogo adequadamente.\nClique em 'For�ar Saida' para fechar o programa sem desconectar seu personagem.", ["Ignore capacity"] = "Ignorar capacidade", ["Ignore equipped"] = "Ignorar equipado", ["Interface framerate limit: %s"] = "Limite da taxa de quadros da interface: %s", - ["Inventory"] = "Inventário", + ["Inventory"] = "Invent�rio", ["Invite to Party"] = "Convidar para o grupo", ["Invite to private chat"] = "Convidar para o canal privado", - ["IP Address Banishment"] = "Banimento de endereço IP", + ["IP Address Banishment"] = "Banimento de endere�o IP", ["Item Offers"] = "Ofertas de items", - ["It is empty.\n"] = "Está vazio\n", + ["It is empty.\n"] = "Est� vazio\n", ["Join %s's Party"] = "Entrar na party do %s", ["Leave Party"] = "Sair do grupo", - ["Level"] = "Nível", + ["Level"] = "N�vel", ["Limits FPS to 60"] = "Limita o FPS para 60", - ["List of items that you're able to buy"] = "Lista de itens que você pode comprar", - ["List of items that you're able to sell"] = "Lista de itens que você pode vender", + ["List of items that you're able to buy"] = "Lista de itens que voc� pode comprar", + ["List of items that you're able to sell"] = "Lista de itens que voc� pode vender", ["Load"] = "Carregar", ["Location"] = "Local", ["Logging out..."] = "Saindo...", ["Login"] = "Entrar", - ["Login Error"] = "Erro de Autenticação", - ["Login Error"] = "Erro de Autenticação", + ["Login Error"] = "Erro de Autentica��o", + ["Login Error"] = "Erro de Autentica��o", ["Logout"] = "Sair", ["Look"] = "Olhar", - ["Magic Level"] = "Nível Mágico", + ["Magic Level"] = "N�vel M�gico", ["Make sure that your client uses\nthe correct game protocol version"] = "Tenha certeza que o seu cliente use\no mesmo protocolo do servidor do jogo", ["Mana"] = "Mana", ["Manage hotkeys:"] = "Configurar atalhos:", @@ -174,9 +174,9 @@ locale = { ["Message to "] = "Mensagem para ", ["Message to %s"] = "Mandar mensagem para %s", ["Minimap"] = "Minimapa", - ["Module Manager"] = "Gerenciador de Módulos", - ["Module name"] = "Nome do módulo", - ["Move Stackable Item"] = "Mover item contável", + ["Module Manager"] = "Gerenciador de M�dulos", + ["Module name"] = "Nome do m�dulo", + ["Move Stackable Item"] = "Mover item cont�vel", ["Move up"] = "Mover para cima", ["Moves"] = "Movimentos", ["My Offers"] = "Minhas ofertas", @@ -185,14 +185,14 @@ locale = { ["Name Report"] = "Reportar Nome", ["Name Report + Banishment"] = "Reportar Nome + Banimento", ["Name Report + Banishment + Final Warning"] = "Reportar Nome + Banimento + Aviso Final", - ["No"] = "Não", + ["No"] = "N�o", ["No item selected."] = "Nenhum item selecionado", ["No Mount"] = "Sem montaria", ["No Outfit"] = "Sem roupa", - ["No statement has been selected."] = "Nenhuma afirmação foi selecionada.", - ["Notation"] = "Notação", + ["No statement has been selected."] = "Nenhuma afirma��o foi selecionada.", + ["Notation"] = "Nota��o", ["NPC Trade"] = "Troca com NPC", - ["Offer History"] = "Histórico de ofertas", + ["Offer History"] = "Hist�rico de ofertas", ["Offers"] = "Ofertas", ["Offer Type:"] = "Tipo de oferta:", ["Offline Training"] = "Treino Offline", @@ -204,31 +204,31 @@ locale = { ["Open charlist automatically when starting otclient"] = "Abrir lista de personagens", ["Open in new window"] = "Abrir em nova janela", ["Open new channel"] = "Abrir novo canal", - ["Options"] = "Opções", - ["Overview"] = "Visão geral", - ["Particles Manager"] = "Gerenciador de partículas", - ["Pass Leadership to %s"] = "Passar liderança para %s", + ["Options"] = "Op��es", + ["Overview"] = "Vis�o geral", + ["Particles Manager"] = "Gerenciador de part�culas", + ["Pass Leadership to %s"] = "Passar lideran�a para %s", ["Password"] = "Senha", ["Pause"] = "Pausar", - ["Piece Price:"] = "Preço por peça:", + ["Piece Price:"] = "Pre�o por pe�a:", ["Please enter a character name:"] = "Por favor, entre com o nome do personagem:", - ["Please, press the key you wish to add onto your hotkeys manager"] = "Por favor, pressione a tecla que você deseja\nadicionar no gerenciador de atalhos", + ["Please, press the key you wish to add onto your hotkeys manager"] = "Por favor, pressione a tecla que voc� deseja\nadicionar no gerenciador de atalhos", ["Please Select"] = "Por favor, selecione algo", - ["Please use this dialog to only report bugs. Do not report rule violations here!"] = "Por favor, use este campo apenas para reportar defeitos. Não reporte violação de regras aqui!", + ["Please use this dialog to only report bugs. Do not report rule violations here!"] = "Por favor, use este campo apenas para reportar defeitos. N�o reporte viola��o de regras aqui!", ["Please wait"] = "Por favor, espere", ["Port"] = "Porta", ["Preview"] = "Prever", - ["Price:"] = "Preço", - ["Primary"] = "Primário", + ["Price:"] = "Pre�o", + ["Primary"] = "Prim�rio", ["Protocol"] = "Protocolo", ["Quantity:"] = "Quantidade:", ["Quest Log"] = "Registro de Quest", ["Randomize"] = "Embaralhar", - ["Randomize characters outfit"] = "Gerar roupa aleatória", + ["Randomize characters outfit"] = "Gerar roupa aleat�ria", ["Reason:"] = "Motivo:", ["Refresh"] = "Atualizar", ["Refresh Offers"] = "Atualizar Ofertas", - ["Regeneration Time"] = "Tempo de Regeneração", + ["Regeneration Time"] = "Tempo de Regenera��o", ["Reject"] = "Rejeitar", ["Reload"] = "Recarregar", ["Reload All"] = "Recarregar Todos", @@ -239,13 +239,13 @@ locale = { ["Report Bug"] = "Reportar defeito", ["Reserved for more functionality later."] = "Reservado para futura maior funcionalidade.", ["Reset Market"] = "Resetar Mercado", - ["Revoke %s's Invitation"] = "Não aceitar o convite do %s", + ["Revoke %s's Invitation"] = "N�o aceitar o convite do %s", ["Rotate"] = "Girar", - ["Rule Violation"] = "Violação de regra", + ["Rule Violation"] = "Viola��o de regra", ["Search:"] = "Procurar:", ["Search"] = "Procurar", ["Search all items"] = "Procurar todos os items", - ["Secondary"] = "Secundário", + ["Secondary"] = "Secund�rio", ["Select object"] = "Selecionar objeto", ["Select Outfit"] = "Selecionar Roupa", ["Sell"] = "Vender", @@ -258,28 +258,28 @@ locale = { ["Set Outfit"] = "Escolher Roupa", ["Shielding"] = "Defesa", ["Show all items"] = "Exibir todos os itens", - ["Show connection ping"] = "Mostrar latência de conexão", - ["Show Depot Only"] = "Mostrar somente o depósito", + ["Show connection ping"] = "Mostrar lat�ncia de conex�o", + ["Show Depot Only"] = "Mostrar somente o dep�sito", ["Show event messages in console"] = "Exibir mensagens de eventos no console", ["Show frame rate"] = "Exibir FPS", ["Show info messages in console"] = "Exibir mensagens informativas no console", ["Show left panel"] = "Mostrar barra lateral esquerda", - ["Show levels in console"] = "Exibir níveis no console", + ["Show levels in console"] = "Exibir n�veis no console", ["Show private messages in console"] = "Exibir mensagens privadas no console", ["Show private messages on screen"] = "Exibir mensagens na tela", ["Show status messages in console"] = "Exibir mensagens de estado no console", ["Show Text"] = "Mostrar texto", - ["Show timestamps in console"] = "Exibir o horário no console", - ["Show your depot items only"] = "Mostrar os itens somentedo depósito", + ["Show timestamps in console"] = "Exibir o hor�rio no console", + ["Show your depot items only"] = "Mostrar os itens somentedo dep�sito", ["Skills"] = "Habilidades", ["Soul"] = "Alma", ["Soul Points"] = "Pontos de Alma", ["Speed"] = "Velocidade", ["Stamina"] = "Vigor", - ["Start"] = "Começar", - ["Statement:"] = "Afirmação:", + ["Start"] = "Come�ar", + ["Statement:"] = "Afirma��o:", ["Statement Report"] = "Afirmar Relato", - ["Statistics"] = "Estatísticas", + ["Statistics"] = "Estat�sticas", ["Stop Attack"] = "Parar de Atacar", ["Stop Follow"] = "Parar de Seguir", ["%s: (use object)"] = "%s: (usar objeto)", @@ -288,21 +288,21 @@ locale = { ["%s: (use object with crosshair)"] = "%s: (usar objeto com mira)", ["Sword Fighting"] = "Combate com Espada", ["Terminal"] = "Terminal", - ["There is no way."] = "Não há rota", - ["Total Price:"] = "Preço total:", + ["There is no way."] = "N�o h� rota", + ["Total Price:"] = "Pre�o total:", ["Trade"] = "Trocar", ["Trade with ..."] = "Trocar com ...", ["Trying to reconnect in %s seconds."] = "Tentando reconectar em %s segundos.", ["Type"] = "Tipo", - ["Unable to load dat file, please place a valid dat in '%s'"] = "Não foi possível carregar o arquivo dat, por favor coloque um arquivo válido em %s", - ["Unable to load spr file, please place a valid spr in '%s'"] = "Não foi possível carregar o arquivo spr, por favor coloque um arquivo válido em %s", - ["Unable to logout."] = "Não é possivel sair", + ["Unable to load dat file, please place a valid dat in '%s'"] = "N�o foi poss�vel carregar o arquivo dat, por favor coloque um arquivo v�lido em %s", + ["Unable to load spr file, please place a valid spr in '%s'"] = "N�o foi poss�vel carregar o arquivo spr, por favor coloque um arquivo v�lido em %s", + ["Unable to logout."] = "N�o � possivel sair", ["Unload"] = "Descarregar", ["Use"] = "Usar", ["Use on target"] = "Usar no alvo", ["Use on yourself"] = "Usar em si", ["Use with ..."] = "Usar com ...", - ["Version"] = "Versão", + ["Version"] = "Vers�o", ["VIP list"] = "Lista VIP", ["VIP List"] = "Lista VIP", ["Voc."] = "Voc.", @@ -313,37 +313,37 @@ locale = { ["With crosshair"] = "Com mira", ["World"] = "Mundo", ["Yes"] = "Sim", - ["You are bleeding"] = "Você está sangrando", - ["You are burning"] = "Você está queimando", - ["You are cursed"] = "Você está amaldiçoado", - ["You are dazzled"] = "Você está deslumbrado", - ["You are dead."] = "Você está morto.", - ["You are dead"] = "Você está morto", - ["You are drowing"] = "Você está se afogando", - ["You are drunk"] = "Você está bêbado", - ["You are electrified"] = "Você está eletrificado", - ["You are freezing"] = "Você está congelando", - ["You are hasted"] = "Você está com pressa", - ["You are hungry"] = "Você está faminto", - ["You are paralysed"] = "Você está paralizado", - ["You are poisoned"] = "Você está envenenado", - ["You are protected by a magic shield"] = "Você está protegido com um escudo mágico", - ["You are strengthened"] = "Você está reforçado", - ["You are within a protection zone"] = "Você está dentro de uma zona de proteção", - ["You can enter new text."] = "Você pode entrar com um novo texto.", - ["You have %s percent"] = "Você tem %s porcento", - ["You have %s percent to go"] = "Você tem %s porcento para avançar", - ["You may not logout during a fight"] = "Você não pode sair durante um combate", - ["You may not logout or enter a protection zone"] = "Você não pode sair ou entrar em uma zona de proteção", - ["You must enter a comment."] = "Você precisa entrar com um comentário", - ["You must enter an account name and password."] = "Você precisa entrar com uma conta e senha.", - ["You must enter a valid server address and port."] = "Você precisa colocar um endereço e uma porta do servidor válidos.", - ["You must select a character to login!"] = "Você deve selecionar um personagem para entrar!", + ["You are bleeding"] = "Voc� est� sangrando", + ["You are burning"] = "Voc� est� queimando", + ["You are cursed"] = "Voc� est� amaldi�oado", + ["You are dazzled"] = "Voc� est� deslumbrado", + ["You are dead."] = "Voc� est� morto.", + ["You are dead"] = "Voc� est� morto", + ["You are drowing"] = "Voc� est� se afogando", + ["You are drunk"] = "Voc� est� b�bado", + ["You are electrified"] = "Voc� est� eletrificado", + ["You are freezing"] = "Voc� est� congelando", + ["You are hasted"] = "Voc� est� com pressa", + ["You are hungry"] = "Voc� est� faminto", + ["You are paralysed"] = "Voc� est� paralizado", + ["You are poisoned"] = "Voc� est� envenenado", + ["You are protected by a magic shield"] = "Voc� est� protegido com um escudo m�gico", + ["You are strengthened"] = "Voc� est� refor�ado", + ["You are within a protection zone"] = "Voc� est� dentro de uma zona de prote��o", + ["You can enter new text."] = "Voc� pode entrar com um novo texto.", + ["You have %s percent"] = "Voc� tem %s porcento", + ["You have %s percent to go"] = "Voc� tem %s porcento para avan�ar", + ["You may not logout during a fight"] = "Voc� n�o pode sair durante um combate", + ["You may not logout or enter a protection zone"] = "Voc� n�o pode sair ou entrar em uma zona de prote��o", + ["You must enter a comment."] = "Voc� precisa entrar com um coment�rio", + ["You must enter an account name and password."] = "Voc� precisa entrar com uma conta e senha.", + ["You must enter a valid server address and port."] = "Voc� precisa colocar um endere�o e uma porta do servidor v�lidos.", + ["You must select a character to login!"] = "Voc� deve selecionar um personagem para entrar!", ["Your Capacity:"] = "Sua capacidade:", - ["You read the following, written by \n%s\n"] = "Você lê o seguinte, escrito por \n%s\n", - ["You read the following, written on %s.\n"] = "Você lê o seguinte, escrito em %s\n", + ["You read the following, written by \n%s\n"] = "Voc� l� o seguinte, escrito por \n%s\n", + ["You read the following, written on %s.\n"] = "Voc� l� o seguinte, escrito em %s\n", ["Your Money:"] = "Seu dinheiro:", } } -Locales.installLocale(locale) +modules.client_locales.installLocale(locale) diff --git a/modules/client_locales/locales/sv.lua b/data/locales/sv.lua similarity index 56% rename from modules/client_locales/locales/sv.lua rename to data/locales/sv.lua index f417e6d3..9489d688 100644 --- a/modules/client_locales/locales/sv.lua +++ b/data/locales/sv.lua @@ -12,69 +12,69 @@ locale = { ["1d) Name Inciting Rule Violation"] = "1d) Namn anstiftar regelbrott.", ["2a) Offensive Statement"] = "2a) Offensivt Uttryck", ["2b) Spamming"] = "2b) Spammning", - ["2c) Illegal Advertising"] = "2c) Olaglig Reklamföring", - ["2d) Off-Topic Public Statement"] = "2d) Icke-Ämneförhållande publiskt uttryck", + ["2c) Illegal Advertising"] = "2c) Olaglig Reklamf�ring", + ["2d) Off-Topic Public Statement"] = "2d) Icke-�mnef�rh�llande publiskt uttryck", ["2e) Non-English Public Statement"] = "2e) Icke-Engelskt publiskt uttryck", ["2f) Inciting Rule Violation"] = "2f) Antyder regelbrytande", ["3a) Bug Abuse"] = "3a) Missbrukande av bugg", ["3b) Game Weakness Abuse"] = "3b) Spelsvaghetsmissbruk", - ["3c) Using Unofficial Software to Play"] = "3c) Använder Icke-officiel mjukvara för att spela", + ["3c) Using Unofficial Software to Play"] = "3c) Anv�nder Icke-officiel mjukvara f�r att spela", ["3d) Hacking"] = "3d) Hackar", ["3e) Multi-Clienting"] = "3e) Multi-klient", ["3f) Account Trading or Sharing"] = "3f) Kontohandel", ["4a) Threatening Gamemaster"] = "4a) Hotar gamemaster", - ["4b) Pretending to Have Influence on Rule Enforcement"] = "4b) Låtsas ha inflytande på Regelsystem", + ["4b) Pretending to Have Influence on Rule Enforcement"] = "4b) L�tsas ha inflytande p� Regelsystem", ["4c) False Report to Gamemaster"] = "4c) Falsk rapport till gamemaster", ["Accept"] = "Acceptera", ["Account name"] = "Konto namn", ["Account Status:\nFree Account"] = "Kontostatus:\nGratis", ["Account Status:\nPremium Account (%s) days left"] = "Kontostatus:\nPremium Konto", ["Action:"] = "Handling:", - ["Add"] = "Lägg till", + ["Add"] = "L�gg till", ["Add new VIP"] = "Ny VIP", - ["Addon 1"] = "Tillägg 1", - ["Addon 2"] = "Tillägg 2", - ["Addon 3"] = "Tillägg 3", - ["Add to VIP list"] = "Lägg till på VIP Listan", + ["Addon 1"] = "Till�gg 1", + ["Addon 2"] = "Till�gg 2", + ["Addon 3"] = "Till�gg 3", + ["Add to VIP list"] = "L�gg till p� VIP Listan", ["Adjust volume"] = "Justera Volym", ["Alas! Brave adventurer, you have met a sad fate.\nBut do not despair, for the gods will bring you back\ninto this world in exchange for a small sacrifice\n\nSimply click on Ok to resume your journeys!"] = false, ["All modules and scripts were reloaded."] = "Alla moduler och skript laddades om", - ["Allow auto chase override"] = "Tillåt Jaktstyrning", + ["Allow auto chase override"] = "Till�t Jaktstyrning", ["Amount:"] = "Antal:", ["Amount"] = "Antal", ["Anonymous"] = "Anonym", - ["Are you sure you want to logout?"] = "Är du säker att du vill logga ut?", + ["Are you sure you want to logout?"] = "�r du s�ker att du vill logga ut?", ["Attack"] = "Attackera", - ["Author"] = "Översättare", + ["Author"] = "�vers�ttare", ["Autoload"] = "Automatisk Laddning", ["Autoload priority"] = "Laddningsprioritet", ["Auto login"] = "Autoinloggning", - ["Auto login selected character on next charlist load"] = "Logga in Näst laddad karaktär automatisk nästa gång karaktärlistan laddar", + ["Auto login selected character on next charlist load"] = "Logga in N�st laddad karakt�r automatisk n�sta g�ng karakt�rlistan laddar", ["Axe Fighting"] = "Yx Stridande", ["Balance:"] = "Balans:", ["Banishment"] = "Bannlysning", ["Banishment + Final Warning"] = "Bannlysning + Sista varning", ["Battle"] = "Strid", - ["Browse"] = "Bläddra", + ["Browse"] = "Bl�ddra", ["Bug report sent."] = "Buggrapport Skickad.", ["Button Assign"] = "Assignera Knapp", - ["Buy"] = "Köp", - ["Buy Now"] = "Köp Nu", - ["Buy Offers"] = "Köp Offerter", - ["Buy with backpack"] = "Köp med ryggsäck", + ["Buy"] = "K�p", + ["Buy Now"] = "K�p Nu", + ["Buy Offers"] = "K�p Offerter", + ["Buy with backpack"] = "K�p med ryggs�ck", ["Cancel"] = "Avbryt", - ["Cannot login while already in game."] = "Kan ej logga in medan du redan är i spelet.", + ["Cannot login while already in game."] = "Kan ej logga in medan du redan �r i spelet.", ["Cap"] = "Kap", ["Capacity"] = "Kapacitet", ["Center"] = "Centrera", ["Channels"] = "Kanaler", - ["Character List"] = "Karaktär lista", + ["Character List"] = "Karakt�r lista", ["Classic control"] = "Klassisk kontroll", ["Clear current message window"] = "Rensa nuvarande meddelanderuta", ["Clear object"] = "Rensa objekt", - ["Client needs update."] = "Klienten behöver uppdateras.", - ["Close"] = "Stäng", - ["Close this channel"] = "Stäng Denna Kanal", + ["Client needs update."] = "Klienten beh�ver uppdateras.", + ["Close"] = "St�ng", + ["Close this channel"] = "St�ng Denna Kanal", ["Club Fighting"] = "Klubb Stridande", ["Combat Controls"] = "Krigs Kontroller", ["Comment:"] = "Kommentar:", @@ -95,57 +95,57 @@ locale = { ["Details"] = "Detaljer", ["Disable Shared Experience"] = "Avaktivera delad erfarenhet", ["Distance Fighting"] = "Distans Stridande", - ["Edit hotkey text:"] = "Ändra Snabbtangent:", - ["Edit List"] = "Ändra Lista", - ["Edit Text"] = "Ändra text", + ["Edit hotkey text:"] = "�ndra Snabbtangent:", + ["Edit List"] = "�ndra Lista", + ["Edit Text"] = "�ndra text", ["Enable music"] = "Aktivera musik", ["Enable Shared Experience"] = "Aktivera delad erfarenhet", ["Enable vertical synchronization"] = "Aktivera vertikal synkronisering", - ["Enter Game"] = "Gå in i Spelet", + ["Enter Game"] = "G� in i Spelet", ["Enter one name per line."] = "Skriv ett namn per linje.", ["Error"] = "Fel", ["Error"] = "Fel", - ["Excessive Unjustified Player Killing"] = "Överdrivet oberättigat dödande av spelare", - ["Exclude from private chat"] = "Exkludera från privat chat", + ["Excessive Unjustified Player Killing"] = "�verdrivet ober�ttigat d�dande av spelare", + ["Exclude from private chat"] = "Exkludera fr�n privat chat", ["Exit"] = "Avsluta", ["Experience"] = "Erfarenhet", - ["Filter list to match your level"] = "Filtrera efter nivå", + ["Filter list to match your level"] = "Filtrera efter niv�", ["Filter list to match your vocation"] = "Filtrera efter kallelse", ["Fishing"] = "Fiske", ["Fist Fighting"] = "Hand Stridande", - ["Follow"] = "Följ", - ["Fullscreen"] = "Helskärm", - ["Game framerate limit: %s"] = "Spelets FPS gräns: %s", - ["General"] = "Allmänt", + ["Follow"] = "F�lj", + ["Fullscreen"] = "Helsk�rm", + ["Game framerate limit: %s"] = "Spelets FPS gr�ns: %s", + ["General"] = "Allm�nt", ["Graphics"] = "Grafik", ["Graphics Engine:"] = "Grafikmotor:", ["Head"] = "Huvud", ["Health Info"] = "Livsinfo", ["Health Information"] = "Livsinformation", - ["Hide monsters"] = "Göm Monster", - ["Hide non-skull players"] = "Göm icke-skullad spelare", - ["Hide Npcs"] = "Göm NPCs", - ["Hide party members"] = "Göm gruppmedlemmar", - ["Hide players"] = "Göm spelare", - ["Hit Points"] = "Livspoäng", - ["Hold right mouse button to navigate\nScroll mouse middle button to zoom"] = "Håll in Höger musknapp för att navigera\nScrolla mitten musknapp för att zooma", + ["Hide monsters"] = "G�m Monster", + ["Hide non-skull players"] = "G�m icke-skullad spelare", + ["Hide Npcs"] = "G�m NPCs", + ["Hide party members"] = "G�m gruppmedlemmar", + ["Hide players"] = "G�m spelare", + ["Hit Points"] = "Livspo�ng", + ["Hold right mouse button to navigate\nScroll mouse middle button to zoom"] = "H�ll in H�ger musknapp f�r att navigera\nScrolla mitten musknapp f�r att zooma", ["Hotkeys"] = "Snabbtangenter", - ["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."] = "Om du stänger av programmet kan din karaktär stanna i spelet.\nKlicka på 'Logga ut' för att säkerställa att din karaktär lämnar spelet korrekt.\nKlicka på 'Avsluta' om du vill avsluta programmet utan att logga ut din karaktär.", + ["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."] = "Om du st�nger av programmet kan din karakt�r stanna i spelet.\nKlicka p� 'Logga ut' f�r att s�kerst�lla att din karakt�r l�mnar spelet korrekt.\nKlicka p� 'Avsluta' om du vill avsluta programmet utan att logga ut din karakt�r.", ["Ignore capacity"] = "Ignorera kapacitet", ["Ignore equipped"] = "Ignorera utrustning", - ["Interface framerate limit: %s"] = "Gränssnitt FPS gräns: %s", + ["Interface framerate limit: %s"] = "Gr�nssnitt FPS gr�ns: %s", ["Inventory"] = "Utrustning", ["Invite to Party"] = "Bjud till grupp", ["Invite to private chat"] = "Bjud in i privat chat", ["IP Address Banishment"] = "Bannlysning av IP", ["Item Offers"] = "Objekt offert", - ["It is empty.\n"] = "Den är tom.\n", - ["Join %s's Party"] = "Gå med i %s's Grupp", - ["Leave Party"] = "Lämna Grupp", - ["Level"] = "Nivå", + ["It is empty.\n"] = "Den �r tom.\n", + ["Join %s's Party"] = "G� med i %s's Grupp", + ["Leave Party"] = "L�mna Grupp", + ["Level"] = "Niv�", ["Limits FPS to 60"] = "Stoppa FPS vid 60", - ["List of items that you're able to buy"] = "Lista av saker du kan köpa", - ["List of items that you're able to sell"] = "Lista av saker du kan sälja", + ["List of items that you're able to buy"] = "Lista av saker du kan k�pa", + ["List of items that you're able to sell"] = "Lista av saker du kan s�lja", ["Load"] = "Ladda", ["Location"] = "plats", ["Logging out..."] = "Loggar ut...", @@ -154,10 +154,10 @@ locale = { ["Login Error"] = "Autentifikations fel", ["Logout"] = "Logga ut", ["Look"] = "Kolla", - ["Magic Level"] = "Magisk Nivå", - ["Make sure that your client uses\nthe correct game protocol version"] = "Var säker på att din client\n andvänder rätt protokol version", + ["Magic Level"] = "Magisk Niv�", + ["Make sure that your client uses\nthe correct game protocol version"] = "Var s�ker p� att din client\n andv�nder r�tt protokol version", ["Mana"] = "Mana", - ["Manage hotkeys:"] = "Ändra snabbtangenten:", + ["Manage hotkeys:"] = "�ndra snabbtangenten:", ["Market"] = "Marknad", ["Market Offers"] = "Marknadsofferter", ["Message of the day"] = "Dagens meddelande", @@ -166,7 +166,7 @@ locale = { ["Minimap"] = "Minikarta", ["Module Manager"] = "Modul Manager", ["Module name"] = "Modul namn", - ["Move Stackable Item"] = "Flytta stapelbart föremål", + ["Move Stackable Item"] = "Flytta stapelbart f�rem�l", ["Move up"] = "Flytta upp", ["My Offers"] = "Mina offerter", ["Name:"] = "Namn:", @@ -178,7 +178,7 @@ locale = { ["No item selected."] = "Ingen sak vald.", ["No Mount"] = "Ingen Mount", ["No Outfit"] = "Ingen Utstyrsel", - ["No statement has been selected."] = "Inget påstående är valt.", + ["No statement has been selected."] = "Inget p�st�ende �r valt.", ["Notation"] = "Notering", ["NPC Trade"] = "Handel NPC", ["Offer History"] = "Offert Historia", @@ -186,141 +186,141 @@ locale = { ["Offer Type:"] = "Offert typ:", ["Ok"] = "Ok", ["Okay"] = "okej", - ["on %s.\n"] = "på %s.\n", - ["Open"] = "Öppna", - ["Open a private message channel:"] = "Öppna en privat meddelandekanal:", - ["Open charlist automatically when starting otclient"] = "Öppna karaktärlistan automatisk vid start", - ["Open in new window"] = "Öppna i nytt fönster", - ["Open new channel"] = "Öppna ny kanal", - ["Options"] = "Inställningar", + ["on %s.\n"] = "p� %s.\n", + ["Open"] = "�ppna", + ["Open a private message channel:"] = "�ppna en privat meddelandekanal:", + ["Open charlist automatically when starting otclient"] = "�ppna karakt�rlistan automatisk vid start", + ["Open in new window"] = "�ppna i nytt f�nster", + ["Open new channel"] = "�ppna ny kanal", + ["Options"] = "Inst�llningar", ["Particles Manager"] = "Partikel manager", ["Pass Leadership to %s"] = "Ge ledarskap till %s", - ["Password"] = "Lösenord", + ["Password"] = "L�senord", ["Pause"] = "Pause", ["Piece Price:"] = "Per Styck:", - ["Please enter a character name:"] = "Skriv in ett karaktärsnamn:", - ["Please, press the key you wish to add onto your hotkeys manager"] = "Tryck på knappen som du\nvill lägga till som snabbtangent", - ["Please Select"] = "Välj", - ["Please use this dialog to only report bugs. Do not report rule violations here!"] = "Använd den här dialogrutan endast för att rapportera buggar. Rapportera inte regelbrott här!", - ["Please wait"] = "Var God Vänta", + ["Please enter a character name:"] = "Skriv in ett karakt�rsnamn:", + ["Please, press the key you wish to add onto your hotkeys manager"] = "Tryck p� knappen som du\nvill l�gga till som snabbtangent", + ["Please Select"] = "V�lj", + ["Please use this dialog to only report bugs. Do not report rule violations here!"] = "Anv�nd den h�r dialogrutan endast f�r att rapportera buggar. Rapportera inte regelbrott h�r!", + ["Please wait"] = "Var God V�nta", ["Port"] = "Port", - ["Preview"] = "Förhandsvisning", + ["Preview"] = "F�rhandsvisning", ["Price:"] = "Pris", - ["Primary"] = "Primär", + ["Primary"] = "Prim�r", ["Protocol"] = "Protokoll", ["Quantity:"] = "Antal:", ["Quest Log"] = "Uppdragslog", ["Randomize"] = "Slumpa", - ["Randomize characters outfit"] = "Slumpa karaktärs utstyrsel", + ["Randomize characters outfit"] = "Slumpa karakt�rs utstyrsel", ["Reason:"] = "Anledning:", ["Refresh"] = "Uppdatera", ["Reject"] = "Avvisa", ["Reload"] = "Ladda om", ["Reload All"] = "Ladda om allt", - ["Remember account and password when starts otclient"] = "Kom ihåg konto och lösen när OTClient startar", - ["Remember password"] = "Kom ihåg lösenord", + ["Remember account and password when starts otclient"] = "Kom ih�g konto och l�sen n�r OTClient startar", + ["Remember password"] = "Kom ih�g l�senord", ["Remove"] = "Ta bort", ["Remove %s"] = "Ta bort %s", ["Report Bug"] = "Rapportera Bugg", ["Revoke %s's Invitation"] = "Annulera %s's Inbjudan", ["Rotate"] = "Rotera", ["Rule Violation"] = "Regel Brott", - ["Search:"] = "Sök:", - ["Search"] = "Sök", - ["Secondary"] = "Sekundär", - ["Select object"] = "Välj Objekt", - ["Select Outfit"] = "Välj Utstyrsel", - ["Sell"] = "Sälj", - ["Sell Now"] = "Sälj Nu", - ["Sell Offers"] = "Sälj Offerter", + ["Search:"] = "S�k:", + ["Search"] = "S�k", + ["Secondary"] = "Sekund�r", + ["Select object"] = "V�lj Objekt", + ["Select Outfit"] = "V�lj Utstyrsel", + ["Sell"] = "S�lj", + ["Sell Now"] = "S�lj Nu", + ["Sell Offers"] = "S�lj Offerter", ["Send"] = "Skicka", ["Send automatically"] = "Skicka automatiskt", ["Server"] = "Server", ["Server Log"] = "Server Log", - ["Set Outfit"] = "Bestäm Utstyrsel", - ["Shielding"] = "Sköld", + ["Set Outfit"] = "Best�m Utstyrsel", + ["Shielding"] = "Sk�ld", ["Show all items"] = "Visa alla saker", - ["Show Depot Only"] = "Visa bara förråd", + ["Show Depot Only"] = "Visa bara f�rr�d", ["Show event messages in console"] = "Visa event meddelanden i konsol", ["Show frame rate"] = "Visa FPS", ["Show info messages in console"] = "Visa info meddelanden i konsol", - ["Show left panel"] = "Visa vänster panel", - ["Show levels in console"] = "Visa nivåer i konsol", + ["Show left panel"] = "Visa v�nster panel", + ["Show levels in console"] = "Visa niv�er i konsol", ["Show private messages in console"] = "Visa privata meddelanden i konsol", - ["Show private messages on screen"] = "Visa privata meddelanden på skärmen", + ["Show private messages on screen"] = "Visa privata meddelanden p� sk�rmen", ["Show status messages in console"] = "Visa statusmeddelanden i konsol", ["Show Text"] = "Visa Text", - ["Show timestamps in console"] = "Visa tidstämpel i konsol", - ["Show your depot items only"] = "Visa mitt förråd endast", - ["Skills"] = "Förmågor", - ["Soul"] = "Själ", - ["Soul Points"] = "Själpoäng", - ["Stamina"] = "Uthållighet", + ["Show timestamps in console"] = "Visa tidst�mpel i konsol", + ["Show your depot items only"] = "Visa mitt f�rr�d endast", + ["Skills"] = "F�rm�gor", + ["Soul"] = "Sj�l", + ["Soul Points"] = "Sj�lpo�ng", + ["Stamina"] = "Uth�llighet", ["Start"] = "Starta", - ["Statement:"] = "Påstående:", - ["Statement Report"] = "Påståenderapport", + ["Statement:"] = "P�st�ende:", + ["Statement Report"] = "P�st�enderapport", ["Statistics"] = "Statistik", ["Stop Attack"] = "Sluta Attackera", - ["Stop Follow"] = "Sluta Följa", - ["%s: (use object)"] = "%s: (Använd objekt)", - ["%s: (use object on target)"] = "%s: (Använd objekt på mål)", - ["%s: (use object on yourself)"] = "%s: (Använd objekt på mig)", - ["%s: (use object with crosshair)"] = "%s: (Använd objekt med sikte)", - ["Sword Fighting"] = "Svärd Stridning", + ["Stop Follow"] = "Sluta F�lja", + ["%s: (use object)"] = "%s: (Anv�nd objekt)", + ["%s: (use object on target)"] = "%s: (Anv�nd objekt p� m�l)", + ["%s: (use object on yourself)"] = "%s: (Anv�nd objekt p� mig)", + ["%s: (use object with crosshair)"] = "%s: (Anv�nd objekt med sikte)", + ["Sword Fighting"] = "Sv�rd Stridning", ["Terminal"] = "Terminal", - ["There is no way."] = "Det finns ingen väg.", + ["There is no way."] = "Det finns ingen v�g.", ["Total Price:"] = "Totalt Pris:", ["Trade"] = "Handel", ["Trade with ..."] = "Handla med ...", - ["Trying to reconnect in %s seconds."] = "Försöker koppla upp igen om %s sekunder.", - ["Unable to load dat file, please place a valid dat in '%s'"] = "kan ej ladda dat filen, lägg en giltig dat fil i '%s'", - ["Unable to load spr file, please place a valid spr in '%s'"] = "kan ej ladda spr filen, lägg en giltig spr fil i '%s'", + ["Trying to reconnect in %s seconds."] = "F�rs�ker koppla upp igen om %s sekunder.", + ["Unable to load dat file, please place a valid dat in '%s'"] = "kan ej ladda dat filen, l�gg en giltig dat fil i '%s'", + ["Unable to load spr file, please place a valid spr in '%s'"] = "kan ej ladda spr filen, l�gg en giltig spr fil i '%s'", ["Unable to logout."] = "Kan ej logga ut.", ["Unload"] = "Avladda", - ["Use"] = "Använd", - ["Use on target"] = "Använd på mål", - ["Use on yourself"] = "Använd på mig", - ["Use with ..."] = "Använd med ...", + ["Use"] = "Anv�nd", + ["Use on target"] = "Anv�nd p� m�l", + ["Use on yourself"] = "Anv�nd p� mig", + ["Use with ..."] = "Anv�nd med ...", ["Version"] = "Version", ["VIP list"] = "VIP Lista", ["VIP List"] = "VIP Lista", ["Voc."] = "Kallelse", - ["Waiting List"] = "Kölista", + ["Waiting List"] = "K�lista", ["Website"] = "Websida", ["Weight:"] = "Vikt:", ["With crosshair"] = "Med sikte", ["Yes"] = "Ja", - ["You are bleeding"] = "Du Blöder", + ["You are bleeding"] = "Du Bl�der", ["You are burning"] = "Du brinner", - ["You are cursed"] = "Du är fördömd", - ["You are dazzled"] = "Du är chockad", - ["You are dead."] = "Du är död.", - ["You are dead"] = "Du är död", + ["You are cursed"] = "Du �r f�rd�md", + ["You are dazzled"] = "Du �r chockad", + ["You are dead."] = "Du �r d�d.", + ["You are dead"] = "Du �r d�d", ["You are drowing"] = "Du drunknar", - ["You are drunk"] = "Du är full.", - ["You are electrified"] = "Du är elektrifierad", + ["You are drunk"] = "Du �r full.", + ["You are electrified"] = "Du �r elektrifierad", ["You are freezing"] = "Du Fryser", - ["You are hasted"] = "Du är i hast", - ["You are hungry"] = "Du är hungrig", - ["You are paralysed"] = "Du är paralyserad", - ["You are poisoned"] = "Du är förgiftad", - ["You are protected by a magic shield"] = "Du är skyddad av en magisk sköld", - ["You are strengthened"] = "Du är förstärkt", - ["You are within a protection zone"] = "Du är inom en skyddszon", + ["You are hasted"] = "Du �r i hast", + ["You are hungry"] = "Du �r hungrig", + ["You are paralysed"] = "Du �r paralyserad", + ["You are poisoned"] = "Du �r f�rgiftad", + ["You are protected by a magic shield"] = "Du �r skyddad av en magisk sk�ld", + ["You are strengthened"] = "Du �r f�rst�rkt", + ["You are within a protection zone"] = "Du �r inom en skyddszon", ["You can enter new text."] = "Du kan skriva i ny text.", ["You have %s percent"] = "Du har %s procent", ["You have %s percent to go"] = "Du har %s procent kvar", ["You may not logout during a fight"] = "Du kan ej logga ut i strid", - ["You may not logout or enter a protection zone"] = "Du kan ej logga ut eller gå in i en skyddszon", - ["You must enter a comment."] = "Du måste skriva en kommentar", - ["You must enter an account name and password."] = "Du måste fylla i ett kontonamn och lösnord.", - ["You must enter a valid server address and port."] = "Du måste fylla i en giltig server adress och port", - ["You must select a character to login!"] = "Du måste välja en karaktär för att logga in!", + ["You may not logout or enter a protection zone"] = "Du kan ej logga ut eller g� in i en skyddszon", + ["You must enter a comment."] = "Du m�ste skriva en kommentar", + ["You must enter an account name and password."] = "Du m�ste fylla i ett kontonamn och l�snord.", + ["You must enter a valid server address and port."] = "Du m�ste fylla i en giltig server adress och port", + ["You must select a character to login!"] = "Du m�ste v�lja en karakt�r f�r att logga in!", ["Your Capacity:"] = "Din Kapacitet:", - ["You read the following, written by \n%s\n"] = "Du läser följande, Skrivet av \n%s\n", - ["You read the following, written on %s.\n"] = "Du läser följande, Skrivet den %s.\n", + ["You read the following, written by \n%s\n"] = "Du l�ser f�ljande, Skrivet av \n%s\n", + ["You read the following, written on %s.\n"] = "Du l�ser f�ljande, Skrivet den %s.\n", ["Your Money:"] = "Dina Pengar:", } } -Locales.installLocale(locale) \ No newline at end of file +modules.client_locales.installLocale(locale) \ No newline at end of file diff --git a/modules/client_skins/skins/default/particles/shiny.otps b/data/particles/shiny.otps similarity index 100% rename from modules/client_skins/skins/default/particles/shiny.otps rename to data/particles/shiny.otps diff --git a/modules/client/startup.ogg b/data/sounds/startup.ogg similarity index 100% rename from modules/client/startup.ogg rename to data/sounds/startup.ogg diff --git a/modules/client_skins/skins/default/styles/buttons.otui b/data/styles/10-buttons.otui similarity index 59% rename from modules/client_skins/skins/default/styles/buttons.otui rename to data/styles/10-buttons.otui index 9ca8427e..fe5e60d6 100644 --- a/modules/client_skins/skins/default/styles/buttons.otui +++ b/data/styles/10-buttons.otui @@ -3,7 +3,7 @@ Button < UIButton color: #f0ad4dff size: 106 22 text-offset: 0 0 - image-source: /images/button_rounded.png + image-source: /images/ui/button_rounded image-color: white image-clip: 0 0 20 20 image-border: 2 @@ -21,7 +21,7 @@ Button < UIButton TabButton < UIButton size: 20 20 - image-source: /images/tabbutton_rounded.png + image-source: /images/ui/tabbutton_rounded image-color: white image-clip: 0 0 20 20 image-border: 2 @@ -40,22 +40,30 @@ TabButton < UIButton image-clip: 0 40 20 20 color: #80c7f8 -BrowseButton < Button - size: 20 29 - icon-clip: 0 0 12 21 +NextButton < UIButton + size: 12 21 + image-source: /images/ui/arrow_horizontal + image-clip: 12 0 12 21 $hover !disabled: - icon-clip: 0 21 12 21 + image-clip: 12 21 12 21 $pressed: - icon-clip: 0 22 12 21 + image-clip: 12 21 12 21 $disabled: image-color: #ffffff55 - icon-color: #ffffff55 -NextButton < BrowseButton - icon-source: /images/arrow_right.png +PreviousButton < UIButton + size: 12 21 + image-source: /images/ui/arrow_horizontal + image-clip: 0 0 12 21 -PreviousButton < BrowseButton - icon-source: /images/arrow_left.png + $hover !disabled: + image-clip: 0 21 12 21 + + $pressed: + image-clip: 0 21 12 21 + + $disabled: + image-color: #ffffff55 \ No newline at end of file diff --git a/modules/client_skins/skins/default/styles/checkboxes.otui b/data/styles/10-checkboxes.otui similarity index 84% rename from modules/client_skins/skins/default/styles/checkboxes.otui rename to data/styles/10-checkboxes.otui index 11d2241b..42dda230 100644 --- a/modules/client_skins/skins/default/styles/checkboxes.otui +++ b/data/styles/10-checkboxes.otui @@ -7,7 +7,7 @@ CheckBox < UICheckBox image-color: #ffffffff image-rect: 0 0 12 12 image-offset: 0 2 - image-source: /images/checkbox.png + image-source: /images/ui/checkbox $hover !disabled: color: #cccccc @@ -31,7 +31,7 @@ CheckBox < UICheckBox ColorBox < UICheckBox size: 16 16 image-color: #ffffffff - image-source: /images/colorbox.png + image-source: /images/ui/colorbox $checked: image-clip: 16 0 16 16 @@ -45,7 +45,7 @@ ButtonBox < UICheckBox size: 106 22 text-offset: 0 0 text-align: center - image-source: /images/tabbutton_rounded.png + image-source: /images/ui/tabbutton_rounded image-color: white image-clip: 0 0 20 20 image-border: 2 @@ -62,5 +62,5 @@ ButtonBox < UICheckBox image-color: #ffffff88 ButtonBoxRounded < ButtonBox - image-source: /images/tabbutton_rounded.png + image-source: /images/ui/tabbutton_rounded image-border: 2 \ No newline at end of file diff --git a/modules/client_skins/skins/default/styles/comboboxes.otui b/data/styles/10-comboboxes.otui similarity index 85% rename from modules/client_skins/skins/default/styles/comboboxes.otui rename to data/styles/10-comboboxes.otui index e4dd1040..b4a71b46 100644 --- a/modules/client_skins/skins/default/styles/comboboxes.otui +++ b/data/styles/10-comboboxes.otui @@ -14,7 +14,7 @@ ComboBoxPopupMenuButton < UIButton color: #555555 ComboBoxPopupMenu < UIPopupMenu - image-source: /images/combobox_square.png + image-source: /images/ui/combobox_square image-clip: 0 60 89 20 image-border-left: 1 image-border-right: 1 @@ -25,7 +25,7 @@ ComboBox < UIComboBox size: 89 20 text-offset: 3 0 text-align: left - image-source: /images/combobox_square.png + image-source: /images/ui/combobox_square image-border: 1 image-border-right: 17 image-clip: 0 0 89 20 @@ -52,11 +52,11 @@ ComboBoxRoundedPopupMenuButton < UIButton color: #555555 ComboBoxRoundedPopupMenu < UIPopupMenu - image-source: /images/combobox_rounded.png + image-source: /images/ui/combobox_rounded image-clip: 0 60 89 20 image-border-left: 1 image-border-right: 1 ComboBoxRounded < ComboBox - image-source: /images/combobox_rounded.png + image-source: /images/ui/combobox_rounded image-border: 2 diff --git a/modules/client_skins/skins/default/styles/creaturebuttons.otui b/data/styles/10-creaturebuttons.otui similarity index 100% rename from modules/client_skins/skins/default/styles/creaturebuttons.otui rename to data/styles/10-creaturebuttons.otui diff --git a/data/styles/10-creatures.otui b/data/styles/10-creatures.otui new file mode 100644 index 00000000..c6664ec3 --- /dev/null +++ b/data/styles/10-creatures.otui @@ -0,0 +1,10 @@ +Creature < UICreature + size: 80 80 + padding: 1 + image-source: /images/ui/panel_flat + image-border: 1 + border-width: 1 + border-color: alpha + + $checked: + border-color: white diff --git a/modules/client_skins/skins/default/styles/items.otui b/data/styles/10-items.otui similarity index 73% rename from modules/client_skins/skins/default/styles/items.otui rename to data/styles/10-items.otui index 305df01e..59b9d95c 100644 --- a/modules/client_skins/skins/default/styles/items.otui +++ b/data/styles/10-items.otui @@ -1,6 +1,6 @@ Item < UIItem size: 34 34 padding: 1 - image-source: /images/item.png + image-source: /images/ui/item font: verdana-11px-rounded border-color: white diff --git a/modules/client_skins/skins/default/styles/labels.otui b/data/styles/10-labels.otui similarity index 86% rename from modules/client_skins/skins/default/styles/labels.otui rename to data/styles/10-labels.otui index 3d083bc3..f422b8c1 100644 --- a/modules/client_skins/skins/default/styles/labels.otui +++ b/data/styles/10-labels.otui @@ -10,7 +10,7 @@ FlatLabel < UILabel color: #aaaaaa size: 86 20 text-offset: 3 3 - image-source: /images/panel_flat.png + image-source: /images/ui/panel_flat image-border: 1 $disabled: @@ -35,9 +35,9 @@ PingLabel < Label font: verdana-11px-rounded @onSetup: | self.updateEvent = cycleEvent(function() - if g_game.isOnline() and Options.getOption('showPing') then + if g_game.isOnline() and modules.client_options.getOption('showPing') then local ping = -1 - if g_game.getFeature(GameClientPing) then + if g_game.getFeature(GameClientPing) or g_game.getFeature(GameExtendedClientPing) then ping = g_game.getPing() else ping = g_game.getLocalPlayer():getWalkPing() diff --git a/modules/client_skins/skins/default/styles/listboxes.otui b/data/styles/10-listboxes.otui similarity index 94% rename from modules/client_skins/skins/default/styles/listboxes.otui rename to data/styles/10-listboxes.otui index 702a84a6..bdbd99d3 100644 --- a/modules/client_skins/skins/default/styles/listboxes.otui +++ b/data/styles/10-listboxes.otui @@ -3,6 +3,7 @@ TextList < UIScrollArea border-width: 1 border-color: #1d222b background-color: #222833 + padding: 1 HorizontalList < UIScrollArea layout: horizontalBox diff --git a/modules/client_skins/skins/default/styles/panels.otui b/data/styles/10-panels.otui similarity index 62% rename from modules/client_skins/skins/default/styles/panels.otui rename to data/styles/10-panels.otui index 41194265..17fe09de 100644 --- a/modules/client_skins/skins/default/styles/panels.otui +++ b/data/styles/10-panels.otui @@ -5,17 +5,17 @@ ScrollablePanel < UIScrollArea phantom: true FlatPanel < Panel - image-source: /images/panel_flat.png + image-source: /images/ui/panel_flat image-border: 1 ScrollableFlatPanel < ScrollablePanel - image-source: /images/panel_flat.png + image-source: /images/ui/panel_flat image-border: 1 ParticlesFlatPanel < Panel - image-source: /images/panel_flat.png + image-source: /images/ui/panel_flat image-border: 1 LightFlatPanel < Panel - image-source: /images/panel_lightflat.png + image-source: /images/ui/panel_lightflat image-border: 1 diff --git a/modules/client_skins/skins/default/styles/progressbars.otui b/data/styles/10-progressbars.otui similarity index 85% rename from modules/client_skins/skins/default/styles/progressbars.otui rename to data/styles/10-progressbars.otui index 4ab1dd35..d1a378d7 100644 --- a/modules/client_skins/skins/default/styles/progressbars.otui +++ b/data/styles/10-progressbars.otui @@ -2,7 +2,7 @@ ProgressBar < UIProgressBar height: 16 background-color: red border: 1 black - image-source: /images/progressbar.png + image-source: /images/ui/progressbar image-border: 1 ProgressRect < UIProgressRect diff --git a/modules/client_skins/skins/default/styles/scrollbars.otui b/data/styles/10-scrollbars.otui similarity index 87% rename from modules/client_skins/skins/default/styles/scrollbars.otui rename to data/styles/10-scrollbars.otui index d24973c6..d1be947c 100644 --- a/modules/client_skins/skins/default/styles/scrollbars.otui +++ b/data/styles/10-scrollbars.otui @@ -2,7 +2,7 @@ ScrollBarSlider < UIButton id: sliderButton anchors.centerIn: parent size: 13 17 - image-source: /images/scrollbar.png + image-source: /images/ui/scrollbar image-clip: 0 26 13 13 image-border: 2 image-color: #ffffffbb @@ -18,7 +18,7 @@ VerticalScrollBar < UIScrollBar orientation: vertical width: 13 height: 39 - image-source: /images/scrollbar.png + image-source: /images/ui/scrollbar image-clip: 39 0 13 65 image-border: 1 pixels-scroll: true @@ -27,7 +27,7 @@ VerticalScrollBar < UIScrollBar id: decrementButton anchors.top: parent.top anchors.left: parent.left - image-source: /images/scrollbar.png + image-source: /images/ui/scrollbar image-clip: 0 0 13 13 image-color: #ffffffff size: 13 13 @@ -43,7 +43,7 @@ VerticalScrollBar < UIScrollBar anchors.bottom: parent.bottom anchors.right: parent.right size: 13 13 - image-source: /images/scrollbar.png + image-source: /images/ui/scrollbar image-clip: 0 13 13 13 image-color: #ffffffff $hover: @@ -59,7 +59,7 @@ HorizontalScrollBar < UIScrollBar orientation: horizontal height: 13 width: 39 - image-source: /images/scrollbar.png + image-source: /images/ui/scrollbar image-clip: 0 65 52 13 image-border: 1 @@ -70,7 +70,7 @@ HorizontalScrollBar < UIScrollBar id: decrementButton anchors.top: parent.top anchors.left: parent.left - image-source: /images/scrollbar.png + image-source: /images/ui/scrollbar image-clip: 0 39 13 13 image-color: #ffffffff size: 13 13 @@ -86,7 +86,7 @@ HorizontalScrollBar < UIScrollBar anchors.bottom: parent.bottom anchors.right: parent.right size: 13 13 - image-source: /images/scrollbar.png + image-source: /images/ui/scrollbar image-clip: 0 52 13 13 image-color: #ffffffff $hover: diff --git a/modules/client_skins/skins/default/styles/separators.otui b/data/styles/10-separators.otui similarity index 67% rename from modules/client_skins/skins/default/styles/separators.otui rename to data/styles/10-separators.otui index c86d309f..98999143 100644 --- a/modules/client_skins/skins/default/styles/separators.otui +++ b/data/styles/10-separators.otui @@ -1,12 +1,12 @@ HorizontalSeparator < UIWidget - image-source: /images/horizontal_separator.png + image-source: /images/ui/separator_horizontal image-border-top: 2 height: 2 phantom: true focusable: false VerticalSeparator < UIWidget - image-source: /images/vertical_separator.png + image-source: /images/ui/separator_vertical image-border-left: 2 width: 2 phantom: true diff --git a/modules/client_skins/skins/default/styles/splitters.otui b/data/styles/10-splitters.otui similarity index 100% rename from modules/client_skins/skins/default/styles/splitters.otui rename to data/styles/10-splitters.otui diff --git a/modules/client_skins/skins/default/styles/textedits.otui b/data/styles/10-textedits.otui similarity index 87% rename from modules/client_skins/skins/default/styles/textedits.otui rename to data/styles/10-textedits.otui index f07bc09c..4a1d4600 100644 --- a/modules/client_skins/skins/default/styles/textedits.otui +++ b/data/styles/10-textedits.otui @@ -4,7 +4,7 @@ TextEdit < UITextEdit size: 86 20 text-offset: 0 3 padding: 3 - image-source: /images/textedit.png + image-source: /images/ui/textedit image-border: 1 $disabled: diff --git a/modules/client_skins/skins/default/styles/windows.otui b/data/styles/10-windows.otui similarity index 68% rename from modules/client_skins/skins/default/styles/windows.otui rename to data/styles/10-windows.otui index c68a3ef7..644a4bf3 100644 --- a/modules/client_skins/skins/default/styles/windows.otui +++ b/data/styles/10-windows.otui @@ -5,7 +5,7 @@ Window < UIWindow color: white text-offset: 0 4 text-align: top - image-source: /images/window.png + image-source: /images/ui/window image-border: 5 image-border-top: 22 opacity: 1 @@ -20,5 +20,10 @@ Window < UIWindow $dragging: opacity: 0.8 +HeadlessWindow < UIWindow + image-source: /images/ui/window_headless + image-border: 5 + padding: 5 + MainWindow < Window anchors.centerIn: parent \ No newline at end of file diff --git a/modules/client_skins/skins/default/styles/popupmenus.otui b/data/styles/20-popupmenus.otui similarity index 85% rename from modules/client_skins/skins/default/styles/popupmenus.otui rename to data/styles/20-popupmenus.otui index 7358672d..163fc39e 100644 --- a/modules/client_skins/skins/default/styles/popupmenus.otui +++ b/data/styles/20-popupmenus.otui @@ -8,7 +8,7 @@ PopupMenuButton < UIButton text-offset: 0 0 font: verdana-11px-antialised - image-source: /images/menubutton.png + image-source: /images/ui/button_popupmenu image-color: white image-clip: 0 0 20 20 image-border: 2 @@ -28,7 +28,7 @@ PopupMenuSeparator < UIWidget margin-left: 2 margin-right: 2 margin-bottom: 1 - image-source: /images/menubox.png + image-source: /images/ui/menubox image-border-left: 1 image-border-right: 1 image-clip: 0 0 32 2 @@ -37,7 +37,7 @@ PopupMenuSeparator < UIWidget PopupMenu < UIPopupMenu width: 50 - image-source: /images/menubox.png + image-source: /images/ui/menubox image-border: 3 padding-top: 3 padding-bottom: 3 diff --git a/modules/client_skins/skins/default/styles/spinboxes.otui b/data/styles/20-spinboxes.otui similarity index 87% rename from modules/client_skins/skins/default/styles/spinboxes.otui rename to data/styles/20-spinboxes.otui index 5749a1fa..aa7f27ff 100644 --- a/modules/client_skins/skins/default/styles/spinboxes.otui +++ b/data/styles/20-spinboxes.otui @@ -5,7 +5,7 @@ SpinBox < TextEdit Button id: up size: 10 10 - image-source: /images/spinbox_up.png + image-source: /images/ui/spinbox_up image-border: 1 image-clip: 0 0 10 10 anchors.top: parent.top @@ -20,7 +20,7 @@ SpinBox < TextEdit Button id: down size: 10 10 - image-source: /images/spinbox_down.png + image-source: /images/ui/spinbox_down image-border: 1 image-clip: 0 0 10 10 anchors.bottom: parent.bottom diff --git a/data/styles/20-tabbars.otui b/data/styles/20-tabbars.otui new file mode 100644 index 00000000..7fcd4854 --- /dev/null +++ b/data/styles/20-tabbars.otui @@ -0,0 +1,89 @@ +TabBar < UITabBar + size: 80 20 +TabBarPanel < Panel +TabBarButton < UIButton + size: 20 20 + image-source: /images/ui/tabbutton_square + image-color: white + image-clip: 0 0 20 20 + image-border: 2 + icon-color: white + color: #aaaaaa + anchors.top: parent.top + anchors.left: parent.left + padding: 5 + + $hover !checked: + image-clip: 0 20 20 20 + color: white + + $disabled: + image-color: #ffffff66 + icon-color: #888888 + + $checked: + image-clip: 0 40 20 20 + color: #D8E7F0 + + $on !checked: + color: #F55E5E + +TabBarRounded < TabBar +TabBarRoundedPanel < TabBarPanel +TabBarRoundedButton < TabBarButton + image-source: /images/ui/tabbutton_rounded + +TabBarVertical < UITabBar + width: 96 + + ScrollableFlatPanel + id: buttonsPanel + anchors.top: parent.top + anchors.left: parent.left + anchors.right: scrollBar.left + anchors.bottom: parent.bottom + vertical-scrollbar: scrollBar + + VerticalScrollBar + id: scrollBar + anchors.top: parent.top + anchors.bottom: parent.bottom + anchors.right: parent.right + step: 16 + pixels-scroll: true + + $!on: + width: 0 + +TabBarVerticalPanel < Panel + +TabBarVerticalButton < UIButton + size: 48 48 + color: #aaaaaa + anchors.left: parent.left + anchors.right: parent.right + text-align: bottom + icon-align: top + icon-offset-y: 2 + icon-color: #888888 + + $first: + anchors.top: parent.top + + $!first: + anchors.top: prev.bottom + margin-top: 5 + + $hover !checked: + color: white + icon-color: #cccccc + + $disabled: + icon-color: #333333 + + $checked: + icon-color: #ffffff + color: #80c7f8 + + $on !checked: + color: #F55E5E diff --git a/modules/client_skins/skins/default/styles/tables.otui b/data/styles/20-tables.otui similarity index 100% rename from modules/client_skins/skins/default/styles/tables.otui rename to data/styles/20-tables.otui diff --git a/data/styles/20-topmenu.otui b/data/styles/20-topmenu.otui new file mode 100644 index 00000000..26db4951 --- /dev/null +++ b/data/styles/20-topmenu.otui @@ -0,0 +1,49 @@ +TopButton < UIButton + size: 26 26 + image-source: /images/ui/button_top + image-clip: 0 0 26 26 + image-border: 3 + image-color: #ffffffff + icon-color: #ffffffff + + $hover !disabled: + image-color: #ffffff99 + image-clip: 26 0 26 26 + + $pressed: + image-clip: 52 0 26 26 + + $disabled: + image-color: #ffffff44 + icon-color: #ffffff44 + +TopToggleButton < UIButton + size: 26 26 + image-source: /images/ui/button_topgame + image-clip: 26 0 26 26 + image-color: #ffffffff + image-border: 3 + icon-color: #ffffffff + + $on: + image-clip: 0 0 26 26 + image-color: #ffffffff + icon-color: #ffffffff + +TopMenuButtonsPanel < Panel + layout: + type: horizontalBox + spacing: 4 + fit-children: true + padding: 6 4 + +TopMenuPanel < Panel + height: 36 + image-source: /images/ui/panel_top + image-repeated: true + focusable: false + +TopMenuFrameCounterLabel < FrameCounterLabel + color: white + margin-top: 4 + margin-left: 5 \ No newline at end of file diff --git a/data/styles/30-inputboxes.otui b/data/styles/30-inputboxes.otui new file mode 100644 index 00000000..90cbb65d --- /dev/null +++ b/data/styles/30-inputboxes.otui @@ -0,0 +1,30 @@ +InputBoxLabel < Label + fixed-size: true + text-align: left +InputBoxLineEdit < TextEdit +InputBoxTextEdit < MultilineTextEdit + text-wrap: true +InputBoxSpinBox < SpinBox +InputBoxCheckBox < CheckBox +InputBoxComboBox < ComboBox +InputBoxComboBoxPopupMenu < ComboBoxPopupMenu +InputBoxComboBoxPopupMenuButton < ComboBoxPopupMenuButton +InputBoxButton < Button + margin-left: 10 + fixed-size: true + +InputBoxButtonsPanel < Panel + height: 20 + margin-top: 4 + focusable: false + layout: + type: horizontalBox + align-right: true + +InputBoxWindow < MainWindow + __class: UIInputBox + width: 260 + layout: + type: verticalBox + fit-children: true + spacing: 2 \ No newline at end of file diff --git a/modules/client_skins/skins/default/styles/messageboxes.otui b/data/styles/30-messageboxes.otui similarity index 100% rename from modules/client_skins/skins/default/styles/messageboxes.otui rename to data/styles/30-messageboxes.otui diff --git a/modules/client_skins/skins/default/styles/miniwindow.otui b/data/styles/30-miniwindow.otui similarity index 93% rename from modules/client_skins/skins/default/styles/miniwindow.otui rename to data/styles/30-miniwindow.otui index 681e909a..75c79c23 100644 --- a/modules/client_skins/skins/default/styles/miniwindow.otui +++ b/data/styles/30-miniwindow.otui @@ -5,7 +5,7 @@ MiniWindow < UIMiniWindow height: 200 text-offset: 24 5 text-align: topLeft - image-source: /images/miniwindow.png + image-source: /images/ui/miniwindow image-border: 4 image-border-top: 23 image-border-bottom: 4 @@ -33,7 +33,7 @@ MiniWindow < UIMiniWindow margin-top: 5 margin-right: 5 size: 14 14 - image-source: /images/miniwindowbuttons.png + image-source: /images/ui/miniwindow_buttons image-clip: 28 0 14 14 $hover: @@ -48,7 +48,7 @@ MiniWindow < UIMiniWindow anchors.right: closeButton.left margin-right: 3 size: 14 14 - image-source: /images/miniwindowbuttons.png + image-source: /images/ui/miniwindow_buttons image-clip: 0 0 14 14 $hover: diff --git a/init.lua b/init.lua index a3864d0c..30e37bb6 100644 --- a/init.lua +++ b/init.lua @@ -7,6 +7,11 @@ g_logger.setLogFile(g_resources.getWorkDir() .. g_app.getCompactName() .. ".log" -- print first terminal message g_logger.info(g_app.getName() .. ' ' .. g_app.getVersion() .. ' rev ' .. g_app.getBuildRevision() .. ' (' .. g_app.getBuildCommit() .. ') built on ' .. g_app.getBuildDate() .. ' for arch ' .. g_app.getBuildArch()) +-- add data directory to the search path +if not g_resources.addSearchPath(g_resources.getWorkDir() .. "data", true) then + g_logger.fatal("Unable to add data directory to the search path.") +end + -- add modules directory to the search path if not g_resources.addSearchPath(g_resources.getWorkDir() .. "modules", true) then g_logger.fatal("Unable to add modules directory to the search path.") @@ -42,7 +47,7 @@ g_modules.ensureModuleLoaded("game_interface") -- mods 1000-9999 g_modules.autoLoadModules(9999) -if g_resources.fileExists("/otclientrc.lua") then - dofile("/otclientrc.lua") +if g_resources.fileExists("/otclientrc") then + dofile("/otclientrc") end diff --git a/modules/client/client.lua b/modules/client/client.lua index 16fd2bce..ec7ed2c3 100644 --- a/modules/client/client.lua +++ b/modules/client/client.lua @@ -1,4 +1,4 @@ -local musicFilename = "startup" +local musicFilename = "/sounds/startup" local musicChannel = g_sounds.getChannel(1) function setMusic(filename) @@ -75,7 +75,7 @@ function init() end g_window.setTitle(g_app.getName()) - g_window.setIcon(resolvepath('clienticon')) + g_window.setIcon('/images/clienticon') -- poll resize events g_window.poll() diff --git a/modules/client/client.otmod b/modules/client/client.otmod index 3d002798..7f899e4c 100644 --- a/modules/client/client.otmod +++ b/modules/client/client.otmod @@ -10,7 +10,7 @@ Module @onUnload: terminate() load-later: - - client_skins + - client_styles - client_locales //- client_particles - client_topmenu diff --git a/modules/client_background/background.lua b/modules/client_background/background.lua index 0e336f1f..a3cc7eea 100644 --- a/modules/client_background/background.lua +++ b/modules/client_background/background.lua @@ -1,15 +1,13 @@ -Background = { } - -- private variables local background -- public functions -function Background.init() - background = g_ui.displayUI('background.otui') +function init() + background = g_ui.displayUI('background') background:lower() local clientVersionLabel = background:getChildById('clientVersionLabel') - clientVersionLabel:setText('OTClient ' .. g_app.getVersion() .. '\n' .. + clientVersionLabel:setText(g_app.getName() .. ' ' .. g_app.getVersion() .. '\n' .. 'Rev ' .. g_app.getBuildRevision() .. ' ('.. g_app.getBuildCommit() .. ')\n' .. 'Built on ' .. g_app.getBuildDate()) @@ -17,13 +15,13 @@ function Background.init() g_effects.fadeIn(clientVersionLabel, 1500) end - connect(g_game, { onGameStart = Background.hide }) - connect(g_game, { onGameEnd = Background.show }) + connect(g_game, { onGameStart = hide }) + connect(g_game, { onGameEnd = show }) end -function Background.terminate() - disconnect(g_game, { onGameStart = Background.hide }) - disconnect(g_game, { onGameEnd = Background.show }) +function terminate() + disconnect(g_game, { onGameStart = hide }) + disconnect(g_game, { onGameEnd = show }) g_effects.cancelFade(background:getChildById('clientVersionLabel')) background:destroy() @@ -32,14 +30,14 @@ function Background.terminate() Background = nil end -function Background.hide() +function hide() background:hide() end -function Background.show() +function show() background:show() end -function Background.hideVersionLabel() +function hideVersionLabel() background:getChildById('clientVersionLabel'):hide() end diff --git a/modules/client_background/background.otmod b/modules/client_background/background.otmod index 581766de..fc14d808 100644 --- a/modules/client_background/background.otmod +++ b/modules/client_background/background.otmod @@ -3,13 +3,8 @@ Module description: Handles the background of the login screen author: edubart website: www.otclient.info - - dependencies: - - client_topmenu - - @onLoad: | - dofile 'background' - Background.init() - - @onUnload: | - Background.terminate() + sandboxed: true + scripts: [ background ] + dependencies: [ client_topmenu ] + @onLoad: init() + @onUnload: terminate() diff --git a/modules/client_background/background.otui b/modules/client_background/background.otui index 5ec649fd..e14fb9e7 100644 --- a/modules/client_background/background.otui +++ b/modules/client_background/background.otui @@ -1,6 +1,6 @@ Panel id: background - image-source: /client_background/background.png + image-source: /images/background image-smooth: true image-fixed-ratio: true anchors.top: topMenu.bottom diff --git a/modules/client_entergame/characterlist.lua b/modules/client_entergame/characterlist.lua index 5aebcd22..9629dfbe 100644 --- a/modules/client_entergame/characterlist.lua +++ b/modules/client_entergame/characterlist.lua @@ -92,7 +92,7 @@ end local function onLoginWait(message, time) CharacterList.destroyLoadBox() - waitingWindow = g_ui.displayUI('waitinglist.otui') + waitingWindow = g_ui.displayUI('waitinglist') local label = waitingWindow:getChildById('infoLabel') label:setText(message) @@ -170,7 +170,7 @@ function CharacterList.terminate() end function CharacterList.create(characters, account, otui) - if not otui then otui = 'characterlist.otui' end + if not otui then otui = 'characterlist' end if charactersWindow then charactersWindow:destroy() diff --git a/modules/client_entergame/entergame.lua b/modules/client_entergame/entergame.lua index 99360a04..7506ac66 100644 --- a/modules/client_entergame/entergame.lua +++ b/modules/client_entergame/entergame.lua @@ -60,9 +60,9 @@ end -- public functions function EnterGame.init() - enterGame = g_ui.displayUI('entergame.otui') - enterGameButton = TopMenu.addLeftButton('enterGameButton', tr('Login') .. ' (Ctrl + G)', 'login.png', EnterGame.openWindow) - motdButton = TopMenu.addLeftButton('motdButton', tr('Message of the day'), 'motd.png', EnterGame.displayMotd) + enterGame = g_ui.displayUI('entergame') + enterGameButton = modules.client_topmenu.addLeftButton('enterGameButton', tr('Login') .. ' (Ctrl + G)', '/images/topbuttons/login', EnterGame.openWindow) + motdButton = modules.client_topmenu.addLeftButton('motdButton', tr('Message of the day'), '/images/topbuttons/motd', EnterGame.displayMotd) motdButton:hide() g_keyboard.bindKeyDown('Ctrl+G', EnterGame.openWindow) diff --git a/modules/client_extended/extended.lua b/modules/client_extended/extended.lua deleted file mode 100644 index 3bd35641..00000000 --- a/modules/client_extended/extended.lua +++ /dev/null @@ -1,58 +0,0 @@ -Extended = {} - --- private variables -local callbacks = {} - --- hooked functions -local function onExtendedOpcode(protocol, opcode, buffer) - local callback = callbacks[opcode] - if callback then - callback(protocol, opcode, buffer) - end -end - --- public functions -function Extended.init() - connect(ProtocolGame, { onExtendedOpcode = onExtendedOpcode } ) -end - -function Extended.terminate() - disconnect(ProtocolGame, { onExtendedOpcode = onExtendedOpcode } ) - callbacks = nil - Extended = nil -end - -function Extended.register(opcode, callback) - if not callback or type(callback) ~= 'function' then - error('Invalid callback.') - return false - end - - if opcode < 0 or opcode > 255 then - error('Invalid opcode. Range: 0-255') - return false - end - - if callbacks[opcode] then - error('Opcode is already taken.') - return false - end - - callbacks[opcode] = callback - return true -end - -function Extended.unregister(opcode) - if opcode < 0 or opcode > 255 then - error('Invalid opcode. Range: 0-255') - return false - end - - if not callbacks[opcode] then - error('Opcode is not registered.') - return false - end - - callbacks[opcode] = nil - return true -end diff --git a/modules/client_extended/extended.otmod b/modules/client_extended/extended.otmod deleted file mode 100644 index b0ca614e..00000000 --- a/modules/client_extended/extended.otmod +++ /dev/null @@ -1,12 +0,0 @@ -Module - name: client_extended - description: Manage client extended messages callbacks - author: baxnie - website: www.otclient.info - - @onLoad: | - dofile 'extended' - Extended.init() - - @onUnload: | - Extended.terminate() diff --git a/modules/client_locales/locales.lua b/modules/client_locales/locales.lua index e657160e..a4ae4de6 100644 --- a/modules/client_locales/locales.lua +++ b/modules/client_locales/locales.lua @@ -1,88 +1,86 @@ -Locales = { } - -dofile 'neededtranslations.lua' +dofile 'neededtranslations' -- private variables local defaultLocaleName = 'en' local installedLocales local currentLocale -local localeComboBox --- private functions -local function sendLocale(localeName) +LocaleExtendedId = 1 + +function sendLocale(localeName) local protocolGame = g_game.getProtocolGame() if protocolGame then - protocolGame:sendExtendedOpcode(ExtendedLocales, localeName) + protocolGame:sendExtendedOpcode(LocaleExtendedId, localeName) return true end return false end -local function onLocaleComboBoxOptionChange(self, optionText, optionData) - if Locales.setLocale(optionData) then - g_settings.set('locale', optionData) - sendLocale(currentLocale.name) +function createWindow() + localesWindow = g_ui.displayUI('locales') + local localesPanel = localesWindow:getChildById('localesPanel') + + for name,locale in pairs(installedLocales) do + local widget = g_ui.createWidget('LocalesButton', localesPanel) + widget:setImageSource('/images/flags/' .. name .. '') + widget:setText(locale.languageName) + widget.onClick = function() selectFirstLocale(name) end + end + + addEvent(function() addEvent(function() localesWindow:raise() localesWindow:focus() end) end) +end + +function selectFirstLocale(name) + if localesWindow then + localesWindow:destroy() + localesWindow = nil + end + if setLocale(name) then g_modules.reloadModules() end end -- hooked functions -local function onGameStart() +function onGameStart() sendLocale(currentLocale.name) end -local function onExtendedLocales(protocol, opcode, buffer) +function onExtendedLocales(protocol, opcode, buffer) local locale = installedLocales[buffer] - if locale then - localeComboBox:setCurrentOption(locale.languageName) + if locale and setLocale(locale.name) then + g_modules.reloadModules() end end -- public functions -function Locales.init() +function init() installedLocales = {} - Locales.installLocales('locales') + installLocales('/locales') local userLocaleName = g_settings.get('locale', 'false') - if userLocaleName ~= 'false' and Locales.setLocale(userLocaleName) then + if userLocaleName ~= 'false' and setLocale(userLocaleName) then pdebug('Using configured locale: ' .. userLocaleName) else - pdebug('Using default locale: ' .. defaultLocaleName) - Locales.setLocale(defaultLocaleName) - g_settings.set('locale', defaultLocaleName) + setLocale(defaultLocaleName) + connect(g_app, {onRun = createWindow}) end - addEvent( function() - localeComboBox = g_ui.createWidget('ComboBoxRounded', rootWidget:recursiveGetChildById('rightButtonsPanel')) - localeComboBox:setFixedSize(true) - for key,value in pairs(installedLocales) do - localeComboBox:addOption(value.languageName, value.name) - end - localeComboBox:setCurrentOption(currentLocale.languageName) - localeComboBox.onOptionChange = onLocaleComboBoxOptionChange - end, false) - - Extended.register(ExtendedLocales, onExtendedLocales) + ProtocolGame.registerExtendedOpcode(LocaleExtendedId, onExtendedLocales) connect(g_game, { onGameStart = onGameStart }) end -function Locales.terminate() +function terminate() installedLocales = nil currentLocale = nil - if localeComboBox then - localeComboBox:destroy() - localeComboBox = nil - end - - Extended.unregister(ExtendedLocales) + ProtocolGame.unregisterExtendedOpcode(LocaleExtendedId) disconnect(g_game, { onGameStart = onGameStart }) end function generateNewTranslationTable(localename) local locale = installedLocales[localename] - for _i,k in pairs(Locales.neededTranslations) do + for _i,k in pairs(neededTranslations) do local trans = locale.translation[k] k = k:gsub('\n','\\n') k = k:gsub('\t','\\t') @@ -100,15 +98,16 @@ function generateNewTranslationTable(localename) end end -function Locales.installLocale(locale) +function installLocale(locale) if not locale or not locale.name then error('Unable to install locale.') end if locale.name ~= defaultLocaleName then - for _i,k in pairs(Locales.neededTranslations) do + for _i,k in pairs(neededTranslations) do if locale.translation[k] == nil then - pwarning('Translation for locale \'' .. locale.name .. '\' not found: \"' .. k.. '\"') + local ktext = string.gsub(k, "\n", "\\n") + pwarning('Translation for locale \'' .. locale.name .. '\' not found: \"' .. ktext .. '\"') end end end @@ -120,35 +119,35 @@ function Locales.installLocale(locale) end else installedLocales[locale.name] = locale - if localeComboBox then - localeComboBox.onOptionChange = nil - localeComboBox:addOption(locale.languageName, locale.name) - localeComboBox.onOptionChange = onLocaleComboBoxOptionChange - end end end -function Locales.installLocales(directory) +function installLocales(directory) dofiles(directory) end -function Locales.setLocale(name) +function setLocale(name) local locale = installedLocales[name] if not locale then pwarning("Locale " .. name .. ' does not exist.') return false end currentLocale = locale - if Locales.onLocaleChanged then Locales.onLocaleChanged(name) end + g_settings.set('locale', name) + if onLocaleChanged then onLocaleChanged(name) end return true end -function Locales.getComboBox() - return localeComboBox +function getInstalledLocales() + return installedLocales +end + +function getCurrentLocale() + return currentLocale end -- global function used to translate texts -function tr(text, ...) +function _G.tr(text, ...) if currentLocale then if tonumber(text) then -- todo: use locale information to calculate this. also detect floating numbers @@ -164,8 +163,10 @@ function tr(text, ...) elseif tostring(text) then local translation = currentLocale.translation[text] if not translation then - if currentLocale.name ~= defaultLocaleName then - pwarning('Unable to translate: \"' .. text .. '\"') + if translation == nil then + if currentLocale.name ~= defaultLocaleName then + pwarning('Unable to translate: \"' .. text .. '\"') + end end translation = text end diff --git a/modules/client_locales/locales.otmod b/modules/client_locales/locales.otmod index c8027c11..403081b8 100644 --- a/modules/client_locales/locales.otmod +++ b/modules/client_locales/locales.otmod @@ -1,16 +1,10 @@ Module name: client_locales description: Translates texts to selected language - author: baxnie + author: baxnie, edubart website: www.otclient.info - - dependencies: - - client_extended - - client_topmenu - - @onLoad: | - dofile 'locales' - Locales.init() - - @onUnload: | - Locales.terminate() + sandboxed: true + scripts: [ locales ] + dependencies: [ client_topmenu ] + @onLoad: init() + @onUnload: terminate() diff --git a/modules/client_locales/locales.otui b/modules/client_locales/locales.otui new file mode 100644 index 00000000..b1182d4d --- /dev/null +++ b/modules/client_locales/locales.otui @@ -0,0 +1,37 @@ +LocalesMainLabel < Label + font: sans-bold-16px + +LocalesButton < UIWidget + size: 96 96 + image-size: 96 96 + image-smooth: true + text-offset: 0 96 + font: verdana-11px-antialised + +UIWindow + id: localesWindow + background-color: #000000 + opacity: 0.90 + clipping: true + anchors.fill: parent + + LocalesMainLabel + !text: tr('Select your language') + text-auto-resize: true + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + margin-top: -100 + + Panel + id: localesPanel + !width: 96*3 + 32*3 + margin-left: 16 + margin-top: 50 + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: prev.bottom + anchors.bottom: parent.bottom + layout: + type: grid + cell-size: 96 128 + cell-spacing: 32 + flow: true diff --git a/modules/client_locales/neededtranslations.lua b/modules/client_locales/neededtranslations.lua index 7accad55..d4ef0c49 100644 --- a/modules/client_locales/neededtranslations.lua +++ b/modules/client_locales/neededtranslations.lua @@ -1,5 +1,5 @@ -- generated by ./tools/gen_needed_translations.sh -Locales.neededTranslations = { +modules.client_locales.neededTranslations = { "1a) Offensive Name", "1b) Invalid Name Format", "1c) Unsuitable Name", diff --git a/modules/client_modulemanager/modulemanager.lua b/modules/client_modulemanager/modulemanager.lua index 4fab7c63..1cb1ce67 100644 --- a/modules/client_modulemanager/modulemanager.lua +++ b/modules/client_modulemanager/modulemanager.lua @@ -1,60 +1,61 @@ -ModuleManager = {} - local moduleManagerWindow local moduleManagerButton local moduleList -function ModuleManager.init() - moduleManagerWindow = g_ui.displayUI('modulemanager.otui') +function init() + moduleManagerWindow = g_ui.displayUI('modulemanager') moduleManagerWindow:hide() moduleList = moduleManagerWindow:getChildById('moduleList') connect(moduleList, { onChildFocusChange = function(self, focusedChild) if focusedChild == nil then return end - ModuleManager.updateModuleInfo(focusedChild:getText()) + updateModuleInfo(focusedChild:getText()) end }) g_keyboard.bindKeyPress('Up', function() moduleList:focusPreviousChild(KeyboardFocusReason) end, moduleManagerWindow) g_keyboard.bindKeyPress('Down', function() moduleList:focusNextChild(KeyboardFocusReason) end, moduleManagerWindow) - moduleManagerButton = TopMenu.addLeftButton('moduleManagerButton', tr('Module Manager'), 'modulemanager.png', ModuleManager.toggle) + moduleManagerButton = modules.client_topmenu.addLeftButton('moduleManagerButton', tr('Module Manager'), '/images/topbuttons/modulemanager', toggle) -- refresh modules only after all modules are loaded - addEvent(ModuleManager.listModules) + addEvent(listModules) +end + +function hideButton() + moduleManagerButton:hide() end -function ModuleManager.terminate() +function terminate() moduleManagerWindow:destroy() moduleManagerWindow = nil moduleManagerButton:destroy() moduleManagerButton = nil moduleList = nil - ModuleManager = nil end -function ModuleManager.hide() +function hide() moduleManagerWindow:hide() end -function ModuleManager.show() +function show() moduleManagerWindow:show() moduleManagerWindow:raise() moduleManagerWindow:focus() end -function ModuleManager.toggle() +function toggle() if moduleManagerWindow:isVisible() then - ModuleManager.hide() + hide() else - ModuleManager.show() + show() end end -function ModuleManager.refreshModules() +function refreshModules() g_modules.discoverModules() - ModuleManager.listModules() + listModules() end -function ModuleManager.listModules() +function listModules() if not moduleManagerWindow then return end moduleList:destroyChildren() @@ -69,7 +70,7 @@ function ModuleManager.listModules() moduleList:focusChild(moduleList:getFirstChild(), ActiveFocusReason) end -function ModuleManager.refreshLoadedModules() +function refreshLoadedModules() if not moduleManagerWindow then return end for i,child in ipairs(moduleList:getChildren()) do @@ -78,7 +79,7 @@ function ModuleManager.refreshLoadedModules() end end -function ModuleManager.updateModuleInfo(moduleName) +function updateModuleInfo(moduleName) if not moduleManagerWindow then return end local name = '' @@ -118,36 +119,36 @@ function ModuleManager.updateModuleInfo(moduleName) unloadButton:setEnabled(canUnload) end -function ModuleManager.reloadCurrentModule() +function reloadCurrentModule() local focusedChild = moduleList:getFocusedChild() if focusedChild then local module = g_modules.getModule(focusedChild:getText()) if module then module:reload() - if ModuleManager == nil then return end - ModuleManager.updateModuleInfo(module:getName()) - ModuleManager.refreshLoadedModules() - ModuleManager.show() + if modules.client_modulemanager == nil then return end + updateModuleInfo(module:getName()) + refreshLoadedModules() + show() end end end -function ModuleManager.unloadCurrentModule() +function unloadCurrentModule() local focusedChild = moduleList:getFocusedChild() if focusedChild then local module = g_modules.getModule(focusedChild:getText()) if module then module:unload() if ModuleManager == nil then return end - ModuleManager.updateModuleInfo(module:getName()) - ModuleManager.refreshLoadedModules() + updateModuleInfo(module:getName()) + refreshLoadedModules() end end end -function ModuleManager.reloadAllModules() +function reloadAllModules() g_modules.reloadModules() - ModuleManager.refreshLoadedModules() - ModuleManager.show() + refreshLoadedModules() + show() end diff --git a/modules/client_modulemanager/modulemanager.otmod b/modules/client_modulemanager/modulemanager.otmod index a8ac0c52..aa839507 100644 --- a/modules/client_modulemanager/modulemanager.otmod +++ b/modules/client_modulemanager/modulemanager.otmod @@ -3,13 +3,8 @@ Module description: Manage other modules author: edubart website: www.otclient.info - - dependencies: - - client_topmenu - - @onLoad: | - dofile 'modulemanager' - ModuleManager.init() - - @onUnload: | - ModuleManager.terminate() + sandboxed: true + scripts: [ modulemanager ] + dependencies: [ client_topmenu ] + @onLoad: init() + @onUnload: terminate() diff --git a/modules/client_modulemanager/modulemanager.otui b/modules/client_modulemanager/modulemanager.otui index e4a97812..8b7e0b7d 100644 --- a/modules/client_modulemanager/modulemanager.otui +++ b/modules/client_modulemanager/modulemanager.otui @@ -35,7 +35,7 @@ MainWindow size: 450 450 !text: tr('Module Manager') - @onEscape: ModuleManager.hide() + @onEscape: modules.client_modulemanager.hide() TextList id: moduleList @@ -63,7 +63,7 @@ MainWindow margin-top: 8 !text: tr('Refresh') text-auto-resize: true - @onClick: ModuleManager.refreshModules() + @onClick: modules.client_modulemanager.refreshModules() Button id: reloadAllModulesButton @@ -72,7 +72,7 @@ MainWindow margin-top: 8 !text: tr('Reload All') text-auto-resize: true - @onClick: ModuleManager.reloadAllModules() + @onClick: modules.client_modulemanager.reloadAllModules() Panel id: moduleInfo @@ -131,7 +131,7 @@ MainWindow !text: tr('Load') enabled: false width: 90 - @onClick: ModuleManager.reloadCurrentModule() + @onClick: modules.client_modulemanager.reloadCurrentModule() Button id: moduleUnloadButton @@ -142,7 +142,7 @@ MainWindow !text: tr('Unload') enabled: false width: 90 - @onClick: ModuleManager.unloadCurrentModule() + @onClick: modules.client_modulemanager.unloadCurrentModule() Button id: closeButton @@ -150,5 +150,5 @@ MainWindow anchors.right: parent.right !text: tr('Close') width: 90 - @onClick: ModuleManager.hide() + @onClick: modules.client_modulemanager.hide() diff --git a/modules/client_options/graphics.otui b/modules/client_options/graphics.otui index ec50ba2b..3d4f9669 100644 --- a/modules/client_options/graphics.otui +++ b/modules/client_options/graphics.otui @@ -1,9 +1,9 @@ FrameRateScrollbar < HorizontalScrollBar step: 1 - @onValueChange: Options.setOption(self:getId(), self:getValue()) + @onValueChange: modules.client_options.setOption(self:getId(), self:getValue()) @onSetup: | UIScrollBar.onSetup(self) - local value = Options.getOption(self:getId()) + local value = modules.client_options.getOption(self:getId()) if value == 0 then value = self:getMaximum() end self:setValue(value) @@ -54,7 +54,7 @@ Panel anchors.top: prev.bottom margin-top: 16 @onSetup: | - local value = Options.getOption('backgroundFrameRate') + local value = modules.client_options.getOption('backgroundFrameRate') local text = value if value <= 0 or value >= 201 then text = 'max' @@ -78,7 +78,7 @@ Panel anchors.top: prev.bottom margin-top: 6 @onSetup: | - local value = Options.getOption('foregroundFrameRate') + local value = modules.client_options.getOption('foregroundFrameRate') local text = value if value <= 0 or value >= 61 then text = 'max' @@ -102,7 +102,7 @@ Panel anchors.top: prev.bottom margin-top: 6 @onSetup: | - local value = Options.getOption('ambientLight') + local value = modules.client_options.getOption('ambientLight') self:setText(tr('Ambient light: %s%%', value)) FrameRateScrollbar diff --git a/modules/client_options/options.lua b/modules/client_options/options.lua index d140863e..34dc900c 100644 --- a/modules/client_options/options.lua +++ b/modules/client_options/options.lua @@ -1,5 +1,3 @@ -Options = {} - local defaultOptions = { vsync = false, showFps = true, @@ -52,9 +50,9 @@ local function setupGraphicsEngines() enginesRadioGroup.onSelectionChange = function(self, selected) if selected == ogl1 then - Options.setOption('painterEngine', 1) + setOption('painterEngine', 1) elseif selected == ogl2 then - Options.setOption('painterEngine', 2) + setOption('painterEngine', 2) end end @@ -79,49 +77,49 @@ function displayWarning(widget, warning) end end -function Options.init() +function init() -- load options for k,v in pairs(defaultOptions) do g_settings.setDefault(k, v) if type(v) == 'boolean' then - Options.setOption(k, g_settings.getBoolean(k)) + setOption(k, g_settings.getBoolean(k)) elseif type(v) == 'number' then - Options.setOption(k, g_settings.getNumber(k)) + setOption(k, g_settings.getNumber(k)) end end - g_keyboard.bindKeyDown('Ctrl+D', function() Options.toggle() end) - g_keyboard.bindKeyDown('Ctrl+F', function() Options.toggleOption('fullscreen') end) - g_keyboard.bindKeyDown('Ctrl+Shift+D', function() Options.toggleOption('walkBooster') end) + g_keyboard.bindKeyDown('Ctrl+D', function() toggle() end) + g_keyboard.bindKeyDown('Ctrl+F', function() toggleOption('fullscreen') end) + g_keyboard.bindKeyDown('Ctrl+Shift+D', function() toggleOption('walkBooster') end) - optionsWindow = g_ui.displayUI('options.otui') + optionsWindow = g_ui.displayUI('options') optionsWindow:hide() - optionsButton = TopMenu.addLeftButton('optionsButton', tr('Options') .. ' (Ctrl+D)', 'options.png', Options.toggle) + optionsButton = modules.client_topmenu.addLeftButton('optionsButton', tr('Options') .. ' (Ctrl+D)', '/images/topbuttons/options', toggle) optionsTabBar = optionsWindow:getChildById('optionsTabBar') optionsTabBar:setContentWidget(optionsWindow:getChildById('optionsTabContent')) - gamePanel = g_ui.loadUI('game.otui') + gamePanel = g_ui.loadUI('game') optionsTabBar:addTab(tr('Game'), gamePanel) - consolePanel = g_ui.loadUI('console.otui') + consolePanel = g_ui.loadUI('console') optionsTabBar:addTab(tr('Console'), consolePanel) - graphicsPanel = g_ui.loadUI('graphics.otui') + graphicsPanel = g_ui.loadUI('graphics') optionsTabBar:addTab(tr('Graphics'), graphicsPanel) if g_game.isOfficialTibia() then local optionWalkBooster = gamePanel:getChildById('walkBooster') optionWalkBooster.onCheckChange = function(widget) displayWarning(widget, "This feature could be detectable by official Tibia servers. Would like to continue?") - Options.setOption(widget:getId(), widget:isChecked()) + setOption(widget:getId(), widget:isChecked()) end end setupGraphicsEngines() end -function Options.terminate() +function terminate() g_keyboard.unbindKeyDown('Ctrl+D') g_keyboard.unbindKeyDown('Ctrl+F') g_keyboard.unbindKeyDown('Ctrl+Shift+D') @@ -133,37 +131,36 @@ function Options.terminate() gamePanel = nil consolePanel = nil graphicsPanel = nil - Options = nil end -function Options.toggle() +function toggle() if optionsWindow:isVisible() then - Options.hide() + hide() else - Options.show() + show() end end -function Options.show() +function show() optionsWindow:show() optionsWindow:raise() optionsWindow:focus() end -function Options.hide() +function hide() optionsWindow:hide() end -function Options.toggleOption(key) +function toggleOption(key) local optionWidget = optionsWindow:recursiveGetChildById(key) if optionWidget then - optionWidget:setChecked(not Options.getOption(key)) + optionWidget:setChecked(not getOption(key)) else - Options.setOption(key, not Options.getOption(key)) + setOption(key, not getOption(key)) end end -function Options.setOption(key, value) +function setOption(key, value) if options[key] == value then return end if key == 'vsync' then g_window.setVerticalSync(value) @@ -229,7 +226,7 @@ function Options.setOption(key, value) options[key] = value end -function Options.getOption(key) +function getOption(key) return options[key] end diff --git a/modules/client_options/options.otmod b/modules/client_options/options.otmod index 7361c42f..1b99917a 100644 --- a/modules/client_options/options.otmod +++ b/modules/client_options/options.otmod @@ -3,13 +3,8 @@ Module description: Create the options window author: edubart, BeniS website: www.otclient.info - - dependencies: - - client_topmenu - - @onLoad: | - dofile 'options' - Options.init() - - @onUnload: | - Options.terminate() + sandboxed: true + dependencies: [ client_topmenu ] + scripts: [ options ] + @onLoad: init() + @onUnload: terminate() diff --git a/modules/client_options/options.otui b/modules/client_options/options.otui index 9881034a..d3ea073b 100644 --- a/modules/client_options/options.otui +++ b/modules/client_options/options.otui @@ -1,6 +1,6 @@ OptionCheckBox < CheckBox - @onCheckChange: Options.setOption(self:getId(), self:isChecked()) - @onSetup: self:setChecked(Options.getOption(self:getId())) + @onCheckChange: modules.client_options.setOption(self:getId(), self:isChecked()) + @onSetup: self:setChecked(modules.client_options.getOption(self:getId())) height: 16 $first: @@ -19,8 +19,8 @@ MainWindow !text: tr('Options') size: 350 310 - @onEnter: Options.hide() - @onEscape: Options.hide() + @onEnter: modules.client_options.hide() + @onEscape: modules.client_options.hide() TabBarRounded id: optionsTabBar @@ -41,4 +41,4 @@ MainWindow width: 64 anchors.right: parent.right anchors.bottom: parent.bottom - @onClick: Options.hide() + @onClick: modules.client_options.hide() diff --git a/modules/client_particles/particles.lua b/modules/client_particles/particles.lua deleted file mode 100644 index 44196129..00000000 --- a/modules/client_particles/particles.lua +++ /dev/null @@ -1,95 +0,0 @@ -Particles = { } - --- private variables -local particlesWindow -local particlesButton - --- private functions -local function onExtendedParticles(protocol, opcode, buffer) - -end - --- public functions -function Particles.init() - particlesWindow = g_ui.displayUI('particles.otui') - particlesButton = TopMenu.addLeftButton('particlesButton', tr('Particles Manager'), 'particles.png', Particles.toggle) - - local particlesList = particlesWindow:getChildById('particlesList') - g_keyboard.bindKeyPress('Up', function() particlesList:focusPreviousChild(KeyboardFocusReason) end, particlesWindow) - g_keyboard.bindKeyPress('Down', function() particlesList:focusNextChild(KeyboardFocusReason) end, particlesWindow) - - Extended.register(ExtendedParticles, onExtendedParticles) -end - -function Particles.terminate() - particlesWindow:destroy() - particlesWindow = nil - - particlesButton:destroy() - particlesButton = nil - - Extended.unregister(ExtendedParticles) -end - -function Particles.show() - Particles.refreshList() - particlesWindow:show() - particlesWindow:raise() - particlesWindow:focus() -end - -function Particles.hide() - particlesWindow:hide() -end - -function Particles.toggle() - if particlesWindow:isVisible() then - Particles.hide() - else - Particles.show() - end -end - -function Particles.refreshInfo() - local particlesList = particlesWindow:getChildById('particlesList') - local widget = particlesList:getFocusedChild() - - local name = particlesWindow:getChildById('name') - name:setText(widget.effect:getName()) - - local location = particlesWindow:getChildById('location') - location:setText(widget.effect:getFile()) - - local description = particlesWindow:getChildById('description') - description:setText(widget.effect:getDescription()) -end - -function Particles.refreshList() - local particlesList = particlesWindow:getChildById('particlesList') - particlesList.onChildFocusChange = nil - particlesList:destroyChildren() - - local firstChild = nil - local effects = g_particles.getEffectsTypes() - for name,effect in pairs(effects) do - local label = g_ui.createWidget('ParticlesListLabel', particlesList) - label:setText(name) - label.effect = effect - - if not firstChild then - firstChild = label - end - end - - particlesList.onChildFocusChange = Particles.refreshInfo - if firstChild then - firstChild:focus() - end -end - -function Particles.start() - local particlesList = particlesWindow:getChildById('particlesList') - local focusedEffect = particlesList:getFocusedChild() - local preview = particlesWindow:getChildById('preview') - preview:addEffect(focusedEffect:getText()) -end diff --git a/modules/client_particles/particles.otmod b/modules/client_particles/particles.otmod deleted file mode 100644 index fa38eda3..00000000 --- a/modules/client_particles/particles.otmod +++ /dev/null @@ -1,17 +0,0 @@ -Module - name: client_particles - description: Manages particles systems - author: baxnie - website: www.otclient.info - - dependencies: - - client_extended - - client_locales - - client_topmenu - - @onLoad: | - dofile 'particles' - Particles.init() - - @onUnload: | - Particles.terminate() diff --git a/modules/client_particles/particles.otui b/modules/client_particles/particles.otui deleted file mode 100644 index 229102a6..00000000 --- a/modules/client_particles/particles.otui +++ /dev/null @@ -1,130 +0,0 @@ -ParticlesListLabel < Label - font: verdana-11px-monochrome - background-color: alpha - text-offset: 2 0 - focusable: true - - $focus: - background-color: #ffffff22 - color: #ffffff - -MainWindow - id: particlesWindow - !text: tr('Particles Manager') - size: 450 450 - visible: false - @onEscape: Particles.hide() - - TextList - id: particlesList - anchors.top: parent.top - anchors.left: parent.left - anchors.bottom: separator.top - width: 128 - padding: 1 - focusable: false - margin-bottom: 10 - vertical-scrollbar: particlesListScrollBar - - VerticalScrollBar - id: particlesListScrollBar - anchors.top: particlesList.top - anchors.bottom: particlesList.bottom - anchors.left: particlesList.right - step: 14 - pixels-scroll: true - - Label - !text: tr('Name') - anchors.top: parent.top - anchors.left: prev.right - margin-left: 10 - - FlatLabel - id: name - anchors.top: prev.bottom - anchors.left: prev.left - anchors.right: parent.right - margin-top: 3 - - Label - !text: tr('Location') - anchors.top: prev.bottom - anchors.left: prev.left - margin-top: 10 - - FlatLabel - id: location - anchors.top: prev.bottom - anchors.left: prev.left - anchors.right: parent.right - margin-top: 3 - - Label - !text: tr('Description') - anchors.top: prev.bottom - anchors.left: prev.left - margin-top: 10 - - FlatLabel - id: description - anchors.top: prev.bottom - anchors.left: prev.left - anchors.right: parent.right - margin-top: 3 - - Label - !text: tr('Preview') - anchors.top: prev.bottom - anchors.left: prev.left - margin-top: 10 - - ParticlesFlatPanel - id: preview - margin-top: 3 - margin-bottom: 10 - anchors.top: prev.bottom - anchors.bottom: next.top - anchors.left: prev.left - anchors.right: parent.right - - reference: 10 10 - - Button - id: startButton - !text: tr('Start') - width: 64 - anchors.bottom: separator.top - anchors.left: location.left - margin-bottom: 10 - - Button - id: pauseButton - !text: tr('Pause') - width: 64 - anchors.bottom: prev.bottom - anchors.left: prev.right - margin-left: 5 - - Button - id: reloadButton - !text: tr('Reload') - width: 64 - anchors.bottom: separator.top - anchors.right: parent.right - margin-bottom: 10 - - HorizontalSeparator - id: separator - anchors.left: parent.left - anchors.right: parent.right - anchors.bottom: next.top - margin-bottom: 10 - - Button - id: closeButton - !text: tr('Close') - width: 64 - anchors.right: parent.right - anchors.bottom: parent.bottom - @onClick: Particles.hide() diff --git a/modules/client_skins/skins.lua b/modules/client_skins/skins.lua deleted file mode 100644 index 3939ca08..00000000 --- a/modules/client_skins/skins.lua +++ /dev/null @@ -1,144 +0,0 @@ -Skins = { } - --- private variables -local defaultSkinName = 'Default' -local installedSkins -local currentSkin -local skinComboBox - --- private functions -local function onSkinComboBoxOptionChange(self, optionText, optionData) - if Skins.setSkin(optionText) then - g_settings.set('skin', optionText) - g_textures.clearTexturesCache() - g_modules.reloadModules() - end -end - -local function getSkinPath(name) - return getfsrcpath() .. '/skins/' .. string.lower(name) -end - --- public functions -function Skins.init() - installedSkins = {} - - Skins.installSkins('skins') - - if installedSkins[defaultSkinName] then - g_resources.addSearchPath(getSkinPath(defaultSkinName), true) - end - - local userSkinName = g_settings.get('skin', 'false') - if userSkinName ~= 'false' and Skins.setSkin(userSkinName) then - pdebug('Using configured skin: ' .. userSkinName) - else - pdebug('Using default skin: ' .. defaultSkinName) - Skins.setSkin(defaultSkinName) - g_settings.set('skin', defaultSkinName) - end - - addEvent( function() - skinComboBox = g_ui.createWidget('ComboBoxRounded', rootWidget:recursiveGetChildById('rightButtonsPanel')) - skinComboBox:setFixedSize(true) - for key,value in pairs(installedSkins) do - skinComboBox:addOption(value.name) - end - skinComboBox:setCurrentOption(currentSkin.name) - skinComboBox.onOptionChange = onSkinComboBoxOptionChange - end, false) -end - -function Skins.terminate() - g_resources.removeSearchPath(getSkinPath(defaultSkinName)) - if currentSkin then - g_resources.removeSearchPath(getSkinPath(currentSkin.name)) - end - - installedSkins = nil - currentSkin = nil - skinComboBox = nil -end - -function Skins.installSkin(skin) - if not skin or not skin.name or not skin.styles then - error('Unable to install skin.') - return false - end - - if installedSkins[skin.name] then - pwarning(skin.name .. ' has been replaced.') - end - - installedSkins[skin.name] = skin - return true -end - -function Skins.installSkins(directory) - dofiles(directory) -end - -function Skins.setSkin(name) - local skin = installedSkins[name] - if not skin then - pwarning("Skin " .. name .. ' does not exist.') - return false - end - - g_fonts.clearFonts() - g_ui.clearStyles() - - if currentSkin and currentSkin.name ~= defaultSkinName then - g_resources.removeSearchPath(getSkinPath(currentSkin.name)) - end - - if skin.name ~= defaultSkinName then - g_resources.addSearchPath(getSkinPath(skin.name), true) - Skins.loadSkin(skin) - end - - local defaultSkin = installedSkins[defaultSkinName] - if not defaultSkin then - error("Default skin is not installed.") - return false - end - Skins.loadSkin(defaultSkin) - - currentSkin = skin - return true -end - -function Skins.loadSkin(skin) - local lowerName = string.lower(skin.name) - - if skin.fonts then - for i=1,#skin.fonts do - g_fonts.importFont('skins/' .. lowerName .. '/fonts/' .. skin.fonts[i]) - end - end - - if skin.defaultFont then - g_fonts.setDefaultFont(skin.defaultFont) - end - - if skin.styles then - for i=1,#skin.styles do - g_ui.importStyle('skins/' .. lowerName .. '/styles/' .. skin.styles[i]) - end - end - - if skin.particles then - for i=1,#skin.particles do - g_particles.importParticle('skins/' .. lowerName .. '/particles/' .. skin.particles[i]) - end - end -end - -function Skins.hideComboBox() - if not skinComboBox then - addEvent(Skins.hideComboBox) - else - skinComboBox:hide() - skinComboBox:setWidth(0) - end -end diff --git a/modules/client_skins/skins.otmod b/modules/client_skins/skins.otmod deleted file mode 100644 index 1c81a4f9..00000000 --- a/modules/client_skins/skins.otmod +++ /dev/null @@ -1,12 +0,0 @@ -Module - name: client_skins - description: Changes modules styles - author: baxnie - website: www.otclient.info - - @onLoad: | - dofile 'skins' - Skins.init() - - @onUnload: | - Skins.terminate() diff --git a/modules/client_skins/skins/default.lua b/modules/client_skins/skins/default.lua deleted file mode 100644 index da423c7f..00000000 --- a/modules/client_skins/skins/default.lua +++ /dev/null @@ -1,42 +0,0 @@ -local skin = { - name = 'Default', - - -- first font is default - fonts = { - 'verdana-11px-antialised', - 'verdana-11px-monochrome', - 'verdana-11px-rounded', - 'terminus-14px-bold' - }, - defaultFont = 'verdana-11px-antialised', - - styles = { - 'buttons.otui', - 'creaturebuttons.otui', - 'labels.otui', - 'panels.otui', - 'separators.otui', - 'textedits.otui', - 'checkboxes.otui', - 'progressbars.otui', - 'tabbars.otui', - 'windows.otui', - 'listboxes.otui', - 'popupmenus.otui', - 'comboboxes.otui', - 'spinboxes.otui', - 'messageboxes.otui', - 'scrollbars.otui', - 'splitters.otui', - 'miniwindow.otui', - 'items.otui', - 'creatures.otui', - 'tables.otui' - }, - - particles = { - 'shiny.otps' - } -} - -Skins.installSkin(skin) diff --git a/modules/client_skins/skins/default/images/arrow_down.png b/modules/client_skins/skins/default/images/arrow_down.png deleted file mode 100644 index c808639a..00000000 Binary files a/modules/client_skins/skins/default/images/arrow_down.png and /dev/null differ diff --git a/modules/client_skins/skins/default/images/arrow_left.png b/modules/client_skins/skins/default/images/arrow_left.png deleted file mode 100644 index 87e99664..00000000 Binary files a/modules/client_skins/skins/default/images/arrow_left.png and /dev/null differ diff --git a/modules/client_skins/skins/default/images/arrow_right.png b/modules/client_skins/skins/default/images/arrow_right.png deleted file mode 100644 index e8f6b430..00000000 Binary files a/modules/client_skins/skins/default/images/arrow_right.png and /dev/null differ diff --git a/modules/client_skins/skins/default/images/button_down.png b/modules/client_skins/skins/default/images/button_down.png deleted file mode 100644 index 7808d00a..00000000 Binary files a/modules/client_skins/skins/default/images/button_down.png and /dev/null differ diff --git a/modules/client_skins/skins/default/images/button_hover.png b/modules/client_skins/skins/default/images/button_hover.png deleted file mode 100644 index 509268b4..00000000 Binary files a/modules/client_skins/skins/default/images/button_hover.png and /dev/null differ diff --git a/modules/client_skins/skins/default/images/horizotal_separator.png b/modules/client_skins/skins/default/images/horizotal_separator.png deleted file mode 100644 index a24cef32..00000000 Binary files a/modules/client_skins/skins/default/images/horizotal_separator.png and /dev/null differ diff --git a/modules/client_skins/skins/default/images/menu.png b/modules/client_skins/skins/default/images/menu.png deleted file mode 100644 index d7e28302..00000000 Binary files a/modules/client_skins/skins/default/images/menu.png and /dev/null differ diff --git a/modules/client_skins/skins/default/styles/creatures.otui b/modules/client_skins/skins/default/styles/creatures.otui deleted file mode 100644 index 4f303beb..00000000 --- a/modules/client_skins/skins/default/styles/creatures.otui +++ /dev/null @@ -1,5 +0,0 @@ -Creature < UICreature - size: 80 80 - padding: 1 - image-source: /images/panel_flat.png - image-border: 1 diff --git a/modules/client_skins/skins/default/styles/tabbars.otui b/modules/client_skins/skins/default/styles/tabbars.otui deleted file mode 100644 index 0fc793ba..00000000 --- a/modules/client_skins/skins/default/styles/tabbars.otui +++ /dev/null @@ -1,34 +0,0 @@ -TabBar < UITabBar - size: 80 20 -TabBarPanel < Panel -TabBarButton < UIButton - size: 20 20 - image-source: /images/tabbutton_square.png - image-color: white - image-clip: 0 0 20 20 - image-border: 2 - icon-color: white - color: #aaaaaa - anchors.top: parent.top - anchors.left: parent.left - padding: 5 - - $hover !checked: - image-clip: 0 20 20 20 - color: white - - $disabled: - image-color: #ffffff66 - icon-color: #888888 - - $checked: - image-clip: 0 40 20 20 - color: #D8E7F0 - - $on !checked: - color: #F55E5E - -TabBarRounded < TabBar -TabBarRoundedPanel < TabBarPanel -TabBarRoundedButton < TabBarButton - image-source: /images/tabbutton_rounded.png \ No newline at end of file diff --git a/modules/client_skins/skins/example.lua b/modules/client_skins/skins/example.lua deleted file mode 100644 index 3f43ecea..00000000 --- a/modules/client_skins/skins/example.lua +++ /dev/null @@ -1,9 +0,0 @@ -local skin = { - name = 'Example', - - styles = { - 'topmenu.otui' - } -} - -Skins.installSkin(skin) diff --git a/modules/client_skins/skins/example/styles/topmenu.otui b/modules/client_skins/skins/example/styles/topmenu.otui deleted file mode 100644 index 80e1cf8b..00000000 --- a/modules/client_skins/skins/example/styles/topmenu.otui +++ /dev/null @@ -1,3 +0,0 @@ -#TopButton < UIButton - size: 36 36 - background-color: #ff0000 \ No newline at end of file diff --git a/modules/client_stats/stats.lua b/modules/client_stats/stats.lua index ec154299..cfa55180 100644 --- a/modules/client_stats/stats.lua +++ b/modules/client_stats/stats.lua @@ -1,9 +1,11 @@ +UUID = nil HOST = 'otclient.herokuapp.com' PORT = 80 -UUID = nil +FIRST_REPORT_DELAY = 15 REPORT_DELAY = 60 sendReportEvent = nil +firstReportEvent = nil function initUUID() UUID = g_settings.getString('report-uuid') @@ -25,7 +27,15 @@ function terminate() onGameEnd = onGameEnd }) end +function configure(host, port, delay) + if not host then return end + HOST = host + PORT = port or PORT + REPORT_DELAY = delay or REPORT_DELAY +end + function sendReport() + if not HOST then return end local protocolHttp = ProtocolHttp.create() protocolHttp.onConnect = onConnect protocolHttp.onRecv = onRecv @@ -34,11 +44,14 @@ function sendReport() end function onGameStart() + if not HOST then return end + firstReportEvent = addEvent(sendReport, FIRST_REPORT_DELAY*1000) sendReportEvent = cycleEvent(sendReport, REPORT_DELAY*1000) end function onGameEnd() removeEvent(sendReportEvent) + removeEvent(firstReportEvent) end function onConnect(protocol) @@ -60,18 +73,17 @@ function onConnect(protocol) post = post .. '&fullscreen=' .. tostring(g_window.isFullscreen()) post = post .. '&window_width=' .. g_window.getWidth() post = post .. '&window_height=' .. g_window.getHeight() - post = post .. '&player_name=' .. g_game.getLocalPlayer():getName() + 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() post = post .. '&build_date=' .. g_app.getBuildDate() post = post .. '&display_width=' .. g_window.getDisplayWidth() post = post .. '&display_height=' .. g_window.getDisplayHeight() + post = post .. '&cpu=' .. g_platform.getCPUName() + post = post .. '&mem=' .. g_platform.getTotalSystemMemory() + post = post .. '&os_name=' .. g_platform.getOSName() local message = '' message = message .. "POST /report HTTP/1.1\r\n" diff --git a/modules/client_stats/stats.otmod b/modules/client_stats/stats.otmod index 32e1b391..95852427 100644 --- a/modules/client_stats/stats.otmod +++ b/modules/client_stats/stats.otmod @@ -4,6 +4,6 @@ Module author: baxnie website: www.otclient.info sandboxed: true - scripts: [ stats.lua ] + scripts: [ stats ] @onLoad: init() @onUnload: terminate() diff --git a/modules/client_styles/styles.lua b/modules/client_styles/styles.lua new file mode 100644 index 00000000..c8152664 --- /dev/null +++ b/modules/client_styles/styles.lua @@ -0,0 +1,21 @@ +function init() + local styles = g_resources.listDirectoryFiles('/styles') + for _i,style in pairs(styles) do + if string.ends(style, '.otui') then + g_ui.importStyle('/styles/' .. style) + end + end + + local fonts = g_resources.listDirectoryFiles('/fonts') + for _i,font in pairs(fonts) do + if string.ends(font, '.otfont') then + g_fonts.importFont('/fonts/' .. font) + end + end + + -- TODO load particles +end + +function terminate() +end + diff --git a/modules/game_shaders/shaders.otmod b/modules/client_styles/styles.otmod similarity index 56% rename from modules/game_shaders/shaders.otmod rename to modules/client_styles/styles.otmod index 8e2f47d8..d57e88e4 100644 --- a/modules/game_shaders/shaders.otmod +++ b/modules/client_styles/styles.otmod @@ -1,9 +1,9 @@ Module - name: game_shaders - description: Manage game shaders + name: client_styles + description: Load client fonts and styles author: edubart website: www.otclient.info + scripts: [ styles ] sandboxed: true - scripts: [ shaders.lua ] @onLoad: init() @onUnload: terminate() diff --git a/modules/client_terminal/terminal.lua b/modules/client_terminal/terminal.lua index 3d685bc6..c3c17135 100644 --- a/modules/client_terminal/terminal.lua +++ b/modules/client_terminal/terminal.lua @@ -1,5 +1,3 @@ -Terminal = { } - -- configs local LogColors = { [LogInfo] = 'white', [LogWarning] = 'yellow', @@ -86,7 +84,7 @@ end local function doCommand() local currentCommand = commandTextEdit:getText() - Terminal.executeCommand(currentCommand) + executeCommand(currentCommand) if commandTextEdit then commandTextEdit:clearText() @@ -102,13 +100,13 @@ local function onLog(level, message, time) if logLocked then return end logLocked = true - Terminal.addLine(message, LogColors[level]) + addLine(message, LogColors[level]) logLocked = false end -- public functions -function Terminal.init() - terminalWindow = g_ui.displayUI('terminal.otui') +function init() + terminalWindow = g_ui.displayUI('terminal') terminalWindow:setVisible(false) local poped = false @@ -128,8 +126,8 @@ function Terminal.init() end end - terminalButton = TopMenu.addLeftButton('terminalButton', tr('Terminal') .. ' (Ctrl + T)', 'terminal.png', Terminal.toggle) - g_keyboard.bindKeyDown('Ctrl+T', Terminal.toggle) + terminalButton = modules.client_topmenu.addLeftButton('terminalButton', tr('Terminal') .. ' (Ctrl + T)', '/images/topbuttons/terminal', toggle) + g_keyboard.bindKeyDown('Ctrl+T', toggle) commandHistory = g_settings.getList('terminal-history') @@ -138,14 +136,14 @@ function Terminal.init() g_keyboard.bindKeyPress('Down', function() navigateCommand(-1) end, commandTextEdit) g_keyboard.bindKeyDown('Tab', completeCommand, commandTextEdit) g_keyboard.bindKeyDown('Enter', doCommand, commandTextEdit) - g_keyboard.bindKeyDown('Escape', Terminal.hide, terminalWindow) + g_keyboard.bindKeyDown('Escape', hide, terminalWindow) terminalBuffer = terminalWindow:getChildById('terminalBuffer') g_logger.setOnLog(onLog) g_logger.fireOldMessages() end -function Terminal.terminate() +function terminate() g_settings.setList('terminal-history', commandHistory) g_keyboard.unbindKeyDown('Ctrl+T') g_logger.setOnLog(nil) @@ -156,28 +154,31 @@ function Terminal.terminate() terminalWindow:destroy() terminalWindow = nil commandEnv = nil - Terminal = nil end -function Terminal.toggle() +function hideButton() + terminalButton:hide() +end + +function toggle() if terminalWindow:isVisible() then - Terminal.hide() + hide() else - Terminal.show() + show() end end -function Terminal.show() +function show() terminalWindow:show() terminalWindow:raise() terminalWindow:focus() end -function Terminal.hide() +function hide() terminalWindow:hide() end -function Terminal.addLine(text, color) +function addLine(text, color) -- delete old lines if needed local numLines = terminalBuffer:getChildCount() + 1 if numLines > MaxLogLines then @@ -191,7 +192,7 @@ function Terminal.addLine(text, color) label:setColor(color) end -function Terminal.executeCommand(command) +function executeCommand(command) if command == nil or #command == 0 then return end logLocked = true @@ -218,7 +219,7 @@ function Terminal.executeCommand(command) end -- add command line - --Terminal.addLine(">> " .. command, "#ffffff") + --addLine(">> " .. command, "#ffffff") -- load command buffer local func, err = loadstring(realCommand, "@") diff --git a/modules/client_terminal/terminal.otmod b/modules/client_terminal/terminal.otmod index 684056e6..5460b356 100644 --- a/modules/client_terminal/terminal.otmod +++ b/modules/client_terminal/terminal.otmod @@ -3,11 +3,7 @@ Module description: Terminal for executing lua functions author: edubart website: www.otclient.info - - @onLoad: | - dofile 'terminal' - dofile 'commands' - Terminal.init() - - @onUnload: | - Terminal.terminate() + scripts: [ terminal, commands ] + sandboxed: true + @onLoad: init() + @onUnload: terminate() diff --git a/modules/client_topmenu/images/top_game_button.png b/modules/client_topmenu/images/top_game_button.png deleted file mode 100644 index c6f115f6..00000000 Binary files a/modules/client_topmenu/images/top_game_button.png and /dev/null differ diff --git a/modules/client_topmenu/topmenu.lua b/modules/client_topmenu/topmenu.lua index 1cf96bd5..dbac71d0 100644 --- a/modules/client_topmenu/topmenu.lua +++ b/modules/client_topmenu/topmenu.lua @@ -1,5 +1,3 @@ -TopMenu = {} - -- private variables local topMenu local leftButtonsPanel @@ -24,17 +22,22 @@ local function addButton(id, description, icon, callback, panel, toggle, front) end button:setId(id) button:setTooltip(description) - button:setIcon(resolvepath(icon, 3)) - button.onClick = callback + button:setIcon(icon, 3) + button.onMouseRelease = function(widget, mousePos, mouseButton) + if widget:containsPoint(mousePos) and mouseButton ~= MouseMiddleButton then + callback() + return true + end + end return button end -- public functions -function TopMenu.init() - connect(g_game, { onGameStart = TopMenu.showGameButtons, - onGameEnd = TopMenu.hideGameButtons }) +function init() + connect(g_game, { onGameStart = showGameButtons, + onGameEnd = hideGameButtons }) - topMenu = g_ui.displayUI('topmenu.otui') + topMenu = g_ui.displayUI('topmenu') leftButtonsPanel = topMenu:getChildById('leftButtonsPanel') rightButtonsPanel = topMenu:getChildById('rightButtonsPanel') @@ -47,9 +50,9 @@ function TopMenu.init() end end -function TopMenu.terminate() - disconnect(g_game, { onGameStart = TopMenu.showGameButtons, - onGameEnd = TopMenu.hideGameButtons }) +function terminate() + disconnect(g_game, { onGameStart = showGameButtons, + onGameEnd = hideGameButtons }) leftButtonsPanel = nil rightButtonsPanel = nil @@ -58,54 +61,54 @@ function TopMenu.terminate() topMenu:destroy() topMenu = nil - - TopMenu = nil end -function TopMenu.addLeftButton(id, description, icon, callback, front) +function addLeftButton(id, description, icon, callback, front) return addButton(id, description, icon, callback, leftButtonsPanel, false, front) end -function TopMenu.addLeftToggleButton(id, description, icon, callback, front) +function addLeftToggleButton(id, description, icon, callback, front) return addButton(id, description, icon, callback, leftButtonsPanel, true, front) end -function TopMenu.addRightButton(id, description, icon, callback, front) +function addRightButton(id, description, icon, callback, front) return addButton(id, description, icon, callback, rightButtonsPanel, false, front) end -function TopMenu.addRightToggleButton(id, description, icon, callback, front) +function addRightToggleButton(id, description, icon, callback, front) return addButton(id, description, icon, callback, rightButtonsPanel, true, front) end -function TopMenu.addLeftGameButton(id, description, icon, callback, front) +function addLeftGameButton(id, description, icon, callback, front) return addButton(id, description, icon, callback, leftGameButtonsPanel, false, front) end -function TopMenu.addLeftGameToggleButton(id, description, icon, callback, front) +function addLeftGameToggleButton(id, description, icon, callback, front) return addButton(id, description, icon, callback, leftGameButtonsPanel, true, front) end -function TopMenu.addRightGameButton(id, description, icon, callback, front) +function addRightGameButton(id, description, icon, callback, front) return addButton(id, description, icon, callback, rightGameButtonsPanel, false, front) end -function TopMenu.addRightGameToggleButton(id, description, icon, callback, front) +function addRightGameToggleButton(id, description, icon, callback, front) return addButton(id, description, icon, callback, rightGameButtonsPanel, true, front) end -function TopMenu.hideGameButtons() +function hideGameButtons() leftGameButtonsPanel:hide() rightGameButtonsPanel:hide() end -function TopMenu.showGameButtons() +function showGameButtons() leftGameButtonsPanel:show() rightGameButtonsPanel:show() end -function TopMenu.getButton(id) +function getButton(id) return topMenu:recursiveGetChildById(id) end - +function getTopMenu() + return topMenu +end diff --git a/modules/client_topmenu/topmenu.otmod b/modules/client_topmenu/topmenu.otmod index 5f492fed..b9417afb 100644 --- a/modules/client_topmenu/topmenu.otmod +++ b/modules/client_topmenu/topmenu.otmod @@ -3,10 +3,8 @@ Module description: Create the top menu author: edubart website: www.otclient.info + scripts: [ topmenu ] + sandboxed: true + @onLoad: init() + @onUnload: terminate() - @onLoad: | - dofile 'topmenu' - TopMenu.init() - - @onUnload: | - TopMenu.terminate() diff --git a/modules/client_topmenu/topmenu.otui b/modules/client_topmenu/topmenu.otui index f2fb82ea..9a12b89e 100644 --- a/modules/client_topmenu/topmenu.otui +++ b/modules/client_topmenu/topmenu.otui @@ -1,53 +1,3 @@ -TopButton < UIButton - size: 26 26 - image-source: images/top_button.png - image-clip: 0 0 26 26 - image-border: 3 - image-color: #ffffffff - icon-color: #ffffffff - - $hover !disabled: - image-color: #ffffff99 - image-clip: 26 0 26 26 - - $pressed: - image-clip: 52 0 26 26 - - $disabled: - image-color: #ffffff44 - icon-color: #ffffff44 - -TopToggleButton < UIButton - size: 26 26 - image-source: images/top_game_button.png - image-clip: 26 0 26 26 - image-color: #ffffffff - image-border: 3 - icon-color: #ffffffff - - $on: - image-clip: 0 0 26 26 - image-color: #ffffffff - icon-color: #ffffffff - -TopMenuButtonsPanel < Panel - layout: - type: horizontalBox - spacing: 4 - fit-children: true - padding: 6 4 - -TopMenuPanel < Panel - height: 36 - image-source: images/top_panel.png - image-repeated: true - focusable: false - -TopMenuFrameCounterLabel < FrameCounterLabel - color: white - margin-top: 4 - margin-left: 5 - TopMenuPanel id: topMenu anchors.top: parent.top @@ -85,6 +35,7 @@ TopMenuPanel anchors.top: parent.top anchors.bottom: parent.bottom anchors.right: parent.right + padding-left: 0 TopMenuButtonsPanel id: rightGameButtonsPanel diff --git a/modules/game_battle/battle.lua b/modules/game_battle/battle.lua index 6d46b183..ddae046b 100644 --- a/modules/game_battle/battle.lua +++ b/modules/game_battle/battle.lua @@ -13,10 +13,10 @@ hideSkullsButton = nil hidePartyButton = nil function init() - g_ui.importStyle('battlebutton.otui') - battleButton = TopMenu.addRightGameToggleButton('battleButton', tr('Battle') .. ' (Ctrl+B)', 'battle.png', toggle) + g_ui.importStyle('battlebutton') + battleButton = modules.client_topmenu.addRightGameToggleButton('battleButton', tr('Battle') .. ' (Ctrl+B)', '/images/topbuttons/battle', toggle) battleButton:setOn(true) - battleWindow = g_ui.loadUI('battle.otui', modules.game_interface.getRightPanel()) + battleWindow = g_ui.loadUI('battle', modules.game_interface.getRightPanel()) g_keyboard.bindKeyDown('Ctrl+B', toggle) -- this disables scrollbar auto hiding diff --git a/modules/game_battle/battle.otmod b/modules/game_battle/battle.otmod index 10569b38..03104b82 100644 --- a/modules/game_battle/battle.otmod +++ b/modules/game_battle/battle.otmod @@ -4,6 +4,6 @@ Module author: andrefaramir, BeniS website: www.otclient.info sandboxed: true - scripts: [ battle.lua ] + scripts: [ battle ] @onLoad: init() @onUnload: terminate() diff --git a/modules/game_battle/battle.otui b/modules/game_battle/battle.otui index b00f3131..6eb2d752 100644 --- a/modules/game_battle/battle.otui +++ b/modules/game_battle/battle.otui @@ -22,25 +22,25 @@ BattleIcon < UICheckBox image-color: #ffffff88 BattlePlayers < BattleIcon - image-source: /game_battle/images/battle_players.png + image-source: /images/game/battle/battle_players BattleNPCs < BattleIcon - image-source: /game_battle/images/battle_npcs.png + image-source: /images/game/battle/battle_npcs BattleMonsters < BattleIcon - image-source: /game_battle/images/battle_monsters.png + image-source: /images/game/battle/battle_monsters BattleSkulls < BattleIcon - image-source: /game_battle/images/battle_skulls.png + image-source: /images/game/battle/battle_skulls BattleParty < BattleIcon - image-source: /game_battle/images/battle_party.png + image-source: /images/game/battle/battle_party MiniWindow id: battleWindow !text: tr('Battle') height: 166 - icon: battle.png + icon: /images/topbuttons/battle @onClose: modules.game_battle.onMiniWindowClose() &save: true diff --git a/modules/game_bugreport/bugreport.lua b/modules/game_bugreport/bugreport.lua index 9eb992a0..5308d7fd 100644 --- a/modules/game_bugreport/bugreport.lua +++ b/modules/game_bugreport/bugreport.lua @@ -5,7 +5,7 @@ bugReportWindow = nil bugTextEdit = nil function init() - g_ui.importStyle('bugreport.otui') + g_ui.importStyle('bugreport') bugReportWindow = g_ui.createWidget('BugReportWindow', rootWidget) bugReportWindow:hide() diff --git a/modules/game_bugreport/bugreport.otmod b/modules/game_bugreport/bugreport.otmod index a6f38888..5a3c2072 100644 --- a/modules/game_bugreport/bugreport.otmod +++ b/modules/game_bugreport/bugreport.otmod @@ -3,7 +3,7 @@ Module description: Bug report interface (Ctrl+Z) author: edubart website: www.otclient.info - scripts: [ bugreport.lua ] + scripts: [ bugreport ] sandboxed: true @onLoad: init() @onUnload: terminate() diff --git a/modules/game_combatcontrols/Thumbs.db b/modules/game_combatcontrols/Thumbs.db deleted file mode 100644 index 17832092..00000000 Binary files a/modules/game_combatcontrols/Thumbs.db and /dev/null differ diff --git a/modules/game_combatcontrols/combatcontrols.lua b/modules/game_combatcontrols/combatcontrols.lua index 051db4ed..e1b04aa7 100644 --- a/modules/game_combatcontrols/combatcontrols.lua +++ b/modules/game_combatcontrols/combatcontrols.lua @@ -8,9 +8,9 @@ safeFightButton = nil fightModeRadioGroup = nil function init() - combatControlsButton = TopMenu.addRightGameToggleButton('combatControlsButton', tr('Combat Controls'), 'combatcontrols.png', toggle) + combatControlsButton = modules.client_topmenu.addRightGameToggleButton('combatControlsButton', tr('Combat Controls'), '/images/topbuttons/combatcontrols', toggle) combatControlsButton:setOn(true) - combatControlsWindow = g_ui.loadUI('combatcontrols.otui', modules.game_interface.getRightPanel()) + combatControlsWindow = g_ui.loadUI('combatcontrols', modules.game_interface.getRightPanel()) combatControlsWindow:disableResize() fightOffensiveBox = combatControlsWindow:recursiveGetChildById('fightOffensiveBox') @@ -82,7 +82,7 @@ function update() end function check() - if Options.getOption('autoChaseOverride') then + if modules.client_options.getOption('autoChaseOverride') then if g_game.isAttacking() and g_game.getChaseMode() == ChaseOpponent then g_game.setChaseMode(DontChase) end diff --git a/modules/game_combatcontrols/combatcontrols.otmod b/modules/game_combatcontrols/combatcontrols.otmod index cc3a59b2..043106d3 100644 --- a/modules/game_combatcontrols/combatcontrols.otmod +++ b/modules/game_combatcontrols/combatcontrols.otmod @@ -4,6 +4,6 @@ Module author: edubart, BeniS website: www.otclient.info sandboxed: true - scripts: [ combatcontrols.lua ] + scripts: [ combatcontrols ] @onLoad: init() @onUnload: terminate() diff --git a/modules/game_combatcontrols/combatcontrols.otui b/modules/game_combatcontrols/combatcontrols.otui index 8a8ba333..df12d94e 100644 --- a/modules/game_combatcontrols/combatcontrols.otui +++ b/modules/game_combatcontrols/combatcontrols.otui @@ -12,20 +12,20 @@ CombatBox < UICheckBox image-clip: 0 20 20 20 FightOffensiveBox < CombatBox - image-source: /game_combatcontrols/icons/fightoffensive.png + image-source: /images/game/combatmodes/fightoffensive FightBalancedBox < CombatBox - image-source: /game_combatcontrols/icons/fightbalanced.png + image-source: /images/game/combatmodes/fightbalanced FightDefensiveBox < CombatBox - image-source: /game_combatcontrols/icons/fightdefensive.png + image-source: /images/game/combatmodes/fightdefensive ChaseModeBox < CombatBox - image-source: /game_combatcontrols/icons/chasemode.png + image-source: /images/game/combatmodes/chasemode SafeFightBox < CombatBox - image-source: /game_combatcontrols/icons/safefight.png + image-source: /images/game/combatmodes/safefight MiniWindow id: combatControlsWindow !text: tr('Combat Controls') - icon: combatcontrols.png + icon: /images/topbuttons/combatcontrols height: 48 &save: true @onClose: modules.game_combatcontrols.onMiniWindowClose() diff --git a/modules/game_console/console.lua b/modules/game_console/console.lua index 104df65b..367c086a 100644 --- a/modules/game_console/console.lua +++ b/modules/game_console/console.lua @@ -40,9 +40,9 @@ SpeakTypes = { } SayModes = { - [1] = { speakTypeDesc = 'whisper', icon = 'icons/whisper.png' }, - [2] = { speakTypeDesc = 'say', icon = 'icons/say.png' }, - [3] = { speakTypeDesc = 'yell', icon = 'icons/yell.png' } + [1] = { speakTypeDesc = 'whisper', icon = '/images/game/console/icons/whisper' }, + [2] = { speakTypeDesc = 'say', icon = '/images/game/console/icons/say' }, + [3] = { speakTypeDesc = 'yell', icon = '/images/game/console/icons/yell' } } MAX_HISTORY = 1000 @@ -79,7 +79,7 @@ function init() onGameStart = onGameStart, onGameEnd = clear }) - consolePanel = g_ui.loadUI('console.otui', modules.game_interface.getBottomPanel()) + consolePanel = g_ui.loadUI('console', modules.game_interface.getBottomPanel()) consoleTextEdit = consolePanel:getChildById('consoleTextEdit') consoleContentPanel = consolePanel:getChildById('consoleContentPanel') consoleTabBar = consolePanel:getChildById('consoleTabBar') @@ -210,7 +210,11 @@ function setTextEditText(text) end function openHelp() - g_game.joinChannel(HELP_CHANNEL) + local helpChannel = 9 + if g_game.getProtocolVersion() <= 810 then + helpChannel = 8 + end + g_game.joinChannel(helpChannel) end function addTab(name, focus) @@ -291,7 +295,7 @@ function addPrivateText(text, speaktype, name, isPrivateCommand, creatureName) local privateTab = getTab(name) if privateTab == nil then - if (Options.getOption('showPrivateMessagesInConsole') and not focus) or (isPrivateCommand and not privateTab) then + if (modules.client_options.getOption('showPrivateMessagesInConsole') and not focus) or (isPrivateCommand and not privateTab) then privateTab = defaultTab else privateTab = addTab(name, focus) @@ -344,7 +348,7 @@ function getHighlightedText(text) end function addTabText(text, speaktype, tab, creatureName) - if Options.getOption('showTimestampsInConsole') then + if modules.client_options.getOption('showTimestampsInConsole') then text = os.date('%H:%M') .. ' ' .. text end @@ -448,6 +452,11 @@ function processMessageMenu(mousePos, mouseButton, creatureName, text) if not g_game.getLocalPlayer():hasVip(creatureName) then menu:addOption(tr('Add to VIP list'), function () g_game.addVip(creatureName) end) end + if modules.game_console.getOwnPrivateTab() then + menu:addSeparator() + menu:addOption(tr('Invite to private chat'), function() g_game.inviteToOwnChannel(creatureName) end) + menu:addOption(tr('Exclude from private chat'), function() g_game.excludeFromOwnChannel(creatureName) end) + end if isIgnored(creatureName) then menu:addOption(tr('Unignore') .. ' ' .. creatureName, function() removeIgnoredPlayer(creatureName) end) else @@ -599,7 +608,7 @@ end function applyMessagePrefixies(name, level, message) if name then - if Options.getOption('showLevelsInConsole') and level > 0 then + if modules.client_options.getOption('showLevelsInConsole') and level > 0 then message = name .. ' [' .. level .. ']: ' .. message else message = name .. ': ' .. message @@ -663,7 +672,7 @@ function onTalk(name, level, mode, message, channelId, creaturePos) if speaktype.private then addPrivateText(composedMessage, speaktype, name, false, name) - if Options.getOption('showPrivateMessagesOnScreen') and speaktype ~= SpeakTypesSettings.privateNpcToPlayer then + if modules.client_options.getOption('showPrivateMessagesOnScreen') and speaktype ~= SpeakTypesSettings.privateNpcToPlayer then modules.game_textmessage.displayPrivateMessage(name .. ':\n' .. message) end else @@ -734,7 +743,7 @@ end function onChannelList(channelList) if channelsWindow then channelsWindow:destroy() end - channelsWindow = g_ui.displayUI('channelswindow.otui') + channelsWindow = g_ui.displayUI('channelswindow') local channelListPanel = channelsWindow:getChildById('channelList') channelsWindow.onEnter = doChannelListSubmit channelsWindow.onDestroy = function() channelsWindow = nil end @@ -801,7 +810,7 @@ end function onClickIgnoreButton() if ignoreWindow then return end - ignoreWindow = g_ui.displayUI('ignorewindow.otui') + ignoreWindow = g_ui.displayUI('ignorewindow') local ignoreListPanel = ignoreWindow:getChildById('ignoreList') ignoreWindow.onDestroy = function() ignoreWindow = nil end diff --git a/modules/game_console/console.otmod b/modules/game_console/console.otmod index 9134b37c..b0d637a0 100644 --- a/modules/game_console/console.otmod +++ b/modules/game_console/console.otmod @@ -4,6 +4,6 @@ Module author: edubart, andrefaramir, baxnie, sn4ake, BeniS website: www.otclient.info sandboxed: true - scripts: [ console.lua ] + scripts: [ console ] @onLoad: init() @onUnload: terminate() diff --git a/modules/game_console/console.otui b/modules/game_console/console.otui index d13f8c3d..c171ac64 100644 --- a/modules/game_console/console.otui +++ b/modules/game_console/console.otui @@ -67,7 +67,7 @@ Panel TabButton id: prevChannelButton - icon: icons/leftarrow.png + icon: /images/game/console/leftarrow anchors.left: parent.left anchors.top: parent.top margin-left: 6 @@ -85,7 +85,7 @@ Panel TabButton id: nextChannelButton - icon: icons/rightarrow.png + icon: /images/game/console/rightarrow anchors.right: next.left anchors.top: parent.top margin-right: 5 @@ -94,7 +94,7 @@ Panel TabButton id: closeChannelButton !tooltip: tr('Close this channel') .. ' (Ctrl+E)' - icon: icons/closechannel.png + icon: /images/game/console/closechannel anchors.right: next.left anchors.top: parent.top enabled: false @@ -105,7 +105,7 @@ Panel TabButton id: clearChannelButton !tooltip: tr('Clear current message window') - icon: icons/clearchannel.png + icon: /images/game/console/clearchannel anchors.right: next.left anchors.top: parent.top margin-right: 5 @@ -117,7 +117,7 @@ Panel TabButton id: channelsButton !tooltip: tr('Open new channel') .. ' (Ctrl+O)' - icon: icons/channels.png + icon: /images/game/console/channels anchors.right: next.left anchors.top: parent.top margin-right: 5 @@ -127,7 +127,7 @@ Panel TabButton id: ignoreButton !tooltip: tr('Ignore players') - icon: icons/ignore.png + icon: /images/game/console/ignore anchors.right: parent.right anchors.top: parent.top margin-right: 5 @@ -149,7 +149,7 @@ Panel TabButton id: sayModeButton - icon: icons/say.png + icon: /images/game/console/say !tooltip: tr('Adjust volume') &sayMode: 2 size: 20 20 diff --git a/modules/game_containers/container.otui b/modules/game_containers/container.otui index b23d532b..7615e4e4 100644 --- a/modules/game_containers/container.otui +++ b/modules/game_containers/container.otui @@ -16,7 +16,7 @@ ContainerWindow < MiniWindow anchors.right: minimizeButton.left margin-right: 3 size: 14 14 - image-source: /images/miniwindowbuttons.png + image-source: /images/ui/miniwindow_buttons image-clip: 42 0 14 14 $hover: diff --git a/modules/game_containers/containers.lua b/modules/game_containers/containers.lua index 5d5cdda9..835f03b1 100644 --- a/modules/game_containers/containers.lua +++ b/modules/game_containers/containers.lua @@ -1,5 +1,5 @@ function init() - g_ui.importStyle('container.otui') + g_ui.importStyle('container') connect(Container, { onOpen = onContainerOpen, onClose = onContainerClose, diff --git a/modules/game_containers/containers.otmod b/modules/game_containers/containers.otmod index 1c282a8e..b7219f84 100644 --- a/modules/game_containers/containers.otmod +++ b/modules/game_containers/containers.otmod @@ -4,6 +4,6 @@ Module author: edubart, baxnie website: www.otclient.info sandboxed: true - scripts: [containers.lua] + scripts: [containers] @onLoad: init() @onUnload: terminate() diff --git a/modules/game_cooldown/Thumbs.db b/modules/game_cooldown/Thumbs.db deleted file mode 100644 index 6f611743..00000000 Binary files a/modules/game_cooldown/Thumbs.db and /dev/null differ diff --git a/modules/game_cooldown/cooldown.lua b/modules/game_cooldown/cooldown.lua index bb5a35fc..0e72a00d 100644 --- a/modules/game_cooldown/cooldown.lua +++ b/modules/game_cooldown/cooldown.lua @@ -9,11 +9,11 @@ function init() onSpellGroupCooldown = onSpellGroupCooldown, onSpellCooldown = onSpellCooldown }) - cooldownButton = TopMenu.addRightGameToggleButton('cooldownButton', tr('Cooldowns'), 'cooldown.png', toggle) + cooldownButton = modules.client_topmenu.addRightGameToggleButton('cooldownButton', tr('Cooldowns'), '/images/topbuttons/cooldowns', toggle) cooldownButton:setOn(true) cooldownButton:hide() - cooldownWindow = g_ui.loadUI('cooldown.otui', modules.game_interface.getRightPanel()) + cooldownWindow = g_ui.loadUI('cooldown', modules.game_interface.getRightPanel()) cooldownWindow:disableResize() cooldownWindow:setup() @@ -91,7 +91,7 @@ function onSpellCooldown(iconId, duration) if not icon then icon = g_ui.createWidget('SpellIcon', spellCooldownPanel) icon:setId(spellName) - icon:setImageSource('/game_cooldown/icons/' .. SpelllistSettings[modules.game_spelllist.getSpelllistProfile()].iconFile) + icon:setImageSource('/images/game/spells/' .. SpelllistSettings[modules.game_spelllist.getSpelllistProfile()].iconFile) icon:setImageClip(modules.game_spelllist.getIconImageClip(otcIconId)) icon.event = scheduleEvent(function() icon:destroy() icon = nil end, duration) diff --git a/modules/game_cooldown/cooldown.otmod b/modules/game_cooldown/cooldown.otmod index 7946ad35..77852b96 100644 --- a/modules/game_cooldown/cooldown.otmod +++ b/modules/game_cooldown/cooldown.otmod @@ -4,6 +4,6 @@ Module author: OTClient team website: www.otclient.info sandboxed: true - scripts: [ cooldown.lua ] + scripts: [ cooldown ] @onLoad: init() @onUnload: terminate() diff --git a/modules/game_cooldown/cooldown.otui b/modules/game_cooldown/cooldown.otui index b66e0dad..3fffe85a 100644 --- a/modules/game_cooldown/cooldown.otui +++ b/modules/game_cooldown/cooldown.otui @@ -1,7 +1,7 @@ SpellGroupIcon < UIWidget size: 22 22 image-size: 22 22 - image-source: /game_cooldown/icons/cooldownIcons.png + image-source: /images/game/spells/cooldowns focusable: false margin-top: 3 @@ -27,7 +27,7 @@ MiniWindow id: cooldownWindow !text: tr('Spell Cooldowns') height: 85 - icon: cooldown.png + icon: /images/topbuttons/cooldowns @onClose: modules.game_cooldown.onMiniWindowClose() &save: true diff --git a/modules/game_cooldown/icons/sample.png b/modules/game_cooldown/icons/sample.png deleted file mode 100644 index 14aa3b05..00000000 Binary files a/modules/game_cooldown/icons/sample.png and /dev/null differ diff --git a/modules/game_healthinfo/healthinfo.lua b/modules/game_healthinfo/healthinfo.lua index 51054f1e..a644880d 100644 --- a/modules/game_healthinfo/healthinfo.lua +++ b/modules/game_healthinfo/healthinfo.lua @@ -1,21 +1,21 @@ Icons = {} -Icons[1] = { tooltip = tr('You are poisoned'), path = '/game_healthinfo/icons/poisoned.png', id = 'condition_poisoned' } -Icons[2] = { tooltip = tr('You are burning'), path = '/game_healthinfo/icons/burning.png', id = 'condition_burning' } -Icons[4] = { tooltip = tr('You are electrified'), path = '/game_healthinfo/icons/electrified.png', id = 'condition_electrified' } -Icons[8] = { tooltip = tr('You are drunk'), path = '/game_healthinfo/icons/drunk.png', id = 'condition_drunk' } -Icons[16] = { tooltip = tr('You are protected by a magic shield'), path = '/game_healthinfo/icons/magic_shield.png', id = 'condition_magic_shield' } -Icons[32] = { tooltip = tr('You are paralysed'), path = '/game_healthinfo/icons/slowed.png', id = 'condition_slowed' } -Icons[64] = { tooltip = tr('You are hasted'), path = '/game_healthinfo/icons/haste.png', id = 'condition_haste' } -Icons[128] = { tooltip = tr('You may not logout during a fight'), path = '/game_healthinfo/icons/logout_block.png', id = 'condition_logout_block' } -Icons[256] = { tooltip = tr('You are drowing'), path = '/game_healthinfo/icons/drowning.png', id = 'condition_drowning' } -Icons[512] = { tooltip = tr('You are freezing'), path = '/game_healthinfo/icons/freezing.png', id = 'condition_freezing' } -Icons[1024] = { tooltip = tr('You are dazzled'), path = '/game_healthinfo/icons/dazzled.png', id = 'condition_dazzled' } -Icons[2048] = { tooltip = tr('You are cursed'), path = '/game_healthinfo/icons/cursed.png', id = 'condition_cursed' } -Icons[4096] = { tooltip = tr('You are strengthened'), path = '/game_healthinfo/icons/strengthened.png', id = 'condition_strengthened' } -Icons[8192] = { tooltip = tr('You may not logout or enter a protection zone'), path = '/game_healthinfo/icons/protection_zone_block.png', id = 'condition_protection_zone_block' } -Icons[16384] = { tooltip = tr('You are within a protection zone'), path = '/game_healthinfo/icons/protection_zone.png', id = 'condition_protection_zone' } -Icons[32768] = { tooltip = tr('You are bleeding'), path = '/game_healthinfo/icons/bleeding.png', id = 'condition_bleeding' } -Icons[65536] = { tooltip = tr('You are hungry'), path = '/game_healthinfo/icons/hungry.png', id = 'condition_hungry' } +Icons[1] = { tooltip = tr('You are poisoned'), path = '/images/game/states/poisoned', id = 'condition_poisoned' } +Icons[2] = { tooltip = tr('You are burning'), path = '/images/game/states/burning', id = 'condition_burning' } +Icons[4] = { tooltip = tr('You are electrified'), path = '/images/game/states/electrified', id = 'condition_electrified' } +Icons[8] = { tooltip = tr('You are drunk'), path = '/images/game/states/drunk', id = 'condition_drunk' } +Icons[16] = { tooltip = tr('You are protected by a magic shield'), path = '/images/game/states/magic_shield', id = 'condition_magic_shield' } +Icons[32] = { tooltip = tr('You are paralysed'), path = '/images/game/states/slowed', id = 'condition_slowed' } +Icons[64] = { tooltip = tr('You are hasted'), path = '/images/game/states/haste', id = 'condition_haste' } +Icons[128] = { tooltip = tr('You may not logout during a fight'), path = '/images/game/states/logout_block', id = 'condition_logout_block' } +Icons[256] = { tooltip = tr('You are drowing'), path = '/images/game/states/drowning', id = 'condition_drowning' } +Icons[512] = { tooltip = tr('You are freezing'), path = '/images/game/states/freezing', id = 'condition_freezing' } +Icons[1024] = { tooltip = tr('You are dazzled'), path = '/images/game/states/dazzled', id = 'condition_dazzled' } +Icons[2048] = { tooltip = tr('You are cursed'), path = '/images/game/states/cursed', id = 'condition_cursed' } +Icons[4096] = { tooltip = tr('You are strengthened'), path = '/images/game/states/strengthened', id = 'condition_strengthened' } +Icons[8192] = { tooltip = tr('You may not logout or enter a protection zone'), path = '/images/game/states/protection_zone_block', id = 'condition_protection_zone_block' } +Icons[16384] = { tooltip = tr('You are within a protection zone'), path = '/images/game/states/protection_zone', id = 'condition_protection_zone' } +Icons[32768] = { tooltip = tr('You are bleeding'), path = '/images/game/states/bleeding', id = 'condition_bleeding' } +Icons[65536] = { tooltip = tr('You are hungry'), path = '/images/game/states/hungry', id = 'condition_hungry' } healthInfoWindow = nil healthBar = nil @@ -35,10 +35,10 @@ function init() connect(g_game, { onGameEnd = offline }) - healthInfoButton = TopMenu.addRightGameToggleButton('healthInfoButton', tr('Health Information'), 'healthinfo.png', toggle) + healthInfoButton = modules.client_topmenu.addRightGameToggleButton('healthInfoButton', tr('Health Information'), '/images/topbuttons/healthinfo', toggle) healthInfoButton:setOn(true) - healthInfoWindow = g_ui.loadUI('healthinfo.otui', modules.game_interface.getRightPanel()) + healthInfoWindow = g_ui.loadUI('healthinfo', modules.game_interface.getRightPanel()) healthInfoWindow:disableResize() healthBar = healthInfoWindow:recursiveGetChildById('healthBar') manaBar = healthInfoWindow:recursiveGetChildById('manaBar') @@ -100,7 +100,7 @@ function hideLabels() capLabel:hide() soulLabel:hide() local removeHeight = capLabel:getHeight() + capLabel:getMarginTop() + capLabel:getMarginBottom() - healthInfoWindow:setHeight(healthInfoWindow:getHeight() - removeHeight) + healthInfoWindow:setHeight(math.max(healthInfoWindow.minimizedHeight, healthInfoWindow:getHeight() - removeHeight)) end function onMiniWindowClose() diff --git a/modules/game_healthinfo/healthinfo.otmod b/modules/game_healthinfo/healthinfo.otmod index 2fbf96bc..45657542 100644 --- a/modules/game_healthinfo/healthinfo.otmod +++ b/modules/game_healthinfo/healthinfo.otmod @@ -4,6 +4,6 @@ Module author: edubart, BeniS website: www.otclient.info sandboxed: true - scripts: [ healthinfo.lua ] + scripts: [ healthinfo ] @onLoad: init() @onUnload: terminate() diff --git a/modules/game_healthinfo/healthinfo.otui b/modules/game_healthinfo/healthinfo.otui index 3283149c..b49ce00f 100644 --- a/modules/game_healthinfo/healthinfo.otui +++ b/modules/game_healthinfo/healthinfo.otui @@ -63,7 +63,7 @@ ConditionWidget < UIWidget margin-left: 2 MiniWindow - icon: healthinfo.png + icon: /images/topbuttons/healthinfo id: healthInfoWindow !text: tr('Health Info') height: 102 diff --git a/modules/game_hotkeys/hotkeys_manager.lua b/modules/game_hotkeys/hotkeys_manager.lua index 5a632c77..ea790274 100644 --- a/modules/game_hotkeys/hotkeys_manager.lua +++ b/modules/game_hotkeys/hotkeys_manager.lua @@ -36,7 +36,7 @@ function init() local hotkeyListPanel = hotkeysWindow:getChildById('currentHotkeys') hotkeysWindow:setVisible(false) - hotkeysButton = TopMenu.addLeftGameButton('hotkeysButton', tr('Hotkeys') .. ' (Ctrl+K)', 'icon.png', toggle) + hotkeysButton = modules.client_topmenu.addLeftGameButton('hotkeysButton', tr('Hotkeys') .. ' (Ctrl+K)', '/images/topbuttons/hotkeys', toggle) g_keyboard.bindKeyDown('Ctrl+K', toggle) g_keyboard.bindKeyPress('Down', function() hotkeyListPanel:focusNextChild(KeyboardFocusReason) end, hotkeysWindow) g_keyboard.bindKeyPress('Up', function() hotkeyListPanel:focusPreviousChild(KeyboardFocusReason) end, hotkeysWindow) diff --git a/modules/game_interface/gameinterface.lua b/modules/game_interface/gameinterface.lua index e87dd017..ba14d6d1 100644 --- a/modules/game_interface/gameinterface.lua +++ b/modules/game_interface/gameinterface.lua @@ -26,7 +26,7 @@ arrowKeys = { } function init() - g_ui.importStyle('styles/countwindow.otui') + g_ui.importStyle('styles/countwindow') connect(g_game, { onGameStart = onGameStart, @@ -34,7 +34,7 @@ function init() onLoginAdvice = onLoginAdvice }, true) - gameRootPanel = g_ui.displayUI('gameinterface.otui') + gameRootPanel = g_ui.displayUI('gameinterface') gameRootPanel:hide() gameRootPanel:lower() gameRootPanel.onGeometryChange = updateStretchShrink @@ -49,7 +49,7 @@ function init() gameBottomPanel = gameRootPanel:getChildById('gameBottomPanel') connect(gameLeftPanel, { onVisibilityChange = onLeftPanelVisibilityChange }) - logoutButton = TopMenu.addLeftButton('logoutButton', 'Logout', '/images/logout.png', tryLogout, true) + logoutButton = modules.client_topmenu.addLeftButton('logoutButton', 'Logout', '/images/topbuttons/logout', tryLogout, true) bindKeys() @@ -125,7 +125,7 @@ end function show() connect(g_app, { onClose = tryExit }) - Background.hide() + modules.client_background.hide() gameRootPanel:show() gameRootPanel:focus() gameMapPanel:followCreature(g_game.getLocalPlayer()) @@ -147,7 +147,7 @@ function hide() countWindow = nil end gameRootPanel:hide() - Background.show() + modules.client_background.show() end function onLoginAdvice(message) @@ -230,7 +230,7 @@ function smartWalk(defaultDir) end local dir = defaultDir - if Options.getOption('smartWalk') then + if modules.client_options.getOption('smartWalk') then if g_keyboard.isKeyPressed('Up') and g_keyboard.isKeyPressed('Left') then dir = NorthWest elseif g_keyboard.isKeyPressed('Up') and g_keyboard.isKeyPressed('Right') then @@ -242,7 +242,7 @@ function smartWalk(defaultDir) end end - if Options.getOption('walkBooster') then + if modules.client_options.getOption('walkBooster') then if g_game.getLocalPlayer():canWalk(dir) then g_game.walk(dir) else @@ -259,7 +259,7 @@ function smartWalk(defaultDir) end function updateStretchShrink() - if Options.getOption('dontStretchShrink') then + if modules.client_options.getOption('dontStretchShrink') then gameMapPanel:setKeepAspectRatio(true) gameMapPanel:setVisibleDimension({ width = 15, height = 11 }) @@ -475,7 +475,7 @@ end function processMouseAction(menuPosition, mouseButton, autoWalkPos, lookThing, useThing, creatureThing) local keyboardModifiers = g_keyboard.getModifiers() - if not Options.getOption('classicControl') then + if not modules.client_options.getOption('classicControl') then if keyboardModifiers == KeyboardNoModifier and mouseButton == MouseRightButton then createThingMenu(menuPosition, lookThing, useThing, creatureThing) return true diff --git a/modules/game_interface/gameinterface.otui b/modules/game_interface/gameinterface.otui index 185cfddb..c4ed27bf 100644 --- a/modules/game_interface/gameinterface.otui +++ b/modules/game_interface/gameinterface.otui @@ -1,17 +1,17 @@ GameSidePanel < UIMiniWindowContainer - image-source: /images/sidepanel.png + image-source: /images/ui/panel_side image-border: 4 padding: 4 width: 198 GameBottomPanel < Panel - image-source: /images/bottompanel.png + image-source: /images/ui/panel_bottom image-border: 4 GameMapPanel < UIGameMap padding: 4 - image-source: /images/mappanel.png + image-source: /images/ui/panel_map image-border: 4 UIWidget @@ -63,7 +63,7 @@ UIWidget anchors.bottom: parent.bottom relative-margin: bottom margin-bottom: 172 - @canUpdateMargin: function(self, newMargin) if Options.getOption('dontStretchShrink') then return self:getMarginBottom() end return math.max(math.min(newMargin, self:getParent():getHeight() - 300), 100) end + @canUpdateMargin: function(self, newMargin) if modules.client_options.getOption('dontStretchShrink') then return self:getMarginBottom() end return math.max(math.min(newMargin, self:getParent():getHeight() - 300), 100) end @onGeometryChange: function(self) self:setMarginBottom(math.min(math.max(self:getParent():getHeight() - 300, 100), self:getMarginBottom())) end UIWidget diff --git a/modules/game_interface/interface.otmod b/modules/game_interface/interface.otmod index c3993fa6..51c99eb5 100644 --- a/modules/game_interface/interface.otmod +++ b/modules/game_interface/interface.otmod @@ -4,7 +4,7 @@ Module author: OTClient team website: www.otclient.info sandboxed: true - scripts: [ widgets/uigamemap.lua, widgets/uiitem.lua, gameinterface.lua ] + scripts: [ widgets/uigamemap, widgets/uiitem, gameinterface ] load-later: - game_hotkeys - game_questlog @@ -24,7 +24,6 @@ Module - game_playertrade - game_ruleviolation - game_bugreport - - game_shaders - game_playerdeath - game_playermount - game_market diff --git a/modules/game_interface/widgets/uiitem.lua b/modules/game_interface/widgets/uiitem.lua index aea985a2..3779e94d 100644 --- a/modules/game_interface/widgets/uiitem.lua +++ b/modules/game_interface/widgets/uiitem.lua @@ -80,7 +80,7 @@ function UIItem:onMouseRelease(mousePosition, mouseButton) local item = self:getItem() if not item or not self:containsPoint(mousePosition) then return false end - if Options.getOption('classicControl') and + if modules.client_options.getOption('classicControl') and ((g_mouse.isPressed(MouseLeftButton) and mouseButton == MouseRightButton) or (g_mouse.isPressed(MouseRightButton) and mouseButton == MouseLeftButton)) then g_game.look(item) diff --git a/modules/game_inventory/inventory.lua b/modules/game_inventory/inventory.lua index e23c4db5..4e2c87a2 100644 --- a/modules/game_inventory/inventory.lua +++ b/modules/game_inventory/inventory.lua @@ -21,10 +21,10 @@ function init() g_keyboard.bindKeyDown('Ctrl+I', toggle) - inventoryButton = TopMenu.addRightGameToggleButton('inventoryButton', tr('Inventory') .. ' (Ctrl+I)', 'inventory.png', toggle) + inventoryButton = modules.client_topmenu.addRightGameToggleButton('inventoryButton', tr('Inventory') .. ' (Ctrl+I)', '/images/topbuttons/inventory', toggle) inventoryButton:setOn(true) - inventoryWindow = g_ui.loadUI('inventory.otui', modules.game_interface.getRightPanel()) + inventoryWindow = g_ui.loadUI('inventory', modules.game_interface.getRightPanel()) inventoryWindow:disableResize() inventoryPanel = inventoryWindow:getChildById('contentsPanel') diff --git a/modules/game_inventory/inventory.otmod b/modules/game_inventory/inventory.otmod index 41a9a306..82e6b776 100644 --- a/modules/game_inventory/inventory.otmod +++ b/modules/game_inventory/inventory.otmod @@ -4,6 +4,6 @@ Module author: baxnie, edubart, BeniS website: www.otclient.info sandboxed: true - scripts: [ inventory.lua ] + scripts: [ inventory ] @onLoad: init() @onUnload: terminate() diff --git a/modules/game_inventory/inventory.otui b/modules/game_inventory/inventory.otui index 17d50edf..e9147a31 100644 --- a/modules/game_inventory/inventory.otui +++ b/modules/game_inventory/inventory.otui @@ -2,58 +2,58 @@ InventoryItem < Item HeadSlot < InventoryItem id: slot1 - image-source: /game_inventory/slots/head.png + image-source: /images/game/slots/head &position: {x=65535, y=1, z=0} BodySlot < InventoryItem id: slot4 - image-source: /game_inventory/slots/body.png + image-source: /images/game/slots/body &position: {x=65535, y=4, z=0} LegSlot < InventoryItem id: slot7 - image-source: /game_inventory/slots/legs.png + image-source: /images/game/slots/legs &position: {x=65535, y=7, z=0} FeetSlot < InventoryItem id: slot8 - image-source: /game_inventory/slots/feet.png + image-source: /images/game/slots/feet &position: {x=65535, y=8, z=0} NeckSlot < InventoryItem id: slot2 - image-source: /game_inventory/slots/neck.png + image-source: /images/game/slots/neck &position: {x=65535, y=2, z=0} LeftSlot < InventoryItem id: slot6 - image-source: /game_inventory/slots/left-hand.png + image-source: /images/game/slots/left-hand &position: {x=65535, y=6, z=0} FingerSlot < InventoryItem id: slot9 - image-source: /game_inventory/slots/finger.png + image-source: /images/game/slots/finger &position: {x=65535, y=9, z=0} BackSlot < InventoryItem id: slot3 - image-source: /game_inventory/slots/back.png + image-source: /images/game/slots/back &position: {x=65535, y=3, z=0} RightSlot < InventoryItem id: slot5 - image-source: /game_inventory/slots/right-hand.png + image-source: /images/game/slots/right-hand &position: {x=65535, y=5, z=0} AmmoSlot < InventoryItem id: slot10 - image-source: /game_inventory/slots/ammo.png + image-source: /images/game/slots/ammo &position: {x=65535, y=10, z=0} MiniWindow id: inventoryWindow !text: tr('Inventory') - icon: inventory.png + icon: /images/topbuttons/inventory height: 175 @onClose: modules.game_inventory.onMiniWindowClose() &save: true diff --git a/modules/game_market/market.lua b/modules/game_market/market.lua index 24e7ddba..48a5510c 100644 --- a/modules/game_market/market.lua +++ b/modules/game_market/market.lua @@ -23,7 +23,7 @@ Market = {} -local protocol = runinsandbox('marketprotocol.lua') +local protocol = runinsandbox('marketprotocol') marketWindow = nil mainTabBar = nil @@ -602,41 +602,41 @@ local function initInterface() mainTabBar:setContentWidget(marketWindow:getChildById('mainTabContent')) -- setup 'Market Offer' section tabs - marketOffersPanel = g_ui.loadUI('ui/marketoffers.otui') + marketOffersPanel = g_ui.loadUI('ui/marketoffers') mainTabBar:addTab(tr('Market Offers'), marketOffersPanel) selectionTabBar = marketOffersPanel:getChildById('leftTabBar') selectionTabBar:setContentWidget(marketOffersPanel:getChildById('leftTabContent')) - browsePanel = g_ui.loadUI('ui/marketoffers/browse.otui') + browsePanel = g_ui.loadUI('ui/marketoffers/browse') selectionTabBar:addTab(tr('Browse'), browsePanel) - overviewPanel = g_ui.loadUI('ui/marketoffers/overview.otui') + overviewPanel = g_ui.loadUI('ui/marketoffers/overview') selectionTabBar:addTab(tr('Overview'), overviewPanel) displaysTabBar = marketOffersPanel:getChildById('rightTabBar') displaysTabBar:setContentWidget(marketOffersPanel:getChildById('rightTabContent')) - itemOffersPanel = g_ui.loadUI('ui/marketoffers/itemoffers.otui') + itemOffersPanel = g_ui.loadUI('ui/marketoffers/itemoffers') displaysTabBar:addTab(tr('Offers'), itemOffersPanel) - itemDetailsPanel = g_ui.loadUI('ui/marketoffers/itemdetails.otui') + itemDetailsPanel = g_ui.loadUI('ui/marketoffers/itemdetails') displaysTabBar:addTab(tr('Details'), itemDetailsPanel) - itemStatsPanel = g_ui.loadUI('ui/marketoffers/itemstats.otui') + itemStatsPanel = g_ui.loadUI('ui/marketoffers/itemstats') displaysTabBar:addTab(tr('Statistics'), itemStatsPanel) -- setup 'My Offer' section tabs - myOffersPanel = g_ui.loadUI('ui/myoffers.otui') + myOffersPanel = g_ui.loadUI('ui/myoffers') mainTabBar:addTab(tr('My Offers'), myOffersPanel) offersTabBar = myOffersPanel:getChildById('offersTabBar') offersTabBar:setContentWidget(myOffersPanel:getChildById('offersTabContent')) - currentOffersPanel = g_ui.loadUI('ui/myoffers/currentoffers.otui') + currentOffersPanel = g_ui.loadUI('ui/myoffers/currentoffers') offersTabBar:addTab(tr('Current Offers'), currentOffersPanel) - offerHistoryPanel = g_ui.loadUI('ui/myoffers/offerhistory.otui') + offerHistoryPanel = g_ui.loadUI('ui/myoffers/offerhistory') offersTabBar:addTab(tr('Offer History'), offerHistoryPanel) balanceLabel = marketWindow:getChildById('balanceLabel') @@ -711,11 +711,11 @@ local function initInterface() end function init() - g_ui.importStyle('market.otui') - g_ui.importStyle('ui/general/markettabs.otui') - g_ui.importStyle('ui/general/marketbuttons.otui') - g_ui.importStyle('ui/general/marketcombobox.otui') - g_ui.importStyle('ui/general/amountwindow.otui') + g_ui.importStyle('market') + g_ui.importStyle('ui/general/markettabs') + g_ui.importStyle('ui/general/marketbuttons') + g_ui.importStyle('ui/general/marketcombobox') + g_ui.importStyle('ui/general/amountwindow') offerExhaust[MarketAction.Sell] = 10 offerExhaust[MarketAction.Buy] = 20 diff --git a/modules/game_market/market.otmod b/modules/game_market/market.otmod index e96f26df..680a7acb 100644 --- a/modules/game_market/market.otmod +++ b/modules/game_market/market.otmod @@ -4,6 +4,6 @@ Module author: BeniS website: www.otclient.info sandboxed: true - scripts: [ offerstatistic.lua, marketoffer.lua, marketprotocol.lua, market.lua ] + scripts: [ offerstatistic, marketoffer, marketprotocol, market ] @onLoad: init() @onUnload: terminate() diff --git a/modules/game_market/marketprotocol.lua b/modules/game_market/marketprotocol.lua index 34e861ad..9f60df1e 100644 --- a/modules/game_market/marketprotocol.lua +++ b/modules/game_market/marketprotocol.lua @@ -4,7 +4,7 @@ MarketProtocol = {} local silent local protocol -local statistics = runinsandbox('offerstatistic.lua') +local statistics = runinsandbox('offerstatistic') local function send(msg) if protocol and not silent then diff --git a/modules/game_market/ui/general/marketcombobox.otui b/modules/game_market/ui/general/marketcombobox.otui index 22f5a0c1..5177073c 100644 --- a/modules/game_market/ui/general/marketcombobox.otui +++ b/modules/game_market/ui/general/marketcombobox.otui @@ -4,7 +4,7 @@ MarketComboBoxPopupMenuButton < ComboBoxRoundedPopupMenuButton text-offset: 2 2 MarketComboBoxPopupMenuSeparator < UIWidget - image-source: /images/combobox_rounded.png + image-source: /images/combobox_rounded image-repeated: true image-clip: 1 59 89 1 height: 1 diff --git a/modules/game_minimap/flagwindow.otui b/modules/game_minimap/flagwindow.otui index 935a2f79..d554ada6 100644 --- a/modules/game_minimap/flagwindow.otui +++ b/modules/game_minimap/flagwindow.otui @@ -1,10 +1,10 @@ FlagButton < CheckBox size: 15 15 margin-left: 2 - image-source: images/flagcheckbox.png + image-source: /images/game/minimap/flagcheckbox image-size: 15 15 image-border: 3 - icon-source: images/mapflags.png + icon-source: /images/game/minimap/mapflags icon-size: 11 11 icon-clip: 0 0 11 11 icon-offset: 2 4 diff --git a/modules/game_minimap/minimap.lua b/modules/game_minimap/minimap.lua index 8e096121..e5049e01 100644 --- a/modules/game_minimap/minimap.lua +++ b/modules/game_minimap/minimap.lua @@ -16,7 +16,7 @@ nextFlagId = 0 you change floor it will not update the minimap. ]] function init() - g_ui.importStyle('flagwindow.otui') + g_ui.importStyle('flagwindow') connect(g_game, { onGameStart = online, @@ -27,10 +27,10 @@ function init() g_keyboard.bindKeyDown('Ctrl+M', toggle) - minimapButton = TopMenu.addRightGameToggleButton('minimapButton', tr('Minimap') .. ' (Ctrl+M)', 'minimap.png', toggle) + minimapButton = modules.client_topmenu.addRightGameToggleButton('minimapButton', tr('Minimap') .. ' (Ctrl+M)', '/images/topbuttons/minimap', toggle) minimapButton:setOn(true) - minimapWindow = g_ui.loadUI('minimap.otui', modules.game_interface.getRightPanel()) + minimapWindow = g_ui.loadUI('minimap', modules.game_interface.getRightPanel()) minimapWindow:setContentMinimumHeight(64) minimapWindow:setContentMaximumHeight(256) diff --git a/modules/game_minimap/minimap.otmod b/modules/game_minimap/minimap.otmod index ccf79f76..8f399100 100644 --- a/modules/game_minimap/minimap.otmod +++ b/modules/game_minimap/minimap.otmod @@ -4,6 +4,6 @@ Module author: edubart, BeniS website: www.otclient.info sandboxed: true - scripts: [ minimap.lua ] + scripts: [ minimap ] @onLoad: init() @onUnload: terminate() diff --git a/modules/game_minimap/minimap.otui b/modules/game_minimap/minimap.otui index e427a935..223e6def 100644 --- a/modules/game_minimap/minimap.otui +++ b/modules/game_minimap/minimap.otui @@ -11,27 +11,27 @@ MapControl < Button FlagWidget < UIWidget size: 11 11 icon-clip: 0 0 11 11 - icon-source: /game_minimap/images/mapflags.png + icon-source: /images/game/minimap/mapflags anchors.left: parent.left anchors.top: parent.top FloorUpControl < MapControl - icon-source: /game_minimap/images/floor_up.png + icon-source: /images/game/minimap/floor_up FloorDownControl < MapControl - icon-source: /game_minimap/images/floor_down.png + icon-source: /images/game/minimap/floor_down ZoomOutControl < MapControl - //image-source: /game_minimap/images/zoom_out.png + //image-source: /images/game/minimap/zoom_out ZoomInControl < MapControl - //image-source: /game_minimap/images/zoom_in.png + //image-source: /images/game/minimap/zoom_in MiniWindow id: minimapWindow !text: tr('Minimap') height: 150 - icon: minimap.png + icon: /images/topbuttons/minimap @onClose: modules.game_minimap.onMiniWindowClose() @onGeometryChange: updateMapFlags() &save: true diff --git a/modules/game_modaldialog/modaldialog.lua b/modules/game_modaldialog/modaldialog.lua index 9c18eb77..c5ec2f12 100644 --- a/modules/game_modaldialog/modaldialog.lua +++ b/modules/game_modaldialog/modaldialog.lua @@ -1,5 +1,5 @@ function init() - g_ui.importStyle('modaldialog.otui') + g_ui.importStyle('modaldialog') connect(g_game, { onModalDialog = onModalDialog, onGameEnd = destroy }) diff --git a/modules/game_modaldialog/modaldialog.otmod b/modules/game_modaldialog/modaldialog.otmod index 948e2924..050fe428 100644 --- a/modules/game_modaldialog/modaldialog.otmod +++ b/modules/game_modaldialog/modaldialog.otmod @@ -5,6 +5,6 @@ Module website: www.otclient.info sandboxed: true dependencies: [ game_interface ] - scripts: [ modaldialog.lua ] + scripts: [ modaldialog ] @onLoad: init() @onUnload: terminate() diff --git a/modules/game_npctrade/npctrade.lua b/modules/game_npctrade/npctrade.lua index 25d618ae..0b7bfec2 100644 --- a/modules/game_npctrade/npctrade.lua +++ b/modules/game_npctrade/npctrade.lua @@ -34,7 +34,7 @@ playerItems = nil selectedItem = nil function init() - npcWindow = g_ui.displayUI('npctrade.otui') + npcWindow = g_ui.displayUI('npctrade') npcWindow:setVisible(false) itemsPanel = npcWindow:recursiveGetChildById('itemsPanel') diff --git a/modules/game_npctrade/npctrade.otmod b/modules/game_npctrade/npctrade.otmod index 224521ef..5e1b4d44 100644 --- a/modules/game_npctrade/npctrade.otmod +++ b/modules/game_npctrade/npctrade.otmod @@ -4,6 +4,6 @@ Module author: andrefaramir, baxnie website: www.otclient.info sandboxed: true - scripts: [ npctrade.lua ] + scripts: [ npctrade ] @onLoad: init() @onUnload: terminate() diff --git a/modules/game_outfit/outfit.lua b/modules/game_outfit/outfit.lua index 50809a3b..a7d6dc05 100644 --- a/modules/game_outfit/outfit.lua +++ b/modules/game_outfit/outfit.lua @@ -57,7 +57,7 @@ function create(creatureOutfit, outfitList, creatureMount, mountList) mounts = mountList destroy() - outfitWindow = g_ui.displayUI('outfitwindow.otui') + outfitWindow = g_ui.displayUI('outfitwindow') local colorBoxPanel = outfitWindow:getChildById('colorBoxPanel') -- setup outfit/mount display boxs diff --git a/modules/game_outfit/outfit.otmod b/modules/game_outfit/outfit.otmod index 36a6f1b8..8b0b2eb4 100644 --- a/modules/game_outfit/outfit.otmod +++ b/modules/game_outfit/outfit.otmod @@ -4,6 +4,6 @@ Module author: baxnie, edubart website: www.otclient.info sandboxed: true - scripts: [ outfit.lua ] + scripts: [ outfit ] @onLoad: init() @onUnload: terminate() diff --git a/modules/game_outfit/outfitwindow.otui b/modules/game_outfit/outfitwindow.otui index c16ec5a7..abe66ea4 100644 --- a/modules/game_outfit/outfitwindow.otui +++ b/modules/game_outfit/outfitwindow.otui @@ -1,14 +1,7 @@ NextOutfitButton < NextButton - icon-source: /images/arrow_right.png - PrevOutfitButton < PreviousButton - icon-source: /images/arrow_left.png - NextMountButton < NextButton - icon-source: /images/arrow_right.png - PrevMountButton < PreviousButton - icon-source: /images/arrow_left.png MainWindow !text: tr('Select Outfit') diff --git a/modules/game_playerdeath/playerdeath.lua b/modules/game_playerdeath/playerdeath.lua index 2cf4393a..338d18ca 100644 --- a/modules/game_playerdeath/playerdeath.lua +++ b/modules/game_playerdeath/playerdeath.lua @@ -1,7 +1,7 @@ deathWindow = nil function init() - g_ui.importStyle('deathwindow.otui') + g_ui.importStyle('deathwindow') connect(g_game, { onDeath = display, onGameEnd = reset }) diff --git a/modules/game_playerdeath/playerdeath.otmod b/modules/game_playerdeath/playerdeath.otmod index 3fbacf64..5e24210d 100644 --- a/modules/game_playerdeath/playerdeath.otmod +++ b/modules/game_playerdeath/playerdeath.otmod @@ -4,6 +4,6 @@ Module author: BeniS, edubart website: www.otclient.info sandboxed: true - scripts: [ playerdeath.lua ] + scripts: [ playerdeath ] @onLoad: init() @onUnload: terminate() diff --git a/modules/game_playermount/playermount.otmod b/modules/game_playermount/playermount.otmod index 33ce7b1a..f8e23677 100644 --- a/modules/game_playermount/playermount.otmod +++ b/modules/game_playermount/playermount.otmod @@ -4,6 +4,6 @@ Module author: BeniS website: www.otclient.info sandboxed: true - scripts: [ playermount.lua ] + scripts: [ playermount ] @onLoad: init() @onUnload: terminate() diff --git a/modules/game_playertrade/playertrade.lua b/modules/game_playertrade/playertrade.lua index 1e93258b..a879bfb5 100644 --- a/modules/game_playertrade/playertrade.lua +++ b/modules/game_playertrade/playertrade.lua @@ -1,7 +1,7 @@ tradeWindow = nil function init() - g_ui.importStyle('tradewindow.otui') + g_ui.importStyle('tradewindow') connect(g_game, { onOwnTrade = onGameOwnTrade, onCounterTrade = onGameCounterTrade, diff --git a/modules/game_playertrade/playertrade.otmod b/modules/game_playertrade/playertrade.otmod index b4e5a7bf..f0ce0ff3 100644 --- a/modules/game_playertrade/playertrade.otmod +++ b/modules/game_playertrade/playertrade.otmod @@ -4,6 +4,6 @@ Module author: edubart website: www.otclient.info sandboxed: true - scripts: [ playertrade.lua ] + scripts: [ playertrade ] @onLoad: init() @onUnload: terminate() diff --git a/modules/game_questlog/questlinewindow.otui b/modules/game_questlog/questlinewindow.otui index e4b22fd2..7d6a5cfa 100644 --- a/modules/game_questlog/questlinewindow.otui +++ b/modules/game_questlog/questlinewindow.otui @@ -19,7 +19,7 @@ QuestLineWindow < MainWindow anchors.top: parent.top anchors.left: parent.left anchors.right: missionListScrollBar.left - height: 200 + height: 100 padding: 1 focusable: false vertical-scrollbar: missionListScrollBar @@ -28,7 +28,7 @@ QuestLineWindow < MainWindow id: missionListScrollBar anchors.top: parent.top anchors.right: parent.right - height: 200 + height: 100 step: 14 pixels-scroll: true diff --git a/modules/game_questlog/questlog.lua b/modules/game_questlog/questlog.lua index 50a60227..afb2de5f 100644 --- a/modules/game_questlog/questlog.lua +++ b/modules/game_questlog/questlog.lua @@ -2,10 +2,10 @@ questLogButton = nil questLineWindow = nil function init() - g_ui.importStyle('questlogwindow.otui') - g_ui.importStyle('questlinewindow.otui') + g_ui.importStyle('questlogwindow') + g_ui.importStyle('questlinewindow') - questLogButton = TopMenu.addLeftGameButton('questLogButton', tr('Quest Log'), 'questlog.png', function() g_game.requestQuestLog() end) + questLogButton = modules.client_topmenu.addLeftGameButton('questLogButton', tr('Quest Log'), '/images/topbuttons/questlog', function() g_game.requestQuestLog() end) connect(g_game, { onQuestLog = onGameQuestLog, onQuestLine = onGameQuestLine, diff --git a/modules/game_questlog/questlog.otmod b/modules/game_questlog/questlog.otmod index 328e5cce..814ed493 100644 --- a/modules/game_questlog/questlog.otmod +++ b/modules/game_questlog/questlog.otmod @@ -4,6 +4,6 @@ Module author: edubart website: www.otclient.info sandboxed: true - scripts: [ questlog.lua ] + scripts: [ questlog ] @onLoad: init() @onUnload: terminate() diff --git a/modules/game_questlog/questlogwindow.otui b/modules/game_questlog/questlogwindow.otui index 25a6cf2d..cb5df91b 100644 --- a/modules/game_questlog/questlogwindow.otui +++ b/modules/game_questlog/questlogwindow.otui @@ -1,22 +1,22 @@ QuestLabel < Label font: verdana-11px-monochrome - background-color: alpha text-offset: 2 0 focusable: true - color: #cccccc - - $focus: - color: #ffffff + color: #aaaaaa + background-color: alpha $on: - background-color: #006600 + color: #00aa00 $!on: - background-color: #660000 + color: #aaaaaa + + $focus: + background-color: #444444 $on focus: - background-color: #004400 + color: #00ff00 $!on focus: - background-color: #440000 + color: #ffffff QuestLogWindow < MainWindow id: questLogWindow @@ -31,7 +31,6 @@ QuestLogWindow < MainWindow anchors.left: parent.left anchors.right: questListScrollBar.left margin-bottom: 10 - padding: 1 focusable: false vertical-scrollbar: questListScrollBar diff --git a/modules/game_ruleviolation/ruleviolation.lua b/modules/game_ruleviolation/ruleviolation.lua index 5314e3ae..79f98c58 100644 --- a/modules/game_ruleviolation/ruleviolation.lua +++ b/modules/game_ruleviolation/ruleviolation.lua @@ -37,7 +37,7 @@ actionsTextList = nil function init() connect(g_game, { onGMActions = loadReasons }) - ruleViolationWindow = g_ui.displayUI('ruleviolation.otui') + ruleViolationWindow = g_ui.displayUI('ruleviolation') ruleViolationWindow:setVisible(false) reasonsTextList = ruleViolationWindow:getChildById('reasonList') diff --git a/modules/game_ruleviolation/ruleviolation.otmod b/modules/game_ruleviolation/ruleviolation.otmod index f3535a68..f3e55b0c 100644 --- a/modules/game_ruleviolation/ruleviolation.otmod +++ b/modules/game_ruleviolation/ruleviolation.otmod @@ -4,6 +4,6 @@ Module author: andrefaramir website: www.otclient.info sandboxed: true - scripts: [ ruleviolation.lua ] + scripts: [ ruleviolation ] @onLoad: init() @onUnload: terminate() diff --git a/modules/game_shaders/images/clouds.png b/modules/game_shaders/images/clouds.png deleted file mode 100644 index 66f8fb34..00000000 Binary files a/modules/game_shaders/images/clouds.png and /dev/null differ diff --git a/modules/game_shaders/shaders.lua b/modules/game_shaders/shaders.lua deleted file mode 100644 index 1f0dda65..00000000 --- a/modules/game_shaders/shaders.lua +++ /dev/null @@ -1,63 +0,0 @@ -HOTKEY = 'Ctrl+X' -MAP_SHADERS = { - { name = 'Default', frag = 'shaders/default.frag' }, - { name = 'Bloom', frag = 'shaders/bloom.frag'}, - { name = 'Sepia', frag ='shaders/sepia.frag' }, - { name = 'Grayscale', frag ='shaders/grayscale.frag' }, - { name = 'Pulse', frag = 'shaders/pulse.frag' }, - { name = 'Old Tv', frag = 'shaders/oldtv.frag' }, - { name = 'Fog', frag = 'shaders/fog.frag', tex1 = 'images/clouds.png' }, - { name = 'Party', frag = 'shaders/party.frag' }, - { name = 'Radial Blur', frag ='shaders/radialblur.frag' }, - { name = 'Zomg', frag ='shaders/zomg.frag' }, - { name = 'Heat', frag ='shaders/heat.frag' }, - { name = 'Noise', frag ='shaders/noise.frag' }, -} - -ITEM_SHADERS = { - { name = 'Fake 3D', vert = 'shaders/fake3d.vert' } -} - -shadersPanel = nil - -function init() - g_ui.importStyle('shaders.otui') - - g_keyboard.bindKeyDown(HOTKEY, toggle) - - shadersPanel = g_ui.createWidget('ShadersPanel', modules.game_interface.getMapPanel()) - shadersPanel:hide() - - local mapComboBox = shadersPanel:getChildById('mapComboBox') - mapComboBox.onOptionChange = function(combobox, option) - local map = modules.game_interface.getMapPanel() - map:setMapShader(g_shaders.getShader(option)) - end - - if not g_graphics.canUseShaders() then return end - - for _i,opts in pairs(MAP_SHADERS) do - local shader = g_shaders.createFragmentShader(opts.name, opts.frag) - - if opts.tex1 then - shader:addMultiTexture(opts.tex1) - end - if opts.tex2 then - shader:addMultiTexture(opts.tex2) - end - - mapComboBox:addOption(opts.name) - end - - local map = modules.game_interface.getMapPanel() - map:setMapShader(g_shaders.getShader('Default')) -end - -function terminate() - g_keyboard.unbindKeyDown(HOTKEY) - shadersPanel:destroy() -end - -function toggle() - shadersPanel:setVisible(not shadersPanel:isVisible()) -end diff --git a/modules/game_shaders/shaders.otui b/modules/game_shaders/shaders.otui deleted file mode 100644 index 27cecdb5..00000000 --- a/modules/game_shaders/shaders.otui +++ /dev/null @@ -1,15 +0,0 @@ -ShadersPanel < UIWidget - focusable: false - - anchors.top: parent.top - anchors.left: parent.left - border-color: red - border-width: 1 - - width: 100 - layout: - type: verticalBox - fit-children: true - - ComboBox - id: mapComboBox \ No newline at end of file diff --git a/modules/game_shaders/shaders/bloom.frag b/modules/game_shaders/shaders/bloom.frag deleted file mode 100644 index ffe282d3..00000000 --- a/modules/game_shaders/shaders/bloom.frag +++ /dev/null @@ -1,16 +0,0 @@ -uniform float u_Time; -uniform sampler2D u_Tex0; -varying vec2 v_TexCoord; - -void main() -{ - vec4 color = texture2D(u_Tex0, v_TexCoord); - int j; - int i; - - for(i = -4 ;i <= 4; i++) - for(j = -4; j <= 4; j++) - color += texture2D(u_Tex0, v_TexCoord + vec2(i, j)*0.003) * 0.008; - - gl_FragColor = color; -} diff --git a/modules/game_shaders/shaders/default.frag b/modules/game_shaders/shaders/default.frag deleted file mode 100644 index b54ca882..00000000 --- a/modules/game_shaders/shaders/default.frag +++ /dev/null @@ -1,8 +0,0 @@ -uniform float u_Time; -uniform sampler2D u_Tex0; -varying vec2 v_TexCoord; - -void main() -{ - gl_FragColor = texture2D(u_Tex0, v_TexCoord); -} diff --git a/modules/game_shaders/shaders/fog.frag b/modules/game_shaders/shaders/fog.frag deleted file mode 100644 index da1fe4ca..00000000 --- a/modules/game_shaders/shaders/fog.frag +++ /dev/null @@ -1,18 +0,0 @@ -uniform float u_Time; -uniform sampler2D u_Tex0; -uniform sampler2D u_Tex1; -varying vec2 v_TexCoord; - -vec2 direction = vec2(1.0,0.3); -float speed = 0.05; -float pressure = 0.6; -float zoom = 0.5; - -void main(void) -{ - vec2 offset = (v_TexCoord + (direction * u_Time * speed)) / zoom; - vec3 bgcol = texture2D(u_Tex0, v_TexCoord).xyz; - vec3 fogcol = texture2D(u_Tex1, offset).xyz; - vec3 col = bgcol + fogcol*pressure; - gl_FragColor = vec4(col,1.0); -} diff --git a/modules/game_shaders/shaders/grayscale.frag b/modules/game_shaders/shaders/grayscale.frag deleted file mode 100644 index 00ad1e75..00000000 --- a/modules/game_shaders/shaders/grayscale.frag +++ /dev/null @@ -1,14 +0,0 @@ -uniform float u_Time; -uniform sampler2D u_Tex0; -varying vec2 v_TexCoord; - -vec4 grayscale(vec4 color) -{ - float gray = dot(color.rgb, vec3(0.299, 0.587, 0.114)); - return vec4(gray, gray, gray, 1); -} - -void main() -{ - gl_FragColor = grayscale(texture2D(u_Tex0, v_TexCoord)); -} diff --git a/modules/game_shaders/shaders/heat.frag b/modules/game_shaders/shaders/heat.frag deleted file mode 100644 index 1d0216a7..00000000 --- a/modules/game_shaders/shaders/heat.frag +++ /dev/null @@ -1,56 +0,0 @@ -uniform sampler2D u_Tex0; -varying vec2 v_TexCoord; -uniform float u_Time; -uniform vec2 u_Resolution; -const float PI = 3.1415926535897932; - -// speed -const float speed = 0.06; -const float speed_x = 0.03; -const float speed_y = 0.02; - -// geometry -const float intensity = 30.; -const int steps = 5; -const float frequency = 3.0; -const int angle = 7; // better when a prime - -// reflection and emboss -const float delta = 100.; -const float intence = 1.2; -const float emboss = 0.1; - -//---------- crystals effect -float col(vec2 coord) -{ - float delta_theta = 2.0 * PI / float(angle); - float col = 0.0; - float theta = 0.0; - for(int i = 0; i < steps; i++) { - vec2 adjc = coord; - theta = delta_theta*float(i); - adjc.x += cos(theta)*u_Time*speed + u_Time * speed_x; - adjc.y -= sin(theta)*u_Time*speed - u_Time * speed_y; - col = col + cos( (adjc.x*cos(theta) - adjc.y*sin(theta))*frequency)*intensity; - } - return cos(col); -} - -void main(void) -{ - vec2 p = v_TexCoord, c1 = p, c2 = p; - float cc1 = col(c1); - - c2.x += u_Resolution.x/delta; - float dx = emboss*(cc1-col(c2))/delta; - - c2.x = p.x; - c2.y += u_Resolution.y/delta; - float dy = emboss*(cc1-col(c2))/delta; - - c1.x += dx; - c1.y += dy; - - float alpha = 1.+dot(dx,dy)*intence; - gl_FragColor = texture2D(u_Tex0,c1)*(alpha); -} diff --git a/modules/game_shaders/shaders/noise.frag b/modules/game_shaders/shaders/noise.frag deleted file mode 100644 index 48f4d71d..00000000 --- a/modules/game_shaders/shaders/noise.frag +++ /dev/null @@ -1,56 +0,0 @@ -uniform sampler2D u_Tex0; -varying vec2 v_TexCoord; -uniform float u_Time; -uniform vec2 u_Resolution; -const float PI = 3.1415926535897932; - -// speed -const float speed = 0.16; -const float speed_x = 0.13; -const float speed_y = 0.12; - -// geometry -const float intensity = 100.; -const int steps = 3; -const float frequency = 100.0; -const int angle = 7; // better when a prime - -// reflection and emboss -const float delta = 1000.; -const float intence = 10.2; -const float emboss = 1.; - -//---------- crystals effect -float col(vec2 coord) -{ - float delta_theta = 2.0 * PI / float(angle); - float col = 0.0; - float theta = 0.0; - for(int i = 0; i < steps; i++) { - vec2 adjc = coord; - theta = delta_theta*float(i); - adjc.x += cos(theta)*u_Time*speed + u_Time * speed_x; - adjc.y -= sin(theta)*u_Time*speed - u_Time * speed_y; - col = col + cos( (adjc.x*cos(theta) - adjc.y*sin(theta))*frequency)*intensity; - } - return cos(col); -} - -void main(void) -{ - vec2 p = v_TexCoord, c1 = p, c2 = p; - float cc1 = col(c1); - - c2.x += u_Resolution.x/delta; - float dx = emboss*(cc1-col(c2))/delta; - - c2.x = p.x; - c2.y += u_Resolution.y/delta; - float dy = emboss*(cc1-col(c2))/delta; - - c1.x += dx; - c1.y += dy; - - float alpha = 1.+dot(dx,dy)*intence; - gl_FragColor = texture2D(u_Tex0,c1)*(alpha); -} diff --git a/modules/game_shaders/shaders/oldtv.frag b/modules/game_shaders/shaders/oldtv.frag deleted file mode 100644 index ea470c0f..00000000 --- a/modules/game_shaders/shaders/oldtv.frag +++ /dev/null @@ -1,24 +0,0 @@ -uniform float u_Time; -varying vec2 v_TexCoord; -uniform sampler2D u_Tex0; - -void main(void) -{ - vec2 q = v_TexCoord; - vec2 uv = 0.5 + (q-0.5)*(0.9 + 0.1*sin(0.2*u_Time)); - - vec3 oricol = texture2D(u_Tex0,vec2(q.x,q.y)).xyz; - vec3 col = oricol; - - col = clamp(col*0.5+0.5*col*col*1.2,0.0,1.0); - - col *= 0.5 + 0.5*16.0*uv.x*uv.y*(1.0-uv.x)*(1.0-uv.y); - - col *= vec3(0.8,1.0,0.7); - - col *= 0.9+0.1*sin(10.0*u_Time+uv.y*1000.0); - - col *= 0.97+0.03*sin(110.0*u_Time); - - gl_FragColor = vec4(col,1.0); -} diff --git a/modules/game_shaders/shaders/party.frag b/modules/game_shaders/shaders/party.frag deleted file mode 100644 index bdf4ed77..00000000 --- a/modules/game_shaders/shaders/party.frag +++ /dev/null @@ -1,13 +0,0 @@ -uniform float u_Time; -uniform sampler2D u_Tex0; -varying vec2 v_TexCoord; - -void main() -{ - vec4 col = texture2D(u_Tex0, v_TexCoord); - float d = u_Time * 2.0; - col.x += (1.0 + sin(d))*0.25; - col.y += (1.0 + sin(d*2.0))*0.25; - col.z += (1.0 + sin(d*4.0))*0.25; - gl_FragColor = col; -} diff --git a/modules/game_shaders/shaders/pulse.frag b/modules/game_shaders/shaders/pulse.frag deleted file mode 100644 index bb4dc60d..00000000 --- a/modules/game_shaders/shaders/pulse.frag +++ /dev/null @@ -1,19 +0,0 @@ -uniform float u_Time; -uniform vec2 u_Resolution; -uniform sampler2D u_Tex0; -varying vec2 v_TexCoord; - -void main(void) -{ - vec2 halfres = u_Resolution.xy/2.0; - vec2 cPos = v_TexCoord.xy * u_Resolution; - - cPos.x -= 0.5*halfres.x*sin(u_Time/2.0)+0.3*halfres.x*cos(u_Time)+halfres.x; - cPos.y -= 0.4*halfres.y*sin(u_Time/5.0)+0.3*halfres.y*cos(u_Time)+halfres.y; - float cLength = length(cPos); - - vec2 uv = v_TexCoord.xy+ ((cPos/cLength)*sin(cLength/30.0-u_Time*10.0)/25.0)*0.15; - vec3 col = texture2D(u_Tex0,uv).xyz * 250.0/cLength; - - gl_FragColor = vec4(col,1.0); -} \ No newline at end of file diff --git a/modules/game_shaders/shaders/radialblur.frag b/modules/game_shaders/shaders/radialblur.frag deleted file mode 100644 index fe359aeb..00000000 --- a/modules/game_shaders/shaders/radialblur.frag +++ /dev/null @@ -1,50 +0,0 @@ -uniform sampler2D u_Tex0; -varying vec2 v_TexCoord; - -// some const, tweak for best look -const float sampleDist = 1.0; -const float sampleStrength = 2.2; - -void main(void) -{ - // 0.5,0.5 is the center of the screen - // so substracting v_TexCoord from it will result in - // a vector pointing to the middle of the screen - vec2 dir = 0.5 - v_TexCoord; - - // calculate the distance to the center of the screen - float dist = sqrt(dir.x*dir.x + dir.y*dir.y); - - // normalize the direction (reuse the distance) - dir = dir/dist; - - // this is the original colour of this fragment - // using only this would result in a nonblurred version - vec4 color = texture2D(u_Tex0,v_TexCoord); - - vec4 sum = color; - - // take 10 additional blur samples in the direction towards - // the center of the screen - sum += texture2D(u_Tex0, v_TexCoord - 0.08 * dir * sampleDist); - sum += texture2D(u_Tex0, v_TexCoord - 0.05 * dir * sampleDist); - sum += texture2D(u_Tex0, v_TexCoord - 0.03 * dir * sampleDist); - sum += texture2D(u_Tex0, v_TexCoord - 0.02 * dir * sampleDist); - sum += texture2D(u_Tex0, v_TexCoord - 0.01 * dir * sampleDist); - sum += texture2D(u_Tex0, v_TexCoord + 0.01 * dir * sampleDist); - sum += texture2D(u_Tex0, v_TexCoord + 0.02 * dir * sampleDist); - sum += texture2D(u_Tex0, v_TexCoord + 0.03 * dir * sampleDist); - sum += texture2D(u_Tex0, v_TexCoord + 0.05 * dir * sampleDist); - sum += texture2D(u_Tex0, v_TexCoord + 0.08 * dir * sampleDist); - - // we have taken eleven samples - sum *= 1.0/11.0; - - // weighten the blur effect with the distance to the - // center of the screen ( further out is blurred more) - float t = dist * sampleStrength; - t = clamp(t ,0.0,1.0); //0 <= t <= 1 - - //Blend the original color with the averaged pixels - gl_FragColor = mix(color, sum, t); -} \ No newline at end of file diff --git a/modules/game_shaders/shaders/sepia.frag b/modules/game_shaders/shaders/sepia.frag deleted file mode 100644 index a20dd6d8..00000000 --- a/modules/game_shaders/shaders/sepia.frag +++ /dev/null @@ -1,16 +0,0 @@ -uniform float u_Time; -uniform sampler2D u_Tex0; -varying vec2 v_TexCoord; - -vec4 sepia(vec4 color) -{ - return vec4(dot(color, vec4(.393, .769, .189, .0)), - dot(color, vec4(.349, .686, .168, .0)), - dot(color, vec4(.272, .534, .131, .0)), - 1); -} - -void main() -{ - gl_FragColor = sepia(texture2D(u_Tex0, v_TexCoord)); -} \ No newline at end of file diff --git a/modules/game_shaders/shaders/zomg.frag b/modules/game_shaders/shaders/zomg.frag deleted file mode 100644 index 8285021b..00000000 --- a/modules/game_shaders/shaders/zomg.frag +++ /dev/null @@ -1,13 +0,0 @@ -uniform sampler2D u_Tex0; -uniform float u_Time; -varying vec2 v_TexCoord; - -vec2 tibiaDir = vec2(1.0, 1.0); -void main(void) -{ - vec2 dir = 0.5 - v_TexCoord; - float dist = sqrt(dir.x*dir.x + dir.y*dir.y); - float scale = 0.8 + dist*0.5; - vec4 color = texture2D(u_Tex0, -(dir*scale - 0.5)); - gl_FragColor = color; -} diff --git a/modules/game_skills/skills.lua b/modules/game_skills/skills.lua index f11b4ae5..496c94f1 100644 --- a/modules/game_skills/skills.lua +++ b/modules/game_skills/skills.lua @@ -24,9 +24,9 @@ function init() onGameStart = refresh }) - skillsButton = TopMenu.addRightGameToggleButton('skillsButton', tr('Skills') .. ' (Ctrl+S)', 'skills.png', toggle) + skillsButton = modules.client_topmenu.addRightGameToggleButton('skillsButton', tr('Skills') .. ' (Ctrl+S)', '/images/topbuttons/skills', toggle) skillsButton:setOn(true) - skillsWindow = g_ui.loadUI('skills.otui', modules.game_interface.getRightPanel()) + skillsWindow = g_ui.loadUI('skills', modules.game_interface.getRightPanel()) g_keyboard.bindKeyDown('Ctrl+S', toggle) diff --git a/modules/game_skills/skills.otmod b/modules/game_skills/skills.otmod index 54ebe054..4a506753 100644 --- a/modules/game_skills/skills.otmod +++ b/modules/game_skills/skills.otmod @@ -4,7 +4,7 @@ Module author: baxnie, edubart website: www.otclient.info sandboxed: true - scripts: [ skills.lua ] + scripts: [ skills ] @onLoad: init() @onUnload: terminate() dependencies: diff --git a/modules/game_skills/skills.otui b/modules/game_skills/skills.otui index d8bc8533..30fb3f2d 100644 --- a/modules/game_skills/skills.otui +++ b/modules/game_skills/skills.otui @@ -34,7 +34,7 @@ MiniWindow id: skillWindow !text: tr('Skills') height: 150 - icon: skills.png + icon: /images/topbuttons/skills @onClose: modules.game_skills.onMiniWindowClose() &save: true diff --git a/modules/game_spelllist/icons/icons.png b/modules/game_spelllist/icons/icons.png deleted file mode 100644 index d1926f37..00000000 Binary files a/modules/game_spelllist/icons/icons.png and /dev/null differ diff --git a/modules/game_spelllist/icons/sample.png b/modules/game_spelllist/icons/sample.png deleted file mode 100644 index 14aa3b05..00000000 Binary files a/modules/game_spelllist/icons/sample.png and /dev/null differ diff --git a/modules/game_spelllist/spelllist.lua b/modules/game_spelllist/spelllist.lua index 24099ee7..e08e6d1e 100644 --- a/modules/game_spelllist/spelllist.lua +++ b/modules/game_spelllist/spelllist.lua @@ -91,10 +91,10 @@ function init() connect(g_game, { onGameStart = setOptions, onGameEnd = resetWindow }) - spelllistWindow = g_ui.displayUI('spelllist.otui', modules.game_interface.getRightPanel()) + spelllistWindow = g_ui.displayUI('spelllist', modules.game_interface.getRightPanel()) spelllistWindow:hide() - spelllistButton = TopMenu.addRightGameToggleButton('spelllistButton', tr('Spell List'), 'spelllist.png', toggle) + spelllistButton = modules.client_topmenu.addRightGameToggleButton('spelllistButton', tr('Spell List'), '/images/topbuttons/spelllist', toggle) spelllistButton:setOn(false) nameValueLabel = spelllistWindow:getChildById('labelNameValue') @@ -231,7 +231,7 @@ function initialiseSpelllist() tmpLabel:setHeight(SpelllistSettings[SpelllistProfile].iconSize.height + 4) tmpLabel:setTextOffset(topoint((SpelllistSettings[SpelllistProfile].iconSize.width + 10) .. ' ' .. (SpelllistSettings[SpelllistProfile].iconSize.height - 32)/2 + 3)) - tmpLabel:setImageSource('/game_spelllist/icons/' .. SpelllistSettings[SpelllistProfile].iconFile) + tmpLabel:setImageSource('/images/game/spells/' .. SpelllistSettings[SpelllistProfile].iconFile) tmpLabel:setImageClip(getIconImageClip(iconId)) tmpLabel:setImageSize(tosize(SpelllistSettings[SpelllistProfile].iconSize.width .. ' ' .. SpelllistSettings[SpelllistProfile].iconSize.height)) tmpLabel.onClick = updateSpellInformation diff --git a/modules/game_spelllist/spelllist.otmod b/modules/game_spelllist/spelllist.otmod index f2645bf2..51628cc0 100644 --- a/modules/game_spelllist/spelllist.otmod +++ b/modules/game_spelllist/spelllist.otmod @@ -4,6 +4,6 @@ Module author: Summ, Edubart website: www.otclient.info sandboxed: true - scripts: [ spelllist.lua ] + scripts: [ spelllist ] @onLoad: init() @onUnload: terminate() diff --git a/modules/game_spelllist/spelllist.otui b/modules/game_spelllist/spelllist.otui index d582ee9e..03edf063 100644 --- a/modules/game_spelllist/spelllist.otui +++ b/modules/game_spelllist/spelllist.otui @@ -7,7 +7,7 @@ SpellListLabel < Label image-clip: 0 0 32 32 image-size: 32 32 image-offset: 2 2 - image-source: /game_spelllist/icons/icons.png + image-source: /images/game/spells/defaultspells $focus: background-color: #ffffff22 diff --git a/modules/game_textmessage/textmessage.lua b/modules/game_textmessage/textmessage.lua index e841fbd1..96d933ff 100644 --- a/modules/game_textmessage/textmessage.lua +++ b/modules/game_textmessage/textmessage.lua @@ -54,7 +54,7 @@ messagesPanel = nil function init() connect(g_game, 'onTextMessage', displayMessage) connect(g_game, 'onGameEnd', clearMessages) - messagesPanel = g_ui.loadUI('textmessage.otui', modules.game_interface.getRootPanel()) + messagesPanel = g_ui.loadUI('textmessage', modules.game_interface.getRootPanel()) end function terminate() @@ -80,7 +80,7 @@ function displayMessage(mode, text) if msgtype == MessageSettings.none then return end - if msgtype.consoleTab ~= nil and (msgtype.consoleOption == nil or Options.getOption(msgtype.consoleOption)) then + if msgtype.consoleTab ~= nil and (msgtype.consoleOption == nil or modules.client_options.getOption(msgtype.consoleOption)) then modules.game_console.addText(text, msgtype, tr(msgtype.consoleTab)) --TODO move to game_console end diff --git a/modules/game_textmessage/textmessage.otmod b/modules/game_textmessage/textmessage.otmod index a640e4b0..4cafa1fa 100644 --- a/modules/game_textmessage/textmessage.otmod +++ b/modules/game_textmessage/textmessage.otmod @@ -4,6 +4,6 @@ Module author: edubart website: www.otclient.info sandboxed: true - scripts: [ textmessage.lua ] + scripts: [ textmessage ] @onLoad: init() @onUnload: terminate() \ No newline at end of file diff --git a/modules/game_textwindow/textwindow.lua b/modules/game_textwindow/textwindow.lua index 0bc57a7e..20fe22ff 100644 --- a/modules/game_textwindow/textwindow.lua +++ b/modules/game_textwindow/textwindow.lua @@ -1,7 +1,7 @@ local windows = {} function init() - g_ui.importStyle('textwindow.otui') + g_ui.importStyle('textwindow') connect(g_game, { onEditText = onGameEditText, onEditList = onGameEditList, diff --git a/modules/game_textwindow/textwindow.otmod b/modules/game_textwindow/textwindow.otmod index 8aa92569..b5066ada 100644 --- a/modules/game_textwindow/textwindow.otmod +++ b/modules/game_textwindow/textwindow.otmod @@ -5,6 +5,6 @@ Module website: www.otclient.info sandboxed: true dependencies: [ game_interface ] - scripts: [ textwindow.lua ] + scripts: [ textwindow ] @onLoad: init() @onUnload: terminate() diff --git a/modules/game_tibiafiles/tibiafiles.otmod b/modules/game_tibiafiles/tibiafiles.otmod index a91ffd70..93480cb5 100644 --- a/modules/game_tibiafiles/tibiafiles.otmod +++ b/modules/game_tibiafiles/tibiafiles.otmod @@ -3,6 +3,6 @@ Module description: Contains tibia spr and dat reloadable: false sandboxed: true - scripts: [tibiafiles.lua] + scripts: [tibiafiles] @onLoad: init() @onUnload: terminate() diff --git a/modules/game_viplist/viplist.lua b/modules/game_viplist/viplist.lua index c960d2a1..cba5b085 100644 --- a/modules/game_viplist/viplist.lua +++ b/modules/game_viplist/viplist.lua @@ -10,9 +10,9 @@ function init() g_keyboard.bindKeyDown('Ctrl+P', toggle) - vipButton = TopMenu.addRightGameToggleButton('vipListButton', tr('VIP list') .. ' (Ctrl+P)', 'viplist.png', toggle) + vipButton = modules.client_topmenu.addRightGameToggleButton('vipListButton', tr('VIP list') .. ' (Ctrl+P)', '/images/topbuttons/viplist', toggle) vipButton:setOn(true) - vipWindow = g_ui.loadUI('viplist.otui', modules.game_interface.getRightPanel()) + vipWindow = g_ui.loadUI('viplist', modules.game_interface.getRightPanel()) refresh() vipWindow:setup() @@ -58,7 +58,7 @@ function onMiniWindowClose() end function createAddWindow() - addVipWindow = g_ui.displayUI('addvip.otui') + addVipWindow = g_ui.displayUI('addvip') end function destroyAddWindow() @@ -71,6 +71,22 @@ function addVip() destroyAddWindow() end +function hideOffline(state) + settings = {} + settings['hideOffline'] = state + g_settings.mergeNode('VipList', settings) + + refresh() +end + +function isHiddingOffline() + local settings = g_settings.getNode('VipList') + if not settings then + return false + end + return settings['hideOffline'] +end + function onAddVip(id, name, state) local vipList = vipWindow:getChildById('contentsPanel') @@ -92,6 +108,10 @@ function onAddVip(id, name, state) label:setPhantom(false) connect(label, { onDoubleClick = function () g_game.openPrivateChannel(label:getText()) return true end } ) + if state == VipState.Offline and isHiddingOffline() then + label:setVisible(false) + end + local nameLower = name:lower() local childrenCount = vipList:getChildCount() @@ -140,6 +160,13 @@ function onVipListMousePress(widget, mousePos, mouseButton) local menu = g_ui.createWidget('PopupMenu') menu:addOption(tr('Add new VIP'), function() createAddWindow() end) + + if not isHiddingOffline() then + menu:addOption(tr('Hide Offline'), function() hideOffline(true) end) + else + menu:addOption(tr('Show Offline'), function() hideOffline(false) end) + end + menu:display(mousePos) return true @@ -155,7 +182,16 @@ function onVipListLabelMousePress(widget, mousePos, mouseButton) menu:addOption(tr('Add new VIP'), function() createAddWindow() end) menu:addOption(tr('Remove %s', widget:getText()), function() if widget then g_game.removeVip(widget:getId():sub(4)) vipList:removeChild(widget) end end) menu:addSeparator() - menu:addOption(tr('Copy Name'), function() g_window.setClipboardText(widget:getText()) end) + menu:addOption(tr('Copy Name'), function() g_window.setClipboardText(widget:getText()) end) if modules.game_console.getOwnPrivateTab() then + menu:addSeparator() + menu:addOption(tr('Invite to private chat'), function() g_game.inviteToOwnChannel(creatureName) end) + menu:addOption(tr('Exclude from private chat'), function() g_game.excludeFromOwnChannel(creatureName) end) + end + if not isHiddingOffline() then + menu:addOption(tr('Hide Offline'), function() hideOffline(true) end) + else + menu:addOption(tr('Show Offline'), function() hideOffline(false) end) + end menu:display(mousePos) return true diff --git a/modules/game_viplist/viplist.otmod b/modules/game_viplist/viplist.otmod index 73ed6945..9aef1e84 100644 --- a/modules/game_viplist/viplist.otmod +++ b/modules/game_viplist/viplist.otmod @@ -4,6 +4,6 @@ Module author: baxnie, edubart website: www.otclient.info sandboxed: true - scripts: [ viplist.lua ] + scripts: [ viplist ] @onLoad: init() @onUnload: terminate() diff --git a/modules/game_viplist/viplist.otui b/modules/game_viplist/viplist.otui index bfb40c31..2cd0a4a6 100644 --- a/modules/game_viplist/viplist.otui +++ b/modules/game_viplist/viplist.otui @@ -10,7 +10,7 @@ MiniWindow id: vipWindow !text: tr('VIP List') height: 100 - icon: viplist.png + icon: /images/topbuttons/viplist @onClose: modules.game_viplist.onMiniWindowClose() &save: true diff --git a/modules/gamelib/creature.lua b/modules/gamelib/creature.lua index 41761262..7fa9219f 100644 --- a/modules/gamelib/creature.lua +++ b/modules/gamelib/creature.lua @@ -32,59 +32,56 @@ EmblemBlue = 3 function getSkullImagePath(skullId) local path if skullId == SkullYellow then - path = 'icons/skull_yellow.png' + path = '/images/game/skulls/skull_yellow' elseif skullId == SkullGreen then - path = 'icons/skull_green.png' + path = '/images/game/skulls/skull_green' elseif skullId == SkullWhite then - path = 'icons/skull_white.png' + path = '/images/game/skulls/skull_white' elseif skullId == SkullRed then - path = 'icons/skull_red.png' + path = '/images/game/skulls/skull_red' elseif skullId == SkullBlack then - path = 'icons/skull_black.png' + path = '/images/game/skulls/skull_black' elseif skullId == SkullOrange then - path = 'icons/skull_orange.png' + path = '/images/game/skulls/skull_orange' end - path = resolvepath(path) return path end function getShieldImagePathAndBlink(shieldId) local path, blink if shieldId == ShieldWhiteYellow then - path, blink = 'icons/shield_yellow_white.png', false + path, blink = '/images/game/shields/shield_yellow_white', false elseif shieldId == ShieldWhiteBlue then - path, blink = 'icons/shield_blue_white.png', false + path, blink = '/images/game/shields//shield_blue_white', false elseif shieldId == ShieldBlue then - path, blink = 'icons/shield_blue.png', false + path, blink = '/images/game/shields//shield_blue', false elseif shieldId == ShieldYellow then - path, blink = 'icons/shield_yellow.png', false + path, blink = '/images/game/shields//shield_yellow', false elseif shieldId == ShieldBlueSharedExp then - path, blink = 'icons/shield_blue_shared.png', false + path, blink = '/images/game/shields//shield_blue_shared', false elseif shieldId == ShieldYellowSharedExp then - path, blink = 'icons/shield_yellow_shared.png', false + path, blink = '/images/game/shields//shield_yellow_shared', false elseif shieldId == ShieldBlueNoSharedExpBlink then - path, blink = 'icons/shield_blue_not_shared.png', true + path, blink = '/images/game/shields//shield_blue_not_shared', true elseif shieldId == ShieldYellowNoSharedExpBlink then - path, blink = 'icons/shield_yellow_not_shared.png', true + path, blink = '/images/game/shields//shield_yellow_not_shared', true elseif shieldId == ShieldBlueNoSharedExp then - path, blink = 'icons/shield_blue_not_shared.png', false + path, blink = '/images/game/shields//shield_blue_not_shared', false elseif shieldId == ShieldYellowNoSharedExp then - path, blink = 'icons/shield_yellow_not_shared.png', false + path, blink = '/images/game/shields//shield_yellow_not_shared', false end - path = resolvepath(path) return path, blink end function getEmblemImagePath(emblemId) local path if emblemId == EmblemGreen then - path = 'icons/emblem_green.png' + path = '/images/game/emblems/emblem_green' elseif emblemId == EmblemRed then - path = 'icons/emblem_red.png' + path = '/images/game/emblems/emblem_red' elseif emblemId == EmblemBlue then - path = 'icons/emblem_blue.png' + path = '/images/game/emblems/emblem_blue' end - path = resolvepath(path) return path end diff --git a/modules/gamelib/gamelib.otmod b/modules/gamelib/gamelib.otmod index bcfdf8cc..7b59f42e 100644 --- a/modules/gamelib/gamelib.otmod +++ b/modules/gamelib/gamelib.otmod @@ -5,7 +5,6 @@ Module website: www.otclient.info dependencies: - - client_extended - game_tibiafiles @onLoad: | diff --git a/modules/gamelib/protocolgame.lua b/modules/gamelib/protocolgame.lua index ac5950ad..a312de5e 100644 --- a/modules/gamelib/protocolgame.lua +++ b/modules/gamelib/protocolgame.lua @@ -1,15 +1,23 @@ local opcodeCallbacks = {} +local extendedCallbacks = {} function ProtocolGame:onOpcode(opcode, msg) for i, callback in pairs(opcodeCallbacks) do if i == opcode then - callback(msg) + callback(self, msg) return true end end return false end +function ProtocolGame:onExtendedOpcode(opcode, buffer) + local callback = extendedCallbacks[opcode] + if callback then + callback(self, opcode, buffer) + end +end + function ProtocolGame.registerOpcode(opcode, callback) if opcodeCallbacks[opcode] then error('opcode ' .. opcode .. ' already registered will be overriden') @@ -21,3 +29,31 @@ end function ProtocolGame.unregisterOpcode(opcode) opcodeCallbacks[opcode] = nil end + +function ProtocolGame.registerExtendedOpcode(opcode, callback) + if not callback or type(callback) ~= 'function' then + error('Invalid callback.') + end + + if opcode < 0 or opcode > 255 then + error('Invalid opcode. Range: 0-255') + end + + if extendedCallbacks[opcode] then + error('Opcode is already taken.') + end + + extendedCallbacks[opcode] = callback +end + +function ProtocolGame.unregisterExtendedOpcode(opcode) + if opcode < 0 or opcode > 255 then + error('Invalid opcode. Range: 0-255') + end + + if not extendedCallbacks[opcode] then + error('Opcode is not registered.') + end + + extendedCallbacks[opcode] = nil +end diff --git a/modules/gamelib/protocollogin.lua b/modules/gamelib/protocollogin.lua index 177e98c0..4bf513c2 100644 --- a/modules/gamelib/protocollogin.lua +++ b/modules/gamelib/protocollogin.lua @@ -2,12 +2,13 @@ ProtocolLogin = extends(Protocol) LoginServerError = 10 +LoginServerUpdate = 17 LoginServerMotd = 20 LoginServerUpdateNeeded = 30 LoginServerCharacterList = 100 LoginServerExtendedCharacterList = 101 -function ProtocolLogin:login(host, port, accountName, accountPassword) +function ProtocolLogin:login(host, port, accountName, accountPassword, locale) if string.len(host) == 0 or port == nil or port == 0 then signalcall(self.onError, self, tr("You must enter a valid server address and port.")) return @@ -16,6 +17,7 @@ function ProtocolLogin:login(host, port, accountName, accountPassword) self.accountName = accountName self.accountPassword = accountPassword self.connectCallback = sendLoginPacket + self.locale = locale self:connect(host, port) end @@ -28,6 +30,16 @@ function ProtocolLogin:sendLoginPacket() local msg = OutputMessage.create() msg:addU8(ClientOpcodes.ClientEnterAccount) msg:addU16(g_game.getOs()) + + if g_game.getFeature(GameUpdater) then + msg:addString(g_app.getOs()) + msg:addString(g_game.getUpdaterSignature()) + end + + if g_game.getFeature(GameLoginLocale) then + msg:addString(self.locale) + end + msg:addU16(g_game.getProtocolVersion()) if g_game.getProtocolVersion() >= 971 then @@ -94,6 +106,9 @@ function ProtocolLogin:onRecv(msg) self:parseCharacterList(msg) elseif opcode == LoginServerExtendedCharacterList then self:parseExtendedCharacterList(msg) + elseif opcode == LoginServerUpdate then + local signature = msg:getString() + signalcall(self.onUpdateNeeded, self, signature) else self:parseOpcode(opcode, msg) end diff --git a/modules/gamelib/spells.lua b/modules/gamelib/spells.lua index f74d1f00..6a2730c1 100644 --- a/modules/gamelib/spells.lua +++ b/modules/gamelib/spells.lua @@ -1,6 +1,6 @@ SpelllistSettings = { ['Default'] = { - iconFile = 'icons.png', + iconFile = 'defaultspells', iconSize = {width = 32, height = 32}, spellListWidth = 210, spellWindowWidth = 550, @@ -9,7 +9,7 @@ SpelllistSettings = { }, ['Sample'] = { - iconFile = 'sample.png', + iconFile = 'sample', iconSize = {width = 64, height = 64}, spellIcons = {[1] = 'Wind Walk', [2] = 'Fire Breath', [3] = 'Moonglaives', [5] = 'Firefly', [4] = 'Critical Strike'}, spellOrder = {'Critical Strike', 'Firefly', 'Fire Breath', 'Moonglaives', 'Wind Walk'} diff --git a/src/framework/graphics/cachedtext.cpp b/src/framework/graphics/cachedtext.cpp index 3205e431..e7693688 100644 --- a/src/framework/graphics/cachedtext.cpp +++ b/src/framework/graphics/cachedtext.cpp @@ -43,7 +43,9 @@ void CachedText::draw(const Rect& rect) m_textCoordsBuffer.clear(); m_font->calculateDrawTextCoords(m_textCoordsBuffer, m_text, rect, Fw::AlignCenter); } - g_painter->drawTextureCoords(m_textCoordsBuffer, m_font->getTexture()); + + if(m_font->getTexture()) + g_painter->drawTextureCoords(m_textCoordsBuffer, m_font->getTexture()); } void CachedText::update() diff --git a/src/framework/input/mouse.cpp b/src/framework/input/mouse.cpp index aea6da6b..c7a925c7 100644 --- a/src/framework/input/mouse.cpp +++ b/src/framework/input/mouse.cpp @@ -28,25 +28,26 @@ Mouse g_mouse; void Mouse::setTargetCursor() { - g_window.setMouseCursor("/cursors/targetcursor.png", Point(9, 9)); + //TODO: configure this in lua + g_window.setMouseCursor("/images/cursors/targetcursor", Point(9, 9)); m_cursorChanged = true; } void Mouse::setHorizontalCursor() { - g_window.setMouseCursor("/cursors/horizontal.png", Point(9, 4)); + g_window.setMouseCursor("/images/cursors/horizontal", Point(9, 4)); m_cursorChanged = true; } void Mouse::setVerticalCursor() { - g_window.setMouseCursor("/cursors/vertical.png", Point(4, 9)); + g_window.setMouseCursor("/images/cursors/vertical", Point(4, 9)); m_cursorChanged = true; } void Mouse::setTextCursor() { - g_window.setMouseCursor("/cursors/text.png", Point(4, 9)); + g_window.setMouseCursor("/images/cursors/text", Point(4, 9)); m_cursorChanged = true; } diff --git a/src/framework/ui/uitextedit.cpp b/src/framework/ui/uitextedit.cpp index 5d43bcb5..e52a9a67 100644 --- a/src/framework/ui/uitextedit.cpp +++ b/src/framework/ui/uitextedit.cpp @@ -57,6 +57,8 @@ void UITextEdit::drawSelf(Fw::DrawPane drawPane) int textLength = m_text.length(); const TexturePtr& texture = m_font->getTexture(); + if(!texture) + return; g_painter->setColor(m_color); for(int i=0;isetColor(m_color); - g_painter->drawTextureCoords(m_textCoordsBuffer, m_font->getTexture()); + + if(m_font->getTexture()) + g_painter->drawTextureCoords(m_textCoordsBuffer, m_font->getTexture()); } void UIWidget::onTextChange(const std::string& text, const std::string& oldText)