Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================|
- # ** You only need to edit this part as it's about what this snippet does |
- #------------------------------------------------------------------------------|
- module Graphic_Face
- # Character graphic of actor with id actor_id_x will be set as that of actor
- # with id being equal to the value of variable with id variable_id_x
- # Setting variable_id_x as 0 will permanently disable this feature for actor
- # with id actor_id_x
- # Setting the value of the variable with id variable_id_x as 0 will
- # temporarily disable this feature for actor with id actor_id_x
- GRAPHIC_ID = {
- actor_id_1 => variable_id_1
- actor_id_2 => variable_id_2
- actor_id_3 => variable_id_3
- actor_id_n => variable_id_n
- }
- # Face graphic of actor with id actor_id_x will be set as that of actor
- # with id being equal to the value of variable with id variable_id_x
- # Setting variable_id_x as 0 will permanently disable this feature for actor
- # with id actor_id_x
- # Setting the value of the variable with id variable_id_x as 0 will
- # temporarily disable this feature for actor with id actor_id_x
- FACE_ID = {
- actor_id_1 => variable_id_1
- actor_id_2 => variable_id_2
- actor_id_3 => variable_id_3
- actor_id_n => variable_id_n
- }
- end # Graphic_Face
- #==============================================================================|
- #==============================================================================|
- # ** You need not edit this part as it's about how this snippet works |
- #------------------------------------------------------------------------------|
- class Window_Base < Window
- alias draw_actor_graphic_actor_graphic draw_actor_graphic
- alias draw_actor_face_actor_graphic draw_actor_face
- #----------------------------------------------------------------------------|
- # Alias method: draw_actor_graphic |
- #----------------------------------------------------------------------------|
- def draw_actor_graphic(actor, x, y)
- # This part is rewritten by this snippet to draw the character graphic of the actor id found in id_hash if any
- draw_actor_face_graphic(actor, x, y, "graphic")
- #
- end # draw_actor_graphic
- #----------------------------------------------------------------------------|
- # Alias method: draw_actor_face |
- #----------------------------------------------------------------------------|
- def draw_actor_face(actor, x, y, enabled = true)
- # This part is rewritten by this snippet to draw the face graphic of the actor id found in id_hash if any
- draw_actor_face_graphic(actor, x, y, enabled, "face")
- #
- end # draw_actor_face
- #----------------------------------------------------------------------------|
- # New method: draw_actor_face_graphic |
- #----------------------------------------------------------------------------|
- def draw_actor_face_graphic(actor, x, y, enabled = true, method)
- id_hash = eval("Graphic_Face::" + method.upcase + "_ID")
- actor = $data_actors[$game_variables[id_hash[actor.id]]] if id_hash[actor.id] && id_hash[actor.id] > 0 && $game_variables[id_hash[actor.id]] > 0
- eval("draw_actor_" + method + "_actor_graphic(actor, x, y" + (method == "face" ? ", enabled)" : ")"))
- end # draw_actor_face_graphic
- end # Window_Base
- #==============================================================================|
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement