#≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
#≡ Sakuraba's Custom Encyclopedia v1.2
#≡ by: Sakuraba
#≡ improved by: Kyonides Arkanthes
#≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
#≡ ● Change Log:
#≡ 12/08/2021: ??:?? > 2 New Script Calls, Add entries & texts in game
#≡ 18/02/2014: 17:10 > Minor improvements
#≡ 27/10/2013: 10:44 > Finished Script
#≡ 26/10/2013: 20:03 > Started Script
#≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
#≡ ● Terms of Use:
#≡ ◦ Do NOT remove this Header
#≡ ◦ Give Credit to "Sakuraba" & Kyonides Arkanthes if Used
#≡ ◦ Feel Free to use in commercial and non commercial projects
#≡ ◦ Don’t ask ME for compatibility patches, ask the other script's creators
#≡ ◦ Edit below Danger Line ONLY if you know what you're doing
#≡ ◦ Don't post this in other forums, post a link to this forum instead
#≡ ◦ Do NOT steal the Sakuraba Nickname!!!
#≡ ◦ ENJOY
#≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
#≡ ● Requires:
#≡ ◦ Nothing Else
#≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
#≡ ● Description
#≡ ◦ A very customizable encyclopedia, put whatever you want
#≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
#≡ ● Compatibility & Glitches
#≡ ◦ None (known)
#≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
#≡ ● Script Calls
#≡ ◦ Use to call this scene!
#≡ SceneManager.call(Scene_CustEncyclopedia)
#≡ ◦ Use to create new entry
#≡ $game_party.add_entry(name, age, switch1, switch2, picture)
#≡ ◦ Use to create new title, subtitle and descriptions
#≡ $game_party.add_text(title, sub, desc1, etc.)
#≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
#Configuration
module SAKURABA
module CUSTENCYC
extend self
#Declaring Arrays, Do not touch!!!======================================
@entries = [] # Do not touch!!!
@text = [] # Do not touch!!!
#Adding Initial Encyclopedic Text Strings
#@text << [name,subname, line1, line2, line3, line4]
@text << ["Sakuraba" ,"Developer", "A talented Designer and developer,", "he have never finished a game.",
"Give credit if you use this script.", "Graphics go in Pictures Folder"]
@text << ["Seen Only", "Dumb Entry", "Description Line 1",
"Description Line 2", "Description Line 3", "Description Line 4" ]
@text << ["Not seen or obtained", "Dumb Entry", "Description Line 1",
"Description Line 2", "Description Line 3","Description Line 4" ]
# Adding Initial Encyclopedic Entries
#@entries << [string1, string2, switch1, switch2, Picture (192x192)]
@entries << ["Boy","18yo", 4001, 4002,"sakuraba"]
@entries << ["Unknown","", 4003, 4004,"Hero_m"]
@entries << ["Unknown","", 4005, 4006,"Hero_m"]
#Other Settings
TITLE = "Sakuraba's Custom Encyclopedia" #Title of The Encyclopedia
BCKMODE = false #Use background instead of window skin
TXTITL = "Skills: " #Title for texts of the entry
LN3TTL = "Additional Info: " #Title for the Descrition Lines 3 & 4
NOTICON = 238 #Icon for unknown entries
SEENICO = 237 #Icon for only seen entries
GOTICON = 234 #Icon for entries with known data
UNSNTXT = "???" #Text for unknown entries
NILDESC = "No Data" #Text for entries with known data
attr_accessor :entry_index
end
end
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
#≡ ● DANGER LINE!!! ◦Edit below ONLY if you know what you're doing!
class Game_Party
alias :kyon_sak_cust_enc_gm_pty_init :initialize
def initialize
kyon_sak_cust_enc_gm_pty_init
@entries = SAKURABA::CUSTENCYC.entries.dup
@text = SAKURABA::CUSTENCYC.text.dup
end
def add_entry(name, age, sw1, sw2, pic)
@entries << [name, age, sw1, sw2, pic]
end
def add_text(s1, s2, *desc)
@text << [s1, s2] + desc
end
attr_accessor :entries, :text
end
#≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
#≡ ● Scene_CustEncyclopedia
#≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
class Scene_CustEncyclopedia < Scene_MenuBase
#≡ Start Processing
def start
super
create_titlewindow
create_entrylist
create_datawindows
if SAKURABA::CUSTENCYC::BCKMODE
create_thebackground
@ttlwndw.opacity = 0
@ntrylst.opacity = 0
@ntrywnd.opacity = 0
@ntrydsc.opacity = 0
end
end
#≡ Create Title Window
def create_titlewindow
@ttlwndw = Sakuraba_Titlewindow.new(0, 0, 544, 50)
@ttlwndw.viewport = @viewport
end
#≡ Create Entrylist
def create_entrylist
@ntrylst = Sakuraba_Entrylist.new(0, 50, 170, 366)
@ntrylst.viewport = @viewport
@ntrylst.activate
@ntrylst.set_handler(:cancel, method(:return_scene))
SAKURABA::CUSTENCYC.entry_index = @ntrylst.index
end
#≡ Create Datawindows
def create_datawindows
@ntrywnd = Sakuraba_Entrywindow1.new(170, 50, 374, 192)
@ntrywnd.viewport = @viewport
@ntrydsc = Sakuraba_Entrywindow2.new(170, 242, 374, 174)
@ntrydsc.viewport = @viewport
end
def create_thebackground
@background_sprite = Sprite.new
@background_sprite.bitmap = Cache.picture("Back")
end
end
#≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
#≡ ● Sakuraba_Titlewindow
#≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
class Sakuraba_Titlewindow < Window_Base
#≡ initialize
def initialize( x, y, window_width, window_height)
super
refresh
end
#≡ refresh
def refresh
contents.clear
draw_text_ex(0, 0, SAKURABA::CUSTENCYC::TITLE)
end
end
#≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
#≡ ● Sakuraba_Entrylist
#≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
class Sakuraba_Entrylist < Window_Selectable
include SAKURABA::CUSTENCYC
def initialize( x, y, window_width, window_height)
super
@data = []
refresh
select(0)
end
def item_max() @data ? @data.size : 1 end
def item() @data && index >= 0 ? @data[index] : nil end
def make_item_list
@data = $game_party.entries
@text = $game_party.text
end
def draw_item(index)
item = @data[index]
verify = @data[index][2]
rect = item_rect(index)
if $game_switches[verify]
draw_text(32, rect.y, 200, line_height, @text[index][0])
obtained = @data[index][3]
if $game_switches[obtained]
draw_icon(GOTICON, 4, rect.y)
else
draw_icon(SEENICO, 4, rect.y)
end
else
draw_text(32, rect.y, 200, line_height, UNSNTXT)
draw_icon(NOTICON, 4, rect.y)
end
end
def refresh
make_item_list
create_contents
draw_all_items
end
def update
process_cursor_move
process_handling
end
def process_cursor_move
return unless cursor_movable?
last_index = @index
cursor_down (Input.trigger?(:DOWN)) if Input.repeat?(:DOWN)
cursor_up (Input.trigger?(:UP)) if Input.repeat?(:UP)
cursor_right(Input.trigger?(:RIGHT)) if Input.repeat?(:RIGHT)
cursor_left (Input.trigger?(:LEFT)) if Input.repeat?(:LEFT)
cursor_pagedown if !handle?(:pagedown) && Input.trigger?(:R)
cursor_pageup if !handle?(:pageup) && Input.trigger?(:L)
Sound.play_cursor if @index != last_index
SAKURABA::CUSTENCYC.entry_index = @index #@data[index]
end
end
#≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
#≡ ● Sakuraba_Entrywindow1
#≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
class Sakuraba_Entrywindow1 < Window_Base
include SAKURABA::CUSTENCYC
#≡ initialize
def initialize( x, y, window_width, window_height)
super
@entries = $game_party.entries
@text = $game_party.text
update
end
#≡ refresh
def update
contents.clear
pos = SAKURABA::CUSTENCYC.entry_index
entry = @entries[pos]
text = @text[pos]
bitmap = Cache.picture(entry[4])
rect = Rect.new(0, 0, 192, 192)
unless $game_switches[entry[2]]
contents.fill_rect(rect, pending_color)
else
if $game_switches[entry[3]]
contents.blt(-2, -2, bitmap, rect, 255)
else
contents.blt(-2, -2, bitmap, rect, 127)
end
end
if $game_switches[entry[3]]
change_color(system_color)
draw_text(192,0,152,30,text[0])
change_color(normal_color)
draw_text(192,40,152,30,text[1])
change_color(system_color)
draw_text(192,80,152,30,TXTITL)
change_color(normal_color)
draw_text(192,105,152,30,entry[0] + " / " + entry[1])
elsif $game_switches[entry[2]]
draw_text(192,0,152,30,text[0])
draw_text(192,40,152,30,UNSNTXT)
change_color(system_color)
draw_text(192,80,152,30,TXTITL)
change_color(normal_color)
draw_text(192,105,152,30,UNSNTXT + " / " + UNSNTXT)
else
end
end
end
#≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
#≡ ● Sakuraba_Entrywindow2
#≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
class Sakuraba_Entrywindow2 < Window_Base
include SAKURABA::CUSTENCYC
#≡ initialize
def initialize( x, y, window_width, window_height)
super
@entries = $game_party.entries
@text = $game_party.text
update
end
#≡ refresh
def update
contents.clear
pos = SAKURABA::CUSTENCYC.entry_index
entry = @entries[pos]
text = @text[pos]
if $game_switches[entry[3]]
draw_text(1,0,350,30,text[2])
draw_text(1,25,350,30,text[3])
change_color(system_color)
draw_text(1,65,350,30,LN3TTL)
change_color(normal_color)
draw_text(1,90,350,30,text[4])
draw_text(1,115,350,30,text[5])
else
draw_text(1,0,350,30,NILDESC)
end
end
end