Handle optionnal flags

This commit is contained in:
nemunaire 2022-05-31 22:03:51 +02:00
commit a414cd22c8
18 changed files with 68 additions and 22 deletions

View file

@ -43,7 +43,8 @@ type ExerciceFlag struct {
SortReGroups bool `toml:"sort_validator_regexp_groups,omitempty"`
Placeholder string `toml:",omitempty"`
Help string `toml:",omitempty"`
ChoicesCost int64 `toml:"choices_cost,omitempty"`
BonusGain int32 `toml:"bonus_gain,omitempty"`
ChoicesCost int32 `toml:"choices_cost,omitempty"`
Choice []ExerciceFlagChoice
LockedFile []ExerciceUnlockFile `toml:"unlock_file,omitempty"`
NeedFlag []ExerciceDependency `toml:"need_flag,omitempty"`

View file

@ -170,6 +170,7 @@ func buildKeyFlag(exercice *fic.Exercice, flag ExerciceFlag, flagline int, defau
SortReGroups: flag.SortReGroups,
Checksum: hashedFlag[:],
ChoicesCost: flag.ChoicesCost,
BonusGain: flag.BonusGain,
})
f = &fl