Jump to content
A.

Steps Window

Recommended Posts

Steps window

 

Version: 1.0

Author: Adrien. (A.)

Usagage: Plug and Play

Blog: Labs

 

capture_by_createdthoughts-d4l1r2h.png

 

Note: First Ever script attempt.....

Comptaibility: No issue

FAQ: Seriously? See screen shot.

 

 

 

#==============================================================================
# Window Steps Script
#------------------------------------------------------------------------------
#  Allows you to show the current amount of steps in the status menu when you
#  open up the menu via esc on the keyboard.
#
#  Author: Adam Balan (Adrien., A.)
#  Incomptaibility?: Nothing.
#  Notes: plug and play.
#  Version 1.1
#==============================================================================

#==============================================================================
# Module WindowVocab
#------------------------------------------------------------------------------
#   STEPS = name of the steps vocab.
#==============================================================================

module WindowVocab
 STEPS = "steps" #name of the steps
end

#==============================================================================
# Window_Steps
#------------------------------------------------------------------------------
#  Window Steps shows a steps window above the gold in the menu.
#==============================================================================

class Window_Steps < Window_Base
 #--------------------------------------------------------------------------
 #   Initialize the class.
 #--------------------------------------------------------------------------
 def initialize
super(0, 0, 160, fitting_height(1))
refresh
 end

 #--------------------------------------------------------------------------
 #   Refresh the box.
 #--------------------------------------------------------------------------
 def refresh
contents.clear
draw_currency_value(value, currency_unit, 4, 0, contents.width - 8)
 end
 #--------------------------------------------------------------------------
 #   Get the value of the steps.
 #--------------------------------------------------------------------------
 def value
$game_party.steps
 end
 #--------------------------------------------------------------------------
 #   Define the Vocab.
 #--------------------------------------------------------------------------
 def currency_unit
WindowVocab::STEPS
 end
end

#==============================================================================
# Scene_Menu
#------------------------------------------------------------------------------
#  Create the Menu - we are only editing one method and adding a new.
#
#  Alias: start method to add the steps window.
#==============================================================================

class Scene_Menu < Scene_MenuBase

 #--------------------------------------------------------------------------
 #   Alias: start method.
 #--------------------------------------------------------------------------
 alias start_a start
 def start
start_a
create_steps_window
 end

 #--------------------------------------------------------------------------
 #   Create the window.
 #--------------------------------------------------------------------------
 def create_steps_window
@steps_window = Window_Steps.new
@steps_window.x = 0
@steps_window.y = (Graphics.height - @steps_window.height) - 50
 end

end

 

 

Share this post


Link to post
Share on other sites

Does anyone know enough about this code or this author to add an icon option?  I like this script and all but I'm also using a menu add on system and it lets me put icons for parts of the menu but not this.

Share this post


Link to post
Share on other sites

Does anyone know enough about this code or this author to add an icon option?  I like this script and all but I'm also using a menu add on system and it lets me put icons for parts of the menu but not this.

 

 

 

module Window_Steps

USE_ICON = true


ST = "Steps"


ICON = 172
end

class ST_Window < Window_Base

def initialize
super(0,0,160,fitting_height(1))
refresh
end


def refresh
contents.clear
draw_currency_value(steps, iconText, 0, 0, contents.width - 2)
end


def steps
$game_party.steps
end


def iconText
if Window_Steps::USE_ICON == true
draw_icon(Window_Steps::ICON,0,0)
else
draw_text_ex(0,0,Window_Steps::ST)
end
end
end

class Scene_Menu < Scene_MenuBase

alias start_original start
def start
start_original
create_st_window
end

def create_st_window
@st_window = ST_Window.new
@st_window.x = 0
@st_window.y = (Graphics.height - @ST_window.height) - 98
end
end

 

 

Edited by Ruiran

Share this post


Link to post
Share on other sites

 

Does anyone know enough about this code or this author to add an icon option?  I like this script and all but I'm also using a menu add on system and it lets me put icons for parts of the menu but not this.

 

 

 

module Window_Steps

USE_ICON = true


ST = "Steps"


ICON = 172
end

class ST_Window < Window_Base

def initialize
super(0,0,160,fitting_height(1))
refresh
end


def refresh
contents.clear
draw_currency_value(steps, iconText, 0, 0, contents.width - 2)
end


def steps
$game_party.steps
end


def iconText
if Window_Steps::USE_ICON == true
draw_icon(Window_Steps::ICON,0,0)
else
draw_text_ex(0,0,Window_Steps::ST)
end
end
end

class Scene_Menu < Scene_MenuBase

alias start_original start
def start
start_original
create_st_window
end

def create_st_window
@st_window = ST_Window.new
@st_window.x = 0
@st_window.y = (Graphics.height - @ST_window.height) - 98
end
end

 

 

 

I'm kind of new to scripting Egg, where would one go about putting that? 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×