Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
DramaEventTalk Class Reference
Inheritance diagram for DramaEventTalk:
DramaEvent EClass

Public Member Functions

 DramaEventTalk ()
 
 DramaEventTalk (string _idActor, Func< string > func)
 
 DramaEventTalk (string _idActor, string _text, List< DramaChoice > listChoice=null)
 
void AddChoice (DramaChoice choice)
 
override bool Play ()
 
void InitDialog ()
 
void ResetDialog ()
 
- Public Member Functions inherited from DramaEvent
virtual bool Play ()
 
virtual void Reset ()
 

Public Attributes

string text
 
string idCancelJump
 
List< DramaChoicechoices = new List<DramaChoice>()
 
bool center
 
bool canCancel
 
bool unknown
 
float timer
 
Func< string > funcText
 
- Public Attributes inherited from DramaEvent
int progress
 
string idJump
 
string idActor
 
string step
 
float time
 
bool temp
 
DramaSequence sequence
 

Additional Inherited Members

- Static Public Member Functions inherited from EClass
static int rnd (int a)
 
static int curve (int a, int start, int step, int rate=75)
 
static int rndHalf (int a)
 
static float rndf (float a)
 
static int rndSqrt (int a)
 
static void Wait (float a, Card c)
 
static void Wait (float a, Point p)
 
static int Bigger (int a, int b)
 
static int Smaller (int a, int b)
 
- Static Public Attributes inherited from EClass
static Core core
 
- Properties inherited from DramaEvent
DramaActor actor [get]
 
DramaManager manager [get]
 
LayerDrama layer [get]
 
- Properties inherited from EClass
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static FactionBranch Branch [get]
 
static FactionBranch BranchOrHomeBranch [get]
 
static Faction Home [get]
 
static Faction Wilds [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static GameSetting setting [get]
 
static GameData gamedata [get]
 
static ColorProfile Colors [get]
 
static World world [get]
 
static SourceManager sources [get]
 
static SourceManager editorSources [get]
 
static SoundManager Sound [get]
 
static CoreDebug debug [get]
 

Detailed Description

Definition at line 5 of file DramaEventTalk.cs.

Constructor & Destructor Documentation

◆ DramaEventTalk() [1/3]

DramaEventTalk.DramaEventTalk ( )
inline

Definition at line 23 of file DramaEventTalk.cs.

24 {
25 }

◆ DramaEventTalk() [2/3]

DramaEventTalk.DramaEventTalk ( string  _idActor,
Func< string >  func 
)
inline

Definition at line 27 of file DramaEventTalk.cs.

28 {
29 if (_idActor.Contains("?"))
30 {
31 unknown = true;
32 }
33 idActor = _idActor.Replace("?", "");
34 funcText = func;
35 }
Func< string > funcText
string idActor
Definition: DramaEvent.cs:7

References funcText, DramaEvent.idActor, and unknown.

◆ DramaEventTalk() [3/3]

DramaEventTalk.DramaEventTalk ( string  _idActor,
string  _text,
List< DramaChoice listChoice = null 
)
inline

Definition at line 37 of file DramaEventTalk.cs.

38 {
39 if (_idActor.Contains("?"))
40 {
41 unknown = true;
42 }
43 idActor = _idActor.Replace("?", "");
44 text = _text;
45 if (listChoice == null)
46 {
47 return;
48 }
49 foreach (DramaChoice item in listChoice)
50 {
52 }
53 }
void AddChoice(DramaChoice choice)

References AddChoice(), DramaEvent.idActor, item, text, and unknown.

Member Function Documentation

◆ AddChoice()

void DramaEventTalk.AddChoice ( DramaChoice  choice)
inline

Definition at line 55 of file DramaEventTalk.cs.

56 {
57 choices.Add(choice);
58 }
List< DramaChoice > choices

References choices.

Referenced by DramaCustomSequence.Choice(), DramaCustomSequence.Choice2(), DramaEventTalk(), and DramaManager.ParseLine().

◆ InitDialog()

void DramaEventTalk.InitDialog ( )
inline

Definition at line 161 of file DramaEventTalk.cs.

162 {
163 if (idActor == "*")
164 {
165 base.manager.SetDialog("Mono");
166 }
167 if (idActor == "*2")
168 {
169 base.manager.SetDialog("Default2");
170 }
171 base.manager.imageBG.color = ((idActor == "*") ? new Color(0.6f, 0.6f, 0.6f) : Color.white);
172 }

References Color, and DramaEvent.idActor.

Referenced by Play().

◆ Play()

override bool DramaEventTalk.Play ( )
inlinevirtual

Reimplemented from DramaEvent.

Definition at line 60 of file DramaEventTalk.cs.

61 {
62 if (progress == 0)
63 {
64 InitDialog();
65 if (sequence.firstTalk == null)
66 {
67 sequence.firstTalk = this;
68 }
69 timer = 0f;
70 sequence.dialog.SetActive(enable: true);
71 base.actor.Talk(sequence.message + ((funcText != null) ? funcText() : text), choices, center, unknown);
72 sequence.message = "";
73 progress++;
74 }
75 else
76 {
77 timer += Time.deltaTime;
78 if (timer < 0.08f)
79 {
80 return false;
81 }
82 if (canCancel && (EInput.rightMouse.down || Input.GetKeyDown(KeyCode.Escape) || Input.GetKeyDown(KeyCode.LeftShift)))
83 {
85 if (temp)
86 {
87 sequence.tempEvents.Clear();
88 }
89 EClass.Sound.Play("click_chat");
90 if (idCancelJump == "back")
91 {
92 return true;
93 }
94 if (idCancelJump.IsEmpty())
95 {
96 sequence.Exit();
97 }
98 else
99 {
101 }
102 return false;
103 }
104 int num = 0;
105 foreach (DramaChoice choice in choices)
106 {
107 if (choice.activeCondition != null && !choice.activeCondition())
108 {
109 continue;
110 }
111 string inputString = Input.inputString;
112 if ((bool)choice.button && inputString == ((num + 1).ToString() ?? ""))
113 {
114 if ((bool)choice.button.soundClick)
115 {
116 SoundManager.current.Play(choice.button.soundClick);
117 }
118 choice.button.onClick.Invoke();
119 return false;
120 }
121 num++;
122 }
123 if (num == 0 && (EInput.leftMouse.down || EInput.rightMouse.down || Input.GetKeyDown(KeyCode.KeypadEnter) || Input.GetKey(KeyCode.LeftControl) || EInput.action == EAction.Confirm || EInput.action == EAction.Wait || Input.GetKeyDown(KeyCode.Return) || Input.GetKeyDown(KeyCode.Escape)))
124 {
125 ResetDialog();
126 if (EClass.ui.GetTopLayer() == base.layer)
127 {
129 if ((bool)typewriter && !typewriter.IsFinished)
130 {
131 typewriter.Skip();
132 return false;
133 }
134 base.actor.gameObject.SetActive(value: false);
135 EClass.Sound.Play("click_chat");
136 if (temp)
137 {
138 sequence.tempEvents.Clear();
139 if (!idJump.IsEmpty())
140 {
142 return false;
143 }
144 return true;
145 }
146 if (idJump.IsEmpty())
147 {
149 }
150 else
151 {
153 }
154 return false;
155 }
156 }
157 }
158 return false;
159 }
EAction
Definition: EAction.cs:2
UIText textMain
Definition: DialogDrama.cs:29
Func< bool > activeCondition
Definition: DramaChoice.cs:29
UIButton button
Definition: DramaChoice.cs:33
string idCancelJump
DramaSequence sequence
Definition: DramaEvent.cs:15
string idJump
Definition: DramaEvent.cs:5
bool temp
Definition: DramaEvent.cs:13
int progress
Definition: DramaEvent.cs:3
DramaEventTalk firstTalk
void Play(string id)
DialogDrama dialog
List< DramaEvent > tempEvents
Definition: EClass.cs:5
static SoundManager Sound
Definition: EClass.cs:46
static UI ui
Definition: EClass.cs:16
Definition: EInput.cs:8
static ButtonState leftMouse
Definition: EInput.cs:349
static ButtonState rightMouse
Definition: EInput.cs:351
static EAction action
Definition: EInput.cs:259
void Skip()
Definition: Typewriter.cs:48
bool IsFinished
Definition: Typewriter.cs:22
SoundData soundClick
Definition: UIButton.cs:130
Typewriter typewriter
Definition: UIText.cs:25

References EInput.action, DramaChoice.activeCondition, DramaChoice.button, canCancel, center, choices, DramaSequence.dialog, ButtonState.down, DramaSequence.Exit(), DramaSequence.firstTalk, funcText, idCancelJump, DramaEvent.idJump, InitDialog(), Typewriter.IsFinished, EInput.leftMouse, DramaSequence.message, DramaSequence.Play(), DramaSequence.PlayNext(), DramaEvent.progress, ResetDialog(), EInput.rightMouse, DramaEvent.sequence, Typewriter.Skip(), EClass.Sound, UIButton.soundClick, DramaEvent.temp, DramaSequence.tempEvents, text, DialogDrama.textMain, timer, UIText.typewriter, EClass.ui, and unknown.

◆ ResetDialog()

void DramaEventTalk.ResetDialog ( )
inline

Definition at line 174 of file DramaEventTalk.cs.

175 {
176 base.manager.imageBG.color = Color.white;
177 if (idActor == "*" || idActor == "*2")
178 {
179 base.manager.SetDialog();
180 }
181 }

References Color, and DramaEvent.idActor.

Referenced by Play().

Member Data Documentation

◆ canCancel

bool DramaEventTalk.canCancel

Definition at line 15 of file DramaEventTalk.cs.

Referenced by Play().

◆ center

bool DramaEventTalk.center

Definition at line 13 of file DramaEventTalk.cs.

Referenced by Play().

◆ choices

List<DramaChoice> DramaEventTalk.choices = new List<DramaChoice>()

Definition at line 11 of file DramaEventTalk.cs.

Referenced by AddChoice(), and Play().

◆ funcText

Func<string> DramaEventTalk.funcText

Definition at line 21 of file DramaEventTalk.cs.

Referenced by DramaEventTalk(), and Play().

◆ idCancelJump

string DramaEventTalk.idCancelJump

Definition at line 9 of file DramaEventTalk.cs.

Referenced by Play().

◆ text

string DramaEventTalk.text

Definition at line 7 of file DramaEventTalk.cs.

Referenced by DramaEventTalk(), and Play().

◆ timer

float DramaEventTalk.timer

Definition at line 19 of file DramaEventTalk.cs.

Referenced by Play().

◆ unknown

bool DramaEventTalk.unknown

Definition at line 17 of file DramaEventTalk.cs.

Referenced by DramaEventTalk(), and Play().


The documentation for this class was generated from the following file: