Absturz nach Menü - Verlassen
Moin moin...
Ich hab mal wieder ein Problem... =)
Wie folgt:
Ich benutze das Tales of Symphonia CMS.
Dort habe ich das Questlog von Cesar eingebunden, funktioniert soweit auch echt klasse !
aber wenn ich "Ecs" drück und ins menü zurück will schmiert das game ab...
TOS CMS: (Leider ist es nicht eingerück... Sorry!)
Code:
#============================================================
# ToS Menu_Compilations
# Compilated By: Vash (aka Vash-X)
# Released on: Dec. 27, 2005
# Last Updates: Jan. 4, 2006, March 2, 2006
# Recent Updates: April 14, 2006
# Version: 1.3.1
# Credits: Many Sources (Don't remember all)
# Cursor Script by squall
#============================================================
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆
class Window_Base < Window
def draw_actor_hp_meter_line(actor, x, y, width = 156, height = 4)
w = width * actor.hp / actor.maxhp
hp_color_1 = Color.new(255, 0, 0, 192)
hp_color_2 = Color.new(255, 255, 0, 192)
self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
x -= 1
y += (height/4).floor
self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
x -= 1
y += (height/4).ceil
self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
x -= 1
y += (height/4).ceil
self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
end
def draw_actor_sp_meter_line(actor, x, y, width = 156, height = 4)
w = width * actor.sp / actor.maxsp
hp_color_1 = Color.new( 0, 0, 255, 192)
hp_color_2 = Color.new( 0, 255, 255, 192)
self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
x -= 1
y += (height/4).floor
self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
x -= 1
y += (height/4).ceil
self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
x -= 1
y += (height/4).ceil
self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
end
def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)
distance = (start_x - end_x).abs + (start_y - end_y).abs
if end_color == start_color
for i in 1..distance
x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
self.contents.fill_rect(x, y, width, width, start_color)
end
else
for i in 1..distance
x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
r = start_color.red * (distance-i)/distance + end_color.red * i/distance
g = start_color.green * (distance-i)/distance + end_color.green * i/distance
b = start_color.blue * (distance-i)/distance + end_color.blue * i/distance
a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance
self.contents.fill_rect(x, y, width, width, Color.new(r, g, b, a))
end
def draw_actor_level(actor, x, y)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 40, 32, " Lv.")
self.contents.font.color = normal_color
self.contents.draw_text(x + 32, y, 24, 32, actor.level.to_s, 2)
end
def draw_actor_hp(actor, x, y, width = 144)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
if width - 32 >= 108
hp_x = x + width - 108
flag = true
elsif width - 32 >= 48
hp_x = x + width - 48
flag = false
end
self.contents.font.color = actor.hp == 0 ? knockout_color :
actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
self.contents.draw_text(hp_x, y, 48, 32, actor.hp.to_s, 2)
if flag
self.contents.font.color = normal_color
self.contents.draw_text(hp_x + 48, y, 12, 32, "/", 1)
self.contents.draw_text(hp_x + 60, y, 48, 32, actor.maxhp.to_s)
end
end
def draw_actor_sp(actor, x, y, width = 144)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, 32, $data_system.words.sp)
if width - 32 >= 108
sp_x = x + width - 108
flag = true
elsif width - 32 >= 48
sp_x = x + width - 48
flag = false
end
self.contents.font.color = actor.sp == 0 ? knockout_color :
actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
self.contents.draw_text(sp_x, y, 48, 32, actor.sp.to_s, 2)
if flag
self.contents.font.color = normal_color
self.contents.draw_text(sp_x + 48, y, 12, 32, "/", 1)
self.contents.draw_text(sp_x + 60, y, 48, 32, actor.maxsp.to_s)
end
end
end
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆
class Sprite_Cursor < Sprite
#--------------------------------------------------------------------------
# ● instances
#--------------------------------------------------------------------------
attr_accessor :true_x
attr_accessor :true_y
#--------------------------------------------------------------------------
# ● initialize
#--------------------------------------------------------------------------
def initialize(x = 0, y = 0)
super()
self.x = @true_x = x
self.y = @true_y = y
self.z = 10000
self.bitmap = RPG::Cache.windowskin("cursor") rescue Bitmap.new(32, 32)
end
#--------------------------------------------------------------------------
# ● update
#--------------------------------------------------------------------------
def update
super
if self.y < @true_y
n = (@true_y - self.y) / 3
n = 1 if n == 0
self.y += n
elsif self.y > @true_y
n = (self.y - @true_y) / 3
n = 1 if n == 0
self.y -= n
end
if self.x < @true_x
n = (@true_x - self.x) / 3
n = 1 if n == 0
self.x += n
elsif self.x > @true_x
n = (self.x - @true_x) / 3
n = 1 if n == 0
self.x -= n
end
end
end
class Window_Selectable < Window_Base
#--------------------------------------------------------------------------
# ● instances
#--------------------------------------------------------------------------
attr_reader :index
attr_reader :help_window
attr_accessor :cursor
alias update_cursor_moves update
#--------------------------------------------------------------------------
# ● initialize
#--------------------------------------------------------------------------
def initialize(x, y, width, height)
super(x, y, width, height)
@item_max = 1
@column_max = 1
@index = -1
@cursor = Sprite_Cursor.new(x, y)
update_cursor
end
#--------------------------------------------------------------------------
# ● x=
#--------------------------------------------------------------------------
def x=(x)
super
@cursor.x = x if !@cursor.nil?
end
#--------------------------------------------------------------------------
# ● y=
#--------------------------------------------------------------------------
def y=(y)
super
@cursor.y = y if !@cursor.nil?
end
#--------------------------------------------------------------------------
# ● visible=
#--------------------------------------------------------------------------
def visible=(visible)
super
if !@cursor.nil? and visible == false
@cursor.visible = false
end
end
#--------------------------------------------------------------------------
# ● dispose
#--------------------------------------------------------------------------
def dispose
@cursor.dispose
super
end
#--------------------------------------------------------------------------
# ● update_cursor_rect
#--------------------------------------------------------------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
return
end
row = @index / @column_max
if row < self.top_row
self.top_row = row
end
if row > self.top_row + (self.page_row_max - 1)
self.top_row = row - (self.page_row_max - 1)
end
cursor_width = self.width / @column_max - 32
x = @index % @column_max * (cursor_width + 32)
y = @index / @column_max * 32 - self.oy
self.cursor_rect.set(x, y, cursor_width, 32)
end
#--------------------------------------------------------------------------
# ● update_cursor
#--------------------------------------------------------------------------
def update_cursor
@cursor.true_x = self.cursor_rect.x + self.x - 8
@cursor.true_y = self.cursor_rect.y + self.y + 16
@cursor.update
@cursor.visible = (self.visible and self.index >= 0)
end
#--------------------------------------------------------------------------
# ● update
#--------------------------------------------------------------------------
def update
update_cursor_moves
update_cursor
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆
class Game_Party
attr_reader :battle_count
alias initialize_para_battle_count initialize
def initialize
initialize_para_battle_count
@battle_count = 0
end
def increase_battle_count
@battle_count = [@battle_count + 1, 9999999].min
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆
class Scene_Battle
alias start_phase1_para_battle_count start_phase1
def start_phase1
@enemies_count = $game_troop.enemies.size
start_phase1_para_battle_count
end
alias battle_end_para_battle_count battle_end
def battle_end(result)
case result
when 0
$game_party.increase_battle_count
when 1
$game_party.increase_battle_count
exist_enemy = 0
for enemy in $game_troop.enemies
if enemy.exist?
exist_enemy += 1
end
end
@enemies_count = @enemies_count - exist_enemy
end
battle_end_para_battle_count(result)
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆
class Window_Info < Window_Base
def initialize
super(0, 0, 170, 384)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
refresh
end
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(1, -7, 120, 32, "Spielzeit")
@total_sec = Graphics.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)
self.contents.font.color = normal_color
self.contents.draw_text(4, 10, 120, 32, text, 2)
self.contents.font.color = system_color
self.contents.draw_text(1, 30, 120, 32, "Schritte")
self.contents.font.color = normal_color
self.contents.draw_text(2, 32, 120, 32, $game_party.steps.to_s, 2)
cx = contents.text_size($data_system.words.gold).width
self.contents.font.color = normal_color
self.contents.draw_text(4, 216, 122.5-cx-6, 32, $game_party.gold.to_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(124-cx, 220, cx, 25, $data_system.words.gold, 2)
self.contents.font.color = system_color
self.contents.draw_text(2, 64, 120, 32, "Monster erledigt")
self.contents.font.color = normal_color
self.contents.draw_text(3, 66, 120, 32, $game_party.battle_count.to_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(2, 95, 120, 32, "Standort")
self.contents.font.color = normal_color
self.contents.draw_text(- 2, 115, 124, 32, $data_map_infos[$game_map.map_id].name, 2)
end
def update
super
if Graphics.frame_count / Graphics.frame_rate != @total_sec
refresh
end
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆
class Window_MenuStatus < Window_Selectable
def initialize
super(0, 0, 470, 386)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
refresh
self.active = false
self.index = -1
end
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
x = 64
y = i * 93
actor = $game_party.actors[i]
draw_actor_graphic(actor, x - 32, y + 65)
draw_actor_name(actor, x + 5, y - 8)
draw_actor_class(actor, x + 5, y + 18)
draw_actor_level(actor, x, y + 45)
draw_actor_state(actor, x + 95, y + 45)
draw_actor_hp_meter_line(actor, x + 223, y + 9, 116, 8)
draw_actor_sp_meter_line(actor, x + 223, y + 37, 116, 8)
draw_actor_hp(actor, x + 195, y + - 8)
draw_actor_sp(actor, x + 195, y + 20)
self.contents.font.color = system_color
self.contents.draw_text(x + 175, y + 45, 84, 32, "Nächste")
self.contents.font.color = normal_color
self.contents.draw_text(x + 310, y + 45, 84, 32, actor.next_exp_s)
end
end
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(5, @index * 90, 32, 32)
end
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆
class Window_MenuCommand < Window_Selectable
#--------------------------------------------------------------------------
def initialize(commands)
col_max = 4
super(0, 0, 640, (commands.size / col_max + 2) * 21.5 + 32)
@column_max = col_max
@item_max = commands.size
@commands = commands
self.contents = Bitmap.new(width - 32, height - 32)
refresh
self.index = 0
end
#--------------------------------------------------------------------------
def refresh(commands = nil)
@commands = commands if commands != nil
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
self.contents.clear
for i in 0...@item_max
draw_item(i, normal_color)
end
end
#--------------------------------------------------------------------------
def draw_item(index, color)
self.contents.font.color = color
rect = Rect.new((index % @column_max) * ((width - 32) / @column_max),
index / @column_max * 32, (width - 32) / @column_max, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect, @commands[index], 1)
end
#--------------------------------------------------------------------------
def disable_item(index)
draw_item(index, disabled_color)
end
#--------------------------------------------------------------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
return
end
row = @index / @column_max
if row < self.top_row
self.top_row = row
end
if row > self.top_row + (self.page_row_max - 1)
self.top_row = row - (self.page_row_max - 1)
end
cursor_width = (self.width - 55) / @column_max
x = @index % @column_max * (cursor_width + 3)
y = @index / @column_max * 32 - self.oy
self.cursor_rect.set(x, y, 32, 32)
end
end
#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆
class Scene_Menu
def initialize(menu_index = 0)
@menu_index = menu_index
@changer = 0
@where = 0
@checker = 0
end
def main
@commands = []
@commands[0] = $data_system.words.item
@commands[1] = $data_system.words.skill
@commands[2] = $data_system.words.equip
@commands[7] = "Log"
@commands[3] = "Status"
@commands[4] = "Gruppe"
@commands[5] = "Speichern"
@commands[6] = "Beenden"
@command_window = Window_MenuCommand.new(@commands)
@command_window.back_opacity = 180
@command_window.index = @menu_index
if $game_party.actors.size == 0
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
end
if $game_system.save_disabled
@command_window.disable_item(5)
end
@info_window = Window_Info.new
@info_window.back_opacity = 180
@info_window.x = 470
@info_window.y = 96
@status_window = Window_MenuStatus.new
@status_window.back_opacity = 180
@status_window.x = 0
@status_window.y = 96
@mapset = Spriteset_Map.new
win1=Window_Base.new(0, 96, 470, 100)
win2=Window_Base.new(0, 196, 470, 93)
win3=Window_Base.new(0, 289, 470, 93)
win4=Window_Base.new(0, 382, 470, 98)
win1.back_opacity= 0
win2.back_opacity= 0
win3.back_opacity= 0
win4.back_opacity= 0
win1.z=9999
win2.z=9999
win3.z=9999
win4.z=9999
Graphics.transition(30, "Graphics/Transitions/" + "015-Diamond01")
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
win1.dispose
win2.dispose
win3.dispose
win4.dispose
@command_window.dispose
@info_window.dispose
@status_window.dispose
end
def update
@command_window.update
@info_window.update
@status_window.update
if @command_window.active
update_command
return
end
if @status_window.active
update_status
return
end
end
def update_command
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end
if Input.trigger?(Input::C)
if $game_party.actors.size == 0 and @command_window.index < 4
$game_system.se_play($data_system.buzzer_se)
return
end
case @command_window.index
when 0 # Item
$game_system.se_play($data_system.decision_se)
$scene = Scene_Item.new
when 1 # Skill
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 2 # Equip
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 7
#Play Descision SE
$game_system.se_play($data_system.decision_se)
$scene = Scene_Questlog.new
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 3 # Status
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 4 # Party Changer
$game_system.se_play($data_system.decision_se)
@checker = 0
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 5 # Save
if $game_system.save_disabled
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_Save.new
when 6 # End
$game_system.se_play($data_system.decision_se)
$scene = Scene_End.new
end
return
end
end
# --------------------------------
def update_status
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@command_window.active = true
@status_window.active = false
@status_window.index = -1
return
end
if Input.trigger?(Input::C)
case @command_window.index
when 1
if $game_party.actors[@status_window.index].restriction >= 2
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_Skill.new(@status_window.index)
when 2
$game_system.se_play($data_system.decision_se)
$scene = Scene_Equip.new(@status_window.index)
when 3
$game_system.se_play($data_system.decision_se)
$scene = Scene_Status.new(@status_window.index)
when 4
$game_system.se_play($data_system.decision_se)
if @checker == 0
@changer = $game_party.actors[@status_window.index]
@where = @status_window.index
@checker = 1
else
$game_party.actors[@where] = $game_party.actors[@status_window.index]
$game_party.actors[@status_window.index] = @changer
@checker = 0
@status_window.refresh
end
end
return
end
end
end
in kurzform wurde folgendes eingefügt(der "command(7)" und die funktion "when 7"):
Code:
def main
@commands = []
@commands[0] = $data_system.words.item
@commands[1] = $data_system.words.skill
@commands[2] = $data_system.words.equip
@commands[7] = "Log"
@commands[3] = "Status"
@commands[4] = "Gruppe"
@commands[5] = "Speichern"
@commands[6] = "Beenden"
@command_window = Window_MenuCommand.new(@commands)
when 7
#Play Descision SE
$game_system.se_play($data_system.decision_se)
$scene = Scene_Questlog.new
@command_window.active = false
@status_window.active = true
@status_window.index = 0
so nun sind wir ja wie gesagt im log und nun wäre es sinnvoll wieder ins TOS CMS zurück zukommen!
QuestLog von Cesar:
Code:
#//////////////////////////////////Questlog 3.0/////////////////////////////////
#~~~~~~~~~~~~~~~~~~by Caesar~~~~~~~~~~~~~~~~~
#\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
#===================Parameter==================
# Wenn true, werden neue Quests oben eingefügt, ansonsten unten
INSERT_AT_TOP = true
# Zeilenhöhe in der Questbeschreibung
LINE_HEIGHT = 24
# Windowskin der Questlog-Fenster (nil = default)
WINDOWSKIN = nil
# "Überschrift" des Questlogs
HEADER_TEXT = "Questlog"
# Geschwindigkeit beim Scrollen (Pixel / Frame)
SCROLL_SPEED = 7
# Styles für die Beschreibungen der Quests
STYLES = {
"h1" => "<size=45><font=Cambria><b>|</b></font></size><down=40>",
"h2" => "<big><b><font=Cambria>|</font></b></big><down=32>",
"disabled" => "<color=disabled_color>|</color>",
"highlight" => "<color=#eeee32>|</color>",
"system" => "<color=system_color>|</color>"
}
# Dieser Process wird ausgeführt, sobald das Questlog geschlossen wird;
# (Default: Spieler kommt wieder auf die Map)
ON_CLOSE = Proc.new {$scene = Scene_Menu.new}
#============================================
class Scene_Questlog
def main
@window_header = Window_Help.new
@window_header.x = 65
@window_header.y = 28
@window_header.z = 500
@window_header.width = 510
@window_header.windowskin = RPG::Cache.windowskin(WINDOWSKIN) unless
WINDOWSKIN.nil?
@window_header.contents = Bitmap.new(478, 32)
@window_header.contents.font.size = 30
@window_header.contents.draw_text(0, 0, 510, 32, HEADER_TEXT, 1)
@window_titles = Window_Questlog_Titles.new
@window_titles.windowskin = RPG::Cache.windowskin(WINDOWSKIN) unless
WINDOWSKIN.nil?
@window_description = Window_Questlog_Description.new(
$game_system.questlog.quests.map{|q| q.description})
@window_description.windowskin = RPG::Cache.windowskin(WINDOWSKIN) unless
WINDOWSKIN.nil?
@index = @window_titles.index
spriteset = Spriteset_Map.new
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@window_header.dispose
@window_titles.dispose
@window_description.dispose
spriteset.dispose
end
#----------------
def update
@window_titles.update
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
ON_CLOSE.call
return
end
if Input.press?(Input::R)
@window_description.scroll_down
elsif Input.press?(Input::L)
@window_description.scroll_up
end
if @index != @window_titles.index
@window_description.index = @index = @window_titles.index
end
end
end
#=============
class Quest
attr_reader :title
attr_reader :description
def initialize(title, description)
@title = title
@description = description
end
end
#============
class Questlog
attr_reader :quests
def initialize
@quests = []
end
#-----------
def add(quest, description="")
return add(Quest.new(quest, description)) unless quest.is_a?(Quest)
i = index(quest.title)
return @quests[i] = quest if i != nil
if INSERT_AT_TOP
# insert quest at top of the list
@quests.unshift(quest)
else
# insert quest at bottom of the list
@quests.push(quest)
end
end
#-----------
def remove(title)
@quests.delete_if{ |quest| quest.title == title}
end
#-----------
def count
return @quests.length
end
#------------
def index(title)
for i in 0..@quests.length-1
return i if @quests[i].title == title
end
return nil
end
#------------
def Questlog.add(title, description="")
$game_system.questlog.add(title, description)
end
#------------
def Questlog.remove(title)
$game_system.questlog.remove(title)
end
end
#=============
class Window_Questlog_Description < Window_Base
attr_reader :index
#------------------
def initialize(descriptions)
super(275, 92, 300, 360)
@descriptions = descriptions
@cache = Array.new(descriptions.size)
self.contents = Bitmap.new(width-32, height-32)
self.index = 0
self.z = 500
end
#-----------
def index=(index)
return if index == @index or @descriptions.empty?
@index = index
self.oy = 0
# bitmaps are only rendered once and than cached to reach more efficiency
if @cache[index].nil?
buffer = Bitmap.new(width-32, 2000)
docheight = buffer.draw_html(0, 0, 270, 2000, @descriptions[index])
@cache[index] = self.contents = Bitmap.new(width-32, docheight)
self.contents.blt(0, 0, buffer, Rect.new(0, 0, self.width-32, docheight))
else
self.contents = @cache[index]
end
end
#-----------
def scroll_down
self.oy += SCROLL_SPEED if self.height + self.oy - 32 < self.contents.height
end
#------------
def scroll_up
self.oy -= SCROLL_SPEED
self.oy = 0 if self.oy < 0
end
end
#=============
class Window_Questlog_Titles < Window_Base
attr_reader :index
def initialize
super(65, 92, 210, 360)
self.z = 500
@item_max = $game_system.questlog.count
self.contents = Bitmap.new(width-32, @item_max > 0 ? @item_max*32 : 32)
@index = 0
refresh
end
#-------------
def index=(index)
@index = index
update_cursor_rect
end
#-------------
def top_row=(row)
if row < 0
row = 0
end
if row > @item_max - 1
row = @item_max - 1
end
self.oy = row * 32
end
#-------------
def page_row_max
return (self.height - 32) / 32
end
#-------------
def page_item_max
return page_row_max * @column_max
end
#-------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
return
end
row = @index
top_row = self.oy / 32
if row < top_row
self.top_row = row
end
if row > top_row + (self.page_row_max - 1)
self.top_row = row - (self.page_row_max - 1)
end
self.cursor_rect.set(0, @index * 32 - self.oy, self.width - 32, 32)
end
#-------------
def refresh
self.contents.clear
for i in 0...$game_system.questlog.count
quest = $game_system.questlog.quests[i]
y = i*32
self.contents.draw_html(4, y, 150, 32, quest.title)
end
end
#------------
def update
super
if self.active and @item_max > 0 and @index >= 0
if Input.repeat?(Input::DOWN) and
(Input.trigger?(Input::DOWN) or @index < @item_max - 1)
$game_system.se_play($data_system.cursor_se)
@index = (@index + 1) % @item_max
end
if Input.repeat?(Input::UP) and
(Input.trigger?(Input::UP) or @index > 0)
$game_system.se_play($data_system.cursor_se)
@index = (@index - 1 + @item_max) % @item_max
end
end
update_cursor_rect
end
end
#===========
class Scene_Map
def call_questlog
$game_temp.questlog_calling = false
$game_player.straighten
$scene = Scene_Questlog.new
end
end
#===========
class Game_System
attr_accessor :questlog
alias questlog_init initialize
def initialize
questlog_init
@questlog = Questlog.new
end
end
#===========
class Game_Temp
attr_accessor :questlog_calling
alias questlog_init initialize
def initialize
questlog_init
@questlog_calling = false
end
end
#========================
class Scene_Load < Scene_File
# if a game that does not yet contain the questlog is loaded
# a new (empty) questlog instance is created
alias questlog_read_save_data read_save_data
def read_save_data(file)
questlog_read_save_data(file)
$game_system.questlog = Questlog.new if $game_system.questlog.nil?
end
end
ganz oben ist der eintrag:
Code:
ON_CLOSE = Proc.new {$scene = Scene_Menu.new}
dort hab ich schon allerhand probiert... nichts hat so richtig funktioniert...
hat jemand eine idee woran es liegt den "cursorsound" hört man noch und dann is fin...
Vielen Dank für die Zeit des durchlesens, des verstehens =) und der Lösung o_O
Gruß fritte