Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified data/images/game/combatmodes/safefight.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 0 additions & 5 deletions mods/game_bot/executor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -427,11 +427,6 @@ function executeBot(config, storage, tabs, msgCallback, saveConfigCallback, relo
callback(iconId, duration)
end
end,
onSpellCooldown = function(iconId, duration)
for i, callback in ipairs(context._callbacks.onSpellCooldown) do
callback(iconId, duration)
end
end,
onInventoryChange = function(player, slot, item, oldItem)
for i, callback in ipairs(context._callbacks.onInventoryChange) do
callback(player, slot, item, oldItem)
Expand Down
3 changes: 2 additions & 1 deletion modules/client_options/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,9 @@ function controller:onTerminate()
panels = {}
extraWidgets = {}
buttons = {}
Keybind.delete("UI", "Toggle Full Screen")
Keybind.delete("UI", "Toggle Fullscreen")
Keybind.delete("UI", "Show/hide Creature Names and Bars")
Keybind.delete("UI", "Show/hide FPS / lag indicator")
Keybind.delete("Sound", "Mute/unmute")

terminate_binds()
Expand Down
6 changes: 3 additions & 3 deletions modules/game_console/console.lua
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,9 @@ function clear()
channelsWindow:destroy()
channelsWindow = nil
end
if g_game.getClientVersion() < 862 then
Keybind.delete("Dialogs", "Open Rule Violation")
end
end

function clearChannel(consoleTabBar)
Expand Down Expand Up @@ -2077,9 +2080,6 @@ function online()
end

function offline()
if g_game.getClientVersion() < 862 then
Keybind.delete("Dialogs", "Open Rule Violation")
end
clear()
end

Expand Down
1 change: 1 addition & 0 deletions modules/game_console/console.otui
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ ConsolePhantomLabel < UILabel

ConsoleTabBar < MoveableTabBar
height: 28
phantom: true

ConsoleTabBarPanel < MoveableTabBarPanel
id: consoleTab
Expand Down
3 changes: 1 addition & 2 deletions modules/game_healthcircle/game_healthcircle.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ manaCircle = nil
expCircle = nil
skillCircle = nil

g_ui.loadUI('game_healthcircle')

healthCircleFront = nil
manaCircleFront = nil
expCircleFront = nil
Expand All @@ -39,6 +37,7 @@ distanceFromCenter = g_settings.getNumber('healthcircle_distfromcenter')
opacityCircle = g_settings.getNumber('healthcircle_opacity', 0.35)

function init()
g_ui.importStyle("game_healthcircle.otui")
healthCircle = g_ui.createWidget('HealthCircle', mapPanel)
manaCircle = g_ui.createWidget('ManaCircle', mapPanel)
expCircle = g_ui.createWidget('ExpCircle', mapPanel)
Expand Down
1 change: 1 addition & 0 deletions modules/game_interface/widgets/statsbar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ local function loadIcon(bitChanged, content, topmenu)
end
icon:setTooltip(tooltip)
icon:setImageSize(tosize("9 9"))
icon:setMarginRight(-1)
if topmenu then
icon:setMarginTop(5)
icon:setMarginLeft(2)
Expand Down
8 changes: 8 additions & 0 deletions modules/game_inventory/inventory.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ local inventoryShrink = false
local itemSlotsWithDuration = {}
local updateSlotsDurationEvent = nil
local DURATION_UPDATE_INTERVAL = 1000
local pvpModeRadioGroup = nil

local function getInventoryUi()
if inventoryShrink then
Expand Down Expand Up @@ -366,6 +367,13 @@ function inventoryController:onTerminate()
iconTopMenu:destroy()
iconTopMenu = nil
end
if pvpModeRadioGroup then
disconnect(pvpModeRadioGroup, {
onSelectionChange = onSetPVPMode
})
pvpModeRadioGroup:destroy()
pvpModeRadioGroup = nil
end
end

function onSetSafeFight(self, checked)
Expand Down
19 changes: 1 addition & 18 deletions modules/game_mainpanel/mainoptionspanel.otui
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,6 @@ PhantomMiniWindow
margin-top: 8
phantom: true

UIWidget
id: store

image-clip: 0 0 108 20
anchors.top: parent.top
anchors.left: parent.left

size: 108 20
layout:
type: verticalBox
cell-size: 108 20
cell-spacing: 2
flow: true
$pressed !disabled:
image-clip: 0 20 108 20

Button
size: 44 20
image-source: /images/options/button_enlarge
Expand All @@ -46,7 +30,6 @@ PhantomMiniWindow

UIWidget
id: store

image-clip: 0 0 108 20
anchors.top: parent.top
anchors.left: parent.left
Expand All @@ -65,7 +48,7 @@ PhantomMiniWindow
Button
id: resizer
size: 44 20
image-source: /images/options/button_shrink
image-source: /images/options/button_enlarge
image-clip: 0 0 44 20
anchors.top: parent.top
anchors.right: parent.right
Expand Down
114 changes: 60 additions & 54 deletions modules/game_mainpanel/mainpanel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,87 +14,93 @@ local COLORS = {
BASE_2 = "#414141"
}

function reloadMainPanelSizes()
local main = modules.game_interface.getMainRightPanel()
local rightPanel = modules.game_interface.getRightPanel()
local PANEL_CONSTANTS = {
ICON_WIDTH = 18,
ICON_HEIGHT = 18,
MAX_ICONS_PER_ROW = {
OPTIONS = 5,
SPECIALS = 2,
STORE = 1
},
MULTI_STORE_HEIGHT = 20,
HEIGHT_EXTRA_ONPANEL = -5,
HEIGHT_EXTRA_SHRINK = 5
}

if not main or not rightPanel then
return
end

local height = 1
local function calculatePanelHeight(icon_count, max_icons_per_row, icon_size)
local rows = math.ceil(icon_count / max_icons_per_row)
return (rows * icon_size) + (rows * 3)
local optionsShrink = false

local function calculatePanelHeight(panel, max_icons_per_row)
local icon_count = 0
for _, icon in ipairs(panel:getChildren()) do
if icon:isVisible() then
icon_count = icon_count + 1
end
end
local rows = math.ceil(icon_count / max_icons_per_row)
local height = (rows * PANEL_CONSTANTS.ICON_HEIGHT) + (rows * 3)
return height, icon_count
end

for _, panel in ipairs(main:getChildren()) do
function reloadMainPanelSizes()
local main_panel = modules.game_interface.getMainRightPanel()
local right_panel = modules.game_interface.getRightPanel()
if not main_panel or not right_panel then
return
end
local total_height = 1
for _, panel in ipairs(main_panel:getChildren()) do
if panel.panelHeight ~= nil then
if panel:isVisible() then
panel:setHeight(panel.panelHeight)
height = height + panel.panelHeight

if panel:getId() == 'mainoptionspanel' and panel:isOn() then

local function calculatePanelHeightFromPanel(panel, icon_width, icon_height, max_icons_per_row)
local icon_count = 0
for _, icon in ipairs(panel:getChildren()) do
if icon:isVisible() then
icon_count = icon_count + 1
end
total_height = total_height + panel.panelHeight
if panel:getId() == 'mainoptionspanel' then
if panel:isOn() then
local options_panel = optionsController.ui.onPanel.options
local options_height, options_count =
calculatePanelHeight(options_panel, PANEL_CONSTANTS.MAX_ICONS_PER_ROW.OPTIONS)
local specials_panel = optionsController.ui.onPanel.specials
local specials_height, specials_count =
calculatePanelHeight(specials_panel, PANEL_CONSTANTS.MAX_ICONS_PER_ROW.SPECIALS)
local store_panel = panel.onPanel.store
local store_height, store_count = calculatePanelHeight(store_panel,
PANEL_CONSTANTS.MAX_ICONS_PER_ROW.STORE)
if store_count > 0 then
store_height = store_count * PANEL_CONSTANTS.MULTI_STORE_HEIGHT + (store_count - 1) * 2
end

local rows = math.ceil(icon_count / max_icons_per_row)
return (rows * icon_height) + (rows * 3)
end

local options_panel = optionsController.ui.onPanel.options
local options_height = calculatePanelHeightFromPanel(options_panel, 18, 18, 5)

local specials_panel = optionsController.ui.onPanel.specials
local specials_height = calculatePanelHeightFromPanel(specials_panel, 18, 18, 2)

local max_panel_height = math.max(options_height, specials_height)
panel:setHeight(panel:getHeight() + max_panel_height + 5)
height = height + options_height

local store_panel = panel.onPanel.store
local store_height = calculatePanelHeightFromPanel(store_panel, 18, 18, 1)

store_panel:setHeight(store_height)
height = height + store_height

if store_panel:getChildCount() >= 2 then
height = height + 15
local combined_height = store_height + math.max(options_height, specials_height)
local extra_height = PANEL_CONSTANTS.HEIGHT_EXTRA_ONPANEL
if store_count >= 2 then
extra_height = extra_height - (store_count - 1) * 5
end
combined_height = combined_height + extra_height
store_panel:setHeight(store_height)
panel:setHeight(combined_height + panel.panelHeight)
total_height = total_height + combined_height
else
total_height = total_height + PANEL_CONSTANTS.HEIGHT_EXTRA_SHRINK
end
end
else
panel:setHeight(0)
end
end
end

main:setHeight(height - 10)
rightPanel:fitAll()
main_panel:setHeight(total_height)
right_panel:fitAll()
end

-- @ Options
local optionsShrink = false
local function refreshOptionsSizes()
if optionsShrink then
optionsController.ui:setOn(false)
optionsController.ui.onPanel:hide()
optionsController.ui.offPanel:show()
else
optionsController.ui:setOn(true)
optionsController.ui.onPanel:show()
optionsController.ui.offPanel:hide()
end
reloadMainPanelSizes()
end

local function createButton_large(id, description, image, callback, special, front)
-- fast version
local panel = optionsController.ui.onPanel.store

storeAmount = storeAmount + 1
Expand Down Expand Up @@ -178,7 +184,7 @@ function toggleStore()
if g_game.getFeature(GameIngameStore) then
modules.game_store.toggle() -- cipsoft packets
else
modules.game_shop.toggle() -- custom from v8
modules.game_shop.toggle() -- custom
end
end

Expand Down
51 changes: 0 additions & 51 deletions modules/game_outfit/outfit.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
local opcodeSystem = {
enable = false,
id = 213
}

local statesOutft ={
available = 0,
store = 1,
Expand Down Expand Up @@ -150,33 +145,13 @@ end
local AppearanceData = {"preset", "outfit", "mount", "familiar", "wings", "aura", "effects", "shader", "healthBar", "title"}

function init()
if opcodeSystem.enable then
ProtocolGame.registerExtendedOpcode(opcodeSystem.id, function(protocol, opcode, buffer)
local status, json_data = pcall(json.decode, buffer)

if not status then
g_logger.error("[Crafting] JSON error: " .. buffer)
return false
end

ServerData.auras = json_data.action
ServerData.wings = json_data.wings
ServerData.shaders = json_data.shader
ServerData.healthBars = json_data.HealthBar
ServerData.effects = json_data.effect
ServerData.title = json_data.title
end)
end
connect(g_game, {
onOpenOutfitWindow = create,
onGameEnd = destroy
})
end

function terminate()
if opcodeSystem.enable then
ProtocolGame.unregisterExtendedOpcode(opcodeSystem.id)
end
disconnect(g_game, {
onOpenOutfitWindow = create,
onGameEnd = destroy
Expand Down Expand Up @@ -1786,23 +1761,6 @@ function loadDefaultSettings()
settings.currentPreset = 0
end

function sendAction(action, data)
local protocolGame = g_game.getProtocolGame()

if data == nil then
data = {}
end

if protocolGame then
protocolGame.sendExtendedJSONOpcode(protocolGame, opcodeSystem.id, {
action = action,
data = data
})
end

return
end

function accept()
if g_game.getFeature(GamePlayerMounts) then
local player = g_game.getLocalPlayer()
Expand All @@ -1822,14 +1780,5 @@ function accept()
end
end
g_game.changeOutfit(tempOutfit)
if opcodeSystem.enable then
sendAction("changeOutfit", {
wingsName = lastSelectWings,
auraName = lastSelectAura,
shaderName = lastSelectShader,
titleName = lastSelectTitle,
EffectName = lastSelectEffects
})
end
destroy()
end
11 changes: 0 additions & 11 deletions modules/game_outfit/serverSIDE/if c++ (protocol)/c++.txt

This file was deleted.

Empty file.
2 changes: 1 addition & 1 deletion modules/game_playerdeath/deathwindow.otui
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
DeathWindow < MainWindow
MainWindow
id: deathWindow
!text: tr('You are dead')
&baseWidth: 350
Expand Down
Loading
Loading