update script start-khanat-client.sh to e/force download/uncompress, and disable uncompress if target exist

This commit is contained in:
AleaJactaEst 2022-02-05 14:14:17 +01:00
parent 0aa8caa4b2
commit 8a25994210
3 changed files with 38 additions and 5 deletions

View file

@ -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://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"] [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/cave.tscn" id="4_pc85h"]
[ext_resource type="PackedScene" path="res://maps/ramp.tscn" id="5_dfm8h"] [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://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"] [sub_resource type="BoxMesh" id="BoxMesh_k23th"]
material = ExtResource( "1_h84bv" ) 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" )] [node name="water-zone" parent="." instance=ExtResource( "6_0o80c" )]
transform = Transform3D(2, 0, 0, 0, 2, 0, 0, 0, 2, -79.9445, 0, 0) 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

View file

@ -75,7 +75,8 @@ func switch_animation(name:String):
if name != current_anim and animation_object.has_animation(name): if name != current_anim and animation_object.has_animation(name):
current_anim = name current_anim = name
animation_object.play( 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): func _on_AnimationPlayer_animation_finished(name:String):

View file

@ -3,6 +3,7 @@
declare DEBUG=0 declare DEBUG=0
declare HELP=0 declare HELP=0
declare EDITOR=0 declare EDITOR=0
declare FORCE=0
declare WORKDIR="$(dirname $(readlink -f $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 GODOT_SRC="https://downloads.tuxfamily.org/godotengine/4.0/alpha1/Godot_v4.0-alpha1_linux.64.zip"
declare OUTZIP="$WORKDIR/Godot.zip" declare OUTZIP="$WORKDIR/Godot.zip"
@ -30,7 +31,7 @@ function download()
{ {
local package="$1" local package="$1"
local out="$2" local out="$2"
if [ -f $2 ] if [[ $FORCE -eq 0 && -f $2 ]]
then then
return 0 return 0
fi fi
@ -64,11 +65,17 @@ function extract()
which unzip 1>/dev/null 2>/dev/null which unzip 1>/dev/null 2>/dev/null
if [ $? -eq 0 ] if [ $? -eq 0 ]
then 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 unzip -u $compressed_file -d $WORKDIR 1>&2
if [ $? -eq 0 ] if [ $? -eq 0 ]
then then
msg_info "Uncompressed GODOT" msg_info "Uncompressed GODOT"
unzip -Z1 $compressed_file echo $fileout
return 0 return 0
fi fi
fi fi
@ -77,7 +84,7 @@ function extract()
} }
while getopts hdeo:s: flag while getopts hdeo:s:f flag
do do
case "${flag}" in case "${flag}" in
h) HELP=1;; h) HELP=1;;
@ -85,6 +92,7 @@ do
e) EDITOR=1;; e) EDITOR=1;;
o) OUTZIP=${OPTARG};; o) OUTZIP=${OPTARG};;
s) GODOT_SRC=${OPTARG};; s) GODOT_SRC=${OPTARG};;
f) FORCE=1;;
*) HELP=1;; *) HELP=1;;
esac esac
done done
@ -97,6 +105,7 @@ $(basename $0) [Option] : Donwload Launch Godot
-h : Show help -h : Show help
-d : Show debug message -d : Show debug message
-e : Start Godot in editor mode -e : Start Godot in editor mode
-f : force download & uncompress
-o <File> : target godot file (downloaded) -o <File> : target godot file (downloaded)
-s <Url> : Url to download a specific godot version -s <Url> : Url to download a specific godot version
EOF EOF