Ciao a tutti.... so ke richiedere la conversione di un script è sempre una rottura, ma ne avrei davvero bisogno....ho cercato ovunque ma non sono riuscito a trovarlo quindi spero ke un'animo gentile mi risponda...
Io ho provato a convertirlo ma con scarsi scarsissimi risultati.... please help me XD
Vi allego lo script del Phone System VX, a me servirebbe per XP ...
Molte grazie in anticipo
#############################################################################
#==================================================================#
# Name: Phone System 0.1BETA
# By: Necrozard
# Date: 19/07/08
#==================================================================#
#==================================================================#
# Description:
# The Phone allows you to receive SMS (Messages) from NPC when and where you want, just
# doing it in a easy way with "Call script".
# You can also Delete this messages, because in this version, the Message Box has a limit
# of 10 Messages. If you have the Message Box full, a notification will notice you what is
# happening until you delete a message.
#==================================================================#
# User Guide:
# All the commands next, have to be written in Call script.
#
# Allow the player open the Phone (Set the option in the Menu):
# Mod::ADD_MENU_OPTION = true/false
#
# Send a SMS (Message) to the player:
# Phone_Msg.new(title,autor,message)
#
# Open the phone In-Game:
# $scene = Phone.new
#
# Set the phone On-line (Common) or Off-line (You cant receive any message, for example
# in caves):
# $phone_online = true/false
#
# Set a phone background In-Game:
# Mod::BACK_PATH="directory" (Where directory is the path to the image)
# It has to be 163x230 px.
#
#==================================================================#
# Modifications:
# You can modify certain things to make the phone different.
module Mod
# MAX_MSGS_IN_BOX
# Set here the max. messages you can have in your message box.
MAX_MSGS_IN_BOX=20
# MAX_TRACKS_IN_MUSICLIST
# Set here the max. messages you can have in your message box.
MAX_TRACKS_IN_MUSICLIST=20
# ICON_TITLES:
# Are the titles of each icon, in the main menu of the phone.
# Max. 8 letters per word.
ICON_TITLES=["SMS","Calendar","Pictures","Camera",
"Calc.","Graphs","Map","Weather","Notes",
"Clock","Settings","E-Mail","Call","Browser","Music"]
# BACK_PATH
# Its the path to the background image.
# It has to be 163x230 px.
BACK_PATH="CellPhone/background.png"
# MSG_TITLE
# Its a word that will take part before the Message Title.
MSG_TITLE="Title"
# MSG_OPS
# Are the Message Options.
MSG_OPS=["Read","Delete"]
# SMS_TONE
# Here you can set the path to the Sound when you receive
# a Message..
SMS_TONE="Audio/SE/Chime2"
# MENU_OPTION_TITLE and ADD_MENU_OPTION
# With MENU_OPTION_TITLE, you can set the name of the
# option in the Menu. Only if ADD_MENU_OPTION its true.
# If its false, it won´t show itself.
MENU_OPTION_TITLE = "Phone"
ADD_MENU_OPTION = true
end
$messages=[]
$phone_online = true
$full_msgbox=false
class Phone < Scene_Base
def start
@level=0
@aux=0
@aux2=0
@aux3=0
@map = Spriteset_Map.new
@phone = Sprite.new
@phone.bitmap = Cache.system("CellPhone/phone.png")
@phone.x=150
@phone.y=20
@background = Sprite.new
@background.bitmap = Cache.system(Mod::BACK_PATH)
@background.x=188
@background.y=98
@cursor=0
@icons=[]
@msgbox_slots=[]
@msgbox_options_slots=[]
@aux_fullmsg=true
create_icons
end
def update
$game_map.update
@map.update
if @phone_new != nil
@phone_new.update
end
if @level==0
update_input_lvl0
update_icon_animation
end
if @level==1
update_input_lvl1
update_msgbox_cursor
end
if @level==2
update_input_lvl2
end
if @level==3
update_input_lvl3
end
if @level==4
update_input_lvl4
end
if @level==5
update_input_lvl5
update_ipod_cursor
end
if @level==6
update_input_lvl6
end
end
# ICONS - LVL 0 - MAIN MENU
def update_input_lvl0
if @aux_fullmsg==true
if Input.trigger?(Input::RIGHT) && @cursor <14
@cursor=@cursor+1
replace_icons
elsif (Input.trigger?(Input::DOWN)) && !(@cursor >= 11 && @cursor <=14)
@cursor=@cursor+4
replace_icons
elsif Input.trigger?(Input::DOWN) && (@cursor>=11 && @cursor <=14)
@cursor=@cursor
replace_icons
elsif Input.trigger?(Input::LEFT) && @cursor >0
@cursor=@cursor-1
replace_icons
elsif Input.trigger?(Input::UP) && !(@cursor>=0 && @cursor<=3)
@cursor=@cursor-4
replace_icons
elsif Input.trigger?(Input::UP) && (@cursor>=0 && @cursor<=3)
@cursor=@cursor
replace_icons
elsif Input.trigger?(Input::B)
@level=nil
@icons_base.contents.clear
@icons_base.dispose
for i in 0..14
@icons[i].bitmap.dispose
@icons[i]=nil
end
@phone.bitmap.dispose
@phone=nil
@background.bitmap.dispose
@background=nil
$scene=Scene_Map.new
elsif Input.trigger?(Input::C)
case @cursor
when 0
delete_icons
create_slots(0)
when 1
delete_icons
create_calendar
when 14
delete_icons
create_ipod
end
end
else
if Input.trigger?(Input::C) || Input.trigger?(Input::B)
@full_msgbox_new_back.bitmap.dispose
@full_msgbox_new_back=nil
@aux_fullmsg=true
end
end
end
def create_icons
@level=0
@phone.bitmap = Cache.system("CellPhone/phone.png")
@background.bitmap = Cache.system(Mod::BACK_PATH)
if $full_msgbox==true
@aux_fullmsg=false
@full_msgbox_new_back = Sprite.new
@full_msgbox_new_back.bitmap = Cache.system("CellPhone/msgbox_full.png")
@full_msgbox_new_back.x=188
@full_msgbox_new_back.y=155
@full_msgbox_new_back.z=105
end
if @icons[0] != nil
for i in 0..14
@icons[i].bitmap.dispose
@icons[i]=nil
end
end
@icons_base = Window_Base.new(145,20,237,374)
@icons_base.opacity=0
@icons_base.contents.font.size=11
if $phone_online==true
@icons_base.contents.draw_text(30,43,60,20,"Status: ",0)
@icons_base.contents.font.color=@icons_base.text_color(3)
@icons_base.contents.draw_text(62,43,60,20,"Online",0)
else
@icons_base.contents.draw_text(30,43,60,20,"Status: ",0)
@icons_base.contents.font.color=@icons_base.knockout_color
@icons_base.contents.draw_text(62,43,60,20,"Offline",0)
end
@icons_base.contents.font.color=@icons_base.normal_color
a = 194
b = 110
c = 0
title_x=0
title_y=110
for i in 0..4
for j in 0..3
if(i==3 && j==3)
break
end
@icons[j+c] = Sprite.new
@icons[j+c].bitmap = Cache.system("CellPhone/"+(j+c).to_s+".png")
@icons[j+c].x = a
@icons[j+c].y = b
@icons_base.contents.draw_text(title_x,title_y,100,20,Mod::ICON_TITLES[j+c],1)
a=a+38
title_x=title_x+38
end
if(i==3 && j==3)
break
end
b=b+56
title_y=title_y+55
a=194
title_x=0
c=c+4
end
end
def delete_icons
for i in 0..14
@icons[i].bitmap.dispose
@icons[i]=nil
end
@icons_base.contents.clear
@icons_base.dispose
end
def update_icon_animation
if @icons[@cursor]!=nil
if(@aux>=0 && @aux<=5)
@icons[@cursor].y=@icons[@cursor].y-1
@aux=@aux+0.5
end
if(@aux>=5 &&@aux<=10)
@icons[@cursor].y=@icons[@cursor].y+1
@aux=@aux+0.5
end
if(@aux>=10)
@aux=0
end
end
end
def replace_icons
if @icons[0] != nil
a = 194
b = 110
c = 0
for i in 0..4
for j in 0..3
if(i==3 && j==3)
break
end
@icons[j+c].x = a
@icons[j+c].y = b
a=a+38
end
if(i==3 && j==3)
break
end
b=b+56
a=194
c=c+4
end
@aux=0
end
end
# SLOTS - LVL 1 - MSG BOX
def create_slots(cursor_index)
@slots_scroll=0
for i in 0+@slots_scroll..9+@slots_scroll
if ($messages[i]==nil && $messages[i+1]!=nil)
$messages[i]=$messages[i+1]
$messages[i+1]=nil
end
end
@aux3=0
if @msgbox_slots[0] !=nil
for i in 0+@slots_scroll..9+@slots_scroll
@msgbox_slots[i].bitmap.dispose
@msgbox_slots[i]=nil
end
@msgbox_base.contents.dispose
@msgbox_cursor_graphic.bitmap.dispose
@msgbox_title.bitmap.dispose
@msgbox_title2.bitmap.dispose
end
@msgbox_cursor=cursor_index
@msgbox_base = Window_Base.new(150,20,237,374)
@msgbox_base.opacity=0
aux=123
aux2=86
for i in 0+@slots_scroll..9+@slots_scroll
@msgbox_slots[i] = Sprite.new
@msgbox_slots[i].bitmap = Cache.system("CellPhone/msgbox_slot.png")
@msgbox_slots[i].x=188
@msgbox_slots[i].y=aux
@msgbox_slots[i].z=3
n=i+1
if $messages[i] != nil
@msgbox_base.contents.font.size=12
@msgbox_base.contents.draw_text(25,aux2,200,20,(n.to_s+" - "+Mod::MSG_TITLE+": "+$messages[i][0]),0)
else
@msgbox_base.contents.font.size=12
@msgbox_base.contents.draw_text(25,aux2,200,20,(n.to_s+" - "),0)
end
aux=aux+19
aux2=aux2+19
end
@msgbox_arrow_down=Sprite.new
@msgbox_arrow_down.bitmap = Cache.system("CellPhone/arrow_down.png")
@msgbox_arrow_down.x = @msgbox_slots[9].x+74
@msgbox_arrow_down.y = @msgbox_slots[9].y+10
@msgbox_arrow_down.z = 100
@msgbox_arrow_up=Sprite.new
@msgbox_arrow_up.bitmap = Cache.system("CellPhone/arrow_up.png")
@msgbox_arrow_up.x = @msgbox_slots[0].x+74
@msgbox_arrow_up.y = @msgbox_slots[0].y-10
@msgbox_arrow_up.z = 100
@msgbox_arrow_up.opacity=0
@msgbox_cursor_graphic=Sprite.new
@msgbox_cursor_graphic.bitmap = Cache.system("CellPhone/msgbox_cursor.png")
@msgbox_cursor_graphic.x = @msgbox_slots[0].x
@msgbox_cursor_graphic.y = @msgbox_slots[0].y
@msgbox_cursor_graphic.z = 4
@msgbox_title=Sprite.new
@msgbox_title.bitmap = Cache.system("CellPhone/msgbox_title.png")
@msgbox_title.x=188
@msgbox_title.y=83
@msgbox_title.z=4
@msgbox_title2=Sprite.new
@msgbox_title2.bitmap = Cache.system("CellPhone/msgbox_title2.png")
@msgbox_title2.x=188
@msgbox_title2.y=313
@msgbox_title2.z=4
@level=1
end
def replace_slots
aux2=86
@msgbox_base.contents.clear
for i in 0+@slots_scroll..9+@slots_scroll
n=i+1
if $messages[i] != nil
@msgbox_base.contents.font.size=12
@msgbox_base.contents.draw_text(25,aux2,200,20,(n.to_s+" - "+Mod::MSG_TITLE+": "+$messages[i][0]),0)
else
@msgbox_base.contents.font.size=12
@msgbox_base.contents.draw_text(25,aux2,200,20,(n.to_s+" - "),0)
end
aux2=aux2+19
end
end
def update_msgbox_cursor
if @msgbox_slots[@msgbox_cursor-@slots_scroll] != nil
@msgbox_cursor_graphic.y = @msgbox_slots[@msgbox_cursor-@slots_scroll].y
end
end
def update_arrow_animation
if(@aux>=0 && @aux<=5)
@msgbox_arrow_down.y=@msgbox_arrow_down.y-1
@msgbox_arrow_up.y=@msgbox_arrow_up.y-1
@aux=@aux+0.5
end
if(@aux>=5 &&@aux<=10)
@msgbox_arrow_down.y=@msgbox_arrow_down.y+1
@msgbox_arrow_up.y=@msgbox_arrow_up.y+1
@aux=@aux+0.5
end
if(@aux>=10)
@aux=0
end
end
end
def update_input_lvl1
update_arrow_animation
if @msgbox_cursor==Mod::MAX_MSGS_IN_BOX-1
already=true
end
if @msgbox_cursor==0
already=false
end
if @msgbox_cursor < (9-@slots_scroll)
@msgbox_arrow_down.opacity=255
else
if already==true
@msgbox_arrow_down.opacity=0
end
end
if @msgbox_cursor > (9-@slots_scroll)
@msgbox_arrow_up.opacity=255
else
if already==false
@msgbox_arrow_up.opacity=0
end
end
if Input.trigger?(Input::DOWN) && @msgbox_cursor<Mod::MAX_MSGS_IN_BOX-1
@msgbox_cursor=@msgbox_cursor+1
if @msgbox_cursor_graphic.y == @msgbox_slots[9].y
@slots_scroll = @slots_scroll + 1
replace_slots
end
end
if Input.trigger?(Input::UP) && @msgbox_cursor>0
@msgbox_cursor=@msgbox_cursor-1
if @msgbox_cursor_graphic.y == @msgbox_slots[0].y
@slots_scroll = @slots_scroll - 1
replace_slots
end
end
if Input.trigger?(Input::B)
for i in 0..8
@msgbox_slots[i].bitmap.dispose
@msgbox_slots[i]=nil
end
@msgbox_base.contents.dispose
@msgbox_cursor_graphic.bitmap.dispose
@msgbox_title.bitmap.dispose
@msgbox_title2.bitmap.dispose
@msgbox_arrow_down.bitmap.dispose
@msgbox_arrow_up.bitmap.dispose
create_icons
end
@aux3=@aux3+1
if @aux3>=5
if Input.trigger?(Input::C)
if $messages[@msgbox_cursor] != nil
@aux3=0
@msgbox_arrow_down.bitmap.dispose
@msgbox_arrow_up.bitmap.dispose
make_msgbox_options
end
end
end
end
# MSG_OPTIONS - LVL2 - READ - DELETE
def make_msgbox_options
@msgbox_options_cursor=0
@msgbox_options_base = Window_Base.new(@msgbox_slots[@msgbox_cursor].x-38,@msgbox_slots[@msgbox_cursor].y-38,237,374)
@msgbox_options_base.opacity=0
@msgbox_options_base.z=101
for i in 0..1
@msgbox_options_slots[i]=Sprite.new
@msgbox_options_slots[i].bitmap=Cache.system("CellPhone/msgbox_options_slot.png")
@msgbox_options_slots[i].x=10+@msgbox_slots[@msgbox_cursor].x+(80*i)
@msgbox_options_slots[i].y=@msgbox_slots[@msgbox_cursor].y-10
@msgbox_options_slots[i].z=100
end
@msgbox_options_cursor_graphic=Sprite.new
@msgbox_options_cursor_graphic.bitmap=Cache.system("CellPhone/msgbox_options_cursor.png")
@msgbox_options_cursor_graphic.x=10+@msgbox_slots[@msgbox_cursor].x
@msgbox_options_cursor_graphic.y=@msgbox_slots[@msgbox_cursor].y-10
@msgbox_options_cursor_graphic.z=100
@msgbox_options_base.contents.font.size=16
@msgbox_options_base.contents.draw_text(37,12,50,20,Mod::MSG_OPS[0],1)
@msgbox_options_base.contents.draw_text(117,12,50,20,Mod::MSG_OPS[1],1)
@level=2
end
def update_input_lvl2
if Input.trigger?(Input::RIGHT)
@msgbox_options_cursor=1
@msgbox_options_cursor_graphic.x=10+@msgbox_slots[@msgbox_cursor].x+80
elsif Input.trigger?(Input::LEFT)
@msgbox_options_cursor=0
@msgbox_options_cursor_graphic.x=10+@msgbox_slots[@msgbox_cursor].x
end
if Input.trigger?(Input::B)
@msgbox_options_slots[0].bitmap.dispose
@msgbox_options_slots[1].bitmap.dispose
@msgbox_options_cursor_graphic.bitmap.dispose
@msgbox_options_base.contents.clear
@msgbox_options_base=nil
create_slots(@msgbox_cursor)
end
@aux3=@aux3+1
if @aux3>=5
if Input.trigger?(Input::C)
case @msgbox_options_cursor
when 0
for i in 0..8
@msgbox_slots[i].bitmap.dispose
@msgbox_slots[i]=nil
end
@msgbox_base.contents.clear
@msgbox_cursor_graphic.bitmap.dispose
@msgbox_options_slots[0].bitmap.dispose
@msgbox_options_slots[1].bitmap.dispose
@msgbox_options_cursor_graphic.bitmap.dispose
@msgbox_options_base.contents.clear
@msgbox_options_base=nil
show_msg(@msgbox_cursor)
@aux3=0
when 1
@msgbox_options_slots[0].bitmap.dispose
@msgbox_options_slots[1].bitmap.dispose
@msgbox_options_cursor_graphic.bitmap.dispose
@msgbox_options_base.contents.clear
@msgbox_options_base=nil
$messages[@msgbox_cursor]=nil
$full_msgbox=false
create_slots(@msgbox_cursor)
end
end
end
end
# MSG - LVL 3 - MESSAGE
def show_msg(msg)
$messages[msg][3]=true
@msgbox_base.contents.font.size=16
a = 0
for i in $messages[msg][2]
@msgbox_base.contents.draw_text(25,122+13*a,200,20,i,0)
a += 1
end
@msgbox_base.contents.draw_text(3,84,200,20,$messages[msg][1],1)
@msgbox_base.contents.draw_text(2,96,200,20,$messages[msg][0],1)
@msgbox_back=Sprite.new
@msgbox_back.bitmap = Cache.system("CellPhone/msgbox_back.png")
@msgbox_back.x=188
@msgbox_back.y=123
@msgbox_back.z=4
@level=3
end
def update_input_lvl3
if Input.trigger?(Input::B)
@msgbox_base.contents.clear
@msgbox_title.bitmap.dispose
@msgbox_title2.bitmap.dispose
@msgbox_back.bitmap.dispose
create_slots(@msgbox_cursor)
end
end
#end
# CALENDAR - LVL 4 - INTERFACE
def create_calendar
@c_index=1
@calendar_arrow_left=Sprite.new
@calendar_arrow_left.bitmap = Cache.system("CellPhone/arrow_left.png")
@calendar_arrow_left.x=208
@calendar_arrow_left.y=146
@calendar_arrow_left.z=5
@calendar_arrow_left.opacity=0
@calendar_arrow_right=Sprite.new
@calendar_arrow_right.bitmap = Cache.system("CellPhone/arrow_right.png")
@calendar_arrow_right.x=315
@calendar_arrow_right.y=146
@calendar_arrow_right.z=5
@calendar_arrow_right.opacity=0
@calendar_title=Sprite.new
@calendar_title.bitmap = Cache.system("CellPhone/calendar_title.png")
@calendar_title.x=188
@calendar_title.y=83
@calendar_title.z=4
@calendar_title2=Sprite.new
@calendar_title2.bitmap = Cache.system("CellPhone/Calendar/bottom.png")
@calendar_title2.x=188
@calendar_title2.y=293
@calendar_title2.z=4
@calendar = Sprite.new
@calendar.bitmap = Cache.system("CellPhone/Calendar/1.png")
@calendar.x=188
@calendar.y=123
@calendar.z=4
@level=4
end
def calendar_arrow_update
if(@aux>=0 && @aux<=5)
@calendar_arrow_left.x=@calendar_arrow_left.x-1
@calendar_arrow_right.x=@calendar_arrow_right.x-1
@aux=@aux+0.5
end
if(@aux>=5 &&@aux<=10)
@calendar_arrow_left.x=@calendar_arrow_left.x+1
@calendar_arrow_right.x=@calendar_arrow_right.x+1
@aux=@aux+0.5
end
if(@aux>=10)
@aux=0
end
end
def update_input_lvl4
calendar_arrow_update
if @c_index==1
@calendar_arrow_left.opacity=0
@calendar_arrow_right.opacity=255
end
if @c_index>1 && @c_index<12
@calendar_arrow_left.opacity=255
@calendar_arrow_right.opacity=255
end
if @c_index==12
@calendar_arrow_left.opacity=255
@calendar_arrow_right.opacity=0
end
if Input.trigger?(Input::RIGHT) && @c_index<12
@c_index=@c_index+1
@calendar.bitmap = Cache.system("CellPhone/Calendar/"+@c_index.to_s+".png")
elsif Input.trigger?(Input::LEFT) && @c_index>1
@c_index=@c_index-1
@calendar.bitmap = Cache.system("CellPhone/Calendar/"+@c_index.to_s+".png")
end
if Input.trigger?(Input::B)
@calendar_title.bitmap.dispose
@calendar_title2.bitmap.dispose
@calendar.bitmap.dispose
@calendar_arrow_left.bitmap.dispose
@calendar_arrow_right.bitmap.dispose
create_icons
end
end
# I-POD - LVL 5 - MUSIC LIST
def create_ipod
@files=Dir.entries("Graphics/System/CellPhone/Memory/Music/")
@files.delete(".")
@files.delete("..")
@ipod_scroll=0
@ipod_slots=[]
@aux3=0
@ipod_cursor=0
@ipod_base = Window_Base.new(150,20,237,374)
@ipod_base.opacity=0
aux=123
aux2=86
for i in 0+@ipod_scroll..9+@ipod_scroll
@ipod_slots[i] = Sprite.new
@ipod_slots[i].bitmap = Cache.system("CellPhone/msgbox_slot.png")
@ipod_slots[i].x=188
@ipod_slots[i].y=aux
@ipod_slots[i].z=3
n=i+1
if @files[i] != nil
@ipod_base.contents.font.size=10
@ipod_base.contents.draw_text(25,aux2,150,20,(n.to_s+" - "+@files[i]),0)
else
@ipod_base.contents.font.size=10
@ipod_base.contents.draw_text(25,aux2,150,20,(n.to_s+" - "),0)
end
aux=aux+19
aux2=aux2+19
end
@ipod_arrow_down=Sprite.new
@ipod_arrow_down.bitmap = Cache.system("CellPhone/arrow_down.png")
@ipod_arrow_down.x = @ipod_slots[9].x+74
@ipod_arrow_down.y = @ipod_slots[9].y+10
@ipod_arrow_down.z = 100
@ipod_arrow_up=Sprite.new
@ipod_arrow_up.bitmap = Cache.system("CellPhone/arrow_up.png")
@ipod_arrow_up.x = @ipod_slots[0].x+74
@ipod_arrow_up.y = @ipod_slots[0].y-10
@ipod_arrow_up.z = 100
@ipod_arrow_up.opacity=0
@ipod_cursor_graphic=Sprite.new
@ipod_cursor_graphic.bitmap = Cache.system("CellPhone/msgbox_cursor.png")
@ipod_cursor_graphic.x = @ipod_slots[0].x
@ipod_cursor_graphic.y = @ipod_slots[0].y
@ipod_cursor_graphic.z = 4
@ipod_title=Sprite.new
@ipod_title.bitmap = Cache.system("CellPhone/ipod_title.png")
@ipod_title.x=188
@ipod_title.y=83
@ipod_title.z=4
@ipod_title2=Sprite.new
@ipod_title2.bitmap = Cache.system("CellPhone/msgbox_title2.png")
@ipod_title2.x=188
@ipod_title2.y=313
@ipod_title2.z=4
@level=5
end
def replace_ipod_slots
aux2=86
@ipod_base.contents.clear
for i in 0+@ipod_scroll..9+@ipod_scroll
n=i+1
if @files[i] != nil
@ipod_base.contents.font.size=10
@ipod_base.contents.draw_text(25,aux2,150,20,(n.to_s+" - "+@files[i]),0)
else
@ipod_base.contents.font.size=10
@ipod_base.contents.draw_text(25,aux2,150,20,(n.to_s+" - "),0)
end
aux2=aux2+19
end
end
def update_ipod_cursor
if @ipod_slots[@ipod_cursor-@ipod_scroll] != nil
@ipod_cursor_graphic.y = @ipod_slots[@ipod_cursor-@ipod_scroll].y
end
end
def update_ipod_arrow_animation
if(@aux>=0 && @aux<=5)
@ipod_arrow_down.y=@ipod_arrow_down.y-1
@ipod_arrow_up.y=@ipod_arrow_up.y-1
@aux=@aux+0.5
end
if(@aux>=5 &&@aux<=10)
@ipod_arrow_down.y=@ipod_arrow_down.y+1
@ipod_arrow_up.y=@ipod_arrow_up.y+1
@aux=@aux+0.5
end
if(@aux>=10)
@aux=0
end
end
def update_input_lvl5
update_ipod_arrow_animation
if @ipod_cursor==Mod::MAX_TRACKS_IN_MUSICLIST-1
already=true
end
if @ipod_cursor==0
already=false
end
if @ipod_cursor < (9-@ipod_scroll)
@ipod_arrow_down.opacity=255
else
if already==true
@ipod_arrow_down.opacity=0
end
end
if @ipod_cursor > (9-@ipod_scroll)
@ipod_arrow_up.opacity=255
else
if already==false
@ipod_arrow_up.opacity=0
end
end
if Input.trigger?(Input::DOWN) && @ipod_cursor<Mod::MAX_TRACKS_IN_MUSICLIST-1
@ipod_cursor=@ipod_cursor+1
if @ipod_cursor_graphic.y == @ipod_slots[9].y
@ipod_scroll = @ipod_scroll + 1
replace_ipod_slots
end
end
if Input.trigger?(Input::UP) && @ipod_cursor>0
@ipod_cursor=@ipod_cursor-1
if @ipod_cursor_graphic.y == @ipod_slots[0].y
@ipod_scroll = @ipod_scroll - 1
replace_ipod_slots
end
end
if Input.trigger?(Input::B)
for i in 0..8
@ipod_slots[i].bitmap.dispose
@ipod_slots[i]=nil
end
@ipod_base.contents.dispose
@ipod_cursor_graphic.bitmap.dispose
@ipod_title.bitmap.dispose
@ipod_title2.bitmap.dispose
@ipod_arrow_down.bitmap.dispose
@ipod_arrow_up.bitmap.dispose
create_icons
end
@aux3=@aux3+1
if @aux3>=5
if Input.trigger?(Input::C)
if @files[@ipod_cursor] != nil
@aux3=0
for i in 0..8
@ipod_slots[i].bitmap.dispose
@ipod_slots[i]=nil
end
@ipod_base.contents.clear
@ipod_cursor_graphic.bitmap.dispose
@ipod_title.bitmap.dispose
@ipod_title2.bitmap.dispose
@ipod_arrow_down.bitmap.dispose
@ipod_arrow_up.bitmap.dispose
create_ipod_player(@ipod_cursor,1)
end
end
end
end
# I-POD - LVL 6 - PLAYER
def create_ipod_player(index,cursor)
@file=index
@ipod_player_cursor_index=cursor
@ipod_player_col=Sprite.new
@ipod_player_col.bitmap = Cache.system("CellPhone/ipod_player_col.png")
@ipod_player_col.x = 198
@ipod_player_col.y = 142
@ipod_player_col.z = 7
@ipod_player=Sprite.new
@ipod_player.bitmap = Cache.system("CellPhone/ipod_player.png")
@ipod_player.x = 188
@ipod_player.y = 84
@ipod_player.z = 6
@ipod_player_cursor=Sprite.new
@ipod_player_cursor.bitmap = Cache.system("CellPhone/ipod_cursor.png")
@ipod_player_cursor.x = 247
@ipod_player_cursor.y = 220
@ipod_player_cursor.z = 7
@ipod_base.contents.font.size=12
@ipod_base.contents.draw_text(28,62,150,20,(@files[@file]),1)
@level=6
end
def update_input_lvl6
if Input.trigger?(Input::RIGHT) && @ipod_player_cursor_index<2
@ipod_player_cursor_index=@ipod_player_cursor_index+1
end
if Input.trigger?(Input::LEFT) && @ipod_player_cursor_index>0
@ipod_player_cursor_index=@ipod_player_cursor_index-1
end
if Input.trigger?(Input::DOWN)
@ipod_player_cursor_index=3
@ipod_player_cursor.bitmap = Cache.system("CellPhone/ipod_cursor4.png")
@ipod_player_cursor.x = 247
@ipod_player_cursor.y = 254
@ipod_player_cursor.z = 7
end
if Input.trigger?(Input::UP)
@ipod_player_cursor_index=1
@ipod_player_cursor.bitmap = Cache.system("CellPhone/ipod_cursor.png")
@ipod_player_cursor.x = 247
@ipod_player_cursor.y = 220
@ipod_player_cursor.z = 7
end
case @ipod_player_cursor_index
when 0
@ipod_player_cursor.bitmap = Cache.system("CellPhone/ipod_cursor2.png")
@ipod_player_cursor.x = 210
@ipod_player_cursor.y = 220
@ipod_player_cursor.z = 7
when 1
@ipod_player_cursor.bitmap = Cache.system("CellPhone/ipod_cursor.png")
@ipod_player_cursor.x = 247
@ipod_player_cursor.y = 220
@ipod_player_cursor.z = 7
when 2
@ipod_player_cursor.bitmap = Cache.system("CellPhone/ipod_cursor3.png")
@ipod_player_cursor.x = 280
@ipod_player_cursor.y = 222
@ipod_player_cursor.z = 7
end
if Input.trigger?(Input::C)
case @ipod_player_cursor_index
when 0
if @files[@file-1]!=nil
Audio.bgm_stop
@ipod_player_col.bitmap.dispose
@ipod_player.bitmap.dispose
@ipod_player_cursor.bitmap.dispose
@ipod_base.contents.clear
create_ipod_player(@file-1,0)
end
when 1
Audio.bgm_play("Graphics/System/CellPhone/Memory/Music/"+@files[@file])
when 2
if @files[@file+1]!=nil
Audio.bgm_stop
@ipod_player_col.bitmap.dispose
@ipod_player.bitmap.dispose
@ipod_player_cursor.bitmap.dispose
@ipod_base.contents.clear
create_ipod_player(@file+1,2)
end
when 3
Audio.bgm_stop
end
end
if Input.trigger?(Input::B)
@ipod_player_col.bitmap.dispose
@ipod_player.bitmap.dispose
@ipod_player_cursor.bitmap.dispose
@ipod_base.contents.clear
create_icons
end
end
#==================================================================#
# Phone_Msg
# Send messages to yhe player
#==================================================================#
class Phone_Msg < Window_Base
def initialize(autor="Unknown",title="No title",msg="")
super(0,0,40,42)
self.opacity=0
if $phone_online==true
if $messages[9] == nil
$full_msgbox=false
Audio.se_play(Mod::SMS_TONE)
msg = msg.delete("\n")
autor = autor.delete("\n")
title= title.delete("\n")
msg_array = msg.ltrim(190,self.contents.font.size,self.contents.font.name)
array = [autor,title,msg_array,false,false] # readed, sended, deleted
for i in 0..9
if $messages[i]==nil
$messages[i]=array
break
end
end
$scene.one_time=true
end
if $messages[9] != nil
$full_msgbox=true
end
end
end
end
#==================================================================#
# String Modification
# RGSS++
#==================================================================#
class String
def trim
@subself = self.clone
loop do
@subself[0,1] = "" if @subself[0,1] == " "
@subself[-1,1] = "" if @subself[-1,1] == " "
break if @subself[0,1] != " " and @subself[-1,1] != " "
end
return @subself
end
def ltrim (width, fontsize, fontname=0)
str = self.trim.clone
bit = Bitmap.new(1,1)
bit.font.name = fontname
bit.font.size = fontsize
wordcount = 0
size = 0
line = ""
word = ""
result = []
while ((c = str.slice!(/./m)) != nil)
wordcount += bit.text_size(c).width if c != " "
word += c
if c == " " and (wordcount + size) <= width
line += word
word = ""
size += wordcount + bit.text_size(c).width
wordcount = 0
end
if c == " " and (wordcount + size) >= width
result.push(line)
line = word
word = ""
size = wordcount
wordcount = 0
end
if c == "\n" and line != ""
result.push(line)
line = ""
size = 0
wordcount = 0
end
end
line += word if word != ""
if line != ""
result.push(line)
end
return result
end
end
#==================================================================#
# Scene_Map
# Modification for Phone Notifications
#==================================================================#
class Scene_Map < Scene_Base
attr_accessor :one_time
alias start_phone start
def start
start_phone
@one_time=true
for i in 0..9
if $messages[i] !=nil
if $messages[i][3] == false
if @unreaded_msg == nil
@unreaded_msg=0
@unreaded_msg=@unreaded_msg + 1
$messages[i][4]=true
else
@unreaded_msg=@unreaded_msg + 1
$messages[i][4]=true
end
end
end
end
if @unreaded_msg !=nil
if @unreaded_msg != 0
if @alert != nil
@alert.bitmap.dispose
end
if @msg_alert_base != nil
@msg_alert_base.contents.clear
@msg_alert_base.dispose
end
@alert=Sprite.new
@alert.bitmap = Cache.system("CellPhone/new_msgs.png")
@alert.x=10
@alert.y=10
@msg_alert_base = Window_Base.new(-6,0,130,130)
@msg_alert_base.contents.draw_text(0,74,100,20,@unreaded_msg.to_s,1)
@msg_alert_base.opacity=0
end
end
end
alias terminate_phone terminate
def terminate
terminate_phone
if @msg_alert_base != nil
super
@msg_alert_base.contents.clear
@msg_alert_base.dispose
@alert.bitmap.dispose
end
end
alias update_phone update
def update
update_phone
if @msg_alert_base != nil
@msg_alert_base.update
end
if @one_time==true
for i in 0..9
if $messages[i] !=nil
if $messages[i][3] == false
if $messages[i][4]== false
if @unreaded_msg == nil
@unreaded_msg=0
@unreaded_msg=@unreaded_msg + 1
$messages[i][4]=true
else
@unreaded_msg=@unreaded_msg + 1
$messages[i][4]=true
end
end
end
end
end
if @unreaded_msg !=nil
if @unreaded_msg != 0
if @alert != nil
@alert.bitmap.dispose
end
if @msg_alert_base != nil
@msg_alert_base.contents.clear
@msg_alert_base.dispose
end
@alert=Sprite.new
@alert.bitmap = Cache.system("CellPhone/new_msgs.png")
@alert.x=10
@alert.y=10
@msg_alert_base = Window_Base.new(-6,0,130,130)
@msg_alert_base.contents.draw_text(0,74,100,20,@unreaded_msg.to_s,1)
@msg_alert_base.opacity=0
end
end
@one_time=false
end
end
end
#==================================================================#
# Scene_Menu
# Modification for Phone Option in Menu.
#==================================================================#
class Scene_Menu < Scene_Base
def create_command_window
if Mod::ADD_MENU_OPTION==true
s1 = Vocab::item
s2 = Vocab::skill
s3 = Vocab::equip
s4 = Vocab::status
s5 = Mod::MENU_OPTION_TITLE
s6 = Vocab::save
s7 = Vocab::game_end
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
@command_window.index = @menu_index
if $game_party.members.size == 0 # ??????? 0 ????
@command_window.draw_item(0, false) # ????????
@command_window.draw_item(1, false) # ???????
@command_window.draw_item(2, false) # ??????
@command_window.draw_item(3, false) # ?????????
end
if $game_system.save_disabled # ????????
@command_window.draw_item(4, false) # ???????
end
end
if Mod::ADD_MENU_OPTION==false
s1 = Vocab::item
s2 = Vocab::skill
s3 = Vocab::equip
s4 = Vocab::status
s5 = Vocab::save
s6 = Vocab::game_end
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
@command_window.index = @menu_index
if $game_party.members.size == 0 # ??????? 0 ????
@command_window.draw_item(0, false) # ????????
@command_window.draw_item(1, false) # ???????
@command_window.draw_item(2, false) # ??????
@command_window.draw_item(3, false) # ?????????
end
if $game_system.save_disabled # ????????
@command_window.draw_item(4, false) # ???????
end
end
end
def update_command_selection
if Mod::ADD_MENU_OPTION==true
if Input.trigger?(Input::B)
Sound.play_cancel
$scene = Scene_Map.new
elsif Input.trigger?(Input::C)
if $game_party.members.size == 0 and @command_window.index < 4
Sound.play_buzzer
return
elsif $game_system.save_disabled and @command_window.index == 4
Sound.play_buzzer
return
end
Sound.play_decision
case @command_window.index
when 0 # ????
$scene = Scene_Item.new
when 1,2,3 # ????????????
start_actor_selection
when 4
$scene = Phone.new
when 5 # ???
$scene = Scene_File.new(true, false, false)
when 6 # ?????
$scene = Scene_End.new
end
end
end
if Mod::ADD_MENU_OPTION==false
if Input.trigger?(Input::B)
Sound.play_cancel
$scene = Scene_Map.new
elsif Input.trigger?(Input::C)
if $game_party.members.size == 0 and @command_window.index < 4
Sound.play_buzzer
return
elsif $game_system.save_disabled and @command_window.index == 4
Sound.play_buzzer
return
end
Sound.play_decision
case @command_window.index
when 0 # ????
$scene = Scene_Item.new
when 1,2,3 # ????????????
start_actor_selection
when 4 # ???
$scene = Scene_File.new(true, false, false)
when 5 # ?????
$scene = Scene_End.new
end
end
end
end
end
Question
snob
Ciao a tutti....
so ke richiedere la conversione di un script è sempre una rottura, ma ne avrei davvero bisogno....ho cercato ovunque ma non sono riuscito a trovarlo quindi spero ke un'animo gentile mi risponda...
Io ho provato a convertirlo ma con scarsi scarsissimi risultati.... please help me XD
Vi allego lo script del Phone System VX, a me servirebbe per XP ...
Molte grazie in anticipo
############################################################################# #==================================================================# # Name: Phone System 0.1BETA # By: Necrozard # Date: 19/07/08 #==================================================================# #==================================================================# # Description: # The Phone allows you to receive SMS (Messages) from NPC when and where you want, just # doing it in a easy way with "Call script". # You can also Delete this messages, because in this version, the Message Box has a limit # of 10 Messages. If you have the Message Box full, a notification will notice you what is # happening until you delete a message. #==================================================================# # User Guide: # All the commands next, have to be written in Call script. # # Allow the player open the Phone (Set the option in the Menu): # Mod::ADD_MENU_OPTION = true/false # # Send a SMS (Message) to the player: # Phone_Msg.new(title,autor,message) # # Open the phone In-Game: # $scene = Phone.new # # Set the phone On-line (Common) or Off-line (You cant receive any message, for example # in caves): # $phone_online = true/false # # Set a phone background In-Game: # Mod::BACK_PATH="directory" (Where directory is the path to the image) # It has to be 163x230 px. # #==================================================================# # Modifications: # You can modify certain things to make the phone different. module Mod # MAX_MSGS_IN_BOX # Set here the max. messages you can have in your message box. MAX_MSGS_IN_BOX=20 # MAX_TRACKS_IN_MUSICLIST # Set here the max. messages you can have in your message box. MAX_TRACKS_IN_MUSICLIST=20 # ICON_TITLES: # Are the titles of each icon, in the main menu of the phone. # Max. 8 letters per word. ICON_TITLES=["SMS","Calendar","Pictures","Camera", "Calc.","Graphs","Map","Weather","Notes", "Clock","Settings","E-Mail","Call","Browser","Music"] # BACK_PATH # Its the path to the background image. # It has to be 163x230 px. BACK_PATH="CellPhone/background.png" # MSG_TITLE # Its a word that will take part before the Message Title. MSG_TITLE="Title" # MSG_OPS # Are the Message Options. MSG_OPS=["Read","Delete"] # SMS_TONE # Here you can set the path to the Sound when you receive # a Message.. SMS_TONE="Audio/SE/Chime2" # MENU_OPTION_TITLE and ADD_MENU_OPTION # With MENU_OPTION_TITLE, you can set the name of the # option in the Menu. Only if ADD_MENU_OPTION its true. # If its false, it won´t show itself. MENU_OPTION_TITLE = "Phone" ADD_MENU_OPTION = true end $messages=[] $phone_online = true $full_msgbox=false class Phone < Scene_Base def start @level=0 @aux=0 @aux2=0 @aux3=0 @map = Spriteset_Map.new @phone = Sprite.new @phone.bitmap = Cache.system("CellPhone/phone.png") @phone.x=150 @phone.y=20 @background = Sprite.new @background.bitmap = Cache.system(Mod::BACK_PATH) @background.x=188 @background.y=98 @cursor=0 @icons=[] @msgbox_slots=[] @msgbox_options_slots=[] @aux_fullmsg=true create_icons end def update $game_map.update @map.update if @phone_new != nil @phone_new.update end if @level==0 update_input_lvl0 update_icon_animation end if @level==1 update_input_lvl1 update_msgbox_cursor end if @level==2 update_input_lvl2 end if @level==3 update_input_lvl3 end if @level==4 update_input_lvl4 end if @level==5 update_input_lvl5 update_ipod_cursor end if @level==6 update_input_lvl6 end end # ICONS - LVL 0 - MAIN MENU def update_input_lvl0 if @aux_fullmsg==true if Input.trigger?(Input::RIGHT) && @cursor <14 @cursor=@cursor+1 replace_icons elsif (Input.trigger?(Input::DOWN)) && !(@cursor >= 11 && @cursor <=14) @cursor=@cursor+4 replace_icons elsif Input.trigger?(Input::DOWN) && (@cursor>=11 && @cursor <=14) @cursor=@cursor replace_icons elsif Input.trigger?(Input::LEFT) && @cursor >0 @cursor=@cursor-1 replace_icons elsif Input.trigger?(Input::UP) && !(@cursor>=0 && @cursor<=3) @cursor=@cursor-4 replace_icons elsif Input.trigger?(Input::UP) && (@cursor>=0 && @cursor<=3) @cursor=@cursor replace_icons elsif Input.trigger?(Input::B) @level=nil @icons_base.contents.clear @icons_base.dispose for i in 0..14 @icons[i].bitmap.dispose @icons[i]=nil end @phone.bitmap.dispose @phone=nil @background.bitmap.dispose @background=nil $scene=Scene_Map.new elsif Input.trigger?(Input::C) case @cursor when 0 delete_icons create_slots(0) when 1 delete_icons create_calendar when 14 delete_icons create_ipod end end else if Input.trigger?(Input::C) || Input.trigger?(Input::B) @full_msgbox_new_back.bitmap.dispose @full_msgbox_new_back=nil @aux_fullmsg=true end end end def create_icons @level=0 @phone.bitmap = Cache.system("CellPhone/phone.png") @background.bitmap = Cache.system(Mod::BACK_PATH) if $full_msgbox==true @aux_fullmsg=false @full_msgbox_new_back = Sprite.new @full_msgbox_new_back.bitmap = Cache.system("CellPhone/msgbox_full.png") @full_msgbox_new_back.x=188 @full_msgbox_new_back.y=155 @full_msgbox_new_back.z=105 end if @icons[0] != nil for i in 0..14 @icons[i].bitmap.dispose @icons[i]=nil end end @icons_base = Window_Base.new(145,20,237,374) @icons_base.opacity=0 @icons_base.contents.font.size=11 if $phone_online==true @icons_base.contents.draw_text(30,43,60,20,"Status: ",0) @icons_base.contents.font.color=@icons_base.text_color(3) @icons_base.contents.draw_text(62,43,60,20,"Online",0) else @icons_base.contents.draw_text(30,43,60,20,"Status: ",0) @icons_base.contents.font.color=@icons_base.knockout_color @icons_base.contents.draw_text(62,43,60,20,"Offline",0) end @icons_base.contents.font.color=@icons_base.normal_color a = 194 b = 110 c = 0 title_x=0 title_y=110 for i in 0..4 for j in 0..3 if(i==3 && j==3) break end @icons[j+c] = Sprite.new @icons[j+c].bitmap = Cache.system("CellPhone/"+(j+c).to_s+".png") @icons[j+c].x = a @icons[j+c].y = b @icons_base.contents.draw_text(title_x,title_y,100,20,Mod::ICON_TITLES[j+c],1) a=a+38 title_x=title_x+38 end if(i==3 && j==3) break end b=b+56 title_y=title_y+55 a=194 title_x=0 c=c+4 end end def delete_icons for i in 0..14 @icons[i].bitmap.dispose @icons[i]=nil end @icons_base.contents.clear @icons_base.dispose end def update_icon_animation if @icons[@cursor]!=nil if(@aux>=0 && @aux<=5) @icons[@cursor].y=@icons[@cursor].y-1 @aux=@aux+0.5 end if(@aux>=5 &&@aux<=10) @icons[@cursor].y=@icons[@cursor].y+1 @aux=@aux+0.5 end if(@aux>=10) @aux=0 end end end def replace_icons if @icons[0] != nil a = 194 b = 110 c = 0 for i in 0..4 for j in 0..3 if(i==3 && j==3) break end @icons[j+c].x = a @icons[j+c].y = b a=a+38 end if(i==3 && j==3) break end b=b+56 a=194 c=c+4 end @aux=0 end end # SLOTS - LVL 1 - MSG BOX def create_slots(cursor_index) @slots_scroll=0 for i in 0+@slots_scroll..9+@slots_scroll if ($messages[i]==nil && $messages[i+1]!=nil) $messages[i]=$messages[i+1] $messages[i+1]=nil end end @aux3=0 if @msgbox_slots[0] !=nil for i in 0+@slots_scroll..9+@slots_scroll @msgbox_slots[i].bitmap.dispose @msgbox_slots[i]=nil end @msgbox_base.contents.dispose @msgbox_cursor_graphic.bitmap.dispose @msgbox_title.bitmap.dispose @msgbox_title2.bitmap.dispose end @msgbox_cursor=cursor_index @msgbox_base = Window_Base.new(150,20,237,374) @msgbox_base.opacity=0 aux=123 aux2=86 for i in 0+@slots_scroll..9+@slots_scroll @msgbox_slots[i] = Sprite.new @msgbox_slots[i].bitmap = Cache.system("CellPhone/msgbox_slot.png") @msgbox_slots[i].x=188 @msgbox_slots[i].y=aux @msgbox_slots[i].z=3 n=i+1 if $messages[i] != nil @msgbox_base.contents.font.size=12 @msgbox_base.contents.draw_text(25,aux2,200,20,(n.to_s+" - "+Mod::MSG_TITLE+": "+$messages[i][0]),0) else @msgbox_base.contents.font.size=12 @msgbox_base.contents.draw_text(25,aux2,200,20,(n.to_s+" - "),0) end aux=aux+19 aux2=aux2+19 end @msgbox_arrow_down=Sprite.new @msgbox_arrow_down.bitmap = Cache.system("CellPhone/arrow_down.png") @msgbox_arrow_down.x = @msgbox_slots[9].x+74 @msgbox_arrow_down.y = @msgbox_slots[9].y+10 @msgbox_arrow_down.z = 100 @msgbox_arrow_up=Sprite.new @msgbox_arrow_up.bitmap = Cache.system("CellPhone/arrow_up.png") @msgbox_arrow_up.x = @msgbox_slots[0].x+74 @msgbox_arrow_up.y = @msgbox_slots[0].y-10 @msgbox_arrow_up.z = 100 @msgbox_arrow_up.opacity=0 @msgbox_cursor_graphic=Sprite.new @msgbox_cursor_graphic.bitmap = Cache.system("CellPhone/msgbox_cursor.png") @msgbox_cursor_graphic.x = @msgbox_slots[0].x @msgbox_cursor_graphic.y = @msgbox_slots[0].y @msgbox_cursor_graphic.z = 4 @msgbox_title=Sprite.new @msgbox_title.bitmap = Cache.system("CellPhone/msgbox_title.png") @msgbox_title.x=188 @msgbox_title.y=83 @msgbox_title.z=4 @msgbox_title2=Sprite.new @msgbox_title2.bitmap = Cache.system("CellPhone/msgbox_title2.png") @msgbox_title2.x=188 @msgbox_title2.y=313 @msgbox_title2.z=4 @level=1 end def replace_slots aux2=86 @msgbox_base.contents.clear for i in 0+@slots_scroll..9+@slots_scroll n=i+1 if $messages[i] != nil @msgbox_base.contents.font.size=12 @msgbox_base.contents.draw_text(25,aux2,200,20,(n.to_s+" - "+Mod::MSG_TITLE+": "+$messages[i][0]),0) else @msgbox_base.contents.font.size=12 @msgbox_base.contents.draw_text(25,aux2,200,20,(n.to_s+" - "),0) end aux2=aux2+19 end end def update_msgbox_cursor if @msgbox_slots[@msgbox_cursor-@slots_scroll] != nil @msgbox_cursor_graphic.y = @msgbox_slots[@msgbox_cursor-@slots_scroll].y end end def update_arrow_animation if(@aux>=0 && @aux<=5) @msgbox_arrow_down.y=@msgbox_arrow_down.y-1 @msgbox_arrow_up.y=@msgbox_arrow_up.y-1 @aux=@aux+0.5 end if(@aux>=5 &&@aux<=10) @msgbox_arrow_down.y=@msgbox_arrow_down.y+1 @msgbox_arrow_up.y=@msgbox_arrow_up.y+1 @aux=@aux+0.5 end if(@aux>=10) @aux=0 end end end def update_input_lvl1 update_arrow_animation if @msgbox_cursor==Mod::MAX_MSGS_IN_BOX-1 already=true end if @msgbox_cursor==0 already=false end if @msgbox_cursor < (9-@slots_scroll) @msgbox_arrow_down.opacity=255 else if already==true @msgbox_arrow_down.opacity=0 end end if @msgbox_cursor > (9-@slots_scroll) @msgbox_arrow_up.opacity=255 else if already==false @msgbox_arrow_up.opacity=0 end end if Input.trigger?(Input::DOWN) && @msgbox_cursor<Mod::MAX_MSGS_IN_BOX-1 @msgbox_cursor=@msgbox_cursor+1 if @msgbox_cursor_graphic.y == @msgbox_slots[9].y @slots_scroll = @slots_scroll + 1 replace_slots end end if Input.trigger?(Input::UP) && @msgbox_cursor>0 @msgbox_cursor=@msgbox_cursor-1 if @msgbox_cursor_graphic.y == @msgbox_slots[0].y @slots_scroll = @slots_scroll - 1 replace_slots end end if Input.trigger?(Input::B) for i in 0..8 @msgbox_slots[i].bitmap.dispose @msgbox_slots[i]=nil end @msgbox_base.contents.dispose @msgbox_cursor_graphic.bitmap.dispose @msgbox_title.bitmap.dispose @msgbox_title2.bitmap.dispose @msgbox_arrow_down.bitmap.dispose @msgbox_arrow_up.bitmap.dispose create_icons end @aux3=@aux3+1 if @aux3>=5 if Input.trigger?(Input::C) if $messages[@msgbox_cursor] != nil @aux3=0 @msgbox_arrow_down.bitmap.dispose @msgbox_arrow_up.bitmap.dispose make_msgbox_options end end end end # MSG_OPTIONS - LVL2 - READ - DELETE def make_msgbox_options @msgbox_options_cursor=0 @msgbox_options_base = Window_Base.new(@msgbox_slots[@msgbox_cursor].x-38,@msgbox_slots[@msgbox_cursor].y-38,237,374) @msgbox_options_base.opacity=0 @msgbox_options_base.z=101 for i in 0..1 @msgbox_options_slots[i]=Sprite.new @msgbox_options_slots[i].bitmap=Cache.system("CellPhone/msgbox_options_slot.png") @msgbox_options_slots[i].x=10+@msgbox_slots[@msgbox_cursor].x+(80*i) @msgbox_options_slots[i].y=@msgbox_slots[@msgbox_cursor].y-10 @msgbox_options_slots[i].z=100 end @msgbox_options_cursor_graphic=Sprite.new @msgbox_options_cursor_graphic.bitmap=Cache.system("CellPhone/msgbox_options_cursor.png") @msgbox_options_cursor_graphic.x=10+@msgbox_slots[@msgbox_cursor].x @msgbox_options_cursor_graphic.y=@msgbox_slots[@msgbox_cursor].y-10 @msgbox_options_cursor_graphic.z=100 @msgbox_options_base.contents.font.size=16 @msgbox_options_base.contents.draw_text(37,12,50,20,Mod::MSG_OPS[0],1) @msgbox_options_base.contents.draw_text(117,12,50,20,Mod::MSG_OPS[1],1) @level=2 end def update_input_lvl2 if Input.trigger?(Input::RIGHT) @msgbox_options_cursor=1 @msgbox_options_cursor_graphic.x=10+@msgbox_slots[@msgbox_cursor].x+80 elsif Input.trigger?(Input::LEFT) @msgbox_options_cursor=0 @msgbox_options_cursor_graphic.x=10+@msgbox_slots[@msgbox_cursor].x end if Input.trigger?(Input::B) @msgbox_options_slots[0].bitmap.dispose @msgbox_options_slots[1].bitmap.dispose @msgbox_options_cursor_graphic.bitmap.dispose @msgbox_options_base.contents.clear @msgbox_options_base=nil create_slots(@msgbox_cursor) end @aux3=@aux3+1 if @aux3>=5 if Input.trigger?(Input::C) case @msgbox_options_cursor when 0 for i in 0..8 @msgbox_slots[i].bitmap.dispose @msgbox_slots[i]=nil end @msgbox_base.contents.clear @msgbox_cursor_graphic.bitmap.dispose @msgbox_options_slots[0].bitmap.dispose @msgbox_options_slots[1].bitmap.dispose @msgbox_options_cursor_graphic.bitmap.dispose @msgbox_options_base.contents.clear @msgbox_options_base=nil show_msg(@msgbox_cursor) @aux3=0 when 1 @msgbox_options_slots[0].bitmap.dispose @msgbox_options_slots[1].bitmap.dispose @msgbox_options_cursor_graphic.bitmap.dispose @msgbox_options_base.contents.clear @msgbox_options_base=nil $messages[@msgbox_cursor]=nil $full_msgbox=false create_slots(@msgbox_cursor) end end end end # MSG - LVL 3 - MESSAGE def show_msg(msg) $messages[msg][3]=true @msgbox_base.contents.font.size=16 a = 0 for i in $messages[msg][2] @msgbox_base.contents.draw_text(25,122+13*a,200,20,i,0) a += 1 end @msgbox_base.contents.draw_text(3,84,200,20,$messages[msg][1],1) @msgbox_base.contents.draw_text(2,96,200,20,$messages[msg][0],1) @msgbox_back=Sprite.new @msgbox_back.bitmap = Cache.system("CellPhone/msgbox_back.png") @msgbox_back.x=188 @msgbox_back.y=123 @msgbox_back.z=4 @level=3 end def update_input_lvl3 if Input.trigger?(Input::B) @msgbox_base.contents.clear @msgbox_title.bitmap.dispose @msgbox_title2.bitmap.dispose @msgbox_back.bitmap.dispose create_slots(@msgbox_cursor) end end #end # CALENDAR - LVL 4 - INTERFACE def create_calendar @c_index=1 @calendar_arrow_left=Sprite.new @calendar_arrow_left.bitmap = Cache.system("CellPhone/arrow_left.png") @calendar_arrow_left.x=208 @calendar_arrow_left.y=146 @calendar_arrow_left.z=5 @calendar_arrow_left.opacity=0 @calendar_arrow_right=Sprite.new @calendar_arrow_right.bitmap = Cache.system("CellPhone/arrow_right.png") @calendar_arrow_right.x=315 @calendar_arrow_right.y=146 @calendar_arrow_right.z=5 @calendar_arrow_right.opacity=0 @calendar_title=Sprite.new @calendar_title.bitmap = Cache.system("CellPhone/calendar_title.png") @calendar_title.x=188 @calendar_title.y=83 @calendar_title.z=4 @calendar_title2=Sprite.new @calendar_title2.bitmap = Cache.system("CellPhone/Calendar/bottom.png") @calendar_title2.x=188 @calendar_title2.y=293 @calendar_title2.z=4 @calendar = Sprite.new @calendar.bitmap = Cache.system("CellPhone/Calendar/1.png") @calendar.x=188 @calendar.y=123 @calendar.z=4 @level=4 end def calendar_arrow_update if(@aux>=0 && @aux<=5) @calendar_arrow_left.x=@calendar_arrow_left.x-1 @calendar_arrow_right.x=@calendar_arrow_right.x-1 @aux=@aux+0.5 end if(@aux>=5 &&@aux<=10) @calendar_arrow_left.x=@calendar_arrow_left.x+1 @calendar_arrow_right.x=@calendar_arrow_right.x+1 @aux=@aux+0.5 end if(@aux>=10) @aux=0 end end def update_input_lvl4 calendar_arrow_update if @c_index==1 @calendar_arrow_left.opacity=0 @calendar_arrow_right.opacity=255 end if @c_index>1 && @c_index<12 @calendar_arrow_left.opacity=255 @calendar_arrow_right.opacity=255 end if @c_index==12 @calendar_arrow_left.opacity=255 @calendar_arrow_right.opacity=0 end if Input.trigger?(Input::RIGHT) && @c_index<12 @c_index=@c_index+1 @calendar.bitmap = Cache.system("CellPhone/Calendar/"+@c_index.to_s+".png") elsif Input.trigger?(Input::LEFT) && @c_index>1 @c_index=@c_index-1 @calendar.bitmap = Cache.system("CellPhone/Calendar/"+@c_index.to_s+".png") end if Input.trigger?(Input::B) @calendar_title.bitmap.dispose @calendar_title2.bitmap.dispose @calendar.bitmap.dispose @calendar_arrow_left.bitmap.dispose @calendar_arrow_right.bitmap.dispose create_icons end end # I-POD - LVL 5 - MUSIC LIST def create_ipod @files=Dir.entries("Graphics/System/CellPhone/Memory/Music/") @files.delete(".") @files.delete("..") @ipod_scroll=0 @ipod_slots=[] @aux3=0 @ipod_cursor=0 @ipod_base = Window_Base.new(150,20,237,374) @ipod_base.opacity=0 aux=123 aux2=86 for i in 0+@ipod_scroll..9+@ipod_scroll @ipod_slots[i] = Sprite.new @ipod_slots[i].bitmap = Cache.system("CellPhone/msgbox_slot.png") @ipod_slots[i].x=188 @ipod_slots[i].y=aux @ipod_slots[i].z=3 n=i+1 if @files[i] != nil @ipod_base.contents.font.size=10 @ipod_base.contents.draw_text(25,aux2,150,20,(n.to_s+" - "+@files[i]),0) else @ipod_base.contents.font.size=10 @ipod_base.contents.draw_text(25,aux2,150,20,(n.to_s+" - "),0) end aux=aux+19 aux2=aux2+19 end @ipod_arrow_down=Sprite.new @ipod_arrow_down.bitmap = Cache.system("CellPhone/arrow_down.png") @ipod_arrow_down.x = @ipod_slots[9].x+74 @ipod_arrow_down.y = @ipod_slots[9].y+10 @ipod_arrow_down.z = 100 @ipod_arrow_up=Sprite.new @ipod_arrow_up.bitmap = Cache.system("CellPhone/arrow_up.png") @ipod_arrow_up.x = @ipod_slots[0].x+74 @ipod_arrow_up.y = @ipod_slots[0].y-10 @ipod_arrow_up.z = 100 @ipod_arrow_up.opacity=0 @ipod_cursor_graphic=Sprite.new @ipod_cursor_graphic.bitmap = Cache.system("CellPhone/msgbox_cursor.png") @ipod_cursor_graphic.x = @ipod_slots[0].x @ipod_cursor_graphic.y = @ipod_slots[0].y @ipod_cursor_graphic.z = 4 @ipod_title=Sprite.new @ipod_title.bitmap = Cache.system("CellPhone/ipod_title.png") @ipod_title.x=188 @ipod_title.y=83 @ipod_title.z=4 @ipod_title2=Sprite.new @ipod_title2.bitmap = Cache.system("CellPhone/msgbox_title2.png") @ipod_title2.x=188 @ipod_title2.y=313 @ipod_title2.z=4 @level=5 end def replace_ipod_slots aux2=86 @ipod_base.contents.clear for i in 0+@ipod_scroll..9+@ipod_scroll n=i+1 if @files[i] != nil @ipod_base.contents.font.size=10 @ipod_base.contents.draw_text(25,aux2,150,20,(n.to_s+" - "+@files[i]),0) else @ipod_base.contents.font.size=10 @ipod_base.contents.draw_text(25,aux2,150,20,(n.to_s+" - "),0) end aux2=aux2+19 end end def update_ipod_cursor if @ipod_slots[@ipod_cursor-@ipod_scroll] != nil @ipod_cursor_graphic.y = @ipod_slots[@ipod_cursor-@ipod_scroll].y end end def update_ipod_arrow_animation if(@aux>=0 && @aux<=5) @ipod_arrow_down.y=@ipod_arrow_down.y-1 @ipod_arrow_up.y=@ipod_arrow_up.y-1 @aux=@aux+0.5 end if(@aux>=5 &&@aux<=10) @ipod_arrow_down.y=@ipod_arrow_down.y+1 @ipod_arrow_up.y=@ipod_arrow_up.y+1 @aux=@aux+0.5 end if(@aux>=10) @aux=0 end end def update_input_lvl5 update_ipod_arrow_animation if @ipod_cursor==Mod::MAX_TRACKS_IN_MUSICLIST-1 already=true end if @ipod_cursor==0 already=false end if @ipod_cursor < (9-@ipod_scroll) @ipod_arrow_down.opacity=255 else if already==true @ipod_arrow_down.opacity=0 end end if @ipod_cursor > (9-@ipod_scroll) @ipod_arrow_up.opacity=255 else if already==false @ipod_arrow_up.opacity=0 end end if Input.trigger?(Input::DOWN) && @ipod_cursor<Mod::MAX_TRACKS_IN_MUSICLIST-1 @ipod_cursor=@ipod_cursor+1 if @ipod_cursor_graphic.y == @ipod_slots[9].y @ipod_scroll = @ipod_scroll + 1 replace_ipod_slots end end if Input.trigger?(Input::UP) && @ipod_cursor>0 @ipod_cursor=@ipod_cursor-1 if @ipod_cursor_graphic.y == @ipod_slots[0].y @ipod_scroll = @ipod_scroll - 1 replace_ipod_slots end end if Input.trigger?(Input::B) for i in 0..8 @ipod_slots[i].bitmap.dispose @ipod_slots[i]=nil end @ipod_base.contents.dispose @ipod_cursor_graphic.bitmap.dispose @ipod_title.bitmap.dispose @ipod_title2.bitmap.dispose @ipod_arrow_down.bitmap.dispose @ipod_arrow_up.bitmap.dispose create_icons end @aux3=@aux3+1 if @aux3>=5 if Input.trigger?(Input::C) if @files[@ipod_cursor] != nil @aux3=0 for i in 0..8 @ipod_slots[i].bitmap.dispose @ipod_slots[i]=nil end @ipod_base.contents.clear @ipod_cursor_graphic.bitmap.dispose @ipod_title.bitmap.dispose @ipod_title2.bitmap.dispose @ipod_arrow_down.bitmap.dispose @ipod_arrow_up.bitmap.dispose create_ipod_player(@ipod_cursor,1) end end end end # I-POD - LVL 6 - PLAYER def create_ipod_player(index,cursor) @file=index @ipod_player_cursor_index=cursor @ipod_player_col=Sprite.new @ipod_player_col.bitmap = Cache.system("CellPhone/ipod_player_col.png") @ipod_player_col.x = 198 @ipod_player_col.y = 142 @ipod_player_col.z = 7 @ipod_player=Sprite.new @ipod_player.bitmap = Cache.system("CellPhone/ipod_player.png") @ipod_player.x = 188 @ipod_player.y = 84 @ipod_player.z = 6 @ipod_player_cursor=Sprite.new @ipod_player_cursor.bitmap = Cache.system("CellPhone/ipod_cursor.png") @ipod_player_cursor.x = 247 @ipod_player_cursor.y = 220 @ipod_player_cursor.z = 7 @ipod_base.contents.font.size=12 @ipod_base.contents.draw_text(28,62,150,20,(@files[@file]),1) @level=6 end def update_input_lvl6 if Input.trigger?(Input::RIGHT) && @ipod_player_cursor_index<2 @ipod_player_cursor_index=@ipod_player_cursor_index+1 end if Input.trigger?(Input::LEFT) && @ipod_player_cursor_index>0 @ipod_player_cursor_index=@ipod_player_cursor_index-1 end if Input.trigger?(Input::DOWN) @ipod_player_cursor_index=3 @ipod_player_cursor.bitmap = Cache.system("CellPhone/ipod_cursor4.png") @ipod_player_cursor.x = 247 @ipod_player_cursor.y = 254 @ipod_player_cursor.z = 7 end if Input.trigger?(Input::UP) @ipod_player_cursor_index=1 @ipod_player_cursor.bitmap = Cache.system("CellPhone/ipod_cursor.png") @ipod_player_cursor.x = 247 @ipod_player_cursor.y = 220 @ipod_player_cursor.z = 7 end case @ipod_player_cursor_index when 0 @ipod_player_cursor.bitmap = Cache.system("CellPhone/ipod_cursor2.png") @ipod_player_cursor.x = 210 @ipod_player_cursor.y = 220 @ipod_player_cursor.z = 7 when 1 @ipod_player_cursor.bitmap = Cache.system("CellPhone/ipod_cursor.png") @ipod_player_cursor.x = 247 @ipod_player_cursor.y = 220 @ipod_player_cursor.z = 7 when 2 @ipod_player_cursor.bitmap = Cache.system("CellPhone/ipod_cursor3.png") @ipod_player_cursor.x = 280 @ipod_player_cursor.y = 222 @ipod_player_cursor.z = 7 end if Input.trigger?(Input::C) case @ipod_player_cursor_index when 0 if @files[@file-1]!=nil Audio.bgm_stop @ipod_player_col.bitmap.dispose @ipod_player.bitmap.dispose @ipod_player_cursor.bitmap.dispose @ipod_base.contents.clear create_ipod_player(@file-1,0) end when 1 Audio.bgm_play("Graphics/System/CellPhone/Memory/Music/"+@files[@file]) when 2 if @files[@file+1]!=nil Audio.bgm_stop @ipod_player_col.bitmap.dispose @ipod_player.bitmap.dispose @ipod_player_cursor.bitmap.dispose @ipod_base.contents.clear create_ipod_player(@file+1,2) end when 3 Audio.bgm_stop end end if Input.trigger?(Input::B) @ipod_player_col.bitmap.dispose @ipod_player.bitmap.dispose @ipod_player_cursor.bitmap.dispose @ipod_base.contents.clear create_icons end end #==================================================================# # Phone_Msg # Send messages to yhe player #==================================================================# class Phone_Msg < Window_Base def initialize(autor="Unknown",title="No title",msg="") super(0,0,40,42) self.opacity=0 if $phone_online==true if $messages[9] == nil $full_msgbox=false Audio.se_play(Mod::SMS_TONE) msg = msg.delete("\n") autor = autor.delete("\n") title= title.delete("\n") msg_array = msg.ltrim(190,self.contents.font.size,self.contents.font.name) array = [autor,title,msg_array,false,false] # readed, sended, deleted for i in 0..9 if $messages[i]==nil $messages[i]=array break end end $scene.one_time=true end if $messages[9] != nil $full_msgbox=true end end end end #==================================================================# # String Modification # RGSS++ #==================================================================# class String def trim @subself = self.clone loop do @subself[0,1] = "" if @subself[0,1] == " " @subself[-1,1] = "" if @subself[-1,1] == " " break if @subself[0,1] != " " and @subself[-1,1] != " " end return @subself end def ltrim (width, fontsize, fontname=0) str = self.trim.clone bit = Bitmap.new(1,1) bit.font.name = fontname bit.font.size = fontsize wordcount = 0 size = 0 line = "" word = "" result = [] while ((c = str.slice!(/./m)) != nil) wordcount += bit.text_size(c).width if c != " " word += c if c == " " and (wordcount + size) <= width line += word word = "" size += wordcount + bit.text_size(c).width wordcount = 0 end if c == " " and (wordcount + size) >= width result.push(line) line = word word = "" size = wordcount wordcount = 0 end if c == "\n" and line != "" result.push(line) line = "" size = 0 wordcount = 0 end end line += word if word != "" if line != "" result.push(line) end return result end end #==================================================================# # Scene_Map # Modification for Phone Notifications #==================================================================# class Scene_Map < Scene_Base attr_accessor :one_time alias start_phone start def start start_phone @one_time=true for i in 0..9 if $messages[i] !=nil if $messages[i][3] == false if @unreaded_msg == nil @unreaded_msg=0 @unreaded_msg=@unreaded_msg + 1 $messages[i][4]=true else @unreaded_msg=@unreaded_msg + 1 $messages[i][4]=true end end end end if @unreaded_msg !=nil if @unreaded_msg != 0 if @alert != nil @alert.bitmap.dispose end if @msg_alert_base != nil @msg_alert_base.contents.clear @msg_alert_base.dispose end @alert=Sprite.new @alert.bitmap = Cache.system("CellPhone/new_msgs.png") @alert.x=10 @alert.y=10 @msg_alert_base = Window_Base.new(-6,0,130,130) @msg_alert_base.contents.draw_text(0,74,100,20,@unreaded_msg.to_s,1) @msg_alert_base.opacity=0 end end end alias terminate_phone terminate def terminate terminate_phone if @msg_alert_base != nil super @msg_alert_base.contents.clear @msg_alert_base.dispose @alert.bitmap.dispose end end alias update_phone update def update update_phone if @msg_alert_base != nil @msg_alert_base.update end if @one_time==true for i in 0..9 if $messages[i] !=nil if $messages[i][3] == false if $messages[i][4]== false if @unreaded_msg == nil @unreaded_msg=0 @unreaded_msg=@unreaded_msg + 1 $messages[i][4]=true else @unreaded_msg=@unreaded_msg + 1 $messages[i][4]=true end end end end end if @unreaded_msg !=nil if @unreaded_msg != 0 if @alert != nil @alert.bitmap.dispose end if @msg_alert_base != nil @msg_alert_base.contents.clear @msg_alert_base.dispose end @alert=Sprite.new @alert.bitmap = Cache.system("CellPhone/new_msgs.png") @alert.x=10 @alert.y=10 @msg_alert_base = Window_Base.new(-6,0,130,130) @msg_alert_base.contents.draw_text(0,74,100,20,@unreaded_msg.to_s,1) @msg_alert_base.opacity=0 end end @one_time=false end end end #==================================================================# # Scene_Menu # Modification for Phone Option in Menu. #==================================================================# class Scene_Menu < Scene_Base def create_command_window if Mod::ADD_MENU_OPTION==true s1 = Vocab::item s2 = Vocab::skill s3 = Vocab::equip s4 = Vocab::status s5 = Mod::MENU_OPTION_TITLE s6 = Vocab::save s7 = Vocab::game_end @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7]) @command_window.index = @menu_index if $game_party.members.size == 0 # ??????? 0 ???? @command_window.draw_item(0, false) # ???????? @command_window.draw_item(1, false) # ??????? @command_window.draw_item(2, false) # ?????? @command_window.draw_item(3, false) # ????????? end if $game_system.save_disabled # ???????? @command_window.draw_item(4, false) # ??????? end end if Mod::ADD_MENU_OPTION==false s1 = Vocab::item s2 = Vocab::skill s3 = Vocab::equip s4 = Vocab::status s5 = Vocab::save s6 = Vocab::game_end @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6]) @command_window.index = @menu_index if $game_party.members.size == 0 # ??????? 0 ???? @command_window.draw_item(0, false) # ???????? @command_window.draw_item(1, false) # ??????? @command_window.draw_item(2, false) # ?????? @command_window.draw_item(3, false) # ????????? end if $game_system.save_disabled # ???????? @command_window.draw_item(4, false) # ??????? end end end def update_command_selection if Mod::ADD_MENU_OPTION==true if Input.trigger?(Input::B) Sound.play_cancel $scene = Scene_Map.new elsif Input.trigger?(Input::C) if $game_party.members.size == 0 and @command_window.index < 4 Sound.play_buzzer return elsif $game_system.save_disabled and @command_window.index == 4 Sound.play_buzzer return end Sound.play_decision case @command_window.index when 0 # ???? $scene = Scene_Item.new when 1,2,3 # ???????????? start_actor_selection when 4 $scene = Phone.new when 5 # ??? $scene = Scene_File.new(true, false, false) when 6 # ????? $scene = Scene_End.new end end end if Mod::ADD_MENU_OPTION==false if Input.trigger?(Input::B) Sound.play_cancel $scene = Scene_Map.new elsif Input.trigger?(Input::C) if $game_party.members.size == 0 and @command_window.index < 4 Sound.play_buzzer return elsif $game_system.save_disabled and @command_window.index == 4 Sound.play_buzzer return end Sound.play_decision case @command_window.index when 0 # ???? $scene = Scene_Item.new when 1,2,3 # ???????????? start_actor_selection when 4 # ??? $scene = Scene_File.new(true, false, false) when 5 # ????? $scene = Scene_End.new end end end end endLink to comment
Share on other sites
0 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now