update 1st page - adding option to update/configure video/sound, show information and locale (fr & en)

This commit is contained in:
AleaJactaEst 2021-05-27 23:56:16 +02:00
parent db3cb83817
commit 7d44d8132b
64 changed files with 3276 additions and 1307 deletions

6
AUTHORS Normal file
View file

@ -0,0 +1,6 @@
Yannk
Zatalyz
Deed
Lyne
Osquallo
AleaJactaEst

1
NEWS Normal file
View file

@ -0,0 +1 @@
# What's new on khanat?

28
NEWS_fr Normal file
View file

@ -0,0 +1,28 @@
# Quels sont les dernières nouvelles ?
1) Configuration de l'internationalisation (fr & en)
2) Dans la page principale, ajout d'un menu, en haut à droite, afin d'avoir d'accessible les actions rapides suivantes:
* les nouvelles
* configuration de la langue
* activer le son
* l'aide
* configuration
* sortir
3) Ajout d'un A propos
a) Auteur
b) License
4) Ajout d'un image pour les icons OPTIONS afin de savoir lequel est actif (fond jaune au lieu de blanc)
5) Ajout de l'option paramètres
I) Paramétrage vidéo
a) Plein écran
b) Fenêtre redimensionnable
c) Orientation de l'écran (à vérifier)
d) Fenêtre sans bord
e) Choisir l'écran
f) Garder la fenêtre dessus
II) Paramétrage son

View file

@ -500,6 +500,7 @@ func _on_window_gui_input( event ):
self.rect_position += delta
func load_from_file( config_file ):
print("[res://addons/kh_window/kh_window.gd] load_from_file")
if config_file.has_section( self.name ):
self.rect_position = config_file.get_value( self.name, "position" )
self.rect_size = config_file.get_value( self.name, "size" )

BIN
assets/fonts/IMMORTAL.ttf Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 545 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 751 B

3
default_bus_layout.tres Normal file
View file

@ -0,0 +1,3 @@
[gd_resource type="AudioBusLayout" format=2]
[resource]

BIN
icon.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 62 KiB

120
locale/en.po Normal file
View file

@ -0,0 +1,120 @@
# Don't remove the two lines below, they're required for gettext to work correctly.
msgid ""
msgstr ""
"Project-Id-Version: khanat-client 1\n"
"PO-Revision-Date: 1\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: en\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "MAIN_MENU_PLAY"
msgstr "Play"
msgid "MAIN_MENU_USERNAME"
msgstr "Username"
msgid "MAIN_MENU_PASSWORD"
msgstr "Password"
msgid "MAIN_MENU_QUIT"
msgstr "Quit"
msgid "Select"
msgstr "Select"
msgid "Remove"
msgstr "Remove"
msgid "New creature"
msgstr "New creature"
msgid "Cancel"
msgstr "Cancel"
msgid "OPTION_LANGUAGE_SELECT_YOUR_LANGUAGE"
msgstr "Select your language"
msgid "OPTION_LANGUAGE_EXIT"
msgstr "Ok"
msgid "OPTION_NEWS_TITLE"
msgstr "News"
msgid "OPTION_INFO_TITLE"
msgstr "About"
msgid "OPTION_INFO_AUTHORS"
msgstr "Authors"
msgid "OPTION_INFO_LICENSE"
msgstr "License"
msgid "OPTION_NEWS_EXIT"
msgstr "OK"
msgid "OPTION_INFO_EXIT"
msgstr "OK"
msgid "OPTION_SETTINGS_EXIT"
msgstr "OK"
msgid "OPTION_SETTINGS_VIDEO"
msgstr "Video"
msgid "OPTION_SETTINGS_SOUND"
msgstr "Sound"
msgid "OPTION_SETTINGS_VIDEO_FULLSCREEN"
msgstr "Fullscreen"
msgid "OPTION_SETTINGS_VIDEO_RESIZABLE"
msgstr "Resizable"
msgid "OPTION_SETTINGS_VIDEO_SCREEN_ORIENTATION"
msgstr "Screen orientation"
msgid "OPTION_SETTINGS_VIDEO_BORDERLESS"
msgstr "Borderless"
msgid "OPTION_SETTINGS_VIDEO_SCREEN"
msgstr "Screen"
msgid "OPTION_SETTINGS_VIDEO_WINDOW_ALWAYS_ON_TOP"
msgstr "Window always on top"
msgid "OPTION_SETTINGS_VIDEO_WINDOW_MAXIMIZED"
msgstr "window maximized"
msgid "OPTION_SETTINGS_VIDEO_DEFAULT"
msgstr "Default configuration"
msgid "OPTION_SETTINGS_VIDEO_SIZE_FONT"
msgstr "font size"
msgid "OPTION_SETTINGS_SOUND_MUTE"
msgstr "Mute"
msgid "OPTION_SETTINGS_SOUND_LEVEL_GLOBAL"
msgstr "Global"
msgid "OPTION_SETTINGS_SOUND_LEVEL_MUSIC"
msgstr "Music"
msgid "OPTION_SETTINGS_SOUND_LEVEL_EFFECT"
msgstr "Effect"
msgid "OPTION_SETTINGS_SOUND_YOUR_MUSIC"
msgstr "Launch your music"
msgid "OPTION_SETTINGS_SOUND_YOUR_SELECTION"
msgstr "Your music"
msgid "OPTION_SETTINGS_SOUND_SELECTION_ADD"
msgstr "Add"
msgid "OPTION_SETTINGS_SOUND_SELECTION_DELETE"
msgstr "Del"

120
locale/fr.po Normal file
View file

@ -0,0 +1,120 @@
# Don't remove the two lines below, they're required for gettext to work correctly.
msgid ""
msgstr ""
"Project-Id-Version: khanat-client 1\n"
"PO-Revision-Date: 1\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
msgid "MAIN_MENU_PLAY"
msgstr "Jouer"
msgid "MAIN_MENU_USERNAME"
msgstr "Identifiant"
msgid "MAIN_MENU_PASSWORD"
msgstr "Mot de passe"
msgid "MAIN_MENU_QUIT"
msgstr "Quitter"
msgid "Select"
msgstr "Sélectionner"
msgid "Remove"
msgstr "Supprimer"
msgid "New creature"
msgstr "Créer une nouvel créature"
msgid "Cancel"
msgstr "Annuler"
msgid "OPTION_LANGUAGE_SELECT_YOUR_LANGUAGE"
msgstr "Sélectionner votre langue"
msgid "OPTION_LANGUAGE_EXIT"
msgstr "Ok"
msgid "OPTION_NEWS_TITLE"
msgstr "Nouveauté"
msgid "OPTION_INFO_TITLE"
msgstr "À propos"
msgid "OPTION_INFO_AUTHORS"
msgstr "Auteurs"
msgid "OPTION_INFO_LICENSE"
msgstr "Licence"
msgid "OPTION_NEWS_EXIT"
msgstr "OK"
msgid "OPTION_INFO_EXIT"
msgstr "OK"
msgid "OPTION_SETTINGS_EXIT"
msgstr "OK"
msgid "OPTION_SETTINGS_VIDEO"
msgstr "Vidéo"
msgid "OPTION_SETTINGS_SOUND"
msgstr "Son"
msgid "OPTION_SETTINGS_VIDEO_FULLSCREEN"
msgstr "Plein écran"
msgid "OPTION_SETTINGS_VIDEO_RESIZABLE"
msgstr "Fenêtre redimensionnable"
msgid "OPTION_SETTINGS_VIDEO_SCREEN_ORIENTATION"
msgstr "Orientation de l'écran"
msgid "OPTION_SETTINGS_VIDEO_BORDERLESS"
msgstr "Fenêtre sans bord"
msgid "OPTION_SETTINGS_VIDEO_SCREEN"
msgstr "Écran"
msgid "OPTION_SETTINGS_VIDEO_WINDOW_ALWAYS_ON_TOP"
msgstr "Garder la fenêtre dessus"
msgid "OPTION_SETTINGS_VIDEO_WINDOW_MAXIMIZED"
msgstr "Fenêtre prend tout l'écran"
msgid "OPTION_SETTINGS_VIDEO_DEFAULT"
msgstr "Configuration par défaut"
msgid "OPTION_SETTINGS_VIDEO_SIZE_FONT"
msgstr "Taille de la police"
msgid "OPTION_SETTINGS_SOUND_MUTE"
msgstr "Mute"
msgid "OPTION_SETTINGS_SOUND_LEVEL_GLOBAL"
msgstr "Niveau global"
msgid "OPTION_SETTINGS_SOUND_LEVEL_MUSIC"
msgstr "Niveau musique"
msgid "OPTION_SETTINGS_SOUND_LEVEL_EFFECT"
msgstr "Niveau effet"
msgid "OPTION_SETTINGS_SOUND_YOUR_MUSIC"
msgstr "Jouer votre musique"
msgid "OPTION_SETTINGS_SOUND_YOUR_SELECTION"
msgstr "Votre musique"
msgid "OPTION_SETTINGS_SOUND_SELECTION_ADD"
msgstr "Ajouter"
msgid "OPTION_SETTINGS_SOUND_SELECTION_DELETE"
msgstr "Supprimer"

21
locale/locale.sh Executable file
View file

@ -0,0 +1,21 @@
*#!/bin/bash
WORKDIR="$(dirname $(readlink -f $0))"
function generate_locale()
{
echo "--- Begin : $1"
if [ -f $1.po ]
then
msgmerge --update --backup=none $1.po messages.pot
else
msginit --no-translator --input=messages.pot --locale=$1
fi
echo "--- Check : $1"
msgfmt $1.po --check
echo "--- End : $1"
}
ORIGIN=$PWD
cd $WORKDIR
generate_locale fr
generate_locale en
cd $ORIGIN

BIN
locale/messages.mo Normal file

Binary file not shown.

112
locale/messages.pot Normal file
View file

@ -0,0 +1,112 @@
# Don't remove the two lines below, they're required for gettext to work correctly.
msgid ""
msgstr ""
msgid "MAIN_MENU_PLAY"
msgstr ""
msgid "MAIN_MENU_USERNAME"
msgstr ""
msgid "MAIN_MENU_PASSWORD"
msgstr ""
msgid "MAIN_MENU_QUIT"
msgstr ""
msgid "Select"
msgstr ""
msgid "Remove"
msgstr ""
msgid "New creature"
msgstr ""
msgid "Cancel"
msgstr ""
msgid "OPTION_LANGUAGE_SELECT_YOUR_LANGUAGE"
msgstr ""
msgid "OPTION_LANGUAGE_EXIT"
msgstr ""
msgid "OPTION_NEWS_TITLE"
msgstr ""
msgid "OPTION_INFO_TITLE"
msgstr ""
msgid "OPTION_INFO_AUTHORS"
msgstr ""
msgid "OPTION_INFO_LICENSE"
msgstr ""
msgid "OPTION_NEWS_EXIT"
msgstr ""
msgid "OPTION_INFO_EXIT"
msgstr ""
msgid "OPTION_SETTINGS_EXIT"
msgstr ""
msgid "OPTION_SETTINGS_VIDEO"
msgstr ""
msgid "OPTION_SETTINGS_SOUND"
msgstr ""
msgid "OPTION_SETTINGS_VIDEO_FULLSCREEN"
msgstr ""
msgid "OPTION_SETTINGS_VIDEO_RESIZABLE"
msgstr ""
msgid "OPTION_SETTINGS_VIDEO_SCREEN_ORIENTATION"
msgstr ""
msgid "OPTION_SETTINGS_VIDEO_BORDERLESS"
msgstr ""
msgid "OPTION_SETTINGS_VIDEO_SCREEN"
msgstr ""
msgid "OPTION_SETTINGS_VIDEO_WINDOW_ALWAYS_ON_TOP"
msgstr ""
msgid "OPTION_SETTINGS_VIDEO_WINDOW_MAXIMIZED"
msgstr ""
msgid "OPTION_SETTINGS_VIDEO_DEFAULT"
msgstr ""
msgid "OPTION_SETTINGS_VIDEO_SIZE_FONT"
msgstr ""
msgid "OPTION_SETTINGS_SOUND_MUTE"
msgstr ""
msgid "OPTION_SETTINGS_SOUND_LEVEL_GLOBAL"
msgstr ""
msgid "OPTION_SETTINGS_SOUND_LEVEL_MUSIC"
msgstr ""
msgid "OPTION_SETTINGS_SOUND_LEVEL_EFFECT"
msgstr ""
msgid "OPTION_SETTINGS_SOUND_YOUR_MUSIC"
msgstr ""
msgid "OPTION_SETTINGS_SOUND_YOUR_SELECTION"
msgstr ""
msgid "OPTION_SETTINGS_SOUND_SELECTION_ADD"
msgstr ""
msgid "OPTION_SETTINGS_SOUND_SELECTION_DELETE"
msgstr ""

View file

@ -67,8 +67,13 @@ run/main_scene="res://scenes/main/main.tscn"
boot_splash/image="res://assets/interfaces/new_launcher_bg_0-1.png"
config/icon="res://icon.png"
[audio]
enable_audio_input=true
[autoload]
Config="*res://ressources/scripts/config/config.gd"
Creatures="*res://ressources/scripts/creatures_old.gd"
MusicManager="*res://scenes/interfaces/music_manager/music_manager.tscn"
Connection="*res://scenes/connection/connection.tscn"
@ -85,10 +90,11 @@ gdscript/warnings/return_value_discarded=false
window/size/width=1280
window/size/height=720
window/size/always_on_top=true
[editor_plugins]
enabled=PoolStringArray( "kh_slider", "kh_window" )
enabled=PoolStringArray( "res://addons/kh_slider/plugin.cfg", "res://addons/kh_window/plugin.cfg" )
[input]
@ -222,6 +228,11 @@ camera_switch={
debug_mode=true
[locale]
locale_filter=[ 0, [ ] ]
translations=PoolStringArray( "res://locale/fr.po", "res://locale/en.po" )
[node]
name_num_separator=2

View file

@ -0,0 +1,205 @@
extends Node
# Localization configuration on linux
# $HOME/.local/share/godot/app_userdata/Khanat
var font_size = 14
var SettingsFile = "user://settings.cfg"
var screen_number = 0
var screen_orientation = 0
var window_maximized:bool = false
var video_default:bool = true
var window_fullscreen:bool = true
var window_borderless:bool = false
var window_resizable:bool = true
var window_size_x = 0
var window_size_y = 0
var window_always_on_top:bool = true
var debug:bool = true
var sound_lvl_music = 50
var sound_lvl_effect = 50
var sound_lvl_global = 50
var mute:bool = false
func msg_debug(text):
if debug:
var frame = get_stack()[1]
print("DEBUG [%s:%d] %s" % [frame.source, frame.line, text] )
func msg_info(text):
var frame = get_stack()[1]
print("INFO [%s:%d] %s" % [frame.source, frame.line, text] )
func msg_error(text):
var frame = get_stack()[1]
print("ERROR [%s:%d] %s" % [frame.source, frame.line, text] )
# Called when the node enters the scene tree for the first time.
func _ready():
load_config()
msg_debug("load end")
func set_window_fullscreen(value: bool):
#if ProjectSettings.has_setting( "display/window/size/fullscreen" ):
# ProjectSettings.set_setting("display/window/size/fullscreen", value)
window_fullscreen = value
if video_default == false:
OS.window_fullscreen = window_fullscreen
func set_window_borderless(value: bool):
#if ProjectSettings.has_setting( "display/window/size/borderless" ):
# ProjectSettings.set_setting("display/window/size/borderless", value)
window_borderless = value
if video_default == false:
OS.window_borderless = window_borderless
func set_window_resizable(value: bool):
#if ProjectSettings.has_setting( "display/window/size/resizable" ):
# ProjectSettings.set_setting("display/window/size/resizable", value)
window_resizable = true
if video_default == false:
OS.window_resizable = window_resizable
func set_window_width(value: int):
#if ProjectSettings.has_setting( "display/window/size/width" ):
# ProjectSettings.set_setting("display/window/size/width", value)
window_size_x = value
if video_default == false:
OS.window_size.x = window_size_x
#OS.window_fullscreen = ProjectSettings.get_setting("display/window/size/width")
func set_window_height(value: int):
#if ProjectSettings.has_setting( "display/window/size/height" ):
# ProjectSettings.set_setting("display/window/size/height", value)
window_size_y = value
if video_default == false:
OS.window_size.y = window_size_y
#OS.window_fullscreen = ProjectSettings.get_setting("display/window/size/height")
func set_font_size(value: int):
font_size = value
if video_default == false:
pass
func set_video_default(value):
video_default = value
func set_window_always_on_top(value: bool):
window_always_on_top = value
if video_default == false:
OS.set_window_always_on_top(window_always_on_top)
func set_current_screen(value: int):
screen_number = int(value)
if video_default == false:
OS.current_screen = screen_number
func set_screen_orientation(value: int):
if video_default == false:
screen_orientation = int(value)
OS.set_screen_orientation(screen_orientation)
func set_window_maximized(value: bool):
if value:
window_maximized = true
else:
window_maximized = false
if not video_default:
OS.set_window_maximized(window_maximized)
func enable_window_default():
# display/window/handheld/orientation
if ProjectSettings.has_setting( "display/window/handheld/orientation" ):
var num = 0
var default_orientation = ProjectSettings.get_setting("display/window/handheld/orientation")
match default_orientation:
"landscape":
num = 0
"portrait":
num = 1
"reverse_landscape":
num = 2
"reverse_portrait":
num = 3
"sensor_landscape":
num = 4
"sensor_portrait":
num = 5
"sensor":
num = 6
_:
num = 6
OS.set_screen_orientation(num)
OS.set_window_maximized(window_maximized)
OS.current_screen = screen_number
# display/window/size/always_on_top
if ProjectSettings.has_setting( "display/window/size/always_on_top" ):
OS.set_window_always_on_top( ProjectSettings.get_setting( "display/window/size/always_on_top" ) )
#OS.window_size.x = window_size_x
#OS.window_size.y = window_size_y
if ProjectSettings.has_setting( "display/window/size/fullscreen" ):
OS.window_fullscreen = ProjectSettings.get_setting( "display/window/size/fullscreen" )
if ProjectSettings.has_setting( "display/window/size/borderless" ):
OS.window_borderless = ProjectSettings.get_setting( "display/window/size/borderless" )
if ProjectSettings.has_setting( "display/window/size/resizable" ):
OS.window_resizable = ProjectSettings.get_setting( "display/window/size/resizable" )
func disable_window_default():
OS.set_screen_orientation(screen_orientation)
OS.set_window_maximized(window_maximized)
OS.current_screen = screen_number
OS.set_window_always_on_top(window_always_on_top)
#OS.window_size.x = window_size_x
#OS.window_size.y = window_size_y
OS.window_fullscreen = window_fullscreen
OS.window_borderless = window_borderless
OS.window_resizable = window_resizable
func set_sound_mute(value: bool):
Config.msg_debug("mute:" + str(value))
mute = value
func save_config():
var config_file = ConfigFile.new()
config_file.set_value( "theme", "font_size", 14 )
config_file.set_value( "display", "default", video_default )
config_file.set_value( "display", "fullscreen", OS.window_fullscreen )
config_file.set_value( "display", "borderless", OS.window_borderless )
config_file.set_value( "display", "resizable", OS.window_resizable )
#config_file.set_value( "display", "width", int( OS.window_size.x ) )
#config_file.set_value( "display", "height", int( OS.window_size.y ) )
config_file.set_value( "display", "window_always_on_top", OS.keep_screen_on )
config_file.set_value( "display", "screen_orientation", OS.get_screen_orientation() )
config_file.set_value( "display", "current_screen", screen_number )
config_file.set_value( "display", "window_maximized", window_maximized )
config_file.set_value( "sound", "global_level", sound_lvl_global )
config_file.set_value( "sound", "music_level", sound_lvl_music )
config_file.set_value( "sound", "effect_level", sound_lvl_effect )
config_file.set_value( "sound", "mute", mute )
config_file.save( SettingsFile )
#print("[res://ressources/scripts/config/config.gd] save_config")
func load_config():
var config_file = ConfigFile.new()
var err = config_file.load( SettingsFile )
if err == ERR_CANT_OPEN or err == ERR_FILE_NOT_FOUND:
# On suppose que le fichier n'existe pas encore, donc on le crée.
#print("[res://ressources/scripts/config/config.gd] Error to read, recreate config")
save_config()
elif not err == OK:
print("[res://ressources/scripts/config/config.gd] Error code when loading user://settings.cfg file: ", err)
font_size = config_file.get_value("theme", "font_size", false)
video_default = config_file.get_value("display", "default", true)
set_window_fullscreen(config_file.get_value("display", "fullscreen", true))
set_window_borderless(config_file.get_value("display", "borderless", false))
set_window_resizable(config_file.get_value("display", "resizable", true))
set_window_always_on_top(config_file.get_value("display", "window_always_on_top", true))
set_screen_orientation(config_file.get_value("display", "screen_orientation", 0))
set_current_screen(config_file.get_value("display", "current_screen", 0))
#set_window_width(config_file.get_value("display", "width", OS.window_size.x))
#set_window_height(config_file.get_value("display", "height", OS.window_size.y))
set_window_maximized(config_file.get_value("display", "window_maximized", OS.window_maximized))
sound_lvl_global = config_file.get_value("sound", "global_level", 100)
sound_lvl_music = config_file.get_value("sound", "music_level", 100)
sound_lvl_effect = config_file.get_value("sound", "effect_level", 100)
mute = config_file.get_value("sound", "mute", false)

View file

@ -7,8 +7,6 @@
[ext_resource path="res://assets/interfaces/cloth_on_icon.png" type="Texture" id=5]
[ext_resource path="res://assets/interfaces/zoom_head_icon.png" type="Texture" id=6]
[sub_resource type="DynamicFont" id=1]
size = 32
outline_size = 1
@ -44,11 +42,11 @@ __meta__ = {
}
[node name="window_box" type="VBoxContainer" parent="margin_box"]
margin_right = 1024.0
margin_bottom = 600.0
margin_right = 1280.0
margin_bottom = 720.0
[node name="title" type="Label" parent="margin_box/window_box"]
margin_right = 1024.0
margin_right = 1280.0
margin_bottom = 64.0
rect_min_size = Vector2( 0, 64 )
size_flags_vertical = 0
@ -59,104 +57,101 @@ valign = 1
[node name="content_box" type="HBoxContainer" parent="margin_box/window_box"]
margin_top = 68.0
margin_right = 1024.0
margin_bottom = 552.0
margin_right = 1280.0
margin_bottom = 666.0
size_flags_horizontal = 7
size_flags_vertical = 3
[node name="tabs_box" type="TabContainer" parent="margin_box/window_box/content_box"]
margin_right = 510.0
margin_bottom = 484.0
margin_right = 638.0
margin_bottom = 598.0
size_flags_horizontal = 3
[node name="definition" type="VBoxContainer" parent="margin_box/window_box/content_box/tabs_box"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 39.0
margin_right = -4.0
margin_bottom = -4.0
margin_top = 25.0
size_flags_horizontal = 6
size_flags_vertical = 6
[node name="race" type="HBoxContainer" parent="margin_box/window_box/content_box/tabs_box/definition"]
margin_right = 502.0
margin_bottom = 27.0
margin_right = 638.0
margin_bottom = 33.0
size_flags_horizontal = 7
alignment = 1
[node name="label" type="Label" parent="margin_box/window_box/content_box/tabs_box/definition/race"]
margin_top = 3.0
margin_right = 249.0
margin_bottom = 24.0
margin_top = 8.0
margin_right = 317.0
margin_bottom = 25.0
size_flags_horizontal = 11
text = "race"
align = 2
[node name="value" type="MenuButton" parent="margin_box/window_box/content_box/tabs_box/definition/race"]
margin_left = 253.0
margin_right = 502.0
margin_bottom = 27.0
margin_left = 321.0
margin_right = 638.0
margin_bottom = 33.0
rect_min_size = Vector2( 164, 0 )
size_flags_horizontal = 3
flat = false
[node name="sex" type="HBoxContainer" parent="margin_box/window_box/content_box/tabs_box/definition"]
margin_top = 31.0
margin_right = 502.0
margin_bottom = 58.0
margin_top = 37.0
margin_right = 638.0
margin_bottom = 70.0
size_flags_horizontal = 7
alignment = 1
[node name="label" type="Label" parent="margin_box/window_box/content_box/tabs_box/definition/sex"]
margin_top = 3.0
margin_right = 249.0
margin_bottom = 24.0
margin_top = 8.0
margin_right = 317.0
margin_bottom = 25.0
size_flags_horizontal = 11
text = "Sexe"
align = 2
[node name="value" type="MenuButton" parent="margin_box/window_box/content_box/tabs_box/definition/sex"]
margin_left = 253.0
margin_right = 502.0
margin_bottom = 27.0
margin_left = 321.0
margin_right = 638.0
margin_bottom = 33.0
rect_min_size = Vector2( 164, 0 )
size_flags_horizontal = 3
flat = false
[node name="name" type="HBoxContainer" parent="margin_box/window_box/content_box/tabs_box/definition"]
margin_top = 62.0
margin_right = 502.0
margin_bottom = 128.0
margin_top = 74.0
margin_right = 638.0
margin_bottom = 144.0
size_flags_horizontal = 7
alignment = 1
[node name="label" type="Label" parent="margin_box/window_box/content_box/tabs_box/definition/name"]
margin_top = 22.0
margin_right = 249.0
margin_top = 26.0
margin_right = 317.0
margin_bottom = 43.0
size_flags_horizontal = 3
text = "Nom"
align = 2
[node name="value" type="VBoxContainer" parent="margin_box/window_box/content_box/tabs_box/definition/name"]
margin_left = 253.0
margin_right = 502.0
margin_bottom = 66.0
margin_left = 321.0
margin_right = 638.0
margin_bottom = 70.0
rect_min_size = Vector2( 164, 0 )
size_flags_horizontal = 3
[node name="first_name" type="LineEdit" parent="margin_box/window_box/content_box/tabs_box/definition/name/value"]
margin_right = 249.0
margin_bottom = 31.0
margin_right = 317.0
margin_bottom = 33.0
hint_tooltip = "Caractères interdits: : / \\ ? * \" | % < >"
size_flags_horizontal = 3
placeholder_text = "First name"
[node name="last_name" type="LineEdit" parent="margin_box/window_box/content_box/tabs_box/definition/name/value"]
margin_top = 35.0
margin_right = 249.0
margin_bottom = 66.0
margin_top = 37.0
margin_right = 317.0
margin_bottom = 70.0
hint_tooltip = "Caractères interdits: : / \\ ? * \" | % < >"
size_flags_horizontal = 3
placeholder_text = "Last name"
@ -165,16 +160,13 @@ placeholder_text = "Last name"
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 39.0
margin_right = -4.0
margin_bottom = -4.0
margin_top = 25.0
[node name="aspect" type="VBoxContainer" parent="margin_box/window_box/content_box/tabs_box/Corps"]
margin_left = 125.0
margin_top = 22.0
margin_right = 376.0
margin_bottom = 418.0
margin_left = 194.0
margin_top = 120.0
margin_right = 443.0
margin_bottom = 452.0
size_flags_horizontal = 6
size_flags_vertical = 6
@ -485,15 +477,13 @@ step = 0.1
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 39.0
margin_right = -4.0
margin_bottom = -4.0
margin_top = 25.0
[node name="aspect" type="VBoxContainer" parent="margin_box/window_box/content_box/tabs_box/Tête"]
margin_left = 100.0
margin_right = 402.0
margin_bottom = 577.0
margin_left = 166.0
margin_top = 47.0
margin_right = 472.0
margin_bottom = 526.0
size_flags_horizontal = 6
size_flags_vertical = 6
@ -959,10 +949,7 @@ step = 0.1
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 39.0
margin_right = -4.0
margin_bottom = -4.0
margin_top = 25.0
size_flags_horizontal = 6
size_flags_vertical = 6
@ -1100,18 +1087,18 @@ value = 5.0
align = 1
[node name="preview_box" type="VBoxContainer" parent="margin_box/window_box/content_box"]
margin_left = 514.0
margin_right = 1024.0
margin_bottom = 484.0
margin_left = 642.0
margin_right = 1280.0
margin_bottom = 598.0
size_flags_horizontal = 11
size_flags_vertical = 3
alignment = 1
[node name="v_box_container" type="VBoxContainer" parent="margin_box/window_box/content_box/preview_box"]
margin_left = 446.0
margin_top = 210.0
margin_right = 510.0
margin_bottom = 274.0
margin_left = 574.0
margin_top = 267.0
margin_right = 638.0
margin_bottom = 331.0
size_flags_horizontal = 10
size_flags_vertical = 5
@ -1152,18 +1139,18 @@ icon = ExtResource( 1 )
expand_icon = true
[node name="tools_box" type="HBoxContainer" parent="margin_box/window_box"]
margin_top = 556.0
margin_right = 1024.0
margin_bottom = 583.0
margin_top = 670.0
margin_right = 1280.0
margin_bottom = 703.0
[node name="buttons_box" type="HBoxContainer" parent="margin_box/window_box/tools_box"]
margin_right = 510.0
margin_bottom = 27.0
margin_right = 638.0
margin_bottom = 33.0
size_flags_horizontal = 3
[node name="load" type="Button" parent="margin_box/window_box/tools_box/buttons_box"]
margin_right = 66.0
margin_bottom = 27.0
margin_right = 74.0
margin_bottom = 33.0
size_flags_horizontal = 4
custom_styles/focus = SubResource( 4 )
custom_colors/font_color_disabled = Color( 0, 0, 0, 0.501961 )
@ -1173,9 +1160,9 @@ custom_colors/font_color_pressed = Color( 1, 1, 1, 1 )
text = "Charger"
[node name="save" type="Button" parent="margin_box/window_box/tools_box/buttons_box"]
margin_left = 70.0
margin_right = 159.0
margin_bottom = 27.0
margin_left = 78.0
margin_right = 173.0
margin_bottom = 33.0
size_flags_horizontal = 4
custom_styles/focus = SubResource( 4 )
custom_colors/font_color_disabled = Color( 0, 0, 0, 0.501961 )
@ -1185,9 +1172,9 @@ custom_colors/font_color_pressed = Color( 1, 1, 1, 1 )
text = "Enregistrer"
[node name="choose" type="Button" parent="margin_box/window_box/tools_box/buttons_box"]
margin_left = 163.0
margin_right = 223.0
margin_bottom = 27.0
margin_left = 177.0
margin_right = 242.0
margin_bottom = 33.0
size_flags_horizontal = 4
custom_styles/focus = SubResource( 4 )
custom_colors/font_color_disabled = Color( 0, 0, 0, 0.501961 )
@ -1197,9 +1184,9 @@ custom_colors/font_color_pressed = Color( 1, 1, 1, 1 )
text = "Choisir"
[node name="quit" type="Button" parent="margin_box/window_box/tools_box/buttons_box"]
margin_left = 448.0
margin_right = 510.0
margin_bottom = 27.0
margin_left = 573.0
margin_right = 638.0
margin_bottom = 33.0
size_flags_horizontal = 10
custom_styles/focus = SubResource( 4 )
custom_colors/font_color_disabled = Color( 0, 0, 0, 0.501961 )
@ -1209,22 +1196,23 @@ custom_colors/font_color_pressed = Color( 1, 1, 1, 1 )
text = "Quitter"
[node name="spacer" type="Label" parent="margin_box/window_box/tools_box"]
margin_left = 514.0
margin_top = 3.0
margin_right = 1024.0
margin_bottom = 24.0
margin_left = 642.0
margin_top = 8.0
margin_right = 1280.0
margin_bottom = 25.0
size_flags_horizontal = 3
[node name="tooltips" type="Label" parent="margin_box/window_box"]
margin_top = 587.0
margin_right = 1024.0
margin_bottom = 600.0
margin_top = 707.0
margin_right = 1280.0
margin_bottom = 720.0
size_flags_vertical = 8
custom_fonts/font = SubResource( 5 )
custom_colors/font_color = Color( 1, 1, 1, 0.501961 )
text = "Menu de création de créatures."
align = 1
valign = 1
[connection signal="mouse_entered" from="." to="." method="_on_creature_creation_menu_mouse_entered"]
[connection signal="mouse_exited" from="." to="." method="_on_creature_creation_menu_mouse_exited"]
[connection signal="text_changed" from="margin_box/window_box/content_box/tabs_box/definition/name/value/first_name" to="." method="_on_first_name_text_changed"]

View file

@ -26,6 +26,7 @@ gravity = 0.0
[node name="directional_light" type="DirectionalLight" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.98872, 2.59328 )
light_specular = 0.1
[connection signal="choose_pressed" from="creature_creation_menu" to="." method="_on_creature_creation_menu_choose_pressed"]
[connection signal="cloths_button_toggled" from="creature_creation_menu" to="." method="_on_creature_creation_menu_cloths_button_toggled"]
[connection signal="load_pressed" from="creature_creation_menu" to="." method="_on_creature_creation_menu_load_pressed"]

View file

@ -8,7 +8,6 @@
[ext_resource path="res://assets/interfaces/slider_minus.png" type="Texture" id=6]
[ext_resource path="res://scenes/creatures/ra/ra.tscn" type="PackedScene" id=7]
[sub_resource type="ViewportTexture" id=1]
viewport_path = NodePath("viewport")
@ -243,6 +242,7 @@ size = 2.0
[node name="model" type="Spatial" parent="viewport"]
[node name="ra" parent="viewport/model" instance=ExtResource( 7 )]
[connection signal="text_changed" from="screen_box/tools_box/name/value" to="." method="_on_name_text_changed"]
[connection signal="color_changed" from="screen_box/tools_box/color/value" to="." method="_on_color_changed"]
[connection signal="value_changed" from="screen_box/tools_box/boobs/value" to="." method="_on_boobs_value_changed"]

View file

@ -12,30 +12,31 @@ __meta__ = {
}
[node name="label" type="Label" parent="."]
margin_left = 547.0
margin_left = 549.0
margin_top = 353.0
margin_right = 608.0
margin_right = 610.0
margin_bottom = 367.0
size_flags_horizontal = 10
custom_colors/font_color = Color( 0.0627451, 0.0313726, 0.45098, 1 )
text = "Anonyme"
[node name="select" type="Button" parent="."]
margin_left = 612.0
margin_left = 614.0
margin_top = 350.0
margin_right = 668.0
margin_right = 665.0
margin_bottom = 370.0
size_flags_horizontal = 0
size_flags_vertical = 6
text = "Choisir"
text = "Select"
[node name="delete" type="Button" parent="."]
margin_left = 672.0
margin_left = 669.0
margin_top = 350.0
margin_right = 726.0
margin_right = 733.0
margin_bottom = 370.0
size_flags_horizontal = 2
size_flags_vertical = 6
text = "Effacer"
text = "Remove"
[connection signal="pressed" from="select" to="." method="_on_select_pressed"]
[connection signal="pressed" from="delete" to="." method="_on_delete_pressed"]

View file

@ -48,19 +48,20 @@ size_flags_horizontal = 3
size_flags_vertical = 3
[node name="new" type="Button" parent="screen_box/scroll_container/v_box_container"]
margin_left = 196.0
margin_left = 244.0
margin_top = 330.0
margin_right = 404.0
margin_right = 355.0
margin_bottom = 363.0
size_flags_horizontal = 4
text = "Créer une nouvel créature."
text = "New creature"
[node name="cancel" type="Button" parent="screen_box/scroll_container/v_box_container"]
margin_left = 268.0
margin_left = 267.0
margin_top = 367.0
margin_right = 332.0
margin_bottom = 400.0
size_flags_horizontal = 4
text = "Retour"
text = "Cancel"
[connection signal="pressed" from="screen_box/scroll_container/v_box_container/new" to="." method="_on_new_pressed"]
[connection signal="pressed" from="screen_box/scroll_container/v_box_container/cancel" to="." method="_on_cancel_pressed"]

View file

@ -74,6 +74,7 @@ __meta__ = {
margin_left = 0.0
margin_right = 128.0
margin_bottom = 128.0
[connection signal="value_changed" from="stats_window/douleur" to="." method="_on_douleur_value_changed"]
[connection signal="value_changed" from="stats_window/oubli" to="." method="_on_oubli_value_changed"]
[connection signal="value_changed" from="stats_window/trauma" to="." method="_on_trauma_value_changed"]

View file

@ -10,6 +10,17 @@ func close():
func _on_play_pressed():
emit_signal( "play_pressed" )
func _on_quitter_pressed():
emit_signal( "quit_pressed" )
func _on_control_quit_pressed():
emit_signal( "quit_pressed" )
func _on_control_mute_pressed():
#Config.msg_debug("")
#emit_signal( "mute_pressed" )
pass
#func _on_main_menu_mute_pressed():
# Config.msg_debug("_on_main_menu_mute_pressed")
# emit_signal( "mute_pressed" )

View file

@ -1,8 +1,9 @@
[gd_scene load_steps=4 format=2]
[gd_scene load_steps=5 format=2]
[ext_resource path="res://assets/interfaces/Login-Khanat-background.png" type="Texture" id=1]
[ext_resource path="res://assets/interfaces/themes/khanat_theme.theme" type="Theme" id=2]
[ext_resource path="res://scenes/interfaces/main_menu/main_menu.gd" type="Script" id=3]
[ext_resource path="res://scenes/interfaces/options/options.tscn" type="PackedScene" id=4]
[node name="main_menu" type="Control"]
anchor_right = 1.0
@ -51,7 +52,7 @@ autowrap = true
margin_top = 21.0
margin_right = 256.0
margin_bottom = 54.0
text = "Jouer"
text = "MAIN_MENU_PLAY"
[node name="username" type="LineEdit" parent="screen_box/login_box"]
margin_top = 58.0
@ -59,7 +60,7 @@ margin_right = 256.0
margin_bottom = 91.0
rect_min_size = Vector2( 256, 0 )
align = 1
placeholder_text = "Username"
placeholder_text = "MAIN_MENU_USERNAME"
[node name="password" type="LineEdit" parent="screen_box/login_box"]
margin_top = 95.0
@ -68,12 +69,21 @@ margin_bottom = 128.0
rect_min_size = Vector2( 256, 0 )
align = 1
secret = true
placeholder_text = "Password"
placeholder_text = "MAIN_MENU_PASSWORD"
[node name="quitter" type="Button" parent="screen_box/login_box"]
[node name="quit" type="Button" parent="screen_box/login_box"]
margin_top = 132.0
margin_right = 256.0
margin_bottom = 165.0
text = "Quitter"
text = "MAIN_MENU_QUIT"
[node name="control" parent="." instance=ExtResource( 4 )]
anchor_left = 1.0
anchor_bottom = 0.0
margin_bottom = 0.0
size_flags_horizontal = 8
size_flags_vertical = 2
[connection signal="pressed" from="screen_box/login_box/play" to="." method="_on_play_pressed"]
[connection signal="pressed" from="screen_box/login_box/quitter" to="." method="_on_quitter_pressed"]
[connection signal="pressed" from="screen_box/login_box/quit" to="." method="_on_quitter_pressed"]
[connection signal="quit_pressed" from="control" to="." method="_on_control_quit_pressed"]

View file

@ -9,4 +9,5 @@ script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[connection signal="pressed" from="." to="." method="_on_music_button_pressed"]

View file

@ -1,7 +1,36 @@
extends WindowDialog
onready var audio_player = $music
func load_external_music(filepath):
var stream = null
Config.msg_debug("")
var file = File.new()
file.open(filepath, file.READ)
var ext = filepath.split(".")[-1].to_lower()
var buffer = file.get_buffer(file.get_len())
Config.msg_debug(ext)
match ext:
"ogg":
stream = AudioStreamOGGVorbis.new()
"mp3":
stream = AudioStreamMP3.new()
#"wav":
# # We need decode message to get format
# stream = AudioStreamSample.new()
# stream.format = AudioStreamSample.FORMAT_16_BITS
# #stream.stereo = true
_:
Config.msg_error("Impossible to identify type of file (file:" + filepath + ", ext:" + ext + ")")
return
stream.data = buffer
audio_player.stream = stream
Config.msg_debug("")
func _ready():
var directory = Directory.new()
get_tree().paused = false
Config.msg_debug("")
if not directory.dir_exists( "user://musics/" ):
directory.make_dir_recursive( "user://musics/" )
@ -17,6 +46,48 @@ func _ready():
directory.list_dir_end()
for file in files:
var button = preload( "res://scenes/interfaces/music_manager/music_button.tscn" ).instance()
button.music_filename = "res://assets/musics/" + file
button.text = file
button.connect( "music_selected", self, "_on_music_pressed" )
$window_box/scroll_box/musics_box.add_child( button )
audio_player.stream = load( "res://assets/musics/sangakanat_ames_voyageuses.ogg" )
#add_music(audio_player)
#audio_player.set_volume_db(linear2db(0.5))
#audio_player.set_volume_db(1.0)
audio_player.play()
#audio_player.set_volume_db(1.0)
#audioPlayer.play()
update_volume_db()
Config.msg_debug("Load End")
func update_volume_db():
if Config.mute:
audio_player.set_volume_db(linear2db(0.0))
audio_player.set_pause_mode(true)
return
var lvl = Config.sound_lvl_global * Config.sound_lvl_music / 10000.0
audio_player.set_volume_db(linear2db(lvl))
audio_player.set_pause_mode(false)
func set_sound_mute(value: bool):
Config.set_sound_mute(value)
update_volume_db()
func set_level_global(value: int):
Config.sound_lvl_global = value
update_volume_db()
func set_level_music(value: int):
Config.sound_lvl_music = value
update_volume_db()
func set_level_effect(value: int):
Config.sound_lvl_effect = value
update_volume_db()
func add_music(file):
var button = preload( "res://scenes/interfaces/music_manager/music_button.tscn" ).instance()
button.music_filename = file
button.text = file
@ -37,5 +108,10 @@ func toggle():
func _on_music_pressed( p_filename ):
$music.stream = load( "res://assets/musics/" + p_filename )
$music.play()
Config.msg_debug(p_filename)
#audio_player.stream = load( p_filename )
#audio_player.set_volume_db(1.0)
#audio_player.play()
#$music.stream = load( p_filename )
#$music.play()

View file

@ -32,8 +32,8 @@ __meta__ = {
}
[node name="controls_box" type="HBoxContainer" parent="window_box"]
margin_left = 26.0
margin_right = 102.0
margin_left = 90.0
margin_right = 166.0
margin_bottom = 16.0
size_flags_horizontal = 6
@ -62,14 +62,14 @@ texture_normal = ExtResource( 3 )
[node name="scroll_box" type="ScrollContainer" parent="window_box"]
margin_top = 20.0
margin_right = 128.0
margin_right = 256.0
margin_bottom = 128.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="musics_box" type="VBoxContainer" parent="window_box/scroll_box"]
margin_left = 64.0
margin_right = 64.0
margin_left = 128.0
margin_right = 128.0
size_flags_horizontal = 6
size_flags_vertical = 2

View file

@ -0,0 +1,72 @@
extends Control
func read_license(key):
var file = File.new()
var filenews = ""
if key.empty():
filenews = "res://LICENSE"
else:
filenews = "res://LICENSE_" + key
if file.file_exists(filenews):
#print(filenews + " exist ! ")
file.open(filenews, File.READ)
var content = file.get_as_text()
file.close()
$window_dialog/margin_container/v_box_container/tab_container/OPTION_INFO_LICENSE.text = content
return true
return false
func load_license():
var current_locale = TranslationServer.get_locale()
var root_language = current_locale.split('_')[0]
var file = File.new()
var filenews = ""
if read_license(current_locale):
pass
elif read_license(root_language):
pass
elif read_license(""):
pass
func read_authors(key):
var file = File.new()
var filenews = ""
if key.empty():
filenews = "res://AUTHORS"
else:
filenews = "res://AUTHORS_" + key
if file.file_exists(filenews):
#print(filenews + " exist ! ")
file.open(filenews, File.READ)
var content = file.get_as_text()
file.close()
$window_dialog/margin_container/v_box_container/tab_container/OPTION_INFO_AUTHORS.text = content
return true
return false
func load_authors():
var current_locale = TranslationServer.get_locale()
var root_language = current_locale.split('_')[0]
var file = File.new()
var filenews = ""
if read_authors(current_locale):
pass
elif read_authors(root_language):
pass
elif read_authors(""):
pass
# Called when the node enters the scene tree for the first time.
func _ready():
load_authors()
load_license()
func _on_button_pressed():
$window_dialog.hide()

View file

@ -0,0 +1,80 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://scenes/interfaces/options/option_info.gd" type="Script" id=1]
[node name="control" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="window_dialog" type="WindowDialog" parent="."]
visible = true
margin_left = 247.505
margin_top = 164.032
margin_right = 927.505
margin_bottom = 558.032
window_title = "OPTION_INFO_TITLE"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="margin_container" type="MarginContainer" parent="window_dialog"]
anchor_right = 1.0
anchor_bottom = 1.0
custom_constants/margin_right = 5
custom_constants/margin_top = 5
custom_constants/margin_left = 5
custom_constants/margin_bottom = 5
__meta__ = {
"_edit_use_anchors_": false
}
[node name="v_box_container" type="VBoxContainer" parent="window_dialog/margin_container"]
margin_left = 5.0
margin_top = 5.0
margin_right = 675.0
margin_bottom = 389.0
custom_constants/separation = 5
[node name="tab_container" type="TabContainer" parent="window_dialog/margin_container/v_box_container"]
margin_right = 670.0
margin_bottom = 359.0
size_flags_horizontal = 3
size_flags_vertical = 3
__meta__ = {
"_edit_use_anchors_": false
}
[node name="OPTION_INFO_AUTHORS" type="TextEdit" parent="window_dialog/margin_container/v_box_container/tab_container"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 32.0
margin_right = -4.0
margin_bottom = -4.0
size_flags_horizontal = 3
size_flags_vertical = 3
readonly = true
[node name="OPTION_INFO_LICENSE" type="TextEdit" parent="window_dialog/margin_container/v_box_container/tab_container"]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 32.0
margin_right = -4.0
margin_bottom = -4.0
[node name="button" type="Button" parent="window_dialog/margin_container/v_box_container"]
margin_top = 364.0
margin_right = 670.0
margin_bottom = 384.0
text = "OPTION_INFO_EXIT"
__meta__ = {
"_edit_use_anchors_": false
}
[connection signal="pressed" from="window_dialog/margin_container/v_box_container/button" to="." method="_on_button_pressed"]

View file

@ -0,0 +1,46 @@
extends Control
# Called when the node enters the scene tree for the first time.
func _ready():
$window_dialog/margin_container/v_box_container/option_button.clear()
var id = 0
var selected = -1
var near_selected = -1
var current_locale = TranslationServer.get_locale()
var root_language = current_locale.split('_')[0]
for key in TranslationServer.get_loaded_locales():
if key == TranslationServer.get_locale():
selected = id
else:
var tmp = key.split("_")
# print("tmp:" + tmp[0])
if tmp[0] == root_language:
if tmp.size() == 1:
near_selected = id
elif near_selected == -1:
near_selected = id
$window_dialog/margin_container/v_box_container/option_button.add_item(TranslationServer.get_locale_name(key) + " [" + key + "]", id)
id += 1
if selected == -1 and near_selected != -1:
selected = near_selected
if selected == -1:
# Your language not exist, create it just for the form
var key = TranslationServer.get_locale()
$window_dialog/margin_container/v_box_container/option_button.add_item(TranslationServer.get_locale_name(key) + " (" + key + " !)", id)
selected = id
$window_dialog/margin_container/v_box_container/option_button.select(selected)
func _on_option_button_item_selected(index):
var id = 0
for key in TranslationServer.get_loaded_locales():
if id == $window_dialog/margin_container/v_box_container/option_button.get_selected():
TranslationServer.set_locale(key)
return
id += 1
func _on_button_pressed():
$window_dialog.hide()

View file

@ -0,0 +1,66 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://scenes/interfaces/options/option_language.gd" type="Script" id=1]
[node name="control" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="window_dialog" type="WindowDialog" parent="."]
margin_left = 448.0
margin_top = 216.0
margin_right = 795.0
margin_bottom = 340.0
popup_exclusive = true
window_title = "OPTION_LANGUAGE_SELECT_YOUR_LANGUAGE"
resizable = true
__meta__ = {
"_edit_use_anchors_": false
}
[node name="margin_container" type="MarginContainer" parent="window_dialog"]
anchor_right = 1.0
anchor_bottom = 1.0
size_flags_horizontal = 3
size_flags_vertical = 3
custom_constants/margin_right = 5
custom_constants/margin_top = 5
custom_constants/margin_left = 5
custom_constants/margin_bottom = 5
__meta__ = {
"_edit_use_anchors_": false
}
[node name="v_box_container" type="VBoxContainer" parent="window_dialog/margin_container"]
margin_left = 5.0
margin_top = 5.0
margin_right = 342.0
margin_bottom = 119.0
size_flags_horizontal = 3
size_flags_vertical = 3
custom_constants/separation = 5
[node name="option_button" type="OptionButton" parent="window_dialog/margin_container/v_box_container"]
margin_right = 337.0
margin_bottom = 89.0
size_flags_horizontal = 3
size_flags_vertical = 3
__meta__ = {
"_edit_use_anchors_": false
}
[node name="button" type="Button" parent="window_dialog/margin_container/v_box_container"]
margin_top = 94.0
margin_right = 337.0
margin_bottom = 114.0
text = "OPTION_LANGUAGE_EXIT"
__meta__ = {
"_edit_use_anchors_": false
}
[connection signal="item_selected" from="window_dialog/margin_container/v_box_container/option_button" to="." method="_on_option_button_item_selected"]
[connection signal="pressed" from="window_dialog/margin_container/v_box_container/button" to="." method="_on_button_pressed"]

View file

@ -0,0 +1,58 @@
extends Control
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
func read_news(key):
var file = File.new()
var filenews = ""
if key.empty():
filenews = "res://NEWS"
else:
filenews = "res://NEWS_" + key
if file.file_exists(filenews):
#print(filenews + " exist ! ")
file.open(filenews, File.READ)
var content = file.get_as_text()
file.close()
#print(content)
#$accept_dialog.dialog_text = content
$window_dialog/margin_container/v_box_container/text_edit.text = content
return true
return false
func load_news():
var current_locale = TranslationServer.get_locale()
var root_language = current_locale.split('_')[0]
var file = File.new()
var filenews = ""
if read_news(current_locale):
pass
elif read_news(root_language):
pass
elif read_news(""):
pass
func _on_accept_dialog_visibility_changed():
if $accept_dialog.visible:
print("show")
load_news()
func _on_accept_dialog_hide():
$accept_dialog.dialog_text = ""
func _on_button_pressed():
$window_dialog.hide()
func _on_window_dialog_visibility_changed():
if $window_dialog.visible:
load_news()

View file

@ -0,0 +1,74 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://scenes/interfaces/options/option_news.gd" type="Script" id=1]
[node name="control" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 3.48987
margin_top = -2.90425
margin_right = 3.48987
margin_bottom = -2.90424
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="window_dialog" type="WindowDialog" parent="."]
visible = true
margin_left = 362.868
margin_top = 192.977
margin_right = 944.868
margin_bottom = 513.977
window_title = "OPTION_NEWS_TITLE"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="margin_container" type="MarginContainer" parent="window_dialog"]
anchor_right = 1.0
anchor_bottom = 1.0
size_flags_horizontal = 3
size_flags_vertical = 3
custom_constants/margin_right = 5
custom_constants/margin_top = 5
custom_constants/margin_left = 5
custom_constants/margin_bottom = 5
__meta__ = {
"_edit_use_anchors_": false
}
[node name="v_box_container" type="VBoxContainer" parent="window_dialog/margin_container"]
margin_left = 5.0
margin_top = 5.0
margin_right = 577.0
margin_bottom = 316.0
size_flags_horizontal = 3
size_flags_vertical = 3
custom_constants/separation = 5
__meta__ = {
"_edit_use_anchors_": false
}
[node name="text_edit" type="TextEdit" parent="window_dialog/margin_container/v_box_container"]
margin_right = 572.0
margin_bottom = 286.0
size_flags_horizontal = 3
size_flags_vertical = 3
readonly = true
syntax_highlighting = true
__meta__ = {
"_edit_use_anchors_": false
}
[node name="button" type="Button" parent="window_dialog/margin_container/v_box_container"]
margin_top = 291.0
margin_right = 572.0
margin_bottom = 311.0
text = "OPTION_NEWS_EXIT"
__meta__ = {
"_edit_use_anchors_": false
}
[connection signal="visibility_changed" from="window_dialog" to="." method="_on_window_dialog_visibility_changed"]
[connection signal="pressed" from="window_dialog/margin_container/v_box_container/button" to="." method="_on_button_pressed"]

View file

@ -0,0 +1,185 @@
extends Control
signal mute_pressed
var slots_number = 0
var slots = {}
var firstime = false
# Called when the node enters the scene tree for the first time.
func _ready():
# default video configuration
if Config.video_default:
$window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/h_box_container_8/default.pressed = true
$window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video.visible = false
else:
$window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/h_box_container_8/default.pressed = false
$window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video.visible = true
# Font size
$window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/h_box_container_9/font.value = Config.font_size
# window fullscreen
if ProjectSettings.has_setting( "display/window/size/fullscreen" ):
$window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video/h_box_container/fullscreen.pressed = Config.window_fullscreen
# ProjectSettings.get_setting( "display/window/size/fullscreen" )
$window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video/h_box_container/fullscreen.disabled = false
else:
$window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video/h_box_container/fullscreen.disabled = true
# window borderless
if ProjectSettings.has_setting( "display/window/size/borderless" ):
$window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video/h_box_container_2/borderless.pressed = Config.window_borderless
# ProjectSettings.get_setting( "display/window/size/borderless" )
$window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video/h_box_container_2/borderless.disabled = false
else:
$window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video/h_box_container_2/borderless.disabled = true
# window resizable
if ProjectSettings.has_setting( "display/window/size/resizable" ):
$window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video/h_box_container_3/resizable.pressed = Config.window_resizable
# ProjectSettings.get_setting( "display/window/size/resizable" )
$window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video/h_box_container_3/resizable.disabled = false
else:
$window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video/h_box_container_3/resizable.disabled = true
# Screen number
$window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video/h_box_container_4/screen.min_value = 0
$window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video/h_box_container_4/screen.max_value = OS.get_screen_count() - 1
$window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video/h_box_container_4/screen.value = OS.current_screen
$window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video/h_box_container_4/screen.editable = true
# Screen orientation
$window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video/h_box_container_5/orientation.value = OS.get_screen_orientation()
$window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video/h_box_container_5/orientation.editable = true
# always_on_top
if ProjectSettings.has_setting( "display/window/size/always_on_top" ):
$window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video/h_box_container_6/always_on_top.pressed = OS.is_keep_screen_on()
$window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video/h_box_container_6/always_on_top.disabled = false
else:
$window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video/h_box_container_6/always_on_top.disabled = true
# window maximized
$window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video/h_box_container_7/window_maximized.pressed = Config.window_maximized
$window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video/h_box_container_7/window_maximized.disabled = false
# Level sound
$window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_SOUND/h_box_container_3/sound_lvl_global.value = Config.sound_lvl_global
$window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_SOUND/h_box_container_6/sound_lvl_music.value = Config.sound_lvl_music
$window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_SOUND/h_box_container_4/sound_lvl_effect.value = Config.sound_lvl_effect
# Mute
#$window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_SOUND/h_box_container_2/mute.pressed = Config.mute
update_mute()
func update_mute():
Config.msg_debug("")
$window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_SOUND/h_box_container_2/mute.pressed = Config.mute
func _on_fullscreen_toggled(button_pressed):
Config.set_window_fullscreen(button_pressed)
func _on_borderless_toggled(button_pressed):
Config.set_window_borderless(button_pressed)
func _on_resizable_toggled(button_pressed):
Config.set_window_resizable(button_pressed)
func _on_window_maximized_toggled(button_pressed):
Config.set_window_maximized(button_pressed)
func _on_screen_value_changed(value):
Config.set_current_screen(value)
# SCREEN_ORIENTATION_LANDSCAPE = 0 Landscape screen orientation.
# SCREEN_ORIENTATION_PORTRAIT = 1 Portrait screen orientation.
# SCREEN_ORIENTATION_REVERSE_LANDSCAPE = 2 Reverse landscape screen orientation.
# SCREEN_ORIENTATION_REVERSE_PORTRAIT = 3 Reverse portrait screen orientation.
# SCREEN_ORIENTATION_SENSOR_LANDSCAPE = 4 Uses landscape or reverse landscape based on the hardware sensor.
# SCREEN_ORIENTATION_SENSOR_PORTRAIT = 5 Uses portrait or reverse portrait based on the hardware sensor.
# SCREEN_ORIENTATION_SENSOR = 6 Uses most suitable orientation based on
func _on_orientation_value_changed(value):
# display/window/handheld/orientation
#print(OS.screen_orientation)
#print(ProjectSettings.get_setting("display/window/handheld/orientation"))
#if ProjectSettings.has_setting( "display/window/handheld/orientation" ):
# ProjectSettings.set_setting("display/window/handheld/orientation", value)
##OS.screen_orientation = value
#print(OS.get_screen_orientation())
Config.set_screen_orientation(value)
#OS.set_screen_orientation(value)
func _on_always_on_top_toggled(button_pressed):
Config.set_window_always_on_top(button_pressed)
func _on_add_music_pressed():
pass # Replace with function body.
$file_dialog.show()
func _on_file_dialog_files_selected(paths):
print("multi files")
for path in paths:
var found = false
for slot in self.slots:
if self.slots[slot].music_filename == path:
found = true
continue
if found:
continue
var music_box = preload( "res://scenes/interfaces/options/option_settings_music_box.tscn" ).instance()
music_box.get_node( "label" ).text = path
#music_box.enable.pressed = true
#music_box.zone = "All"
music_box.slot = self.slots_number
music_box.music_filename = path
#creature_box.connect( "select_pressed", self, "_on_creature_box_select_pressed" )
music_box.connect( "delete_pressed", self, "_on_music_box_delete_pressed" )
$window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_SOUND/scroll_container/list_music.add_child(music_box)
MusicManager.add_music(path)
self.slots[ self.slots_number ] = music_box
self.slots_number += 1
func _on_music_box_delete_pressed( slot ):
if self.slots[ slot ].music_filename:
#var dir = Directory.new()
#dir.remove( "user://creatures/" + self.slots[ slot ].creature_filename )
pass
self.slots[ slot ].queue_free()
func _on_default_toggled(button_pressed):
if button_pressed:
$window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/h_box_container_8/default.pressed = true
$window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video.visible = false
Config.enable_window_default()
else:
$window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/h_box_container_8/default.pressed = false
$window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video.visible = true
Config.disable_window_default()
Config.set_video_default(button_pressed)
func _on_font_value_changed(value):
var valueint = int(value)
Config.set_font_size(value)
func _on_sound_lvl_global_value_changed(value):
MusicManager.set_level_global(int(value))
func _on_sound_lvl_music_value_changed(value):
MusicManager.set_level_music(int(value))
func _on_sound_lvl_effect_value_changed(value):
MusicManager.set_level_effect(int(value))
func _on_ok_pressed():
$file_dialog.hide()
$window_dialog.hide()
Config.save_config()
func _on_window_dialog_hide():
$file_dialog.hide()
if firstime:
Config.save_config()
func _on_window_dialog_draw():
firstime = true
func _on_mute_toggled(button_pressed):
Config.msg_debug("")
MusicManager.set_sound_mute(button_pressed)
emit_signal( "mute_pressed" )
#func _on_control_mute_pressed():
# update_mute()

View file

@ -0,0 +1,445 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://scenes/interfaces/options/option_settings.gd" type="Script" id=1]
[node name="control" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="window_dialog" type="WindowDialog" parent="."]
margin_left = 55.2183
margin_top = 62.4725
margin_right = 1231.22
margin_bottom = 674.473
__meta__ = {
"_edit_use_anchors_": false
}
[node name="margin_container" type="MarginContainer" parent="window_dialog"]
anchor_right = 1.0
anchor_bottom = 1.0
size_flags_horizontal = 3
size_flags_vertical = 3
custom_constants/margin_right = 5
custom_constants/margin_top = 5
custom_constants/margin_left = 5
custom_constants/margin_bottom = 5
__meta__ = {
"_edit_use_anchors_": false
}
[node name="v_box_container" type="VBoxContainer" parent="window_dialog/margin_container"]
margin_left = 5.0
margin_top = 5.0
margin_right = 1171.0
margin_bottom = 607.0
custom_constants/separation = 5
__meta__ = {
"_edit_use_anchors_": false
}
[node name="tab_container" type="TabContainer" parent="window_dialog/margin_container/v_box_container"]
margin_right = 1166.0
margin_bottom = 577.0
size_flags_horizontal = 3
size_flags_vertical = 3
custom_constants/label_valign_fg = 0
custom_constants/hseparation = 0
custom_constants/label_valign_bg = 0
custom_constants/top_margin = 0
custom_constants/side_margin = 0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="OPTION_SETTINGS_VIDEO" type="VBoxContainer" parent="window_dialog/margin_container/v_box_container/tab_container"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 32.0
margin_right = -4.0
margin_bottom = -4.0
[node name="h_box_container_8" type="HBoxContainer" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO"]
margin_right = 1158.0
margin_bottom = 24.0
size_flags_horizontal = 3
[node name="label" type="Label" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/h_box_container_8"]
margin_left = 349.0
margin_top = 5.0
margin_right = 577.0
margin_bottom = 19.0
size_flags_horizontal = 10
text = "OPTION_SETTINGS_VIDEO_DEFAULT"
[node name="default" type="CheckBox" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/h_box_container_8"]
margin_left = 581.0
margin_right = 605.0
margin_bottom = 24.0
size_flags_horizontal = 2
[node name="h_box_container_9" type="HBoxContainer" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO"]
margin_top = 28.0
margin_right = 1158.0
margin_bottom = 52.0
size_flags_horizontal = 3
[node name="label" type="Label" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/h_box_container_9"]
margin_left = 338.0
margin_top = 5.0
margin_right = 577.0
margin_bottom = 19.0
size_flags_horizontal = 10
text = "OPTION_SETTINGS_VIDEO_SIZE_FONT"
[node name="font" type="SpinBox" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/h_box_container_9"]
margin_left = 581.0
margin_right = 655.0
margin_bottom = 24.0
size_flags_horizontal = 2
min_value = 8.0
value = 8.0
[node name="settings_video" type="GridContainer" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO"]
margin_top = 56.0
margin_right = 1158.0
margin_bottom = 158.0
custom_constants/vseparation = 2
custom_constants/hseparation = 0
columns = 2
[node name="h_box_container" type="HBoxContainer" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video"]
margin_right = 579.0
margin_bottom = 24.0
size_flags_horizontal = 3
[node name="label" type="Label" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video/h_box_container"]
margin_left = 38.0
margin_top = 5.0
margin_right = 287.0
margin_bottom = 19.0
size_flags_horizontal = 10
text = "OPTION_SETTINGS_VIDEO_FULLSCREEN"
[node name="fullscreen" type="CheckBox" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video/h_box_container"]
margin_left = 291.0
margin_right = 315.0
margin_bottom = 24.0
size_flags_horizontal = 2
[node name="h_box_container_2" type="HBoxContainer" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video"]
margin_left = 579.0
margin_right = 1158.0
margin_bottom = 24.0
size_flags_horizontal = 3
[node name="label" type="Label" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video/h_box_container_2"]
margin_left = 35.0
margin_top = 5.0
margin_right = 287.0
margin_bottom = 19.0
size_flags_horizontal = 10
text = "OPTION_SETTINGS_VIDEO_BORDERLESS"
[node name="borderless" type="CheckBox" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video/h_box_container_2"]
margin_left = 291.0
margin_right = 315.0
margin_bottom = 24.0
size_flags_horizontal = 2
[node name="h_box_container_7" type="HBoxContainer" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video"]
margin_top = 26.0
margin_right = 579.0
margin_bottom = 50.0
size_flags_horizontal = 3
[node name="label" type="Label" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video/h_box_container_7"]
margin_top = 5.0
margin_right = 315.0
margin_bottom = 19.0
size_flags_horizontal = 10
text = "OPTION_SETTINGS_VIDEO_WINDOW_MAXIMIZED"
[node name="window_maximized" type="CheckBox" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video/h_box_container_7"]
margin_left = 319.0
margin_right = 343.0
margin_bottom = 24.0
size_flags_horizontal = 2
[node name="h_box_container_3" type="HBoxContainer" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video"]
margin_left = 579.0
margin_top = 26.0
margin_right = 1158.0
margin_bottom = 50.0
size_flags_horizontal = 3
[node name="label" type="Label" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video/h_box_container_3"]
margin_left = 49.0
margin_top = 5.0
margin_right = 287.0
margin_bottom = 19.0
size_flags_horizontal = 10
text = "OPTION_SETTINGS_VIDEO_RESIZABLE"
[node name="resizable" type="CheckBox" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video/h_box_container_3"]
margin_left = 291.0
margin_right = 315.0
margin_bottom = 24.0
size_flags_horizontal = 2
__meta__ = {
"_edit_use_anchors_": false
}
[node name="h_box_container_4" type="HBoxContainer" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video"]
margin_top = 52.0
margin_right = 579.0
margin_bottom = 76.0
size_flags_horizontal = 3
[node name="label" type="Label" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video/h_box_container_4"]
margin_left = 69.0
margin_top = 5.0
margin_right = 287.0
margin_bottom = 19.0
size_flags_horizontal = 10
text = "OPTION_SETTINGS_VIDEO_SCREEN"
[node name="screen" type="SpinBox" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video/h_box_container_4"]
margin_left = 291.0
margin_right = 365.0
margin_bottom = 24.0
size_flags_horizontal = 2
[node name="h_box_container_5" type="HBoxContainer" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video"]
margin_left = 579.0
margin_top = 52.0
margin_right = 1158.0
margin_bottom = 76.0
size_flags_horizontal = 3
[node name="label" type="Label" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video/h_box_container_5"]
margin_top = 5.0
margin_right = 314.0
margin_bottom = 19.0
size_flags_horizontal = 10
text = "OPTION_SETTINGS_VIDEO_SCREEN_ORIENTATION"
[node name="orientation" type="SpinBox" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video/h_box_container_5"]
margin_left = 318.0
margin_right = 392.0
margin_bottom = 24.0
size_flags_horizontal = 2
max_value = 6.0
[node name="h_box_container_6" type="HBoxContainer" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video"]
margin_top = 78.0
margin_right = 579.0
margin_bottom = 102.0
size_flags_horizontal = 3
[node name="label" type="Label" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video/h_box_container_6"]
margin_top = 5.0
margin_right = 350.0
margin_bottom = 19.0
size_flags_horizontal = 10
text = "OPTION_SETTINGS_VIDEO_WINDOW_ALWAYS_ON_TOP"
[node name="always_on_top" type="CheckBox" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video/h_box_container_6"]
margin_left = 354.0
margin_right = 579.0
margin_bottom = 24.0
size_flags_horizontal = 3
[node name="OPTION_SETTINGS_SOUND" type="GridContainer" parent="window_dialog/margin_container/v_box_container/tab_container"]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 32.0
margin_right = -4.0
margin_bottom = -4.0
[node name="h_box_container_2" type="HBoxContainer" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_SOUND"]
margin_right = 1158.0
margin_bottom = 24.0
size_flags_horizontal = 3
[node name="label" type="Label" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_SOUND/h_box_container_2"]
margin_left = 363.0
margin_top = 5.0
margin_right = 577.0
margin_bottom = 19.0
size_flags_horizontal = 10
text = "OPTION_SETTINGS_SOUND_MUTE"
[node name="mute" type="CheckBox" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_SOUND/h_box_container_2"]
margin_left = 581.0
margin_right = 605.0
margin_bottom = 24.0
size_flags_horizontal = 2
[node name="h_box_container_3" type="HBoxContainer" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_SOUND"]
margin_top = 28.0
margin_right = 1158.0
margin_bottom = 42.0
size_flags_horizontal = 3
[node name="label" type="Label" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_SOUND/h_box_container_3"]
margin_left = 304.0
margin_right = 577.0
margin_bottom = 14.0
size_flags_horizontal = 10
text = "OPTION_SETTINGS_SOUND_LEVEL_GLOBAL"
[node name="sound_lvl_global" type="HScrollBar" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_SOUND/h_box_container_3"]
margin_left = 581.0
margin_right = 1158.0
margin_bottom = 12.0
size_flags_horizontal = 3
step = 1.0
rounded = true
custom_step = 10.0
[node name="h_box_container_6" type="HBoxContainer" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_SOUND"]
margin_top = 46.0
margin_right = 1158.0
margin_bottom = 60.0
size_flags_horizontal = 3
[node name="label" type="Label" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_SOUND/h_box_container_6"]
margin_left = 315.0
margin_right = 577.0
margin_bottom = 14.0
size_flags_horizontal = 10
text = "OPTION_SETTINGS_SOUND_LEVEL_MUSIC"
[node name="sound_lvl_music" type="HScrollBar" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_SOUND/h_box_container_6"]
margin_left = 581.0
margin_right = 1158.0
margin_bottom = 12.0
size_flags_horizontal = 3
step = 1.0
[node name="h_box_container_4" type="HBoxContainer" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_SOUND"]
margin_top = 64.0
margin_right = 1158.0
margin_bottom = 78.0
size_flags_horizontal = 3
[node name="label" type="Label" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_SOUND/h_box_container_4"]
margin_left = 314.0
margin_right = 577.0
margin_bottom = 14.0
size_flags_horizontal = 10
text = "OPTION_SETTINGS_SOUND_LEVEL_EFFECT"
[node name="sound_lvl_effect" type="HScrollBar" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_SOUND/h_box_container_4"]
margin_left = 581.0
margin_right = 1158.0
margin_bottom = 12.0
size_flags_horizontal = 3
[node name="h_box_container_5" type="HBoxContainer" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_SOUND"]
margin_top = 82.0
margin_right = 1158.0
margin_bottom = 106.0
size_flags_horizontal = 3
[node name="label" type="Label" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_SOUND/h_box_container_5"]
margin_left = 315.0
margin_top = 5.0
margin_right = 577.0
margin_bottom = 19.0
size_flags_horizontal = 10
text = "OPTION_SETTINGS_SOUND_YOUR_MUSIC"
[node name="mute" type="CheckBox" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_SOUND/h_box_container_5"]
margin_left = 581.0
margin_right = 605.0
margin_bottom = 24.0
size_flags_horizontal = 2
[node name="h_box_container" type="HBoxContainer" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_SOUND"]
margin_top = 110.0
margin_right = 1158.0
margin_bottom = 130.0
size_flags_horizontal = 3
[node name="label" type="Label" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_SOUND/h_box_container"]
margin_top = 3.0
margin_right = 289.0
margin_bottom = 17.0
text = "OPTION_SETTINGS_SOUND_YOUR_SELECTION"
[node name="add_music" type="Button" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_SOUND/h_box_container"]
margin_left = 293.0
margin_right = 587.0
margin_bottom = 20.0
text = "OPTION_SETTINGS_SOUND_SELECTION_ADD"
[node name="scroll_container" type="ScrollContainer" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_SOUND"]
margin_top = 134.0
margin_right = 1158.0
margin_bottom = 541.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="list_music" type="VBoxContainer" parent="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_SOUND/scroll_container"]
margin_right = 1158.0
margin_bottom = 407.0
size_flags_horizontal = 3
size_flags_vertical = 3
custom_constants/separation = 4
[node name="ok" type="Button" parent="window_dialog/margin_container/v_box_container"]
margin_top = 582.0
margin_right = 1166.0
margin_bottom = 602.0
text = "OPTION_SETTINGS_EXIT"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="file_dialog" type="FileDialog" parent="."]
margin_left = 156.0
margin_top = 237.0
margin_right = 1102.0
margin_bottom = 586.0
popup_exclusive = true
window_title = "Ouvrir un ou plusieurs fichiers"
resizable = true
mode = 1
access = 2
filters = PoolStringArray( "*.mp3,*.ogg" )
show_hidden_files = true
current_dir = "/home/aleajactaest/Projets/khanat/khanat-client-new"
current_path = "/home/aleajactaest/Projets/khanat/khanat-client-new/"
__meta__ = {
"_edit_use_anchors_": false
}
[connection signal="mute_pressed" from="." to="." method="_on_control_mute_pressed"]
[connection signal="draw" from="window_dialog" to="." method="_on_window_dialog_draw"]
[connection signal="hide" from="window_dialog" to="." method="_on_window_dialog_hide"]
[connection signal="modal_closed" from="window_dialog" to="." method="_on_window_dialog_modal_closed"]
[connection signal="toggled" from="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/h_box_container_8/default" to="." method="_on_default_toggled"]
[connection signal="value_changed" from="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/h_box_container_9/font" to="." method="_on_font_value_changed"]
[connection signal="toggled" from="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video/h_box_container/fullscreen" to="." method="_on_fullscreen_toggled"]
[connection signal="toggled" from="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video/h_box_container_2/borderless" to="." method="_on_borderless_toggled"]
[connection signal="toggled" from="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video/h_box_container_7/window_maximized" to="." method="_on_window_maximized_toggled"]
[connection signal="toggled" from="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video/h_box_container_3/resizable" to="." method="_on_resizable_toggled"]
[connection signal="value_changed" from="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video/h_box_container_4/screen" to="." method="_on_screen_value_changed"]
[connection signal="value_changed" from="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video/h_box_container_5/orientation" to="." method="_on_orientation_value_changed"]
[connection signal="toggled" from="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_VIDEO/settings_video/h_box_container_6/always_on_top" to="." method="_on_always_on_top_toggled"]
[connection signal="toggled" from="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_SOUND/h_box_container_2/mute" to="." method="_on_mute_toggled"]
[connection signal="value_changed" from="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_SOUND/h_box_container_3/sound_lvl_global" to="." method="_on_sound_lvl_global_value_changed"]
[connection signal="value_changed" from="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_SOUND/h_box_container_6/sound_lvl_music" to="." method="_on_sound_lvl_music_value_changed"]
[connection signal="value_changed" from="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_SOUND/h_box_container_4/sound_lvl_effect" to="." method="_on_sound_lvl_effect_value_changed"]
[connection signal="pressed" from="window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_SOUND/h_box_container/add_music" to="." method="_on_add_music_pressed"]
[connection signal="pressed" from="window_dialog/margin_container/v_box_container/ok" to="." method="_on_ok_pressed"]
[connection signal="files_selected" from="file_dialog" to="." method="_on_file_dialog_files_selected"]

View file

@ -0,0 +1,13 @@
extends HBoxContainer
signal select_pressed( slot )
signal delete_pressed( slot )
var slot = null
var music_filename = null
func _on_select_pressed():
emit_signal( "select_pressed", self.slot )
func _on_delete_pressed():
emit_signal( "delete_pressed", self.slot )

View file

@ -0,0 +1,28 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://scenes/interfaces/options/option_settings_music_box.gd" type="Script" id=1]
[node name="h_box_container" type="HBoxContainer"]
margin_right = 40.0
margin_bottom = 40.0
size_flags_horizontal = 3
custom_constants/separation = 0
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="delete" type="Button" parent="."]
margin_right = 310.0
margin_bottom = 40.0
text = "OPTION_SETTINGS_SOUND_SELECTION_DELETE"
[node name="label" type="Label" parent="."]
margin_left = 310.0
margin_top = 13.0
margin_right = 330.0
margin_bottom = 27.0
size_flags_horizontal = 3
text = "file"
[connection signal="pressed" from="delete" to="." method="_on_delete_pressed"]

View file

@ -0,0 +1,51 @@
extends Control
signal quit_pressed
signal mute_pressed
func _ready():
get_node("option_settings").connect("mute_pressed", self, "_on_control_mute_pressed")
update_sound_button()
func _on_quit_button_pressed():
emit_signal( "quit_pressed" )
func _on_language_button_pressed():
$option_language/window_dialog.show()
func _on_news_button_pressed():
#$option_news/accept_dialog.show()
$option_news/window_dialog.show()
func _on_help_button_pressed():
$option_info/window_dialog.show()
func _on_settings_button_pressed():
$option_settings/window_dialog.show()
func update_sound_button():
Config.msg_debug("")
if Config.mute:
$options_reduce/h_box_container/sound_button.texture_normal = load ( "res://assets/interfaces/Login-Khanat-sound-muted-button.png")
$options_reduce/h_box_container/sound_button.texture_hover = load ( "res://assets/interfaces/Login-Khanat-sound-muted-button-hover.png")
else:
$options_reduce/h_box_container/sound_button.texture_normal = load ( "res://assets/interfaces/Login-Khanat-sound-button.png")
$options_reduce/h_box_container/sound_button.texture_hover = load ( "res://assets/interfaces/Login-Khanat-sound-button-hover.png")
func _on_sound_button_pressed():
Config.msg_debug("")
MusicManager.set_sound_mute(not Config.mute)
emit_signal( "mute_pressed" )
func _on_control_mute_pressed():
Config.msg_debug("received signal mute")
update_sound_button()
$option_settings/window_dialog/margin_container/v_box_container/tab_container/OPTION_SETTINGS_SOUND/h_box_container_2/mute.pressed = Config.mute

View file

@ -0,0 +1,122 @@
[gd_scene load_steps=19 format=2]
[ext_resource path="res://scenes/interfaces/options/options.gd" type="Script" id=1]
[ext_resource path="res://assets/interfaces/Login-Khanat-help-button.png" type="Texture" id=2]
[ext_resource path="res://assets/interfaces/Login-Khanat-quit-button.png" type="Texture" id=3]
[ext_resource path="res://assets/interfaces/options.png" type="Texture" id=4]
[ext_resource path="res://assets/interfaces/Login-Khanat-settings-button.png" type="Texture" id=5]
[ext_resource path="res://assets/interfaces/Login-Khanat-sound-button.png" type="Texture" id=6]
[ext_resource path="res://assets/interfaces/Login-Khanat-help-button-hover.png" type="Texture" id=7]
[ext_resource path="res://assets/interfaces/Login-Khanat-news-button.png" type="Texture" id=8]
[ext_resource path="res://assets/interfaces/Login-Khanat-language-button.png" type="Texture" id=9]
[ext_resource path="res://assets/interfaces/Login-Khanat-quit-button-hover.png" type="Texture" id=10]
[ext_resource path="res://scenes/interfaces/options/option_language.tscn" type="PackedScene" id=11]
[ext_resource path="res://scenes/interfaces/options/option_news.tscn" type="PackedScene" id=12]
[ext_resource path="res://scenes/interfaces/options/option_info.tscn" type="PackedScene" id=13]
[ext_resource path="res://assets/interfaces/Login-Khanat-sound-button-hover.png" type="Texture" id=14]
[ext_resource path="res://assets/interfaces/Login-Khanat-news-button-hover.png" type="Texture" id=15]
[ext_resource path="res://assets/interfaces/Login-Khanat-language-button-hover.png" type="Texture" id=16]
[ext_resource path="res://assets/interfaces/Login-Khanat-settings-button-hover.png" type="Texture" id=17]
[ext_resource path="res://scenes/interfaces/options/option_settings.tscn" type="PackedScene" id=18]
[node name="control" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_bottom = -651.0
size_flags_horizontal = 9
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="options_reduce" type="TextureRect" parent="."]
anchor_left = 1.0
anchor_right = 1.0
margin_left = -416.0
margin_bottom = 69.0
mouse_default_cursor_shape = 5
texture = ExtResource( 4 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="h_box_container" type="HBoxContainer" parent="options_reduce"]
margin_left = 30.0
margin_right = 396.0
margin_bottom = 64.0
alignment = 2
__meta__ = {
"_edit_use_anchors_": false
}
[node name="news_button" type="TextureButton" parent="options_reduce/h_box_container"]
margin_left = 22.0
margin_right = 76.0
margin_bottom = 64.0
texture_normal = ExtResource( 8 )
texture_hover = ExtResource( 15 )
[node name="language_button" type="TextureButton" parent="options_reduce/h_box_container"]
margin_left = 80.0
margin_right = 134.0
margin_bottom = 64.0
texture_normal = ExtResource( 9 )
texture_hover = ExtResource( 16 )
[node name="sound_button" type="TextureButton" parent="options_reduce/h_box_container"]
margin_left = 138.0
margin_right = 192.0
margin_bottom = 64.0
texture_normal = ExtResource( 6 )
texture_hover = ExtResource( 14 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="help_button" type="TextureButton" parent="options_reduce/h_box_container"]
margin_left = 196.0
margin_right = 250.0
margin_bottom = 64.0
texture_normal = ExtResource( 2 )
texture_hover = ExtResource( 7 )
[node name="settings_button" type="TextureButton" parent="options_reduce/h_box_container"]
margin_left = 254.0
margin_right = 308.0
margin_bottom = 64.0
texture_normal = ExtResource( 5 )
texture_hover = ExtResource( 17 )
[node name="quit_button" type="TextureButton" parent="options_reduce/h_box_container"]
margin_left = 312.0
margin_right = 366.0
margin_bottom = 64.0
texture_normal = ExtResource( 3 )
texture_hover = ExtResource( 10 )
[node name="option_language" parent="." instance=ExtResource( 11 )]
visible = false
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -640.0
margin_top = -34.5
margin_right = 640.0
margin_bottom = 34.5
[node name="option_news" parent="." instance=ExtResource( 12 )]
visible = false
[node name="option_info" parent="." instance=ExtResource( 13 )]
visible = false
[node name="option_settings" parent="." instance=ExtResource( 18 )]
[connection signal="mute_pressed" from="." to="." method="_on_control_mute_pressed"]
[connection signal="pressed" from="options_reduce/h_box_container/news_button" to="." method="_on_news_button_pressed"]
[connection signal="pressed" from="options_reduce/h_box_container/language_button" to="." method="_on_language_button_pressed"]
[connection signal="pressed" from="options_reduce/h_box_container/sound_button" to="." method="_on_sound_button_pressed"]
[connection signal="pressed" from="options_reduce/h_box_container/help_button" to="." method="_on_help_button_pressed"]
[connection signal="pressed" from="options_reduce/h_box_container/settings_button" to="." method="_on_settings_button_pressed"]
[connection signal="pressed" from="options_reduce/h_box_container/quit_button" to="." method="_on_quit_button_pressed"]

View file

@ -169,3 +169,11 @@ func _on_connexion_ok():
func _on_connection_error( message ):
$main_menu/screen_box/login_box/error.text = message
func _on_mute_pressed():
pass
# $main_menu/control/option_settings.update_sound_button()
func _on_main_menu_mute_pressed():
Config.msg_debug("_on_main_menu_mute_pressed")
$main_menu/control/option_settings.update_sound_button()

View file

@ -10,8 +10,11 @@ script = ExtResource( 3 )
[node name="scene" type="Spatial" parent="."]
[node name="main_menu" parent="." instance=ExtResource( 1 )]
margin_top = 1.49832
margin_bottom = 1.49829
[node name="loading_screen" parent="." instance=ExtResource( 2 )]
visible = false
[connection signal="play_pressed" from="main_menu" to="." method="_on_main_menu_play_pressed"]
[connection signal="quit_pressed" from="main_menu" to="." method="_on_main_menu_quit_pressed"]