Finished first EA Version #1
Binary file not shown.
Binary file not shown.
@@ -96,6 +96,11 @@ text = "19:20"
|
|||||||
fit_content = true
|
fit_content = true
|
||||||
autowrap_mode = 0
|
autowrap_mode = 0
|
||||||
|
|
||||||
|
[node name="LightColor" type="ColorPickerButton" parent="Control/MainUI/HeaderContainer/Header" unique_id=395026790]
|
||||||
|
layout_mode = 2
|
||||||
|
theme_override_colors/font_color = Color(1, 1, 1, 1)
|
||||||
|
text = "Choose Color..."
|
||||||
|
|
||||||
[node name="Content" type="Control" parent="Control/MainUI" unique_id=45665557]
|
[node name="Content" type="Control" parent="Control/MainUI" unique_id=45665557]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_vertical = 3
|
size_flags_vertical = 3
|
||||||
@@ -138,3 +143,5 @@ layout_mode = 2
|
|||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
size_flags_vertical = 3
|
size_flags_vertical = 3
|
||||||
theme_override_constants/separation = 10
|
theme_override_constants/separation = 10
|
||||||
|
|
||||||
|
[connection signal="color_changed" from="Control/MainUI/HeaderContainer/Header/LightColor" to="Control" method="ChangeColor"]
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
using Godot;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public class LightHandler
|
||||||
|
{
|
||||||
|
public static List<OmniLight3D> lights = new ();
|
||||||
|
|
||||||
|
public static void RedrawLights(Color color)
|
||||||
|
{
|
||||||
|
foreach(OmniLight3D light in lights)
|
||||||
|
{
|
||||||
|
light.LightColor = color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
uid://b150nxl3cc3ck
|
||||||
@@ -4,7 +4,7 @@ public partial class UIHandler : Control
|
|||||||
{
|
{
|
||||||
public override void _Ready()
|
public override void _Ready()
|
||||||
{
|
{
|
||||||
|
GetNode<ColorPickerButton>("./MainUI/HeaderContainer/Header/LightColor").Color = GameData.lightColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called every frame. 'delta' is the elapsed time since the previous frame.
|
// Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
@@ -13,4 +13,10 @@ public partial class UIHandler : Control
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ChangeColor(Color color)
|
||||||
|
{
|
||||||
|
GameData.lightColor = color;
|
||||||
|
LightHandler.RedrawLights(color);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-2
@@ -104,6 +104,7 @@ public partial class Tile
|
|||||||
Position = placeholder.transform.Origin
|
Position = placeholder.transform.Origin
|
||||||
};
|
};
|
||||||
lightSource.Position.MoveToward(transform.Origin, 0.1f);
|
lightSource.Position.MoveToward(transform.Origin, 0.1f);
|
||||||
|
LightHandler.lights.Add(lightSource);
|
||||||
light.AddChild(lightSource);
|
light.AddChild(lightSource);
|
||||||
ContentNode.AddChild(light);
|
ContentNode.AddChild(light);
|
||||||
light.LookAt(transform.Origin, Vector3.Up);
|
light.LookAt(transform.Origin, Vector3.Up);
|
||||||
@@ -111,14 +112,13 @@ public partial class Tile
|
|||||||
|
|
||||||
private void SpawnResource(MeshInstance3D resourceMesh, Placeholder placeholder, Transform3D transform)
|
private void SpawnResource(MeshInstance3D resourceMesh, Placeholder placeholder, Transform3D transform)
|
||||||
{
|
{
|
||||||
Vector3 forward = (transform.Origin - placeholder.transform.Origin).Normalized();
|
|
||||||
MeshInstance3D resource = new MeshInstance3D
|
MeshInstance3D resource = new MeshInstance3D
|
||||||
{
|
{
|
||||||
Mesh = resourceMesh.Mesh,
|
Mesh = resourceMesh.Mesh,
|
||||||
Position = placeholder.transform.Origin
|
Position = placeholder.transform.Origin
|
||||||
};
|
};
|
||||||
ContentNode.AddChild(resource);
|
ContentNode.AddChild(resource);
|
||||||
resource.LookAt(resource.Position + forward, Vector3.Up);
|
resource.LookAt(transform.Origin, Vector3.Up);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SpawnDecorations(Dictionary<string, MeshInstance3D> contentMeshes, Placeholder placeholder, Transform3D transform)
|
private void SpawnDecorations(Dictionary<string, MeshInstance3D> contentMeshes, Placeholder placeholder, Transform3D transform)
|
||||||
@@ -132,6 +132,7 @@ public partial class Tile
|
|||||||
Position = placeholder.transform.Origin
|
Position = placeholder.transform.Origin
|
||||||
};
|
};
|
||||||
ContentNode.AddChild(decoration);
|
ContentNode.AddChild(decoration);
|
||||||
|
decoration.LookAt(transform.Origin, Vector3.Up);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -141,7 +141,7 @@ public partial class World : Node3D
|
|||||||
|
|
||||||
int posX, posY;
|
int posX, posY;
|
||||||
|
|
||||||
while(currentLight < layerSize * layerSize / 2)
|
while(currentLight < layerSize * layerSize / 4)
|
||||||
{
|
{
|
||||||
posX = rand.Next(layerSize);
|
posX = rand.Next(layerSize);
|
||||||
posY = rand.Next(layerSize);
|
posY = rand.Next(layerSize);
|
||||||
|
|||||||
Reference in New Issue
Block a user