Ulysses
Home
Help
Ulysses
»
Ulysses Stuff
»
Suggestions
»
A hook for custom pieces. (Default Pieces: *, ^, $)
« previous next »
Print
Pages: [
1
]
Go Down
Author
Topic: A hook for custom pieces. (Default Pieces: *, ^, $) (Read 5164 times)
0 Members and 1 Guest are viewing this topic.
LuaTenshi
Hero Member
Posts: 545
Karma: 47
Just your ordinary moon angel!
A hook for custom pieces. (Default Pieces: *, ^, $)
«
on:
August 05, 2014, 01:53:43 pm »
I would like to see the ability for people to add custom "pieces" into ULX, for their own targeting methods.
https://github.com/Nayruden/Ulysses/pull/332
Added a hook to allow custom pieces within ULib.getUsers. Lines: 219 - 223
Here is a quick example...
Code: Lua
hook
.
Add
(
"ulx_custompiece"
,
"__j"
,
function
(
ply
,
p
)
if
p
:
sub
(
1
,
1
)
==
"&"
then
local
uSel
=
ply
.
_ulxSelection
if
uSel
and
type
(
uSel
)
==
"table"
and
#
uSel
>=
1
then
local
tab
=
{
}
for
_
,
v
in
next
,
ply
.
_ulxSelection
do
if
IsValid
(
v
)
and
v
:
IsPlayer
(
)
then
table.insert
(
tab
,
v
)
end
end
return
tab
-- Notice how we are returning the built table here.
else
return
nil
end
end
end
)
Logged
I cry every time I see that I am not a respected member of this community.
Cobalt
Full Member
Posts: 216
Karma: 44
http://steamcommunity.com/id/__yvl/
Re: A hook for custom pieces. (Default Pieces: *, ^, $)
«
Reply #1 on:
August 05, 2014, 02:45:47 pm »
This is a good idea, I like it.
Logged
Stickly Man!
Ulysses Team Member
Hero Member
Posts: 1270
Karma: 164
What even IS software anymore?
Re: A hook for custom pieces. (Default Pieces: *, ^, $)
«
Reply #2 on:
August 07, 2014, 03:13:04 pm »
This is a very interesting feature- I'll have test it out myself and run the idea past Megiddo.
Logged
Join our Team Ulysses community discord!
https://discord.gg/gR4Uye6
Print
Pages: [
1
]
Go Up
« previous next »
Ulysses
»
Ulysses Stuff
»
Suggestions
»
A hook for custom pieces. (Default Pieces: *, ^, $)