Small code request
Moderator: Forum Moderators
Small code request
This would be a fairly simple thing to code if you can code, I'd imagine. So, if there's a new coder lurking around somewhere, here's a perfect opportunity to contribute a small but useful feature.
The problem is this: the command mode command ":refresh" reloads all graphics files, which is very useful when tweaking and testing graphics in-game. But it only refreshes graphics. I'd like it to reload the sound files (not music though, just the effects) as well, so I could tweak and test sounds without the painful process of quitting and starting the game between every modification.
The problem is this: the command mode command ":refresh" reloads all graphics files, which is very useful when tweaking and testing graphics in-game. But it only refreshes graphics. I'd like it to reload the sound files (not music though, just the effects) as well, so I could tweak and test sounds without the painful process of quitting and starting the game between every modification.
-
- Retired Developer
- Posts: 2633
- Joined: March 22nd, 2004, 11:22 pm
- Location: An Earl's Roadstead
Re: Small code request
Just a note: this should probably be a seperate command from refresh.zookeeper wrote:This would be a fairly simple thing to code if you can code, I'd imagine. So, if there's a new coder lurking around somewhere, here's a perfect opportunity to contribute a small but useful feature.
The problem is this: the command mode command ":refresh" reloads all graphics files, which is very useful when tweaking and testing graphics in-game. But it only refreshes graphics. I'd like it to reload the sound files (not music though, just the effects) as well, so I could tweak and test sounds without the painful process of quitting and starting the game between every modification.
"you can already do that with WML"
Fight Creeeping Biggerism!
http://www.wesnoth.org/forum/viewtopic. ... 760#131760
http://www.wesnoth.org/forum/viewtopic. ... 1358#11358
:resound?
I think a :recache command would be popular too (sorry to derail).
I think a :recache command would be popular too (sorry to derail).
Hope springs eternal.
Wesnoth acronym guide.
Wesnoth acronym guide.
Does anyone want to take this on? If no one with experience wants to do this, I'd like to try. I want to start contributing some code to wesnoth, maybe this would be a good start? Can any developers give me some pointers on what files need to be modified? I guess understanding how :refresh works would be useful.
If by 'recache' you mean reload WML, you should note that this would be difficult to implement the way you probably want it.scott wrote: I think a :recache command would be popular too (sorry to derail).
The best we could probably do is to do the equivalent of saving the game, reloading all WML, and then reloading the game. However, if you make changes to the scenario this wouldn't have any effect since scenario data is only loaded at the start of a scenario -- after this it is all obtained from the save, which by definition would be using the old version of the scenario.
Reloading sound would be easy though. It might be best to make :refresh refresh everything by default, but support arguments. E.g. :refresh gfx or :refresh sfx or :refresh music or :refresh wml.
David
“At Gambling, the deadly sin is to mistake bad play for bad luck.” -- Ian Fleming
If the hypothetical "recache" command just repeats what the game does at startup, requiring us to use start-of-scenario saves, that by itself would be enough to qualify as very useful.Dave wrote: If by 'recache' you mean reload WML, you should note that this would be difficult to implement the way you probably want it.
The best we could probably do is to do the equivalent of saving the game, reloading all WML, and then reloading the game. However, if you make changes to the scenario this wouldn't have any effect since scenario data is only loaded at the start of a scenario -- after this it is all obtained from the save, which by definition would be using the old version of the scenario.
Hope springs eternal.
Wesnoth acronym guide.
Wesnoth acronym guide.