mirror of
https://github.com/Nokorpo/LibreAim.git
synced 2025-06-11 10:18:28 +09:00
Merge branch 'erkkon'
This commit is contained in:
commit
feec0e91fb
8 changed files with 93 additions and 31 deletions
|
@ -26,8 +26,7 @@ DataManager="*res://scripts/data_manager.gd"
|
|||
|
||||
window/size/viewport_width=3840
|
||||
window/size/viewport_height=2160
|
||||
window/size/mode=3
|
||||
window/size/borderless=true
|
||||
window/size/mode=2
|
||||
window/stretch/mode="viewport"
|
||||
window/stretch/aspect="expand"
|
||||
|
||||
|
@ -72,3 +71,8 @@ esc={
|
|||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194305,"key_label":0,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
f_pressed={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":70,"key_label":0,"unicode":102,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
|
|
0
scenes/levels/World.gdshader
Normal file
0
scenes/levels/World.gdshader
Normal file
|
@ -1,8 +1,7 @@
|
|||
[gd_scene load_steps=19 format=3 uid="uid://cdbhv0p0jfr75"]
|
||||
[gd_scene load_steps=18 format=3 uid="uid://cdbhv0p0jfr75"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/levels/World.gd" id="1_02ggb"]
|
||||
[ext_resource type="Script" path="res://scripts/characters/CharacterBody3D.gd" id="1_77co2"]
|
||||
[ext_resource type="Texture2D" uid="uid://mhv5qf7fdeig" path="res://assets/images/texture_08.png" id="1_s1bsx"]
|
||||
[ext_resource type="Script" path="res://scripts/ui/Crosshair.gd" id="4_jkxyl"]
|
||||
[ext_resource type="Script" path="res://scripts/levels/Pause.gd" id="5_4wxgd"]
|
||||
[ext_resource type="LabelSettings" uid="uid://crnxcugovdaio" path="res://assets/fonts/100_outline.tres" id="5_k01xn"]
|
||||
|
@ -21,7 +20,6 @@ tonemap_mode = 2
|
|||
glow_enabled = true
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_glx82"]
|
||||
albedo_texture = ExtResource("1_s1bsx")
|
||||
uv1_scale = Vector3(0.1, 0.1, 0.1)
|
||||
uv1_triplanar = true
|
||||
|
||||
|
@ -83,10 +81,8 @@ _data = {
|
|||
[node name="World" type="Node3D"]
|
||||
script = ExtResource("1_02ggb")
|
||||
|
||||
[node name="OmniLight3D" type="OmniLight3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, -0.920764, -0.390121, 0, 0.390121, -0.920764, 0, 19.0056, 0)
|
||||
omni_range = 150.0
|
||||
omni_attenuation = 0.0179484
|
||||
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 0.5, 0.866025, 0, -0.866025, 0.5, 0, 80, 0)
|
||||
|
||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
||||
environment = SubResource("Environment_mlohy")
|
||||
|
@ -248,9 +244,43 @@ text = "Resume"
|
|||
layout_mode = 2
|
||||
text = "Menu"
|
||||
|
||||
[node name="FullScreenRequest" type="Control" parent="CanvasLayer"]
|
||||
process_mode = 2
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="CanvasLayer/FullScreenRequest"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
color = Color(0.0745098, 0.0745098, 0.0745098, 0.34902)
|
||||
|
||||
[node name="FullScreenNeeded" type="Button" parent="CanvasLayer/FullScreenRequest"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -503.5
|
||||
offset_top = -60.0
|
||||
offset_right = 503.5
|
||||
offset_bottom = 60.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
text = "Press \"F\". Full screen is needed."
|
||||
|
||||
[node name="Timer" type="Timer" parent="."]
|
||||
|
||||
[connection signal="pause_game" from="Player" to="CanvasLayer/Pause" method="_on_player_pause_game"]
|
||||
[connection signal="pressed" from="CanvasLayer/Pause/Buttons/Resume" to="CanvasLayer/Pause" method="_on_resume_pressed"]
|
||||
[connection signal="pressed" from="CanvasLayer/Pause/Buttons/Menu" to="CanvasLayer/Pause" method="_on_menu_pressed"]
|
||||
[connection signal="pressed" from="CanvasLayer/FullScreenRequest/FullScreenNeeded" to="." method="_on_full_screen_needed_pressed"]
|
||||
[connection signal="timeout" from="Timer" to="Player" method="_on_timer_timeout"]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
extends CharacterBody3D
|
||||
|
||||
signal pause_game(is_paused)
|
||||
signal pause_game
|
||||
|
||||
const SPEED = 20.0
|
||||
const JUMP_VELOCITY = 25
|
||||
|
@ -25,12 +25,12 @@ var direction = Vector3()
|
|||
@onready var timer = $"../Timer"
|
||||
@onready var timer_label = $Head/Timer
|
||||
@onready var bullet_hole = preload("res://scenes/ui/BulletHole.tscn")
|
||||
|
||||
@onready var paused = $"../CanvasLayer/Pause"
|
||||
# Get the gravity from the project settings to be synced with RigidBody nodes.
|
||||
var gravity = ProjectSettings.get_setting("physics/3d/default_gravity")
|
||||
|
||||
func _ready():
|
||||
emit_signal("pause_game", false)
|
||||
paused.visible = false
|
||||
timer_label.set_text((str(seconds) + "s"))
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
|
||||
if DataManager.get_data("sensitivity_game_value"):
|
||||
|
@ -63,7 +63,7 @@ func _input(event):
|
|||
camera.rotation.x = clamp(camera.rotation.x, deg_to_rad(-89), deg_to_rad(89))
|
||||
else:
|
||||
if event.is_action_pressed("ui_cancel"):
|
||||
emit_signal("pause_game", true)
|
||||
emit_signal("pause_game")
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
extends Node
|
||||
|
||||
const IS_WEB_EXPORTED = false
|
||||
|
||||
func string_to_vector3d(string_vector: String) -> Vector3:
|
||||
var components_str = string_vector.substr(1, string_vector.length() - 2)
|
||||
|
|
|
@ -1,27 +1,33 @@
|
|||
extends Control
|
||||
|
||||
@onready var full_screen_needed = $"../FullScreenRequest"
|
||||
# Declare member variables here. Examples:
|
||||
# var a = 2
|
||||
# var b = "text"
|
||||
var the_new_pause_state = false
|
||||
|
||||
#
|
||||
#func _input(event):
|
||||
# if event.is_action_pressed("ui_cancel"):
|
||||
# trigger_pause(not get_tree().paused)
|
||||
|
||||
func _process(_delta):
|
||||
if Input.is_action_pressed("f_pressed"):
|
||||
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN)
|
||||
is_already_full_screen()
|
||||
|
||||
|
||||
func is_already_full_screen():
|
||||
if !(DisplayServer.window_get_mode() < 3):
|
||||
full_screen_needed.visible = false
|
||||
trigger_pause(false)
|
||||
|
||||
func _notification(what):
|
||||
if what == MainLoop.NOTIFICATION_APPLICATION_FOCUS_OUT:
|
||||
trigger_pause(true)
|
||||
|
||||
func trigger_pause(new_pause_state):
|
||||
the_new_pause_state = new_pause_state
|
||||
get_tree().paused = the_new_pause_state
|
||||
visible = the_new_pause_state
|
||||
if (the_new_pause_state):
|
||||
get_tree().paused = new_pause_state
|
||||
visible = new_pause_state
|
||||
if (new_pause_state):
|
||||
$Buttons/Resume.grab_focus()
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
|
||||
else:
|
||||
|
@ -29,15 +35,13 @@ func trigger_pause(new_pause_state):
|
|||
|
||||
|
||||
func _on_resume_pressed():
|
||||
if Global.IS_WEB_EXPORTED:
|
||||
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN)
|
||||
trigger_pause(false)
|
||||
|
||||
func _on_menu_pressed():
|
||||
get_tree().paused = false
|
||||
get_tree().change_scene_to_file("res://scenes/ui/MainScreen.tscn")
|
||||
|
||||
func _on_player_pause_game(is_paused):
|
||||
trigger_pause(is_paused)
|
||||
func _on_player_pause_game():
|
||||
trigger_pause(true)
|
||||
|
||||
|
||||
|
|
|
@ -5,13 +5,18 @@ var location_target = Vector3()
|
|||
var count_kills = 0
|
||||
var id_spawn_target = 0
|
||||
|
||||
|
||||
@onready var animation_kill = $Player/Head/AnimationKill
|
||||
@onready var kill = $Player/Head/Kill
|
||||
@onready var kills = $Player/Head/Kills
|
||||
@onready var full_screen_needed = $CanvasLayer/FullScreenRequest
|
||||
#@onready var anim_hit = $FPS/Head/Camera3D/AnimationHit
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
full_screen_needed.visible = false
|
||||
if (DisplayServer.window_get_mode() < 3):
|
||||
full_screen_requested()
|
||||
id_spawn_target = 0
|
||||
count_kills = 0
|
||||
|
||||
|
@ -21,6 +26,8 @@ func _ready():
|
|||
spawn_target()
|
||||
|
||||
|
||||
|
||||
|
||||
func target_killed():
|
||||
messageHit()
|
||||
spawn_target()
|
||||
|
@ -70,8 +77,25 @@ func messageHit():
|
|||
animation_kill.play("kill")
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(_delta):
|
||||
pass
|
||||
|
||||
if Input.is_action_pressed("f_pressed"):
|
||||
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN)
|
||||
is_already_full_screen()
|
||||
|
||||
func _on_menu_pressed():
|
||||
pass # Replace with function body.
|
||||
|
||||
func full_screen_requested():
|
||||
get_tree().paused = true
|
||||
full_screen_needed.visible = true
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
|
||||
|
||||
|
||||
func is_already_full_screen():
|
||||
if !(DisplayServer.window_get_mode() < 3):
|
||||
full_screen_needed.visible = false
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
|
||||
get_tree().paused = false
|
||||
|
||||
func _on_full_screen_needed_pressed():
|
||||
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN)
|
||||
is_already_full_screen()
|
||||
|
|
|
@ -55,7 +55,7 @@ var models3d: Dictionary = {
|
|||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
if Global.IS_WEB_EXPORTED:
|
||||
if OS.has_feature("web"):
|
||||
exit_button.visible = false
|
||||
AddGamesSensitivities()
|
||||
if DataManager.get_data("resolution"):
|
||||
|
@ -68,6 +68,10 @@ func _ready():
|
|||
get_viewport().size_changed.connect(self.update_resolution_label)
|
||||
update_resolution_label()
|
||||
|
||||
func _process(_delta):
|
||||
if Input.is_action_pressed("f_pressed"):
|
||||
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN)
|
||||
|
||||
func AddGamesSensitivities():
|
||||
for sens in games_sensitivities:
|
||||
game.add_item(sens)
|
||||
|
@ -101,8 +105,6 @@ func AddGames():
|
|||
|
||||
func startTraining(type):
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
|
||||
if Global.IS_WEB_EXPORTED:
|
||||
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN)
|
||||
Global.game_type = models3d[type]
|
||||
get_tree().change_scene_to_file("res://scenes/levels/World.tscn")
|
||||
|
||||
|
@ -115,8 +117,7 @@ func update_resolution_label() -> void:
|
|||
|
||||
func _on_play_pressed():
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
|
||||
if Global.IS_WEB_EXPORTED:
|
||||
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN)
|
||||
|
||||
var keys = []
|
||||
for key in models3d.keys():
|
||||
keys.push_back(key)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue