def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
for i in 0...$game_party.quest.size
@data.push($game_party.quest[i])
end
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
self.contents.font.name = $defaultfonttype # "Items" window font
self.contents.font.size = $defaultfontsize
self.back_opacity = (OP)
for i in 0...@item_max
draw_item(i)
end
end
end
def draw_item(index)
item = @data[index]
x = 8
y = index * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.back_opacity = (OP)
self.contents.draw_text(x , y, 212, 32, item[0], 0)
end
end
class QuestLog
def initialize
@quest = $game_party.quest
end
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(0, 0, 80, 32, "Trudnosc:")
self.contents.font.color = normal_color
self.contents.draw_text(90, 0, 120, 32, "Bardzo Ĺatwy") if @quest == 0
self.contents.draw_text(90, 0, 120, 32, "Ĺatwy") if @quest == 1
self.contents.draw_text(90, 0, 120, 32, "Ĺredni") if @quest == 2
self.contents.draw_text(90, 0, 120, 32, "Trudny") if @quest == 3
self.contents.draw_text(90, 0, 120, 32, "Bardzo trudny") if @quest == 4
self.contents.draw_text(90, 0, 120, 32, "Hiper Trudny") if @quest == 5
end
def update
refresh
end
end
ATP:
Spoiler:
Kod:
=begin
ATP(Advanced Text Paragrapher) V1.0 by Samo, The thief
Ok, Something of The Scripters do normally to draw a text in form of a paragraph is
doing an array [] that contains each line. The Time Has come For
This Microsoft Word Effect!
This Script Just need a Long String and it will paragraph it!
How to call it?
paragraph = str_paragraph(string, width of the paragraph.)
Example :
@my_paragraph = str_paragraph("La la la la la la la la la , This is a Looooong Strriiiing!", 120)
Returns an Array with each line separately.
How to draw it?
draw_paragraph(x,y,width,height, paragraph)
width and height for each line, not for the paragraph.
.::-NOTE-::.
If you put a ' ^ '(must be between spaces), the text will pass to the next line.
This Symbol Won't be drawed.
Reminder: Always use '' instead of ""! It works faster!
=end
class Window_Base < Window
#--------------------------------------------------
def str_paragraph(str_old, width)
temp_str = ''
str = '' + str_old
words = []
size = 0
str_size = 0
#
while ((c = str.slice!(/./m)) != nil)
temp_str += c
str_size += 1
if c == ' '
words.push(temp_str)
temp_str = ''
end
if str.size == 0
words.push(temp_str)
temp_str = ''
end
end
lines = []
for i in 0...words.size
word = words[i]
if word == '^ '
lines.push(temp_str)
temp_str = ''
next
end
temp_str += word
size = contents.text_size(temp_str).width
if size > width - contents.text_size(' ').width
for i in 1..word.size
temp_str = temp_str.chop
end
lines.push(temp_str)
temp_str = ''
temp_str += word
end
end
words = words.compact
if temp_str != ''
lines.push(temp_str)
end
return lines
end
#---------------------------------------------------------------------
def draw_paragraph(x,y,width,height,lines,align = 0)
for i in 0...lines.size
self.contents.draw_text(x, y + i * self.contents.font.size + 1, width, height, lines[i], align)
end
end
#-----------------------------------------------------------------
end
Pomogła: 232 razy Dołączyła: 18 Wrz 2007 Posty: 2424
Wysłany: Nie 10 Lut, 2013 23:00
ZnajdĹş fragment:
Kod:
@spriteset = Spriteset_Map.new
zamieĹ na:
Kod:
@spriteset = Spriteset_Map_QuestLog.new
nastÄpnie znajdĹş:
Kod:
if $scene.is_a?(Scene_Title)
dodaj przed:
Kod:
@spriteset.dispose
Na samym dole skryptu dodaj:
Spoiler:
Kod:
class Spriteset_Map_QuestLog
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
@viewport1 = Viewport.new(0, 0, 640, 480)
@tilemap = Tilemap.new(@viewport1)
@tilemap.tileset = RPG::Cache.tileset($game_map.tileset_name)
for i in 0..6
autotile_name = $game_map.autotile_names[i]
@tilemap.autotiles[i] = RPG::Cache.autotile(autotile_name)
end
@tilemap.map_data = $game_map.data
@tilemap.priorities = $game_map.priorities
@panorama = Plane.new(@viewport1)
@panorama.z = -1000
@character_sprites = []
for i in $game_map.events.keys.sort
sprite = Sprite_Character.new(@viewport1, $game_map.events[i])
@character_sprites.push(sprite)
end
@character_sprites.push(Sprite_Character.new(@viewport1, $game_player))
end
#--------------------------------------------------------------------------
# * Dispose
#--------------------------------------------------------------------------
def dispose
@tilemap.tileset.dispose
for i in 0..6
@tilemap.autotiles[i].dispose
end
@tilemap.dispose
@panorama.dispose
for sprite in @character_sprites
sprite.dispose
end
@viewport1.dispose
end
end
Pomogła: 232 razy Dołączyła: 18 Wrz 2007 Posty: 2424
Wysłany: Pon 11 Lut, 2013 10:56
A przed wprowadzeniem korekt wszystko dziaĹaĹo? PisaĹam juĹź Ĺźe skrypt jest mocno niezoptymalizowany. Nie usuwaĹ domyĹlnie spriteseta mapy przez co po trzykrotnym wejĹciu do QuestLoga gra siÄ zawieszaĹa. Korekty, ktĂłre wprowadziĹam nie sÄ na tyle powaĹźne, aby siadaĹ program. Problem leĹźy po stronie samego skryptu na dziennik.
Czyli z uĹźycia questlogu nici? Jaki dziennik polecasz? Bo nie ogarniam zbytnio Jaberwocky, a inne mi nie pasujÄ , bo to trudne do ogarniÄcia, bo to po otwarciu otwiera siÄ maĹe okienko z podziaĹem itp.
Pomogła: 232 razy Dołączyła: 18 Wrz 2007 Posty: 2424
Wysłany: Czw 21 Lut, 2013 23:27
Przykro mi, ale w kwestii ogarniania to nie jestem dobrym doradcÄ , bo to ktĂłry jest dla Ciebie najlepszy / najĹatwiejszy, moĹźesz tylko Ty zdecydowaÄ. Przejrzyj na spokojnie zasoby, moĹźe uda siÄ Tobie coĹ znaleĹşÄ. Pewnie do tych bardziej rozbudowanych skryptĂłw moĹźna znaleĹşÄ jakieĹ tutoriale.
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach Nie możesz załączać plików na tym forum Możesz ściągać załączniki na tym forum