Skip to content

Commit

Permalink
Merge pull request #15 from c0des1ayr/main
Browse files Browse the repository at this point in the history
Add new setting to set a custom music loop point
  • Loading branch information
tariq-nasheed authored Jul 14, 2024
2 parents ba78583 + 61df69b commit 5bbb9c1
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/hypermania/HyperManiaVariables.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ typedef struct {
bool32 twoHeavensMode; // set to true to enable "Two Heavens mode" letting you choose between turning super OR hyper with the latter form consuming rings at a faster rate
bool32 enableHyperMusic; // set to true to enable hyper music (duhhh!!!!!)
bool32 superTailsOnly; // set to enable vanilla S3&K super tails logic (hyper tails = super tails, can't turn super tails with chaos emeralds)
int32 hyperMusicLoopPoint; // set when changing the Hyper track (defaults to 423801)
} HM_Config;

typedef struct {
Expand Down
3 changes: 2 additions & 1 deletion src/hypermania/ModConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ typedef struct {
float screenFlashFactor; // set to control intensity of screen flashes, with 1.0 being full intensity and 0.0 disabling flashes
bool32 twoHeavensMode; // set to true to enable "Two Heavens mode" letting you choose between turning super OR hyper with the latter form consuming rings at a faster rate
bool32 enableHyperMusic; // set to true to enable hyper music (duhhh!!!!!)
int32 hyperMusicLoopPoint; // set when changing the Hyper track (defaults to 423801)
} ModConfig_t;

extern ModConfig_t ModConfig;

#endif //! MOD_CONFIG_H
#endif //! MOD_CONFIG_H
2 changes: 2 additions & 0 deletions src/hypermania/dllmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ void InitModAPI() {
HM_globals->config.GSWitemBoxes = Mod.GetSettingsBool("", "Config:GSWitemBoxes", true);
HM_globals->config.JEAjank = Mod.GetSettingsBool("", "Config:JEAjank", false);
HM_globals->config.superTailsOnly = Mod.GetSettingsBool("", "Config:superTailsOnly", false);
HM_globals->config.hyperMusicLoopPoint = Mod.GetSettingsInteger("", "Config:hyperMusicLoopPoint", 423801);
Mod.SetSettingsInteger("Config:hyperStyle", HM_globals->config.hyperStyle);
Mod.SetSettingsBool("Config:hyperFlashDropDash", HM_globals->config.hyperFlashDropDash);
Mod.SetSettingsBool("Config:hyperFlashForwarding", HM_globals->config.hyperFlashForwarding);
Expand All @@ -121,6 +122,7 @@ void InitModAPI() {
Mod.SetSettingsBool("Config:GSWitemBoxes", HM_globals->config.GSWitemBoxes);
Mod.SetSettingsBool("Config:JEAjank", HM_globals->config.JEAjank);
Mod.SetSettingsBool("Config:superTailsOnly", HM_globals->config.superTailsOnly);
Mod.SetSettingsInteger("Config:hyperMusicLoopPoint", HM_globals->config.hyperMusicLoopPoint);
Mod.SaveSettings();

// Boilerplate ---------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions src/hypermania/mod/Global/Player.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,10 +348,10 @@ void Player_Update_OVERLOAD() {
}

// music handling ------------------------------------------------------
if (!ERZStart && HM_globals->config.enableHyperMusic && Music->trackLoops[TRACK_SUPER] != 423801 &&
if (!ERZStart && HM_globals->config.enableHyperMusic && Music->trackLoops[TRACK_SUPER] != HM_globals->config.hyperMusicLoopPoint &&
(Music->activeTrack == TRACK_SUPER || !HM_globals->config.twoHeavensMode)) {
#if MANIA_USE_PLUS
Music_SetMusicTrack("Hyper.ogg", TRACK_SUPER, 423801);
Music_SetMusicTrack("Hyper.ogg", TRACK_SUPER, HM_globals->config.hyperMusicLoopPoint);
if (Music->activeTrack == TRACK_SUPER) Music_PlayJingle(TRACK_SUPER);
#else
//Music_TransitionTrack(TRACK_HYPER, 1.0);
Expand Down Expand Up @@ -691,4 +691,4 @@ int32 Player_GetIndexFromID(int32 ID) {
#endif
}
return index;
}
}
1 change: 1 addition & 0 deletions src/release-files/modSettings.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ hyperFlashForwarding = N
hyperStyle = 0
screenFlashFactor = 1.000000
twoHeavensMode = N
hyperMusicLoopPoint = 423801

0 comments on commit 5bbb9c1

Please sign in to comment.