Browse Source

設定機能

main
Miteruzo 1 year ago
parent
commit
9be74a872a
3 changed files with 46 additions and 5 deletions
  1. +5
    -1
      main.hsp
  2. +37
    -0
      modules/setting.mod.hsp
  3. +4
    -4
      modules/user.mod.hsp

+ 5
- 1
main.hsp View File

@@ -34,6 +34,7 @@
#include "./modules/chat.mod.hsp"
#include "./modules/char.mod.hsp"
#include "./modules/keyboard.mod.hsp"
#include "./modules/setting.mod.hsp"


#ifdef _DEBUG
@@ -76,6 +77,9 @@
; ゴートうインスタンス生成
Goatoh = New@Goatoh (960, 800, DIRECTION_LEFT)

; 設定読込み
Load@Setting

; サウンド読込み
MMLoad "mumumumu.wav", SOUND_MUMUMUMU
MMLoad "MusMus-BGM-097.mp3", SOUND_BGM, MM_REPEAT
@@ -101,7 +105,7 @@
Draw@Char
Draw@Keyboard

a = GetChar@Keyboard ()
Print GetChar@Keyboard () != False
text@Char.Text = text@Keyboard
ReDraw True



+ 37
- 0
modules/setting.mod.hsp View File

@@ -0,0 +1,37 @@
#module \
Setting

#define FILE_NAME ("setting.dat")

; ユーザ ID
#const USER_ID_OFFSET 0
#const USER_ID_SIZE 4

; ユーザのパスコード
#const USER_PASSCODE_OFFSET (USER_ID_OFFSET + USER_ID_SIZE)
#const USER_PASSCODE_SIZE 16

#deffunc local \
Load
userId = 0
SDim userPasscode, USER_PASSCODE_SIZE

Exist FILE_NAME
If strSize < 0 {
Return
}

BLoad FILE_NAME, userId, USER_ID_SIZE, USER_ID_OFFSET
BLoad FILE_NAME, userPasscode, USER_PASSCODE_SIZE, USER_PASSCODE_OFFSET

Return

#deffunc local \
Save
BSave FILE_NAME, userId, USER_ID_SIZE, USER_ID_OFFSET
BSave FILE_NAME, userPasscode, USER_PASSCODE_SIZE, USER_PASSCODE_OFFSET

Return

#global


+ 4
- 4
modules/user.mod.hsp View File

@@ -1,7 +1,7 @@
#module \
User

#define URL (CONFIG_SERVER_URL + "/make_user.php")
#define URL (CONFIG_SERVER_URL + "/create_user.php")

#defcfunc local \
New
@@ -13,11 +13,11 @@ New
Return insNum - 1

#deffunc local \
Make \
Create \
int p_insId,\
local data
local l_data
HTTPLoad URL
HTTPInfo data
HTTPInfo l_data

id.p_insId = 0
pass.p_insId = ""


Loading…
Cancel
Save