Opened 7 years ago
Closed 6 years ago
#4677 closed enhancement (fixed)
Add a 8-bit music Easter Egg
Reported by: | Itms | Owned by: | elexis |
---|---|---|---|
Priority: | Should Have | Milestone: | Alpha 23 |
Component: | Music & Sound FX | Keywords: | |
Cc: | Patch: | Phab:D1097 |
Description
The 8-bit version of Honor Bound is not currently used. It would be nice to play it when a cheat code is entered. The code could be "retro me" or "0.8. Bit" or something even funnier :)
The music can be found here: audio/trunk/music/0_8Bit_Bonus_Track.wav and should be converted to ogg.
Change History (9)
comment:1 by , 6 years ago
comment:2 by , 6 years ago
Perhaps a new state in music.js
, for instance CUSTOMPLAYLIST
might suit to prevent the track to be reset each turn from updateGUIObjects()
in session.js
.
(With that we could perhaps even create a 0ad soundtrack player.)
In the scope of the ticket, perhaps its sufficient to switch to this state and then prevent any further state switches.
This might still start a new song when opening new GUI pages, such as the summary screen or message boxes (like "do you want to delete this unit?"). But that might not really be an issue with an easteregg feature.
comment:3 by , 6 years ago
I tried creating a new state and it doesn't work, because list change mechanism
Music.prototype.setState = function(state) { this.reference.currentState = state; this.updateState(); }; Music.prototype.updateState = function() { if (this.currentState != this.oldState) { this.oldState = this.currentState; switch (this.currentState)
If i change the play list to something new eg.: states.RETRO
the next turn of updateGUIObjects()
will overwrite. Because of this:
this.currentState != this.oldState
Where currentState
is 2 and oldSate
is 6 for example.
comment:4 by , 6 years ago
That's why I suggested to not switch the state in setState
if the state is the new custom one.
comment:5 by , 6 years ago
Keywords: | simple removed |
---|---|
Patch: | → Phab:D1097 |
comment:6 by , 6 years ago
In r20733:
Allow cheats to pass negative numeric arguments and default parameters for cheat arguments that are strings, refs D1097.
comment:8 by , 6 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Actually let me reopen the ticket so that we don't forget the ogg file.
Cheats can currently only execute code in the simulation, thus can't access the music code directly.
One way to implement it would be adding
executeGUICheat
tosubmitChatInput
ingui/session/messages.js
. But that would conflict a bit with the fact that all cheats should be contained in a single place.So I would suggest to add the following code to
Cheat.js
for the proposed cheatand an entry in
g_NotificationsTypes
processing that to access the music prototype.