-
-
Save syureri/9a869d07c25574c99594ef6d33cb053d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
# βΌ Nova Encyclopedia | |
# Autor: Alisson | |
# VersΓ£o: 1.3 | |
# Data: 26/08/2016 | |
#ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
#-------------------------------------------------------------------------- | |
# βΌ HistΓ³rico | |
#-------------------------------------------------------------------------- | |
# v1.3. Seleção de Categorias adicionada. Instruçáes atualizadas. | |
# v1.2. Compatibilidade com resoluçáes maiores. Liberado. | |
# v1.0. Limpeza de cΓ³digo. | |
# v0.5. Correção de bugs. | |
# v0.1. Criado. | |
#-------------------------------------------------------------------------- | |
# βΌ Termos de Uso | |
#-------------------------------------------------------------------------- | |
# Livre para uso comercial. Ficaria agradecido se entrasse em contato | |
# comigo para avisar. | |
# VocΓͺ pode alterar este sistema para uso prΓ³prio. | |
# VocΓͺ nΓ£o pode postar o sistema diretamente em outro lugar. | |
# Caso poste, redirecione o usuΓ‘rio para o tΓ³pico original do sistema. | |
# CrΓ©ditos nΓ£o sΓ£o necessΓ‘rios, mas seriam apreciados. | |
# | |
# Para mais informaçáes: centrorpg.com | |
#-------------------------------------------------------------------------- | |
# ⼠Introdução | |
#-------------------------------------------------------------------------- | |
# Este Γ© um sistema de enciclopΓ©dia inspirado em Megadimension Neptunia VII | |
# da Idea Factory. | |
# Ele permite que vocΓͺ faΓ§a uma lista de tΓ³picos com informaçáes sobre | |
# um determinado lugar, personagem, monstro, conquista, o que vocΓͺ quiser. | |
# As possibilidades de uso dependem de vocΓͺ. FaΓ§a sua enciclopΓ©dia. | |
#-------------------------------------------------------------------------- | |
# ⼠Instruçáes | |
#-------------------------------------------------------------------------- | |
# Primeiramente crie uma pasta em Graphics chamada Info. | |
# Γ lΓ‘ que ficarΓ£o guardadas as imagens que serΓ£o utilizadas pelo sistema. | |
# HaverΓ‘ um modelo em *psd (Photoshop Document) junto com algumas imagens | |
# de exemplo nesta demo caso vocΓͺ queira utilizar. | |
# | |
# Nas configuraçáes normais vocΓͺ pode customizar algumas opçáes bΓ‘sicas. | |
# Se quiser configurar mais a fundo o sistema, vÑ nas configuraçáes | |
# avançadas. | |
# | |
# Na Γ‘rea de Adição de TΓ³picos, vocΓͺ poderΓ‘ adicionar os tΓ³picos da | |
# sua enciclopΓ©dia como preferir. Pode adicionar quantos quiser. | |
# Siga as instruçáes de lÑ para entender com mais detalhes. | |
# Para chamar a scene em qualquer lugar, use um comando de Chamar Script | |
# e insira o seguinte: SceneManager.call(Nova_CategoryCommand) | |
#ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
module Nova_Encyclopedia | |
#ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
# β - Configuração - Normal - | |
#ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
# Nesta Γ‘rea vocΓͺ pode configurar as opçáes bΓ‘sicas do sistema e | |
# adicionar suas informaçáes. Se quiser configurar mais a fundo, | |
# vÑ para as configuraçáes avançadas. | |
#ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
# | |
# Configuração das imagens. Deixe "" se não quiser usar uma. | |
# Nota: A imagem de fundo irΓ‘ se esticar para preencher a tela. | |
# PorΓ©m as outras nΓ£o. | |
# Se vocΓͺ usar uma imagem menor que sua tela, ela irΓ‘ se esticar | |
# para preencher o quadro. | |
# Se vocΓͺ usar uma imagem maior que sua tela, ela irΓ‘ encolher | |
# para preencher o quadro tambΓ©m. | |
# Fique atento com a resolução do seu jogo para não haver | |
# perda de qualidade na imagem de fundo. | |
BACKGROUND_IMAGE = "Background" # Imagem de fundo. | |
INFO_BAR_IMAGE = "Info Bar" # Imagem de ajuda. | |
INFO_BOX_IMAGE = "Info Box" # Imagem da janela de texto. | |
COMMAND_BOX_IMAGE = "Command Box" # Imagem da janela de tΓ³picos. | |
CATEGORY_BG = "Background" # Imagem de fundo da seleção de categorias. | |
CT_HELP_BG = "Info Bar" # Imagem de ajuda das categorias. | |
CT_CMD_BG = "Command Box" # Imagem da janela de categorias. | |
# Texto de ajuda. Use \n caso queira pular uma linha. | |
HELP_TEXT = " Please select topic to check. Back" | |
# Texto de ajuda para a janela de categorias. | |
CT_HELP_TEXT = " Please select category to check. Back" | |
# As configuraçáes abaixo lhe permitem adicionar uma opção no menu | |
# padrΓ£o para acessar a enciclopΓ©dia. | |
COMMAND_IN_MENU = true # Adicionar comando ao menu? | |
COMMAND_CONDITIONAL_SWITCH = 0 # Switch necessΓ‘rio para acessar o comando. | |
# Deixe 0 se nΓ£o quiser nenhum. | |
COMMAND_NAME = "Encyclopedia" # Nome do comando | |
#ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
# β - Adição de Categorias - | |
#ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
# Aqui vocΓͺ poderΓ‘ criar suas categorias. As categorias servem para | |
# dividir as diferentes enciclopΓ©dias, entΓ£o se vocΓͺ quiser separar | |
# tudo por categorias, insira aqui usando o seguinte modelo: | |
# | |
# Nome da Categoria: O nome da categoria. Não deve conter espaços. | |
# | |
# :name : O nome de exibição da categoria. Este pode conter espaços. | |
# | |
# :switch_id : Switch necessÑrio para que a categoria apareça | |
# na lista. Deixe 0 se quiser que ela sempre apareça. | |
# | |
# :picture : A imagem que aparecerΓ‘ ao selecionar a categoria. | |
# Deixe "" se nΓ£o quiser nenhuma. | |
# | |
# "Nome da Categoria" => {:name => "Nome", :switch_id => 0}, # NΓ£o se esqueΓ§a da vΓrgula. | |
#ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
CATEGORIES = { # <= NΓ£o remova. | |
"World" => {:name => "World", :switch_id => 0, :picture => "World Category"}, | |
"Extra" => {:name => "Extra", :switch_id => 1, :picture => ""}, | |
} # <= NΓ£o remova. | |
#ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
# β - Adição de TΓ³picos - | |
#ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
# Aqui vocΓͺ poderΓ‘ adicionar seus prΓ³prios tΓ³picos Γ janela de | |
# seleção. Pode adicionar quantos quiser. | |
# O modelo de adição é o seguinte: | |
# | |
# Nome do Tópico: O nome que aparecerÑ na janela de seleção. | |
# | |
# :picture : Imagem que aparecerΓ‘ ao escolher o tΓ³pico. | |
# Deixe "" se nΓ£o quiser uma imagem. | |
# | |
# :information : Texto que aparecerÑ na janela de descrição. | |
# Use \n se quiser pular uma linha. | |
# Tipo assim: "Este Γ© o mundo.\nEle se chama..." | |
# Caso nΓ£o se sinta confortΓ‘vel usando esse estilo, | |
# vocΓͺ pode apenas pular uma linha pressionando Enter. | |
# (\n deixa mais organizado, por isso eu gosto ;-;) | |
# | |
# :switch_id : Switch necessÑrio para que o tópico apareça. | |
# Deixe 0 se quiser que ele sempre apareça. | |
# | |
# | |
# "Nome do TΓ³pico" => { :picture => "Imagem do TΓ³pico", | |
# :information => "Texto do TΓ³pico", | |
# :switch_id => 13, # Switch necessΓ‘rio | |
# | |
# # A categoria a qual este tΓ³pico pertence. | |
# Deve ser o mesmo nome configurado nas | |
# categorias sem espaço. Não é o nome de | |
# exibição, é o Nome da Categoria. Atenção nisso. | |
# | |
# :category => :Categoria | |
# | |
# }, # <= Mantenha isso. E lembre-se da vΓrgula. | |
# | |
# Nota: Caso vocΓͺ queira usar aspas no texto, use estas: βtextoβ | |
# As aspas normais ("") servem para indicar o inΓcio e o fim da | |
# string de texto, sendo assim vocΓͺ nΓ£o pode usar elas normalmente. | |
#ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
TOPICS = { # <= NΓ£o remova. | |
#------------------------------------------------------------------------- | |
# Nome do comando, Informaçáes. | |
"Gamindustri" => { :picture => "Gamindustri", | |
:information => "A world composed of four nations:\nPlaneptune, Lastation, Lowee and Leanbox.\nEach nation is presided by a CPU,\nwho gains strength from the people's faith.\nIn the past, Gamindustri was threatened\nby ASIC, the Deity of Sin, and the CPU of\nthe ancient nation of Tari.\nPeace exists thanks to the CPUs.", | |
:switch_id => 0, | |
:category => :World, | |
}, | |
# Nome do comando, Informaçáes. | |
"Platform Zero" => { :picture => "Platform Zero", | |
:information => "Umio named this world based on\nthe idea that Uzume may not be\naccepted by the people as a CPU;\nthe meaning behind the name\nbeing βa world without CPUs.β\nSynonymous with Zero Dimension.", | |
:switch_id => 1, | |
:category => :World, | |
}, | |
# Nome do comando, Informaçáes. | |
"Planeptune" => { :picture => "Planeptune", | |
:information => "An advanced nation in West Gamindustri\npresided over by CPU Purple Heart. It almost\nfaced destruction once, but was rebuilt with\nHistoire's guidance. Neptune's deficits in\nindustry and trading has almost led it to\nruin many times, but thanks to Histoire,\nNeptune now gains faith from the\ncitizens as a faithful leader.", | |
:switch_id => 0, | |
:category => :World, | |
}, | |
# Nome do comando, Informaçáes. | |
"Leanbox" => { :picture => "Leanbox", | |
:information => "A large nation on an island in southern\nGamindustri, presided by CPU Green Heart.\nAs Lastation is the closest nation, their\nexchange thrives despite their rivalry. It's\ncivilization looks a lot like Lastation's.\nWhen founded, it was focused on its\nmilitary, but under Vert's leadership,\nit has adopted a much more moe culture.", | |
:switch_id => 0, | |
:category => :World, | |
}, | |
# Nome do comando, Informaçáes. | |
"Lastation" => { :picture => "Lastation", | |
:information => "A nation located in Eastern Gamindustri,\npresided by CPU Black Heart. It's surrounded\nby three nations and is the center of trade in\nthe world. Its capital is also an important\ntrade city, as it's located to the coast.\nAlthough Leanbox treats Lastation as its\nrival, Lastation actually views its main\nrival as Planeptune.", | |
:switch_id => 0, | |
:category => :World, | |
}, | |
# Nome do comando, Informaçáes. | |
"Lowee" => { :picture => "Lowee", | |
:information => "A nation in Northern Gamindustri,\npresided by CPU White Heart.\nIt's incredibly cold there in the North.\nUnlike the other nations, magic is\nquite normal. It's the oldest nation\nof the four, and has had the most CPUs,\nhistorically speaking. Those retired CPUs are\nrumored to actually still reside in Lowee.", | |
:switch_id => 0, | |
:category => :World, | |
}, | |
# Nome do comando, Informaçáes. | |
"HDD" => { :picture => "HDD", | |
:information => "CPUs or Candidates can use the power\nof faith to transform into their HDD forms.\nThese forms boast tremendous fighting\npower, and this strength has saved\nGamindustri from danger many times.\n Its power is proportional to the\namount of faith people have in them.", | |
:switch_id => 1, | |
:category => :Extra, | |
}, | |
# Nome do comando, Informaçáes. | |
"Oracles" => { :picture => "Oracles", | |
:information => "The leaders of each nation's Basilicom\nwho serves the CPUs. There are different\nconditions for each nation to become an\nOracle. Planeptune's Oracle, Histoire, is\nan artificial being created by an Ancient\nCPU; she also has the role of recording\nPlaneptune's history.", | |
:switch_id => 1, | |
:category => :Extra, | |
}, | |
# Nome do comando, Informaçáes. | |
"AffimaX" => { :picture => "AffimaX", | |
:information => "An organization created by Affimojas\nand Steamax. The name is taken from\ntheir own, and its only called a\nβsecret organizationβ because it sounds\ncool. The original objective was to\nsecretly make pocket money on an\naffiliate blog, but Kurome noticed their\nambition and took advantage of it.", | |
:switch_id => 1, | |
:category => :Extra, | |
}, | |
# Nome do comando, Informaçáes. | |
"4 Goddesses Online 2" => { :picture => "4 Goddesses Online 2", | |
:information => "The super popular sequel to the MMORPG,\n4 Goddesses Online. It has the most MMO\nshares in Gamindustri. Vert is addicted to\nthis game, and she owns several high-power\ncharacters ranked top 10 in Leanbox's\nservers. Her Rune Knight ββ Green_Heartβ β is\nknown as one of the strongest. The amount\nof money she's paid is immensurable.", | |
:switch_id => 1, | |
:category => :Extra, | |
}, | |
# Nome do comando, Informaçáes. | |
"Dark CPU" => { :picture => "Dark CPU", | |
:information => "A monsterous existence that easily\ntowers over buildings. Because\nplaces attacked by the Dark CPU\nbecome nothingness, the world\nitself is facing a crisis of life or death.", | |
:switch_id => 1, | |
:category => :Extra, | |
}, | |
# Nome do comando, Informaçáes. | |
"Gold Third" => { :picture => "Gold Third", | |
:information => "The group consisting of S-Sha, C-Sha,\nK-Sha and B-Sha; they replaced the CPUs\nas the rulers of Gamindustri. This legend\nwas passed down in the past, indicating\nthey existed in the past: βWearing golden\narmor, he shall stand in Gamindustri.\nFinding the lost people's bonds, he will\nfinally lead them to the golden summit.β", | |
:switch_id => 1, | |
:category => :Extra, | |
}, | |
# Nome do comando, Informaçáes. | |
"Hyper Share Crystal" => { :picture => "Hyper Share Crystal", | |
:information => "A Share Crystal formed with the\naddition of the Gold Crystals. It\nholds the faith of both the CPUs\nand Gold Third, and helps the\nCPUs activate their Next Forms.", | |
:switch_id => 1, | |
:category => :Extra, | |
}, | |
# Nome do comando, Informaçáes. | |
"Next Form" => { :picture => "Next Form", | |
:information => "The new, Next-Gen form of the CPUs\nawoke to using the Hyper Share\nCrystal. No HDD up 'til now held\nthis level of power. Not only have\ntheir weapons been upgraded for\nNext Form use, but their processor\nunits have various attack gimmicks\nincorporated into them, too.", | |
:switch_id => 1, | |
:category => :Extra, | |
}, | |
# Nome do comando, Informaçáes. | |
"Flag" => { :picture => "", | |
:information => "The term βFlags,β from their use as\nlandmarks, is used in programming\nto mean a requirement to process\nan action. If the requirement's\ncleared, one says βthe flag is trueβ\nor βthe flag's been raised.β When\nit's not met, one says βa false\nflag falls.β", | |
:switch_id => 1, | |
:category => :Extra, | |
}, | |
# Nome do comando, Informaçáes. | |
"Hyper Dimension" => { :picture => "Hyper Dimension", | |
:information => "The world of Gamindustri where Neptune\nand the others live. Neither the CPUs nor\nthe people know why it's called βHyper,β\nbut it has been called so since long ago.", | |
:switch_id => 1, | |
:category => :World, | |
}, | |
# Nome do comando, Informaçáes. | |
"Zero Dimension" => { :picture => "Zero Dimension", | |
:information => "The ruined world Neptune and Nepgear\nfell into. Uzume and the monsters are\nthe only inhabitants as there are no\nhumans living there. It is called Zero\nDimension as it has been reduced\nto nothing.", | |
:switch_id => 1, | |
:category => :World, | |
}, | |
# Nome do comando, Informaçáes. | |
"Heart Dimension" => { :picture => "Heart Dimension", | |
:information => "The world created inside the heart\nof a sealed and sleeping Uzume.\nHer nightmare of having almost\ndestroyed Gamindustri acts as the\nbase for its creation. The Zero Dimension\nturned out to be part of this world.", | |
:switch_id => 1, | |
:category => :World, | |
}, | |
} # <= NΓ£o remova. | |
#ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
# β - Configuração - AvanΓ§ado(mas nem tanto) - | |
#ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
# Aqui ficam as configuraçáes avançadas. Para os jÑ acostumados. | |
# Se vocΓͺ nΓ£o tem ideia do que essas coisas sejam, nΓ£o precisa alterar | |
# nada. Mas se ainda assim quiser alterar por curiosidade, sinta-se | |
# Γ vontade. Caso vocΓͺ tenha alterado algum valor por engano, basta ver | |
# o valor padrão de cada opção. | |
#ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
# Opacidade das janelas. Caso vocΓͺ queira usar janelas ao invΓ©s de | |
# imagens, nΓ£o insira nenhuma imagem e altere a opacidade das janelas | |
# aqui. | |
# 0 = Transparente(PadrΓ£o), 255 = Completamente visΓvel | |
COMMAND_WINDOW_OPACITY = 0 # Opacidade da Janela de Comandos. | |
HELP_WINDOW_OPACITY = 0 # Opacidade da Janela de Ajuda. | |
INFORMATION_WINDOW_OPACITY = 0 # Opacidade da Janela de Informação. | |
CATEGORY_OPACITY = 0 # Opacidade da Janela de Categorias. | |
HELP_OPACITY = 0 # Opacidade da Janela de Ajuda das Categorias. | |
# Configuração da fonte da janela de informaçáes. | |
INFO_WINDOW_FONT_SIZE = 18 # Tamanho da fonte. PadrΓ£o = 18 | |
INFO_WINDOW_FONT_OUTLINE = false # Outline da fonte. PadrΓ£o = false | |
# Cor da fonte: Color.new(Vermelho, Verde, Azul, Opacidade) | |
# 0, 0, 0, 255 = Completamente preto. PadrΓ£o. | |
# 255, 255, 255, 255 = Completamente branco. | |
INFO_WINDOW_FONT_COLOR = Color.new(0, 0, 0, 255) | |
# Configuração da windowskin das janelas. | |
# PadrΓ£o: "Window" | |
COMMAND_WINDOW_SKIN = "Window" | |
HELP_WINDOW_SKIN = "Window" | |
INFORMATION_WINDOW_SKIN = "Window" | |
end # Nova_Encyclopedia | |
#============================================================================== | |
# ⼠- Fim das Configuraçáes - | |
# Editar qualquer coisa apΓ³s aqui pode acabar causando problemas no cΓ³digo, | |
# falha no sistema, problemas mentais, dor de cabeça, perda de saves, | |
# sacrifΓcios de Yoshis, mortes de galinhas, bad endings, enfrentar 2 | |
# bosses seguidos sem heal, desperdΓcio de itens em uma batalha com perda | |
# obrigatΓ³ria e incompatibilidade. | |
#============================================================================== | |
#ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
# β Cache | |
#ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
module Cache | |
#-------------------------------------------------------------------------- | |
# β Info | |
#-------------------------------------------------------------------------- | |
def self.info(filename) | |
load_bitmap("Graphics/Info/", filename) | |
end | |
end | |
#ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
# β Scene_NOVA | |
#ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
class Scene_NOVA < Scene_Base | |
include Nova_Encyclopedia | |
#-------------------------------------------------------------------------- | |
# β Start | |
#-------------------------------------------------------------------------- | |
def start | |
super | |
create_all_windows | |
create_background | |
create_info_bar | |
create_info_box | |
create_command_box | |
@actual_selection | |
@actual_sprite | |
end | |
#-------------------------------------------------------------------------- | |
# β Update | |
#-------------------------------------------------------------------------- | |
def update | |
super | |
update_nova_info_sprite | |
update_nova_info_text | |
return_scene && Sound.play_cancel if Input.trigger?(:B) | |
end | |
#-------------------------------------------------------------------------- | |
# β Terminate | |
#-------------------------------------------------------------------------- | |
def terminate | |
@nova_help_window.dispose | |
@nova_info_window.dispose | |
@nova_topic_window.dispose | |
@nova_topic_info_bar.bitmap.dispose | |
@nova_topic_info_bar.dispose | |
@nova_topic_info_box.bitmap.dispose | |
@nova_topic_info_box.dispose | |
@nova_topic_box.bitmap.dispose | |
@nova_topic_box.dispose | |
@nova_info_sprite.dispose if @nova_info_sprite | |
@nova_info_sprite.bitmap.dispose if @nova_info_sprite.bitmap | |
@nova_encyclopedia_background.bitmap.dispose | |
@nova_encyclopedia_background.dispose | |
super | |
end | |
#-------------------------------------------------------------------------- | |
# β Return Scene | |
#-------------------------------------------------------------------------- | |
def return_scene | |
Graphics.freeze | |
SceneManager.return | |
end | |
#-------------------------------------------------------------------------- | |
# β Create All Windows | |
#-------------------------------------------------------------------------- | |
def create_all_windows | |
create_nova_help_window | |
create_nova_info_window | |
create_nova_topic_window | |
create_nova_info_sprite | |
end | |
#-------------------------------------------------------------------------- | |
# β Create Nova Help Window | |
#-------------------------------------------------------------------------- | |
def create_nova_help_window | |
@nova_help_window = NOVA_HelpWindow.new | |
@nova_help_window.y = Graphics.height - @nova_help_window.height | |
@nova_help_window.opacity = HELP_WINDOW_OPACITY | |
@nova_help_window.width = Graphics.width | |
@nova_help_window.draw_text_ex(0, 0, HELP_TEXT) | |
end | |
#-------------------------------------------------------------------------- | |
# β Create Nova Info Window | |
#-------------------------------------------------------------------------- | |
def create_nova_info_window | |
@nova_info_window = NOVA_InfoWindow.new | |
@nova_info_window.width = Graphics.width * 0.6 | |
@nova_info_window.opacity = INFORMATION_WINDOW_OPACITY | |
@nova_info_window.height = Graphics.height * 0.7 - @nova_help_window.height * 0.85 | |
@nova_info_window.x = Graphics.width * 0.4 | |
@nova_info_window.y = Graphics.height * 0.3 - 10 | |
end | |
#-------------------------------------------------------------------------- | |
# β Create Nova Command Window | |
#-------------------------------------------------------------------------- | |
def create_nova_topic_window | |
@nova_topic_window = NOVA_CommandWindow.new(0, 0) | |
@nova_topic_window.opacity = COMMAND_WINDOW_OPACITY | |
@nova_topic_window.height = Graphics.height - @nova_help_window.height | |
end | |
#-------------------------------------------------------------------------- | |
# β Create Background | |
#-------------------------------------------------------------------------- | |
def create_background | |
@nova_encyclopedia_background = Sprite.new | |
if Nova_Encyclopedia::BACKGROUND_IMAGE == "" | |
@nova_encyclopedia_background.bitmap = SceneManager.background_bitmap | |
@nova_encyclopedia_background.color.set(16, 16, 16, 128) | |
else | |
@nova_encyclopedia_background.bitmap = Cache.info(BACKGROUND_IMAGE) | |
end | |
@nova_encyclopedia_background.zoom_x = Graphics.width.to_f / @nova_encyclopedia_background.bitmap.width | |
@nova_encyclopedia_background.zoom_y = Graphics.height.to_f / @nova_encyclopedia_background.bitmap.height | |
end | |
#-------------------------------------------------------------------------- | |
# β Create Info Bar | |
#-------------------------------------------------------------------------- | |
def create_info_bar | |
@nova_topic_info_bar = Sprite.new | |
@nova_topic_info_bar.bitmap = Cache.info(INFO_BAR_IMAGE) | |
@nova_topic_info_bar.y = @nova_help_window.y + 7 | |
end | |
#-------------------------------------------------------------------------- | |
# β Create Info Box | |
#-------------------------------------------------------------------------- | |
def create_info_box | |
@nova_topic_info_box = Sprite.new | |
@nova_topic_info_box.bitmap = Cache.info(INFO_BOX_IMAGE) | |
@nova_topic_info_box.y = @nova_info_window.y | |
@nova_topic_info_box.x = @nova_info_window.x | |
end | |
#-------------------------------------------------------------------------- | |
# β Create Command Box | |
#-------------------------------------------------------------------------- | |
def create_command_box | |
@nova_topic_box = Sprite.new | |
@nova_topic_box.bitmap = Cache.info(COMMAND_BOX_IMAGE) | |
@nova_topic_box.y = @nova_topic_window.y | |
@nova_topic_box.x = @nova_topic_window.x | |
end | |
#-------------------------------------------------------------------------- | |
# β Create Nova Info Sprite | |
#-------------------------------------------------------------------------- | |
def create_nova_info_sprite | |
@nova_info_sprite = Sprite.new | |
@nova_info_sprite.z = 300 | |
@nova_info_sprite.x = Graphics.width * 0.55 | |
@nova_info_sprite.y = Graphics.height.to_f * 0.05 | |
@nova_info_sprite.visible = true | |
update_nova_info_sprite | |
update_nova_info_text | |
end | |
#-------------------------------------------------------------------------- | |
# β Update Nova Info Sprite | |
#-------------------------------------------------------------------------- | |
def update_nova_info_sprite | |
if @actual_sprite != @nova_topic_window.current_symbol | |
@actual_sprite = @nova_topic_window.current_symbol | |
@picture = TOPICS[@actual_sprite.to_s][:picture] | |
@nova_info_sprite.bitmap = Cache.info(@picture) unless !@picture | |
end | |
end | |
#-------------------------------------------------------------------------- | |
# β Update Nova Info Text | |
#-------------------------------------------------------------------------- | |
def update_nova_info_text | |
if @actual_selection != @nova_topic_window.current_symbol | |
@actual_selection = @nova_topic_window.current_symbol | |
@text = TOPICS[@actual_selection.to_s][:information] | |
@nova_info_window.create_info_text(@text) | |
end | |
end | |
end | |
#ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
# β NOVA_HelpWindow | |
#ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
class NOVA_HelpWindow < Window_Help | |
include Nova_Encyclopedia | |
#-------------------------------------------------------------------------- | |
# β Initialize | |
#-------------------------------------------------------------------------- | |
def initialize | |
super | |
self.windowskin = Cache.system(HELP_WINDOW_SKIN) | |
end | |
end | |
#ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
# β NOVA_InfoWindow | |
#ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
class NOVA_InfoWindow < Window_ScrollText | |
include Nova_Encyclopedia | |
#-------------------------------------------------------------------------- | |
# β Initialize | |
#-------------------------------------------------------------------------- | |
def initialize | |
super | |
self.windowskin = Cache.system(INFORMATION_WINDOW_SKIN) | |
self.opacity = 255 | |
show | |
end | |
#-------------------------------------------------------------------------- | |
# β Create Info Text | |
#-------------------------------------------------------------------------- | |
def create_info_text(text) | |
contents.clear | |
draw_text_ex(0, 0, text) | |
end | |
#-------------------------------------------------------------------------- | |
# β Reset Font Settings | |
#-------------------------------------------------------------------------- | |
def reset_font_settings | |
contents.font.size = INFO_WINDOW_FONT_SIZE | |
contents.font.color = INFO_WINDOW_FONT_COLOR | |
contents.font.outline = INFO_WINDOW_FONT_OUTLINE | |
end | |
end | |
#ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
# β NOVA_CommandWindow | |
#ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
class NOVA_CommandWindow < Window_Command | |
include Nova_Encyclopedia | |
#-------------------------------------------------------------------------- | |
# β Initialize | |
#-------------------------------------------------------------------------- | |
def initialize(x, y) | |
super | |
self.windowskin = Cache.system(COMMAND_WINDOW_SKIN) | |
end | |
#-------------------------------------------------------------------------- | |
# β Window Width | |
#-------------------------------------------------------------------------- | |
def window_width | |
return Graphics.width * 0.4 | |
end | |
#-------------------------------------------------------------------------- | |
# β Ok Enabled? | |
#-------------------------------------------------------------------------- | |
def ok_enabled? | |
return false | |
end | |
#-------------------------------------------------------------------------- | |
# β Make Command List | |
#-------------------------------------------------------------------------- | |
def make_command_list | |
TOPICS.each_key do |coll_name| | |
switch_id = TOPICS[coll_name][:switch_id] | |
next unless $game_switches[switch_id] || switch_id == 0 | |
next if $game_temp.ency_curr_cat != TOPICS[coll_name][:category] | |
add_command(coll_name, coll_name.to_sym) | |
end | |
end | |
end | |
#ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
# β Window_MenuCommand | |
#ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
class Window_MenuCommand < Window_Command | |
#-------------------------------------------------------------------------- | |
# β Add Main Commands | |
#-------------------------------------------------------------------------- | |
alias nova_main_commands add_main_commands | |
def add_main_commands | |
nova_main_commands | |
add_command(Nova_Encyclopedia::COMMAND_NAME, :Nova_Encyclopedia, nova_conditional_switch) if Nova_Encyclopedia::COMMAND_IN_MENU | |
end | |
#-------------------------------------------------------------------------- | |
# β Nova Conditional Switch | |
#-------------------------------------------------------------------------- | |
def nova_conditional_switch | |
if Nova_Encyclopedia::COMMAND_CONDITIONAL_SWITCH == 0 | |
return true | |
else | |
return $game_switches[Nova_Encyclopedia::COMMAND_CONDITIONAL_SWITCH] | |
end | |
end | |
end | |
#ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
# β Scene_Menu | |
#ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
class Scene_Menu < Scene_MenuBase | |
#-------------------------------------------------------------------------- | |
# β Create Command Window | |
#-------------------------------------------------------------------------- | |
alias nova_set_handler create_command_window | |
def create_command_window | |
nova_set_handler | |
@command_window.set_handler(:Nova_Encyclopedia, method(:collection_command)) if Nova_Encyclopedia::COMMAND_IN_MENU | |
end | |
#-------------------------------------------------------------------------- | |
# β Collection Command | |
#-------------------------------------------------------------------------- | |
def collection_command | |
SceneManager.call(Nova_CategoryCommand) | |
end | |
end | |
#ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
# β Nova_Category | |
#ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
class Nova_Category < Window_Command | |
include Nova_Encyclopedia | |
#-------------------------------------------------------------------------- | |
# β Initialize | |
#-------------------------------------------------------------------------- | |
def initialize(x, y) | |
super | |
end | |
#-------------------------------------------------------------------------- | |
# β Window Width | |
#-------------------------------------------------------------------------- | |
def window_width | |
return Graphics.width * 0.4 | |
end | |
#-------------------------------------------------------------------------- | |
# β Make Command List | |
#-------------------------------------------------------------------------- | |
def make_command_list | |
CATEGORIES.each_key do |cat_name| | |
switch_id = CATEGORIES[cat_name][:switch_id] | |
next unless $game_switches[switch_id] || switch_id == 0 | |
add_command(CATEGORIES[cat_name][:name], cat_name.to_sym) | |
end | |
end | |
end | |
#ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
# β Nova_CategoryCommand | |
#ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
class Nova_CategoryCommand < Scene_Base | |
include Nova_Encyclopedia | |
#-------------------------------------------------------------------------- | |
# β Start | |
#-------------------------------------------------------------------------- | |
def start | |
super | |
exec_bg | |
exec_help | |
exec_category | |
exec_category_box | |
exec_help_bar | |
@actual_cat_sprite = nil | |
exec_category_info_sprite | |
end | |
#-------------------------------------------------------------------------- | |
# β Post Start | |
#-------------------------------------------------------------------------- | |
def post_start | |
super | |
end | |
#-------------------------------------------------------------------------- | |
# β Exec BG | |
#-------------------------------------------------------------------------- | |
def exec_bg | |
@nova_category_bg = Sprite.new | |
if Nova_Encyclopedia::CATEGORY_BG == "" | |
@nova_category_bg.bitmap = SceneManager.background_bitmap | |
@nova_category_bg.color.set(16, 16, 16, 128) | |
else | |
@nova_category_bg.bitmap = Cache.info(CATEGORY_BG) | |
end | |
@nova_category_bg.zoom_x = Graphics.width.to_f / @nova_category_bg.bitmap.width | |
@nova_category_bg.zoom_y = Graphics.height.to_f / @nova_category_bg.bitmap.height | |
end | |
#-------------------------------------------------------------------------- | |
# β Exec Help | |
#-------------------------------------------------------------------------- | |
def exec_help | |
@nova_cat_help = NOVA_HelpWindow.new | |
@nova_cat_help.y = Graphics.height - @nova_cat_help.height | |
@nova_cat_help.opacity = HELP_OPACITY | |
@nova_cat_help.width = Graphics.width | |
@nova_cat_help.draw_text_ex(0, 0, CT_HELP_TEXT) | |
end | |
#-------------------------------------------------------------------------- | |
# β Exec Category | |
#-------------------------------------------------------------------------- | |
def exec_category | |
@nova_category_cmd = Nova_Category.new(0, 0) | |
@nova_category_cmd.opacity = CATEGORY_OPACITY | |
@nova_category_cmd.height = Graphics.height - @nova_cat_help.height | |
CATEGORIES.each_key do |cat_n| | |
@nova_category_cmd.set_handler(cat_n.to_sym, method(:on_cat_confirm)) | |
end | |
end | |
#-------------------------------------------------------------------------- | |
# β Exec Category Box | |
#-------------------------------------------------------------------------- | |
def exec_category_box | |
@nova_category_box = Sprite.new | |
@nova_category_box.bitmap = Cache.info(CT_CMD_BG) | |
@nova_category_box.y = @nova_category_cmd.y | |
@nova_category_box.x = @nova_category_cmd.x | |
end | |
#-------------------------------------------------------------------------- | |
# β Exec Help Bar | |
#-------------------------------------------------------------------------- | |
def exec_help_bar | |
@nova_cat_help_bar = Sprite.new | |
@nova_cat_help_bar.bitmap = Cache.info(CT_HELP_BG) | |
@nova_cat_help_bar.y = @nova_cat_help.y + 7 | |
@nova_cat_help_bar.x = @nova_cat_help.x | |
end | |
def exec_category_info_sprite | |
@nova_cat_info_sprite = Sprite.new | |
@nova_cat_info_sprite.z = 300 | |
@nova_cat_info_sprite.x = 0 | |
@nova_cat_info_sprite.y = 0 | |
@nova_cat_info_sprite.visible = true | |
update_nova_cat_info_sprite | |
end | |
def update_nova_cat_info_sprite | |
if @actual_cat_sprite != @nova_category_cmd.current_symbol | |
@actual_cat_sprite = @nova_category_cmd.current_symbol | |
@sprite = CATEGORIES[@actual_cat_sprite.to_s][:picture] | |
@nova_cat_info_sprite.bitmap = Cache.info(@sprite) unless !@sprite | |
end | |
end | |
#-------------------------------------------------------------------------- | |
# β On Cat Confirm | |
#-------------------------------------------------------------------------- | |
def on_cat_confirm | |
SceneManager.call(Scene_NOVA) | |
end | |
#-------------------------------------------------------------------------- | |
# β Update | |
#-------------------------------------------------------------------------- | |
def update | |
super | |
update_nova_cat_info_sprite | |
$game_temp.ency_curr_cat = @nova_category_cmd.current_symbol | |
return_scene && Sound.play_cancel if Input.trigger?(:B) | |
end | |
#-------------------------------------------------------------------------- | |
# β Update Basic | |
#-------------------------------------------------------------------------- | |
def update_basic | |
super | |
end | |
#-------------------------------------------------------------------------- | |
# β Pre Terminate | |
#-------------------------------------------------------------------------- | |
def pre_terminate | |
super | |
end | |
#-------------------------------------------------------------------------- | |
# β Terminate | |
#-------------------------------------------------------------------------- | |
def terminate | |
super | |
@nova_cat_help.dispose | |
@nova_category_cmd.dispose | |
@nova_category_box.bitmap.dispose | |
@nova_category_box.dispose | |
@nova_cat_help_bar.bitmap.dispose | |
@nova_cat_help_bar.dispose | |
@nova_cat_info_sprite.bitmap.dispose | |
@nova_cat_info_sprite.dispose | |
end | |
#-------------------------------------------------------------------------- | |
# β Return Scene | |
#-------------------------------------------------------------------------- | |
def return_scene | |
Graphics.freeze | |
SceneManager.return | |
end | |
end | |
#ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
# β Game_Temp | |
#ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
class Game_Temp | |
attr_accessor :ency_curr_cat | |
#-------------------------------------------------------------------------- | |
# β Initialize | |
#-------------------------------------------------------------------------- | |
alias nv_ency_init initialize | |
def initialize | |
nv_ency_init | |
@ency_curr_cat = :none | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment