mirror of
https://port.numenaute.org/aleajactaest/khanat-client.git
synced 2024-11-21 22:56:13 +00:00
correct some issue
This commit is contained in:
parent
db3cb83817
commit
70f3ae38c6
33 changed files with 1913 additions and 1898 deletions
BIN
assets/fonts/IMMORTAL.ttf
Normal file
BIN
assets/fonts/IMMORTAL.ttf
Normal file
Binary file not shown.
BIN
icon.png
BIN
icon.png
Binary file not shown.
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 62 KiB |
|
@ -69,7 +69,7 @@ config/icon="res://icon.png"
|
|||
|
||||
[autoload]
|
||||
|
||||
Creatures="*res://ressources/scripts/creatures_old.gd"
|
||||
Creatures="*res://ressources/scripts/creatures.gd"
|
||||
MusicManager="*res://scenes/interfaces/music_manager/music_manager.tscn"
|
||||
Connection="*res://scenes/connection/connection.tscn"
|
||||
Globals="*res://ressources/scripts/global.gd"
|
||||
|
|
85
ressources/scripts/creatures.gd
Normal file
85
ressources/scripts/creatures.gd
Normal file
|
@ -0,0 +1,85 @@
|
|||
extends Node
|
||||
|
||||
class Creature_old2:
|
||||
|
||||
enum Sex { F, M, H, A, U }
|
||||
|
||||
var type
|
||||
var pseudonym
|
||||
|
||||
|
||||
func _init( p_pseudonym = "Créature" ):
|
||||
self.type = "creature"
|
||||
self.pseudonym = p_pseudonym
|
||||
|
||||
|
||||
class Ra_old2 extends Creature_old2:
|
||||
|
||||
|
||||
var sex = Creature_old2.Sex.F
|
||||
|
||||
var female_boobs = 0.0
|
||||
var female_hip = 0.0
|
||||
var male_pack = 0.0
|
||||
var male_throat = 0.0
|
||||
var female_pregnant = 0.0
|
||||
|
||||
var color = Color( 1.0, 1.0, 1.0 )
|
||||
|
||||
var douleur = 0.0
|
||||
var trauma = 0.0
|
||||
var oubli = 0.0
|
||||
|
||||
func _init( p_pseudonym = "Créature" ):
|
||||
self.type = "ra"
|
||||
self.pseudonym = p_pseudonym
|
||||
|
||||
func to_dictionary():
|
||||
|
||||
var dictionary = Dictionary()
|
||||
dictionary[ "type" ] = self.type
|
||||
dictionary[ "pseudonym" ] = self.pseudonym
|
||||
|
||||
dictionary[ "sex" ] = var2str( self.sex )
|
||||
dictionary[ "female_boobs" ] = var2str( self.female_boobs )
|
||||
dictionary[ "female_hip" ] = var2str( self.female_hip )
|
||||
dictionary[ "male_pack" ] = var2str( self.male_pack )
|
||||
dictionary[ "male_throat" ] = var2str( self.male_throat )
|
||||
dictionary[ "female_pregnant" ] = var2str( self.female_pregnant )
|
||||
|
||||
dictionary[ "color" ] = var2str( self.color )
|
||||
|
||||
|
||||
return dictionary
|
||||
|
||||
func from_dictionary( dictionary ):
|
||||
|
||||
self.pseudonym = dictionary.get( "pseudonym", self.pseudonym )
|
||||
|
||||
self.sex = dictionary.get( "sex", self.sex )
|
||||
self.female_boobs = dictionary.get( "female_boobs", self.female_boobs )
|
||||
self.female_hip = dictionary.get( "female_hip", self.female_hip )
|
||||
self.male_pack = dictionary.get( "male_pack", self.male_pack )
|
||||
self.male_throat = dictionary.get( "male_throat", self.male_throat )
|
||||
self.female_pregnant = dictionary.get( "female_pregnant", self.female_pregnant )
|
||||
|
||||
self.color = dictionary.get( "color", self.color )
|
||||
|
||||
func from_file( filename ):
|
||||
var file = File.new()
|
||||
if file.file_exists( "user://creatures/" + filename ):
|
||||
file.open( "user://creatures/" + filename, File.READ )
|
||||
var lines = ""
|
||||
while not file.eof_reached():
|
||||
var current_line = file.get_line()
|
||||
lines += current_line
|
||||
var json = JSON.parse( lines ).result
|
||||
var dict = {}
|
||||
for data in json:
|
||||
dict[ data ] = str2var( json[data] )
|
||||
|
||||
|
||||
self.from_dictionary( dict )
|
||||
|
||||
file.close()
|
||||
|
|
@ -1,85 +0,0 @@
|
|||
extends Node
|
||||
|
||||
class Creature_old2:
|
||||
|
||||
enum Sex { F, M, H, A, U }
|
||||
|
||||
var type
|
||||
var pseudonym
|
||||
|
||||
|
||||
func _init( p_pseudonym = "Créature" ):
|
||||
self.type = "creature"
|
||||
self.pseudonym = p_pseudonym
|
||||
|
||||
|
||||
class Ra_old2 extends Creature_old2:
|
||||
|
||||
|
||||
var sex = Creature_old2.Sex.F
|
||||
|
||||
var female_boobs = 0.0
|
||||
var female_hip = 0.0
|
||||
var male_pack = 0.0
|
||||
var male_throat = 0.0
|
||||
var female_pregnant = 0.0
|
||||
|
||||
var color = Color( 1.0, 1.0, 1.0 )
|
||||
|
||||
var douleur = 0.0
|
||||
var trauma = 0.0
|
||||
var oubli = 0.0
|
||||
|
||||
func _init( p_pseudonym = "Créature" ):
|
||||
self.type = "ra"
|
||||
self.pseudonym = p_pseudonym
|
||||
|
||||
func to_dictionary():
|
||||
|
||||
var dictionary = Dictionary()
|
||||
dictionary[ "type" ] = self.type
|
||||
dictionary[ "pseudonym" ] = self.pseudonym
|
||||
|
||||
dictionary[ "sex" ] = var2str( self.sex )
|
||||
dictionary[ "female_boobs" ] = var2str( self.female_boobs )
|
||||
dictionary[ "female_hip" ] = var2str( self.female_hip )
|
||||
dictionary[ "male_pack" ] = var2str( self.male_pack )
|
||||
dictionary[ "male_throat" ] = var2str( self.male_throat )
|
||||
dictionary[ "female_pregnant" ] = var2str( self.female_pregnant )
|
||||
|
||||
dictionary[ "color" ] = var2str( self.color )
|
||||
|
||||
|
||||
return dictionary
|
||||
|
||||
func from_dictionary( dictionary ):
|
||||
|
||||
self.pseudonym = dictionary.get( "pseudonym", self.pseudonym )
|
||||
|
||||
self.sex = dictionary.get( "sex", self.sex )
|
||||
self.female_boobs = dictionary.get( "female_boobs", self.female_boobs )
|
||||
self.female_hip = dictionary.get( "female_hip", self.female_hip )
|
||||
self.male_pack = dictionary.get( "male_pack", self.male_pack )
|
||||
self.male_throat = dictionary.get( "male_throat", self.male_throat )
|
||||
self.female_pregnant = dictionary.get( "female_pregnant", self.female_pregnant )
|
||||
|
||||
self.color = dictionary.get( "color", self.color )
|
||||
|
||||
func from_file( filename ):
|
||||
var file = File.new()
|
||||
if file.file_exists( "user://creatures/" + filename ):
|
||||
file.open( "user://creatures/" + filename, File.READ )
|
||||
var lines = ""
|
||||
while not file.eof_reached():
|
||||
var current_line = file.get_line()
|
||||
lines += current_line
|
||||
var json = JSON.parse( lines ).result
|
||||
var dict = {}
|
||||
for data in json:
|
||||
dict[ data ] = str2var( json[data] )
|
||||
|
||||
|
||||
self.from_dictionary( dict )
|
||||
|
||||
file.close()
|
||||
|
|
@ -51,18 +51,18 @@ func get_sun_position():
|
|||
return sun_position
|
||||
|
||||
func set_time_of_day(hours, directional_light, horizontal_angle = 0.0):
|
||||
var sun_position = Vector3(0.0, -100.0, 0.0)
|
||||
sun_position = sun_position.rotated(Vector3(1.0, 0.0, 0.0), hours * PI / 12.0)
|
||||
sun_position = sun_position.rotated(Vector3(0.0, 1.0, 0.0), horizontal_angle)
|
||||
var new_position = Vector3(0.0, -100.0, 0.0)
|
||||
new_position = new_position.rotated(Vector3(1.0, 0.0, 0.0), hours * PI / 12.0)
|
||||
new_position = new_position.rotated(Vector3(0.0, 1.0, 0.0), horizontal_angle)
|
||||
|
||||
if directional_light:
|
||||
var t = directional_light.transform
|
||||
t.origin = sun_position
|
||||
t.origin = new_position
|
||||
directional_light.transform = t.looking_at(Vector3(0.0, 0.0, 0.0), Vector3(0.0, 1.0, 0.0))
|
||||
directional_light.light_energy = 1.0 - clamp(abs(hours - 12.0) / 6.0, 0.0, 1.0)
|
||||
|
||||
# and update our sky
|
||||
set_sun_position(sun_position)
|
||||
set_sun_position(new_position)
|
||||
|
||||
|
||||
func set_day_time_hours(hours):
|
||||
|
|
|
@ -33,14 +33,15 @@ func update_model():
|
|||
self.add_child( item_node )
|
||||
|
||||
func set_focus( p_focus = true ):
|
||||
var _item
|
||||
if p_focus:
|
||||
for item in self.get_children():
|
||||
if item.has_node( "focus" ):
|
||||
item.get_node( "focus" ).show()
|
||||
for _item in self.get_children():
|
||||
if _item.has_node( "focus" ):
|
||||
_item.get_node( "focus" ).show()
|
||||
else:
|
||||
for item in self.get_children():
|
||||
if item.has_node( "focus" ):
|
||||
item.get_node( "focus" ).hide()
|
||||
for _item in self.get_children():
|
||||
if _item.has_node( "focus" ):
|
||||
_item.get_node( "focus" ).hide()
|
||||
|
||||
func interact( p_object ):
|
||||
if self.item.get_data( "pickable" ):
|
||||
|
|
|
@ -23,7 +23,8 @@ func _process(_time):
|
|||
if Globals.ressource_queue.is_ready( self.current_scene_path ):
|
||||
print( "LOADING FINISHED")
|
||||
self.set_new_scene( Globals.ressource_queue.get_resource( self.current_scene_path ) )
|
||||
$loading_screen.hide()
|
||||
# $loading_screen.hide()
|
||||
self.stop_progress()
|
||||
else:
|
||||
self.update_progress()
|
||||
$loading_screen.show()
|
||||
|
@ -84,8 +85,9 @@ func set_new_scene( scene_resource ):
|
|||
if scene_resource:
|
||||
self.current_scene = scene_resource.instance()
|
||||
self.get_node("scene").add_child(self.current_scene)
|
||||
self.is_scene_loading = false
|
||||
$loading_screen.hide()
|
||||
# self.is_scene_loading = false
|
||||
self.stop_progress()
|
||||
# $loading_screen.hide()
|
||||
$main_menu.hide()
|
||||
|
||||
if self.has_node( "scene/creatures_menu_ui" ):
|
||||
|
@ -102,11 +104,22 @@ func set_new_scene( scene_resource ):
|
|||
|
||||
func update_progress():
|
||||
var progress = float(Globals.ressource_queue.get_progress( self.current_scene_path ))
|
||||
|
||||
self.get_node("loading_screen/background_player").play("loading")
|
||||
self.get_node("loading_screen/background_player").stop()
|
||||
#self.get_node("loading_screen/background_player").play("loading")
|
||||
#self.get_node("loading_screen/background_player").stop()
|
||||
self.get_node("loading_screen/background_player").seek( (progress*13.0)/100.0 )
|
||||
|
||||
func start_progress():
|
||||
var progress = float(Globals.ressource_queue.get_progress( self.current_scene_path ))
|
||||
self.get_node("loading_screen/background_player").play("loading")
|
||||
#self.get_node("loading_screen/background_player").stop()
|
||||
self.get_node("loading_screen/background_player").seek( 0 )
|
||||
self.is_scene_loading = true
|
||||
$loading_screen.show()
|
||||
|
||||
func stop_progress():
|
||||
self.get_node("loading_screen/background_player").stop()
|
||||
self.is_scene_loading = false
|
||||
$loading_screen.hide()
|
||||
|
||||
func goto_scene( p_path ):
|
||||
|
||||
|
@ -117,7 +130,8 @@ func goto_scene( p_path ):
|
|||
|
||||
Globals.ressource_queue.queue_resource( p_path )
|
||||
self.current_scene_path = p_path
|
||||
self.is_scene_loading = true
|
||||
#self.is_scene_loading = true
|
||||
self.start_progress()
|
||||
|
||||
|
||||
#func set_new_scene( scene_resource ):
|
||||
|
|
Loading…
Reference in a new issue