mirror of
https://github.com/jie65535/JMods.git
synced 2025-10-20 17:13:58 +08:00
first commit
This commit is contained in:
BIN
JCursor/Cursor.png
Normal file
BIN
JCursor/Cursor.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.6 KiB |
67
JCursor/JCursor.lua
Normal file
67
JCursor/JCursor.lua
Normal file
@@ -0,0 +1,67 @@
|
||||
--- STEAMODDED HEADER
|
||||
--- MOD_NAME: J Cursor
|
||||
--- MOD_ID: JCursor
|
||||
--- MOD_AUTHOR: [Jie65535]
|
||||
--- MOD_DESCRIPTION: Custom Cursor (./Mods/JCursor/Cursor.png)
|
||||
|
||||
----------------------------------------------
|
||||
------------MOD CODE -------------------------
|
||||
|
||||
SMODS.registerUIElement("JCursor", {
|
||||
{
|
||||
n = G.UIT.R,
|
||||
config = {
|
||||
padding = 0.2,
|
||||
align = "cm"
|
||||
},
|
||||
nodes = {
|
||||
UIBox_button({
|
||||
minw = 3.85,
|
||||
button = "openModDirectory",
|
||||
label = {
|
||||
"Open directory"
|
||||
}
|
||||
}),
|
||||
UIBox_button({
|
||||
minw = 3.85,
|
||||
button = "refreshCursor",
|
||||
label = {
|
||||
"Refresh cursor"
|
||||
}
|
||||
}),
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
local function getModDirectory()
|
||||
return "/Mods/JCursor"
|
||||
end
|
||||
|
||||
local function getCursorFile()
|
||||
return getModDirectory() .. "/Cursor.png"
|
||||
end
|
||||
|
||||
local function setCursor(filename)
|
||||
cursor = love.mouse.newCursor(filename, 0, 0)
|
||||
love.mouse.setCursor(cursor)
|
||||
end
|
||||
|
||||
function G.FUNCS.openModDirectory(arg_736_0)
|
||||
sendDebugMessage("openModDirectory")
|
||||
love.system.openURL("file://" .. love.filesystem.getSaveDirectory() .. getModDirectory())
|
||||
end
|
||||
|
||||
function G.FUNCS.refreshCursor(arg_736_0)
|
||||
sendDebugMessage("refreshCursor")
|
||||
setCursor(getCursorFile())
|
||||
end
|
||||
|
||||
local defaultCursor = getCursorFile()
|
||||
if love.filesystem.exists(defaultCursor) then
|
||||
setCursor(defaultCursor)
|
||||
end
|
||||
|
||||
sendDebugMessage("JCursor loaded!")
|
||||
|
||||
----------------------------------------------
|
||||
------------MOD CODE END----------------------
|
Reference in New Issue
Block a user