Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================
- #
- # HSTC - Total Window Maker V 1.0
- #
- # This is a script which lets the user make a custom window. The user
- # can choose to use the window as an HUD or as an option in the Menu.
- #
- #
- # How to use:
- #
- # 1) Set-up the config
- # 2) Switch the Switch_ID In-Game ON
- # 3) Finished
- #
- # Credit:
- #
- # HungrySnake
- #
- #==============================================================
- module WM
- module Config
- #==============================================================
- #
- # Start Config
- #
- #==============================================================
- # WLH ----------------------------------------------------------------------
- WLH = 24 # When you change the WLH in Window_Base, change this to that
- # value too.
- # ------------------------------------------------------------------------
- # Switch -------------------------------------------------------------------
- SWITCH_ID = 20 # Switch ID to turn your Custom Window ON
- # --------------------------------------------------------------------------
- # Visual -------------------------------------------------------------------
- WINDOW_X = 0 # Your custom window's X Coordinate
- WINDOW_Y = 0 # Your custom window's Y Coordinate
- WINDOW_WIDTH = Graphics.width # Your custom window's width
- WINDOW_HEIGHT = Graphics.height # Your custom window's height
- SHOW_MAP = false # Set this to true, to show the window as an HUD.
- MENU_TEXT = "Window" # Text to show in the menu
- # --------------------------------------------------------------------------
- # ------------------------------------------------------------------------
- # For which actor does the window to draw
- # the things beneath?
- #
- # Options:
- #
- # 0 = Current active actor
- # 1 = Second party member
- # 2 = Third party member
- # 4 = Fourth party member
- # false = All the members of the party
- DRAW_WHICH_ACTOR = 0
- # ------------------------------------------------------------------------
- # ------------------------------------------------------------------------
- DRAW_PARAMETER = [ # << Don't delete
- true, # Draw Attack
- true, # Draw Defence
- true, # Draw Agility
- true, # Draw Spirit
- ] # << Don't delete
- PARA_ATK_X = 250 # X coordinate to draw the Attack
- PARA_ATK_Y = WLH * 0 # Y coordinate to draw the Attack
- PARA_DEF_X = 250 # X coordinate to draw the Defence
- PARA_DEF_Y = WLH * 1 # Y coordinate to draw the Defence
- PARA_AGI_X = 250 # X coordinate to draw the Agility
- PARA_AGI_Y = WLH * 2 # Y coordinate to draw the Agility
- PARA_SPI_X = 250 # X coordinate to draw the Spirit
- PARA_SPI_Y = WLH * 3 # Y coordinate to draw the Spirit
- # ------------------------------------------------------------------------
- # ------------------------------------------------------------------------
- DRAW_STUFF = [
- true, # << draw_actor_face
- true, # << draw_actor_name
- true, # << draw_actor_graphic
- true, # << draw_actor_level
- true, # << draw_actor_hp
- true, # << draw_actor_mp
- true, # << draw_actor_class
- true, # << draw_actor_state
- ]
- ACTOR_FACE_X = 2 # Actor Face X coordinate
- ACTOR_FACE_Y = 0 # Actor Face Y coordinate
- ACTOR_NAME_X = 184 # Actor Name X coordinate
- ACTOR_NAME_Y = 0 # -15 # Actor Name Y coordinate
- ACTOR_GRAPHIC_X = 50 # Actor Graphic X coordinate
- ACTOR_GRAPHIC_Y = 80 # Actor Graphic Y coordinate
- ACTOR_LEVEL_X = 104 # Actor Level X coordinate
- ACTOR_LEVEL_Y = WLH # Actor Level Y coordinate
- ACTOR_HP_X = 104 # Actor HP X coordinate
- ACTOR_HP_Y = WLH * 2 # Actor HP Y coordinate
- ACTOR_MP_X = 104 # Actor MP X coordinate
- ACTOR_MP_Y = WLH * 3 # Actor MP Y coordinate
- ACTOR_CLASS_X = 104 # Actor Class X coordinate
- ACTOR_CLASS_Y = 0 # Actor Class Y coordinate
- ACTOR_STATE_X = 104 # Actor State X coordinate
- ACTOR_STATE_Y = 45 # Actor State Y coordinate
- DRAW_TEXT1 = "Test Window" # String of the text
- DRAW_TEXT1_X = 0 # X coordinate to draw the text
- DRAW_TEXT1_Y = WLH * 4 # Y coordinate to draw the text
- DRAW_TEXT2 = "Hi" # String of the text
- DRAW_TEXT2_X = 0 # X coordinate to draw the text
- DRAW_TEXT2_Y = WLH * 5 # Y coordinate to draw the text
- DRAW_TEXT3 = "" # When not used, leave it like this.
- DRAW_TEXT3_X = 0 # When not used, leave it like this.
- DRAW_TEXT3_Y = 0 # When not used, leave it like this.
- DRAW_TEXT4 = "" # When not used, leave it like this.
- DRAW_TEXT4_X = 0 # When not used, leave it like this.
- DRAW_TEXT4_Y = 0 # When not used, leave it like this.
- # ------------------------------------------------------------------------
- end
- end
- #==============================================================
- #
- # End Config
- #
- #==============================================================
- class Window_CustomWindow < Window_Base
- include WM::Config
- def initialize
- super(WINDOW_X,WINDOW_Y,WINDOW_WIDTH,WINDOW_HEIGHT)
- self.visible = $game_switches[SWITCH_ID]
- refresh
- end
- def refresh
- self.contents.clear
- determine_actor
- end
- def update
- super
- self.visible = $game_switches[SWITCH_ID]
- end
- def determine_actor
- if DRAW_WHICH_ACTOR == false
- for actor in $game_party.members
- draw_contents(actor)
- end
- else
- actor = $game_party.members[DRAW_WHICH_ACTOR]
- draw_contents(actor)
- end
- end
- def draw_contents(actor)
- y = actor.index * 96 + WLH / 2
- self.contents.draw_text(DRAW_TEXT1_X,DRAW_TEXT1_Y,180,WLH,DRAW_TEXT1)
- self.contents.draw_text(DRAW_TEXT2_X,DRAW_TEXT2_Y,180,WLH,DRAW_TEXT2)
- self.contents.draw_text(DRAW_TEXT3_X,DRAW_TEXT3_Y,180,WLH,DRAW_TEXT3)
- self.contents.draw_text(DRAW_TEXT4_X,DRAW_TEXT4_Y,180,WLH,DRAW_TEXT4)
- if DRAW_STUFF[0]
- draw_actor_face(actor, ACTOR_FACE_X, actor.index * 96 + 2 + ACTOR_FACE_Y, 92)
- end
- if DRAW_STUFF[1]
- draw_actor_name(actor, ACTOR_NAME_X, y + ACTOR_NAME_Y)
- end
- if DRAW_STUFF[2]
- draw_actor_graphic(actor,ACTOR_GRAPHIC_X, y + ACTOR_GRAPHIC_Y)
- end
- if DRAW_STUFF[3]
- draw_actor_level(actor,ACTOR_LEVEL_X, y + ACTOR_LEVEL_Y)
- end
- if DRAW_STUFF[4]
- draw_actor_hp(actor,ACTOR_HP_X, y + ACTOR_HP_Y)
- end
- if DRAW_STUFF[5]
- draw_actor_mp(actor,ACTOR_MP_X, y + ACTOR_MP_Y)
- end
- if DRAW_STUFF[6]
- draw_actor_class(actor,ACTOR_CLASS_X, y + ACTOR_CLASS_Y)
- end
- if DRAW_STUFF[7]
- draw_actor_state(actor,ACTOR_STATE_X, y + ACTOR_STATE_Y)
- end
- if DRAW_PARAMETER[0]
- draw_actor_parameter(actor, PARA_ATK_X, y + PARA_ATK_Y, 0)
- end
- if DRAW_PARAMETER[1]
- draw_actor_parameter(actor, PARA_DEF_X, y + PARA_DEF_Y, 1)
- end
- if DRAW_PARAMETER[2]
- draw_actor_parameter(actor, PARA_AGI_X, y + PARA_AGI_Y, 2)
- end
- if DRAW_PARAMETER[3]
- draw_actor_parameter(actor, PARA_SPI_X, y + PARA_SPI_Y, 3)
- end
- end
- end
- class Scene_CustomWindow < Scene_Base
- def start
- super
- create_menu_background
- @customwindow = Window_CustomWindow.new
- end
- def update
- @customwindow.update
- if @customwindow.active = true
- update_customscreen
- end
- end
- def update_customscreen
- if Input.trigger?(Input::B)
- Sound.play_cancel
- return_scene
- end
- end
- def terminate
- @customwindow.dispose
- end
- def return_scene
- $scene = Scene_Menu.new(0)
- end
- end
- class Scene_Map < Scene_Base
- include WM::Config
- alias hsnake_wa_start start unless $@
- def start(*args,&block)
- if SHOW_MAP
- @customwindow = Window_CustomWindow.new
- end
- hsnake_wa_start(*args,&block)
- end
- alias hsnake_wa_update update unless $@
- def update(*args,&block)
- if SHOW_MAP
- @customwindow.update
- end
- hsnake_wa_update(*args,&block)
- end
- alias hsnake_wa_terminate terminate unless $@
- def terminate(*args,&block)
- if SHOW_MAP
- @customwindow.dispose
- end
- hsnake_wa_terminate(*args,&block)
- end
- end
- class Scene_Menu < Scene_Base
- include WM::Config
- #--------------------------------------------------------------------------
- # * Create Command Window
- #--------------------------------------------------------------------------
- def create_command_window
- s1 = Vocab::item
- s2 = Vocab::skill
- s3 = Vocab::equip
- s4 = Vocab::status
- s5 = Vocab::save
- s6 = Vocab::game_end
- if SHOW_MAP == false and $game_switches[SWITCH_ID]
- s7 = MENU_TEXT
- @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s7, s6])
- else
- @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
- end
- @command_window.index = @menu_index
- if $game_party.members.size == 0 # If number of party members is 0
- @command_window.draw_item(0, false) # Disable item
- @command_window.draw_item(1, false) # Disable skill
- @command_window.draw_item(2, false) # Disable equipment
- @command_window.draw_item(3, false) # Disable status
- end
- if $game_system.save_disabled # If save is forbidden
- @command_window.draw_item(4, false) # Disable save
- end
- end
- #--------------------------------------------------------------------------
- # * Update Command Selection
- #--------------------------------------------------------------------------
- def update_command_selection
- if Input.trigger?(Input::B)
- Sound.play_cancel
- $scene = Scene_Map.new
- elsif Input.trigger?(Input::C)
- if $game_party.members.size == 0 and @command_window.index < 4
- Sound.play_buzzer
- return
- elsif $game_system.save_disabled and @command_window.index == 4
- Sound.play_buzzer
- return
- end
- Sound.play_decision
- case @command_window.index
- when 0 # Item
- $scene = Scene_Item.new
- when 1,2,3 # Skill, equipment, status
- start_actor_selection
- when 4 # Save
- $scene = Scene_File.new(true, false, false)
- when 5 # Window
- $scene = Scene_CustomWindow.new
- when 6 # End Game
- $scene = Scene_End.new
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement