-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Full Session): loading menu fixes, launch fixes
- Loading branch information
1 parent
5f5cedb
commit a86b2ab
Showing
16 changed files
with
128 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
extends OSPlatform | ||
class_name PlatformNixOS | ||
|
||
|
||
func _init() -> void: | ||
logger.set_name("PlatformNixOS") | ||
logger.set_level(Log.LEVEL.INFO) | ||
logger.info("Detected NixOS platform") | ||
|
||
|
||
## NixOS typically cannot execute regular binaries, so downloaded binaries will | ||
## be run with 'steam-run'. | ||
func get_binary_compatibility_cmd(cmd: String, args: PackedStringArray) -> Array[String]: | ||
# Hack for steam plugin running steamcmd on NixOS | ||
var command: Array[String] = [] | ||
if not cmd.ends_with("steamcmd.sh"): | ||
return command | ||
|
||
command.push_back("steam-run") | ||
command.push_back(cmd) | ||
command.append_array(args) | ||
|
||
return command |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[gd_resource type="Resource" script_class="PlatformNixOS" load_steps=3 format=3 uid="uid://byxeetkb11b3e"] | ||
|
||
[ext_resource type="Script" path="res://core/platform/os/nixos.gd" id="1_h88kc"] | ||
[ext_resource type="Script" path="res://core/platform/actions/platform_action.gd" id="2_tc12v"] | ||
|
||
[resource] | ||
script = ExtResource("1_h88kc") | ||
name = "" | ||
startup_actions = Array[ExtResource("2_tc12v")]([]) | ||
shutdown_actions = Array[ExtResource("2_tc12v")]([]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,33 @@ | ||
extends Control | ||
|
||
var launch_manager := load("res://core/global/launch_manager.tres") as LaunchManager | ||
var state_machine := ( | ||
preload("res://assets/state/state_machines/global_state_machine.tres") as StateMachine | ||
) | ||
var menu_state := preload("res://assets/state/states/menu.tres") as State | ||
var popup_state := preload("res://assets/state/states/popup.tres") as State | ||
var in_game_state := preload("res://assets/state/states/in_game.tres") as State | ||
var game_launching := false | ||
|
||
|
||
# Called when the node enters the scene tree for the first time. | ||
func _ready() -> void: | ||
launch_manager.app_launched.connect(_on_app_launched) | ||
|
||
var on_state_changed := func(_from: State, to: State): | ||
if not game_launching: | ||
visible = false | ||
return | ||
visible = to in [in_game_state, popup_state] | ||
state_machine.state_changed.connect(on_state_changed) | ||
|
||
|
||
func _on_app_launched(app: RunningApp): | ||
visible = true | ||
game_launching = true | ||
app.app_type_detected.connect(_on_window_created, CONNECT_ONE_SHOT) | ||
app.app_killed.connect(_on_window_created, CONNECT_ONE_SHOT) | ||
|
||
|
||
func _on_window_created() -> void: | ||
game_launching = false | ||
visible = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters