Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add: Bg3 tts #827

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions SQL/paradise_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ CREATE TABLE `player` (
`server_region` VARCHAR(32) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
`muted_adminsounds_ckeys` MEDIUMTEXT NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
`viewrange` VARCHAR(5) NOT NULL DEFAULT '19x15' COLLATE 'utf8mb4_general_ci',
`species_whitelist` LONGTEXT COLLATE utf8mb4_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `ckey` (`ckey`),
KEY `lastseen` (`lastseen`),
Expand Down
4 changes: 4 additions & 0 deletions SQL/updates220/53.220.5-53.220.6.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Updating DB from 53.220.5 to 53.220.6
# Adds species whitelist ~legendaxe

ALTER TABLE `player` ADD `species_whitelist` LONGTEXT COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '["human"]';
2 changes: 1 addition & 1 deletion code/__DEFINES/misc_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@
#define INVESTIGATE_BOMB "bombs"

// The SQL version required by this version of the code
#define SQL_VERSION 532205 // SS220 EDIT
#define SQL_VERSION 532206 // SS220 EDIT

// Vending machine stuff
#define CAT_NORMAL 1
Expand Down
15 changes: 13 additions & 2 deletions code/game/jobs/whitelist.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,20 @@
if(NOT_SELECTABLE in S.species_traits)
return FALSE

// SS220 EDIT START

// Yes if admin
if(check_rights(R_ADMIN, FALSE))
return TRUE
//if(check_rights(R_ADMIN, FALSE))
// return TRUE

if(GLOB.configuration.species_whitelist.species_whitelist_enabled)
if(!M.client?.prefs?.species_whitelist)
return FALSE

if(!(species in M.client.prefs.species_whitelist))
return FALSE

// SS220 EDIT END

// No if species is blacklisted
if(S.blacklisted)
Expand Down
8 changes: 7 additions & 1 deletion config/example/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ ipc_screens = [
# Enable/disable the database on a whole
sql_enabled = false
# SQL version. If this is a mismatch, round start will be delayed
sql_version = 532205
sql_version = 532206
# SQL server address. Can be an IP or DNS name
sql_address = "127.0.0.1"
# SQL server port
Expand Down Expand Up @@ -895,3 +895,9 @@ ffmpeg_cpuaffinity = ""
force_discord_verification = false

################################################################

[species_whitelist_configuration]

species_whitelist_enabled = false

################################################################
1 change: 1 addition & 0 deletions modular_ss220/modular_ss220.dme
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
#include "mecha_skins/mecha_skins.dme"
#include "queue/_queue.dme"
#include "phrases/_phrases.dme"
#include "species_whitelist/_species_whitelist.dme"

// --- PRIME --- //
// #define MODPACK_MAIN_ONLY
Expand Down
4 changes: 4 additions & 0 deletions modular_ss220/species_whitelist/_species_whitelist.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/datum/modpack/discord_link
name = "Вайтлист на расы"
desc = "Добавление вайтлиста на расы"
author = "legendaxe"
4 changes: 4 additions & 0 deletions modular_ss220/species_whitelist/_species_whitelist.dme
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#include "_species_whitelist.dm"

#include "code/species_whitelist_configuration.dm"
#include "code/species_whitelist_preferences.dm"
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/datum/server_configuration
/// Holder for the gateway configuration datum
var/datum/configuration_section/species_whitelist_configuration/species_whitelist

/datum/server_configuration/load_all_sections()
. = ..()
species_whitelist = new()
safe_load(species_whitelist, "species_whitelist_configuration")

/datum/configuration_section/species_whitelist_configuration
var/species_whitelist_enabled = FALSE

/datum/configuration_section/species_whitelist_configuration/load_data(list/data)
CONFIG_LOAD_BOOL(species_whitelist_enabled, data["species_whitelist_enabled"])
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/datum/preferences
var/species_whitelist

/datum/preferences/proc/get_species_whitelist()
. = TRUE

if(species_whitelist)
return

var/datum/db_query/preferences_query = SSdbcore.NewQuery("SELECT species_whitelist FROM player WHERE ckey=:ckey", list(
"ckey" = parent.ckey
))

if(!preferences_query.warn_execute())
qdel(preferences_query)
return FALSE

while(preferences_query.NextRow())
var/species_whitelist_json = preferences_query.item[1]
if(species_whitelist_json)
species_whitelist = json_decode(preferences_query.item[1])

qdel(preferences_query)

/datum/preferences/load_preferences(datum/db_query/query)
. = ..()
if(!.)
return

return get_species_whitelist()
1 change: 1 addition & 0 deletions modular_ss220/text_to_speech/code/_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#define TTS_CATEGORY_LEFT4DEAD "Left 4 Dead"
#define TTS_CATEGORY_SPONGEBOB "SpongeBob"
#define TTS_CATEGORY_TINYBUNNY "Tiny Bunny"
#define TTS_CATEGORY_BALDURS_GATE_3 "Baldur's gate 3"

#define TTS_GENDER_ANY "Любой"
#define TTS_GENDER_MALE "Мужской"
Expand Down
78 changes: 78 additions & 0 deletions modular_ss220/text_to_speech/code/seeds/silero.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4327,3 +4327,81 @@
category = TTS_CATEGORY_WITCHER
gender = TTS_GENDER_MALE
required_donator_level = 1

/datum/tts_seed/silero/gale
name = "Gale"
value = "en_Gale"
category = TTS_CATEGORY_BALDURS_GATE_3
gender = TTS_GENDER_MALE

/datum/tts_seed/silero/jaheira
name = "Jaheira"
value = "en_Jaheira"
category = TTS_CATEGORY_BALDURS_GATE_3
gender = TTS_GENDER_FEMALE

/datum/tts_seed/silero/laezel
name = "Laezel"
value = "en_Laezel"
category = TTS_CATEGORY_BALDURS_GATE_3
gender = TTS_GENDER_FEMALE

/datum/tts_seed/silero/karlach
name = "Karlach"
value = "en_Karlach"
category = TTS_CATEGORY_BALDURS_GATE_3
gender = TTS_GENDER_FEMALE

/datum/tts_seed/silero/shadowheart
name = "Shadowheart"
value = "en_Shadowheart"
category = TTS_CATEGORY_BALDURS_GATE_3
gender = TTS_GENDER_FEMALE

/datum/tts_seed/silero/wyll
name = "Wyll"
value = "en_Wyll"
category = TTS_CATEGORY_BALDURS_GATE_3
gender = TTS_GENDER_MALE

/datum/tts_seed/silero/minthara
name = "Minthara"
value = "en_Minthara"
category = TTS_CATEGORY_BALDURS_GATE_3
gender = TTS_GENDER_FEMALE

/datum/tts_seed/silero/minsc
name = "Minsc"
value = "en_Minsc"
category = TTS_CATEGORY_BALDURS_GATE_3
gender = TTS_GENDER_MALE

/datum/tts_seed/silero/astarion
name = "Astarion"
value = "en_Astarion"
category = TTS_CATEGORY_BALDURS_GATE_3
gender = TTS_GENDER_MALE

/datum/tts_seed/silero/halsin
name = "Halsin"
value = "en_Halsin"
category = TTS_CATEGORY_BALDURS_GATE_3
gender = TTS_GENDER_MALE

/datum/tts_seed/silero/emperor_bg3
name = "Emperor"
value = "en_Emperor"
category = TTS_CATEGORY_BALDURS_GATE_3
gender = TTS_GENDER_MALE

/datum/tts_seed/silero/ketheric
name = "Ketheric"
value = "en_Ketheric"
category = TTS_CATEGORY_BALDURS_GATE_3
gender = TTS_GENDER_MALE

/datum/tts_seed/silero/gortash
name = "Gortash"
value = "en_Gortash"
category = TTS_CATEGORY_BALDURS_GATE_3
gender = TTS_GENDER_MALE