Main Menu
  • Welcome to The RPG Maker Resource Kit.

[REQUEST] Savefile (Where playtime is drawn)

Started by &&&&&&&&&&&&&, April 09, 2011, 07:42:16 PM

0 Members and 1 Guest are viewing this topic.

&&&&&&&&&&&&&

Move playtime snippet
April 09 '11




Summary
I just want the little script piece that will move the playtime. I want to display the playtime counter in the load/save menu under the slot number, so I don't need an entire script. I just the snippet that tells it where to draw the playtime.

Features Desired

  • to move the playtime

Mockups
_________________________________
|Slot 1                                                   |
|1:00:32            ???    :P    ::)    >:(            |
------------------------------------------




&&&&&&&&&&&&&&&&

TDS

This should do it.


#==============================================================================
# ** Window_SaveFile
#------------------------------------------------------------------------------
#  This window displays save files on the save and load screens.
#==============================================================================

class Window_SaveFile < Window_Base
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.font.color = normal_color
    name = Vocab::File + " #{@file_index + 1}"
    self.contents.draw_text(4, 0, 200, WLH, name)
    @name_width = contents.text_size(name).width
    if @file_exist
      draw_party_characters(152, 58)
      draw_playtime(0, 34, contents.width - 4, 0)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Play Time
  #     x : Draw spot X coordinate
  #     y : Draw spot Y coordinate
  #     width : Width
  #     align : Alignment
  #--------------------------------------------------------------------------
  def draw_playtime(x, y, width, align)
    hour = @total_sec / 60 / 60
    min = @total_sec / 60 % 60
    sec = @total_sec % 60
    time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
    self.contents.font.color = normal_color
    self.contents.draw_text(x, y, width, WLH, time_string, align)
  end
end


The draw_playtime had to be edited because they seem to have forgotten to add the align argument into the text drawing.

Have a nice day.

&&&&&&&&&&&&&

#2
Thank you. It's working great.

I tried to just use "draw_playtime = (0, 4)" but I just got syntax errors. I know how to change things here and there, but I'm definitely not a scripter, I can't write new stuff.

So, thank you. I will have a good day. You have one too.
&&&&&&&&&&&&&&&&