Jump to content
Rpg²S Forum
  • 0

Cambiare font nello Script Advances Saves


Zosimos
 Share

Question

Carissimi,

 

ho deciso di utilizzare lo script dell'Advanced Saves, che mi piace assai.

Si tratta di questo script qui:

 

 

#======================================================================

========

# ■ ASM - advanced save menu

#------------------------------------------------------------------------------

# by squall // squall@loeher.zzn.com - Tradotto da Reol 90

# monday the 28th of november 2005

#

# Allows to have up to 99 files.

# Files are stored inside of the folder 'Saves' inside of the game's folder.

# Don't forget to create that folder if it doesn't already exist.

#

# Istruzioni in ita:

# Questo script permette di salvare fino a 99 slots.

# I file salvati si trovano nella cartella 'Saves' che dovrete creare

# all'interno della cartella principale del gioco.

# Non dimenticare di creare la cartella Saves, altrimenti il salvataggio fallirà.

#==============================================================================

 

#==============================================================================

# ■ Window_File

#------------------------------------------------------------------------------

#  Questa finestra mostra la lista degli slot salvati.

#==============================================================================

 

class Window_File

#--------------------------------------------------------------------------

# ● inizializza

#--------------------------------------------------------------------------

def initialize()

super(0, 64, 320, 416)

self.contents = Bitmap.new(width - 32, 99 * 32)

index = $game_temp.last_file_index == nil ? 0 : $game_temp.last_file_index

self.index = index

@item_max = 99

refresh

end

#--------------------------------------------------------------------------

# ● aggiorna la finestra

#--------------------------------------------------------------------------

def refresh

time_stamp = Time.at(0)

for i in 0...99

filename = "Saves/Save#{i + 1}.rxdata"

self.contents.draw_text(1, i * 32, 32, 32, (i + 1).to_s, 1)

if FileTest.exist?(filename)

size = File.size(filename)

if size.between?(1000, 999999)

size /= 1000

size_str = "#{size} Ko"

elsif size > 999999

size /= 1000000

size_str = "#{size} Mo"

else

size_str = size.to_s

end

time_stamp = File.open(filename, "r").mtime

date = time_stamp.strftime("%m/%Y")

time = time_stamp.strftime("%H:%M")

self.contents.draw_text(38, i * 32, 120, 32, date)

self.contents.draw_text(160, i * 32, 100, 32, time)

self.contents.draw_text(0, i * 32, 284, 32, size_str, 2)

end

end

end

end

 

#==============================================================================

# ■ Window_FileStatus

#------------------------------------------------------------------------------

#  Questa finestra mostra lo stato degli attuali slot salvati selezionati.

#==============================================================================

 

class Window_FileStatus

#--------------------------------------------------------------------------

# ● inizializza

#--------------------------------------------------------------------------

def initialize(save_window)

super(320, 64, 320, 416)

self.contents = Bitmap.new(width - 32, height - 32)

@save_window = save_window

@index = @save_window.index

rect = Rect.new(x + 16, y + (height - 32) / 2 + 16, width - 32, (height - 32) / 2)

@viewport = Viewport.new(rect)

@viewport.z = z + 10

refresh

end

#--------------------------------------------------------------------------

# ● dispone la mappa nella finestra

#--------------------------------------------------------------------------

def dispose

tilemap_dispose

@viewport.dispose

super

end

#--------------------------------------------------------------------------

# ● aggiorna

#--------------------------------------------------------------------------

def refresh

self.contents.clear

tilemap_dispose

filename = "Saves/Save#{@index + 1}.rxdata"

return unless FileTest.exist?(filename)

file = File.open(filename, "r")

Marshal.load(file)

frame_count = Marshal.load(file)

for i in 0...6

Marshal.load(file)

end

party = Marshal.load(file)

Marshal.load(file)

map = Marshal.load(file)

for i in 0...party.actors.size

actor = party.actors

x = i % 2 * 144 + 4

y = i / 2 * 64

draw_actor_name(actor, x + 40, y)

draw_actor_level(actor, x + 40, y + 32)

draw_actor_graphic(actor, x + 10, y + 50)

end

total_sec = frame_count / Graphics.frame_rate

hour = total_sec / 60 / 60

min = total_sec / 60 % 60

sec = total_sec % 60

text = sprintf("%02d:%02d:%02d", hour, min, sec)

map_name = load_data("Data/MapInfos.rxdata")[map.map_id].name

self.contents.font.color = system_color

self.contents.draw_text(4, 128, 120, 32, "Tempo di gioco ")

self.contents.draw_text(4, 160, 120, 32, "Mappa di gioco ")

self.contents.draw_text(128, 128, 16, 32, ":")

self.contents.draw_text(128, 160, 16, 32, ":")

self.contents.font.color = normal_color

self.contents.draw_text(144, 128, 120, 32, text)

self.contents.draw_text(144, 160, 120, 32, map_name)

 

@tilemap = Tilemap.new(@viewport)

@tilemap.tileset = RPG::Cache.tileset(map.tileset_name)

for i in 0..6

autotile_name = map.autotile_names

@tilemap.autotiles = RPG::Cache.autotile(autotile_name)

end

@tilemap.map_data = map.data

@tilemap.ox = map.display_x / 4 + 176

@tilemap.oy = map.display_y / 4 + 148

end

#--------------------------------------------------------------------------

# ● tilemap_dispose

#--------------------------------------------------------------------------

def tilemap_dispose

unless @tilemap == nil

@tilemap.tileset.dispose

for i in 0..6

@tilemap.autotiles.dispose

end

@tilemap.dispose

@tilemap = nil

end

end

#--------------------------------------------------------------------------

# ● aggiorna

#--------------------------------------------------------------------------

def update

@tilemap.update if @tilemap != nil

if @index != @save_window.index

@index = @save_window.index

refresh

end

super

end

end

 

#==============================================================================

# ■ Scene_File

#------------------------------------------------------------------------------

#  Scena di base per caricare e salvare.

#==============================================================================

 

class Scene_File

#--------------------------------------------------------------------------

# ● inizializza la scena

#--------------------------------------------------------------------------

def initialize(help_text)

@help_text = help_text

end

#--------------------------------------------------------------------------

# ● main

#--------------------------------------------------------------------------

def main

@help_window = Window_Help.new

@help_window.set_text(@help_text)

@file_window = Window_File.new

@status_window = Window_FileStatus.new(@file_window)

Graphics.transition

loop do

Graphics.update

Input.update

update

if $scene != self

break

end

end

Graphics.freeze

@help_window.dispose

@file_window.dispose

@status_window.dispose

end

#--------------------------------------------------------------------------

# ● aggiorna

#--------------------------------------------------------------------------

def update

@help_window.update

@file_window.update

@status_window.update

if Input.trigger?(Input::C)

decision

$game_temp.last_file_index = @file_index

return

end

if Input.trigger?(Input::B)

cancel

return

end

end

#--------------------------------------------------------------------------

# ● Ritorna al nome dello slot selezionato

#--------------------------------------------------------------------------

def filename

return "Saves/Save#{@file_window.index + 1}.rxdata"

end

end

 

#==============================================================================

# ■ Scene_Save

#------------------------------------------------------------------------------

#  Save menu

#==============================================================================

 

class Scene_Save

#--------------------------------------------------------------------------

# ● Inizializza il Menu di Salvataggio

#--------------------------------------------------------------------------

def initialize

super("Seleziona lo slot nel quale vuoi salvare.")

end

#--------------------------------------------------------------------------

# ● Tasto premuto decisivo

#--------------------------------------------------------------------------

def decision

$game_system.se_play($data_system.save_se)

file = File.open(filename, "wb")

write_save_data(file)

file.close

if $game_temp.save_calling

$game_temp.save_calling = false

$scene = Scene_Map.new

return

end

$scene = Scene_Menu.new(4)

end

#--------------------------------------------------------------------------

# ● cancella tasto premuto

#--------------------------------------------------------------------------

def cancel

$game_system.se_play($data_system.cancel_se)

if $game_temp.save_calling

$game_temp.save_calling = false

$scene = Scene_Map.new

return

end

$scene = Scene_Menu.new(4)

end

#--------------------------------------------------------------------------

# ● salva i dati attuali nello slot selezionato

#--------------------------------------------------------------------------

def write_save_data(file)

characters = []

for i in 0...$game_party.actors.size

actor = $game_party.actors

characters.push([actor.character_name, actor.character_hue])

end

Marshal.dump(characters, file)

Marshal.dump(Graphics.frame_count, file)

$game_system.save_count += 1

$game_system.magic_number = $data_system.magic_number

Marshal.dump($game_system, file)

Marshal.dump($game_switches, file)

Marshal.dump($game_variables, file)

Marshal.dump($game_self_switches, file)

Marshal.dump($game_screen, file)

Marshal.dump($game_actors, file)

Marshal.dump($game_party, file)

Marshal.dump($game_troop, file)

Marshal.dump($game_map, file)

Marshal.dump($game_player, file)

end

end

 

#==============================================================================

# ■ Scene_Load

#------------------------------------------------------------------------------

#  Carica il Menu

#==============================================================================

 

class Scene_Load

#--------------------------------------------------------------------------

# ● Inizializza il Menu

#--------------------------------------------------------------------------

def initialize

$game_temp = Game_Temp.new

$game_temp.last_file_index = 0

latest_time = Time.at(0)

for i in 0..99

filename = "Saves/Save#{i + 1}.rxdata"

if FileTest.exist?(filename)

file = File.open(filename, "r")

if file.mtime > latest_time

latest_time = file.mtime

$game_temp.last_file_index = i

end

file.close

end

end

super("Select a file to load.")

end

#--------------------------------------------------------------------------

# ● Tasto premuto decisivo

#--------------------------------------------------------------------------

def decision

unless FileTest.exist?(filename)

$game_system.se_play($data_system.buzzer_se)

return

end

$game_system.se_play($data_system.load_se)

file = File.open(filename, "rb")

read_save_data(file)

file.close

$game_system.bgm_play($game_system.playing_bgm)

$game_system.bgs_play($game_system.playing_bgs)

$game_map.update

$scene = Scene_Map.new

end

#--------------------------------------------------------------------------

# ● cancella tasto premuto

#--------------------------------------------------------------------------

def cancel

$game_system.se_play($data_system.cancel_se)

$scene = Scene_Title.new

end

#--------------------------------------------------------------------------

# ● Carica lo slot selezionato

#--------------------------------------------------------------------------

def read_save_data(file)

characters = Marshal.load(file)

Graphics.frame_count = Marshal.load(file)

$game_system = Marshal.load(file)

$game_switches = Marshal.load(file)

$game_variables = Marshal.load(file)

$game_self_switches = Marshal.load(file)

$game_screen = Marshal.load(file)

$game_actors = Marshal.load(file)

$game_party = Marshal.load(file)

$game_troop = Marshal.load(file)

$game_map = Marshal.load(file)

$game_player = Marshal.load(file)

if $game_system.magic_number != $data_system.magic_number

$game_map.setup($game_map.map_id)

$game_player.center($game_player.x, $game_player.y)

end

$game_party.refresh

end

end

 

 

Il problema? L'elenco dei salvataggi a sinistra compare in Arial, e non so come invece far sì che compaia secondo il font del mio gioco. So che occorre inserire una stringa specifica da qualche parte... potreste aiutarmi a capire dove?

 

Grazie in anticipo!

Gioco in Sviluppo:

http://www.studibizantini.it/docs/Logo.png

 

Blog: Ode to my Forthcoming Winter

Riferimento

 

Contest:

http://rpg2s.net/gif/SCContest2Oct.gifx2 http://rpg2s.net/gif/SCContest1Oct.gifx1

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

basta ggiungere prima del draw_text self.contents.font_name = "nome del font " se non sbaglio ma sicuramente mi sbaglio sono 3 setimane che non tocco rgss

 

comunque è qualcosa dle genere

http://img256.imageshack.us/img256/7639/ihateyou.gif

Un uomo senza religione è come un pesce senza bicicletta.

http://img18.imageshack.us/img18/3668/decasoft1.png

http://rpg2s.net/gif/SCContest1Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gif

Link to comment
Share on other sites

  • 0
Grazie... ma non ho capito: quello che hai scritto è la stringa da modificare o solo la posizione?

Gioco in Sviluppo:

http://www.studibizantini.it/docs/Logo.png

 

Blog: Ode to my Forthcoming Winter

Riferimento

 

Contest:

http://rpg2s.net/gif/SCContest2Oct.gifx2 http://rpg2s.net/gif/SCContest1Oct.gifx1

Link to comment
Share on other sites

  • 0
devi aggiungerla in quella posizione comunque self.contents.font.name ="nome del font"

http://img256.imageshack.us/img256/7639/ihateyou.gif

Un uomo senza religione è come un pesce senza bicicletta.

http://img18.imageshack.us/img18/3668/decasoft1.png

http://rpg2s.net/gif/SCContest1Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gif

Link to comment
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
 Share

×
×
  • Create New...