Skip to content

Commit

Permalink
improve: client_options with tibia 13 styles (#821)
Browse files Browse the repository at this point in the history
  • Loading branch information
kokekanon authored Jul 15, 2024
1 parent 24d2fe3 commit a1baafb
Show file tree
Hide file tree
Showing 28 changed files with 1,217 additions and 92 deletions.
Binary file added data/images/ui/button-grey-down.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/images/ui/button-grey-up.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/images/ui/icon-arrow-disabled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/images/ui/icon-arrow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/images/ui/icon-arrow7x7-down.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/images/ui/icon-arrow7x7-right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/images/ui/test/button-darkgrey-down.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/images/ui/test/button-darkgrey-up.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/images/ui/test/button-verydarkgrey-down.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/images/ui/test/button-verydarkgrey-up.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 16 additions & 16 deletions modules/client_options/data_options.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
return {
vsync = {
value = true,
action = function(value, options, controller, panels, extraWidgets, extraWidgets)
action = function(value, options, controller, panels, extraWidgets)
g_window.setVerticalSync(value)
end
},
Expand Down Expand Up @@ -96,7 +96,7 @@ return {
value = true,
action = function(value, options, controller, panels, extraWidgets)
panels.gameMapPanel:setDrawLights(value and options.ambientLight.value < 100)
panels.graphicsPanel:recursiveGetChildById('ambientLight'):setEnabled(value)
panels.graphicsEffectsPanel:recursiveGetChildById('ambientLight'):setEnabled(value)
end
},
limitVisibleDimension = {
Expand All @@ -114,7 +114,7 @@ return {
ambientLight = {
value = 0,
action = function(value, options, controller, panels, extraWidgets)
panels.graphicsPanel:recursiveGetChildById('ambientLight'):setText(string.format('Ambient light: %s%%', value))
panels.graphicsEffectsPanel:recursiveGetChildById('ambientLight'):setText(string.format('Ambient light: %s%%', value))
panels.gameMapPanel:setMinimumAmbientLight(value / 100)
panels.gameMapPanel:setDrawLights(options.enableLights.value)
end
Expand Down Expand Up @@ -158,13 +158,13 @@ return {
turnDelay = {
value = 50,
action = function(value, options, controller, panels, extraWidgets)
panels.controlPanel:recursiveGetChildById('turnDelay'):setText(string.format('Turn delay: %sms', value))
panels.generalPanel:recursiveGetChildById('turnDelay'):setText(string.format('Turn delay: %sms', value))
end
},
hotkeyDelay = {
value = 70,
action = function(value, options, controller, panels, extraWidgets)
panels.controlPanel:recursiveGetChildById('hotkeyDelay'):setText(string.format('Hotkey delay: %sms', value))
panels.generalPanel:recursiveGetChildById('hotkeyDelay'):setText(string.format('Hotkey delay: %sms', value))
end
},
crosshair = {
Expand All @@ -177,7 +177,7 @@ return {
end

panels.gameMapPanel:setCrosshairTexture(newValue and crossPath .. newValue or nil)
panels.generalPanel:recursiveGetChildById('crosshair'):setCurrentOptionByData(newValue, true)
panels.interface:recursiveGetChildById('crosshair'):setCurrentOptionByData(newValue, true)
end
},
enableHighlightMouseTarget = {
Expand All @@ -196,7 +196,7 @@ return {
shadowFloorIntensity = {
value = 30,
action = function(value, options, controller, panels, extraWidgets)
panels.graphicsPanel:recursiveGetChildById('shadowFloorIntensity'):setText(string.format(
panels.graphicsEffectsPanel:recursiveGetChildById('shadowFloorIntensity'):setText(string.format(
'Shadow floor Intensity: %s%%', value))
panels.gameMapPanel:setShadowFloorIntensity(1 - (value / 100))
end
Expand All @@ -223,16 +223,16 @@ return {
value = 1,
action = function(value, options, controller, panels, extraWidgets)
panels.gameMapPanel:setFloorViewMode(value)
panels.graphicsPanel:recursiveGetChildById('floorViewMode'):setCurrentOptionByData(value, true)
panels.graphicsEffectsPanel:recursiveGetChildById('floorViewMode'):setCurrentOptionByData(value, true)

local fadeMode = value == 1
panels.graphicsPanel:recursiveGetChildById('floorFading'):setEnabled(fadeMode)
panels.graphicsEffectsPanel:recursiveGetChildById('floorFading'):setEnabled(fadeMode)
end
},
floorFading = {
value = 500,
action = function(value, options, controller, panels, extraWidgets)
panels.graphicsPanel:recursiveGetChildById('floorFading'):setText(string.format('Floor Fading: %s ms', value))
panels.graphicsEffectsPanel:recursiveGetChildById('floorFading'):setText(string.format('Floor Fading: %s ms', value))
panels.gameMapPanel:setFloorFading(tonumber(value))
end
},
Expand All @@ -242,7 +242,7 @@ return {
if g_game.isUsingProtobuf() then
value = true
elseif g_app.isEncrypted() then
local asyncWidget = panels.generalPanel:recursiveGetChildById('asyncTxtLoading')
local asyncWidget = panels.graphicsPanel:recursiveGetChildById('asyncTxtLoading')
asyncWidget:setEnabled(false)
asyncWidget:setChecked(false)
return
Expand All @@ -260,7 +260,7 @@ return {
value = value / 2
end
g_app.setCreatureInformationScale(math.max(value + 0.5, 1))
panels.consolePanel:recursiveGetChildById('creatureInformationScale'):setText(string.format(
panels.interfaceHUD:recursiveGetChildById('creatureInformationScale'):setText(string.format(
'Creature Information Scale: %sx', math.max(value + 0.5, 1)))
end
},
Expand All @@ -273,7 +273,7 @@ return {
value = value / 2
end
g_app.setStaticTextScale(math.max(value + 0.5, 1))
panels.consolePanel:recursiveGetChildById('staticTextScale'):setText(string.format('Message Scale: %sx',
panels.interfaceHUD:recursiveGetChildById('staticTextScale'):setText(string.format('Message Scale: %sx',
math.max(value + 0.5, 1)))
end
},
Expand All @@ -286,7 +286,7 @@ return {
value = value / 2
end
g_app.setAnimatedTextScale(math.max(value + 0.5, 1))
panels.consolePanel:recursiveGetChildById('animatedTextScale'):setText(
panels.interfaceHUD:recursiveGetChildById('animatedTextScale'):setText(
tr('Animated Message Scale: %sx', math.max(value + 0.5, 1)))
end
},
Expand Down Expand Up @@ -332,14 +332,14 @@ return {
value = 100,
action = function(value, options, controller, panels, extraWidgets)
g_client.setEffectAlpha(value / 100)
panels.consolePanel:recursiveGetChildById('setEffectAlphaScroll'):setText(tr('Opacity Effect: %s%%', value))
panels.graphicsEffectsPanel:recursiveGetChildById('setEffectAlphaScroll'):setText(tr('Opacity Effect: %s%%', value))
end
},
setMissileAlphaScroll = {
value = 100,
action = function(value, options, controller, panels, extraWidgets)
g_client.setMissileAlpha(value / 100)
panels.consolePanel:recursiveGetChildById('setMissileAlphaScroll'):setText(tr('Opacity Missile: %s%%', value))
panels.graphicsEffectsPanel:recursiveGetChildById('setMissileAlphaScroll'):setText(tr('Opacity Missile: %s%%', value))
end
},
distFromCenScrollbar = {
Expand Down
Loading

0 comments on commit a1baafb

Please sign in to comment.