-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAPI.py
More file actions
3260 lines (2651 loc) · 75.7 KB
/
Copy pathAPI.py
File metadata and controls
3260 lines (2651 loc) · 75.7 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
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
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
class ApiBuff:
""
Graphic: int = None
Text: str = None
Timer: int = None
Type = None
Title: str = None
class ApiEntity(ApiGameObject):
""
Name: str = None
__class__: str = None
Serial: int = None
def ToString(self) -> "str":
"""
Returns a readable string representation of the entity.
Used when printing or converting the object to a string in Python scripts.
"""
pass
def Destroy(self) -> None:
"""
This will remove the item from the client, it will reappear if you leave the area and come back.
This object will also no longer be available and may cause issues if you try to interact with it further.
"""
pass
class ApiGameObject:
""
Impassible: bool = None
X: int = None
Y: int = None
Z: int = None
Graphic: int = None
Hue: int = None
Distance: int = None
IsDestroyed: bool = None
__class__: str = None
def SetOutlineColor(self, htmlColor: "str") -> None:
"""
Set an objects outline color using html hex colors.
Example:
```py
API.Player.SetOutlineColor("#105510")
```
"""
pass
def SetHue(self, hue: "int") -> None:
"""
Set the hue of a game object.
"""
pass
def HasLineOfSightFrom(self, observer: "ApiGameObject" = None) -> "bool":
"""
Determines if there is line of sight from the specified observer to this object.
If no observer is specified, it defaults to the player.
"""
pass
def ToString(self) -> "str":
"""
Returns a readable string representation of the game object.
Used when printing or converting the object to a string in Python scripts.
"""
pass
def __repr__(self) -> "str":
"""
Returns a detailed string representation of the object.
This string is used by Python’s built-in <c>repr()</c> function.
"""
pass
class ApiItem(ApiEntity):
""
Amount: int = None
Opened: bool = None
Container: int = None
RootContainer: int = None
OnGround: bool = None
RootEntity: ApiEntity = None
__class__: str = None
IsCorpse: bool = None
IsContainer: bool = None
MatchingHighlightName: str = None
MatchesHighlight: bool = None
def GetItemData(self) -> "ApiItemData":
"""
Get the items ItemData
"""
pass
def GetContainerGump(self) -> "ApiUiBaseControl":
"""
If this item is a container ( item.IsContainer ) and is open, this will return the grid container or container gump for it.
"""
pass
def NameAndProps(self, wait: "bool" = False, timeout: "int" = 10) -> "str":
"""
Gets the item name and properties (tooltip text).
This returns the name and properties in a single string. You can split it by newline if you want to separate them.
"""
pass
class ApiItemData:
""
Flags = None
Weight: int = None
Layer: int = None
Count: int = None
AnimID: int = None
Hue: int = None
LightIndex: int = None
Height: int = None
Name: str = None
IsAnimated: bool = None
IsBridge: bool = None
IsImpassable: bool = None
IsSurface: bool = None
IsWearable: bool = None
IsInternal: bool = None
IsBackground: bool = None
IsNoDiagonal: bool = None
IsWet: bool = None
IsFoliage: bool = None
IsRoof: bool = None
IsTranslucent: bool = None
IsPartialHue: bool = None
IsStackable: bool = None
IsTransparent: bool = None
IsContainer: bool = None
IsDoor: bool = None
IsWall: bool = None
IsLight: bool = None
IsNoShoot: bool = None
IsWeapon: bool = None
IsMultiMovable: bool = None
IsWindow: bool = None
class ApiJournalEntry:
""
Hue: int = None
Name: str = None
Text: str = None
TextType = None
Time: datetime = None
MessageType = None
Disposed: bool = None
class ApiLand(ApiGameObject):
""
__class__: str = None
class ApiMobile(ApiEntity):
""
X: int = None
Y: int = None
Z: int = None
HitsDiff: int = None
ManaDiff: int = None
StamDiff: int = None
IsDead: bool = None
IsPoisoned: bool = None
HitsMax: int = None
Hits: int = None
StaminaMax: int = None
Stamina: int = None
ManaMax: int = None
Mana: int = None
IsRenamable: bool = None
IsHuman: bool = None
IsYellowHits: bool = None
IsHidden: bool = None
IsGargoyle: bool = None
IsMounted: bool = None
IsDrivingBoat: bool = None
IsRunning: bool = None
Notoriety: Notoriety = None
InWarMode: bool = None
Backpack: ApiItem = None
Mount: ApiItem = None
__class__: str = None
def NameAndProps(self, wait: "bool" = False, timeout: "int" = 10) -> "str":
"""
Gets the mobile name and properties (tooltip text).
This returns the name and properties in a single string. You can split it by newline if you want to separate them.
"""
pass
class ApiMulti(ApiGameObject):
""
__class__: str = None
class ApiPlayer(ApiMobile):
""
X: int = None
Y: int = None
Z: int = None
Position: ApiPoint3D = None
Strength: int = None
Dexterity: int = None
Intelligence: int = None
StrengthIncrease: int = None
DexterityIncrease: int = None
IntelligenceIncrease: int = None
StrLock = None
DexLock = None
IntLock = None
HitPointsIncrease: int = None
ManaIncrease: int = None
StaminaIncrease: int = None
HitPointsRegeneration: int = None
ManaRegeneration: int = None
StaminaRegeneration: int = None
PhysicalResistance: int = None
FireResistance: int = None
ColdResistance: int = None
PoisonResistance: int = None
EnergyResistance: int = None
MaxPhysicResistance: int = None
MaxFireResistance: int = None
MaxColdResistance: int = None
MaxPoisonResistance: int = None
MaxEnergyResistance: int = None
DamageMin: int = None
DamageMax: int = None
DamageIncrease: int = None
HitChanceIncrease: int = None
SwingSpeedIncrease: int = None
DefenseChanceIncrease: int = None
MaxDefenseChanceIncrease: int = None
ReflectPhysicalDamage: int = None
SpellDamageIncrease: int = None
FasterCasting: int = None
FasterCastRecovery: int = None
LowerManaCost: int = None
LowerReagentCost: int = None
IsCasting: bool = None
IsRecovering: bool = None
Luck: int = None
Gold: int = None
TithingPoints: int = None
Weight: int = None
WeightMax: int = None
StatsCap: int = None
Followers: int = None
FollowersMax: int = None
EnhancePotions: int = None
MaxHitPointsIncrease: int = None
MaxManaIncrease: int = None
MaxStaminaIncrease: int = None
IsHidden: bool = None
IsWalking: bool = None
InWarMode: bool = None
__class__: str = None
class ApiSoundEntry:
""
ID: int = None
X: int = None
Y: int = None
Time: datetime = None
class ApiStatic(ApiGameObject):
""
IsImpassible: bool = None
IsTree: bool = None
IsVegetation: bool = None
IsCave: bool = None
Name: str = None
__class__: str = None
class ApiUiAlphaBlendControl(ApiUiBaseControl):
""
Hue: int = None
Alpha: float = None
BaseColorR: int = None
BaseColorG: int = None
BaseColorB: int = None
BaseColorA: int = None
def SetBaseColor(self, r: "int", g: "int", b: "int", a: "int" = 255) -> None:
"""
Sets the base color of the alpha blend control using RGBA values (0-255)
"""
pass
class ApiUiBaseControl:
""
CanMove: bool = None
IsVisible: bool = None
IsDisposed: bool = None
def Add(self, childControl: "Any") -> None:
"""
Adds a child control to this control. Works with gumps too (gump.Add(control)).
Used in python API
"""
pass
def GetX(self) -> "int":
"""
Returns the control's X position.
Used in python API
"""
pass
def GetY(self) -> "int":
"""
Returns the control's Y position.
Used in python API
"""
pass
def SetX(self, x: "int") -> "ApiUiBaseControl":
"""
Sets the control's X position.
Used in python API
"""
pass
def SetY(self, y: "int") -> "ApiUiBaseControl":
"""
Sets the control's Y position.
Used in python API
"""
pass
def SetPos(self, x: "int", y: "int") -> "ApiUiBaseControl":
"""
Sets the control's X and Y positions.
Used in python API
"""
pass
def GetWidth(self) -> "int":
pass
def GetHeight(self) -> "int":
pass
def SetWidth(self, width: "int") -> "ApiUiBaseControl":
"""
Sets the control's width.
Used in python API
"""
pass
def SetHeight(self, height: "int") -> "ApiUiBaseControl":
"""
Sets the control's height.
Used in python API
"""
pass
def SetRect(self, x: "int", y: "int", width: "int", height: "int") -> "ApiUiBaseControl":
"""
Sets the control's position and size in one operation.
Used in python API
"""
pass
def CenterXInViewPort(self) -> "ApiUiBaseControl":
"""
Centers a GUMP horizontally in the viewport. Only works on Gump instances.
Used in python API
"""
pass
def CenterYInViewPort(self) -> "ApiUiBaseControl":
"""
Centers a GUMP vertically in the viewport. Only works on Gump instances.
Used in python API
"""
pass
def GetAlpha(self) -> "float":
"""
Returns the control's Alpha value.
Used in python API
"""
pass
def SetAlpha(self, alpha: "float") -> "ApiUiBaseControl":
"""
Sets the control's Alpha value.
Used in python API
"""
pass
def Clear(self) -> "ApiUiBaseControl":
"""
Clears all child controls from this control.
Used in python API
"""
pass
def Dispose(self) -> None:
"""
Close/Destroy the control
"""
pass
class ApiUiBaseGump(ApiUiBaseControl, IApiGump):
""
IsDisposed: bool = None
PacketGumpText: str = None
CanCloseWithRightClick: bool = None
LayerOrder = None
Gump: ApiUiBaseGump = None
def SetInScreen(self) -> None:
"""
Ensures the gump is fully visible within the screen boundaries.
Adjusts the gump's position if it extends beyond the screen edges.
Used in python API
"""
pass
def CenterYInScreen(self) -> None:
"""
Centers the gump vertically within the entire screen.
This accounts for the full screen dimensions, including all UI elements.
Used in python API
"""
pass
def CenterXInScreen(self) -> None:
"""
Centers the gump horizontally within the entire screen.
This accounts for the full screen dimensions, including all UI elements.
Used in python API
"""
pass
class ApiUiButton(ApiUiBaseControl):
""
ButtonID: int = None
IsClicked: bool = None
ButtonAction: int = None
ToPage: int = None
ButtonGraphicNormal: int = None
ButtonGraphicPressed: int = None
ButtonGraphicOver: int = None
Hue: int = None
FontCenter: bool = None
ContainsByBounds: bool = None
def HasBeenClicked(self) -> "bool":
pass
class ApiUiCheckbox(ApiUiBaseControl):
""
IsChecked: bool = None
Text: str = None
def GetIsChecked(self) -> "bool":
"""
Gets the checked state of the checkbox.
Used in python API
"""
pass
def SetIsChecked(self, isChecked: "bool") -> None:
"""
Sets the checked state of the checkbox.
Used in python API
"""
pass
def GetText(self) -> "str":
"""
Gets the text label displayed next to the checkbox.
Used in python API
"""
pass
class ApiUiControlDropDown(ApiUiBaseControl):
""
def GetSelectedIndex(self) -> "int":
"""
Get the selected index of the dropdown. The first entry is 0.
"""
pass
def OnDropDownOptionSelected(self, onSelectionChanged: "Any") -> "ApiUiControlDropDown":
"""
Add an onSelectionChanged callback to this dropdown control.
The callback function will receive the selected index as a parameter.
Example:
```py
def on_select(index):
API.SysMsg(f"Selected index: {index}")
dropdown = API.Gumps.CreateDropDown(100, ["first", "second", "third"], 0)
dropdown.OnDropDownOptionSelected(on_select)
while True:
API.ProcessCallbacks()
```
"""
pass
class ApiUiGump:
""
def CreateGump(self, acceptMouseInput: "bool" = True, canMove: "bool" = True, keepOpen: "bool" = False) -> "ApiUiBaseGump":
"""
Get a blank gump.
Example:
```py
g = API.CreateGump()
g.SetRect(100, 100, 200, 200)
g.Add(API.CreateGumpLabel("Hello World!"))
API.AddGump(g)
```
"""
pass
def CreateModernGump(self, x: "int", y: "int", width: "int", height: "int", resizable: "bool" = True, minWidth: "int" = 50, minHeight: "int" = 50, onResized: "Any" = None) -> "ApiUiNineSliceGump":
"""
Creates a modern nine-slice gump using ModernUIConstants for consistent styling.
The gump uses the standard modern UI panel texture and border size internally.
"""
pass
def AddGump(self, g: "Any") -> None:
"""
Add a gump to the players screen.
Example:
```py
g = API.CreateGump()
g.SetRect(100, 100, 200, 200)
g.Add(API.CreateGumpLabel("Hello World!"))
API.AddGump(g)
```
"""
pass
def CreateGumpCheckbox(self, text: "str" = "", hue: "int" = 0, isChecked: "bool" = False) -> "ApiUiCheckbox":
"""
Create a checkbox for gumps.
Example:
```py
g = API.CreateGump()
g.SetRect(100, 100, 200, 200)
cb = API.CreateGumpCheckbox("Check me?!")
g.Add(cb)
API.AddGump(g)
API.SysMsg("Checkbox checked: " + str(cb.IsChecked))
```
"""
pass
def CreateGumpLabel(self, text: "str", hue: "int" = 996) -> "ApiUiLabel":
"""
Create a label for a gump.
Example:
```py
g = API.CreateGump()
g.SetRect(100, 100, 200, 200)
g.Add(API.CreateGumpLabel("Hello World!"))
API.AddGump(g)
```
"""
pass
def CreateGumpColorBox(self, opacity: "float" = 0.7, color: "str" = "#000000") -> "ApiUiAlphaBlendControl":
"""
Get a transparent color box for gumps.
Example:
```py
g = API.CreateGump()
g.SetRect(100, 100, 200, 200)
cb = API.CreateGumpColorBox(0.5, "#000000")
cb.SetWidth(200)
cb.SetHeight(200)
g.Add(cb)
API.AddGump(g)
```
"""
pass
def CreateGumpItemPic(self, graphic: "int", width: "int", height: "int") -> "ApiUiResizableStaticPic":
"""
Create a picture of an item.
Example:
```py
g = API.CreateGump()
g.SetRect(100, 100, 200, 200)
g.Add(API.CreateGumpItemPic(0x0E78, 50, 50))
API.AddGump(g)
```
"""
pass
def CreateGumpButton(self, text: "str" = "", hue: "int" = 996, normal: "int" = 0x00EF, pressed: "int" = 0x00F0, hover: "int" = 0x00EE) -> "ApiUiButton":
"""
Create a button for gumps.
Example:
```py
g = API.CreateGump()
g.SetRect(100, 100, 200, 200)
button = API.CreateGumpButton("Click Me!")
g.Add(button)
API.AddGump(g)
while True:
API.SysMsg("Button currently clicked?: " + str(button.IsClicked))
API.SysMsg("Button clicked since last check?: " + str(button.HasBeenClicked()))
API.Pause(0.2)
```
"""
pass
def CreateSimpleButton(self, text: "str", width: "int", height: "int") -> "ApiUiNiceButton":
"""
Create a simple button, does not use graphics.
Example:
```py
g = API.CreateGump()
g.SetRect(100, 100, 200, 200)
button = API.CreateSimpleButton("Click Me!", 100, 20)
g.Add(button)
API.AddGump(g)
```
"""
pass
def CreateGumpRadioButton(self, text: "str" = "", group: "int" = 0, inactive: "int" = 0x00D0, active: "int" = 0x00D1, hue: "int" = 0xFFFF, isChecked: "bool" = False) -> "ApiUiRadioButton":
"""
Create a radio button for gumps, use group numbers to only allow one item to be checked at a time.
Example:
```py
g = API.CreateGump()
g.SetRect(100, 100, 200, 200)
rb = API.CreateGumpRadioButton("Click Me!", 1)
g.Add(rb)
API.AddGump(g)
API.SysMsg("Radio button checked?: " + str(rb.IsChecked))
```
"""
pass
def CreateGumpTextBox(self, text: "str" = "", width: "int" = 200, height: "int" = 30, multiline: "bool" = False) -> "ApiUiTtfTextInputField":
"""
Create a text area control.
Example:
```py
w = 500
h = 600
gump = API.CreateGump(True, True)
gump.SetWidth(w)
gump.SetHeight(h)
gump.CenterXInViewPort()
gump.CenterYInViewPort()
bg = API.CreateGumpColorBox(0.7, "#D4202020")
bg.SetWidth(w)
bg.SetHeight(h)
gump.Add(bg)
textbox = API.CreateGumpTextBox("Text example", w, h, True)
gump.Add(textbox)
API.AddGump(gump)
```
"""
pass
def CreateGumpTTFLabel(self, text: "str", size: "float", color: "str" = "#FFFFFF", font: "str" = TrueTypeLoader.EMBEDDED_FONT, aligned: "str" = "let", maxWidth: "int" = 0, applyStroke: "bool" = False) -> "ApiUiTextBox":
"""
Create a TTF label with advanced options.
Example:
```py
gump = API.CreateGump()
gump.SetRect(100, 100, 200, 200)
ttflabel = API.CreateGumpTTFLabel("Example label", 25, "#F100DD", "alagard")
ttflabel.SetRect(10, 10, 180, 30)
gump.Add(ttflabel)
API.AddGump(gump) #Add the gump to the players screen
```
"""
pass
def CreateGumpSimpleProgressBar(self, width: "int", height: "int", backgroundColor: "str" = "#616161", foregroundColor: "str" = "#212121", value: "int" = 100, max: "int" = 100) -> "ApiUiSimpleProgressBar":
"""
Create a progress bar. Can be updated as needed with `bar.SetProgress(current, max)`.
Example:
```py
gump = API.CreateGump()
gump.SetRect(100, 100, 400, 200)
pb = API.CreateGumpSimpleProgressBar(400, 200)
gump.Add(pb)
API.AddGump(gump)
cur = 0
max = 100
while True:
pb.SetProgress(cur, max)
if cur >= max:
break
cur += 1
API.Pause(0.5)
```
"""
pass
def CreateGumpScrollArea(self, x: "int", y: "int", width: "int", height: "int") -> "ApiUiScrollArea":
"""
Create a scrolling area, add and position controls to it directly.
Example:
```py
sa = API.CreateGumpScrollArea(0, 60, 200, 140)
gump.Add(sa)
for i in range(10):
label = API.CreateGumpTTFLabel(f"Label {i + 1}", 20, "#FFFFFF", "alagard")
label.SetRect(5, i * 20, 180, 20)
sa.Add(label)
```
"""
pass
def CreateGumpPic(self, graphic: "int", x: "int" = 0, y: "int" = 0, hue: "int" = 0) -> "ApiUiGumpPic":
"""
Create a gump pic(Use this for gump art, not item art)
Example:
```py
gumpPic = API.CreateGumpPic(0xafb)
gump.Add(gumpPic)
"""
pass
def CreateTiledGumpPic(self, graphic: "int", width: "int", height: "int", hue: "int" = 0) -> "ApiUiTiledGumpPic":
"""
Create a gump pic that tiles(repeats) (Use this for gump art, not item art)
Example:
```py
gumpPic = API.CreateTiledGumpPic(0xafb, 100, 100)
gump.Add(gumpPic)
"""
pass
def CreateDropDown(self, width: "int", items: "list[str]", selectedIndex: "int" = 0) -> "ApiUiControlDropDown":
"""
Creates a dropdown control (combobox) with the specified width and items.
"""
pass
def AddControlOnClick(self, control: "Any", onClick: "Any", leftOnly: "bool" = True) -> "Any":
"""
Add an onClick callback to a control.
Example:
```py
def myfunc:
API.SysMsg("Something clicked!")
bg = API.CreateGumpColorBox(0.7, "#D4202020")
API.AddControlOnClick(bg, myfunc)
while True:
API.ProcessCallbacks()
```
"""
pass
def AddControlOnDisposed(self, control: "ApiUiBaseControl", onDispose: "Any") -> "ApiUiBaseControl":
"""
Add onDispose(Closed) callback to a control.
Example:
```py
def onClose():
API.Stop()
gump = API.CreateGump()
gump.SetRect(100, 100, 200, 200)
bg = API.CreateGumpColorBox(opacity=0.7, color="#000000")
gump.Add(bg.SetRect(0, 0, 200, 200))
API.AddControlOnDisposed(gump, onClose)
```
"""
pass
class ApiUiGumpPic(ApiUiBaseControl):
""
Graphic: int = None
Hue: int = None
IsPartialHue: bool = None
ContainsByBounds: bool = None
class ApiUiLabel(ApiUiBaseControl):
""
Text: str = None
Hue: int = None
class ApiUiMenuItem:
""
Index: int = None
Name: str = None
Graphic: int = None
Hue: int = None
__class__: str = None
def ToString(self) -> "str":
"""
Returns a readable string representation of the menu item.
Used when printing or converting the object to a string in Python scripts.
"""
pass
def __repr__(self) -> "str":
"""
Returns a detailed string representation of the object.
This string is used by Python’s built-in <c>repr()</c> function.
"""
pass
class ApiUiNiceButton(ApiUiBaseControl):
""
ButtonParameter: int = None
IsSelectable: bool = None
IsSelected: bool = None
DisplayBorder: bool = None
AlwaysShowBackground: bool = None
Text: str = None
TextHue: int = None
BackgroundHue: int = None
def SetText(self, text: "str") -> None:
pass
def SetBackgroundHue(self, hue: "int") -> None:
pass
def SetBackgroundColor(self, r: "int | None", g: "int | None", b: "int | None", a: "int | None" = 255) -> None:
"""
Sets the background color of the button. Pass null to clear.
"""
pass
def ClearBackgroundColor(self) -> None:
"""
Clears the background color of the button.
"""
pass
class ApiUiNineSliceGump(ApiUiBaseControl, IApiGump):
""
NineSliceGump = None
Gump: ApiUiBaseGump = None
def GetHue(self) -> "int":
"""
Gets the current hue of the nine-slice gump
"""
pass
def SetHue(self, hue: "int") -> None:
"""
Sets the hue of the nine-slice gump
"""
pass
def GetResizable(self) -> "bool":
"""
Gets whether the gump is resizable
"""
pass
def SetResizable(self, resizable: "bool") -> None:
"""
Sets whether the gump is resizable
"""
pass
def GetBorderSize(self) -> "int":
"""
Gets the border size of the nine-slice
"""
pass
def SetBorderSize(self, borderSize: "int") -> None:
"""
Sets the border size of the nine-slice
"""
pass
class ModernNineSliceGump(NineSliceGump):
""
def SetResizeCallback(self, callback: "Any") -> None:
"""
Registers a callback to be called when the gump is resized.
<remarks>
Note that only one callback may be registered at a time. Subsequent calls will replace the previous callback.
</remarks>
"""
pass
def Dispose(self) -> None:
"""
Disposes the gump and releases its internal resources
"""
pass
class ApiUiRadioButton(ApiUiCheckbox):
""
GroupIndex: int = None
def GetGroupIndex(self) -> "int":
"""
Gets the group index of the radio button.
Radio buttons with the same group index are mutually exclusive.
Used in python API
"""
pass