Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

#817 Pre-Conditional Button tests #1382

Merged

Conversation

mayjak
Copy link
Collaborator

@mayjak mayjak commented Nov 2, 2020

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:
image

2 heroes option example (1 hidden):
image

@mayjak mayjak changed the title WIP: Feature/817 preconditional button texts #817 preconditional button texts Nov 8, 2020
@mayjak mayjak changed the base branch from master to dev/2.4.11 November 8, 2020 22:54
@mayjak mayjak changed the title #817 preconditional button texts #817 Pre-Conditional Button tests Nov 8, 2020
@mayjak mayjak merged commit 5c43cad into NPBruce:dev/2.4.11 Nov 8, 2020
mayjak pushed a commit that referenced this pull request Nov 25, 2020
Syntax details:

event1=<EventName>[ <EventName>]*[,<Variable>,<Operator>,<Constant>[,hide|disable]]
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pre-Conditional Button texts
2 participants