Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bronuh
Vector Survivors
Commits
03c50dcd
Commit
03c50dcd
authored
1 year ago
by
Bronuh
Browse files
Options
Download
Email Patches
Plain Diff
Visual adjustments
- add 'maximize on start' setting
parent
d11b6e9a
master
complete-rewrite
refuse-configs
temporary-raname
0.3.2.0
0.2.1.0
0.2.0.1
0.2.0.0-prealpha
No related merge requests found
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
Assets/Icons/CheckboxChecked.svg.import
+1
-1
Assets/Icons/CheckboxChecked.svg.import
Assets/Icons/CheckboxCheckedDisabled.svg.import
+1
-1
Assets/Icons/CheckboxCheckedDisabled.svg.import
Assets/Icons/CheckboxUnchecked.svg.import
+1
-1
Assets/Icons/CheckboxUnchecked.svg.import
Assets/Icons/CheckboxUncheckedDisabled.svg.import
+1
-1
Assets/Icons/CheckboxUncheckedDisabled.svg.import
project.godot
+0
-1
project.godot
src/VectorSurvivors/Scenes/Main/Game.cs
+4
-0
src/VectorSurvivors/Scenes/Main/Game.cs
src/VectorSurvivors/Scenes/Main/Settings.cs
+1
-0
src/VectorSurvivors/Scenes/Main/Settings.cs
src/VectorSurvivors/Scenes/Screen/Components/CustomCheckBox.cs
+27
-0
...ectorSurvivors/Scenes/Screen/Components/CustomCheckBox.cs
src/VectorSurvivors/Scenes/Screen/PauseMenu/PauseScreen.tscn
+4
-1
src/VectorSurvivors/Scenes/Screen/PauseMenu/PauseScreen.tscn
src/VectorSurvivors/Scenes/Screen/SettingsScreen/SettingsScreen.cs
+4
-0
...rSurvivors/Scenes/Screen/SettingsScreen/SettingsScreen.cs
src/VectorSurvivors/Scenes/Screen/SettingsScreen/SettingsScreen.tscn
+15
-4
...urvivors/Scenes/Screen/SettingsScreen/SettingsScreen.tscn
src/VectorSurvivors/Scenes/States/MainMenu/MainMenu.cs
+11
-0
src/VectorSurvivors/Scenes/States/MainMenu/MainMenu.cs
src/VectorSurvivors/Scenes/States/MainMenu/MainMenu.tscn
+32
-2
src/VectorSurvivors/Scenes/States/MainMenu/MainMenu.tscn
with
102 additions
and
12 deletions
+102
-12
Assets/Icons/CheckboxChecked.svg.import
+
1
-
1
View file @
03c50dcd
...
...
@@ -32,6 +32,6 @@ process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=0.0
5
svg/scale=0.0
4
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false
This diff is collapsed.
Click to expand it.
Assets/Icons/CheckboxCheckedDisabled.svg.import
+
1
-
1
View file @
03c50dcd
...
...
@@ -32,6 +32,6 @@ process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=0.0
5
svg/scale=0.0
4
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false
This diff is collapsed.
Click to expand it.
Assets/Icons/CheckboxUnchecked.svg.import
+
1
-
1
View file @
03c50dcd
...
...
@@ -32,6 +32,6 @@ process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=0.0
5
svg/scale=0.0
4
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false
This diff is collapsed.
Click to expand it.
Assets/Icons/CheckboxUncheckedDisabled.svg.import
+
1
-
1
View file @
03c50dcd
...
...
@@ -32,6 +32,6 @@ process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=0.0
5
svg/scale=0.0
4
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false
This diff is collapsed.
Click to expand it.
project.godot
+
0
-
1
View file @
03c50dcd
...
...
@@ -19,7 +19,6 @@ config/show_image=false
[display]
window/size/mode=2
window/stretch/mode="canvas_items"
window/stretch/aspect="expand"
...
...
This diff is collapsed.
Click to expand it.
src/VectorSurvivors/Scenes/Main/Game.cs
+
4
-
0
View file @
03c50dcd
...
...
@@ -33,6 +33,10 @@ public partial class Game : AbstractStorage
{
Instance
=
this
;
Settings
=
Settings
.
Load
()
??
new
Settings
();
if
(
Settings
.
MaximizeOnStart
)
{
DisplayServer
.
WindowSetMode
(
DisplayServer
.
WindowMode
.
Maximized
);
}
var
services
=
new
ServiceRegistry
();
services
.
RegisterServices
();
...
...
This diff is collapsed.
Click to expand it.
src/VectorSurvivors/Scenes/Main/Settings.cs
+
1
-
0
View file @
03c50dcd
...
...
@@ -9,6 +9,7 @@ public class Settings
public
float
MasterVolume
{
get
;
set
;
}
=
1
;
public
float
MusicVolume
{
get
;
set
;
}
=
1
;
public
float
SoundVolume
{
get
;
set
;
}
=
1
;
public
bool
MaximizeOnStart
{
get
;
set
;
}
=
false
;
public
Settings
GetCopy
()
=>
FromJson
(
ToString
());
...
...
This diff is collapsed.
Click to expand it.
src/VectorSurvivors/Scenes/Screen/Components/CustomCheckBox.cs
0 → 100644
+
27
-
0
View file @
03c50dcd
using
Content
;
namespace
VectorSurvivors
;
[
GlobalClass
]
public
partial
class
CustomCheckBox
:
CheckBox
{
public
override
void
_Ready
()
{
MouseEntered
+=
OnHoverChanged
;
Pressed
+=
OnClick
;
}
private
void
OnHoverChanged
()
{
string
sfx
=
Sfx
.
UiSelectNeutral
;
Audio2D
.
PlayUiSound
(
sfx
);
}
private
void
OnClick
()
{
string
sfx
=
Sfx
.
UiClick
;
Audio2D
.
PlayUiSound
(
sfx
);
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/VectorSurvivors/Scenes/Screen/PauseMenu/PauseScreen.tscn
+
4
-
1
View file @
03c50dcd
[gd_scene load_steps=
6
format=3 uid="uid://b1o1cegx2f35d"]
[gd_scene load_steps=
7
format=3 uid="uid://b1o1cegx2f35d"]
[ext_resource type="Script" path="res://src/VectorSurvivors/Scenes/Screen/PauseMenu/PauseScreen.cs" id="1_a3qpc"]
[ext_resource type="Theme" uid="uid://depdqo36e8ank" path="res://Assets/Resources/MenuTheme.tres" id="1_qnehr"]
[ext_resource type="Script" path="res://src/VectorSurvivors/Scenes/Screen/Components/CustomButton.cs" id="3_7jalm"]
[sub_resource type="Gradient" id="Gradient_1uyy1"]
offsets = PackedFloat32Array(0.348958, 0.927083)
...
...
@@ -99,6 +100,7 @@ theme_override_font_sizes/font_size = 30
text = "Настройки
"
alignment = 0
script = ExtResource("3_7jalm")
[node name="Quit" type="Button" parent="Control/MarginContainer/VBoxContainer/VBoxContainer"]
layout_mode = 2
...
...
@@ -106,3 +108,4 @@ size_flags_horizontal = 0
theme_override_font_sizes/font_size = 30
text = "Выйти"
alignment = 0
script = ExtResource("3_7jalm")
This diff is collapsed.
Click to expand it.
src/VectorSurvivors/Scenes/Screen/SettingsScreen/SettingsScreen.cs
+
4
-
0
View file @
03c50dcd
...
...
@@ -12,6 +12,7 @@ public partial class SettingsScreen : CanvasLayer, IUiScene
[
Export
]
[
NotNull
]
public
Button
SaveButton
{
get
;
private
set
;
}
[
Export
]
[
NotNull
]
public
Button
CancelButton
{
get
;
private
set
;
}
[
Export
]
[
NotNull
]
public
CheckBox
MaximizeCheckBox
{
get
;
private
set
;
}
private
static
Settings
_preserved
=
null
;
private
bool
_saved
=
false
;
...
...
@@ -24,6 +25,7 @@ public partial class SettingsScreen : CanvasLayer, IUiScene
MasterVolumeSlider
.
Value
=
Audio2D
.
MasterVolume
;
MusicVolumeSlider
.
Value
=
Audio2D
.
MusicVolume
;
SoundVolumeSlider
.
Value
=
Audio2D
.
SoundsVolume
;
MaximizeCheckBox
.
ButtonPressed
=
_preserved
.
MaximizeOnStart
;
MasterVolumeSlider
.
ValueChanged
+=
value
=>
Audio2D
.
MasterVolume
=
(
float
)
value
;
MusicVolumeSlider
.
ValueChanged
+=
value
=>
Audio2D
.
MusicVolume
=
(
float
)
value
;
...
...
@@ -43,11 +45,13 @@ public partial class SettingsScreen : CanvasLayer, IUiScene
settings
.
MasterVolume
=
(
float
)
MasterVolumeSlider
.
Value
;
settings
.
MusicVolume
=
(
float
)
MusicVolumeSlider
.
Value
;
settings
.
SoundVolume
=
(
float
)
SoundVolumeSlider
.
Value
;
settings
.
MaximizeOnStart
=
MaximizeCheckBox
.
ButtonPressed
;
Game
.
Settings
=
settings
;
QueueFree
();
}
private
void
OnCancel
()
{
if
(!
_saved
)
...
...
This diff is collapsed.
Click to expand it.
src/VectorSurvivors/Scenes/Screen/SettingsScreen/SettingsScreen.tscn
+
15
-
4
View file @
03c50dcd
[gd_scene load_steps=
8
format=3 uid="uid://8t47r3ktd7x3"]
[gd_scene load_steps=
10
format=3 uid="uid://8t47r3ktd7x3"]
[ext_resource type="Theme" uid="uid://depdqo36e8ank" path="res://Assets/Resources/MenuTheme.tres" id="1_b8kxm"]
[ext_resource type="Script" path="res://src/VectorSurvivors/Scenes/Screen/SettingsScreen/SettingsScreen.cs" id="1_wv2s2"]
[ext_resource type="Script" path="res://src/VectorSurvivors/Scenes/Screen/Components/CustomHSlider.cs" id="3_kysm1"]
[ext_resource type="Script" path="res://src/VectorSurvivors/Scenes/Screen/Components/CustomCheckBox.cs" id="4_8w6h3"]
[ext_resource type="Script" path="res://src/VectorSurvivors/Scenes/Screen/Components/CustomButton.cs" id="4_qf0wo"]
[sub_resource type="Environment" id="Environment_hox0w"]
background_mode = 3
...
...
@@ -12,12 +14,12 @@ glow_intensity = 3.65
glow_blend_mode = 0
glow_hdr_threshold = 0.01
[sub_resource type="Gradient" id="Gradient_
2xh3w
"]
[sub_resource type="Gradient" id="Gradient_
fdw5p
"]
offsets = PackedFloat32Array(0.348958, 0.927083)
colors = PackedColorArray(0, 0, 0, 0, 0, 0, 0, 1)
[sub_resource type="GradientTexture2D" id="GradientTexture2D_0w0u1"]
gradient = SubResource("Gradient_
2xh3w
")
gradient = SubResource("Gradient_
fdw5p
")
fill = 1
fill_from = Vector2(0.5, 0.5)
...
...
@@ -26,7 +28,7 @@ line_spacing = 10.0
font_size = 36
font_color = Color(0.517647, 0.694118, 0.87451, 1)
[node name="SettingsScreen" type="CanvasLayer" node_paths=PackedStringArray("MasterVolumeSlider", "MusicVolumeSlider", "SoundVolumeSlider", "SaveButton", "CancelButton")]
[node name="SettingsScreen" type="CanvasLayer" node_paths=PackedStringArray("MasterVolumeSlider", "MusicVolumeSlider", "SoundVolumeSlider", "SaveButton", "CancelButton"
, "MaximizeCheckBox"
)]
layer = 10
script = ExtResource("1_wv2s2")
MasterVolumeSlider = NodePath("Control/MarginContainer/VBoxContainer/ScrollContainer/MainVerticalContainer/MasterVolume/MasterSlider")
...
...
@@ -34,6 +36,7 @@ MusicVolumeSlider = NodePath("Control/MarginContainer/VBoxContainer/ScrollContai
SoundVolumeSlider = NodePath("Control/MarginContainer/VBoxContainer/ScrollContainer/MainVerticalContainer/SoundVolume/SoundSlider")
SaveButton = NodePath("Control/MarginContainer/VBoxContainer/HBoxContainer/Save")
CancelButton = NodePath("Control/MarginContainer/VBoxContainer/HBoxContainer/Cancel")
MaximizeCheckBox = NodePath("Control/MarginContainer/VBoxContainer/ScrollContainer/MainVerticalContainer/MaximizeCheck")
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource("Environment_hox0w")
...
...
@@ -151,6 +154,12 @@ step = 0.05
value = 1.0
script = ExtResource("3_kysm1")
[node name="MaximizeCheck" type="CheckBox" parent="Control/MarginContainer/VBoxContainer/ScrollContainer/MainVerticalContainer"]
layout_mode = 2
size_flags_vertical = 3
text = "Развернуть на весь экран при старте"
script = ExtResource("4_8w6h3")
[node name="HBoxContainer" type="HBoxContainer" parent="Control/MarginContainer/VBoxContainer"]
layout_mode = 2
size_flags_horizontal = 4
...
...
@@ -161,6 +170,7 @@ layout_mode = 2
size_flags_horizontal = 2
theme_override_font_sizes/font_size = 20
text = "Сохранить"
script = ExtResource("4_qf0wo")
[node name="Filler" type="Control" parent="Control/MarginContainer/VBoxContainer/HBoxContainer"]
custom_minimum_size = Vector2(100, 0)
...
...
@@ -171,3 +181,4 @@ size_flags_horizontal = 3
layout_mode = 2
theme_override_font_sizes/font_size = 20
text = "Отмена"
script = ExtResource("4_qf0wo")
This diff is collapsed.
Click to expand it.
src/VectorSurvivors/Scenes/States/MainMenu/MainMenu.cs
+
11
-
0
View file @
03c50dcd
...
...
@@ -14,6 +14,7 @@ public partial class MainMenu : AbstractStorage, IUiScene
[
Export
]
[
NotNull
]
public
Button
SettingsButton
{
get
;
private
set
;
}
[
Export
]
[
NotNull
]
public
Button
CreditsButton
{
get
;
private
set
;
}
[
Export
]
[
NotNull
]
public
Button
QuitButton
{
get
;
private
set
;
}
[
Export
]
[
NotNull
]
public
ColorRect
FadingForeground
{
get
;
private
set
;
}
/// <inheritdoc />
...
...
@@ -24,6 +25,16 @@ public partial class MainMenu : AbstractStorage, IUiScene
SettingsButton
.
Pressed
+=
OnSettings
;
CreditsButton
.
Pressed
+=
OnCredits
;
QuitButton
.
Pressed
+=
OnQuit
;
FadingForeground
.
Visible
=
true
;
var
tween
=
FadingForeground
.
CreateTween
();
tween
.
TweenProperty
(
FadingForeground
,
"modulate:a"
,
0
,
2
);
TreeExiting
+=
()
=>
{
if
(
tween
.
IsValid
())
tween
.
Kill
();
};
Audio2D
.
PlayMusic
(
Music
.
MainBgm
);
}
...
...
This diff is collapsed.
Click to expand it.
src/VectorSurvivors/Scenes/States/MainMenu/MainMenu.tscn
+
32
-
2
View file @
03c50dcd
[gd_scene load_steps=
4
format=3 uid="uid://btxu2hs1vtn3g"]
[gd_scene load_steps=
6
format=3 uid="uid://btxu2hs1vtn3g"]
[ext_resource type="Script" path="res://src/VectorSurvivors/Scenes/States/MainMenu/MainMenu.cs" id="1_b0m5l"]
[ext_resource type="Theme" uid="uid://depdqo36e8ank" path="res://Assets/Resources/MenuTheme.tres" id="2_xywb3"]
[ext_resource type="Script" path="res://src/VectorSurvivors/Scenes/Screen/Components/CustomButton.cs" id="3_vihbj"]
[node name="MainMenu" type="Node" node_paths=PackedStringArray("CreateGameButton", "ConnectToGameButton", "SettingsButton", "CreditsButton", "QuitButton")]
[sub_resource type="Gradient" id="Gradient_2xh3w"]
offsets = PackedFloat32Array(0.683168, 1)
colors = PackedColorArray(0, 0, 0, 0, 0, 0, 0, 0.780392)
[sub_resource type="GradientTexture2D" id="GradientTexture2D_huyya"]
gradient = SubResource("Gradient_2xh3w")
fill = 2
fill_from = Vector2(0.5, 0.5)
[node name="MainMenu" type="Node" node_paths=PackedStringArray("CreateGameButton", "ConnectToGameButton", "SettingsButton", "CreditsButton", "QuitButton", "FadingForeground")]
script = ExtResource("1_b0m5l")
CreateGameButton = NodePath("Screen/Control/MarginContainer/Halves/ButtonsContainer/StartGame")
ConnectToGameButton = NodePath("Screen/Control/MarginContainer/Halves/ButtonsContainer/ConnectToGame")
SettingsButton = NodePath("Screen/Control/MarginContainer/Halves/ButtonsContainer/Settings")
CreditsButton = NodePath("Screen/Control/MarginContainer/Halves/ButtonsContainer/Credits")
QuitButton = NodePath("Screen/Control/MarginContainer/Halves/ButtonsContainer/Quit")
FadingForeground = NodePath("Screen/Control/FadingForeground")
[node name="Screen" type="CanvasLayer" parent="."]
...
...
@@ -23,6 +33,15 @@ grow_horizontal = 2
grow_vertical = 2
theme = ExtResource("2_xywb3")
[node name="Vignette" type="TextureRect" parent="Screen/Control"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = SubResource("GradientTexture2D_huyya")
[node name="MarginContainer" type="MarginContainer" parent="Screen/Control"]
layout_mode = 1
anchors_preset = 15
...
...
@@ -84,3 +103,14 @@ visible = false
layout_mode = 2
theme_override_font_sizes/font_size = 24
text = "CONNECT TO GAME"
[node name="FadingForeground" type="ColorRect" parent="Screen/Control"]
visible = false
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
color = Color(0, 0, 0, 1)
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets