From 8a25994210ded59a3d78cfd76ec43abb734e9c73 Mon Sep 17 00:00:00 2001 From: AleaJactaEst Date: Sat, 5 Feb 2022 14:14:17 +0100 Subject: [PATCH] update script start-khanat-client.sh to e/force download/uncompress, and disable uncompress if target exist --- maps/basic_setup.tscn | 25 ++++++++++++++++++++++++- player/player.gd | 3 ++- start-khanat-client.sh | 15 ++++++++++++--- 3 files changed, 38 insertions(+), 5 deletions(-) diff --git a/maps/basic_setup.tscn b/maps/basic_setup.tscn index d855086..f949a96 100644 --- a/maps/basic_setup.tscn +++ b/maps/basic_setup.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=13 format=3 uid="uid://cvdmfc2hi172g"] +[gd_scene load_steps=14 format=3 uid="uid://cvdmfc2hi172g"] [ext_resource type="Material" uid="uid://cdijyqa881tvv" path="res://maps/materials/simple_grid_world.material" id="1_h84bv"] [ext_resource type="Material" uid="uid://jrlyuynpu62b" path="res://maps/materials/simple_grid.material" id="1_ympm1"] @@ -6,6 +6,7 @@ [ext_resource type="PackedScene" path="res://maps/cave.tscn" id="4_pc85h"] [ext_resource type="PackedScene" path="res://maps/ramp.tscn" id="5_dfm8h"] [ext_resource type="PackedScene" uid="uid://bkcvep4ijijmc" path="res://maps/water-zone.tscn" id="6_0o80c"] +[ext_resource type="PackedScene" uid="uid://c7sga2ipka52x" path="res://maps/waypoint/waypoint.tscn" id="7_5rpqq"] [sub_resource type="BoxMesh" id="BoxMesh_k23th"] material = ExtResource( "1_h84bv" ) @@ -209,3 +210,25 @@ transform = Transform3D(-0.218552, 0, -0.975825, 0, 1, 0, 0.975825, 0, -0.218552 [node name="water-zone" parent="." instance=ExtResource( "6_0o80c" )] transform = Transform3D(2, 0, 0, 0, 2, 0, 0, 0, 2, -79.9445, 0, 0) + +[node name="RedPoint" type="Position3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -6.73132, 1.60608, 0.625255) + +[node name="RedPoint" parent="RedPoint" instance=ExtResource( "7_5rpqq" )] +modulate = Color(1, 0.192157, 0.156863, 1) +text = "Red Point" + +[node name="BluePoint" type="Position3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.92729, 0.434467, -0.440078) + +[node name="BluePoint" parent="BluePoint" instance=ExtResource( "7_5rpqq" )] +modulate = Color(0.227451, 0.184314, 1, 1) +text = "Blue point" + +[node name="GreenPoint" type="Position3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.217303, 0, -5.77926) + +[node name="GreePoint" parent="GreenPoint" instance=ExtResource( "7_5rpqq" )] +modulate = Color(0.0196078, 1, 0, 1) +text = "Green Point" +sticky = false diff --git a/player/player.gd b/player/player.gd index deedb02..501de33 100644 --- a/player/player.gd +++ b/player/player.gd @@ -75,7 +75,8 @@ func switch_animation(name:String): if name != current_anim and animation_object.has_animation(name): current_anim = name animation_object.play( name ) - animation_object.connect("animation_finished", self._on_AnimationPlayer_animation_finished.bind(name)) + if not animation_object.is_connected("animation_finished", self._on_AnimationPlayer_animation_finished.bind(name)): + animation_object.connect("animation_finished", self._on_AnimationPlayer_animation_finished.bind(name)) func _on_AnimationPlayer_animation_finished(name:String): diff --git a/start-khanat-client.sh b/start-khanat-client.sh index 1aa1c92..28f1b19 100755 --- a/start-khanat-client.sh +++ b/start-khanat-client.sh @@ -3,6 +3,7 @@ declare DEBUG=0 declare HELP=0 declare EDITOR=0 +declare FORCE=0 declare WORKDIR="$(dirname $(readlink -f $0))" declare GODOT_SRC="https://downloads.tuxfamily.org/godotengine/4.0/alpha1/Godot_v4.0-alpha1_linux.64.zip" declare OUTZIP="$WORKDIR/Godot.zip" @@ -30,7 +31,7 @@ function download() { local package="$1" local out="$2" - if [ -f $2 ] + if [[ $FORCE -eq 0 && -f $2 ]] then return 0 fi @@ -64,11 +65,17 @@ function extract() which unzip 1>/dev/null 2>/dev/null if [ $? -eq 0 ] then + fileout=$(unzip -Z1 $compressed_file) + if [[ $FORCE -eq 0 && -f $fileout ]] + then + echo $fileout + return 0 + fi unzip -u $compressed_file -d $WORKDIR 1>&2 if [ $? -eq 0 ] then msg_info "Uncompressed GODOT" - unzip -Z1 $compressed_file + echo $fileout return 0 fi fi @@ -77,7 +84,7 @@ function extract() } -while getopts hdeo:s: flag +while getopts hdeo:s:f flag do case "${flag}" in h) HELP=1;; @@ -85,6 +92,7 @@ do e) EDITOR=1;; o) OUTZIP=${OPTARG};; s) GODOT_SRC=${OPTARG};; + f) FORCE=1;; *) HELP=1;; esac done @@ -97,6 +105,7 @@ $(basename $0) [Option] : Donwload Launch Godot -h : Show help -d : Show debug message -e : Start Godot in editor mode + -f : force download & uncompress -o : target godot file (downloaded) -s : Url to download a specific godot version EOF