[XP] Location Window

Started by Juan, January 07, 2008, 08:08:27 pm

Previous topic - Next topic

Juan

January 07, 2008, 08:08:27 pm Last Edit: June 02, 2009, 11:14:45 am by Juan
Location Window
Authors: Juan
Version: 1.4
Type: Scene Menu Add on
Key Term: Menu Add-on



Introduction

This script allows you to display the maps name.


Features


  • Display maps name
  • Removed the * in map name
  • Removes the step window
  • Less code than other location scripts



Screenshots

Spoiler: ShowHide


Demo

Just post this script above main and go to test play.


Script

Spoiler: ShowHide

#==============================================================================
# ** Location Window
#------------------------------------------------------------------------------
# Juan  
# Version 1.4
# made 10/13/07
# Date last time updated 12/30/07
#==============================================================================
# This script changes the step window to a location window(displays map name.)
# by changing the steps wiindow to display a location window.
# Any bugs email me juanpena1111@yahoo.com
# Version History
#
# Version 1.0
# -> This script was first made.
# Version 1.1
# -> Fixed font bug
# Version 1.2
# -> Removed * in map name.
# Version 1.3
# -> You can now change the location name.
# Version 1.4
# -> Improed coding
#
# Compatibility:
# This script changes the windows steps window to display the map name. What  that means
# is this script will not work on some cms(custom menu systems) if they
# don't use the step window
#
# Features
# Displays the map name.
# Removed the * in map name.
# Less code than other location scripts
#
# Instructions
# Make a new script above main and paste this script there. You should
# also configure the location name. Just change the Location Name = 'Location'
# FAQ (Frequently Asked Questions):
# None yet

# Author's Notes
# Any bugs email me juanpena1111@yahoo.com
# Credit me and enjoy.
#
#
#==============================================================================
# module Juan_Configuration
#==============================================================================

module Juan_Configuration
 
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::  
# Begin Configuration
Location_Name = 'Location'
# End Configuration.
end
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

#==============================================================================
# Scene_Title
#==============================================================================

class Scene_Title

 alias main_juans_custom_menu_later main
 def main
   $map_infos = load_data('Data/MapInfos.rxdata')
   $map_infos.keys.each {|key| $map_infos[key] = $map_infos[key].name}
   main_juans_custom_menu_later
 end  
end
#===================================================
# * Class Scene_Title Ends
#===================================================


#===================================================
# * Class Game_Map Begins
#===================================================
class Game_Map
def name
return $map_infos[@map_id]
end
end
#===================================================
# * Class Game_Map Ends
#===================================================



#===================================================
# * Class Window_Steps Begins
#===================================================
class Window_Steps < Window_Base
 #--------------------------------------------------------------------------
 # * Refresh
 #--------------------------------------------------------------------------
 def refresh
   if $fontface != nil
   self.contents.font.name = $fontface
   elsif $defaultfonttype != nil
   self.contents.font.name = $defaultfonttype
   end
   self.contents.font.size = 24    
   self.contents.clear
   self.contents.font.color = system_color
   self.contents.draw_text(4, 0, 80, 32, Juan_Configuration::Location_Name)
   self.contents.font.color = normal_color
   if $game_map.name.include?('*')
   self.contents.draw_text(4, 32, 120, 32, $game_map.name.delete!('*'), 2)
   else
   self.contents.draw_text(4, 32, 120, 32, $game_map.name, 2)
   end
 end
end
#===================================================
# * Class Window_Steps Ends
#===================================================



Instructions
Make a new script and post it above main.


Compatibility

This script rewrites the windows step class. So all that means is if a cms doesn't use the steps window at all it will not work.


Credits and Thanks


  • Juan



Author's Notes

Credit me and enjoy.
Dropbox Who need luck when you can make your own.
3ds Friend code: ShowHide
 4468 1422  6617

Fantasist

You know, replacing the steps window with locatin is really a nice idea. Good work :)

You might also want to put in the instructions the syntax needed to call the map's name since that's the feature which actually matters. I mean, the steps window mod is just an application. Someone might use it for other purposes. This is a convention I decided to implement in my scripts. If I add a new feature or functionality (command windows for exaple), I'll mention in the documentation.
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Juan

January 09, 2008, 10:12:04 am #2 Last Edit: January 11, 2008, 10:09:38 pm by Juan
@Fantasist I'll post that on Friday. And thanks.

Edit
Updated the script. More user configurable.
Dropbox Who need luck when you can make your own.
3ds Friend code: ShowHide
 4468 1422  6617