-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcrawli-tts-saveload.rb
More file actions
122 lines (116 loc) · 4.48 KB
/
crawli-tts-saveload.rb
File metadata and controls
122 lines (116 loc) · 4.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
class IntroEventScene
alias :crawlittssaveload_old_openSplash :openSplash
def openSplash(scene,args)
tts("Pokemon Rejuvenation")
tts("Press Enter")
crawlittssaveload_old_openSplash(scene,args)
end
end
class PokemonLoadScene
def pbDrawSaveCommands(savefiles)
@savefiles = savefiles
@sprites["overlay"].bitmap.clear
textpos = []
if savefiles.length >= 9
numsavebuttons = 9
else
numsavebuttons = savefiles.length
end
for i in 0...numsavebuttons
@sprites["savefile#{i}"] = IconSprite.new(Graphics.width / 2 - 384 / 2, i * 45, @viewport)
@sprites["savefile#{i}"].setBitmap("Graphics/Pictures/loadsavepanel")
@sprites["savefile#{i}"].zoom_x = 0.5
@sprites["savefile#{i}"].zoom_y = 0.5
Graphics.update
loop do
@sprites["savefile#{i}"].zoom_x += 0.5
@sprites["savefile#{i}"].zoom_y += 0.5
Graphics.update
break if @sprites["savefile#{i}"].zoom_x == 1
end
if i < 10
if savefiles[i][1].start_with?("Anna's Wish")
textpos.push([savefiles[i][1], Graphics.width / 2 - savefiles[i][1].length * 4.5, i * 45 + 12, 0, Color.new(218, 182, 214), Color.new(139, 131, 148)])
else
textpos.push([savefiles[i][1], Graphics.width / 2 - savefiles[i][1].length * 4.5, i * 45 + 12, 0, Color.new(255, 255, 255), Color.new(125, 125, 125)])
end
pbDrawTextPositions(@sprites["overlay"].bitmap, textpos)
end
end
pbDrawSaveText(savefiles)
@sprites["saveselect"] = IconSprite.new(Graphics.width / 2 - 384 / 2, 0, @viewport)
@sprites["saveselect"].setBitmap("Graphics/Pictures/loadsavepanel_1")
Graphics.update
pbToggleSelecting
tts(@savefiles[0][1]) ### MODDED
end
def pbMoveSaveSel(index)
tts(@savefiles[index][1]) ### MODDED
@index = index
if index <= 7
@sprites["saveselect"].y = index * 45
pbDrawSaveText(@savefiles)
elsif index == @savefiles.length - 1
@sprites["saveselect"].y = 7 * 45
pbDrawSaveText(@savefiles, 0, 45 * (index - 7))
else
pbDrawSaveText(@savefiles, 0, 45 * (index - 7))
end
if index == (@savefiles.length - 1) && @savefiles.length - 1 >= 8
@sprites["savefile8"].visible = false if @sprites["savefile8"]
else
@sprites["savefile8"].visible = true if @sprites["savefile8"]
end
Graphics.update
end
# def pbChoose(commands)
# @sprites["cmdwindow"].commands = commands
# lastread = nil ### MODDED
# loop do
# Graphics.update
# Input.update
# tts(commands[@sprites["cmdwindow"].index]) if @sprites["cmdwindow"].index != lastread ### MODDED
# lastread = @sprites["cmdwindow"].index ### MODDED
# pbUpdate
# if Input.trigger?(Input::C) && (!@saveselecting || @saveselecting == false)
# return @sprites["cmdwindow"].index
# end
# end
# end
end
class PokemonSaveScene
def pbStartScreen
@viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
@viewport.z=99999
@sprites={}
totalsec = Graphics.time_passed / 40 + (Process.clock_gettime(Process::CLOCK_MONOTONIC) - Graphics.start_playing).to_i
hour = totalsec / 60 / 60
min = totalsec / 60 % 60
mapname=$game_map.name
textColor="0070F8,78B8E8"
loctext=_INTL("<ac><c2=06644bd2>{1}</c2></ac>",mapname)
tts(mapname) ### MODDED
loctext+=_INTL("Player<r><c3={1}>{2}</c3><br>",textColor,$Trainer.name)
tts($Trainer.name) ### MODDED
loctext+=_ISPRINTF("Time<r><c3={1:s}>{2:02d}:{3:02d}</c3><br>",textColor,hour,min)
loctext+=_INTL("Badges<r><c3={1}>{2}</c3><br>",textColor,$Trainer.numbadges)
tts("#{$Trainer.numbadges} badges") ### MODDED
if $Trainer.pokedex.canViewDex
loctext+=_INTL("Pokédex<r><c3={1}>{2}/{3}</c3><br>",textColor,$Trainer.pokedex.getOwnedCount,$Trainer.pokedex.getSeenCount)
tts("Pokédex: owned #{$Trainer.pokedex.getOwnedCount} / seen #{$Trainer.pokedex.getSeenCount}") ### MODDED
end
if $Unidata[:saveslot]>1
loctext+=_INTL("Save File:<r><c3={1}>{2}</c3><br>",textColor,$Unidata[:saveslot])
tts("Save File: #{$Unidata[:saveslot]}") ### MODDED
else
loctext+=_INTL("Save File:<r><c3={1}>1</c3><br>",textColor)
tts("Save File: 1") ### MODDED
end
@sprites["locwindow"]=Window_AdvancedTextPokemon.new(loctext)
@sprites["locwindow"].viewport=@viewport
@sprites["locwindow"].x=0
@sprites["locwindow"].y=0
@sprites["locwindow"].width=228 if @sprites["locwindow"].width<228
@sprites["locwindow"].visible=true
end
end