Skip to content

Commit 819c5e1

Browse files
committed
Revert "Add: TextDraw.on_click() event"
This commit was not meant to be pushed to main.. Reverting.
1 parent f9c7c24 commit 819c5e1

File tree

1 file changed

+9
-28
lines changed

1 file changed

+9
-28
lines changed

pysamp/textdraw.py

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@
2222
text_draw_text_size,
2323
text_draw_use_box,
2424
select_text_draw,
25-
cancel_select_text_draw,
25+
cancel_select_text_draw
2626
)
27-
from pysamp.event import event
2827

2928

3029
class TextDraw:
@@ -37,7 +36,6 @@ class TextDraw:
3736
3837
To create a new textdraw, use :meth:`TextDraw.create`.
3938
"""
40-
4139
def __init__(self, id: int) -> None:
4240
self.id = id
4341

@@ -77,7 +75,9 @@ def create(cls, x: float, y: float, text: str) -> "TextDraw":
7775
- If part of the text is off-screen, the color of the text will\
7876
not show, only the shadow (if enabled) will.
7977
"""
80-
return cls(text_draw_create(x, y, text))
78+
return cls(
79+
text_draw_create(x, y, text)
80+
)
8181

8282
def destroy(self) -> bool:
8383
"""Destroy the textdraw.
@@ -286,7 +286,11 @@ def set_preview_model(self, model_index: int) -> bool:
286286
return text_draw_set_preview_model(self.id, model_index)
287287

288288
def set_preview_rotation(
289-
self, rotation_x: float, rotation_y: float, rotation_z: float, zoom: float = 1.0
289+
self,
290+
rotation_x: float,
291+
rotation_y: float,
292+
rotation_z: float,
293+
zoom: float = 1.0
290294
) -> bool:
291295
"""Sets the rotation and zoom of a 3D model preview textdraw.
292296
@@ -351,28 +355,5 @@ def cancel_select(self, player: "Player") -> bool:
351355
"""
352356
return cancel_select_text_draw(player.id)
353357

354-
@event("OnPlayerClickTextDraw")
355-
def on_click(cls, player_id: int, clicked_id: int):
356-
"""This event is called when a player clicks on the instance of the
357-
TextDraw.
358-
359-
:param Player player: The player that clicked on the
360-
textdraw.
361-
:returns: No return value.
362-
363-
.. warning::
364-
The clickable area is defined by :meth:`TextDraw.text_size()`.
365-
The x and y parameters passed to that function
366-
must not be zero or negative.
367-
Do not use :meth:`TextDraw.cancel_select()` unconditionally
368-
within this event. This results in an infinite loop.
369-
370-
Wraps: https://open.mp/docs/scripting/callbacks/OnPlayerClickTextDraw
371-
"""
372-
if clicked_id != cls.id:
373-
return
374-
375-
return Player(player_id)
376-
377358

378359
from .player import Player # noqa

0 commit comments

Comments
 (0)