mirror of
https://github.com/glest/glest-source.git
synced 2025-09-01 20:12:40 +02:00
core_data.cpp:allow user-configurable sfx
This allows users to set their own sound effects using glestuser.ini Any values from glest.ini can be used in glestuser.ini, and when in glestuser.ini, they override the values in glest.ini. Not yet documented. This adds only 2 sfx, and shows how to do it. This will change how #63 is done
This commit is contained in:
@@ -94,3 +94,7 @@ UnitParticles=true
|
|||||||
UserData_Root=$HOME/.zetaglest/
|
UserData_Root=$HOME/.zetaglest/
|
||||||
VersionURL=http://zetaglest.dreamhosters.com/files/versions/
|
VersionURL=http://zetaglest.dreamhosters.com/files/versions/
|
||||||
Windowed=false
|
Windowed=false
|
||||||
|
|
||||||
|
; sfx
|
||||||
|
PlaySoundAttention=../../../zetaglest-data/data/core/menu/sound/attention.wav
|
||||||
|
PlaySoundHighlight=../../../zetaglest-data/data/core/menu/sound/highlight.wav
|
||||||
|
@@ -92,3 +92,7 @@ UnitParticles=true
|
|||||||
UserData_Root=$HOME/.zetaglest/
|
UserData_Root=$HOME/.zetaglest/
|
||||||
VersionURL=http://zetaglest.dreamhosters.com/files/versions/
|
VersionURL=http://zetaglest.dreamhosters.com/files/versions/
|
||||||
Windowed=true
|
Windowed=true
|
||||||
|
|
||||||
|
; sfx
|
||||||
|
PlaySoundAttention=../../../zetaglest-data/data/core/menu/sound/attention.wav
|
||||||
|
PlaySoundHighlight=../../../zetaglest-data/data/core/menu/sound/highlight.wav
|
||||||
|
@@ -94,3 +94,7 @@ UnitParticles=true
|
|||||||
UserData_Root=$APPDATA\zetaglest\
|
UserData_Root=$APPDATA\zetaglest\
|
||||||
VersionURL=http://zetaglest.dreamhosters.com/files/versions/
|
VersionURL=http://zetaglest.dreamhosters.com/files/versions/
|
||||||
Windowed=false
|
Windowed=false
|
||||||
|
|
||||||
|
; sfx
|
||||||
|
PlaySoundAttention=..\..\..\zetaglest-data\data\core\menu\sound\attention.wav
|
||||||
|
PlaySoundHighlight=..\..\..\zetaglest-data\data\core\menu\sound\highlight.wav
|
||||||
|
@@ -1,13 +1,22 @@
|
|||||||
// ==============================================================
|
// core_data.cpp: game setup menu as it appears to
|
||||||
// This file is part of Glest (www.glest.org)
|
// connected clients (not the host or user setting up the game)
|
||||||
//
|
//
|
||||||
// Copyright (C) 2001-2008 Martiño Figueroa
|
// Copyright (C) 2018 The ZetaGlest team <https://github.com/ZetaGlest>
|
||||||
//
|
//
|
||||||
// You can redistribute this code and/or modify it under
|
// ZetaGlest is a fork of MegaGlest <https://megaglest.org>
|
||||||
// the terms of the GNU General Public License as published
|
//
|
||||||
// by the Free Software Foundation; either version 2 of the
|
// This program is free software: you can redistribute it and/or modify
|
||||||
// License, or (at your option) any later version
|
// it under the terms of the GNU General Public License as published by
|
||||||
// ==============================================================
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
#include "core_data.h"
|
#include "core_data.h"
|
||||||
|
|
||||||
@@ -614,9 +623,8 @@ StaticSound *CoreData::getAttentionSound() {
|
|||||||
itemLoadAttempted[loadAttemptLookupKey] = true;
|
itemLoadAttempted[loadAttemptLookupKey] = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
string data_path = getDataPath();
|
static Config &config = Config::getInstance();
|
||||||
attentionSound.load(getGameCustomCoreDataPath(data_path,
|
attentionSound.load(config.getString ("PlaySoundAttention", ""));
|
||||||
CORE_MENU_SOUND_PATH + "attention.wav"));
|
|
||||||
}
|
}
|
||||||
catch (const megaglest_runtime_error& ex) {
|
catch (const megaglest_runtime_error& ex) {
|
||||||
message(ex.what(), GlobalStaticFlags::getIsNonGraphicalModeEnabled(),
|
message(ex.what(), GlobalStaticFlags::getIsNonGraphicalModeEnabled(),
|
||||||
@@ -633,9 +641,8 @@ StaticSound *CoreData::getHighlightSound() {
|
|||||||
itemLoadAttempted[loadAttemptLookupKey] = true;
|
itemLoadAttempted[loadAttemptLookupKey] = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
string data_path = getDataPath();
|
static Config &config = Config::getInstance();
|
||||||
highlightSound.load(getGameCustomCoreDataPath(data_path,
|
highlightSound.load(config.getString ("PlaySoundHighlight", ""));
|
||||||
CORE_MENU_SOUND_PATH + "highlight.wav"));
|
|
||||||
}
|
}
|
||||||
catch (const megaglest_runtime_error& ex) {
|
catch (const megaglest_runtime_error& ex) {
|
||||||
message(ex.what(), GlobalStaticFlags::getIsNonGraphicalModeEnabled(),
|
message(ex.what(), GlobalStaticFlags::getIsNonGraphicalModeEnabled(),
|
||||||
|
@@ -1,13 +1,22 @@
|
|||||||
// ==============================================================
|
// core_data.h: game setup menu as it appears to
|
||||||
// This file is part of Glest (www.glest.org)
|
// connected clients (not the host or user setting up the game)
|
||||||
//
|
//
|
||||||
// Copyright (C) 2001-2008 Martiño Figueroa
|
// Copyright (C) 2018 The ZetaGlest team <https://github.com/ZetaGlest>
|
||||||
//
|
//
|
||||||
// You can redistribute this code and/or modify it under
|
// ZetaGlest is a fork of MegaGlest <https://megaglest.org>
|
||||||
// the terms of the GNU General Public License as published
|
//
|
||||||
// by the Free Software Foundation; either version 2 of the
|
// This program is free software: you can redistribute it and/or modify
|
||||||
// License, or (at your option) any later version
|
// it under the terms of the GNU General Public License as published by
|
||||||
// ==============================================================
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
#ifndef _GLEST_GAME_COREDATA_H_
|
#ifndef _GLEST_GAME_COREDATA_H_
|
||||||
#define _GLEST_GAME_COREDATA_H_
|
#define _GLEST_GAME_COREDATA_H_
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
// This program is distributed in the hope that it will be useful,
|
// This program is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
Reference in New Issue
Block a user