Skip to content

Commit

Permalink
feat: keybinds by oen | (limited) Part 1 (#996)
Browse files Browse the repository at this point in the history
  • Loading branch information
InnerCircleTFS authored Dec 17, 2024
1 parent b8b229e commit 06aa908
Show file tree
Hide file tree
Showing 38 changed files with 2,590 additions and 82 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,7 @@ Beyond of it's flexibility with scripts, otclient comes with tons of other featu
- Module Oufit
- Placeholder
- UIGraph
- keybinds
## <a name="themobileproject"><img height="32" src="https://raw.githubusercontent.com/github/explore/80688e429a7d4ef2fca1e82350fe8e3517d3494d/topics/android/android.png" alt="Android"> The Mobile Project </a>
The Mobile Project
Expand Down
Binary file added data/images/ui/icon-edit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions data/styles/10-scrollbars.otui
Original file line number Diff line number Diff line change
Expand Up @@ -186,3 +186,23 @@ HorizontalQtScrollBar < UIScrollBar
image-clip: 54 10 12 12

HorizontalScrollBarQtSlider

SmallButton < UIButton
size: 106 20
font: cipsoftFont
text-offset: 0 2
image-source: /images/ui/button
image-clip: 0 0 22 23
image-border: 3
padding: 5 10 5 10
change-cursor-image: true
cursor: pointer
color: #ffffff
$hover !disabled:
image-clip: 0 23 22 23
$pressed:
image-clip: 0 46 22 23
text-offset: 1 2
$disabled:
color: #ffffff88
change-cursor-image: false
10 changes: 8 additions & 2 deletions modules/client_debug_info/debug_info.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ function init()
debugInfoWindow = g_ui.displayUI('debug_info')
debugInfoWindow:hide()

g_keyboard.bindKeyDown('Ctrl+Alt+D', toggle)
Keybind.new("Debug", "Toggle Stats", "Ctrl+Alt+D", "")
Keybind.bind("Debug", "Toggle Stats", {
{
type = KEY_DOWN,
callback = toggle,
}
})

updateEvent = scheduleEvent(update, 2000)
end
Expand All @@ -20,7 +26,7 @@ function terminate()
debugInfoWindow:destroy()
debugInfoButton:destroy()

g_keyboard.unbindKeyDown('Ctrl+Alt+D')
Keybind.delete("Debug", "Toggle Stats")

removeEvent(updateEvent)
end
Expand Down
10 changes: 8 additions & 2 deletions modules/client_entergame/entergame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,13 @@ end
-- public functions
function EnterGame.init()
enterGame = g_ui.displayUI('entergame')
g_keyboard.bindKeyDown('Ctrl+G', EnterGame.openWindow)
Keybind.new("Misc.", "Change Character", "Ctrl+G", "")
Keybind.bind("Misc.", "Change Character", {
{
type = KEY_DOWN,
callback = EnterGame.openWindow,
}
})

local account = g_settings.get('account')
local password = g_settings.get('password')
Expand Down Expand Up @@ -259,7 +265,7 @@ function EnterGame.firstShow()
end

function EnterGame.terminate()
g_keyboard.unbindKeyDown('Ctrl+G')
Keybind.delete("Misc.", "Change Character")

disconnect(clientBox, {
onOptionChange = EnterGame.onClientVersionChange
Expand Down
6 changes: 6 additions & 0 deletions modules/client_options/data_options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -444,4 +444,10 @@ return {
end, 100)
end
},
autoSwitchPreset = false,
listKeybindsPanel = {
action = function(value, options, controller, panels, extraWidgets)
listKeybindsComboBox(value)
end
},
}
Loading

0 comments on commit 06aa908

Please sign in to comment.