From 4579bf5743b48b5849679bc8fbed0142e6709217 Mon Sep 17 00:00:00 2001 From: unfa Date: Sat, 18 Dec 2021 14:45:32 +0100 Subject: [PATCH] Updated AFK icons and implemented AWAY focus state Colored the focus banners to make them more easy to identify at first glance --- Asset Sources/Effects/Busy.svg | 310 ++++++++++++++++-- Game/Assets/Characters/Player.gd | 8 +- Game/Assets/Effects/FocusAway.png | 3 + Game/Assets/Effects/FocusAway.png.import | 37 +++ Game/Assets/Effects/FocusChat.png | 3 + Game/Assets/Effects/FocusChat.png.import | 35 ++ Game/Assets/Effects/FocusMenu.png | 3 + Game/Assets/Effects/FocusMenu.png.import | 37 +++ Game/Assets/Effects/Typing.png | 3 - Game/Assets/HUD/MuteIcon.png | 3 + .../MuteIcon.png.import} | 8 +- Game/Main.gd | 8 + 12 files changed, 421 insertions(+), 37 deletions(-) create mode 100644 Game/Assets/Effects/FocusAway.png create mode 100644 Game/Assets/Effects/FocusAway.png.import create mode 100644 Game/Assets/Effects/FocusChat.png create mode 100644 Game/Assets/Effects/FocusChat.png.import create mode 100644 Game/Assets/Effects/FocusMenu.png create mode 100644 Game/Assets/Effects/FocusMenu.png.import delete mode 100644 Game/Assets/Effects/Typing.png create mode 100644 Game/Assets/HUD/MuteIcon.png rename Game/Assets/{Effects/Typing.png.import => HUD/MuteIcon.png.import} (68%) diff --git a/Asset Sources/Effects/Busy.svg b/Asset Sources/Effects/Busy.svg index 0e8dc9b..ea95559 100644 --- a/Asset Sources/Effects/Busy.svg +++ b/Asset Sources/Effects/Busy.svg @@ -7,9 +7,9 @@ viewBox="0 0 35.691444 35.691444" version="1.1" id="svg5" - inkscape:version="1.1 (c4e8f9ed74, 2021-05-24)" + inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20, custom)" sodipodi:docname="Busy.svg" - inkscape:export-filename="/data/Projects/Games/Liblast/Game/Assets/Effects/Typing.png" + inkscape:export-filename="/data/Projects/Games/Liblast/Game/Assets/Effects/FocusAway.png" inkscape:export-xdpi="182.1837" inkscape:export-ydpi="182.1837" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" @@ -31,12 +31,12 @@ fit-margin-left="0" fit-margin-right="0" fit-margin-bottom="0" - inkscape:zoom="2.0000001" - inkscape:cx="20.499999" - inkscape:cy="76.499998" + inkscape:zoom="2.8284273" + inkscape:cx="118.44038" + inkscape:cy="42.779958" inkscape:window-width="1920" - inkscape:window-height="1051" - inkscape:window-x="1920" + inkscape:window-height="1003" + inkscape:window-x="0" inkscape:window-y="0" inkscape:window-maximized="1" inkscape:current-layer="layer2" /> @@ -58,7 +58,7 @@ Z Z + style="font-weight:bold;stroke:#d5e5ff;stroke-width:7.14732;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;paint-order:markers stroke fill">Z Z + style="font-weight:bold;stroke:#d5e5ff;stroke-width:5.06089;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;paint-order:markers stroke fill">Z Z + style="font-weight:bold;stroke:#d5e5ff;stroke-width:3.44247;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;paint-order:markers stroke fill">Z + inkscape:label="Chat" + transform="translate(-25.239306,-69.836283)" + style="display:none" + sodipodi:insensitive="true"> AFK Z Z @@ -480,4 +482,258 @@ y="58.153423" style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';stroke-width:1.00563">%$^#! + + AFK + Lag + + + Chat + + + + + + + + + + + + + + + + + + + + + + Z + Z + + + AFK + diff --git a/Game/Assets/Characters/Player.gd b/Game/Assets/Characters/Player.gd index 3a75863..e34ef56 100644 --- a/Game/Assets/Characters/Player.gd +++ b/Game/Assets/Characters/Player.gd @@ -24,8 +24,9 @@ var health = max_health: @onready var crosshair = hud.get_node("Crosshair") @onready var vignette = hud.get_node("Vignette") -@onready var banner_busy = preload("res://Assets/Effects/Busy.png") -@onready var banner_chat = preload("res://Assets/Effects/Typing.png") +@onready var banner_menu = preload("res://Assets/Effects/FocusMenu.png") +@onready var banner_chat = preload("res://Assets/Effects/FocusChat.png") +@onready var banner_away = preload("res://Assets/Effects/FocusAway.png") @onready var head = $Head @onready var camera = $Head/Camera @@ -153,8 +154,9 @@ func view_banner(show:bool): $FocusBanner.hide() match type: - 0: $FocusBanner.mesh.surface_get_material(0).set("albedo_texture", banner_busy) + 0: $FocusBanner.mesh.surface_get_material(0).set("albedo_texture", banner_menu) 1: $FocusBanner.mesh.surface_get_material(0).set("albedo_texture", banner_chat) + 2: $FocusBanner.mesh.surface_get_material(0).set("albedo_texture", banner_away) @rpc(authority, unreliable) func update_movement(player_transform, head_rotation, lin_velocity, jetpack): diff --git a/Game/Assets/Effects/FocusAway.png b/Game/Assets/Effects/FocusAway.png new file mode 100644 index 0000000..fa7be95 --- /dev/null +++ b/Game/Assets/Effects/FocusAway.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a93e0383b676c9a9b9277ebfe268f0acc5672a2d5e4e3c24b0edd91c799c3208 +size 15627 diff --git a/Game/Assets/Effects/FocusAway.png.import b/Game/Assets/Effects/FocusAway.png.import new file mode 100644 index 0000000..1a81402 --- /dev/null +++ b/Game/Assets/Effects/FocusAway.png.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="StreamTexture2D" +uid="uid://bbbxc8du7ercf" +path.s3tc="res://.godot/imported/FocusAway.png-4fcaf53d1542396a96f4ef05152c3816.s3tc.stex" +path.etc2="res://.godot/imported/FocusAway.png-4fcaf53d1542396a96f4ef05152c3816.etc2.stex" +metadata={ +"imported_formats": ["s3tc", "etc2"], +"vram_texture": true +} + +[deps] + +source_file="res://Assets/Effects/FocusAway.png" +dest_files=["res://.godot/imported/FocusAway.png-4fcaf53d1542396a96f4ef05152c3816.s3tc.stex", "res://.godot/imported/FocusAway.png-4fcaf53d1542396a96f4ef05152c3816.etc2.stex"] + +[params] + +compress/mode=2 +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/bptc_ldr=0 +compress/normal_map=0 +compress/channel_pack=0 +compress/streamed=false +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/HDR_as_SRGB=false +process/size_limit=0 +detect_3d/compress_to=0 +svg/scale=1.0 diff --git a/Game/Assets/Effects/FocusChat.png b/Game/Assets/Effects/FocusChat.png new file mode 100644 index 0000000..ac8367b --- /dev/null +++ b/Game/Assets/Effects/FocusChat.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:69d79686b9b71fe141cab499b9c43e962c6c1e701ecb635acfa983e5f970c78d +size 17896 diff --git a/Game/Assets/Effects/FocusChat.png.import b/Game/Assets/Effects/FocusChat.png.import new file mode 100644 index 0000000..da69aa8 --- /dev/null +++ b/Game/Assets/Effects/FocusChat.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture2D" +uid="uid://cl5ctxbfxnr48" +path="res://.godot/imported/FocusChat.png-9c56aa44a1a79d9c265aede1021377f0.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/Effects/FocusChat.png" +dest_files=["res://.godot/imported/FocusChat.png-9c56aa44a1a79d9c265aede1021377f0.stex"] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/bptc_ldr=0 +compress/normal_map=0 +compress/channel_pack=0 +compress/streamed=false +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/HDR_as_SRGB=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 diff --git a/Game/Assets/Effects/FocusMenu.png b/Game/Assets/Effects/FocusMenu.png new file mode 100644 index 0000000..13f2400 --- /dev/null +++ b/Game/Assets/Effects/FocusMenu.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4df4c0264b8c5d8cc8762227d53d2a2edbfc6530a4c3418d2e1e130306fc67fa +size 15988 diff --git a/Game/Assets/Effects/FocusMenu.png.import b/Game/Assets/Effects/FocusMenu.png.import new file mode 100644 index 0000000..b9f86c7 --- /dev/null +++ b/Game/Assets/Effects/FocusMenu.png.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="StreamTexture2D" +uid="uid://bf7idsht43ljr" +path.s3tc="res://.godot/imported/FocusMenu.png-93dd3dd10ffa571e5294f3be1c2c96b7.s3tc.stex" +path.etc2="res://.godot/imported/FocusMenu.png-93dd3dd10ffa571e5294f3be1c2c96b7.etc2.stex" +metadata={ +"imported_formats": ["s3tc", "etc2"], +"vram_texture": true +} + +[deps] + +source_file="res://Assets/Effects/FocusMenu.png" +dest_files=["res://.godot/imported/FocusMenu.png-93dd3dd10ffa571e5294f3be1c2c96b7.s3tc.stex", "res://.godot/imported/FocusMenu.png-93dd3dd10ffa571e5294f3be1c2c96b7.etc2.stex"] + +[params] + +compress/mode=2 +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/bptc_ldr=0 +compress/normal_map=0 +compress/channel_pack=0 +compress/streamed=false +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/HDR_as_SRGB=false +process/size_limit=0 +detect_3d/compress_to=0 +svg/scale=1.0 diff --git a/Game/Assets/Effects/Typing.png b/Game/Assets/Effects/Typing.png deleted file mode 100644 index cb9ca8f..0000000 --- a/Game/Assets/Effects/Typing.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a7dfbd1955c1de3f811c516ae9cbae3e97b3174bab9b266667db60f3e4e2e775 -size 16132 diff --git a/Game/Assets/HUD/MuteIcon.png b/Game/Assets/HUD/MuteIcon.png new file mode 100644 index 0000000..13a808d --- /dev/null +++ b/Game/Assets/HUD/MuteIcon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:91b03c1e33851f638b8cfc32fabd4b908de2fd3edb141a6d2d522c9eb5624926 +size 1302 diff --git a/Game/Assets/Effects/Typing.png.import b/Game/Assets/HUD/MuteIcon.png.import similarity index 68% rename from Game/Assets/Effects/Typing.png.import rename to Game/Assets/HUD/MuteIcon.png.import index 436e536..c0dc484 100644 --- a/Game/Assets/Effects/Typing.png.import +++ b/Game/Assets/HUD/MuteIcon.png.import @@ -2,16 +2,16 @@ importer="texture" type="StreamTexture2D" -uid="uid://b1bf2ni3gggce" -path="res://.godot/imported/Typing.png-cfa6ed9a5a612bb50eac93e4420acb28.stex" +uid="uid://nvmxqamvgmwl" +path="res://.godot/imported/MuteIcon.png-9cd8d91785fe3bea8c53fe212e36d908.stex" metadata={ "vram_texture": false } [deps] -source_file="res://Assets/Effects/Typing.png" -dest_files=["res://.godot/imported/Typing.png-cfa6ed9a5a612bb50eac93e4420acb28.stex"] +source_file="res://Assets/HUD/MuteIcon.png" +dest_files=["res://.godot/imported/MuteIcon.png-9cd8d91785fe3bea8c53fe212e36d908.stex"] [params] diff --git a/Game/Main.gd b/Game/Main.gd index 0f4d500..8719b0a 100644 --- a/Game/Main.gd +++ b/Game/Main.gd @@ -22,6 +22,8 @@ var player_scene = preload("res://Assets/Characters/Player.tscn") @onready var chat = hud.get_node("Chat") var local_player: Node = null +var local_player_focus_previous: GameFocus # to store focus that should be set after AWAY is gone + class PlayerInfo: var name: String var team: int @@ -81,9 +83,15 @@ func _notification(what: int) -> void: match what: NOTIFICATION_APPLICATION_FOCUS_OUT: Engine.target_fps = 5 + if local_player: + local_player_focus_previous = focus + focus = GameFocus.AWAY + NOTIFICATION_APPLICATION_FOCUS_IN: # `0` means "unlimited". Engine.target_fps = 0 + if local_player: + focus = local_player_focus_previous func _process(delta): uptime += delta