ユーザ作成に完全対応

This commit is contained in:
2023-07-17 17:23:50 +09:00
parent 402c08b6dd
commit 549eeedbf3
12 changed files with 309 additions and 71 deletions
+10 -3
View File
@@ -1,3 +1,6 @@
#ifndef __CHAR__
#define __CHAR__
#module \
Char
@@ -6,6 +9,8 @@ Char
#defcfunc local \
New \
int p_posX,\
int p_posY,\
str p_text
If insNum <= 0 {
SDim charDict, 384
@@ -16,8 +21,8 @@ New \
text.insNum = p_text
posX.insNum = gInfo_cX
posY.insNum = gInfo_cY
posX.insNum = p_posX
posY.insNum = p_posY
size.insNum = CHAR_WIDTH
exists.insNum = True
@@ -29,7 +34,7 @@ New \
#deffunc local \
Destroy \
int p_insId
exists.insNum = False
exists.p_insId = False
Return
@@ -100,3 +105,5 @@ MyStrMid \
#global
#endif ; not __CHAR__
+5
View File
@@ -1,3 +1,6 @@
#ifndef __CHAT__
#define __CHAT__
#module \
Chat
@@ -23,3 +26,5 @@ Send \
#global
#endif ; not __CHAT__
+41
View File
@@ -0,0 +1,41 @@
#ifndef __DIALOGUE__
#define __DIALOGUE__
#module \
Dialogue
#const DIALOGUE_WIDTH 840
#const DIALOGUE_HEIGHT 600
#const DIALOGUE_TOP 360
#const DIALOGUE_BOTTOM (DIALOGUE_TOP + DIALOGUE_HEIGHT)
#const DIALOGUE_LEFT ((DISPLAY_WIDTH - DIALOGUE_WIDTH) / 2)
#const DIALOGUE_RIGHT ((DISPLAY_WIDTH + DIALOGUE_WIDTH) / 2)
#deffunc local \
Show
showing = True
Return
#deffunc local \
Hide
showing = False
Return
#deffunc local \
Draw
If showing = False {
Return
}
Pos DIALOGUE_LEFT, DIALOGUE_TOP
CelPut bufferId
Return
#global
#endif ; not __DIALOGUE__
+48 -46
View File
@@ -104,72 +104,74 @@ Eat \
Return
#deffunc local \
Draw \
int p_insId
Pos posX.p_insId - scale.p_insId * 50, posY.p_insId + scale.p_insId * 26
CelPut BUFFER_GOATOH_LEG, 0, scale.p_insId, scale.p_insId, legArgs.LEG_RF.p_insId
Draw
Repeat insNum
Pos posX.cnt - scale.cnt * 50, posY.cnt + scale.cnt * 26
CelPut BUFFER_GOATOH_LEG, 0, scale.cnt, scale.cnt, legArgs.LEG_RF.cnt
Pos posX.p_insId + scale.p_insId * 30, posY.p_insId + scale.p_insId * 26
CelPut BUFFER_GOATOH_LEG, 0, scale.p_insId, scale.p_insId, legArgs.LEG_RH.p_insId
Pos posX.cnt + scale.cnt * 30, posY.cnt + scale.cnt * 26
CelPut BUFFER_GOATOH_LEG, 0, scale.cnt, scale.cnt, legArgs.LEG_RH.cnt
Pos posX.p_insId + scale.p_insId * 64, posY.p_insId - scale.p_insId * 12
CelPut BUFFER_GOATOH_TAIL, 0, scale.p_insId, scale.p_insId
Pos posX.cnt + scale.cnt * 64, posY.cnt - scale.cnt * 12
CelPut BUFFER_GOATOH_TAIL, 0, scale.cnt, scale.cnt
Pos posX.p_insId, posY.p_insId
CelPut BUFFER_GOATOH_TARSO, 0, scale.p_insId, scale.p_insId
Pos posX.cnt, posY.cnt
CelPut BUFFER_GOATOH_TARSO, 0, scale.cnt, scale.cnt
Pos posX.p_insId - scale.p_insId * 30, posY.p_insId + scale.p_insId * 30
CelPut BUFFER_GOATOH_LEG, 0, scale.p_insId, scale.p_insId, legArgs.LEG_LF.p_insId
Pos posX.cnt - scale.cnt * 30, posY.cnt + scale.cnt * 30
CelPut BUFFER_GOATOH_LEG, 0, scale.cnt, scale.cnt, legArgs.LEG_LF.cnt
Pos posX.p_insId + scale.p_insId * 50, posY.p_insId + scale.p_insId * 30
CelPut BUFFER_GOATOH_LEG, 0, scale.p_insId, scale.p_insId, legArgs.LEG_LH.p_insId
Pos posX.cnt + scale.cnt * 50, posY.cnt + scale.cnt * 30
CelPut BUFFER_GOATOH_LEG, 0, scale.cnt, scale.cnt, legArgs.LEG_LH.cnt
Pos posX.p_insId - scale.p_insId * 64, posY.p_insId - scale.p_insId * 20
CelPut BUFFER_GOATOH_HEAD, 0, scale.p_insId, scale.p_insId, neckArg.p_insId
Pos posX.cnt - scale.cnt * 64, posY.cnt - scale.cnt * 20
CelPut BUFFER_GOATOH_HEAD, 0, scale.cnt, scale.cnt, neckArg.cnt
Pos posX.p_insId - scale.p_insId * 64, posY.p_insId - scale.p_insId * 20
If openingEyes {
If openingMouth {
CelPut BUFFER_GOATOH_FACE_OO, 0, scale.p_insId, scale.p_insId, neckArg.p_insId
Pos posX.cnt - scale.cnt * 64, posY.cnt - scale.cnt * 20
If openingEyes {
If openingMouth {
CelPut BUFFER_GOATOH_FACE_OO, 0, scale.cnt, scale.cnt, neckArg.cnt
}
Else {
CelPut BUFFER_GOATOH_FACE_OC, 0, scale.cnt, scale.cnt, neckArg.cnt
}
}
Else {
CelPut BUFFER_GOATOH_FACE_OC, 0, scale.p_insId, scale.p_insId, neckArg.p_insId
If openingMouth {
CelPut BUFFER_GOATOH_FACE_CO, 0, scale.cnt, scale.cnt, neckArg.cnt
}
Else {
CelPut BUFFER_GOATOH_FACE_CC, 0, scale.cnt, scale.cnt, neckArg.cnt
}
}
}
Else {
If openingMouth {
CelPut BUFFER_GOATOH_FACE_CO, 0, scale.p_insId, scale.p_insId, neckArg.p_insId
}
Else {
CelPut BUFFER_GOATOH_FACE_CC, 0, scale.p_insId, scale.p_insId, neckArg.p_insId
}
}
Loop
Interval@Goatoh p_insId
Interval@Goatoh
Return
#deffunc local \
Interval \
int p_insId
If walking.p_insId {
Walk@Goatoh p_insId
Interval
Repeat insNum
If walking.cnt {
Walk@Goatoh cnt
If frame.p_insId \ 150 == 30 {
MMPlay SOUND_MUMUMUMU
If frame.cnt \ 150 == 30 {
MMPlay SOUND_MUMUMUMU
openingMouth = True
openingMouth = True
}
}
Else: If running.cnt {
DoRun@Goatoh cnt
}
}
Else: If running.p_insId {
DoRun@Goatoh p_insId
}
If eating.p_insId {
Eat@Goatoh p_insId
}
If eating.cnt {
Eat@Goatoh cnt
}
frame.p_insId++
frame.cnt++
Loop
Return
+20 -8
View File
@@ -1,3 +1,9 @@
#include "./modules/char.mod.hsp"
#ifndef __KEYBOARD__
#define __KEYBOARD__
#module \
Keyboard
@@ -14,10 +20,10 @@ Hide
Return
#defcfunc local \
#deffunc local \
GetChar
if showing = False {
Return ""
Return
}
MTList getChar_id
@@ -25,17 +31,23 @@ GetChar
If stat = 0 {
touching = False
Return ""
Return
}
If touching {
Return ""
Return
}
MTInfo getChar_touchInfo, getChar_id.0
touching = True
If Length (getChar_touchInfo) < 4 {
Return
}
If getChar_touchInfo.2 < 1920 - 480 {
Return ""
Return
}
getChar_charId = (1080 - getChar_touchInfo.1) / 96 * 5 + (getChar_touchInfo.2 - (1920 - 480)) / 96
@@ -45,9 +57,7 @@ GetChar
Poke text, getChar_textLength + cnt, Peek (charDict@Char, getChar_charId * 3 + cnt)
Loop
touching = True
Return ""
Return
#deffunc local \
Draw
@@ -67,3 +77,5 @@ Draw
#global
#endif ; not __KEYBOARD__
+96
View File
@@ -0,0 +1,96 @@
#ifndef __MY_BUTTON__
#define __MY_BUTTON__
#module \
MyButton
#const SIZE_X 240
#const SIZE_Y 120
#const ZOOM 0.8
#defcfunc local \
New \
int p_posX,\
int p_posY,\
int p_bufferId,\
label p_onClicked
posX.insNum = p_posX
posY.insNum = p_posY
bufferId.insNum = p_bufferId
onClicked.insNum = p_onClicked
touching.insNum = False
exists.insNum = True
insNum++
Return insNum - 1
#deffunc local \
Destroy \
int p_insId
exists.p_insId = False
Return
#deffunc local \
Interval \
int p_insId,\
local l_id,\
local l_touchInfo
MTList l_id
If stat = 0 {
touching.p_insId = False
Return
}
If touching.p_insId {
Return
}
MTInfo l_touchInfo, l_id.0
touching.p_insId = True
If l_touchInfo.1 < posX.p_insId - ZOOM * SIZE_X / 2 {
Return
}
If l_touchInfo.1 >= posX.p_insId + ZOOM * SIZE_X / 2 {
Return
}
If l_touchInfo.2 < posY.p_insId - ZOOM * SIZE_Y / 2 {
Return
}
If l_touchInfo.2 >= posY.p_insId + ZOOM * SIZE_Y / 2 {
Return
}
GoSub onClicked.p_insId
Return
#deffunc local \
Draw
Repeat insNum
If exists.cnt = False {
Continue
}
Pos posX.cnt, posY.cnt
CelPut bufferId.cnt, 0, ZOOM, ZOOM
Loop
Interval
Return
#global
#endif ; not __MY_BUTTON__
+67
View File
@@ -0,0 +1,67 @@
#include "./modules/dialogue.mod.hsp"
#include "./modules/my_button.mod.hsp"
#include "./modules/keyboard.mod.hsp"
#include "./modules/char.mod.hsp"
#include "./modules/user.mod.hsp"
#ifndef __NAME_DIALOGUE__
#define __NAME_DIALOGUE__
#module \
NameDialogue
#const DIALOGUE_TOP DIALOGUE_TOP@Dialogue
#const DIALOGUE_BOTTOM DIALOGUE_BOTTOM@Dialogue
#const DIALOGUE_LEFT DIALOGUE_LEFT@Dialogue
#const DIALOGUE_RIGHT DIALOGUE_RIGHT@Dialogue
#deffunc local \
Show
ButtonOk = New@MyButton (DISPLAY_WIDTH / 2, DIALOGUE_BOTTOM@Dialogue - 132, BUFFER_BUTTON_OK, *Ok)
Char = New@Char (DIALOGUE_LEFT + 168, DIALOGUE_TOP + 272, "")
size@Char.Char = 64
Show@Keyboard
bufferId@Dialogue = BUFFER_NAME_DIALOGUE
Show@Dialogue
Return
#deffunc local \
Hide
Destroy@MyButton ButtonOk
Destroy@Char Char
Hide@Keyboard
Hide@Dialogue
Return
#deffunc local \
Interval
GetChar@Keyboard
text@Char.Char = text@Keyboard
Return
#deffunc local \
Draw
Draw@Dialogue
Draw@MyButton
Interval
Return
*Ok
Hide
Create@User text@Keyboard
Return
#global
#endif ; not __NAME_DIALOGUE__
+2 -1
View File
@@ -6,8 +6,9 @@ User
#deffunc local \
Create \
str p_name,\
local l_data
HTTPLoad CREATE_URL
HTTPLoad CREATE_URL + "?name=" + p_name
HTTPInfo l_data
id = 0