MCPcopy Create free account
hub / github.com/candybox2/candybox2.github.io / draw

Method draw

code/main/QuestPlayerSpell.ts:58–75  ·  view source on GitHub ↗
(renderArea: RenderArea, position: Pos)

Source from the content-addressed store, hash-verified

56
57 // Public methods
58 public draw(renderArea: RenderArea, position: Pos): void{
59 // Set the text
60 var text: string = this.buttonText;
61
62 // Possibly modify the text depending on numberIdWichLimitsQuantity
63 if(this.numberIdWichLimitsQuantity != null){
64 if(Saving.loadNumber(this.numberIdWichLimitsQuantity) <= 999)
65 text += " " + Saving.loadNumber(this.numberIdWichLimitsQuantity);
66 else
67 text += " 999+";
68 }
69
70 // Add the button
71 renderArea.addAsciiRealButton(text, position.x + this.buttonPosition.x, position.y + this.buttonPosition.y, this.buttonClassName + " keepBlackTextWhenInverted", "", false, this.underlinedLetter, this.buttonColor);
72
73 // Add the link
74 renderArea.addLinkCall("." + this.buttonClassName, new CallbackCollection(this.cast.bind(this)));
75 }
76
77 public getHotkey(): Hotkey{
78 return new Hotkey(this.hotkeyLetter, new CallbackCollection(this.cast.bind(this)));

Callers

nothing calls this directly

Calls 3

addAsciiRealButtonMethod · 0.80
addLinkCallMethod · 0.80
bindMethod · 0.80

Tested by

no test coverage detected