File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,28 +50,21 @@ Want to add your own insane stuff to this mod? You can register your very own ho
5050``` cpp
5151using namespace horrible ;
5252
53- $on_mod(Loaded){
54- OptionManager::get ()->registerOption({
55- "my-option"_ spr,
56- "My Very Cool Option!",
57- "This option is so very cool!",
58- "Cool Options",
59- SillyTier::Medium
60- });
53+ inline static Option const option = {
54+ "my-option"_spr,
55+ "My Very Cool Option!",
56+ "This option is so very cool!",
57+ "Cool Options",
58+ SillyTier::Medium
6159};
62- ```
63- ``` cpp
64- using namespace horrible ;
60+ HORRIBLE_REGISTER_OPTION (option);
6561
6662class $modify(MyPlayLayer, PlayLayer) {
67- struct Fields {
68- bool enabled = OptionManager::get()->getOption("my-option"_ spr);
69- };
63+ HORRIBLE_DELEGATE_HOOKS(option.id);
7064
65+ // a vanilla hook
7166 void setupHasCompleted() {
72- if (m_fields->enabled) {
73- // do insane stuff with my option!
74- };
67+ // do insane stuff with my option!
7568
7669 PlayLayer::setupHasCompleted();
7770 };
Original file line number Diff line number Diff line change @@ -46,28 +46,21 @@ Want to add your own insane stuff to this mod? You can <cy>register your very ow
4646``` cpp
4747using namespace horrible ;
4848
49- $on_mod(Loaded){
50- OptionManager::get ()->registerOption({
51- "my-option"_ spr,
52- "My Very Cool Option!",
53- "This option is so very cool!",
54- "Cool Options",
55- SillyTier::Medium
56- });
49+ inline static Option const option = {
50+ "my-option"_spr,
51+ "My Very Cool Option!",
52+ "This option is so very cool!",
53+ "Cool Options",
54+ SillyTier::Medium
5755};
58- ```
59- ``` cpp
60- using namespace horrible ;
56+ HORRIBLE_REGISTER_OPTION (option);
6157
6258class $modify(MyPlayLayer, PlayLayer) {
63- struct Fields {
64- bool enabled = OptionManager::get()->getOption("my-option"_ spr);
65- };
59+ HORRIBLE_DELEGATE_HOOKS(option.id);
6660
61+ // a vanilla hook
6762 void setupHasCompleted() {
68- if (m_fields->enabled) {
69- // do insane stuff with my option!
70- };
63+ // do insane stuff with my option!
7164
7265 PlayLayer::setupHasCompleted();
7366 };
You can’t perform that action at this time.
0 commit comments