Eu tava querendo um scene login diferente ai eu achei [KM] Scene_Login mas ta dando erro ta aqui o script:
Veja a imagem do erro:
E eu estou usando o netplay master v4.0.7
- Código:
#==============================================================================#
# » [KM] Scene_Login #
#==============================================================================#
# » Desenvolvido por Kadu Macedo #
# » Desenvolvido com base na Scene_Login do Marlos Gama #
# » Visite: www.aldeiarpgbr.forumeiros.com #
#==============================================================================#
module KDU
#Fundo da Scene (Deve estar dentro da pasta "Titles")
FUNDO_LOGIN = "Title"
#Mensagem de Servidor Online
SERVER_ON = "Servidor Ligado"
#Mensagem de Servidor Offline
SERVER_OFF = "Servidor Desligado"
#Botão de Login
BOT_LOGIN = " "
#Botão de Registrar
BOT_REGISTRO = " "
#Campo de Usuário
#Posição X
USER_X = 165
#Posição Y
USER_Y = 249
#Campo de Senha
#Posição X
PASS_X = 165
#Posição Y
PASS_Y = 277
#Botão Salvar Informações
#Posição X
SALV_X = 149
#Posição Y
SALV_Y = 298
#Mensagem de Salvar Informações
SALV_MSG = "Salvar Informações"
#Posição X da Mensagem
SMSG_X = 165
#Posição Y da Mensagem
SMSG_Y = 290
#Botão de Login
#Posição X
LOGIN_X = 295
#Posição Y
LOGIN_Y = 249
#Botão de Registro
#Posição X
REGISTRO_X = 295
#Posição Y
REGISTRO_Y = 275
#Status do Servidor
#Posição X
SERVER_X = 160
#Posição Y
SERVER_Y = 323
end
class Scene_Login
#--------------------------------------------------------------------------
# Main
#--------------------------------------------------------------------------
def main
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.title("Title.png")
@base_window = Window_Dummys.new(0, 0, 640, 480)
@base_window.windowskin = RPG::Cache.windowskin("Blank")
@base_window.dragable = false
@window_erro = Window_Dummys.new(200,165,235,90)#Window_Dummys5.new(180,150,250,80)
@window_erro.z = 9999
@window_erro.visible = false
@window_erro.active = false
@convite_button1 = Button.new(@window_erro,@window_erro.width/3+12, 55, " Ok ") {@window_erro.visible = false; @window_erro.active = false}
@window_erro.dragable = false
@window_erro.closable = true
#@window_erro.set_modt("aaa",0, -3)
main_data
if $servidor_off == true
@base_window.set_text7(KDU::SERVER_OFF,KDU::SERVER_X, KDU::SERVER_Y)
else
Network::Main.retrieve_mod if $game_temp.motd.to_s == "" or $game_temp.motd.to_s == LANGUAGE::NOMOTD
@base_window.set_text7(KDU::SERVER_ON,KDU::SERVER_X, KDU::SERVER_Y)
end
@user_window = $user_window_text
@user_window.x = KDU::USER_X
@user_window.y = KDU::USER_Y
@user_window.active = true
@pass_window = $pass_window_text
@pass_window.x = KDU::PASS_X
@pass_window.y = KDU::PASS_Y
@register_button = Button3.new(@base_window,156,76+12+27+25-5,KDU::BOT_REGISTRO) {register}
@register_button.x = KDU::REGISTRO_X
@register_button.y = KDU::REGISTRO_Y
@base_window.set_text6(KDU::SALV_MSG,KDU::SMSG_X, KDU::SMSG_Y)
@mainlogin_ckh = Check_Box.new(@base_window,16,116-24+27-5)
@mainlogin_ckh.x = KDU::SALV_X
@mainlogin_ckh.y = KDU::SALV_Y
@tempo = 0
if @user_window.text != ""
ativar_ckh
@user_window.active = false
@pass_window.active = true
end
@login_button = Button3.new(@base_window,156,76+12+27-5,KDU::BOT_LOGIN) {entrando}
@login_button.x = KDU::LOGIN_X
@login_button.y = KDU::LOGIN_Y
plusx = (640/2 - @base_window.width/2) - 100
@password = []
@user_name = []
Graphics.transition
if $servidor_off == true
else
Network::Main.retrieve_version
end
loop do
Network::Base.update
update
if $scene != self
break if main_scenechange?
end
end
Graphics.freeze
@sprite.dispose
@window_erro.dispose
@base_window.dispose
@login_button.dispose
@mainlogin_ckh.dispose
end
#--------------------------------------------------------------------------
# Salvar Conta
#--------------------------------------------------------------------------
def main_data
if FileTest.exist?("Account.rxdata")
@dati = []
file = File.open("Account.rxdata", "rb")
@dati = Marshal.load(file)
file.close
@user_name = []
@password = []
end
end
def ativar_ckh
@mainlogin_ckh.value = true
end
def main_scenechange?
if $scene != self
if @mainlogin_ckh.checked
@dati = []
@dati[0] = @base_window.username
@dati[1] = @base_window.password
file = File.open("Account.rxdata", "wb")
Marshal.dump(@dati,file)
file.close
end
return true
end
return false
end
def username
return @base_window.username
end
#--------------------------------------------------------------------------
# Update
#--------------------------------------------------------------------------
def update
@base_window.update
@window_erro.update
@login_button.update
if Input.pressed(Input::Mouse_Left) and @user_window.in_area?
@user_window.active = true
@pass_window.active = false
@pass_window.refresh
return
elsif Input.pressed(Input::Mouse_Left) and @pass_window.in_area?
@user_window.active = false
@pass_window.active = true
@user_window.refresh
end
if Input.trigger?(Input::Tab) or Input.trigger?(Input::DN) and @user_window.active == true
@user_window.active = false
@pass_window.active = true
@user_window.refresh
elsif Input.trigger?(Input::Tab) or Input.trigger?(Input::UPs) and @user_window.active == false
@user_window.active = true
@pass_window.active = false
@pass_window.refresh
return
end
if Graphics.frame_count / Graphics.frame_rate != @total_sec
@tempo += 1
end
if @tempo == 4 * 10
$mouse_active = false
@tempo = 0
end
if @login_update
login
return
end
end
#--------------------------------------------------------------------------
# Set Status Text
#--------------------------------------------------------------------------
def set_status(status)
@base_window.contents.clear
@base_window.set_text2(User_Edit::LOGIN_TITLE,125, 0)
#@base_window.set_text2(status, 25, 150)
if status != "Conectando ao Servidor..."
#@window_erro.contents.clear
@window_erro.visible = true
@window_erro.active = true
@window_erro.set_modt(status,0, -3)
end
@base_window.set_text4(USUARIO_NOME,10, 10+27)
@base_window.set_text5(SENHA_NOME,10,35+27)
@base_window.set_text6(LEMBRAR_NOME,22,66+27-5)
if $servidor_off == true
@base_window.set_text7(KDU::SERVER_OFF,KDU::SERVER_X, KDU::SERVER_Y)
else
Network::Main.retrieve_mod if $game_temp.motd.to_s == "" or $game_temp.motd.to_s == User_Edit::NOMOTD
@base_window.set_text7(KDU::SERVER_ON,KDU::SERVER_X, KDU::SERVER_Y)
@base_window.set_modt("#{$game_temp.motd}",18, 2)
end
end
def entrando
return if $mouse_active == true
if $mouse_active != true
if $servidor_off == true
@base_window.contents.clear
@base_window.set_text2(User_Edit::LOGIN_TITLE,125, 0)
#@window_erro.contents.clear
@window_erro.visible = true
@window_erro.active = true
@window_erro.set_modt("O servidor está offline!",0, -3)
#@base_window.set_text2(" Usuário Incorreto ou Logado.", 25, 150)
@base_window.set_text7(KDU::SERVER_OFF,KDU::SERVER_X, KDU::SERVER_Y)
#$game_system.se_play($data_system.decision_se)
$mouse_active = true
else
@user_window.active = false
@pass_window.active = false
@login_update = true
login
#$game_system.se_play($data_system.decision_se)
$mouse_active = true
return true
end
end
end
def register
return if $mouse_active == true
if $mouse_active != true
if $servidor_off == true
@base_window.contents.clear
@base_window.set_text2(User_Edit::LOGIN_TITLE,125, 0)
#@window_erro.contents.clear
@window_erro.visible = true
@window_erro.active = true
@window_erro.set_modt("O servidor está offline!",0, -3)
#@base_window.set_text2(" Nome de usuário já existe.", 25, 150)
@base_window.set_text7(KDU::SERVER_OFF,KDU::SERVER_X, KDU::SERVER_Y)
#$game_system.se_play($data_system.decision_se)
$mouse_active = true
else
if @pass_window.text != "" && @user_window.text != ""
if Network::Main.user_exist?(@base_window.username) == true
@base_window.contents.clear
@base_window.set_text2(User_Edit::LOGIN_TITLE,125, 0)
#@window_erro.contents.clear
@window_erro.visible = true
@window_erro.active = true
@window_erro.set_modt(User_Edit::REGISTER_DENIED,0, -3)
#@base_window.set_text2(User_Edit::REGISTER_DENIED, 25, 150)
#$game_system.se_play($data_system.decision_se)
$mouse_active = true
if $servidor_off == true
@base_window.set_text7(KDU::SERVER_OFF,KDU::SERVER_X, KDU::SERVER_Y)
else
Network::Main.retrieve_mod if $game_temp.motd.to_s == "" or $game_temp.motd.to_s == User_Edit::NOMOTD
@base_window.set_text7(KDU::SERVER_ON,KDU::SERVER_X, KDU::SERVER_Y)
@base_window.set_modt("#{$game_temp.motd}",18, 2)
end
else
Network::Main.send_register(@base_window.username , @base_window.password)
Network::Main.send_login(@base_window.username , @base_window.password)
@base_window.contents.clear
@base_window.set_text2(User_Edit::LOGIN_TITLE,125, 0)
#@base_window.set_text2(User_Edit::REGISTERED, 25, 150)
@base_window.set_text4(USUARIO_NOME,10, 10+27)
@base_window.set_text5(SENHA_NOME,10,35+27)
@base_window.set_text6(LEMBRAR_NOME,22,66+27-5)
#$game_system.se_play($data_system.decision_se)
$mouse_active = true
if $servidor_off == true
@base_window.set_text7(KDU::SERVER_OFF,KDU::SERVER_X, KDU::SERVER_Y)
else
Network::Main.retrieve_mod if $game_temp.motd.to_s == "" or $game_temp.motd.to_s == User_Edit::NOMOTD
@base_window.set_text7(KDU::SERVER_ON,KDU::SERVER_X, KDU::SERVER_Y)
@base_window.set_modt("#{$game_temp.motd}",18, 2)
end
end
else
@base_window.contents.clear
@base_window.set_text2(User_Edit::LOGIN_TITLE,125, 0)
#@window_erro.contents.clear
@window_erro.visible = true
@window_erro.active = true
@window_erro.set_modt(User_Edit::REGISTER_ERROR,0, -3)
#@base_window.set_text2(User_Edit::REGISTER_ERROR, 25, 150)
@base_window.set_text4(USUARIO_NOME,10, 10+27)
@base_window.set_text5(SENHA_NOME,10,35+27)
@base_window.set_text6(LEMBRAR_NOME,22,66+27-5)
#$game_system.se_play($data_system.decision_se)
$mouse_active = true
if $servidor_off == true
@base_window.set_text7(KDU::SERVER_OFF,KDU::SERVER_X, KDU::SERVER_Y)
else
Network::Main.retrieve_mod if $game_temp.motd.to_s == "" or $game_temp.motd.to_s == User_Edit::NOMOTD
@base_window.set_text7(KDU::SERVER_ON,KDU::SERVER_X, KDU::SERVER_Y)
@base_window.set_modt("#{$game_temp.motd}",18, 2)
end
end
end
end
end
#--------------------------------------------------------------------------
# Login
#--------------------------------------------------------------------------
def login
return if not @login_update
if @pass_window.text != "" && @user_window.text != ""
Network::Main.send_login(@base_window.username , @base_window.password)
@base_window.contents.clear
@base_window.set_text2(User_Edit::LOGIN_TITLE,125, 0)
#@base_window.set_text2(User_Edit::LOGIN_STATUS, 25, 150)
if $servidor_off == true
@base_window.set_text7(KDU::SERVER_OFF,KDU::SERVER_X, KDU::SERVER_Y)
else
Network::Main.retrieve_mod if $game_temp.motd.to_s == "" or $game_temp.motd.to_s == User_Edit::NOMOTD
@base_window.set_text7(KDU::SERVER_ON,KDU::SERVER_X, KDU::SERVER_Y)
@base_window.set_modt("#{$game_temp.motd}",18, 2)
end
@login_update = false
@cursor_pos = 1
else
@base_window.contents.clear
@base_window.set_text2(User_Edit::LOGIN_TITLE,125, 0)
#@window_erro.contents.clear
@window_erro.visible = true
@window_erro.active = true
@window_erro.set_modt(User_Edit::LOGIN_FILLERROR,0, -3)
#@base_window.set_text2(User_Edit::LOGIN_FILLERROR, 25, 150)
if $servidor_off == true
@base_window.set_text7(KDU::SERVER_OFF,KDU::SERVER_X, KDU::SERVER_Y)
else
Network::Main.retrieve_mod if $game_temp.motd.to_s == "" or $game_temp.motd.to_s == User_Edit::NOMOTD
@base_window.set_text7(KDU::SERVER_ON,KDU::SERVER_X, KDU::SERVER_Y)
@base_window.set_modt("#{$game_temp.motd}",18, 2)
end
@login_update = false
@cursor_pos = 1
end
end
end
Veja a imagem do erro:
E eu estou usando o netplay master v4.0.7