Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile
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
List
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
fallenstardust
YGOMobile
Commits
d38e50bf
Commit
d38e50bf
authored
Oct 15, 2024
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DataManager::FormatLocation
fix ClientField::SetResponseSelectedCards
parent
eed6d0d6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
47 deletions
+42
-47
Classes/gframe/data_manager.cpp
Classes/gframe/data_manager.cpp
+24
-32
Classes/gframe/data_manager.h
Classes/gframe/data_manager.h
+11
-11
Classes/gframe/event_handler.cpp
Classes/gframe/event_handler.cpp
+7
-4
No files found.
Classes/gframe/data_manager.cpp
View file @
d38e50bf
...
...
@@ -181,24 +181,12 @@ bool DataManager::Error(spmemvfs_db_t* pDB, sqlite3_stmt* pStmt, int errNo) {
spmemvfs_env_fini
();
return
false
;
}
bool
DataManager
::
GetData
(
unsigned
int
code
,
CardData
*
pData
)
{
code_pointer
cdit
=
_datas
.
find
(
code
);
bool
DataManager
::
GetData
(
unsigned
int
code
,
CardData
*
pData
)
const
{
auto
cdit
=
_datas
.
find
(
code
);
if
(
cdit
==
_datas
.
end
())
return
false
;
auto
&
data
=
cdit
->
second
;
if
(
pData
)
{
pData
->
code
=
data
.
code
;
pData
->
alias
=
data
.
alias
;
memcpy
(
pData
->
setcode
,
data
.
setcode
,
SIZE_SETCODE
);
pData
->
type
=
data
.
type
;
pData
->
level
=
data
.
level
;
pData
->
attribute
=
data
.
attribute
;
pData
->
race
=
data
.
race
;
pData
->
attack
=
data
.
attack
;
pData
->
defense
=
data
.
defense
;
pData
->
lscale
=
data
.
lscale
;
pData
->
rscale
=
data
.
rscale
;
pData
->
link_marker
=
data
.
link_marker
;
*
pData
=
cdit
->
second
;
}
return
true
;
}
...
...
@@ -208,7 +196,7 @@ code_pointer DataManager::GetCodePointer(unsigned int code) const {
string_pointer
DataManager
::
GetStringPointer
(
unsigned
int
code
)
const
{
return
_strings
.
find
(
code
);
}
bool
DataManager
::
GetString
(
unsigned
int
code
,
CardString
*
pStr
)
{
bool
DataManager
::
GetString
(
unsigned
int
code
,
CardString
*
pStr
)
const
{
auto
csit
=
_strings
.
find
(
code
);
if
(
csit
==
_strings
.
end
())
{
pStr
->
name
=
unknown_string
;
...
...
@@ -218,7 +206,7 @@ bool DataManager::GetString(unsigned int code, CardString* pStr) {
*
pStr
=
csit
->
second
;
return
true
;
}
const
wchar_t
*
DataManager
::
GetName
(
unsigned
int
code
)
{
const
wchar_t
*
DataManager
::
GetName
(
unsigned
int
code
)
const
{
auto
csit
=
_strings
.
find
(
code
);
if
(
csit
==
_strings
.
end
())
return
unknown_string
;
...
...
@@ -226,7 +214,7 @@ const wchar_t* DataManager::GetName(unsigned int code) {
return
csit
->
second
.
name
.
c_str
();
return
unknown_string
;
}
const
wchar_t
*
DataManager
::
GetText
(
unsigned
int
code
)
{
const
wchar_t
*
DataManager
::
GetText
(
unsigned
int
code
)
const
{
auto
csit
=
_strings
.
find
(
code
);
if
(
csit
==
_strings
.
end
())
return
unknown_string
;
...
...
@@ -234,7 +222,7 @@ const wchar_t* DataManager::GetText(unsigned int code) {
return
csit
->
second
.
text
.
c_str
();
return
unknown_string
;
}
const
wchar_t
*
DataManager
::
GetDesc
(
unsigned
int
strCode
)
{
const
wchar_t
*
DataManager
::
GetDesc
(
unsigned
int
strCode
)
const
{
if
(
strCode
<
(
MIN_CARD_ID
<<
4
))
return
GetSysString
(
strCode
);
unsigned
int
code
=
(
strCode
>>
4
)
&
0x0fffffff
;
...
...
@@ -246,7 +234,7 @@ const wchar_t* DataManager::GetDesc(unsigned int strCode) {
return
csit
->
second
.
desc
[
offset
].
c_str
();
return
unknown_string
;
}
const
wchar_t
*
DataManager
::
GetSysString
(
int
code
)
{
const
wchar_t
*
DataManager
::
GetSysString
(
int
code
)
const
{
if
(
code
<
0
||
code
>
MAX_STRING_ID
)
return
unknown_string
;
auto
csit
=
_sysStrings
.
find
(
code
);
...
...
@@ -254,25 +242,25 @@ const wchar_t* DataManager::GetSysString(int code) {
return
unknown_string
;
return
csit
->
second
.
c_str
();
}
const
wchar_t
*
DataManager
::
GetVictoryString
(
int
code
)
{
const
wchar_t
*
DataManager
::
GetVictoryString
(
int
code
)
const
{
auto
csit
=
_victoryStrings
.
find
(
code
);
if
(
csit
==
_victoryStrings
.
end
())
return
unknown_string
;
return
csit
->
second
.
c_str
();
}
const
wchar_t
*
DataManager
::
GetCounterName
(
int
code
)
{
const
wchar_t
*
DataManager
::
GetCounterName
(
int
code
)
const
{
auto
csit
=
_counterStrings
.
find
(
code
);
if
(
csit
==
_counterStrings
.
end
())
return
unknown_string
;
return
csit
->
second
.
c_str
();
}
const
wchar_t
*
DataManager
::
GetSetName
(
int
code
)
{
const
wchar_t
*
DataManager
::
GetSetName
(
int
code
)
const
{
auto
csit
=
_setnameStrings
.
find
(
code
);
if
(
csit
==
_setnameStrings
.
end
())
return
NULL
;
return
nullptr
;
return
csit
->
second
.
c_str
();
}
std
::
vector
<
unsigned
int
>
DataManager
::
GetSetCodes
(
std
::
wstring
setname
)
{
std
::
vector
<
unsigned
int
>
DataManager
::
GetSetCodes
(
std
::
wstring
setname
)
const
{
std
::
vector
<
unsigned
int
>
matchingCodes
;
for
(
auto
csit
=
_setnameStrings
.
begin
();
csit
!=
_setnameStrings
.
end
();
++
csit
)
{
auto
xpos
=
csit
->
second
.
find_first_of
(
L'|'
);
//setname|another setname or extra info
...
...
@@ -299,8 +287,8 @@ const wchar_t* DataManager::GetNumString(int num, bool bracket) {
*++
p
=
0
;
return
numBuffer
;
}
const
wchar_t
*
DataManager
::
FormatLocation
(
int
location
,
int
sequence
)
{
if
(
location
==
0x8
)
{
const
wchar_t
*
DataManager
::
FormatLocation
(
int
location
,
int
sequence
)
const
{
if
(
location
==
LOCATION_SZONE
)
{
if
(
sequence
<
5
)
return
GetSysString
(
1003
);
else
if
(
sequence
==
5
)
...
...
@@ -308,12 +296,16 @@ const wchar_t* DataManager::FormatLocation(int location, int sequence) {
else
return
GetSysString
(
1009
);
}
unsigned
filter
=
1
;
int
i
=
1000
;
for
(;
filter
!=
0x100
&&
filter
!=
location
;
filter
<<=
1
)
++
i
;
if
(
filter
==
location
)
return
GetSysString
(
i
);
int
string_id
=
0
;
for
(
unsigned
filter
=
LOCATION_DECK
;
filter
<=
LOCATION_PZONE
;
filter
<<=
1
,
++
i
)
{
if
(
filter
==
location
)
{
string_id
=
i
;
break
;
}
}
if
(
string_id
)
return
GetSysString
(
string_id
);
else
return
unknown_string
;
}
...
...
Classes/gframe/data_manager.h
View file @
d38e50bf
...
...
@@ -23,20 +23,20 @@ public:
bool
LoadStrings
(
IReadFile
*
reader
);
void
ReadStringConfLine
(
const
char
*
linebuf
);
bool
Error
(
spmemvfs_db_t
*
pDB
,
sqlite3_stmt
*
pStmt
=
0
,
int
err
=
0
);
bool
GetData
(
unsigned
int
code
,
CardData
*
pData
);
bool
GetData
(
unsigned
int
code
,
CardData
*
pData
)
const
;
code_pointer
GetCodePointer
(
unsigned
int
code
)
const
;
string_pointer
GetStringPointer
(
unsigned
int
code
)
const
;
bool
GetString
(
unsigned
int
code
,
CardString
*
pStr
);
const
wchar_t
*
GetName
(
unsigned
int
code
);
const
wchar_t
*
GetText
(
unsigned
int
code
);
const
wchar_t
*
GetDesc
(
unsigned
int
strCode
);
const
wchar_t
*
GetSysString
(
int
code
);
const
wchar_t
*
GetVictoryString
(
int
code
);
const
wchar_t
*
GetCounterName
(
int
code
);
const
wchar_t
*
GetSetName
(
int
code
);
std
::
vector
<
unsigned
int
>
GetSetCodes
(
std
::
wstring
setname
);
bool
GetString
(
unsigned
int
code
,
CardString
*
pStr
)
const
;
const
wchar_t
*
GetName
(
unsigned
int
code
)
const
;
const
wchar_t
*
GetText
(
unsigned
int
code
)
const
;
const
wchar_t
*
GetDesc
(
unsigned
int
strCode
)
const
;
const
wchar_t
*
GetSysString
(
int
code
)
const
;
const
wchar_t
*
GetVictoryString
(
int
code
)
const
;
const
wchar_t
*
GetCounterName
(
int
code
)
const
;
const
wchar_t
*
GetSetName
(
int
code
)
const
;
std
::
vector
<
unsigned
int
>
GetSetCodes
(
std
::
wstring
setname
)
const
;
const
wchar_t
*
GetNumString
(
int
num
,
bool
bracket
=
false
);
const
wchar_t
*
FormatLocation
(
int
location
,
int
sequence
);
const
wchar_t
*
FormatLocation
(
int
location
,
int
sequence
)
const
;
const
wchar_t
*
FormatAttribute
(
int
attribute
);
const
wchar_t
*
FormatRace
(
int
race
);
const
wchar_t
*
FormatType
(
int
type
);
...
...
Classes/gframe/event_handler.cpp
View file @
d38e50bf
...
...
@@ -2819,11 +2819,14 @@ void ClientField::ShowCardInfoInList(ClientCard* pcard, irr::gui::IGUIElement* e
}
}
void
ClientField
::
SetResponseSelectedCards
()
const
{
unsigned
char
respbuf
[
SIZE_RETURN_VALUE
];
respbuf
[
0
]
=
selected_cards
.
size
();
for
(
size_t
i
=
0
;
i
<
selected_cards
.
size
();
++
i
)
unsigned
char
respbuf
[
SIZE_RETURN_VALUE
]{};
int
len
=
(
int
)
selected_cards
.
size
();
if
(
len
>
UINT8_MAX
)
len
=
UINT8_MAX
;
respbuf
[
0
]
=
(
unsigned
char
)
len
;
for
(
int
i
=
0
;
i
<
len
;
++
i
)
respbuf
[
i
+
1
]
=
selected_cards
[
i
]
->
select_seq
;
DuelClient
::
SetResponseB
(
respbuf
,
selected_cards
.
size
()
+
1
);
DuelClient
::
SetResponseB
(
respbuf
,
len
+
1
);
}
void
ClientField
::
SetResponseSelectedOption
()
const
{
if
(
mainGame
->
dInfo
.
curMsg
==
MSG_SELECT_OPTION
)
{
...
...
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