forked from wofsauge/External-Item-Descriptions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eid_mcm.lua
948 lines (862 loc) · 40.1 KB
/
eid_mcm.lua
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
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
Controller = Controller or {}
Controller.DPAD_LEFT = 0
Controller.DPAD_RIGHT = 1
Controller.DPAD_UP = 2
Controller.DPAD_DOWN = 3
Controller.BUTTON_A = 4
Controller.BUTTON_B = 5
Controller.BUTTON_X = 6
Controller.BUTTON_Y = 7
Controller.BUMPER_LEFT = 8
Controller.TRIGGER_LEFT = 9
Controller.STICK_LEFT = 10
Controller.BUMPER_RIGHT = 11
Controller.TRIGGER_RIGHT = 12
Controller.STICK_RIGHT = 13
Controller.BUTTON_BACK = 14
Controller.BUTTON_START = 15
-- MOD CONFIG MENU Compatibility
local MCMLoaded, MCM = pcall(require, "scripts.modconfig")
EID.MCMCompat_isDisplayingEIDTab = ""
local MCMCompat_isDisplayingDummyMCMObj = false
local MCMCompat_oldPermanentObj = nil
EID.MCMLoaded = MCMLoaded
local colorNameArray = {}
EID.MCM_OptionChanged = false
local function renderDummyDesc(reload)
if reload then
MCMCompat_oldPermanentObj = nil
else
MCMCompat_oldPermanentObj = EID.permanentDisplayTextObj
end
local demoDescObj = EID:getDescriptionObj(5, 100, 33)
demoDescObj.Name = EID:getDescriptionEntry("MCM","DemoObjectName")
demoDescObj.Transformation = EID:getDescriptionEntry("MCM","DemoObjectTransformation")
demoDescObj.Description = EID:getDescriptionEntry("MCM","DemoObjectText")
EID:displayPermanentText(demoDescObj, "MCM", "DemoObjectName")
end
local function renderDummyBagOfCraftingDesc()
EID.bagPlayer = Isaac.GetPlayer(0)
EID.BoC.BagItemsOverride = {15,15,5,1,10}
EID.BoC.RoomOverride = {8,8,8,9}
EID.BoC.FloorOverride = {1,1,1,3,4,8,8,8,9}
EID.BoC.InventoryOverride = {21,22}
EID.RefreshBagTextbox = true
local craftingSuccess = EID:handleBagOfCraftingRendering(true)
if craftingSuccess then
EID:printDescription(EID.descriptionsToPrint[#EID.descriptionsToPrint])
end
end
-- get list of all defined fonts per language file
local fonts = {}
local fontNames = {}
for _, pack in pairs(EID.descriptions) do
if pack.fonts then
for _,fontToAdd in ipairs(pack.fonts) do
local exists = false
for _,font in ipairs(fontNames) do
if font == fontToAdd.name then
exists = true
break
end
end
if not exists then
table.insert(fonts, fontToAdd)
table.insert(fontNames, fontToAdd.name)
end
end
end
end
-- get list of all defined Language names
local displayLanguage = {}
for _, lang in ipairs(EID.Languages) do
table.insert(displayLanguage, EID.descriptions[lang].languageName)
end
local function clearRenderDummyDesc()
if MCMCompat_oldPermanentObj == nil then
EID:hidePermanentText()
else
EID.permanentDisplayTextObj = MCMCompat_oldPermanentObj
end
MCMCompat_oldPermanentObj = nil
MCMCompat_isDisplayingDummyMCMObj = false
EID.BoC.BagItemsOverride = nil
EID.BoC.RoomOverride = nil
EID.BoC.FloorOverride = nil
EID.BoC.InventoryOverride = nil
EID.RefreshBagTextbox = true
end
function EID:renderMCMDummyDescription()
if MCMLoaded then
if not Options then
local hudOffset = ModConfigMenu.Config["General"].HudOffset
if hudOffset == nil and ScreenHelper then
hudOffset = ScreenHelper.GetOffset()
end
EID.Config["HUDOffset"] = hudOffset
EID:addTextPosModifier("HudOffset", Vector((hudOffset * 2) - 20, hudOffset - 10))
end
if MCM.IsVisible and EID.MCMCompat_isDisplayingEIDTab ~= "" then
if EID.MCMCompat_isDisplayingEIDTab == "Mouse" and EID.Config["EnableMouseControls"] then
clearRenderDummyDesc()
EID:renderHUDLocationIndicators()
MCMCompat_isDisplayingDummyMCMObj = true
elseif EID.MCMCompat_isDisplayingEIDTab == "Visuals" and EID.permanentDisplayTextObj == nil then
renderDummyDesc()
MCMCompat_isDisplayingDummyMCMObj = true
elseif EID.MCMCompat_isDisplayingEIDTab == "Crafting" then
clearRenderDummyDesc()
renderDummyBagOfCraftingDesc()
MCMCompat_isDisplayingDummyMCMObj = true
end
EID:buildColorArray()
elseif not MCM.IsVisible and MCMCompat_isDisplayingDummyMCMObj then
clearRenderDummyDesc()
EID.MCMCompat_isDisplayingEIDTab = ""
colorNameArray = {}
end
end
end
function EID:buildColorArray()
if (colorNameArray[1] ~= nil) then return end
colorNameArray = {}
for k,v in pairs(EID.InlineColors) do
if k~="ColorText" and k~="ColorTransform" and k~="ColorError" and k~="ColorObjName" and k~="ColorReset" then
table.insert(colorNameArray,k)
end
end
table.sort(colorNameArray)
end
function EID:AddBooleanSetting(category, optionName, displayText, params)
if type(params) ~= "table" then params = {} end
if params.repOnly and not REPENTANCE then return end
MCM.AddSetting(
"EID", category,
{
Type = ModConfigMenu.OptionType.BOOLEAN,
CurrentSetting = params.currentSettingFunc or function()
return EID.Config[optionName]
end,
Display = params.displayFunc or function()
if params.displayingTab then EID.MCMCompat_isDisplayingEIDTab = params.displayingTab end
local onOff = params.offText or "False"
if EID.Config[optionName] then
onOff = params.onText or "True"
end
return displayText .. ": " .. onOff
end,
OnChange = params.onChangeFunc or function(currentBool)
EID.Config[optionName] = currentBool
EID.MCM_OptionChanged = true
end,
Info = params.infoText or {}
}
)
end
function EID:AddNumberSetting(category, optionName, displayText, minimum, maximum, params)
if type(params) ~= "table" then params = {} end
if params.repOnly and not REPENTANCE then return end
MCM.AddSetting(
"EID", category,
{
Type = ModConfigMenu.OptionType.NUMBER,
CurrentSetting = params.currentSettingFunc or function()
return (params.indexOf and AnIndexOf(params.indexOf, EID.Config[optionName])) or EID.Config[optionName]
end,
Minimum = minimum,
Maximum = maximum,
ModifyBy = params.modifyBy or 1,
Display = params.displayFunc or function()
if params.displayingTab then EID.MCMCompat_isDisplayingEIDTab = params.displayingTab end
return displayText .. ": " .. ((params.displayTable and params.displayTable[EID.Config[optionName]]) or EID.Config[optionName])
end,
OnChange = params.onChangeFunc or function(currentNum)
EID.Config[optionName] = (params.indexOf and params.indexOf[currentNum]) or currentNum
EID.MCM_OptionChanged = true
end,
Info = params.infoText or {}
}
)
end
function EID:AddScrollSetting(category, optionName, displayText, scrollTable, params)
if type(params) ~= "table" then params = {} end
if params.repOnly and not REPENTANCE then return end
MCM.AddSetting(
"EID", category,
{
Type = ModConfigMenu.OptionType.SCROLL,
CurrentSetting = params.currentSettingFunc or function()
return AnIndexOf(scrollTable, EID.Config[optionName]) - 1
end,
Display = params.displayFunc or function()
if params.displayingTab then EID.MCMCompat_isDisplayingEIDTab = params.displayingTab end
return displayText .. ": $scroll" .. (AnIndexOf(scrollTable, EID.Config[optionName]) - 1) .. " " ..
EID.Config[optionName] .. (params.label or "")
end,
OnChange = params.onChangeFunc or function(currentNum)
EID.Config[optionName] = scrollTable[currentNum + 1]
EID.MCM_OptionChanged = true
end,
Info = params.infoText or {}
}
)
end
function EID:AddHotkeySetting(category, optionName, displayText, infoText, isController)
if (type(infoText) == "string") then infoText = {infoText} end
local optionType = ModConfigMenu.OptionType.KEYBIND_KEYBOARD
local hotkeyToString = InputHelper.KeyboardToString
local deviceString = "keyboard"
local backString = "ESCAPE"
if isController then
optionType = ModConfigMenu.OptionType.KEYBIND_CONTROLLER
hotkeyToString = InputHelper.ControllerToString
deviceString = "controller"
backString = "BACK"
end
MCM.AddSetting(
"EID",
category,
{
Type = optionType,
CurrentSetting = function()
return EID.Config[optionName]
end,
Display = function()
local key = "None"
if (hotkeyToString[EID.Config[optionName]]) then key = hotkeyToString[EID.Config[optionName]] end
return displayText .. ": " .. key
end,
OnChange = function(currentNum)
EID.Config[optionName] = currentNum or -1
EID.MCM_OptionChanged = true
end,
PopupGfx = ModConfigMenu.PopupGfx.WIDE_SMALL,
PopupWidth = 280,
Popup = function()
local currentValue = EID.Config[optionName]
local keepSettingString = ""
if currentValue > -1 then
local currentSettingString = hotkeyToString[currentValue]
keepSettingString = "This setting is currently set to \"" .. currentSettingString .. "\".$newlinePress this button to keep it unchanged.$newline$newline"
end
return "Press a button on your "..deviceString.." to change this setting.$newline$newline" .. keepSettingString .. "Press "..backString.." to go back and clear this setting."
end,
Info = infoText
}
)
end
if MCMLoaded then
function AnIndexOf(t, val)
--check for 0th term, to help with how OptionType.SCROLL works (returns value between 0 and 10)
if t[0] and t[0] == val then return 0 end
for k, v in ipairs(t) do
if v == val then
return k
end
end
return 1
end
---------------------------------------------------------------------------
-----------------------------------Info------------------------------------
MCM.AddSpace("EID", "Info")
MCM.AddText("EID", "Info", function() return "External Item Descriptions" end)
MCM.AddSpace("EID", "Info")
MCM.AddText("EID", "Info", function() return "Version "..EID.ModVersion .." ("..EID.GameVersion..")" end)
MCM.AddSpace("EID", "Info")
MCM.AddText("EID", "Info", function() return "by Wofsauge" end)
MCM.AddSpace("EID", "Info")
MCM.AddText("EID", "Info", function() return EID.isHidden and"~~~~~~~~~~~~~~~~~~~~~~~~~~~" or "" end)
MCM.AddText("EID", "Info", function() return EID.isHidden and"~~~~~ CURRENTLY HIDDEN! ~~~~~" or "" end)
MCM.AddText("EID", "Info", function()
EID.MCMCompat_isDisplayingEIDTab = ""
if EID.Config["HideKey"] ~= -1 or EID.Config["HideButton"] ~= -1 then
local hotkeyString = InputHelper.KeyboardToString[EID.Config["HideKey"]] or InputHelper.ControllerToString[EID.Config["HideButton"]]
return EID.isHidden and ("~~~~~~~ " .. hotkeyString .." to show ~~~~~~~~") or ""
else
return EID.isHidden and"~~ bind a key/button in the General tab to show ~~" or ""
end
end)
---------------------------------------------------------------------------
---------------------------------General-----------------------------------
-- Language
MCM.AddSetting(
"EID",
"General",
{
Type = ModConfigMenu.OptionType.NUMBER,
CurrentSetting = function()
if EID.Config["Language"] == "auto" then
return #(EID.Languages) + 1
else
return AnIndexOf(EID.Languages, EID.Config["Language"])
end
end,
Minimum = 1,
Maximum = #(EID.Languages) + 1, -- add "auto" language
Display = function()
EID.MCMCompat_isDisplayingEIDTab = "Visuals"
if EID.Config["Language"] == "auto" then
return "Language: Auto (" .. displayLanguage[AnIndexOf(EID.Languages, EID:getLanguage())] .. ")"
else
return "Language: " .. displayLanguage[AnIndexOf(EID.Languages, EID.Config["Language"])]
end
end,
OnChange = function(currentNum)
EID.MCM_OptionChanged = true
EID.RefreshBagTextbox = true -- Crafting isn't open so it won't notice MCM_OptionChanged, but definitely needs to refresh
if currentNum == #(EID.Languages) + 1 then
EID.Config["Language"] = "auto"
else
EID.Config["Language"] = EID.Languages[currentNum]
end
local isFixed = EID:fixDefinedFont()
if isFixed then
EID:loadFont(EID.modPath .. "resources/font/eid_"..EID.Config["FontType"]..".fnt")
end
renderDummyDesc(true)
end,
Info = {"Changes the language.","Languages marked with (WIP) are incomplete"}
}
)
-- Item Name Language
local translateStates = {"English", "Current Language", "Current + English"}
EID:AddNumberSetting("General", "TranslateItemName", "Name Language", 1, 3, {displayTable = translateStates,
infoText = {"If translated names are available,","this changes how item names are displayed."}})
-- Hide Keys
EID:AddHotkeySetting("General", "HideKey", "Toggle (Keyboard)",
"Press this key to toggle the description display", false)
EID:AddHotkeySetting("General", "HideButton", "Toggle (Controller)",
"Press this button to toggle the description display (Left Stick or Right Stick recommended; most other buttons will not work)", true)
MCM.AddSpace("EID", "General")
-- Position / Textbox Size
EID:AddNumberSetting("General", "XPosition", "Position X", 0, 500, {modifyBy = 5, infoText = "Default = 60"})
EID:AddNumberSetting("General", "YPosition", "Position Y", 0, 500, {modifyBy = 5, infoText = "Default = 45"})
EID:AddNumberSetting("General", "LineHeight", "Line Height", 1, 30, {infoText = "Default = 11 (varies per language)"})
EID:AddNumberSetting("General", "TextboxWidth", "Textbox Width", 1, 500, {modifyBy = 5, infoText = "Default = 130 (varies per language)"})
MCM.AddSpace("EID", "General")
EID:AddBooleanSetting("General", "InitiallyHidden", "Is Initially Hidden")
EID:AddBooleanSetting("General", "DisableStartOfRunWarnings", "Start of Run Warnings", {offText = "Enabled", onText = "Disabled",
repOnly = true, infoText = "Toggle the achievement, outdated game version, and modded crafting recipes warnings"})
EID:AddBooleanSetting("General", "DisableOnCurse", 'Show on "Curse of the Blind"', {offText = "True", onText = "False"})
EID:AddBooleanSetting("General", "DisableOnAprilFoolsChallenge", "Show on April Fools Challenge", {offText = "True", onText = "False"})
EID:AddBooleanSetting("General", "DisableOnAltPath", "Show Hidden Alt-Path Item", {offText = "True", onText = "False",
repOnly = true, infoText = "Show the description for the blind item in Downpour/Mines/etc."})
EID:AddBooleanSetting("General", "OnlyShowPillWhenUsedAtLeastOnce", "Show pill effect after one use", {infoText = "Keeps pilleffect descriptions unidentified, until the player has used the pill at least once in the run. This ignores effects caused by PHD and False PHD"})
EID:AddBooleanSetting("General", "ShowUnidentifiedPillDescriptions", "Show Unidentified Pill Effects")
EID:AddBooleanSetting("General", "HideInBattle", "Hide in Battle", {infoText = "Hides the descriptions when in a fight"})
MCM.AddSpace("EID", "General")
--indicator
local indicators = {"arrow", "blink", "border", "highlight", "none"}
EID:AddNumberSetting("General", "Indicator", "Indicator", 1, 5, {indexOf = indicators,
infoText = {"Change how the currently described item is marked"}})
MCM.AddSpace("EID", "General")
-- maxDistance
local distances = {1, 1.5, 2, 3, 4, 5, 6, 7, 8, 9, 10}
EID:AddScrollSetting("General", "MaxDistance", "Max Distance", distances, {label = " Grids",
infoText = "Distance to the object until descriptions are displayed"})
EID:AddBooleanSetting("General", "DisplayAllNearby", "Display All Objects In Range",
{ infoText = "Descriptions besides the closest one will be shown using the Local display mode" })
local descsToDisplaySteps = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 99}
EID:AddScrollSetting("General", "MaxDescriptionsToDisplay", "Max Descriptions to Display", descsToDisplaySteps,
{infoText = "Max number of descriptions to display per frame"})
--------Reset to default
MCM.AddSpace("EID", "General")
MCM.AddSetting(
"EID",
"General",
{
Type = ModConfigMenu.OptionType.BOOLEAN,
CurrentSetting = function() return true end,
Display = function() return "<---- RESET CONFIG TO DEFAULT ---->" end,
OnChange = function(currentBool)
local resetFont = (EID.Config["FontType"] ~= "default")
for k,v in pairs(EID.DefaultConfig) do EID.Config[k] = v end
EID.MCM_OptionChanged = true
EID.RefreshBagTextbox = true
if resetFont then EID:loadFont(EID.modPath .. "resources/font/eid_"..EID.Config["FontType"]..".fnt") end
renderDummyDesc(true)
end,
Info = {"Press this to reset the config back to its default values"}
}
)
---------------------------------------------------------------------------
---------------------------------Display-----------------------------------
local refreshRateSteps = {1, 2, 3, 4, 6, 10, 12, 15, 20, 30, 60}
EID:AddScrollSetting("Display", "RefreshRate", "Description Refresh Rate", refreshRateSteps,
{displayingTab = "", infoText = "How many times per second that EID updates what description to show"})
EID:AddBooleanSetting("Display", "CoopDescriptions", "Co-op Player Descriptions",
{infoText = "Allow Players 2, 3, and 4 to display descriptions in Co-op"})
EID:AddBooleanSetting("Display", "PairedPlayerDescriptions", "Paired Player Descriptions", {repOnly = true,
infoText = "Allow paired characters like Esau and Tainted Forgotten's bone pile to display descriptions"})
MCM.AddSpace("EID", "Display")
-- Simple toggles of what descriptions the user wants displayed
EID:AddBooleanSetting("Display", "DisplayItemInfo", "Collectible Infos", {displayingTab = ""})
EID:AddBooleanSetting("Display", "DisplayTrinketInfo", "Trinket Infos")
EID:AddBooleanSetting("Display", "DisplayCardInfo", "Card Infos")
EID:AddBooleanSetting("Display", "DisplayPillInfo", "Pill Infos")
EID:AddBooleanSetting("Display", "DisplayGlitchedItemInfo", "Glitched Item Infos", {repOnly = true,
infoText = "Note: The --luadebug launch option is required for more detailed glitched item descriptions; this can be dangerous!"})
EID:AddBooleanSetting("Display", "DisplaySacrificeInfo", "Sacrifice Room Infos")
EID:AddBooleanSetting("Display", "DisplayDiceInfo", "Dice Room Infos")
EID:AddBooleanSetting("Display", "DisplayCraneInfo", "Crane Game Infos", {repOnly = true})
EID:AddBooleanSetting("Display", "DisplayVoidStatInfo", "Void Stat Increase Infos")
EID:AddBooleanSetting("Display", "DisplaySanguineInfo", "Sanguine Bond Infos", {repOnly = true})
EID:AddBooleanSetting("Display", "PredictionSanguineBond", "Predict Sanguine Bond Result", {repOnly = true, infoText = "The next reward from Sanguine Bond can be predicted and highlighted in the description"})
local diceSteps = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
-- Spindown Dice Settings
if REPENTANCE then MCM.AddSpace("EID", "Display") end
EID:AddScrollSetting("Display", "SpindownDiceResults", "Spindown Dice", diceSteps, {repOnly = true, label = " Items",
infoText = "Number of item previews when holding Spindown Dice"})
-- Display IDs for Spindown Dice results
EID:AddBooleanSetting("Display", "SpindownDiceDisplayID", "Display IDs",
{repOnly = true, infoText = "Display IDs for Spindown Dice results"})
-- Display names for Spindown Dice results
EID:AddBooleanSetting("Display", "SpindownDiceDisplayName", "Display Names",
{repOnly = true, infoText = "Display names for Spindown Dice results"})
-- Spindown Dice skip locked items
EID:AddBooleanSetting("Display", "SpindownDiceSkipLocked", "Skip Locked Items",
{repOnly = true, infoText = "Skip locked items in the preview just as the dice will; the method to check for unlock status is not perfect, though"})
--------Obstruction---------
MCM.AddSpace("EID", "Display")
MCM.AddText("EID", "Display", "Display Infos when Obstructed")
EID:AddBooleanSetting("Display", "DisableObstructionOnFlight", "Show again when you have Flight")
EID:AddBooleanSetting("Display", "DisplayObstructedCardInfo", "Obstructed Card Infos")
EID:AddBooleanSetting("Display", "DisplayObstructedPillInfo", "Obstructed Pill Infos")
EID:AddBooleanSetting("Display", "DisplayObstructedSoulstoneInfo", "Obstructed Soulstone Infos", {repOnly = true})
-------Shop Spoilers-------
MCM.AddSpace("EID", "Display")
MCM.AddText("EID", "Display", "Display Infos in Shops")
EID:AddBooleanSetting("Display", "DisplayCardInfoShop", "Shop Card Infos")
EID:AddBooleanSetting("Display", "DisplayPillInfoShop", "Shop Pill Infos")
EID:AddBooleanSetting("Display", "DisplaySoulstoneInfoShop", "Shop Soulstone Infos", {repOnly = true})
----"Options?" Spoilers----
if REPENTANCE then
MCM.AddSpace("EID", "Display")
MCM.AddText("EID", "Display", "Interaction with 'Options?'")
end
EID:AddBooleanSetting("Display", "DisplayCardInfoOptions?", "'Options?' Card Infos", {repOnly = true})
EID:AddBooleanSetting("Display", "DisplayPillInfoOptions?", "'Options?' Pill Infos", {repOnly = true})
---------------------------------------------------------------------------
---------------------------------Visuals-----------------------------------
-- Font Type
MCM.AddSetting(
"EID",
"Visuals",
{
Type = ModConfigMenu.OptionType.NUMBER,
CurrentSetting = function()
return AnIndexOf(fontNames, EID.Config["FontType"])
end,
Minimum = 1,
Maximum = #fontNames,
Display = function()
EID.MCMCompat_isDisplayingEIDTab = "Visuals";
return "Font Type: " .. EID.Config["FontType"]
end,
OnChange = function(currentNum)
if EID:canUseFontType(fontNames[currentNum]) then
EID.MCM_OptionChanged = true
EID.Config["FontType"] = fontNames[currentNum]
EID.Config["LineHeight"] = fonts[currentNum].lineHeight or EID.Config["LineHeight"]
EID.Config["TextboxWidth"] = fonts[currentNum].textboxWidth or EID.Config["TextboxWidth"]
local fontFile = EID.Config["FontType"] or "default"
EID:loadFont(EID.modPath .. "resources/font/eid_"..fontFile..".fnt")
end
end
}
)
-- Display Mode
local displayModes = {"default", "local"}
EID:AddNumberSetting("Visuals", "DisplayMode", "Display Mode", 1, #displayModes, {indexOf = displayModes,
infoText = {"Changes display mode of descriptions", "Default: Text is displayed in the top left", "Local: Text is displayed under the described object"}})
-- Scale/Size
EID:AddNumberSetting("Visuals", "Size", "Text Size", 0.5, 2, {modifyBy = 0.25, onChangeFunc =
function(currentNum)
EID.MCM_OptionChanged = true
currentNum = currentNum - (currentNum % 0.25)
EID.Config["Size"] = currentNum
end})
EID:AddNumberSetting("Visuals", "LocalModeSize", "Text Size (Local Mode)", 0.5, 2, {modifyBy = 0.25, onChangeFunc =
function(currentNum)
EID.MCM_OptionChanged = true
currentNum = currentNum - (currentNum % 0.25)
EID.Config["LocalModeSize"] = currentNum
end})
-- SCALE Hotkey
EID:AddHotkeySetting("Visuals",
"SizeHotkey", "Toggle Size (Keyboard)",
{"Press this key to change the text size.", "Hold this key to smoothly change the text size."}, false)
-- Local Mode Centered or not
EID:AddBooleanSetting("Visuals", "LocalModeCentered", "Local Mode Centered")
-- Transparency
local transparencies = {0.1, 0.175, 0.25, 0.3, 0.4, 0.5, 0.6, 0.75, 0.8, 0.9, 1}
EID:AddScrollSetting("Visuals", "Transparency", "Transparency", transparencies)
MCM.AddSpace("EID", "Visuals")
-------Markup icon Sizes---------
local markupSizes = {"default", "big", "small"}
EID:AddNumberSetting("Visuals", "MarkupSize", "Markup Icon Size", 1, #markupSizes, {indexOf = markupSizes})
EID:AddBooleanSetting("Visuals", "StatChangeIcons", "Stat Change Icons")
EID:AddBooleanSetting("Visuals", "StatAndPickupBulletpoints", "Stat/Pickup Bulletpoint Icons")
MCM.AddSpace("EID", "Visuals")
-- Simple toggles of what is shown in the title and transformation lines of a description
EID:AddBooleanSetting("Visuals", "ShowItemName", "Display Item Name")
EID:AddBooleanSetting("Visuals", "ShowItemType", "Display Item Type")
EID:AddBooleanSetting("Visuals", "ShowItemIcon", "Display Item Icon")
EID:AddBooleanSetting("Visuals", "ShowItemDescription", "Display Item Description")
EID:AddBooleanSetting("Visuals", "TransformationText", "Display Transformation Name")
EID:AddBooleanSetting("Visuals", "TransformationIcons", "Display Transformation Icon")
EID:AddBooleanSetting("Visuals", "TransformationProgress", "Display Transformation Progress")
EID:AddBooleanSetting("Visuals", "ShowQuality", "Display Quality Info", {repOnly = true})
EID:AddBooleanSetting("Visuals", "ShowObjectID", "Display Object ID")
-------Mod indicator for modded items---------
local modIndicatorDisplays = {"Both","Name only","Icon only", "None"}
EID:AddNumberSetting("Visuals", "ModIndicatorDisplay", "Display Mod Indicator", 1, #modIndicatorDisplays, {indexOf = modIndicatorDisplays})
---------------------------------------------------------------------------
------------------------------Item Reminder--------------------------------
EID:AddBooleanSetting("Reminder", "ItemReminderEnabled", "Item Reminder Description", {displayingTab = "",offText = "Disabled", onText = "Enabled", infoText = "Hold Map to show your active item's effect, recently picked up items, and much more"})
local actionToName = { [0] = "Move Left", "Move Right", "Move Up", "Move Down", "Shoot Left", "Shoot Right", "Shoot Up", "Shoot Down", "Bomb", "Item", "Pill/Card", "Drop", "Pause", "Map" }
EID:AddNumberSetting("Reminder", "BagOfCraftingToggleKey", "Hold to Show", 8, 13, {displayTable = actionToName,
infoText = {"Hold this key to display the Item Reminder description, show Flip/Spindown previews and control the Bag of Crafting recipe list"}})
local itemSlotReminders = { [0] = "No", "Yes (max 1)", "Yes (max 2)", "Yes (max 3)", "Yes (max 4)", "Yes (max 5)", "Yes (max 6)", "Yes (max 7)", "Yes (max 8)" }
MCM.AddSpace("EID", "Reminder")
MCM.AddText("EID", "Reminder", "Item Descriptions")
-- should these be organized in the order they're shown in the map desc code?
EID:AddNumberSetting("Reminder", "ItemReminderShowRecentItem", "Recent Items", 0, 8, { displayTable = itemSlotReminders, infoText = {"Show recently acquired item descriptions in the Item Reminder (good for Curse of the Blind!)"}})
EID:AddNumberSetting("Reminder", "ItemReminderShowActiveDesc", "Active Items", 0, 2, { displayTable = itemSlotReminders, infoText = "Show your active item descriptions in the Item Reminder"})
EID:AddNumberSetting("Reminder", "ItemReminderShowPocketDesc", "Pocket Items", 0, 4, { displayTable = itemSlotReminders, infoText = "Show your pocket item (card, pill, active) descriptions in the Item Reminder"})
EID:AddNumberSetting("Reminder", "ItemReminderShowTrinketDesc", "Trinkets", 0, 2, { displayTable = itemSlotReminders, infoText = "Show your trinket descriptions in the Item Reminder"})
EID:AddNumberSetting("Reminder", "ItemReminderShowPoopDesc", "Poop Spells", 0, 6, { repOnly = true, displayTable = itemSlotReminders, infoText = "Show Tainted ???'s next Poop Spell descriptions in the Item Reminder"})
EID:AddBooleanSetting("Reminder", "ItemReminderShowHiddenInfo", "Show Hidden Information", { infoText = "Items like Error (404) or Rainbow Worm can have their current granted item revealed in the Item Reminder"})
EID:AddBooleanSetting("Reminder", "ItemReminderShowRNGCheats", "Show RNG Predictions", { infoText = "Some items can have their next random result predicted and shown in the Item Reminder"})
---------------------------------------------------------------------------
-----------------------------BAG OF CRAFTING-------------------------------
if REPENTANCE then
-- Bag of Crafting Display
local bagDisplays = {"always","hold","never"}
EID:AddNumberSetting("Crafting", "DisplayBagOfCrafting", "Show Display", 1, #bagDisplays, { displayingTab = "Crafting", indexOf = bagDisplays, infoText = {"Always = Always show Results", "Hold = Show when holding up bag", "Never = Disable Bag of Crafting feature"}})
-- Bag of Crafting Display Mode
local bagDisplayModes = {"Recipe List","Preview Only","No Recipes","Pickups Only"}
EID:AddNumberSetting("Crafting", "BagOfCraftingDisplayMode", "Display Mode", 1, #bagDisplayModes, { indexOf = bagDisplayModes,
infoText = {"Toggle showing a list of recipes, an item preview when bag is full, what item pool/quality you might get, or only the floor pickups"}})
-- Bag of Crafting Hide in Battle
EID:AddBooleanSetting("Crafting", "BagOfCraftingHideInBattle", "Hide in Battle", {onText = "Yes", offText = "No",
infoText = "Hides the Bag of Crafting info when in a fight"})
-- Bag of Crafting Show Controls
EID:AddBooleanSetting("Crafting", "BagOfCraftingShowControls", "Show Controls", {onText = "Yes", offText = "No",
infoText = "Show the text for the Hide/Preview and Recipe List hotkeys"})
-- Bag of Crafting 8 icons toggle
EID:AddBooleanSetting("Crafting", "BagOfCraftingDisplayIcons", "Show Recipes/Best Bag as", {onText = "8 Icons", offText = "Groups",
infoText = "Choose if you want recipes (and the Best Quality bag in No Recipes Mode) shown as 8 icons, or as grouped ingredients"})
-- Modded Recipes toggle
EID:AddBooleanSetting("Crafting", "BagOfCraftingModdedRecipes", "Load Modded Item Recipes (WIP)", {
infoText = {"Enable or disable basic modded item support", "If you have a lot of modded items, it will slow down game launch"}})
MCM.AddSpace("EID", "Crafting")
MCM.AddText("EID", "Crafting", function() return "Recipe List Options" end)
-- Bag of Crafting results per page
local bagSteps = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}
EID:AddScrollSetting("Crafting", "BagOfCraftingResults", "Displayed Recipes", bagSteps,
{ infoText = "Page size for the preview of items currently craftable with Bag of Crafting"})
-- Bag of Crafting thorough recipe checks
local combSteps = {8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18}
EID:AddScrollSetting("Crafting", "BagOfCraftingCombinationMax", "Thorough Calculations", combSteps,
{ infoText = {"Get every recipe for the X best components; setting this high slows down recipe checking", "(12 = 500 combinations, 14 = 3,000, 16 = 13,000)"}})
-- Bag of Crafting random recipe checks
local calcSteps = {200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200}
EID:AddScrollSetting("Crafting", "BagOfCraftingRandomResults", "Random Calculations", calcSteps,
{ infoText = "An additional X number of randomly chosen recipes will be checked, changing each pickup spawn/despawn or refresh"})
-- Bag of Crafting item names
EID:AddBooleanSetting("Crafting", "BagOfCraftingDisplayNames", "Show Item Names",
{ infoText = "If on, each recipe result takes two lines, one for the item name, one for the recipe"})
MCM.AddSpace("EID", "Crafting")
EID:AddHotkeySetting("Crafting",
"CraftingHideKey", "Toggle (Keyboard)",
"Press this key to toggle the crafting display, allowing you to check descriptions of items/pickups on the floor", false)
EID:AddHotkeySetting("Crafting",
"CraftingHideButton", "Toggle (Controller)",
"Press this button to toggle the crafting display (Left Stick or Right Stick recommended; most other buttons will not work)", true)
EID:AddHotkeySetting("Crafting",
"CraftingResultKey", "Result Toggle (Keyboard)",
"Press this key to toggle the description of the item ready to be crafted in Recipe List/No Recipe Mode", false)
EID:AddHotkeySetting("Crafting",
"CraftingResultButton", "Result Toggle (Controller)",
"Press this button to toggle the description of the item ready to be crafted (Left Stick or Right Stick recommended; most other buttons will not work)", true)
MCM.AddSpace("EID", "Crafting")
--------Clear bag---------
MCM.AddSetting(
"EID",
"Crafting",
{
Type = ModConfigMenu.OptionType.BOOLEAN,
CurrentSetting = function() return true end,
Display = function() return "<---- Clear Bag Content ---->" end,
OnChange = function()
EID.BoC.BagItems = {}
end,
Info = {"Press this to clear all currently detected items on the bag"}
}
)
--------Clear Floor---------
MCM.AddSetting(
"EID",
"Crafting",
{
Type = ModConfigMenu.OptionType.BOOLEAN,
CurrentSetting = function() return true end,
Display = function() return "<---- Clear Floor item list ---->" end,
OnChange = function()
EID.BoC.RoomQueries = {}
EID.BoC.FloorQuery = {}
EID.BoC.CurrentPickupCount = -1
end,
Info = {"Press this to clear all currently detected items on the floor"}
}
)
end
---------------------------------------------------------------------------
----------------------------Savegame Config--------------------------------
if EID.SaveGame then
MCM.AddText("EID", "Save Game", function() EID.MCMCompat_isDisplayingEIDTab = ""; return "Loaded savegame data:" end)
MCM.AddText("EID", "Save Game", function() return EID.SaveGame.Platform .." User: "..EID.SaveGame.UserName.." ("..EID.SaveGame.UserID..")" end)
MCM.AddSpace("EID", "Save Game")
-- Show Item needs Collection
MCM.AddSetting(
"EID",
"Save Game",
{
Type = ModConfigMenu.OptionType.NUMBER,
CurrentSetting = function()
return EID.Config["SaveGameNumber"]
end,
Minimum = 0,
Maximum = 3,
Display = function()
if EID.Config["SaveGameNumber"] == 0 then
return "Current Save Game: 0 (Deactivated)"
end
return "Current Save Game: " .. EID.Config["SaveGameNumber"]
end,
OnChange = function(currentNum)
EID.MCM_OptionChanged = true
EID.Config["SaveGameNumber"] = currentNum
end,
Info = {"Save game you are currently on. This info needs to be set to get the correct lookup tables"}
}
)
MCM.AddText("EID", "Save Game", function()
if EID.Config["SaveGameNumber"] == 0 then return "" end
local count = 0
for k, v in pairs(EID.SaveGame[EID.Config["SaveGameNumber"]].ItemNeedsPickup) do
count = count + 1
end
return "Collection page items missing: "..count end)
MCM.AddSpace("EID", "Save Game")
-- Needs collection Color
MCM.AddSetting(
"EID",
"Save Game",
{
Type = ModConfigMenu.OptionType.NUMBER,
CurrentSetting = function()
return AnIndexOf(colorNameArray, EID.Config["ItemCollectionColor"])
end,
Minimum = 0,
Maximum = 1000,
Display = function()
if EID.Config["ItemCollectionColor"] == nil then EID.Config["ItemCollectionColor"] = EID.DefaultConfig["ItemCollectionColor"] end
EID.MCMCompat_isDisplayingEIDTab = "Visuals";
return "Collection Page Highlight color: " .. string.gsub(EID.Config["ItemCollectionColor"], "Color", "").. " ("..AnIndexOf(colorNameArray, EID.Config["ItemCollectionColor"]).."/"..#colorNameArray..")"
end,
OnChange = function(currentNum)
EID.MCM_OptionChanged = true
if currentNum == 0 then currentNum = #colorNameArray end
if currentNum > #colorNameArray then currentNum = 1 end
EID.Config["ItemCollectionColor"] = colorNameArray[currentNum]
end,
Info = {"Color in which item names are colored to highlight that this item needs to be collected for the collection page"}
}
)
else
MCM.AddSpace("EID", "Save Game")
MCM.AddSpace("EID", "Save Game")
MCM.AddText("EID", "Save Game", function() EID.MCMCompat_isDisplayingEIDTab = ""; return "To enable savegame related features," end)
MCM.AddText("EID", "Save Game", "please run \"scripts\\savegame_reader.exe\"")
MCM.AddText("EID", "Save Game", "found in the EID mod folder")
end
---------------------------------------------------------------------------
-----------------------------Mouse Controls--------------------------------
MCM.AddText("EID", "Mouse", "! THIS FEATURE IS IN EARLY DEVELOPMENT !")
MCM.AddSpace("EID", "Mouse")
MCM.AddText("EID", "Mouse", "MCM -> General -> Hud Offset")
MCM.AddText("EID", "Mouse", "to adjust Hud Offset")
MCM.AddSpace("EID", "Mouse")
-- Enable mouse controls
MCM.AddSetting(
"EID",
"Mouse",
{
Type = ModConfigMenu.OptionType.BOOLEAN,
CurrentSetting = function()
return EID.Config["EnableMouseControls"]
end,
Display = function()
EID.MCMCompat_isDisplayingEIDTab = "Mouse";
local onOff = "False"
if EID.Config["EnableMouseControls"] then
onOff = "True"
end
return "Enable Mouse controls: " .. onOff
end,
OnChange = function(currentBool)
EID.Config["EnableMouseControls"] = currentBool
end,
Info = {"If enabled, allows to hover over certain HUD elements to get descriptions"}
}
)
-- Enable mouse controls
MCM.AddSetting(
"EID",
"Mouse",
{
Type = ModConfigMenu.OptionType.BOOLEAN,
CurrentSetting = function()
return EID.Config["ShowCursor"]
end,
Display = function()
local onOff = "False"
if EID.Config["ShowCursor"] then
onOff = "True"
end
return "Show Cursor: " .. onOff
end,
OnChange = function(currentBool)
EID.Config["ShowCursor"] = currentBool
end,
}
)
---------------------------------------------------------------------------
---------------------------------Colors-----------------------------------
-- Text Color
MCM.AddSetting(
"EID",
"Colors",
{
Type = ModConfigMenu.OptionType.NUMBER,
CurrentSetting = function()
return AnIndexOf(colorNameArray, EID.Config["TextColor"])
end,
Minimum = 0,
Maximum = 1000,
Display = function()
if EID.Config["TextColor"] == nil then EID.Config["TextColor"] = EID.DefaultConfig["TextColor"] end
EID.MCMCompat_isDisplayingEIDTab = "Visuals";
return "Descriptions: " .. string.gsub(EID.Config["TextColor"], "Color", "").. " ("..AnIndexOf(colorNameArray, EID.Config["TextColor"]).."/"..#colorNameArray..")"
end,
OnChange = function(currentNum)
EID.MCM_OptionChanged = true
if currentNum == 0 then currentNum = #colorNameArray end
if currentNum > #colorNameArray then currentNum = 1 end
EID.Config["TextColor"] = colorNameArray[currentNum]
end,
Info = {"Changes the color of normal texts."}
}
)
-- Name Color
MCM.AddSetting(
"EID",
"Colors",
{
Type = ModConfigMenu.OptionType.NUMBER,
CurrentSetting = function()
return AnIndexOf(colorNameArray, EID.Config["ItemNameColor"])
end,
Minimum = 0,
Maximum = 1000,
Display = function()
if EID.Config["ItemNameColor"] == nil then EID.Config["ItemNameColor"] = EID.DefaultConfig["ItemNameColor"] end
return "Names: " .. string.gsub(EID.Config["ItemNameColor"], "Color", "").. " ("..AnIndexOf(colorNameArray, EID.Config["ItemNameColor"]).."/"..#colorNameArray..")"
end,
OnChange = function(currentNum)
EID.MCM_OptionChanged = true
if currentNum == 0 then currentNum = #colorNameArray end
if currentNum > #colorNameArray then currentNum = 1 end
EID.Config["ItemNameColor"] = colorNameArray[currentNum]
end,
Info = {"Changes the color of name texts."}
}
)
-- Transform Color
MCM.AddSetting(
"EID",
"Colors",
{
Type = ModConfigMenu.OptionType.NUMBER,
CurrentSetting = function()
return AnIndexOf(colorNameArray, EID.Config["TransformationColor"])
end,
Minimum = 0,
Maximum = 1000,
Display = function()
if EID.Config["TransformationColor"] == nil then EID.Config["TransformationColor"] = EID.DefaultConfig["TransformationColor"] end
return "Transformations: " .. string.gsub(EID.Config["TransformationColor"], "Color", "").. " ("..AnIndexOf(colorNameArray, EID.Config["TransformationColor"]).."/"..#colorNameArray..")"
end,
OnChange = function(currentNum)
EID.MCM_OptionChanged = true
if currentNum == 0 then currentNum = #colorNameArray end
if currentNum > #colorNameArray then currentNum = 1 end
EID.Config["TransformationColor"] = colorNameArray[currentNum]
end,
Info = {"Changes the color of transformation texts."}
}
)
-- Error Color
MCM.AddSetting(
"EID",
"Colors",
{
Type = ModConfigMenu.OptionType.NUMBER,
CurrentSetting = function()
return AnIndexOf(colorNameArray, EID.Config["ErrorColor"])
end,
Minimum = 0,
Maximum = 1000,
Display = function()
if EID.Config["ErrorColor"] == nil then EID.Config["ErrorColor"] = EID.DefaultConfig["ErrorColor"] end
return "Errors: " .. string.gsub(EID.Config["ErrorColor"], "Color", "").. " ("..AnIndexOf(colorNameArray, EID.Config["ErrorColor"]).."/"..#colorNameArray..")"
end,
OnChange = function(currentNum)
EID.MCM_OptionChanged = true
if currentNum == 0 then currentNum = #colorNameArray end
if currentNum > #colorNameArray then currentNum = 1 end
EID.Config["ErrorColor"] = colorNameArray[currentNum]
end,
Info = {"Changes the color of error messages like Unknown pills"}
}
)
-- Mod indicator Color
MCM.AddSetting(
"EID",
"Colors",
{
Type = ModConfigMenu.OptionType.NUMBER,
CurrentSetting = function()
return AnIndexOf(colorNameArray, EID.Config["ModIndicatorTextColor"])
end,
Minimum = 0,
Maximum = 1000,
Display = function()
if EID.Config["ModIndicatorTextColor"] == nil then EID.Config["TextColor"] = EID.DefaultConfig["ModIndicatorTextColor"] end
return "Mod Indicator: " .. string.gsub(EID.Config["ModIndicatorTextColor"], "Color", "").. " ("..AnIndexOf(colorNameArray, EID.Config["ModIndicatorTextColor"]).."/"..#colorNameArray..")"
end,
OnChange = function(currentNum)
EID.MCM_OptionChanged = true
if currentNum == 0 then currentNum = #colorNameArray end
if currentNum > #colorNameArray then currentNum = 1 end
EID.Config["ModIndicatorTextColor"] = colorNameArray[currentNum]
end,
Info = {"Changes the color of mod indicator texts (as long as they are enabled)."}
}
)
if MCM.i18n == "Chinese" then
require("eid_mcm_cn")
end
end