gefällt mir
This commit is contained in:
78
Main.tscn
78
Main.tscn
@@ -2,7 +2,15 @@
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://dciugg77wsy6p" path="res://MeetingPhysicsBox.tscn" id="1_glv2v"]
|
||||
[ext_resource type="PackedScene" uid="uid://nnr6u0igggve" path="res://TimeSlot.tscn" id="1_uu6xs"]
|
||||
[ext_resource type="Resource" uid="uid://mifwco1yj8kc" path="res://meetings/coffee_meeting.tres" id="3_r0du0"]
|
||||
[ext_resource type="Resource" uid="uid://mifwco1yj8kc" path="res://resources/meetings/coffee_meeting.tres" id="3_r0du0"]
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_sko1m"]
|
||||
font_size = 64
|
||||
stacked_outline_count = 1
|
||||
stacked_shadow_count = 1
|
||||
stacked_outline_0/size = 9
|
||||
stacked_shadow_0/offset = Vector2(4, 4)
|
||||
stacked_shadow_0/outline_size = 2
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_50jir"]
|
||||
|
||||
@@ -14,6 +22,37 @@ size = Vector2(21.5, 1920)
|
||||
|
||||
[node name="Main" type="Node2D" unique_id=287617203]
|
||||
|
||||
[node name="CanvasLayer" type="CanvasLayer" parent="." unique_id=1328071901]
|
||||
|
||||
[node name="Control" type="Control" parent="CanvasLayer" unique_id=947212855]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
|
||||
[node name="Day" type="Label" parent="CanvasLayer/Control" unique_id=1593831007]
|
||||
layout_mode = 1
|
||||
offset_left = 142.0
|
||||
offset_right = 260.0
|
||||
offset_bottom = 88.0
|
||||
text = "Day"
|
||||
label_settings = SubResource("LabelSettings_sko1m")
|
||||
|
||||
[node name="Inbox" type="Label" parent="CanvasLayer/Control" unique_id=163179205]
|
||||
layout_mode = 1
|
||||
anchors_preset = 1
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
offset_left = -464.0
|
||||
offset_right = -290.0
|
||||
offset_bottom = 88.0
|
||||
grow_horizontal = 0
|
||||
text = "Inbox"
|
||||
label_settings = SubResource("LabelSettings_sko1m")
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="." unique_id=1636973054]
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
@@ -21,9 +60,9 @@ anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = 96.0
|
||||
offset_top = 93.0
|
||||
offset_top = 114.0
|
||||
offset_right = 302.0
|
||||
offset_bottom = 553.0
|
||||
offset_bottom = 574.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
@@ -85,14 +124,41 @@ position = Vector2(1120, -339)
|
||||
shape = SubResource("RectangleShape2D_ig7tw")
|
||||
|
||||
[node name="Meeting" parent="." unique_id=796440984 instance=ExtResource("1_glv2v")]
|
||||
position = Vector2(654, 130)
|
||||
position = Vector2(634, -454)
|
||||
MeetingResource = ExtResource("3_r0du0")
|
||||
|
||||
[node name="Meeting4" parent="." unique_id=1960552374 instance=ExtResource("1_glv2v")]
|
||||
position = Vector2(707, -340)
|
||||
rotation = 0.24779713
|
||||
|
||||
[node name="Meeting5" parent="." unique_id=1692042144 instance=ExtResource("1_glv2v")]
|
||||
position = Vector2(851, -500)
|
||||
rotation = 0.24779713
|
||||
|
||||
[node name="Meeting6" parent="." unique_id=2120697586 instance=ExtResource("1_glv2v")]
|
||||
position = Vector2(604, -619.99994)
|
||||
rotation = 0.24779713
|
||||
MeetingResource = ExtResource("3_r0du0")
|
||||
|
||||
[node name="Meeting7" parent="." unique_id=2144014406 instance=ExtResource("1_glv2v")]
|
||||
position = Vector2(857, -661)
|
||||
rotation = 0.24779713
|
||||
MeetingResource = ExtResource("3_r0du0")
|
||||
|
||||
[node name="Meeting8" parent="." unique_id=1157887697 instance=ExtResource("1_glv2v")]
|
||||
position = Vector2(964, -555)
|
||||
rotation = 0.24779713
|
||||
|
||||
[node name="Meeting9" parent="." unique_id=1055632102 instance=ExtResource("1_glv2v")]
|
||||
position = Vector2(614, -732.99994)
|
||||
rotation = 0.24779713
|
||||
|
||||
[node name="Meeting2" parent="." unique_id=1691479453 instance=ExtResource("1_glv2v")]
|
||||
position = Vector2(957, 231.99998)
|
||||
position = Vector2(937, -352)
|
||||
rotation = -0.5541229
|
||||
MeetingResource = ExtResource("3_r0du0")
|
||||
|
||||
[node name="Meeting3" parent="." unique_id=673551448 instance=ExtResource("1_glv2v")]
|
||||
position = Vector2(782.9999, 402.99997)
|
||||
position = Vector2(762.9999, -181.00012)
|
||||
rotation = -0.18364333
|
||||
MeetingResource = ExtResource("3_r0du0")
|
||||
|
||||
@@ -15,8 +15,8 @@ public partial class MeetingControl : Control
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
Modulate = MeetingPhysicsBox.MeetingResource.Color;
|
||||
MeetingControlGfx.MeetingTitle.Text = MeetingPhysicsBox.MeetingResource.Title;
|
||||
// TODO: make this more pretty
|
||||
MeetingControlGfx.MeetingResource = MeetingPhysicsBox.MeetingResource;
|
||||
}
|
||||
|
||||
public override Variant _GetDragData(Vector2 atPosition)
|
||||
|
||||
@@ -4,8 +4,22 @@ using Godot;
|
||||
[SceneTree]
|
||||
public partial class MeetingControlGfx : PanelContainer
|
||||
{
|
||||
public void SetMeetingTitle(string title)
|
||||
private MeetingResource _meetingResource;
|
||||
|
||||
public MeetingResource MeetingResource
|
||||
{
|
||||
MeetingTitle.Text = title;
|
||||
get => _meetingResource;
|
||||
set
|
||||
{
|
||||
_meetingResource = value;
|
||||
|
||||
UpdateGfx();
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateGfx()
|
||||
{
|
||||
SelfModulate = MeetingResource.Color;
|
||||
MeetingTitle.Text = MeetingResource.Title;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
using System;
|
||||
using Godot;
|
||||
using yourareanaiceo;
|
||||
|
||||
[SceneTree]
|
||||
public partial class MeetingPhysicsBox : RigidBody2D
|
||||
@@ -15,12 +13,10 @@ public partial class MeetingPhysicsBox : RigidBody2D
|
||||
public override void _Ready()
|
||||
{
|
||||
FreezeMode = FreezeModeEnum.Kinematic;
|
||||
Modulate = MeetingResource.Color;
|
||||
|
||||
MeetingControlGfx.MeetingTitle.Text = MeetingResource.Title;
|
||||
|
||||
MouseEntered += () =>
|
||||
{
|
||||
GD.Print("Mouse Entered");
|
||||
_mouseInside = true;
|
||||
CanSleep = false;
|
||||
};
|
||||
@@ -29,11 +25,14 @@ public partial class MeetingPhysicsBox : RigidBody2D
|
||||
_mouseInside = false;
|
||||
CanSleep = true;
|
||||
};
|
||||
|
||||
MeetingControlGfx.MeetingResource = MeetingResource;
|
||||
}
|
||||
|
||||
public override void _UnhandledInput(InputEvent @event)
|
||||
{
|
||||
// TODO: probably memory problem
|
||||
using (@event)
|
||||
{
|
||||
if (@event is InputEventMouse mouseEvent)
|
||||
{
|
||||
if (_mouseInside)
|
||||
@@ -46,6 +45,7 @@ public partial class MeetingPhysicsBox : RigidBody2D
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void _PhysicsProcess(double delta)
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[gd_resource type="Resource" script_class="MeetingResource" format=3 uid="uid://mifwco1yj8kc"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cuq38lbfa2v74" path="res://MeetingResource.cs" id="1_s1cac"]
|
||||
[ext_resource type="Script" uid="uid://cuq38lbfa2v74" path="res://resources/MeetingResource.cs" id="1_s1cac"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_s1cac")
|
||||
Reference in New Issue
Block a user