34 lines
915 B
C#
34 lines
915 B
C#
using Godot;
|
|
|
|
[SceneTree]
|
|
public partial class TimeSlot : PanelContainer
|
|
{
|
|
public MeetingControl MeetingControl { get; set; }
|
|
|
|
public override bool _CanDropData(Vector2 atPosition, Variant data)
|
|
{
|
|
return data.VariantType == Variant.Type.Object
|
|
&& data.AsGodotObject() is MeetingControlDragData;
|
|
}
|
|
|
|
public override void _DropData(Vector2 atPosition, Variant data)
|
|
{
|
|
var meetingData = (MeetingControlDragData)data;
|
|
|
|
MeetingControl = meetingData.MeetingControl;
|
|
MeetingControl.Reparent(this, false);
|
|
MeetingControl.Visible = true;
|
|
|
|
meetingData.MeetingControl.DragIsHandled = true;
|
|
}
|
|
|
|
public override void _Notification(int what)
|
|
{
|
|
if (what == NotificationDragBegin)
|
|
MouseFilter = MouseFilterEnum.Pass;
|
|
|
|
if (what == NotificationDragEnd)
|
|
MouseFilter = MouseFilterEnum.Ignore;
|
|
}
|
|
}
|