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

Method drawCfgLanguage

code/main/Cfg.ts:87–127  ·  view source on GitHub ↗
(x: number, y: number)

Source from the content-addressed store, hash-verified

85 }
86
87 private drawCfgLanguage(x: number, y: number): void{
88 // Text
89 this.renderArea.drawString(Database.getText("cfgChooseLanguage"), x, y);
90 this.renderArea.drawString(Database.getTranslatedText("cfgChooseLanguage"), x, y + 1, true);
91
92 // List
93 this.renderArea.addList(x + Algo.takeBiggest(Database.getText("cfgChooseLanguage").length, Database.getTranslatedText("cfgChooseLanguage").length) + 2, x + Algo.takeBiggest(Database.getText("cfgChooseLanguage").length, Database.getTranslatedText("cfgChooseLanguage").length) + 20, y, "cfgLanguageList", new CallbackCollection(this.languageSelected.bind(this)),
94 [
95 "cfgLanguageEn", "English",
96 "cfgLanguageBr", "Brazilian Portuguese (by TranslaCAT)",
97 "cfgLanguageZh", "Chinese (by Fan Zhang)",
98 "cfgLanguageCz", "Czech (by Keranis)",
99 "cfgLanguageNl", "Dutch (by Noël Wierema and Vincent van Gennep, corrections by Wessel van den Putte)",
100 "cfgLanguageFr", "French (by aniwey)",
101 "cfgLanguageDe", "German (by Kai Kubasta)",
102 "cfgLanguageEl", "Greek (by VagosLabrou)",
103 "cfgLanguageHu", "Hungarian (by The_Reaper_CooL)",
104 "cfgLanguageId", "Indonesian (by Richard Sudaryono)",
105 "cfgLanguageKr", "Korean (by jiyeonnn03)",
106 "cfgLanguagePl", "Polish (by Patryk Połomski)",
107 "cfgLanguageRu", "Russian (by Julia Richter (Zen Chelios Jr.))",
108 "cfgLanguageEs", "Spanish (by Saúl Ruiz Calleja and Tania López Camino)",
109 "cfgLanguageSe", "Swedish (by Jessica Tsiamis)",
110 "cfgLanguageTr", "Turkish (by B. Güler)",
111 "cfgLanguageUk", "Ukrainian (by Volodymyr Lataniuk)"
112 ]
113 );
114
115 // Add the link which will call the selectRightLanguage method after the html dom is created
116 this.renderArea.addLinkCallbackCollection(new CallbackCollection(this.selectRightLanguage.bind(this)));
117
118 // Add the special message for the chinese translation
119 if(Saving.loadString("gameLanguage") == "zh"){
120 this.renderArea.drawString("中文版翻译会导致少量图像显示错误,我会尽量修复它们的!", x + 9, y + 2, true);
121 }
122 // Add the TranslaCAT ascii art
123 else if(Saving.loadString("gameLanguage") == "br"){
124 this.renderArea.drawArray(Database.getAscii("general/translaCAT"), x + 70, y - 1);
125 this.renderArea.addHtmlLink(x + 76, y + 7, "http://www.translacat.com/", "TranslaCAT");
126 }
127 }
128
129 private drawConfigurationText(x: number, y: number): void{
130 this.renderArea.drawArray(Database.getAscii("text/Configuration"), x + 17, y);

Callers 1

updateMethod · 0.95

Calls 8

drawStringMethod · 0.80
addListMethod · 0.80
bindMethod · 0.80
drawArrayMethod · 0.80
getAsciiMethod · 0.80
addHtmlLinkMethod · 0.80
getTextMethod · 0.45

Tested by

no test coverage detected