home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 3
/
PDCD_3.iso
/
games2
/
solutions
/
!Solutions
/
!RunImage
(
.txt
)
< prev
next >
Wrap
RISC OS BBC BASIC V Source
|
1994-05-21
|
7KB
|
324 lines
>!RunImage
taskname$="Solutions"
dirname$="<solutions$dir>"
iconname$="!Solutions"
menuname$="Solns"
nagg(
$+" at line "+
taskid% 8:$taskid%="TASK"
"Wimp_Initialise",200,!taskid%,taskname$
version%,taskhand%
block% 1024,menu% 127,command% 80,wblk% 2048
"Hourglass_On"
sprites
templates
setupmenu
initsol
iconid%=
"Hourglass_Off"
"Wimp_Poll",1,block%
reason%
reason%
2 :
"Wimp_OpenWindow",,block%
1 :
"Wimp_RedrawWindow",,block%
3 :
"Wimp_CloseWindow",,block%
9 :
!block%=1
block%!4=-1
savestatus:
6 :
iconclicked(block%!12,block%!16)
8 :
keypressed(block%!24)
17,18:
keypressed(code%)
"Wimp_ProcessKey",code%
nagg(nagg$)
"Wimp_ReportError"," "+nagg$,1<<4,taskname$
iconclicked(window%,icon%)
window%<0
icon%=iconid%
click_type:
(block%!8)=2
popupmenu((icon%=iconid%)
(window%=-2)):
window%<>main%
icon%>7
icon%<10
move(icon%=9)
block%!0=-1
block%!4=0
block%!8=0 :
Y DIRECTION
7 block%!12=74 :
X DIRECTION
block%!16=96
block%!20=&2002
$(block%+24)=iconname$
"Wimp_CreateIcon",,block%
icon%
=icon%
nagg("Error in death throes!"):
b%=1
(b%?fontarray%)>0
B
i%=1
(b%?fontarray%)
"Font_LoseFont",b%
D
"Wimp_CloseDown",taskhand%,!taskid%
click_type
c%=block%!8
c%=4
select
c%=2
popupmenu(
c%=1
adjust
block%!16=0
savestatus:
file(where%)
file$=""
?where%
file$+=
(?where%)
where%+=1
=file$
setupmenu
_4$menu%=menuname$: :
menu title
`Emenu%?12=7:menu%?13=2 :
title foreground & background
aEmenu%?14=7:menu%?15=0 :
menu foreground & background
(menuname$)>5
c" menu%!16=(
(menuname$)+1)*16
menu%!16=6*16
g2menu%!20=44 :
width & height of items
h@menu%!24=0 :
vertical gap twixt items
menu%!28=0
menu%!32=inf_win%
menu%!36=&7000021
$(menu%+40)="Info"
menu%!52=128
menu%!56=-1
menu%!60=&7000021
$(menu%+64)="Quit"
popupmenu(bar%)
"Wimp_GetPointerInfo",,block%
q=!block%:w=block%!4
bar%
w=96+44+44
w+=22
"Wimp_CreateMenu",,menu%,q-64,w
templates
fontarray% 256
b%=0
252
b%!fontarray%=0
infb% 600,infi% 200
mainb% 1024,maini% 512
"Wimp_OpenTemplate",,dirname$+".<sols$templates>"
:inf_win%=
template("info",infb%,infi%,200,-1,sprites%)
<main%=
template("chooser",mainb%,maini%,512,-1,sprites%)
"Wimp_CloseTemplate"
template(name$,buf%,ind%,len%,fonts%,sprs%)
"Wimp_LoadTemplate",,buf%,ind%,ind%+len%,fonts%,name$,0
buf%!64=sprs%
"Wimp_CreateWindow",,buf%
handle%
=handle%
sprites
#file%=
(dirname$+".SpriteFile")
file%=0
nagg("Can't find spritefile!"):
#file%)+128
#file%
sprites% S%
sprites%!0=S%
sprites%!8=16
"OS_SpriteOp",9+256,sprites%
"OS_SpriteOp",10+256,sprites%,dirname$+".SPRITEFILE"
select
openwindow(main%)
adjust
openwindow(main%)
openwindow(window%)
!wblk%=window%
"Wimp_GetWindowState",,wblk%
wblk%!28=-1
flags%=wblk%!32
(flags%
1<<16)=0
!wblk%=window%
"Wimp_GetWindowInfo",,wblk%
! width%=(wblk%!12)-(wblk%!4)
wide%=2111
wide%=1279
" wblk%!4=wide%
2 - width%
wblk%!12=(wblk%!4)+width%
wblk%!28=-1
"Wimp_OpenWindow",,wblk%
pii(window%,icon%,text$)
!wblk%=window%
wblk%!4=icon%
"Wimp_GetIconState",,wblk%
$(wblk%!28)=text$
wblk%!8=0
wblk%!12=0
"Wimp_SetIconState",,wblk%
pii2(window%,icon%,text$)
!wblk%=window%
wblk%!4=icon%
"Wimp_GetIconState",,wblk%
$(wblk%!28)=text$
contents(window%,icon%)
!wblk%=window%
wblk%!4=icon%
"Wimp_GetIconState",,wblk%
=$(wblk%!28)
shade(window%,icon%,shade%)
!wblk%=window%
wblk%!4=icon%
"Wimp_GetIconState",,wblk%
wblk%!12=1<<22
wblk%!8=(-shade%)<<22
"Wimp_SetIconState",,wblk%
closewindow(window%)
!wblk%=window%
"Wimp_CloseWindow",,wblk%
output(sprite$)
sprite$=""
"OS_SpriteOp",or0%,or1%,or2%,or3%
"OS_SpriteOp",256+60,sprites%,sprite$,0
or0%,or1%,or2%,or3%
changeval(window%,icon%,to$)
!wblk%=window%
wblk%!4=icon%
"Wimp_GetIconState",,wblk%
$(wblk%!32)=to$
wblk%!8=0
wblk%!12=0
"Wimp_SetIconState",,wblk%
selected(window%,icon%,well%)
!wblk%=window%
wblk%!4=icon%
wblk%!12=1<<21
wblk%!8=(-well%)<<21
"Wimp_SetIconState",,wblk%
isselected(win%,icon%)
!wblk%=window%:wblk%!4=icon%
"Wimp_GetIconState",,wblk%
=((wblk%!24)
1<<21)
buttontype(window%,icon%,bt%)
!wblk%=window%
wblk%!4=icon%
wblk%!12=%1111<<12
wblk%!8=bt%<<12
"Wimp_SetIconState",,wblk%
initsol
currentclue%=0
sys$(100),plan$(100),shape$(100),note$(100)
@sys$()="Unknown":shape$()="N/A":plan$()="Unknown":note$()=""
dsys$(0)="":plan$(0)="":shape$(0)="":note$(0)="Welcome to !Solutions by the Angelos
Thanatou"
file%=
(dirname$+".soldat")
file%=0
nagg("Where're my resources!"):
#file%
line$=
#file%
solnum%=
(line$)
6 line$=
line$,
(line$)-5) :
skip the "XX : " bit
sys$(solnum%)=""
line$,1)<>
line$<>""
sys$(solnum%)+=
line$,1)
line$=
line$,
(line$)-1)
. line$=
line$,
(line$)-1) :
skip the TAB
plan$(solnum%)=""
line$,1)<>
line$<>""
! plan$(solnum%)+=
line$,1)
line$=
line$,
(line$)-1)
; line$=
line$,
(line$)-1) :
skip the TAB (if present)
line$<>""
shape$(solnum%)=line$
shape$(solnum%)="n/a"
#file%
file%=
(dirname$+".notedat")
file%=0
nagg("Where're my resources!"):
#file%
line$=
#file%
!* notenum%=
(line$):note$(notenum%)=""
note$=
#file%
$$ note$(notenum%)+=(note$+" ")
#file%
note$=""
note$(solnum%),1)=" "
'; note$(solnum%)=
note$(solnum%),
(note$(solnum%))-1)
#file%
file%=
(dirname$+".status")
file%
currentclue%=
#file%:
#file%
clue(currentclue%)
clue(num%)
pii(main%,7,
(num%))
pii(main%,2,sys$(num%))
pii(main%,11,shape$(num%))
pii(main%,4,plan$(num%))
contents(main%,6)<>note$(num%)
pii(main%,6,note$(num%))
savestatus
?block%=currentclue%
"XOS_CLI","SAVE "+dirname$+".status "+
~block%+" +1"
"XOS_CLI","STAMP "+dirname$+".status"
move(dir%)
dir%=0
dir%=1
currentclue%+dir%>0
currentclue%+dir%<101
currentclue%+=dir%:
clue(currentclue%)