Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
ygopro
Commits
124269e7
Commit
124269e7
authored
Apr 21, 2024
by
Chen Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add max length to edit box
parent
562ad942
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
gframe/game.cpp
gframe/game.cpp
+23
-0
gframe/game.h
gframe/game.h
+3
-0
No files found.
gframe/game.cpp
View file @
124269e7
...
...
@@ -203,17 +203,21 @@ bool Game::Initialize() {
env
->
addStaticText
(
dataManager
.
GetSysString
(
1220
),
rect
<
s32
>
(
10
,
30
,
220
,
50
),
false
,
false
,
wLanWindow
);
ebNickName
=
env
->
addEditBox
(
gameConf
.
nickname
,
rect
<
s32
>
(
110
,
25
,
450
,
50
),
true
,
wLanWindow
);
ebNickName
->
setTextAlignment
(
irr
::
gui
::
EGUIA_UPPERLEFT
,
irr
::
gui
::
EGUIA_CENTER
);
editbox_list
.
push_back
(
ebNickName
);
lstHostList
=
env
->
addListBox
(
rect
<
s32
>
(
10
,
60
,
570
,
320
),
wLanWindow
,
LISTBOX_LAN_HOST
,
true
);
lstHostList
->
setItemHeight
(
18
);
btnLanRefresh
=
env
->
addButton
(
rect
<
s32
>
(
240
,
325
,
340
,
350
),
wLanWindow
,
BUTTON_LAN_REFRESH
,
dataManager
.
GetSysString
(
1217
));
env
->
addStaticText
(
dataManager
.
GetSysString
(
1221
),
rect
<
s32
>
(
10
,
360
,
220
,
380
),
false
,
false
,
wLanWindow
);
ebJoinHost
=
env
->
addEditBox
(
gameConf
.
lasthost
,
rect
<
s32
>
(
110
,
355
,
350
,
380
),
true
,
wLanWindow
);
ebJoinHost
->
setTextAlignment
(
irr
::
gui
::
EGUIA_CENTER
,
irr
::
gui
::
EGUIA_CENTER
);
editbox_list
.
push_back
(
ebJoinHost
);
ebJoinPort
=
env
->
addEditBox
(
gameConf
.
lastport
,
rect
<
s32
>
(
360
,
355
,
420
,
380
),
true
,
wLanWindow
);
ebJoinPort
->
setTextAlignment
(
irr
::
gui
::
EGUIA_CENTER
,
irr
::
gui
::
EGUIA_CENTER
);
editbox_list
.
push_back
(
ebJoinPort
);
env
->
addStaticText
(
dataManager
.
GetSysString
(
1222
),
rect
<
s32
>
(
10
,
390
,
220
,
410
),
false
,
false
,
wLanWindow
);
ebJoinPass
=
env
->
addEditBox
(
gameConf
.
roompass
,
rect
<
s32
>
(
110
,
385
,
420
,
410
),
true
,
wLanWindow
);
ebJoinPass
->
setTextAlignment
(
irr
::
gui
::
EGUIA_CENTER
,
irr
::
gui
::
EGUIA_CENTER
);
editbox_list
.
push_back
(
ebJoinPass
);
btnJoinHost
=
env
->
addButton
(
rect
<
s32
>
(
460
,
355
,
570
,
380
),
wLanWindow
,
BUTTON_JOIN_HOST
,
dataManager
.
GetSysString
(
1223
));
btnJoinCancel
=
env
->
addButton
(
rect
<
s32
>
(
460
,
385
,
570
,
410
),
wLanWindow
,
BUTTON_JOIN_CANCEL
,
dataManager
.
GetSysString
(
1212
));
btnCreateHost
=
env
->
addButton
(
rect
<
s32
>
(
460
,
25
,
570
,
50
),
wLanWindow
,
BUTTON_CREATE_HOST
,
dataManager
.
GetSysString
(
1224
));
...
...
@@ -261,6 +265,7 @@ bool Game::Initialize() {
myswprintf
(
strbuf
,
L"%d"
,
180
);
ebTimeLimit
=
env
->
addEditBox
(
strbuf
,
rect
<
s32
>
(
140
,
115
,
220
,
140
),
true
,
wCreateHost
);
ebTimeLimit
->
setTextAlignment
(
irr
::
gui
::
EGUIA_CENTER
,
irr
::
gui
::
EGUIA_CENTER
);
editbox_list
.
push_back
(
ebTimeLimit
);
env
->
addStaticText
(
dataManager
.
GetSysString
(
1228
),
rect
<
s32
>
(
20
,
150
,
320
,
170
),
false
,
false
,
wCreateHost
);
env
->
addStaticText
(
dataManager
.
GetSysString
(
1236
),
rect
<
s32
>
(
20
,
180
,
220
,
200
),
false
,
false
,
wCreateHost
);
cbDuelRule
=
env
->
addComboBox
(
rect
<
s32
>
(
140
,
175
,
300
,
200
),
wCreateHost
);
...
...
@@ -276,20 +281,25 @@ bool Game::Initialize() {
myswprintf
(
strbuf
,
L"%d"
,
8000
);
ebStartLP
=
env
->
addEditBox
(
strbuf
,
rect
<
s32
>
(
140
,
235
,
220
,
260
),
true
,
wCreateHost
);
ebStartLP
->
setTextAlignment
(
irr
::
gui
::
EGUIA_CENTER
,
irr
::
gui
::
EGUIA_CENTER
);
editbox_list
.
push_back
(
ebStartLP
);
env
->
addStaticText
(
dataManager
.
GetSysString
(
1232
),
rect
<
s32
>
(
20
,
270
,
320
,
290
),
false
,
false
,
wCreateHost
);
myswprintf
(
strbuf
,
L"%d"
,
5
);
ebStartHand
=
env
->
addEditBox
(
strbuf
,
rect
<
s32
>
(
140
,
265
,
220
,
290
),
true
,
wCreateHost
);
ebStartHand
->
setTextAlignment
(
irr
::
gui
::
EGUIA_CENTER
,
irr
::
gui
::
EGUIA_CENTER
);
editbox_list
.
push_back
(
ebStartHand
);
env
->
addStaticText
(
dataManager
.
GetSysString
(
1233
),
rect
<
s32
>
(
20
,
300
,
320
,
320
),
false
,
false
,
wCreateHost
);
myswprintf
(
strbuf
,
L"%d"
,
1
);
ebDrawCount
=
env
->
addEditBox
(
strbuf
,
rect
<
s32
>
(
140
,
295
,
220
,
320
),
true
,
wCreateHost
);
ebDrawCount
->
setTextAlignment
(
irr
::
gui
::
EGUIA_CENTER
,
irr
::
gui
::
EGUIA_CENTER
);
editbox_list
.
push_back
(
ebDrawCount
);
env
->
addStaticText
(
dataManager
.
GetSysString
(
1234
),
rect
<
s32
>
(
10
,
360
,
220
,
380
),
false
,
false
,
wCreateHost
);
ebServerName
=
env
->
addEditBox
(
gameConf
.
gamename
,
rect
<
s32
>
(
110
,
355
,
250
,
380
),
true
,
wCreateHost
);
ebServerName
->
setTextAlignment
(
irr
::
gui
::
EGUIA_CENTER
,
irr
::
gui
::
EGUIA_CENTER
);
editbox_list
.
push_back
(
ebServerName
);
env
->
addStaticText
(
dataManager
.
GetSysString
(
1235
),
rect
<
s32
>
(
10
,
390
,
220
,
410
),
false
,
false
,
wCreateHost
);
ebServerPass
=
env
->
addEditBox
(
L""
,
rect
<
s32
>
(
110
,
385
,
250
,
410
),
true
,
wCreateHost
);
ebServerPass
->
setTextAlignment
(
irr
::
gui
::
EGUIA_CENTER
,
irr
::
gui
::
EGUIA_CENTER
);
editbox_list
.
push_back
(
ebServerPass
);
btnHostConfirm
=
env
->
addButton
(
rect
<
s32
>
(
260
,
355
,
370
,
380
),
wCreateHost
,
BUTTON_HOST_CONFIRM
,
dataManager
.
GetSysString
(
1211
));
btnHostCancel
=
env
->
addButton
(
rect
<
s32
>
(
260
,
385
,
370
,
410
),
wCreateHost
,
BUTTON_HOST_CANCEL
,
dataManager
.
GetSysString
(
1212
));
//host(single)
...
...
@@ -603,6 +613,7 @@ bool Game::Initialize() {
wANCard
->
setVisible
(
false
);
ebANCard
=
env
->
addEditBox
(
L""
,
rect
<
s32
>
(
20
,
25
,
290
,
45
),
true
,
wANCard
,
EDITBOX_ANCARD
);
ebANCard
->
setTextAlignment
(
irr
::
gui
::
EGUIA_CENTER
,
irr
::
gui
::
EGUIA_CENTER
);
editbox_list
.
push_back
(
ebANCard
);
lstANCard
=
env
->
addListBox
(
rect
<
s32
>
(
20
,
50
,
290
,
265
),
wANCard
,
LISTBOX_ANCARD
,
true
);
btnANCardOK
=
env
->
addButton
(
rect
<
s32
>
(
110
,
270
,
200
,
295
),
wANCard
,
BUTTON_ANCARD_OK
,
dataManager
.
GetSysString
(
1211
));
//announce attribute
...
...
@@ -673,6 +684,7 @@ bool Game::Initialize() {
stDMMessage2
->
setTextAlignment
(
irr
::
gui
::
EGUIA_CENTER
,
irr
::
gui
::
EGUIA_CENTER
);
ebDMName
=
env
->
addEditBox
(
L""
,
rect
<
s32
>
(
20
,
50
,
290
,
70
),
true
,
wDMQuery
,
-
1
);
ebDMName
->
setTextAlignment
(
irr
::
gui
::
EGUIA_CENTER
,
irr
::
gui
::
EGUIA_CENTER
);
editbox_list
.
push_back
(
ebDMName
);
cbDMCategory
=
env
->
addComboBox
(
rect
<
s32
>
(
20
,
50
,
290
,
70
),
wDMQuery
,
-
1
);
stDMMessage2
->
setVisible
(
false
);
ebDMName
->
setVisible
(
false
);
...
...
@@ -694,6 +706,7 @@ bool Game::Initialize() {
btnSaveDeck
=
env
->
addButton
(
rect
<
s32
>
(
225
,
35
,
290
,
60
),
wDeckEdit
,
BUTTON_SAVE_DECK
,
dataManager
.
GetSysString
(
1302
));
ebDeckname
=
env
->
addEditBox
(
L""
,
rect
<
s32
>
(
80
,
65
,
220
,
90
),
true
,
wDeckEdit
,
-
1
);
ebDeckname
->
setTextAlignment
(
irr
::
gui
::
EGUIA_CENTER
,
irr
::
gui
::
EGUIA_CENTER
);
editbox_list
.
push_back
(
ebDeckname
);
btnSaveDeckAs
=
env
->
addButton
(
rect
<
s32
>
(
225
,
65
,
290
,
90
),
wDeckEdit
,
BUTTON_SAVE_DECK_AS
,
dataManager
.
GetSysString
(
1303
));
btnDeleteDeck
=
env
->
addButton
(
rect
<
s32
>
(
225
,
95
,
290
,
120
),
wDeckEdit
,
BUTTON_DELETE_DECK
,
dataManager
.
GetSysString
(
1308
));
btnShuffleDeck
=
env
->
addButton
(
rect
<
s32
>
(
5
,
99
,
55
,
120
),
wDeckEdit
,
BUTTON_SHUFFLE_DECK
,
dataManager
.
GetSysString
(
1307
));
...
...
@@ -758,18 +771,23 @@ bool Game::Initialize() {
stAttack
=
env
->
addStaticText
(
dataManager
.
GetSysString
(
1322
),
rect
<
s32
>
(
205
,
22
+
50
/
6
,
280
,
42
+
50
/
6
),
false
,
false
,
wFilter
);
ebAttack
=
env
->
addEditBox
(
L""
,
rect
<
s32
>
(
260
,
20
+
50
/
6
,
340
,
40
+
50
/
6
),
true
,
wFilter
,
EDITBOX_INPUTS
);
ebAttack
->
setTextAlignment
(
irr
::
gui
::
EGUIA_CENTER
,
irr
::
gui
::
EGUIA_CENTER
);
editbox_list
.
push_back
(
ebAttack
);
stDefense
=
env
->
addStaticText
(
dataManager
.
GetSysString
(
1323
),
rect
<
s32
>
(
205
,
42
+
75
/
6
,
280
,
62
+
75
/
6
),
false
,
false
,
wFilter
);
ebDefense
=
env
->
addEditBox
(
L""
,
rect
<
s32
>
(
260
,
40
+
75
/
6
,
340
,
60
+
75
/
6
),
true
,
wFilter
,
EDITBOX_INPUTS
);
ebDefense
->
setTextAlignment
(
irr
::
gui
::
EGUIA_CENTER
,
irr
::
gui
::
EGUIA_CENTER
);
editbox_list
.
push_back
(
ebDefense
);
stStar
=
env
->
addStaticText
(
dataManager
.
GetSysString
(
1324
),
rect
<
s32
>
(
10
,
62
+
100
/
6
,
80
,
82
+
100
/
6
),
false
,
false
,
wFilter
);
ebStar
=
env
->
addEditBox
(
L""
,
rect
<
s32
>
(
60
,
60
+
100
/
6
,
100
,
80
+
100
/
6
),
true
,
wFilter
,
EDITBOX_INPUTS
);
ebStar
->
setTextAlignment
(
irr
::
gui
::
EGUIA_CENTER
,
irr
::
gui
::
EGUIA_CENTER
);
editbox_list
.
push_back
(
ebStar
);
stScale
=
env
->
addStaticText
(
dataManager
.
GetSysString
(
1336
),
rect
<
s32
>
(
101
,
62
+
100
/
6
,
150
,
82
+
100
/
6
),
false
,
false
,
wFilter
);
ebScale
=
env
->
addEditBox
(
L""
,
rect
<
s32
>
(
150
,
60
+
100
/
6
,
195
,
80
+
100
/
6
),
true
,
wFilter
,
EDITBOX_INPUTS
);
ebScale
->
setTextAlignment
(
irr
::
gui
::
EGUIA_CENTER
,
irr
::
gui
::
EGUIA_CENTER
);
editbox_list
.
push_back
(
ebScale
);
stSearch
=
env
->
addStaticText
(
dataManager
.
GetSysString
(
1325
),
rect
<
s32
>
(
205
,
62
+
100
/
6
,
280
,
82
+
100
/
6
),
false
,
false
,
wFilter
);
ebCardName
=
env
->
addEditBox
(
L""
,
rect
<
s32
>
(
260
,
60
+
100
/
6
,
390
,
80
+
100
/
6
),
true
,
wFilter
,
EDITBOX_KEYWORD
);
ebCardName
->
setTextAlignment
(
irr
::
gui
::
EGUIA_CENTER
,
irr
::
gui
::
EGUIA_CENTER
);
editbox_list
.
push_back
(
ebCardName
);
btnEffectFilter
=
env
->
addButton
(
rect
<
s32
>
(
345
,
20
+
50
/
6
,
390
,
60
+
75
/
6
),
wFilter
,
BUTTON_EFFECT_FILTER
,
dataManager
.
GetSysString
(
1326
));
btnStartFilter
=
env
->
addButton
(
rect
<
s32
>
(
205
,
80
+
125
/
6
,
390
,
100
+
125
/
6
),
wFilter
,
BUTTON_START_FILTER
,
dataManager
.
GetSysString
(
1327
));
if
(
gameConf
.
separate_clear_button
)
{
...
...
@@ -826,6 +844,7 @@ bool Game::Initialize() {
env
->
addStaticText
(
dataManager
.
GetSysString
(
1353
),
rect
<
s32
>
(
360
,
275
,
570
,
295
),
false
,
true
,
wReplay
);
ebRepStartTurn
=
env
->
addEditBox
(
L""
,
rect
<
s32
>
(
360
,
300
,
460
,
320
),
true
,
wReplay
,
-
1
);
ebRepStartTurn
->
setTextAlignment
(
irr
::
gui
::
EGUIA_CENTER
,
irr
::
gui
::
EGUIA_CENTER
);
editbox_list
.
push_back
(
ebRepStartTurn
);
//single play window
wSinglePlay
=
env
->
addWindow
(
rect
<
s32
>
(
220
,
100
,
800
,
520
),
false
,
dataManager
.
GetSysString
(
1201
));
wSinglePlay
->
getCloseButton
()
->
setVisible
(
false
);
...
...
@@ -874,6 +893,7 @@ bool Game::Initialize() {
env
->
addStaticText
(
dataManager
.
GetSysString
(
1342
),
rect
<
s32
>
(
20
,
25
,
290
,
45
),
false
,
false
,
wReplaySave
);
ebRSName
=
env
->
addEditBox
(
L""
,
rect
<
s32
>
(
20
,
50
,
290
,
70
),
true
,
wReplaySave
,
-
1
);
ebRSName
->
setTextAlignment
(
irr
::
gui
::
EGUIA_CENTER
,
irr
::
gui
::
EGUIA_CENTER
);
editbox_list
.
push_back
(
ebRSName
);
btnRSYes
=
env
->
addButton
(
rect
<
s32
>
(
70
,
80
,
140
,
105
),
wReplaySave
,
BUTTON_REPLAY_SAVE
,
dataManager
.
GetSysString
(
1341
));
btnRSNo
=
env
->
addButton
(
rect
<
s32
>
(
170
,
80
,
240
,
105
),
wReplaySave
,
BUTTON_REPLAY_CANCEL
,
dataManager
.
GetSysString
(
1212
));
//replay control
...
...
@@ -892,6 +912,7 @@ bool Game::Initialize() {
wChat
->
setDrawTitlebar
(
false
);
wChat
->
setVisible
(
false
);
ebChatInput
=
env
->
addEditBox
(
L""
,
rect
<
s32
>
(
3
,
2
,
710
,
22
),
true
,
wChat
,
EDITBOX_CHAT
);
editbox_list
.
push_back
(
ebChatInput
);
//swap
btnSpectatorSwap
=
env
->
addButton
(
rect
<
s32
>
(
205
,
100
,
295
,
135
),
0
,
BUTTON_REPLAY_SWAP
,
dataManager
.
GetSysString
(
1346
));
btnSpectatorSwap
->
setVisible
(
false
);
...
...
@@ -961,6 +982,8 @@ bool Game::Initialize() {
col
.
setAlpha
(
224
);
env
->
getSkin
()
->
setColor
((
EGUI_DEFAULT_COLOR
)
i
,
col
);
}
for
(
auto
it
=
editbox_list
.
begin
();
it
!=
editbox_list
.
end
();
++
it
)
(
*
it
)
->
setMax
(
MAX_INPUT_LENGTH
);
dimension2du
size
=
driver
->
getScreenSize
();
if
(
window_size
!=
size
)
{
window_size
=
size
;
...
...
gframe/game.h
View file @
124269e7
...
...
@@ -267,6 +267,7 @@ public:
HWND
hWnd
;
#endif
std
::
vector
<
irr
::
gui
::
IGUIEditBox
*
>
editbox_list
;
//GUI
irr
::
gui
::
IGUIEnvironment
*
env
;
irr
::
gui
::
CGUITTFont
*
guiFont
;
...
...
@@ -603,6 +604,8 @@ extern Game* mainGame;
#define SIZE_QUERY_BUFFER 0x4000
#define MAX_INPUT_LENGTH 256
#define CARD_IMG_WIDTH 177
#define CARD_IMG_HEIGHT 254
#define CARD_THUMB_WIDTH 44
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment