Mikuri Administrateur
Nombre de messages : 142 Age : 33 Date d'inscription : 24/09/2006
Projet Projet: Mysis Pourcentage: (0/100)
| Sujet: Afficher des virgules pour l'argent. [F] Lun 25 Sep - 16:57 | |
| Afficher des virgules pour l'argent. Auteur : Dubealex Voici un script bien sympathique qui permet d'avoir des virgule dans l'argent. Dans le scrîpt Window_Gold, supprimer tout le code situé en dessous de def refresh et collez le code suivant : Version avec des vigules : - Code:
-
#Advanced Gold Display mini-scrîpt by Dubealex.
self.contents.clear case $game_party.gold when 0..9999 gold = $game_party.gold when 10000..99999 gold = $game_party.gold.to_s array = gold.split(//) gold = array[0].to_s+array[1].to_s+","+array[2].to_s+array[3].to_s+array[4].to_s when 100000..999999 gold = $game_party.gold.to_s array = gold.split(//) gold = array[0].to_s+array[1].to_s+array[2].to_s+","+array[3].to_s+array[4].to_s+array[5].to_s when 1000000..9999999 gold = $game_party.gold.to_s array = gold.split(//) gold = array[0].to_s+","+array[1].to_s+array[2].to_s+array[3].to_s+","+array[4].to_s+array[5].to_s+array[6].to_s end self.contents.font.color = text_color(6) gold_word = $data_system.words.gold.to_s + ":" cx = contents.text_size(gold_word).width cx2=contents.text_size(gold.to_s).width self.contents.draw_text(4, 0, 120-cx-2, 32, gold_word) self.contents.font.color = text_color(0) self.contents.draw_text(124-cx2+2, 0, cx2, 32, gold.to_s, 2) end end Version avec des espaces : - Code:
-
self.contents.clear case $game_party.gold when 0..9999 gold = $game_party.gold when 10000..99999 gold = $game_party.gold.to_s array = gold.split(//) gold = array[0].to_s+array[1].to_s+" "+array[2].to_s+array[3].to_s+array[4].to_s when 100000..999999 gold = $game_party.gold.to_s array = gold.split(//) gold = array[0].to_s+array[1].to_s+array[2].to_s+" "+array[3].to_s+array[4].to_s+array[5].to_s when 1000000..9999999 gold = $game_party.gold.to_s array = gold.split(//) gold = array[0].to_s+" "+array[1].to_s+array[2].to_s+array[3].to_s+" "+array[4].to_s+array[5].to_s+array[6].to_s end self.contents.font.color = text_color(6) gold_word = $data_system.words.gold.to_s + ":" cx = contents.text_size(gold_word).width cx2=contents.text_size(gold.to_s).width self.contents.draw_text(4, 0, 120-cx-2, 32, gold_word) self.contents.font.color = text_color(0) self.contents.draw_text(124-cx2+2, 0, cx2, 32, gold.to_s, 2) end end Version avec des points : - Code:
-
self.contents.clear case $game_party.gold when 0..9999 gold = $game_party.gold when 10000..99999 gold = $game_party.gold.to_s array = gold.split(//) gold = array[0].to_s+array[1].to_s+"."+array[2].to_s+array[3].to_s+array[4].to_s when 100000..999999 gold = $game_party.gold.to_s array = gold.split(//) gold = array[0].to_s+array[1].to_s+array[2].to_s+"."+array[3].to_s+array[4].to_s+array[5].to_s when 1000000..9999999 gold = $game_party.gold.to_s array = gold.split(//) gold = array[0].to_s+"."+array[1].to_s+array[2].to_s+array[3].to_s+"."+array[4].to_s+array[5].to_s+array[6].to_s end self.contents.font.color = text_color(6) gold_word = $data_system.words.gold.to_s + ":" cx = contents.text_size(gold_word).width cx2=contents.text_size(gold.to_s).width self.contents.draw_text(4, 0, 120-cx-2, 32, gold_word) self.contents.font.color = text_color(0) self.contents.draw_text(124-cx2+2, 0, cx2, 32, gold.to_s, 2) end end P.S. les versions avec un espace et un point ont été modifiées par Faust. | |
|