#817 Pre-Conditional Button tests #1382
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #817
Syntax details:
event1=<EventName>[ <EventName>]*[,<Variable>,<Operator>,<Constant>[,<FailAction>]]
[] are optional parts so you can either have
event1=<EventName>
event1=<EventName>,<Variable>,<Operator>,<Constant>
event1=<EventName>,<Variable>,<Operator>,<Constant>,<FailAction>
Operators:
==
!=
>
>=
<
<=
FailAction:
none
(default when no condition specified): No action, button always enabled.disable
(default when condition specified): The button is visible, but disabled if the condition is not met.hide
: The button is not visible if the condition is not met.So in your example:
Event.ini
[EventDialogue]
buttons=5
event1=EventGainEntryBribe,%Gold,>=,25
event2=EventGainEntryHero,#HeroLeoricoftheBook,==,1,hide
event3=EventGainEntryClass,#HeroClassRunemaster,==,1,hide
event4=EventGainEntryRelic,#RelicTheShadowRune,==,1,hide
event5=EventGainEntryConvince
Localization.txt
EventDialogue.text,You approach the academy of Greyhaven, but a guard denies you entry.
EventDialogue.button1,[25 Gold] Bribe the guard
EventDialogue.button2,[Leoric] Demand entry
EventDialogue.button3,[Runemaster] Demand entry
EventDialogue.button4,[Shadow Rune] Demand entry
EventDialogue.button5,Try to convince the guard
In case of multiple events:
event1=EventGainEntryBribe EventGainEntryAfterBribe,%Gold,>=,25
No Editor UI implemented yet, you need to modify .ini files directly.
[EventStartCustomizing]
buttons=3
event1=
event2=,#heroes,>,2,hide
event3=,#heroes,<=,2,disable
3+ heroes options:

2 heroes option example (1 hidden):
