Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ################################################################################
- ##### ** ItemsColor
- # Par Biward le 24/04/2014 ~ 00:21
- # Fonctionne sur : VXAce et VX
- #
- # Permet de choisir une couleur d'affichage pour chaque objet dans le menu
- # équipement de base.
- #
- # Comment fonctionne-t-il ?
- # Il vous suffit de mettre <ItemColor = R, G, B> dans la note de l'objet en
- # question.
- # R est le taux de rouge (0~255)
- # G est le taux de vert (0~255)
- # B est le taux de bleu (0~255)
- #
- ################################################################################
- ##### ** Début du script
- ########################
- class Window_Base
- #########################################
- ##### ** Change Color
- # Alias + ajout de conditions
- # Permet de modifier la couleur de l'item
- #########################################
- alias dicolorbi change_color if RUBY_VERSION == "1.9.2"
- def change_color(color, enabled = true, item = nil)
- if RUBY_VERSION == "1.9.2"
- dicolorbi(color, enabled)
- elsif RUBY_VERSION == "1.8.1"
- contents.font.color = normal_color
- end
- if item
- # On vérifie si l'objet a une couleur spéciale
- item.note =~ /<ItemColor = (.*)>/
- if $1
- e = $1.split(",")
- c = Color.new(e[0].to_i, e[1].to_i, e[2].to_i, 255)
- end
- # On vérifie si l'objet a une couleur de palette
- item.note =~ /<ItemPalet = (.*)>/
- c = text_color($1.to_i) if $1
- if c
- contents.font.color.set(c) if RUBY_VERSION == "1.9.2"
- contents.font.color = c if RUBY_VERSION == "1.8.1"
- contents.font.color.alpha = translucent_alpha unless enabled
- end
- end
- end
- #########################################
- ##### ** Line Height | Draw Text
- # Ajout de deux nouvelles méthodes de VXAce à VX
- #########################################
- if RUBY_VERSION == "1.8.1"
- def line_height ; WLH ; end
- def draw_text(*args) ; contents.draw_text(*args) ; end
- end
- end
- #######################
- ##### ** Fin du script
- ################################################################################
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement