forked from UnknownX7/ReAction
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPluginUI.cs
More file actions
669 lines (517 loc) · 26.3 KB
/
PluginUI.cs
File metadata and controls
669 lines (517 loc) · 26.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
using System;
using System.Collections.Generic;
using System.Numerics;
using Dalamud.Interface;
using FFXIVClientStructs.FFXIV.Client.UI.Misc;
using ImGuiNET;
namespace ReAction;
public static class PluginUI
{
public static bool isVisible = false;
private static int selectedStack = -1;
private static string search = string.Empty;
private static int hotbar = 0;
private static int hotbarSlot = 0;
private static int commandType = 1;
private static int commandID = 0;
private static Configuration.ActionStack CurrentStack => 0 <= selectedStack && selectedStack < ReAction.Config.ActionStacks.Count ? ReAction.Config.ActionStacks[selectedStack] : null;
public static void Draw()
{
if (!isVisible) return;
ImGui.SetNextWindowSizeConstraints(new Vector2(700, 660) * ImGuiHelpers.GlobalScale, new Vector2(9999));
ImGui.Begin("ReAction Configuration", ref isVisible, ImGuiWindowFlags.NoScrollbar | ImGuiWindowFlags.NoScrollWithMouse);
if (ImGui.BeginTabBar("ReActionTabs"))
{
if (ImGui.BeginTabItem("Stacks"))
{
DrawStackList();
ImGui.EndTabItem();
}
if (ImGui.BeginTabItem("Other Settings"))
{
DrawOtherSettings();
ImGui.EndTabItem();
}
if (ImGui.BeginTabItem("Help"))
{
DrawStackHelp();
ImGui.EndTabItem();
}
ImGui.EndTabBar();
}
ImGui.End();
}
private static void DrawStackList()
{
var currentStack = CurrentStack;
var hasSelectedStack = currentStack != null;
ImGui.PushFont(UiBuilder.IconFont);
var buttonSize = ImGui.CalcTextSize(FontAwesomeIcon.SignOutAlt.ToIconString()) + ImGui.GetStyle().FramePadding * 2;
if (ImGui.Button(FontAwesomeIcon.Plus.ToIconString(), buttonSize))
{
ReAction.Config.ActionStacks.Add(new() { Name = "New Stack" });
ReAction.Config.Save();
}
ImGui.SameLine();
if (ImGui.Button(FontAwesomeIcon.SignOutAlt.ToIconString(), buttonSize) && hasSelectedStack)
ImGui.SetClipboardText(Configuration.ExportActionStack(CurrentStack));
ImGui.PopFont();
SetItemTooltip("Export stack to clipboard.");
ImGui.PushFont(UiBuilder.IconFont);
ImGui.SameLine();
if (ImGui.Button(FontAwesomeIcon.SignInAlt.ToIconString(), buttonSize))
{
try
{
var stack = Configuration.ImportActionStack(ImGui.GetClipboardText());
ReAction.Config.ActionStacks.Add(stack);
ReAction.Config.Save();
}
catch (Exception e)
{
ReAction.PrintError($"Failed to import stack from clipboard!\n{e.Message}");
}
}
ImGui.PopFont();
SetItemTooltip("Import stack from clipboard.");
ImGui.PushFont(UiBuilder.IconFont);
ImGui.SameLine();
if (ImGui.Button(FontAwesomeIcon.ArrowUp.ToIconString(), buttonSize) && hasSelectedStack)
{
var preset = CurrentStack;
ReAction.Config.ActionStacks.RemoveAt(selectedStack);
selectedStack = Math.Max(selectedStack - 1, 0);
ReAction.Config.ActionStacks.Insert(selectedStack, preset);
ReAction.Config.Save();
}
ImGui.SameLine();
if (ImGui.Button(FontAwesomeIcon.ArrowDown.ToIconString(), buttonSize) && hasSelectedStack)
{
var preset = CurrentStack;
ReAction.Config.ActionStacks.RemoveAt(selectedStack);
selectedStack = Math.Min(selectedStack + 1, ReAction.Config.ActionStacks.Count);
ReAction.Config.ActionStacks.Insert(selectedStack, preset);
ReAction.Config.Save();
}
ImGui.SameLine();
ImGui.Button(FontAwesomeIcon.Times.ToIconString(), buttonSize);
if (hasSelectedStack && ImGui.BeginPopupContextItem(null, ImGuiPopupFlags.MouseButtonLeft))
{
if (ImGui.Selectable(FontAwesomeIcon.TrashAlt.ToIconString()))
{
ReAction.Config.ActionStacks.RemoveAt(selectedStack);
selectedStack = Math.Min(selectedStack, ReAction.Config.ActionStacks.Count - 1);
currentStack = CurrentStack;
hasSelectedStack = currentStack != null;
ReAction.Config.Save();
}
ImGui.EndPopup();
}
ImGui.PopFont();
var firstColumnWidth = 250 * ImGuiHelpers.GlobalScale;
ImGui.PushStyleColor(ImGuiCol.Border, ImGui.GetColorU32(ImGuiCol.TabActive));
ImGui.BeginChild("ReActionPresetList", new Vector2(firstColumnWidth, ImGui.GetContentRegionAvail().Y / 2), true);
ImGui.PopStyleColor();
for (int i = 0; i < ReAction.Config.ActionStacks.Count; i++)
{
ImGui.PushID(i);
var preset = ReAction.Config.ActionStacks[i];
if (ImGui.Selectable(preset.Name, selectedStack == i))
selectedStack = i;
ImGui.PopID();
}
ImGui.EndChild();
if (!hasSelectedStack) return;
var lastCursorPos = ImGui.GetCursorPos();
ImGui.SameLine();
var nextLineCursorPos = ImGui.GetCursorPos();
ImGui.SetCursorPos(lastCursorPos);
ImGui.BeginChild("ReActionStackEditorMain", new Vector2(firstColumnWidth, ImGui.GetContentRegionAvail().Y), true);
DrawStackEditorMain(currentStack);
ImGui.EndChild();
ImGui.SetCursorPos(nextLineCursorPos);
ImGui.BeginChild("ReActionStackEditorLists", ImGui.GetContentRegionAvail(), false);
DrawStackEditorLists(currentStack);
ImGui.EndChild();
}
private static void DrawStackEditorMain(Configuration.ActionStack stack)
{
var save = false;
save |= ImGui.InputText("Name", ref stack.Name, 64);
save |= ImGui.CheckboxFlags("##Shift", ref stack.ModifierKeys, 1);
SetItemTooltip("Shift");
ImGui.SameLine();
save |= ImGui.CheckboxFlags("##Ctrl", ref stack.ModifierKeys, 2);
SetItemTooltip("Control");
ImGui.SameLine();
save |= ImGui.CheckboxFlags("##Alt", ref stack.ModifierKeys, 4);
SetItemTooltip("Alt");
ImGui.SameLine();
save |= ImGui.CheckboxFlags("##Exact", ref stack.ModifierKeys, 8);
SetItemTooltip("Match exactly these modifiers. E.g. Shift + Control ticked will match Shift + Control held, but not Shift + Control + Alt held.");
ImGui.SameLine();
ImGui.TextUnformatted("Modifier Keys");
save |= ImGui.Checkbox("Block Original on Stack Fail", ref stack.BlockOriginal);
save |= ImGui.Checkbox("Fail if Out of Range", ref stack.CheckRange);
save |= ImGui.Checkbox("Fail if On Cooldown", ref stack.CheckCooldown);
SetItemTooltip("Will fail if the action would fail to queue due to cooldown. Which is either" +
"\n> 0.5s left on the cooldown, or < 0.5s since the last use (Charges / GCD).");
if (save)
ReAction.Config.Save();
}
private static void DrawStackEditorLists(Configuration.ActionStack stack)
{
DrawActionEditor(stack);
DrawItemEditor(stack);
}
private static void DrawActionEditor(Configuration.ActionStack stack)
{
var contentRegion = ImGui.GetContentRegionAvail();
ImGui.BeginChild("ReActionActionEditor", new Vector2(contentRegion.X, contentRegion.Y / 2), true);
var buttonWidth = ImGui.GetContentRegionAvail().X / 2;
for (int i = 0; i < stack.Actions.Count; i++)
{
ImGui.PushID(i);
var action = stack.Actions[i];
ImGui.SetNextItemWidth(buttonWidth);
ActionComboBox(ref action.ID, false);
ImGui.SameLine();
if (ImGui.Checkbox("Adjust ID", ref action.UseAdjustedID))
ReAction.Config.Save();
var detectedAdjustment = false;
unsafe
{
if (!action.UseAdjustedID && (detectedAdjustment = Game.actionManager->GetAdjustedActionId(action.ID) != action.ID))
ImGui.GetWindowDrawList().AddRectFilled(ImGui.GetItemRectMin(), ImGui.GetItemRectMax(), 0x2000FF30, ImGui.GetStyle().FrameRounding);
}
SetItemTooltip("Allows the action to match any other action that it transforms into." +
"\nE.g. Aero will match Dia, Play will match all cards, Diagnosis will match Eukrasian Diagnosis, etc." +
"\nEnable this for skills that upgrade. Disable this for compatibility with certain XIVCombos." +
(detectedAdjustment ? "\n\nThis action is currently adjusted due to a trait, combo or plugin. This option is recommended." : string.Empty));
ImGui.SameLine();
ImGui.PushFont(UiBuilder.IconFont);
ImGui.Button(FontAwesomeIcon.TimesCircle.ToIconString());
if (ImGui.BeginPopupContextItem(null, ImGuiPopupFlags.MouseButtonLeft))
{
if (ImGui.Selectable(FontAwesomeIcon.TrashAlt.ToIconString()))
{
stack.Actions.RemoveAt(i);
ReAction.Config.Save();
}
ImGui.EndPopup();
}
ImGui.PopFont();
ImGui.PopID();
}
AddActionList(stack.Actions, buttonWidth);
ImGui.EndChild();
}
private static void DrawItemEditor(Configuration.ActionStack stack)
{
ImGui.BeginChild("ReActionItemEditor", ImGui.GetContentRegionAvail(), true);
var buttonWidth = ImGui.GetContentRegionAvail().X / 3;
var targets = Enum.GetNames(typeof(ActionStackManager.TargetType));
for (int i = 0; i < stack.Items.Count; i++)
{
ImGui.PushID(i);
var item = stack.Items[i];
ImGui.SetNextItemWidth(buttonWidth);
var _ = (int)item.Target;
if (ImGui.Combo("##TargetType", ref _, targets, targets.Length))
{
item.Target = (ActionStackManager.TargetType)_;
ReAction.Config.Save();
}
ImGui.SameLine();
ImGui.SetNextItemWidth(buttonWidth);
ActionComboBox(ref item.ID, true);
ImGui.SameLine();
ImGui.PushFont(UiBuilder.IconFont);
ImGui.Button(FontAwesomeIcon.TimesCircle.ToIconString());
if (ImGui.BeginPopupContextItem(null, ImGuiPopupFlags.MouseButtonLeft))
{
if (ImGui.Selectable(FontAwesomeIcon.TrashAlt.ToIconString()))
{
stack.Items.RemoveAt(i);
ReAction.Config.Save();
}
ImGui.EndPopup();
}
ImGui.PopFont();
ImGui.PopID();
}
ImGui.PushFont(UiBuilder.IconFont);
if (ImGui.Button(FontAwesomeIcon.PlusCircle.ToIconString(), new Vector2(buttonWidth, 0)))
{
stack.Items.Add(new());
ReAction.Config.Save();
}
ImGui.PopFont();
ImGui.EndChild();
}
private static readonly List<string> specialActions = new()
{
"All Actions",
"All Harmful Actions",
"All Beneficial Actions"
};
private static string FormatActionRowName(Lumina.Excel.GeneratedSheets.Action a) => $"[#{a.RowId} {a.ClassJob.Value?.Abbreviation}{(a.IsPvP ? " PVP" : string.Empty)}] {a.Name}";
private static void ActionComboBox(ref uint option, bool isOverrideSelection)
{
var selected = option < specialActions.Count ? (!isOverrideSelection ? specialActions[(int)option] : "Same Action") : ReAction.actionSheet.TryGetValue(option, out var a) ? FormatActionRowName(a) : option.ToString();
if (!ImGui.BeginCombo("##Action", selected))
return;
ImGui.InputText("##ActionSearch", ref search, 64);
var doSearch = !string.IsNullOrEmpty(search);
for (uint id = 0; id < (!isOverrideSelection ? specialActions.Count : 1); id++)
{
var name = !isOverrideSelection ? specialActions[(int)id] : "Same Action";
if (doSearch && !name.Contains(search, StringComparison.CurrentCultureIgnoreCase)) continue;
ImGui.PushID((int)id);
if (ImGui.Selectable(name, option == id))
{
option = id;
ReAction.Config.Save();
}
ImGui.PopID();
}
foreach (var (id, row) in ReAction.actionSheet)
{
var name = FormatActionRowName(row);
if (doSearch && !name.Contains(search, StringComparison.CurrentCultureIgnoreCase)) continue;
ImGui.PushID((int)id);
if (ImGui.Selectable(name, option == id))
{
option = id;
ReAction.Config.Save();
}
ImGui.PopID();
}
ImGui.EndCombo();
}
private static void AddActionList(ICollection<Configuration.Action> actions, float buttonWidth)
{
ImGui.PushFont(UiBuilder.IconFont);
if (ImGui.Button(FontAwesomeIcon.PlusCircle.ToIconString(), new Vector2(buttonWidth, 0)))
ImGui.OpenPopup("ReActionAddSkillsPopup");
ImGui.PopFont();
ImGui.SetNextWindowSize(new Vector2(0, 200 * ImGuiHelpers.GlobalScale));
if (!ImGui.BeginPopup("ReActionAddSkillsPopup")) return;
ImGui.InputText("##ActionSearch", ref search, 64);
var doSearch = !string.IsNullOrEmpty(search);
for (uint id = 0; id < specialActions.Count; id++)
{
var name = specialActions[(int)id];
if (doSearch && !name.Contains(search, StringComparison.CurrentCultureIgnoreCase)) continue;
ImGui.PushID((int)id);
if (ImGui.Selectable(name))
{
actions.Add(new() { ID = id });
ReAction.Config.Save();
}
ImGui.PopID();
}
foreach (var (id, row) in ReAction.actionSheet)
{
var name = FormatActionRowName(row);
if (doSearch && !name.Contains(search, StringComparison.CurrentCultureIgnoreCase)) continue;
ImGui.PushID((int)id);
if (ImGui.Selectable(name, false, ImGuiSelectableFlags.DontClosePopups))
{
actions.Add(new() { ID = id });
ReAction.Config.Save();
}
ImGui.PopID();
}
ImGui.EndPopup();
}
private static void DrawStackHelp()
{
ImGui.Text("Creating a Stack");
ImGui.Indent();
ImGui.TextWrapped("To start, click the + button in the top left corner, this will create a new stack that you can begin adding actions and functionality to.");
ImGui.Unindent();
ImGui.Separator();
ImGui.Text("Editing a Stack");
ImGui.Indent();
ImGui.TextWrapped("Click on a stack from the top left list to display the editing panes for that it. The bottom left pane is where the " +
"main settings reside, these will change the base functionality for the stack itself.");
ImGui.Unindent();
ImGui.Separator();
ImGui.Text("Editing a Stack's Actions");
ImGui.Indent();
ImGui.TextWrapped("The top right pane is where you can add actions, click the + to bring up a box that you can search for them through. " +
"After adding every action that you would like to change the functionality of, you can additionally select which ones you would like to " +
"\"adjust\". This means that the selected action will match any other one that replaces it on the hotbar. This can be due to a trait " +
"(Holy <-> Holy III), a buff (Play -> The Balance) or another plugin (XIVCombo). An example case where you might want it off is when the " +
"adjusted action has a separate use case, such as XIVCombo turning Play into Draw. You can change the functionality of the individual " +
"cards while not affecting Draw by adding each of them to the list. Additionally, if the action is currently adjusted by the game, the " +
"option will be highlighted in green as an indicator.");
ImGui.Unindent();
ImGui.Separator();
ImGui.Text("Editing a Stack's Functionality");
ImGui.Indent();
ImGui.TextWrapped("The bottom right pane is where you can change the functionality of the selected actions, by setting a list of targets to " +
"extend or replace the game's. When the action is used, the plugin will attempt to determine, from top to bottom, which target is a valid choice. " +
"This will execute before the game's own target priority system and only allow it to continue if not blocked by the stack. If any of the targets " +
"are valid choices, the plugin will change the action's target to the new one and, additionally, replace the action with the override if set.");
ImGui.Unindent();
ImGui.Separator();
ImGui.Text("Stack Priority");
ImGui.Indent();
ImGui.TextWrapped("The executed stack will depend on which one, from top to bottom, first contains the action being used and has its modifier " +
"keys held. If you would like to use \"All Actions\" in a stack, you can utilize this to add overrides above it in the list. Note that a stack " +
"does not need to contain any functionality in the event that you would like for a set of actions to never be changed by \"All Actions\" and " +
"instead use the original.");
ImGui.Unindent();
}
private static void DrawOtherSettings()
{
ImGui.Columns(2, null, false);
var save = false;
if (ImGui.Checkbox("Enable Ground Target Queuing", ref ReAction.Config.EnableGroundTargetQueuing))
{
Game.queueGroundTargetsReplacer.Toggle();
save = true;
}
SetItemTooltip("Ground targets will insert themselves into the action queue,\ncausing them to immediately be used as soon as possible, like other OGCDs.");
ImGui.NextColumn();
save |= ImGui.Checkbox("Enable Instant Ground Targets", ref ReAction.Config.EnableInstantGroundTarget);
SetItemTooltip("Ground targets will immediately place themselves at your current cursor position when a stack does not override the target.");
ImGui.NextColumn();
if (ImGui.Checkbox("Enable Enhanced Auto Face Target", ref ReAction.Config.EnableEnhancedAutoFaceTarget))
{
Game.enhancedAutoFaceTargetReplacer1.Toggle();
Game.enhancedAutoFaceTargetReplacer2.Toggle();
save = true;
}
SetItemTooltip("Actions that don't require facing a target will no longer automatically face the target, such as healing.");
ImGui.NextColumn();
save |= ImGui.Checkbox("Enable Auto Dismount", ref ReAction.Config.EnableAutoDismount);
SetItemTooltip("Automatically dismounts when an action is used, prior to using the action.");
ImGui.NextColumn();
save |= ImGui.Checkbox("Enable Auto Cast Cancel", ref ReAction.Config.EnableAutoCastCancel);
SetItemTooltip("Automatically cancels casting when the target dies.");
ImGui.NextColumn();
save |= ImGui.Checkbox("Enable Auto Target", ref ReAction.Config.EnableAutoTarget);
SetItemTooltip("Automatically targets the closest enemy when no target is specified for a targeted attack.");
if (ReAction.Config.EnableAutoTarget)
{
ImGui.NextColumn();
save |= ImGui.Checkbox("Enable Auto Change Target", ref ReAction.Config.EnableAutoChangeTarget);
SetItemTooltip("Additionally targets the closest enemy when your main target is incorrect for a targeted attack.");
}
ImGui.NextColumn();
save |= ImGui.Checkbox("Enable Auto Refocus Target", ref ReAction.Config.EnableAutoRefocusTarget);
SetItemTooltip("While in duties, attempts to focus target whatever was previously focus targeted if the focus target is lost.");
ImGui.NextColumn();
if (ImGui.Checkbox("Enable Auto Attacks on Spells", ref ReAction.Config.EnableSpellAutoAttacks))
{
Game.spellAutoAttackReplacer.Toggle();
save = true;
}
SetItemTooltip("Causes spells to start using auto attacks just like weaponskills.");
ImGui.NextColumn();
save |= ImGui.Checkbox("Enable Camera Relative Dashes", ref ReAction.Config.EnableCameraRelativeDashes);
SetItemTooltip("Changes dashes, such as En Avant and Elusive Jump, to be relative\nto the direction your camera is facing, rather than your character.");
if (ReAction.Config.EnableCameraRelativeDashes)
{
ImGui.NextColumn();
save |= ImGui.Checkbox("Enable Normal Backward Dashes", ref ReAction.Config.EnableNormalBackwardDashes);
SetItemTooltip("Ignores \"Enable Camera Relative Dashes\" for any backward dash, such as Elusive Jump.");
}
ImGui.NextColumn();
save |= ImGui.Checkbox("Enable Queuing More", ref ReAction.Config.EnableQueuingMore);
SetItemTooltip("Allows sprint and items to be queued.");
ImGui.NextColumn();
save |= ImGui.Checkbox("Enable FPS Alignment", ref ReAction.Config.EnableFPSAlignment);
SetItemTooltip("Aligns the game's FPS with the GCD and animation lock.\nNote: this option will cause an almost unnoticeable stutter when either of these timers ends.");
ImGui.Columns(1);
ImGui.Separator();
ImGui.Columns(2, null, false);
ImGui.Indent();
ImGui.TextUnformatted("Decombos");
ImGui.Unindent();
ImGui.NextColumn();
ImGui.NextColumn();
if (ImGui.Checkbox("Enable Uncombo'd Meditation", ref ReAction.Config.EnableDecomboMeditation))
{
Game.decomboMeditationReplacer.Toggle();
save = true;
}
SetItemTooltip("Removes the Meditation <-> Steel Peak / Forbidden Chakra combo. You will need to use\nthe hotbar feature below to place one of them on your hotbar in order to use them again.\nSteel Peak ID: 25761\nForbidden Chakra ID: 3547");
ImGui.NextColumn();
if (ImGui.Checkbox("Enable Uncombo'd Bunshin", ref ReAction.Config.EnableDecomboBunshin))
{
Game.decomboBunshinReplacer.Toggle();
save = true;
}
SetItemTooltip("Removes the Bunshin <-> Phantom Kamaitachi combo. You will need to use\nthe hotbar feature below to place it on your hotbar in order to use it again.\nPhantom Kamaitachi ID: 25774");
ImGui.NextColumn();
if (ImGui.Checkbox("Enable Uncombo'd Wanderer's Minuet", ref ReAction.Config.EnableDecomboWanderersMinuet))
{
Game.decomboWanderersMinuetReplacer.Toggle();
save = true;
}
SetItemTooltip("Removes the Wanderer's Minuet -> Pitch Perfect combo. You will need to use\nthe hotbar feature below to place it on your hotbar in order to use it again.\nPitch Perfect ID: 7404");
ImGui.NextColumn();
if (ImGui.Checkbox("Enable Uncombo'd Liturgy of the Bell", ref ReAction.Config.EnableDecomboLiturgy))
{
Game.decomboLiturgyReplacer.Toggle();
save = true;
}
SetItemTooltip("Removes the Liturgy of the Bell combo. You will need to use the hotbar\nfeature below to place it on your hotbar in order to use it again.\nLiturgy of the Bell (Detonate) ID: 28509");
ImGui.NextColumn();
if (ImGui.Checkbox("Enable Uncombo'd Earthly Star", ref ReAction.Config.EnableDecomboEarthlyStar))
{
Game.decomboEarthlyStarReplacer.Toggle();
save = true;
}
SetItemTooltip("Removes the Earthly Star combo. You will need to use the hotbar\nfeature below to place it on your hotbar in order to use it again.\nStellar Detonation ID: 8324");
ImGui.Columns(1);
ImGui.Spacing();
ImGui.Separator();
ImGui.Indent();
ImGui.TextUnformatted("Place on Hotbar (HOVER ME FOR INFORMATION)");
SetItemTooltip("This will allow you to place various things on the hotbar that you can't normally." +
"\nIf you don't know what this can be used for, don't touch it. Whatever you place on it MUST BE MOVED OR ELSE IT WILL NOT SAVE." +
"\nSome examples of things you can do:" +
"\n\tPlace a certain action on the hotbar to be used with one of the \"Decombo\" features. The IDs are in each setting's tooltip." +
"\n\tPlace a certain doze and sit emote on the hotbar (88 and 95)." +
"\n\tPlace a currency (Item, 1-99) on the hotbar to see how much you have without opening the currency menu." +
"\n\tRevive flying mount roulette (GeneralAction, 24).");
ImGui.Unindent();
ImGui.Columns(5, null, false);
ImGui.Combo("Bar", ref hotbar, "1\02\03\04\05\06\07\08\09\010\0XHB 1\0XHB 2\0XHB 3\0XHB 4\0XHB 5\0XHB 6\0XHB 7\0XHB 8");
ImGui.NextColumn();
ImGui.Combo("Slot", ref hotbarSlot, "1\02\03\04\05\06\07\08\09\010\011\012\013\014\015\016");
ImGui.NextColumn();
var hotbarSlotType = Enum.GetName(typeof(HotbarSlotType), commandType) ?? commandType.ToString();
if (ImGui.BeginCombo("Type", hotbarSlotType))
{
for (int i = 1; i <= 32; i++)
{
if (!ImGui.Selectable($"{Enum.GetName(typeof(HotbarSlotType), i) ?? i.ToString()}##{i}", commandType == i)) continue;
commandType = i;
}
ImGui.EndCombo();
}
ImGui.NextColumn();
ImGui.InputInt("ID", ref commandID);
ImGui.NextColumn();
if (ImGui.Button("Execute"))
{
Game.SetHotbarSlot(hotbar, hotbarSlot, (byte)commandType, (uint)commandID);
ReAction.PrintEcho("MAKE SURE TO MOVE WHATEVER YOU JUST PLACED ON THE HOTBAR OR IT WILL NOT SAVE. YES, MOVING IT TO ANOTHER SLOT AND THEN MOVING IT BACK IS FINE.");
}
SetItemTooltip("You need to move whatever you place on the hotbar in order to have it save.");
ImGui.Columns(1);
if (save)
ReAction.Config.Save();
}
private static void SetItemTooltip(string s, ImGuiHoveredFlags flags = ImGuiHoveredFlags.None)
{
if (ImGui.IsItemHovered(flags))
ImGui.SetTooltip(s);
}
}