From 7fdabe6c781613903915b25bb54b02fc6c02b382 Mon Sep 17 00:00:00 2001 From: rainlizard Date: Wed, 1 Nov 2023 13:28:31 +1100 Subject: [PATCH] custom images, finish fixing right-click bug, brighter selection, fix 1st person angle --- Art/Cursor96x96Blue.png | Bin 490 -> 513 bytes Scenes/Main.tscn | 3 +- Scenes/Player.gd | 31 +++------------- Scenes/Selection.gd | 2 +- Shaders/cursor.shader | 4 +- Shaders/cursorMat.tres | 1 + .../ice_pillar.png.import | 35 ++++++++++++++++++ .../custom-object-images/ice_rock.png.import | 35 ++++++++++++++++++ .../lava_pillar.png.import | 35 ++++++++++++++++++ .../custom-object-images/lava_rock.png.import | 35 ++++++++++++++++++ .../potion_brown.png.import | 35 ++++++++++++++++++ .../potion_red.png.import | 35 ++++++++++++++++++ .../potion_white.png.import | 35 ++++++++++++++++++ .../potion_yellow.png.import | 35 ++++++++++++++++++ .../custom-object-images/rock.png.import | 35 ++++++++++++++++++ .../rock_pillar.png.import | 35 ++++++++++++++++++ 16 files changed, 362 insertions(+), 29 deletions(-) create mode 100644 unearthdata/custom-object-images/ice_pillar.png.import create mode 100644 unearthdata/custom-object-images/ice_rock.png.import create mode 100644 unearthdata/custom-object-images/lava_pillar.png.import create mode 100644 unearthdata/custom-object-images/lava_rock.png.import create mode 100644 unearthdata/custom-object-images/potion_brown.png.import create mode 100644 unearthdata/custom-object-images/potion_red.png.import create mode 100644 unearthdata/custom-object-images/potion_white.png.import create mode 100644 unearthdata/custom-object-images/potion_yellow.png.import create mode 100644 unearthdata/custom-object-images/rock.png.import create mode 100644 unearthdata/custom-object-images/rock_pillar.png.import diff --git a/Art/Cursor96x96Blue.png b/Art/Cursor96x96Blue.png index d7742e28dfe65c7d6946748277c323d05f34127d..0d9036f5d79e0338d57baf4abbccc7ce5d17dbe4 100644 GIT binary patch literal 513 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD1|%QND7OGojKx9jP7LeL$-D%zcYC@xhE&XX zd&|*_IZ=T1q4`_4lld+@S{;W}?)`UBW9|}ARXWDGYvMxziziHmzK3-la0G} z>pffT-h7jNe7E-VUb667+xhSQ-xD_R3*~1%*Z!jXxu&%)W#0M={bxRl{+d|1&&l5C zeE19ZXFs_pQZzSe_NH^;FUlt^TLU#$Uc80-)4Rt_1&;S>V+8b0?C$42#9H~i&~b;t ydpkW2@h5kWvp#Iv^LvLv%!Km6tN7RRfBI#&ep#$Je-;>}3=E#GelF{r5}E+P>h-q( literal 490 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD1|%QND7OGooCO|{#S9GG!XV7ZFl&wkP*5S+ zBgmJ5p-Pp3p`n?9;pcxK{gQ#9)PRBERRRNp)eHs(@%%~gN8K107z;dI978H@y}7k8 z=@5f}%faMOmW2Tm|NMWhx@aLwW7aCeskX*tN4u6kpOR>ycYWot+ab^UcOH8k^7who z^V1=ZbL;Ns7r(t7^t*QL^Y1~ww_V$(`?Y4x*808g`+rB-uMba^IQ3ut|D!Me+~?f; z-*Nf3d|}mpWxx0JM_&Hzx7hn%aQSz8(j@z`P`41{(uav*X!W^1hV4a sP6fRa_CO0U-1PbV|NX#-`Tw7pL1Wc7t-9wmpx9*aboFyt=akR{04q_~aR2}S diff --git a/Scenes/Main.tscn b/Scenes/Main.tscn index 39a82e94..8841284d 100644 --- a/Scenes/Main.tscn +++ b/Scenes/Main.tscn @@ -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 @@ -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 diff --git a/Scenes/Player.gd b/Scenes/Player.gd index 43293fc2..1f124351 100644 --- a/Scenes/Player.gd +++ b/Scenes/Player.gd @@ -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) diff --git a/Scenes/Selection.gd b/Scenes/Selection.gd index 8992f896..a06a5f37 100644 --- a/Scenes/Selection.gd +++ b/Scenes/Selection.gd @@ -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: diff --git a/Shaders/cursor.shader b/Shaders/cursor.shader index f171d91c..ac3f56c8 100644 --- a/Shaders/cursor.shader +++ b/Shaders/cursor.shader @@ -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() { @@ -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; diff --git a/Shaders/cursorMat.tres b/Shaders/cursorMat.tres index 63d681e5..7ae03bb7 100644 --- a/Shaders/cursorMat.tres +++ b/Shaders/cursorMat.tres @@ -5,3 +5,4 @@ [resource] shader = ExtResource( 1 ) shader_param/zoom = 1.0 +shader_param/thickness = 2.0 diff --git a/unearthdata/custom-object-images/ice_pillar.png.import b/unearthdata/custom-object-images/ice_pillar.png.import new file mode 100644 index 00000000..c911fb9a --- /dev/null +++ b/unearthdata/custom-object-images/ice_pillar.png.import @@ -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 diff --git a/unearthdata/custom-object-images/ice_rock.png.import b/unearthdata/custom-object-images/ice_rock.png.import new file mode 100644 index 00000000..e1b064d4 --- /dev/null +++ b/unearthdata/custom-object-images/ice_rock.png.import @@ -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 diff --git a/unearthdata/custom-object-images/lava_pillar.png.import b/unearthdata/custom-object-images/lava_pillar.png.import new file mode 100644 index 00000000..b7425114 --- /dev/null +++ b/unearthdata/custom-object-images/lava_pillar.png.import @@ -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 diff --git a/unearthdata/custom-object-images/lava_rock.png.import b/unearthdata/custom-object-images/lava_rock.png.import new file mode 100644 index 00000000..0730493b --- /dev/null +++ b/unearthdata/custom-object-images/lava_rock.png.import @@ -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 diff --git a/unearthdata/custom-object-images/potion_brown.png.import b/unearthdata/custom-object-images/potion_brown.png.import new file mode 100644 index 00000000..1f13b3ac --- /dev/null +++ b/unearthdata/custom-object-images/potion_brown.png.import @@ -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 diff --git a/unearthdata/custom-object-images/potion_red.png.import b/unearthdata/custom-object-images/potion_red.png.import new file mode 100644 index 00000000..d70c5c09 --- /dev/null +++ b/unearthdata/custom-object-images/potion_red.png.import @@ -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 diff --git a/unearthdata/custom-object-images/potion_white.png.import b/unearthdata/custom-object-images/potion_white.png.import new file mode 100644 index 00000000..a165a5b0 --- /dev/null +++ b/unearthdata/custom-object-images/potion_white.png.import @@ -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 diff --git a/unearthdata/custom-object-images/potion_yellow.png.import b/unearthdata/custom-object-images/potion_yellow.png.import new file mode 100644 index 00000000..1fb54f92 --- /dev/null +++ b/unearthdata/custom-object-images/potion_yellow.png.import @@ -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 diff --git a/unearthdata/custom-object-images/rock.png.import b/unearthdata/custom-object-images/rock.png.import new file mode 100644 index 00000000..566be45a --- /dev/null +++ b/unearthdata/custom-object-images/rock.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/rock.png-f16017d39103eb7586bb63875f1e8adc.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://unearthdata/custom-object-images/rock.png" +dest_files=[ "res://.import/rock.png-f16017d39103eb7586bb63875f1e8adc.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 diff --git a/unearthdata/custom-object-images/rock_pillar.png.import b/unearthdata/custom-object-images/rock_pillar.png.import new file mode 100644 index 00000000..83815f6d --- /dev/null +++ b/unearthdata/custom-object-images/rock_pillar.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/rock_pillar.png-0d1afe74cff59e301f465b8bf94f0509.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://unearthdata/custom-object-images/rock_pillar.png" +dest_files=[ "res://.import/rock_pillar.png-0d1afe74cff59e301f465b8bf94f0509.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