Skip to content

Commit

Permalink
custom images, finish fixing right-click bug, brighter selection, fix…
Browse files Browse the repository at this point in the history
… 1st person angle
  • Loading branch information
rainlizard committed Nov 1, 2023
1 parent a8131f3 commit 7fdabe6
Show file tree
Hide file tree
Showing 16 changed files with 362 additions and 29 deletions.
Binary file modified Art/Cursor96x96Blue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion Scenes/Main.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ shader = ExtResource( 36 )
[sub_resource type="ShaderMaterial" id=9]
shader = ExtResource( 8 )
shader_param/zoom = 1.0
shader_param/thickness = 4.0

[sub_resource type="StyleBoxFlat" id=15]
content_margin_left = 12.0
Expand Down Expand Up @@ -1670,7 +1671,7 @@ custom_colors/font_color_hover = Color( 1, 0.65098, 0.556863, 1 )
custom_colors/font_color_pressed = Color( 0.333333, 0.607843, 1, 1 )
text = "View"
align = 0
items = [ "Map folder", null, 0, false, false, 0, 0, null, "", false, "Script file", null, 0, false, false, 1, 0, null, "", false, "Log file", null, 0, false, false, 2, 0, null, "", false, "", null, 0, false, true, -1, 0, null, "", true, "3D: 1st person", null, 0, false, false, 3, 0, null, "", false, "3D: Overhead", null, 0, false, false, 4, 0, null, "", false, "2D", null, 0, false, false, 5, 0, null, "", false ]
items = [ "Map folder", null, 0, false, false, 0, 0, null, "", false, "Script file", null, 0, false, false, 1, 0, null, "", false, "Log file", null, 0, false, false, 2, 0, null, "", false, "", null, 0, false, true, -1, 0, null, "", true, "3D: 1st person", null, 0, false, false, 3, 0, null, "", false ]
switch_on_hover = true
__meta__ = {
"_edit_use_anchors_": false
Expand Down
31 changes: 6 additions & 25 deletions Scenes/Player.gd
Original file line number Diff line number Diff line change
Expand Up @@ -30,32 +30,13 @@ onready var oCamera2D = $'../../Game2D/Camera2D'

func switch_camera_type(type):
velocity = Vector3(0,0,0) # stop moving

if type == 0: # 3D overhead orthogonal
if oCamera3D.projection == Camera.PROJECTION_PERSPECTIVE:
rememberPerspective = [transform, oHead.transform, oCamera3D.transform]
if rememberOrthogonal != [null,null,null]:
transform = rememberOrthogonal[0]
oHead.transform = rememberOrthogonal[1]
oCamera3D.transform = rememberOrthogonal[2]
else:
# Default orthogonal camera position and rotation
rotation_degrees = Vector3(-45, -135, 0) #Vector2(270, 45, 0)
oHead.rotation_degrees = Vector3(0, 0, 0)
translation = Vector3(0,60,0)

oCamera3D.size = translation.y

oCamera3D.set_orthogonal(oCamera3D.size, -1000000, 1000000)
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)

if type == 1: # 3D 1st person perspective
if oCamera3D.projection == Camera.PROJECTION_ORTHOGONAL:
rememberOrthogonal = [transform, oHead.transform, oCamera3D.transform]
if rememberPerspective != [null,null,null]:
transform = rememberPerspective[0]
oHead.transform = rememberPerspective[1]
oCamera3D.transform = rememberPerspective[2]
if rememberPerspective == [null,null,null]:
oHead.rotation_degrees = Vector3(0,0,0)
else:
transform = rememberPerspective[0]
oHead.transform = rememberPerspective[1]
oCamera3D.transform = rememberPerspective[2]

oCamera3D.set_perspective(oCamera3D.fov, 0.01, 8192)
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
Expand Down
2 changes: 1 addition & 1 deletion Scenes/Selection.gd
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func update_paint():
newPaintSlab(cursorOverSlab)
oPickSlabWindow.set_selection(cursorOverSlab)

if cursorOverSlabOwner != 5 or oOwnableNaturalTerrain.pressed == true:
if cursorOverSlabOwner != 5 or oOwnableNaturalTerrain.pressed == true or Slabs.data[cursorOverSlab][Slabs.IS_OWNABLE] == true:
newOwnership(cursorOverSlabOwner)

oSelector.MODE_SUBTILE:
Expand Down
4 changes: 2 additions & 2 deletions Shaders/cursor.shader
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
shader_type canvas_item;

uniform float zoom = 1.00;

uniform float thickness = 2.00;
const float animationRate = 0.15;

void fragment() {
Expand All @@ -13,7 +13,7 @@ void fragment() {

baseCol.a = 0.0;

float superPixel = max(texel.x, texel.x*zoom)*2.0;
float superPixel = max(texel.x, texel.x*zoom)*thickness;

if ( UV.x <= superPixel ) {
baseCol.a = 1.0;
Expand Down
1 change: 1 addition & 0 deletions Shaders/cursorMat.tres
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
[resource]
shader = ExtResource( 1 )
shader_param/zoom = 1.0
shader_param/thickness = 2.0
35 changes: 35 additions & 0 deletions unearthdata/custom-object-images/ice_pillar.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/ice_pillar.png-c0ab13848d04f073e6ae8198f6638fc4.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://unearthdata/custom-object-images/ice_pillar.png"
dest_files=[ "res://.import/ice_pillar.png-c0ab13848d04f073e6ae8198f6638fc4.stex" ]

[params]

compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=true
flags/anisotropic=true
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0
35 changes: 35 additions & 0 deletions unearthdata/custom-object-images/ice_rock.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/ice_rock.png-64f4931903df685b8bd2954e7649c173.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://unearthdata/custom-object-images/ice_rock.png"
dest_files=[ "res://.import/ice_rock.png-64f4931903df685b8bd2954e7649c173.stex" ]

[params]

compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=true
flags/anisotropic=true
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0
35 changes: 35 additions & 0 deletions unearthdata/custom-object-images/lava_pillar.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/lava_pillar.png-40dedd5cef8c6fd30696dc0566a9d044.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://unearthdata/custom-object-images/lava_pillar.png"
dest_files=[ "res://.import/lava_pillar.png-40dedd5cef8c6fd30696dc0566a9d044.stex" ]

[params]

compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=true
flags/anisotropic=true
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0
35 changes: 35 additions & 0 deletions unearthdata/custom-object-images/lava_rock.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/lava_rock.png-69b497b944d3862e1003d383934dc422.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://unearthdata/custom-object-images/lava_rock.png"
dest_files=[ "res://.import/lava_rock.png-69b497b944d3862e1003d383934dc422.stex" ]

[params]

compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=true
flags/anisotropic=true
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0
35 changes: 35 additions & 0 deletions unearthdata/custom-object-images/potion_brown.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/potion_brown.png-3cbb67415d0ce12260f61d25b2b7a9ef.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://unearthdata/custom-object-images/potion_brown.png"
dest_files=[ "res://.import/potion_brown.png-3cbb67415d0ce12260f61d25b2b7a9ef.stex" ]

[params]

compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=true
flags/anisotropic=true
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0
35 changes: 35 additions & 0 deletions unearthdata/custom-object-images/potion_red.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/potion_red.png-1f6ac617d4b543a5a11f62ac9f32e940.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://unearthdata/custom-object-images/potion_red.png"
dest_files=[ "res://.import/potion_red.png-1f6ac617d4b543a5a11f62ac9f32e940.stex" ]

[params]

compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=true
flags/anisotropic=true
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0
35 changes: 35 additions & 0 deletions unearthdata/custom-object-images/potion_white.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/potion_white.png-6227881eeb5fd0c609939461f2df12dc.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://unearthdata/custom-object-images/potion_white.png"
dest_files=[ "res://.import/potion_white.png-6227881eeb5fd0c609939461f2df12dc.stex" ]

[params]

compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=true
flags/anisotropic=true
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0
35 changes: 35 additions & 0 deletions unearthdata/custom-object-images/potion_yellow.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/potion_yellow.png-e1a537b359a8acc5bc7a16ddb7bb0a6d.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://unearthdata/custom-object-images/potion_yellow.png"
dest_files=[ "res://.import/potion_yellow.png-e1a537b359a8acc5bc7a16ddb7bb0a6d.stex" ]

[params]

compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=true
flags/anisotropic=true
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0
Loading

0 comments on commit 7fdabe6

Please sign in to comment.