Caio Juan Administradores!
Sexo : Mensagens : 38
| Assunto: [HUD] OLD Cayoda HUD para NetPlay 1.7 Plus Qui Dez 09, 2010 10:13 am | |
| IntroduçãoVendo em algumas pastas antigas reencontrei este código que eu tinha, Que envolvia Misturar a HUD Evixian com a HUD do Icedmetal e com add-ons e surgiu esta HUD, ela é bem simples de um tempo bem antigo quando eu era bem noob mesmo. Screenshots- Spoiler:
https://2img.net/r/ihimizer/img299/3428/newhud2hf3.png
Funções-Ekips no Mapa por Moghunter -Barras de Gradient Melhorada e mais bonita na demostração de HP/SP/EXP -Antigas Funções dos botões da Evixian HUD(Save Desabilitado por maioria dos users usarem autosave nos games online) -Janela do Chat, veja o que os outros estão falando sem apertar F5 script:HUD - Código:
-
#============================================================== # * Cayoda Netplay Head Up Display # For NP 1.7 # ESTE script NÃO DEVE SER POSTADO EM OUTRAS COMUNIDADES SEM # MINNHA PERMISSÃO SENDO DISPONÍVEL ENCONTRA-LA NOS SITES: # www.mundorpgmaker.com # www.reinorpg.com #==============================================================
#============================================================================== # ** Window_Base #------------------------------------------------------------------------------ # This class is for all in-game windows. #==============================================================================
class Window_Base < Window #===================================== #Gradient Bars with customizable lengths, thicknesses, types and Colors #By AcedentProne #Adtional Method to cayoda HUD #===================================== def draw_normal_barz(x, y, type, length, thick, e1, e2, c1 = Color.new(153,238,153,255), c2 = Color.new(0,0,0,255)) if type == "horizontal" width = length height = thick self.contents.fill_rect(x-1, y - 1, width+2, height + 3, Color.new(255, 255, 255, 255)) self.contents.fill_rect(x, y, width, height + 1, Color.new(0, 0, 0, 255)) w = width * e1 / e2 for i in 0..height r = c1.red + (c2.red - c1.red) * (height -i)/height + 0 * i/height g = c1.green + (c2.green - c1.green) * (height -i)/height + 0 * i/height b = c1.blue + (c2.blue - c1.blue) * (height -i)/height + 0 * i/height a = c1.alpha + (c2.alpha - c1.alpha)* (height -i)/height + 255 * i/height self.contents.fill_rect(x, y+i, w, 1, Color.new(r, g, b, a)) end elsif type == "vertical" width = thick height = length self.contents.fill_rect(x-1, y - 1, width+3, height + 2, Color.new(255, 255, 255, 255)) self.contents.fill_rect(x, y, width+1, height , Color.new(0, 0, 0, 255)) h = height * e1 / e2 for i in 0..width r = c1.red + (c2.red - c1.red) * (width -i)/width + 0 * i/width g = c1.green + (c2.green - c1.green) * (width -i)/width + 0 * i/width b = c1.blue + (c2.blue - c1.blue) * (width -i)/width + 0 * i/width a = c1.alpha + (c2.alpha - c1.alpha)* (width -i)/width + 255 * i/width self.contents.fill_rect(x+i, y, 1, h, Color.new(r, g, b, a)) end end end def draw_actor_barz(actor,x, y, type, length, thick, e1, e2, c1 = Color.new(255,0,0,255), c2 = Color.new(0,0,0,255)) if type == "horizontal" width = length height = thick self.contents.fill_rect(x-1, y - 1, width+2, height + 3, Color.new(255, 255, 255, 255)) self.contents.fill_rect(x, y, width, height + 1, Color.new(0, 0, 0, 255)) w = width * e1 / e2 for i in 0..height r = c1.red + (c2.red - c1.red) * (height -i)/height + 0 * i/height g = c1.green + (c2.green - c1.green) * (height -i)/height + 0 * i/height b = c1.blue + (c2.blue - c1.blue) * (height -i)/height + 0 * i/height a = c1.alpha + (c2.alpha - c1.alpha)* (height -i)/height + 255 * i/height self.contents.fill_rect(x, y+i, w, 1, Color.new(r, g, b, a)) end elsif type == "vertical" width = thick height = length self.contents.fill_rect(x-1, y - 1, width+3, height + 2, Color.new(255, 255, 255, 255)) self.contents.fill_rect(x, y, width+1, height , Color.new(0, 0, 0, 255)) h = height * e1 / e2 for i in 0..width r = c1.red + (c2.red - c1.red) * (width -i)/width + 0 * i/width g = c1.green + (c2.green - c1.green) * (width -i)/width + 0 * i/width b = c1.blue + (c2.blue - c1.blue) * (width -i)/width + 0 * i/width a = c1.alpha + (c2.alpha - c1.alpha)* (width -i)/width + 255 * i/width self.contents.fill_rect(x+i, y, 1, h, Color.new(r, g, b, a)) end end end #-------------------------------------------------------------------------- # * Draw EXP # actor : actor # x : draw spot x-coordinate # y : draw spot y-coordinate #-------------------------------------------------------------------------- def draw_actor_exp(actor, x, y) self.contents.font.color = system_color self.contents.draw_text(x, y, 24, 32, "Exp") self.contents.font.color = normal_color self.contents.draw_text(x + 10, y, 84, 32, actor.exp_s, 2) self.contents.draw_text(x + 100, y, 12, 32, "/", 1) self.contents.draw_text(x + 112, y, 84, 32, actor.next_exp_s) end end #=============================================================== # * Cayoda HUD # Agradecimentos a AcedentProne pelos Método(draw_normal_barz) #=============================================================== class Window_initial < Window_Base def initialize super(0, 0, 240, 165) $game_actors[1].name = Network::Main.name self.contents = Bitmap.new(width - 32, height - 32) self.opacity = 0 refresh end def refresh self.contents.clear self.contents.font.color = normal_color self.contents.font.size = 16 self.contents.draw_text(36, 0, 640, 32, $game_actors[1].name.to_s) self.contents.font.color = normal_color chatc = RPG::Cache.icon("033-Item02") chat_rect = Rect.new(0, 0, chatc.width, chatc.height) self.contents.blt(120, 78, chatc, chat_rect) if $game_temp.chat_refresh draw_normal_barz(36, 27, "horizontal", 150, 10, $game_actors[1].hp.to_i, $game_actors[1].maxhp.to_i, Color.new (225, 0, 0, 225)) draw_normal_barz(36, 42, "horizontal", 150, 10, $game_actors[1].sp.to_i, $game_actors[1].maxsp.to_i, Color.new (0,0,255,255)) draw_normal_barz(36, 57, "horizontal", 150, 10, $game_actors[1].exp_s.to_i, $game_actors[1].next_exp_s.to_i, Color.new (0, 255, 0, 225)) draw_actor_graphic($game_actors[1], 15, 63) draw_actor_level($game_actors[1], 128, 0) draw_actor_hp($game_actors[1], 42, 17) draw_actor_sp($game_actors[1], 42, 32) draw_actor_exp($game_actors[1], 42, 47) end end #=================================================================== # * Chat_Window Feito pela Equipe do Netplay #=================================================================== class Window_Chat < Window_Base
#-------------------------------------------------------------------------- # * Initializes chat window. #-------------------------------------------------------------------------- def initialize super(0, 380, 448, 100) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.size = 16 self.opacity = 160 refresh end #-------------------------------------------------------------------------- # * Refreshes chat window. #-------------------------------------------------------------------------- def refresh $game_temp.chat_refresh = true self.contents.clear c = User_Edit::CHAT_SYSTEM n = (c == 'Chat[1]' ? 25 : c == 'Chat[2]' ? 4 : 0) $game_temp.chat_log.delete_at(0) if $game_temp.chat_log.size > n for i in 0..$game_temp.chat_log.size - 1 self.contents.draw_text(0, i * 16 - 8, 640, 32, $game_temp.chat_log[i]) end end #-------------------------------------------------------------------------- # * Updates chat window. #-------------------------------------------------------------------------- def update # Only refresh when the Chat Changes refresh if $game_temp.chat_refresh super end end
#=============================================================================== class Window_three < Window_Base def initialize super(448, 430, 64, 50) self.contents = Bitmap.new(width-32, height-32) self.contents.font.size = 12 self.opacity = 127 self.contents.font.name = "Tahoma" refresh end #=============================================================================== def refresh self.contents.clear self.contents.draw_text(0, -7, 200, 32, "Itens") if mouse_over?(self) and Input.pressed?(Input::Mouse_Left) == true $scene = Scene_Item.new end end #============================================================================= def update refresh end #=============================================================================== def mouse_over?(window) if $mouse.x > window.x and $mouse.x < window.x + window.width and $mouse.y > window.y and $mouse.y < window.y + window.height return true end return false end end #=============================================================================== class Window_four < Window_Base def initialize super(448, 380, 64, 50) self.contents = Bitmap.new(width-32, height-32) self.contents.font.size = 12 self.opacity = 127 self.contents.font.name = "Tahoma" refresh end #=============================================================================== def refresh self.contents.clear self.contents.draw_text(0, -7, 200, 32, "Habil") if mouse_over?(self) and Input.pressed?(Input::Mouse_Left) == true $scene = Scene_Skill.new end end #=============================================================================== def update refresh end #=============================================================================== def mouse_over?(window) if $mouse.x > window.x and $mouse.x < window.x + window.width and $mouse.y > window.y and $mouse.y < window.y + window.height return true end return false end end #=============================================================================== class Window_five < Window_Base def initialize super(512, 430, 64, 50) self.contents = Bitmap.new(width-32, height-32) self.contents.font.size = 12 self.opacity = 127 self.contents.font.name = "Tahoma" refresh end #=============================================================================== def refresh self.contents.clear self.contents.draw_text(0, -7, 200, 32, "Equip") if mouse_over?(self) and Input.pressed?(Input::Mouse_Left) == true $scene = Scene_Equip.new end end #=============================================================================== def update refresh end #=============================================================================== def mouse_over?(window) if $mouse.x > window.x and $mouse.x < window.x + window.width and $mouse.y > window.y and $mouse.y < window.y + window.height return true end return false end end #=============================================================================== class Window_six < Window_Base def initialize super(512, 380, 64, 50) self.contents = Bitmap.new(width-32, height-32) self.contents.font.size = 12 self.opacity = 127 self.contents.font.name = "Tahoma" refresh end #=============================================================================== def refresh self.contents.clear self.contents.draw_text(0, -7, 200, 32, "Status") if mouse_over?(self) and Input.pressed?(Input::Mouse_Left) == true $scene = Scene_Status.new end end #=============================================================================== def update refresh end def mouse_over?(window) if $mouse.x > window.x and $mouse.x < window.x + window.width and $mouse.y > window.y and $mouse.y < window.y + window.height return true end return false end end #=============================================================================== class Window_seven < Window_Base def initialize super(576, 380, 64, 50) self.contents = Bitmap.new(width-32, height-32) self.contents.font.size = 12 self.opacity = 127 self.contents.font.name = "Tahoma" refresh end #=============================================================================== def refresh self.contents.clear self.contents.draw_text(0, -7, 200, 32, "Sair") if mouse_over?(self) and Input.pressed?(Input::Mouse_Left) == true $scene = Scene_End.new end end #=============================================================================== def update refresh end def mouse_over?(window) if $mouse.x > window.x and $mouse.x < window.x + window.width and $mouse.y > window.y and $mouse.y < window.y + window.height return true end return false end end #=============================================================================== class Window_eight < Window_Base def initialize super(576, 430, 64, 50) self.contents = Bitmap.new(width-32, height-32) self.contents.font.size = 12 self.opacity = 127 self.contents.font.name = "Tahoma" refresh end #=============================================================================== def refresh self.contents.clear self.contents.draw_text(0, -7, 200, 32, "Salvar") if mouse_over?(self) and Input.pressed?(Input::Mouse_Left) == true p "Opção Desativada" end end #=============================================================================== def update refresh end #=============================================================================== def mouse_over?(window) if $mouse.x > window.x and $mouse.x < window.x + window.width and $mouse.y > window.y and $mouse.y < window.y + window.height return true end return false end end #=============================================================================== class Scene_Map alias cayoda_main main alias cayoda_update update def init_hud @Window = Window_initial.new @Window2 = Window_Chat.new # @Window2 = Window_two.new @Window3 = Window_three.new @Window4 = Window_four.new @Window5 = Window_five.new @Window6 = Window_six.new @Window7 = Window_seven.new @Window8 = Window_eight.new end #=============================================================================== def main init_hud cayoda_main end #=============================================================================== def dispose @Window_initial.dispose @Window2.dispose @Window2_Input.dispose @Window_three.dispose @Window_five.dispose @Window_six.dispose @Window_seven.dispose @Window_eight.dispose end #=============================================================================== def update @Window.update if @Hp != $game_party.actors[0].hp or @Sp != $game_party.actors[0].sp or @Exp != $game_party.actors[0].next_rest_exp_s or @gold != $game_party.gold or @level != $game_party.actors[0].level or @Name != $game_party.actors[0].name @Window2.update @Window3.update @Window4.update @Window5.update @Window6.update @Window7.update @Window8.update cayoda_update end end Add-on - Código:
-
#=============================================================================== # MOG Equpmap #=============================================================================== module MOG #Switch que desativa a janela de equipamentos. EQPMAPVIS = 10 #Opacidade da janela. EQPMAPOPA = 0 #Windows Skin da janela. EQPMAPSKIN = "Windowskin_pergaminho22" #Posição da janela na Horizontal. EQPMAPX = 320 #Posição da janela na Vertical. EQPMAPY = 70 end ############### # Window_Base # ############### class Window_Base < Window def draw_equip_map(item, x, y) if item == nil return end bitmap = RPG::Cache.icon(item.icon_name) self.contents.blt(x + 3, y + 12, bitmap, Rect.new(0, 0, 24, 24)) end end #################### # Window_Equip_Map # #################### class Window_Equipmap < Window_Base def initialize(actor) super(0, 0, 165, 70) self.contents = Bitmap.new(width - 32, height - 32) self.opacity = 180 self.windowskin = RPG::Cache.windowskin("001-Blue01") @actor = actor refresh end def refresh self.contents.clear self.contents.font.size = 12 self.contents.font.color = Color.new(0,0,0) self.contents.draw_text(0,-7,100,20,"Equipamentos")
@data = [] @actor = $game_party.actors[0] @data.push($data_weapons[@actor.weapon_id]) @data.push($data_armors[@actor.armor1_id]) @data.push($data_armors[@actor.armor2_id]) @data.push($data_armors[@actor.armor3_id]) @data.push($data_armors[@actor.armor4_id]) self.contents.font.color = Color.new(0,0,0) draw_equip_map(@data[0], 32 * 0, 0) draw_equip_map(@data[1], 32 * 1, 0) draw_equip_map(@data[2], 32 * 2, 0) draw_equip_map(@data[3], 32 * 3, 0) draw_equip_map(@data[4], 32 * 4, 0) end end
############# # Scene_Map # ############# class Scene_Map alias mog8_main main def main @actor = $game_party.actors[0] @eqmap = Window_Equipmap.new(@actor) @eqmap.x = MOG::EQPMAPX+150 @eqmap.y = MOG::EQPMAPY-36 @eqmap.z = 1000 if $game_switches[MOG::EQPMAPVIS] == false @eqmap.visible = true else @eqmap.visible = false end mog8_main end alias mog8_update update def update if $scene != self @eqmap.dispose end $game_map.update $game_player.update Graphics.update if $game_switches[MOG::EQPMAPVIS] == false @eqmap.visible = true else @eqmap.visible = false end if $eref == true @eqmap.refresh $eref = false end mog8_update end end
############ # Game_Map # ############ class Game_Map attr_accessor :eref end class Interpreter def eref $eref = true end alias mog319ref command_319 def command_319 eref return mog319ref end end Créditos-Cayoda Reeprogramação da HUD -MogHunter pelo Add-on dos equips no Mapa -AcedentProne Pelos Metodos Adcionais na Window_Base -Mordoke pro trazelo aqui.
Última edição por Mordoke em Seg Jan 03, 2011 5:17 pm, editado 1 vez(es) | |
|