Skip to content

Commit

Permalink
Config: Bugfix, actually change values in setters
Browse files Browse the repository at this point in the history
  • Loading branch information
Zirias committed Aug 7, 2024
1 parent 9fb2c65 commit 28cbdb8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/bin/xmoji/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ void Config_setScale(Config *self, EmojiFont scale)
if (self->scale == scale) return;
if ((int)scale < (int)EF_TINY || (int)scale > (int)EF_HUGE) return;
writeNum(self, CFG_SCALE, scale);
self->scale = scale;
ConfigChangedEventArgs ea = { 0 };
PSC_Event_raise(self->changed[CFG_SCALE], 0, &ea);
}
Expand All @@ -382,6 +383,7 @@ void Config_setInjectorFlags(Config *self, InjectorFlags flags)
if ((flags & (IF_ADDSPACE|IF_ADDZWSPACE))
== (IF_ADDSPACE|IF_ADDZWSPACE)) return;
writeNum(self, CFG_INJECTORFLAGS, flags);
self->injectorFlags = flags;
ConfigChangedEventArgs ea = { 0 };
PSC_Event_raise(self->changed[CFG_INJECTORFLAGS], 0, &ea);
}
Expand All @@ -401,6 +403,7 @@ void Config_setWaitBefore(Config *self, unsigned ms)
if (self->waitBefore == ms) return;
if (ms > 500) return;
writeNum(self, CFG_WAITBEFORE, ms);
self->waitBefore = ms;
ConfigChangedEventArgs ea = { 0 };
PSC_Event_raise(self->changed[CFG_WAITBEFORE], 0, &ea);
}
Expand All @@ -420,6 +423,7 @@ void Config_setWaitAfter(Config *self, unsigned ms)
if (self->waitAfter == ms) return;
if (ms < 50 || ms > 1000) return;
writeNum(self, CFG_WAITAFTER, ms);
self->waitAfter = ms;
ConfigChangedEventArgs ea = { 0 };
PSC_Event_raise(self->changed[CFG_WAITAFTER], 0, &ea);
}
Expand Down

0 comments on commit 28cbdb8

Please sign in to comment.