#defcfunc の中では,ほかの #defcfunc で宣言された関数を利用できなぃらしぃ.
This commit is contained in:
+57
-19
@@ -8,9 +8,10 @@ Char
|
||||
New \
|
||||
str p_text
|
||||
If insNum <= 0 {
|
||||
NoteSel charDict
|
||||
NoteLoad "dict.dat"
|
||||
NoteUnsel
|
||||
SDim charDict, 384
|
||||
SDim text, 1024
|
||||
|
||||
BLoad "dict.dat", charDict
|
||||
}
|
||||
|
||||
text.insNum = p_text
|
||||
@@ -34,31 +35,68 @@ Destroy \
|
||||
|
||||
#deffunc local \
|
||||
Draw \
|
||||
local cnt_,\
|
||||
local found,\
|
||||
local zoom
|
||||
local l_cnt,\
|
||||
local l_found
|
||||
Repeat insNum
|
||||
If exists.cnt {
|
||||
cnt_ = cnt
|
||||
l_cnt = cnt
|
||||
|
||||
NoteSel charDict
|
||||
Repeat StrLen (text.cnt_) / 3
|
||||
Pos posX.cnt_ + cnt * size.cnt_, posY.cnt_
|
||||
Repeat StrLen (text.l_cnt) / 3
|
||||
l_found = MyInStr (charDict, 0, StrMid (text.l_cnt, cnt * 3, 3)) / 3
|
||||
|
||||
found = NoteFind (StrMid (text.cnt_, cnt * 3, 3))
|
||||
If darw_found < 0 {
|
||||
l_found = UNKNOWN
|
||||
}
|
||||
|
||||
If found = -1 {
|
||||
found = UNKNOWN
|
||||
}
|
||||
|
||||
zoom = Double (size.cnt_) / CHAR_WIDTH
|
||||
CelPut BUFFER_CHAR, found, zoom, zoom
|
||||
Loop
|
||||
NoteUnsel
|
||||
Pos posX.l_cnt + cnt * size.l_cnt, posY.l_cnt
|
||||
l_zoom = Double (size.l_cnt) / CHAR_WIDTH
|
||||
CelPut BUFFER_CHAR, l_found, l_zoom, l_zoom
|
||||
Loop
|
||||
}
|
||||
Loop
|
||||
|
||||
Return
|
||||
|
||||
#defcfunc local \
|
||||
MyInStr \
|
||||
str p_haystack,\
|
||||
int p_offset,\
|
||||
str p_needle
|
||||
myInStr_haystack = p_haystack
|
||||
|
||||
myInStr_flag = True
|
||||
|
||||
Repeat StrLen (myInStr_haystack) / 3
|
||||
SDim myInStr_work, 3
|
||||
myInStr_cnt = cnt
|
||||
Repeat 3
|
||||
Poke myInStr_work, cnt, Peek (myInStr_haystack, myInStr_cnt * 3 + cnt)
|
||||
Loop
|
||||
|
||||
If myInStr_work = p_needle {
|
||||
myInStr_flag = False
|
||||
|
||||
Break
|
||||
}
|
||||
Loop
|
||||
|
||||
If myInStr_flag {
|
||||
Return -1
|
||||
}
|
||||
|
||||
Return myInStr_cnt * 3
|
||||
|
||||
#defcfunc local \
|
||||
MyStrMid \
|
||||
str p_string,\
|
||||
int p_offset,\
|
||||
int p_length,\
|
||||
int p_test
|
||||
myStrMid_string = p_string
|
||||
|
||||
SDim myStrMid_return, p_length
|
||||
|
||||
Return myStrMid_return
|
||||
|
||||
#global
|
||||
|
||||
|
||||
+18
-14
@@ -15,33 +15,37 @@ Hide
|
||||
Return
|
||||
|
||||
#defcfunc local \
|
||||
GetChar \
|
||||
local l_ids,\
|
||||
local l_touchInfo,\
|
||||
local l_charId,\
|
||||
local l_char
|
||||
GetChar
|
||||
if showing = False {
|
||||
Return ""
|
||||
}
|
||||
|
||||
MTList l_id
|
||||
MTList getChar_id
|
||||
|
||||
If stat = 0 {
|
||||
touching = False
|
||||
|
||||
Return ""
|
||||
}
|
||||
|
||||
MTInfo l_touchInfo, l_id.0
|
||||
|
||||
If l_touchInfo.2 < 1920 - 480 {
|
||||
If touching {
|
||||
Return ""
|
||||
}
|
||||
|
||||
l_charId = (1080 - l_touchInfo.1) / 96 * 5 + (l_touchInfo.2 - (1920 - 480)) / 96
|
||||
MTInfo getChar_touchInfo, getChar_id.0
|
||||
|
||||
NoteSel charDict@Char
|
||||
NoteGet l_char, l_charId
|
||||
text += l_char
|
||||
NoteUnsel
|
||||
If getChar_touchInfo.2 < 1920 - 480 {
|
||||
Return ""
|
||||
}
|
||||
|
||||
getChar_charId = (1080 - getChar_touchInfo.1) / 96 * 5 + (getChar_touchInfo.2 - (1920 - 480)) / 96
|
||||
getChar_textLength = StrLen (text)
|
||||
|
||||
Repeat 3
|
||||
Poke text, getChar_textLength + cnt, Peek (charDict@Char, getChar_charId * 3 + cnt)
|
||||
Loop
|
||||
|
||||
touching = True
|
||||
|
||||
Return ""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user