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
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
REIKAI
ygopro
Commits
7774f410
Commit
7774f410
authored
Jan 12, 2020
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'server' of
https://github.com/purerosefallen/ygopro
parents
735d7751
b9a1afe8
Changes
24
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
525 additions
and
98 deletions
+525
-98
CMakeLists.txt
CMakeLists.txt
+5
-1
appveyor.yml
appveyor.yml
+3
-3
cards.cdb
cards.cdb
+0
-0
cmake/compiler/gcc.cmake
cmake/compiler/gcc.cmake
+0
-1
cmake/compiler/msvc.cmake
cmake/compiler/msvc.cmake
+1
-0
cmake/macros/MSVCJustMyCodeDebugging.cmake
cmake/macros/MSVCJustMyCodeDebugging.cmake
+23
-0
cmake/platform/xcode.cmake
cmake/platform/xcode.cmake
+0
-1
gframe/CMakeLists.txt
gframe/CMakeLists.txt
+5
-1
gframe/client_card.cpp
gframe/client_card.cpp
+2
-0
gframe/deck_con.cpp
gframe/deck_con.cpp
+9
-7
gframe/deck_manager.cpp
gframe/deck_manager.cpp
+39
-6
gframe/deck_manager.h
gframe/deck_manager.h
+20
-0
gframe/drawing.cpp
gframe/drawing.cpp
+2
-2
gframe/duelclient.cpp
gframe/duelclient.cpp
+110
-23
gframe/event_handler.cpp
gframe/event_handler.cpp
+25
-0
gframe/game.cpp
gframe/game.cpp
+30
-7
gframe/game.h
gframe/game.h
+21
-7
gframe/menu_handler.cpp
gframe/menu_handler.cpp
+22
-18
gframe/premake4.lua
gframe/premake4.lua
+12
-2
gframe/tag_duel.cpp
gframe/tag_duel.cpp
+3
-3
lflist.conf
lflist.conf
+190
-14
premake4.lua
premake4.lua
+0
-1
strings.conf
strings.conf
+2
-1
system.conf
system.conf
+1
-0
No files found.
CMakeLists.txt
View file @
7774f410
project
(
ygo
)
cmake_minimum_required
(
VERSION
2
.8
)
cmake_minimum_required
(
VERSION
3
.8
)
if
(
NOT CMAKE_BUILD_TYPE
)
message
(
STATUS
"Setting build type to 'Debug' as none was specified."
)
...
...
@@ -15,6 +15,10 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set
(
CMAKE_LIBRARY_OUTPUT_DIRECTORY
${
CMAKE_BINARY_DIR
}
/lib
)
set
(
CMAKE_RUNTIME_OUTPUT_DIRECTORY
${
CMAKE_BINARY_DIR
}
/bin
)
set
(
CMAKE_CXX_STANDARD 14
)
set
(
CMAKE_CXX_STANDARD_REQUIRED ON
)
set
(
CMAKE_CXX_EXTENSIONS OFF
)
include
(
AutoFiles
)
include
(
platform/settings
)
...
...
appveyor.yml
View file @
7774f410
...
...
@@ -39,9 +39,9 @@ after_build:
-
7z x -y -oredis Redis-x64-3.2.100.zip
# nodejs
-
bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://nodejs.org/dist/v1
0.15.3/node-v10.15.3
-win-x64.zip ; exit 0"
-
7z x -y node-v1
0.15.3
-win-x64.zip
-
mv node-v1
0.15.3
-win-x64 node
-
bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://nodejs.org/dist/v1
2.14.0/node-v12.14.0
-win-x64.zip ; exit 0"
-
7z x -y node-v1
2.14.0
-win-x64.zip
-
mv node-v1
2.14.0
-win-x64 node
# srvpro
-
git clone https://github.com/purerosefallen/ygopro-server
...
...
cards.cdb
View file @
7774f410
No preview for this file type
cmake/compiler/gcc.cmake
View file @
7774f410
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-std=c++14"
)
set
(
CMAKE_C_FLAGS_DEBUG
"
${
CMAKE_C_FLAGS_DEBUG
}
-D_DEBUG"
)
set
(
CMAKE_CXX_FLAGS_DEBUG
"
${
CMAKE_CXX_FLAGS_DEBUG
}
-D_DEBUG"
)
add_definitions
(
"-fexceptions"
"-fomit-frame-pointer"
"-fno-strict-aliasing"
"-Wno-format-security"
)
cmake/compiler/msvc.cmake
View file @
7774f410
...
...
@@ -3,3 +3,4 @@ add_definitions ( "-D_UNICODE" "-DUNICODE" "/utf-8" )
include
(
MSVCMultipleProcessCompile
)
include
(
MSVCStaticRuntime
)
include
(
MSVCJustMyCodeDebugging
)
cmake/macros/MSVCJustMyCodeDebugging.cmake
0 → 100644
View file @
7774f410
# - Enable Just My Code debugging on MSVC
#
# include(MSVCJustMyCodeDebugging)
#
# Requires these CMake modules:
# ListCombinations.cmake
#
# The cmake property VS_JUST_MY_CODE_DEBUGGING introduced in CMake 3.15
# also add /JMC to Release configuration, which is inappropriate
if
(
MSVC AND NOT
"
${
MSVC_VERSION
}
"
LESS 1918
)
# Only available in VS 2017 15.8 and newer
include
(
ListCombinations
)
list_combinations
(
_varnames
PREFIXES
CMAKE_CXX_FLAGS_
SUFFIXES
DEBUG
RELWITHDEBINFO
)
foreach
(
_var
${
_varnames
}
)
set
(
${
_var
}
"
${${
_var
}}
/JMC"
)
endforeach
()
endif
()
cmake/platform/xcode.cmake
View file @
7774f410
set
(
CMAKE_XCODE_ATTRIBUTE_GCC_VERSION
"com.apple.compilers.llvm.clang.1_0"
)
set
(
CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD
"c++14"
)
set
(
CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY
"libc++"
)
gframe/CMakeLists.txt
View file @
7774f410
...
...
@@ -16,7 +16,11 @@ endif ()
if
(
MSVC
)
add_executable
(
ygopro WIN32
${
AUTO_FILES_RESULT
}
)
set_target_properties
(
ygopro PROPERTIES LINK_FLAGS /ENTRY:
"mainCRTStartup"
)
set_target_properties
(
ygopro PROPERTIES
LINK_FLAGS /ENTRY:
"mainCRTStartup"
VS_DEBUGGER_WORKING_DIRECTORY
"
${
CMAKE_SOURCE_DIR
}
"
)
set_property
(
DIRECTORY
${
CMAKE_SOURCE_DIR
}
PROPERTY VS_STARTUP_PROJECT ygopro
)
else
()
add_executable
(
ygopro
${
AUTO_FILES_RESULT
}
)
endif
()
...
...
gframe/client_card.cpp
View file @
7774f410
...
...
@@ -199,6 +199,8 @@ void ClientCard::ClearTarget() {
ownerTarget
.
clear
();
}
bool
ClientCard
::
client_card_sort
(
ClientCard
*
c1
,
ClientCard
*
c2
)
{
if
(
c1
->
is_selected
!=
c2
->
is_selected
)
return
c1
->
is_selected
<
c2
->
is_selected
;
int32
cp1
=
c1
->
overlayTarget
?
c1
->
overlayTarget
->
controler
:
c1
->
controler
;
int32
cp2
=
c2
->
overlayTarget
?
c2
->
overlayTarget
->
controler
:
c2
->
controler
;
if
(
cp1
!=
cp2
)
...
...
gframe/deck_con.cpp
View file @
7774f410
...
...
@@ -79,22 +79,23 @@ inline void refreshDeckList() {
});
}
inline
void
refreshReadonly
(
int
catesel
)
{
bool
hasDeck
=
mainGame
->
cbDBDecks
->
getItemCount
()
!=
0
;
mainGame
->
deckBuilder
.
readonly
=
catesel
<
2
;
mainGame
->
btnSaveDeck
->
setEnabled
(
!
mainGame
->
deckBuilder
.
readonly
);
mainGame
->
btnDeleteDeck
->
setEnabled
(
!
mainGame
->
deckBuilder
.
readonly
);
mainGame
->
btnDeleteDeck
->
setEnabled
(
hasDeck
&&
!
mainGame
->
deckBuilder
.
readonly
);
mainGame
->
btnRenameCategory
->
setEnabled
(
catesel
>
3
);
mainGame
->
btnDeleteCategory
->
setEnabled
(
catesel
>
3
);
mainGame
->
btnNewDeck
->
setEnabled
(
!
mainGame
->
deckBuilder
.
readonly
);
mainGame
->
btnRenameDeck
->
setEnabled
(
!
mainGame
->
deckBuilder
.
readonly
);
mainGame
->
btnDMDeleteDeck
->
setEnabled
(
!
mainGame
->
deckBuilder
.
readonly
);
mainGame
->
btnMoveDeck
->
setEnabled
(
!
mainGame
->
deckBuilder
.
readonly
);
mainGame
->
btnCopyDeck
->
setEnabled
(
!
mainGame
->
deckBuilder
.
readonly
);
mainGame
->
btnRenameDeck
->
setEnabled
(
hasDeck
&&
!
mainGame
->
deckBuilder
.
readonly
);
mainGame
->
btnDMDeleteDeck
->
setEnabled
(
hasDeck
&&
!
mainGame
->
deckBuilder
.
readonly
);
mainGame
->
btnMoveDeck
->
setEnabled
(
hasDeck
&&
!
mainGame
->
deckBuilder
.
readonly
);
mainGame
->
btnCopyDeck
->
setEnabled
(
hasDeck
);
}
inline
void
changeCategory
(
int
catesel
)
{
refreshReadonly
(
catesel
);
mainGame
->
RefreshDeck
(
mainGame
->
cbDBCategory
,
mainGame
->
cbDBDecks
);
mainGame
->
cbDBDecks
->
setSelected
(
0
);
deckManager
.
LoadDeck
(
mainGame
->
cbDBCategory
,
mainGame
->
cbDBDecks
);
refreshReadonly
(
catesel
);
mainGame
->
deckBuilder
.
is_modified
=
false
;
mainGame
->
deckBuilder
.
prev_category
=
catesel
;
mainGame
->
deckBuilder
.
prev_deck
=
0
;
...
...
@@ -116,8 +117,8 @@ inline void showDeckManage() {
}
});
lstCategories
->
setSelected
(
mainGame
->
deckBuilder
.
prev_category
);
refreshReadonly
(
mainGame
->
deckBuilder
.
prev_category
);
refreshDeckList
();
refreshReadonly
(
mainGame
->
deckBuilder
.
prev_category
);
mainGame
->
lstDecks
->
setSelected
(
mainGame
->
deckBuilder
.
prev_deck
);
mainGame
->
PopupElement
(
mainGame
->
wDeckManage
);
}
...
...
@@ -626,6 +627,7 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
mainGame
->
cbDBDecks
->
setSelected
(
decksel
);
deckManager
.
LoadDeck
(
mainGame
->
cbDBCategory
,
mainGame
->
cbDBDecks
);
}
refreshReadonly
(
prev_category
);
prev_deck
=
decksel
;
}
else
{
mainGame
->
stACMessage
->
setText
(
dataManager
.
GetSysString
(
1476
));
...
...
gframe/deck_manager.cpp
View file @
7774f410
...
...
@@ -79,12 +79,21 @@ int DeckManager::CheckDeck(Deck& deck, int lfhash, bool allow_ocg, bool allow_tc
if
(
!
list
)
return
0
;
int
dc
=
0
;
#ifdef YGOPRO_SERVER_MODE
if
(
deck
.
main
.
size
()
<
DECKCOUNT_MAIN_MIN
||
deck
.
main
.
size
()
>
DECKCOUNT_MAIN_MAX
)
return
(
DECKERROR_MAINCOUNT
<<
28
)
+
deck
.
main
.
size
();
if
(
deck
.
extra
.
size
()
>
DECKCOUNT_SIDE
)
return
(
DECKERROR_EXTRACOUNT
<<
28
)
+
deck
.
extra
.
size
();
if
(
deck
.
side
.
size
()
>
DECKCOUNT_EXTRA
)
return
(
DECKERROR_SIDECOUNT
<<
28
)
+
deck
.
side
.
size
();
#else
if
(
deck
.
main
.
size
()
<
40
||
deck
.
main
.
size
()
>
60
)
return
(
DECKERROR_MAINCOUNT
<<
28
)
+
deck
.
main
.
size
();
if
(
deck
.
extra
.
size
()
>
15
)
return
(
DECKERROR_EXTRACOUNT
<<
28
)
+
deck
.
extra
.
size
();
if
(
deck
.
side
.
size
()
>
15
)
return
(
DECKERROR_SIDECOUNT
<<
28
)
+
deck
.
side
.
size
();
#endif
for
(
size_t
i
=
0
;
i
<
deck
.
main
.
size
();
++
i
)
{
code_pointer
cit
=
deck
.
main
[
i
];
...
...
@@ -148,9 +157,23 @@ int DeckManager::LoadDeck(Deck& deck, int* dbuf, int mainc, int sidec) {
}
if
(
cd
.
type
&
TYPE_TOKEN
)
continue
;
else
if
(
cd
.
type
&
(
TYPE_FUSION
|
TYPE_SYNCHRO
|
TYPE_XYZ
|
TYPE_LINK
)
&&
deck
.
extra
.
size
()
<
15
)
{
deck
.
extra
.
push_back
(
dataManager
.
GetCodePointer
(
code
));
//verified by GetData()
}
else
if
(
deck
.
main
.
size
()
<
60
)
{
else
if
(
cd
.
type
&
(
TYPE_FUSION
|
TYPE_SYNCHRO
|
TYPE_XYZ
|
TYPE_LINK
))
{
if
(
#ifdef YGOPRO_SERVER_MODE
deck
.
extra
.
size
()
>=
DECKCOUNT_EXTRA
#else
deck
.
extra
.
size
()
>=
15
#endif
)
continue
;
deck
.
extra
.
push_back
(
dataManager
.
GetCodePointer
(
code
));
//verified by GetData()
}
else
#ifdef YGOPRO_SERVER_MODE
if
(
deck
.
main
.
size
()
<
DECKCOUNT_MAIN_MAX
)
#else
if
(
deck
.
main
.
size
()
<
60
)
#endif
{
deck
.
main
.
push_back
(
dataManager
.
GetCodePointer
(
code
));
}
}
...
...
@@ -162,7 +185,11 @@ int DeckManager::LoadDeck(Deck& deck, int* dbuf, int mainc, int sidec) {
}
if
(
cd
.
type
&
TYPE_TOKEN
)
continue
;
#ifdef YGOPRO_SERVER_MODE
if
(
deck
.
side
.
size
()
<
DECKCOUNT_SIDE
)
#else
if
(
deck
.
side
.
size
()
<
15
)
#endif
deck
.
side
.
push_back
(
dataManager
.
GetCodePointer
(
code
));
//verified by GetData()
}
return
errorcode
;
...
...
@@ -217,9 +244,15 @@ void DeckManager::GetCategoryPath(wchar_t* ret, int index, const wchar_t* text)
void
DeckManager
::
GetDeckFile
(
wchar_t
*
ret
,
irr
::
gui
::
IGUIComboBox
*
cbCategory
,
irr
::
gui
::
IGUIComboBox
*
cbDeck
)
{
wchar_t
filepath
[
256
];
wchar_t
catepath
[
256
];
GetCategoryPath
(
catepath
,
cbCategory
->
getSelected
(),
cbCategory
->
getText
());
myswprintf
(
filepath
,
L"%ls/%ls.ydk"
,
catepath
,
cbDeck
->
getItem
(
cbDeck
->
getSelected
()));
BufferIO
::
CopyWStr
(
filepath
,
ret
,
256
);
wchar_t
*
deckname
=
(
wchar_t
*
)
cbDeck
->
getItem
(
cbDeck
->
getSelected
());
if
(
deckname
!=
NULL
)
{
GetCategoryPath
(
catepath
,
cbCategory
->
getSelected
(),
cbCategory
->
getText
());
myswprintf
(
filepath
,
L"%ls/%ls.ydk"
,
catepath
,
deckname
);
BufferIO
::
CopyWStr
(
filepath
,
ret
,
256
);
}
else
{
BufferIO
::
CopyWStr
(
L""
,
ret
,
256
);
}
}
bool
DeckManager
::
LoadDeck
(
irr
::
gui
::
IGUIComboBox
*
cbCategory
,
irr
::
gui
::
IGUIComboBox
*
cbDeck
)
{
wchar_t
filepath
[
256
];
...
...
gframe/deck_manager.h
View file @
7774f410
...
...
@@ -64,4 +64,24 @@ extern DeckManager deckManager;
}
#ifdef YGOPRO_SERVER_MODE
#ifndef DECKCOUNT_MAIN_MIN
#define DECKCOUNT_MAIN_MIN 40
#endif
#ifndef DECKCOUNT_MAIN_MAX
#define DECKCOUNT_MAIN_MAX 60
#endif
#ifndef DECKCOUNT_SIDE
#define DECKCOUNT_SIDE 15
#endif
#ifndef DECKCOUNT_EXTRA
#define DECKCOUNT_EXTRA 15
#endif
#endif //YGOPRO_SERVER_MODE
#endif //DECKMANAGER_H
gframe/drawing.cpp
View file @
7774f410
...
...
@@ -984,7 +984,7 @@ void Game::DrawSpec() {
break
;
}
}
if
(
auto_watch_mode
&&
showcard
p
<
8
&&
showcardp
>
0
&&
showcardcode
>
10
0
)
{
if
(
auto_watch_mode
&&
showcard
code
>
9999
&&
(
showcardcode
&
0xFFFCFFFC
)
>
0
)
{
mainGame
->
ShowCardInfo
(
showcardcode
);
}
}
...
...
@@ -1039,7 +1039,7 @@ void Game::ShowElement(irr::gui::IGUIElement * win, int autoframe) {
FadingUnit
fu
;
fu
.
fadingSize
=
win
->
getRelativePosition
();
for
(
auto
fit
=
fadingList
.
begin
();
fit
!=
fadingList
.
end
();
++
fit
)
if
(
win
==
fit
->
guiFading
&&
win
!=
wOptions
)
// the size of wOptions is always setted by ClientField::ShowSelectOption before showing it
if
(
win
==
fit
->
guiFading
&&
win
!=
wOptions
&&
win
!=
wANNumber
)
// the size of wOptions is always setted by ClientField::ShowSelectOption before showing it
fu
.
fadingSize
=
fit
->
fadingSize
;
irr
::
core
::
position2di
center
=
fu
.
fadingSize
.
getCenter
();
fu
.
fadingDiff
.
X
=
fu
.
fadingSize
.
getWidth
()
/
10
;
...
...
gframe/duelclient.cpp
View file @
7774f410
...
...
@@ -141,7 +141,7 @@ void DuelClient::ClientEvent(bufferevent *bev, short events, void *ctx) {
cscg
.
info
.
draw_count
=
1
;
cscg
.
info
.
time_limit
=
0
;
cscg
.
info
.
lflist
=
0
;
cscg
.
info
.
duel_rule
=
mainGame
->
c
hkBotOldRule
->
isChecked
()
?
DEFAULT_DUEL_RULE
-
1
:
DEFAULT_DUEL_RULE
;
cscg
.
info
.
duel_rule
=
mainGame
->
c
bBotRule
->
getSelected
()
+
3
;
cscg
.
info
.
no_check_deck
=
mainGame
->
chkBotNoCheckDeck
->
isChecked
();
cscg
.
info
.
no_shuffle_deck
=
mainGame
->
chkBotNoShuffleDeck
->
isChecked
();
}
...
...
@@ -190,6 +190,10 @@ void DuelClient::ClientEvent(bufferevent *bev, short events, void *ctx) {
soundManager
.
PlaySoundEffect
(
SOUND_INFO
);
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1400
));
mainGame
->
gMutex
.
unlock
();
if
(
auto_watch_mode
)
{
mainGame
->
actionSignal
.
Wait
(
2000
);
mainGame
->
device
->
closeDevice
();
}
}
else
if
(
connect_state
==
0x7
)
{
if
(
!
mainGame
->
dInfo
.
isStarted
&&
!
mainGame
->
is_building
)
{
mainGame
->
btnCreateHost
->
setEnabled
(
true
);
...
...
@@ -209,6 +213,10 @@ void DuelClient::ClientEvent(bufferevent *bev, short events, void *ctx) {
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1401
));
else
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1402
));
mainGame
->
gMutex
.
unlock
();
if
(
auto_watch_mode
)
{
mainGame
->
actionSignal
.
Wait
(
2000
);
mainGame
->
device
->
closeDevice
();
}
}
else
{
mainGame
->
gMutex
.
lock
();
soundManager
.
PlaySoundEffect
(
SOUND_INFO
);
...
...
@@ -220,6 +228,10 @@ void DuelClient::ClientEvent(bufferevent *bev, short events, void *ctx) {
mainGame
->
btnBotCancel
->
setEnabled
(
true
);
mainGame
->
stTip
->
setVisible
(
false
);
mainGame
->
gMutex
.
unlock
();
if
(
auto_watch_mode
)
{
mainGame
->
actionSignal
.
Wait
(
2000
);
mainGame
->
device
->
closeDevice
();
}
mainGame
->
closeDoneSignal
.
Reset
();
mainGame
->
closeSignal
.
Set
();
mainGame
->
closeDoneSignal
.
Wait
();
...
...
@@ -237,8 +249,6 @@ void DuelClient::ClientEvent(bufferevent *bev, short events, void *ctx) {
}
}
event_base_loopexit
(
client_base
,
0
);
if
(
exit_on_return
&&
auto_watch_mode
)
mainGame
->
device
->
closeDevice
();
}
}
int
DuelClient
::
ClientThread
()
{
...
...
@@ -280,6 +290,10 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
else
if
(
pkt
->
code
==
2
)
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1405
));
mainGame
->
gMutex
.
unlock
();
if
(
auto_watch_mode
)
{
mainGame
->
actionSignal
.
Wait
(
2000
);
mainGame
->
device
->
closeDevice
();
}
event_base_loopbreak
(
client_base
);
break
;
}
...
...
@@ -736,16 +750,20 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame
->
dInfo
.
isReplaySkiping
=
false
;
mainGame
->
wSurrender
->
setVisible
(
false
);
mainGame
->
stMessage
->
setText
(
dataManager
.
GetSysString
(
1500
));
if
(
!
auto_watch_mode
)
{
mainGame
->
PopupElement
(
mainGame
->
wMessage
);
mainGame
->
gMutex
.
unlock
();
mainGame
->
PopupElement
(
mainGame
->
wMessage
);
mainGame
->
gMutex
.
unlock
();
if
(
auto_watch_mode
)
{
mainGame
->
actionSignal
.
Wait
(
2000
);
mainGame
->
device
->
closeDevice
();
}
else
{
mainGame
->
actionSignal
.
Reset
();
mainGame
->
actionSignal
.
Wait
();
mainGame
->
closeDoneSignal
.
Reset
();
mainGame
->
closeSignal
.
Set
();
mainGame
->
closeDoneSignal
.
Wait
();
mainGame
->
gMutex
.
lock
();
}
mainGame
->
closeDoneSignal
.
Reset
();
mainGame
->
closeSignal
.
Set
();
mainGame
->
closeDoneSignal
.
Wait
();
mainGame
->
gMutex
.
lock
();
mainGame
->
dInfo
.
isStarted
=
false
;
mainGame
->
dInfo
.
isFinished
=
true
;
mainGame
->
dInfo
.
announce_cache
.
clear
();
...
...
@@ -788,11 +806,13 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
wcsftime
(
timetext
,
40
,
L"%Y-%m-%d %H-%M-%S"
,
localedtime
);
mainGame
->
ebRSName
->
setText
(
timetext
);
if
(
!
mainGame
->
chkAutoSaveReplay
->
isChecked
())
{
mainGame
->
wReplaySave
->
setText
(
dataManager
.
GetSysString
(
1340
));
mainGame
->
PopupElement
(
mainGame
->
wReplaySave
);
mainGame
->
gMutex
.
unlock
();
mainGame
->
replaySignal
.
Reset
();
mainGame
->
replaySignal
.
Wait
();
if
(
!
auto_watch_mode
)
{
mainGame
->
wReplaySave
->
setText
(
dataManager
.
GetSysString
(
1340
));
mainGame
->
PopupElement
(
mainGame
->
wReplaySave
);
mainGame
->
gMutex
.
unlock
();
mainGame
->
replaySignal
.
Reset
();
mainGame
->
replaySignal
.
Wait
();
}
}
else
{
mainGame
->
actionParam
=
1
;
...
...
@@ -3002,6 +3022,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame
->
dField
.
current_chain
.
chain_pos
.
X
+=
0.35
f
;
else
mainGame
->
dField
.
current_chain
.
chain_pos
.
Y
+=
chc
*
0.25
f
;
if
(
auto_watch_mode
&&
(
mainGame
->
dField
.
current_chain
.
chain_card
->
location
&
LOCATION_ONFIELD
))
mainGame
->
ShowCardInfo
(
mainGame
->
dField
.
current_chain
.
chain_card
->
code
);
return
true
;
}
case
MSG_CHAINED
:
{
...
...
@@ -3021,6 +3043,18 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int
ct
=
BufferIO
::
ReadInt8
(
pbuf
);
if
(
mainGame
->
dInfo
.
isReplaySkiping
)
return
true
;
if
(
auto_watch_mode
&&
mainGame
->
dField
.
chains
.
size
()
>
1
)
{
int
code
=
mainGame
->
dField
.
chains
[
ct
-
1
].
chain_card
->
code
;
if
(
code
>
0
)
{
mainGame
->
showcardcode
=
code
;
mainGame
->
showcarddif
=
0
;
mainGame
->
showcardp
=
0
;
mainGame
->
showcard
=
1
;
mainGame
->
WaitFrameSignal
(
30
);
mainGame
->
showcard
=
0
;
mainGame
->
WaitFrameSignal
(
11
);
}
}
if
(
mainGame
->
dField
.
chains
.
size
()
>
1
)
{
if
(
mainGame
->
dField
.
last_chain
)
mainGame
->
WaitFrameSignal
(
11
);
...
...
@@ -3031,10 +3065,6 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame
->
WaitFrameSignal
(
3
);
}
}
if
(
auto_watch_mode
)
{
int
code
=
mainGame
->
dField
.
chains
[
ct
-
1
].
chain_card
->
code
;
mainGame
->
ShowCardInfo
(
code
);
}
mainGame
->
dField
.
last_chain
=
false
;
return
true
;
}
...
...
@@ -3105,8 +3135,11 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int
s
=
BufferIO
::
ReadInt8
(
pbuf
);
/*int ss = */
BufferIO
::
ReadInt8
(
pbuf
);
ClientCard
*
pcard
=
mainGame
->
dField
.
GetCard
(
c
,
l
,
s
);
if
(
auto_watch_mode
&&
i
==
0
)
{
mainGame
->
ShowCardInfo
(
pcard
->
code
);
if
(
auto_watch_mode
&&
pcard
->
code
>
0
)
{
mainGame
->
showcardcode
=
pcard
->
code
;
mainGame
->
showcarddif
=
0
;
mainGame
->
showcardp
=
0
;
mainGame
->
showcard
=
4
;
}
pcard
->
is_highlighting
=
true
;
mainGame
->
dField
.
current_chain
.
target
.
insert
(
pcard
);
...
...
@@ -3128,6 +3161,9 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame
->
dField
.
MoveCard
(
pcard
,
5
);
}
else
mainGame
->
WaitFrameSignal
(
30
);
if
(
auto_watch_mode
&&
pcard
->
code
>
0
)
{
mainGame
->
showcard
=
0
;
}
myswprintf
(
textBuffer
,
dataManager
.
GetSysString
(
1610
),
dataManager
.
GetName
(
pcard
->
code
),
dataManager
.
FormatLocation
(
l
,
s
),
s
+
1
);
mainGame
->
AddLog
(
textBuffer
,
pcard
->
code
);
pcard
->
is_highlighting
=
false
;
...
...
@@ -3387,6 +3423,16 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int
s
=
BufferIO
::
ReadInt8
(
pbuf
);
int
count
=
BufferIO
::
ReadInt16
(
pbuf
);
ClientCard
*
pc
=
mainGame
->
dField
.
GetCard
(
c
,
l
,
s
);
if
(
auto_watch_mode
&&
pc
->
code
>
0
)
{
myswprintf
(
event_string
,
dataManager
.
GetSysString
(
1610
),
dataManager
.
GetName
(
pc
->
code
));
mainGame
->
showcardcode
=
pc
->
code
;
mainGame
->
showcarddif
=
0
;
mainGame
->
showcardp
=
0
;
mainGame
->
showcard
=
5
;
mainGame
->
WaitFrameSignal
(
30
);
mainGame
->
showcard
=
0
;
mainGame
->
WaitFrameSignal
(
11
);
}
if
(
pc
->
counters
.
count
(
type
))
pc
->
counters
[
type
]
+=
count
;
else
pc
->
counters
[
type
]
=
count
;
...
...
@@ -3470,13 +3516,22 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
else
mainGame
->
atk_r
=
vector3df
(
0
,
0
,
3.1415926
-
atan
((
xd
-
xa
)
/
(
yd
-
ya
)));
}
matManager
.
GenArrow
(
sy
);
if
(
auto_watch_mode
)
{
mainGame
->
ShowCardInfo
(
mainGame
->
dField
.
attacker
->
code
);
int
code
=
mainGame
->
dField
.
attacker
->
code
;
if
(
code
>
0
)
{
mainGame
->
showcardcode
=
code
;
mainGame
->
showcarddif
=
0
;
mainGame
->
showcardp
=
0
;
mainGame
->
showcard
=
2
;
}
}
matManager
.
GenArrow
(
sy
);
mainGame
->
attack_sv
=
0
;
mainGame
->
is_attacking
=
true
;
mainGame
->
WaitFrameSignal
(
40
);
if
(
auto_watch_mode
)
{
mainGame
->
showcard
=
0
;
}
mainGame
->
is_attacking
=
false
;
return
true
;
}
...
...
@@ -3673,12 +3728,44 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
mainGame
->
gMutex
.
lock
();
mainGame
->
cbANNumber
->
clear
();
bool
quickmode
=
count
<=
12
;
if
(
quickmode
)
{
for
(
int
i
=
0
;
i
<
12
;
++
i
)
{
mainGame
->
btnANNumber
[
i
]
->
setEnabled
(
false
);
mainGame
->
btnANNumber
[
i
]
->
setPressed
(
false
);
mainGame
->
btnANNumber
[
i
]
->
setVisible
(
true
);
}
}
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
int
value
=
BufferIO
::
ReadInt32
(
pbuf
);
myswprintf
(
textBuffer
,
L" % d"
,
value
);
mainGame
->
cbANNumber
->
addItem
(
textBuffer
,
value
);
if
(
quickmode
)
{
if
((
value
>
12
||
value
<=
0
))
{
quickmode
=
false
;
}
else
{
mainGame
->
btnANNumber
[
value
-
1
]
->
setEnabled
(
true
);
}
}
}
mainGame
->
cbANNumber
->
setSelected
(
0
);
if
(
quickmode
)
{
mainGame
->
cbANNumber
->
setVisible
(
false
);
mainGame
->
btnANNumberOK
->
setRelativePosition
(
rect
<
s32
>
(
20
,
195
,
210
,
230
));
mainGame
->
btnANNumberOK
->
setEnabled
(
false
);
recti
pos
=
mainGame
->
wANNumber
->
getRelativePosition
();
pos
.
LowerRightCorner
.
Y
=
pos
.
UpperLeftCorner
.
Y
+
250
;
mainGame
->
wANNumber
->
setRelativePosition
(
pos
);
}
else
{
for
(
int
i
=
0
;
i
<
12
;
++
i
)
{
mainGame
->
btnANNumber
[
i
]
->
setVisible
(
false
);
}
mainGame
->
cbANNumber
->
setVisible
(
true
);
mainGame
->
btnANNumberOK
->
setRelativePosition
(
rect
<
s32
>
(
80
,
60
,
150
,
85
));
recti
pos
=
mainGame
->
wANNumber
->
getRelativePosition
();
pos
.
LowerRightCorner
.
Y
=
pos
.
UpperLeftCorner
.
Y
+
95
;
mainGame
->
wANNumber
->
setRelativePosition
(
pos
);
}
if
(
select_hint
)
myswprintf
(
textBuffer
,
L"%ls"
,
dataManager
.
GetDesc
(
select_hint
));
else
myswprintf
(
textBuffer
,
dataManager
.
GetSysString
(
565
));
...
...
gframe/event_handler.cpp
View file @
7774f410
...
...
@@ -320,6 +320,31 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
SetResponseSelectedOption
();
break
;
}
case
BUTTON_ANNUMBER_1
:
case
BUTTON_ANNUMBER_2
:
case
BUTTON_ANNUMBER_3
:
case
BUTTON_ANNUMBER_4
:
case
BUTTON_ANNUMBER_5
:
case
BUTTON_ANNUMBER_6
:
case
BUTTON_ANNUMBER_7
:
case
BUTTON_ANNUMBER_8
:
case
BUTTON_ANNUMBER_9
:
case
BUTTON_ANNUMBER_10
:
case
BUTTON_ANNUMBER_11
:
case
BUTTON_ANNUMBER_12
:
{
soundManager
.
PlaySoundEffect
(
SOUND_BUTTON
);
for
(
int
i
=
0
;
i
<
mainGame
->
cbANNumber
->
getItemCount
();
++
i
)
{
if
(
id
-
BUTTON_ANNUMBER_1
+
1
==
mainGame
->
cbANNumber
->
getItemData
(
i
))
{
mainGame
->
cbANNumber
->
setSelected
(
i
);
break
;
}
}
for
(
int
i
=
0
;
i
<
12
;
++
i
)
{
mainGame
->
btnANNumber
[
i
]
->
setPressed
(
event
.
GUIEvent
.
Caller
==
mainGame
->
btnANNumber
[
i
]);
}
mainGame
->
btnANNumberOK
->
setEnabled
(
true
);
break
;
}
case
BUTTON_ANNUMBER_OK
:
{
soundManager
.
PlaySoundEffect
(
SOUND_BUTTON
);
DuelClient
::
SetResponseI
(
mainGame
->
cbANNumber
->
getSelected
());
...
...
gframe/game.cpp
View file @
7774f410
...
...
@@ -149,7 +149,7 @@ bool Game::Initialize() {
SetWindowsIcon
();
//main menu
wchar_t
strbuf
[
256
];
myswprintf
(
strbuf
,
L"KoishiPro %X.0%X.%X
Fortune
"
,
PRO_VERSION
>>
12
,
(
PRO_VERSION
>>
4
)
&
0xff
,
PRO_VERSION
&
0xf
);
myswprintf
(
strbuf
,
L"KoishiPro %X.0%X.%X
Lunar
"
,
PRO_VERSION
>>
12
,
(
PRO_VERSION
>>
4
)
&
0xff
,
PRO_VERSION
&
0xf
);
wMainMenu
=
env
->
addWindow
(
rect
<
s32
>
(
370
,
200
,
650
,
415
),
false
,
strbuf
);
wMainMenu
->
getCloseButton
()
->
setVisible
(
false
);
btnLanMode
=
env
->
addButton
(
rect
<
s32
>
(
10
,
30
,
270
,
60
),
wMainMenu
,
BUTTON_LAN_MODE
,
dataManager
.
GetSysString
(
1200
));
...
...
@@ -211,7 +211,8 @@ bool Game::Initialize() {
cbDuelRule
->
addItem
(
dataManager
.
GetSysString
(
1261
));
cbDuelRule
->
addItem
(
dataManager
.
GetSysString
(
1262
));
cbDuelRule
->
addItem
(
dataManager
.
GetSysString
(
1263
));
cbDuelRule
->
setSelected
(
DEFAULT_DUEL_RULE
-
1
);
cbDuelRule
->
addItem
(
dataManager
.
GetSysString
(
1264
));
cbDuelRule
->
setSelected
(
gameConf
.
default_rule
-
1
);
chkNoCheckDeck
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
20
,
210
,
170
,
230
),
wCreateHost
,
-
1
,
dataManager
.
GetSysString
(
1229
));
chkNoShuffleDeck
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
180
,
210
,
360
,
230
),
wCreateHost
,
-
1
,
dataManager
.
GetSysString
(
1230
));
env
->
addStaticText
(
dataManager
.
GetSysString
(
1231
),
rect
<
s32
>
(
20
,
240
,
320
,
260
),
false
,
false
,
wCreateHost
);
...
...
@@ -520,11 +521,16 @@ bool Game::Initialize() {
scrDisplayList
=
env
->
addScrollBar
(
true
,
rect
<
s32
>
(
30
,
235
,
650
,
255
),
wCardDisplay
,
SCROLL_CARD_DISPLAY
);
btnDisplayOK
=
env
->
addButton
(
rect
<
s32
>
(
300
,
265
,
380
,
290
),
wCardDisplay
,
BUTTON_CARD_DISP_OK
,
dataManager
.
GetSysString
(
1211
));
//announce number
wANNumber
=
env
->
addWindow
(
rect
<
s32
>
(
550
,
200
,
780
,
295
),
false
,
L""
);
wANNumber
=
env
->
addWindow
(
rect
<
s32
>
(
550
,
180
,
780
,
430
),
false
,
L""
);
wANNumber
->
getCloseButton
()
->
setVisible
(
false
);
wANNumber
->
setVisible
(
false
);
cbANNumber
=
env
->
addComboBox
(
rect
<
s32
>
(
40
,
30
,
190
,
50
),
wANNumber
,
-
1
);
cbANNumber
->
setTextAlignment
(
irr
::
gui
::
EGUIA_CENTER
,
irr
::
gui
::
EGUIA_CENTER
);
for
(
int
i
=
0
;
i
<
12
;
++
i
)
{
myswprintf
(
strbuf
,
L"%d"
,
i
+
1
);
btnANNumber
[
i
]
=
env
->
addButton
(
rect
<
s32
>
(
20
+
50
*
(
i
%
4
),
40
+
50
*
(
i
/
4
),
60
+
50
*
(
i
%
4
),
80
+
50
*
(
i
/
4
)),
wANNumber
,
BUTTON_ANNUMBER_1
+
i
,
strbuf
);
btnANNumber
[
i
]
->
setIsPushButton
(
true
);
}
btnANNumberOK
=
env
->
addButton
(
rect
<
s32
>
(
80
,
60
,
150
,
85
),
wANNumber
,
BUTTON_ANNUMBER_OK
,
dataManager
.
GetSysString
(
1211
));
//announce card
wANCard
=
env
->
addWindow
(
rect
<
s32
>
(
510
,
120
,
820
,
420
),
false
,
L""
);
...
...
@@ -778,7 +784,11 @@ bool Game::Initialize() {
btnBotCancel
=
env
->
addButton
(
rect
<
s32
>
(
459
,
331
,
569
,
356
),
tabBot
,
BUTTON_CANCEL_SINGLEPLAY
,
dataManager
.
GetSysString
(
1210
));
env
->
addStaticText
(
dataManager
.
GetSysString
(
1382
),
rect
<
s32
>
(
360
,
10
,
550
,
30
),
false
,
true
,
tabBot
);
stBotInfo
=
env
->
addStaticText
(
L""
,
rect
<
s32
>
(
360
,
40
,
560
,
160
),
false
,
true
,
tabBot
);
chkBotOldRule
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
360
,
170
,
560
,
190
),
tabBot
,
CHECKBOX_BOT_OLD_RULE
,
dataManager
.
GetSysString
(
1383
));
cbBotRule
=
env
->
addComboBox
(
rect
<
s32
>
(
360
,
165
,
560
,
190
),
tabBot
,
COMBOBOX_BOT_RULE
);
cbBotRule
->
addItem
(
dataManager
.
GetSysString
(
1262
));
cbBotRule
->
addItem
(
dataManager
.
GetSysString
(
1263
));
cbBotRule
->
addItem
(
dataManager
.
GetSysString
(
1264
));
cbBotRule
->
setSelected
(
gameConf
.
default_rule
-
3
);
chkBotHand
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
360
,
200
,
560
,
220
),
tabBot
,
-
1
,
dataManager
.
GetSysString
(
1384
));
chkBotNoCheckDeck
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
360
,
230
,
560
,
250
),
tabBot
,
-
1
,
dataManager
.
GetSysString
(
1229
));
chkBotNoShuffleDeck
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
360
,
260
,
560
,
280
),
tabBot
,
-
1
,
dataManager
.
GetSysString
(
1230
));
...
...
@@ -1212,8 +1222,11 @@ void Game::RefreshBot() {
fgets
(
linebuf
,
256
,
fp
);
newinfo
.
support_master_rule_3
=
!!
strstr
(
linebuf
,
"SUPPORT_MASTER_RULE_3"
);
newinfo
.
support_new_master_rule
=
!!
strstr
(
linebuf
,
"SUPPORT_NEW_MASTER_RULE"
);
if
((
chkBotOldRule
->
isChecked
()
&&
newinfo
.
support_master_rule_3
)
||
(
!
chkBotOldRule
->
isChecked
()
&&
newinfo
.
support_new_master_rule
))
newinfo
.
support_master_rule_2020
=
!!
strstr
(
linebuf
,
"SUPPORT_MASTER_RULE_2020"
);
int
rule
=
cbBotRule
->
getSelected
()
+
3
;
if
((
rule
==
3
&&
newinfo
.
support_master_rule_3
)
||
(
rule
==
4
&&
newinfo
.
support_new_master_rule
)
||
(
rule
==
5
&&
newinfo
.
support_master_rule_2020
))
botInfo
.
push_back
(
newinfo
);
continue
;
}
...
...
@@ -1260,6 +1273,7 @@ void Game::LoadConfig() {
gameConf
.
chkWaitChain
=
0
;
gameConf
.
chkIgnore1
=
0
;
gameConf
.
chkIgnore2
=
0
;
gameConf
.
default_rule
=
DEFAULT_DUEL_RULE
;
gameConf
.
hide_setname
=
0
;
gameConf
.
hide_hint_button
=
0
;
gameConf
.
control_mode
=
0
;
...
...
@@ -1332,6 +1346,10 @@ void Game::LoadConfig() {
gameConf
.
chkIgnore1
=
atoi
(
valbuf
);
}
else
if
(
!
strcmp
(
strbuf
,
"mute_spectators"
))
{
gameConf
.
chkIgnore2
=
atoi
(
valbuf
);
}
else
if
(
!
strcmp
(
strbuf
,
"default_rule"
))
{
gameConf
.
default_rule
=
atoi
(
valbuf
);
if
(
gameConf
.
default_rule
<=
0
)
gameConf
.
default_rule
=
DEFAULT_DUEL_RULE
;
}
else
if
(
!
strcmp
(
strbuf
,
"hide_setname"
))
{
gameConf
.
hide_setname
=
atoi
(
valbuf
);
}
else
if
(
!
strcmp
(
strbuf
,
"hide_hint_button"
))
{
...
...
@@ -1458,6 +1476,10 @@ void Game::LoadConfig() {
gameConf
.
chkIgnore1
=
atoi
(
valbuf
);
}
else
if
(
!
strcmp
(
strbuf
,
"mute_spectators"
))
{
gameConf
.
chkIgnore2
=
atoi
(
valbuf
);
}
else
if
(
!
strcmp
(
strbuf
,
"default_rule"
))
{
gameConf
.
default_rule
=
atoi
(
valbuf
);
if
(
gameConf
.
default_rule
<=
0
)
gameConf
.
default_rule
=
DEFAULT_DUEL_RULE
;
}
else
if
(
!
strcmp
(
strbuf
,
"hide_setname"
))
{
gameConf
.
hide_setname
=
atoi
(
valbuf
);
}
else
if
(
!
strcmp
(
strbuf
,
"hide_hint_button"
))
{
...
...
@@ -1632,6 +1654,7 @@ void Game::SaveConfig() {
fprintf
(
fp
,
"waitchain = %d
\n
"
,
(
chkWaitChain
->
isChecked
()
?
1
:
0
));
fprintf
(
fp
,
"mute_opponent = %d
\n
"
,
(
chkIgnore1
->
isChecked
()
?
1
:
0
));
fprintf
(
fp
,
"mute_spectators = %d
\n
"
,
(
chkIgnore2
->
isChecked
()
?
1
:
0
));
fprintf
(
fp
,
"default_rule = %d
\n
"
,
gameConf
.
default_rule
==
DEFAULT_DUEL_RULE
?
0
:
gameConf
.
default_rule
);
fprintf
(
fp
,
"hide_setname = %d
\n
"
,
gameConf
.
hide_setname
);
fprintf
(
fp
,
"hide_hint_button = %d
\n
"
,
gameConf
.
hide_hint_button
);
fprintf
(
fp
,
"#control_mode = 0: Key A/S/D/R Chain Buttons. control_mode = 1: MouseLeft/MouseRight/NULL/F9 Without Chain Buttons
\n
"
);
...
...
@@ -2078,7 +2101,7 @@ void Game::OnResize() {
wOptions
->
setRelativePosition
(
ResizeWin
(
490
,
200
,
840
,
340
));
wPosSelect
->
setRelativePosition
(
ResizeWin
(
340
,
200
,
935
,
410
));
wCardSelect
->
setRelativePosition
(
ResizeWin
(
320
,
100
,
1000
,
400
));
wANNumber
->
setRelativePosition
(
ResizeWin
(
550
,
200
,
780
,
295
));
wANNumber
->
setRelativePosition
(
ResizeWin
(
550
,
180
,
780
,
430
));
wANCard
->
setRelativePosition
(
ResizeWin
(
510
,
120
,
820
,
420
));
wANAttribute
->
setRelativePosition
(
ResizeWin
(
500
,
200
,
830
,
285
));
wANRace
->
setRelativePosition
(
ResizeWin
(
480
,
200
,
850
,
410
));
...
...
gframe/game.h
View file @
7774f410
...
...
@@ -42,6 +42,7 @@ struct Config {
int
chkWaitChain
;
int
chkIgnore1
;
int
chkIgnore2
;
int
default_rule
;
int
hide_setname
;
int
hide_hint_button
;
int
control_mode
;
...
...
@@ -112,6 +113,7 @@ struct BotInfo {
wchar_t
desc
[
256
];
bool
support_master_rule_3
;
bool
support_new_master_rule
;
bool
support_master_rule_2020
;
};
struct
FadingUnit
{
...
...
@@ -404,7 +406,7 @@ public:
irr
::
gui
::
IGUIStaticText
*
stBotInfo
;
irr
::
gui
::
IGUIButton
*
btnStartBot
;
irr
::
gui
::
IGUIButton
*
btnBotCancel
;
irr
::
gui
::
IGUIC
heckBox
*
chkBotOld
Rule
;
irr
::
gui
::
IGUIC
omboBox
*
cbBot
Rule
;
irr
::
gui
::
IGUICheckBox
*
chkBotHand
;
irr
::
gui
::
IGUICheckBox
*
chkBotNoCheckDeck
;
irr
::
gui
::
IGUICheckBox
*
chkBotNoShuffleDeck
;
...
...
@@ -465,6 +467,7 @@ public:
//announce number
irr
::
gui
::
IGUIWindow
*
wANNumber
;
irr
::
gui
::
IGUIComboBox
*
cbANNumber
;
irr
::
gui
::
IGUIButton
*
btnANNumber
[
12
];
irr
::
gui
::
IGUIButton
*
btnANNumberOK
;
//announce card
irr
::
gui
::
IGUIWindow
*
wANCard
;
...
...
@@ -684,7 +687,7 @@ extern HostInfo game_info;
#define BUTTON_CANCEL_SINGLEPLAY 152
#define LISTBOX_BOT_LIST 153
#define BUTTON_BOT_START 154
#define C
HECKBOX_BOT_OLD_RULE
155
#define C
OMBOBOX_BOT_RULE
155
#define EDITBOX_CHAT 199
#define BUTTON_MSG_OK 200
...
...
@@ -741,9 +744,18 @@ extern HostInfo game_info;
#define BUTTON_CHAIN_WHENAVAIL 266
#define BUTTON_CANCEL_OR_FINISH 267
#define BUTTON_PHASE 268
#define BUTTON_CLEAR_LOG 270
#define LISTBOX_LOG 271
#define SCROLL_CARDTEXT 280
#define BUTTON_ANNUMBER_1 270
#define BUTTON_ANNUMBER_2 271
#define BUTTON_ANNUMBER_3 272
#define BUTTON_ANNUMBER_4 273
#define BUTTON_ANNUMBER_5 274
#define BUTTON_ANNUMBER_6 275
#define BUTTON_ANNUMBER_7 276
#define BUTTON_ANNUMBER_8 277
#define BUTTON_ANNUMBER_9 278
#define BUTTON_ANNUMBER_10 279
#define BUTTON_ANNUMBER_11 280
#define BUTTON_ANNUMBER_12 281
#define BUTTON_DISPLAY_0 290
#define BUTTON_DISPLAY_1 291
#define BUTTON_DISPLAY_2 292
...
...
@@ -780,7 +792,6 @@ extern HostInfo game_info;
#define BUTTON_MARKS_FILTER 322
#define BUTTON_MARKERS_OK 323
#define COMBOBOX_SORTTYPE 324
#define WINDOW_DECK_MANAGE 330
#define BUTTON_NEW_CATEGORY 331
#define BUTTON_RENAME_CATEGORY 332
...
...
@@ -796,6 +807,9 @@ extern HostInfo game_info;
#define BUTTON_DM_CANCEL 342
#define COMBOBOX_LFLIST 349
#define BUTTON_CLEAR_LOG 350
#define LISTBOX_LOG 351
#define SCROLL_CARDTEXT 352
#define CHECKBOX_AUTO_SEARCH 360
#define CHECKBOX_ENABLE_SOUND 361
#define CHECKBOX_ENABLE_MUSIC 362
...
...
@@ -826,7 +840,7 @@ extern HostInfo game_info;
#define TEXTURE_ACTIVATE 6
#ifndef DEFAULT_DUEL_RULE
#define DEFAULT_DUEL_RULE
4
#define DEFAULT_DUEL_RULE
5
#endif
#define CARD_ARTWORK_VERSIONS_OFFSET 10
...
...
gframe/menu_handler.cpp
View file @
7774f410
...
...
@@ -86,6 +86,10 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
soundManager
.
PlaySoundEffect
(
SOUND_INFO
);
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1412
));
mainGame
->
gMutex
.
unlock
();
if
(
auto_watch_mode
)
{
mainGame
->
actionSignal
.
Wait
(
2000
);
mainGame
->
device
->
closeDevice
();
}
break
;
}
else
{
sockaddr_in
*
sin
=
((
struct
sockaddr_in
*
)
answer
->
ai_addr
);
...
...
@@ -562,23 +566,6 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
}
break
;
}
case
irr
:
:
gui
::
EGET_COMBO_BOX_CHANGED
:
{
switch
(
id
)
{
case
COMBOBOX_HP_CATEGORY
:
{
int
catesel
=
mainGame
->
cbCategorySelect
->
getSelected
();
if
(
catesel
==
3
)
{
catesel
=
2
;
mainGame
->
cbCategorySelect
->
setSelected
(
2
);
}
if
(
catesel
>=
0
)
{
mainGame
->
RefreshDeck
(
mainGame
->
cbCategorySelect
,
mainGame
->
cbDeckSelect
);
mainGame
->
cbDeckSelect
->
setSelected
(
0
);
}
break
;
}
}
break
;
}
case
irr
:
:
gui
::
EGET_CHECKBOX_CHANGED
:
{
switch
(
id
)
{
case
CHECKBOX_HP_READY
:
{
...
...
@@ -602,10 +589,27 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
}
break
;
}
case
CHECKBOX_BOT_OLD_RULE
:
{
}
break
;
}
case
irr
:
:
gui
::
EGET_COMBO_BOX_CHANGED
:
{
switch
(
id
)
{
case
COMBOBOX_BOT_RULE
:
{
mainGame
->
RefreshBot
();
break
;
}
case
COMBOBOX_HP_CATEGORY
:
{
int
catesel
=
mainGame
->
cbCategorySelect
->
getSelected
();
if
(
catesel
==
3
)
{
catesel
=
2
;
mainGame
->
cbCategorySelect
->
setSelected
(
2
);
}
if
(
catesel
>=
0
)
{
mainGame
->
RefreshDeck
(
mainGame
->
cbCategorySelect
,
mainGame
->
cbDeckSelect
);
mainGame
->
cbDeckSelect
->
setSelected
(
0
);
}
break
;
}
}
break
;
}
...
...
gframe/premake4.lua
View file @
7774f410
...
...
@@ -3,8 +3,18 @@ include "lzma/."
project
"ygopro"
kind
"ConsoleApp"
local
mr
=
os.getenv
(
"YGOPRO_DEFAULT_DUEL_RULE"
)
if
mr
and
tonumber
(
mr
)
then
defines
{
"DEFAULT_DUEL_RULE="
..
tonumber
(
mr
)
}
end
local
params
=
{
"DEFAULT_DUEL_RULE"
,
"DECKCOUNT_MAIN_MIN"
,
"DECKCOUNT_MAIN_MAX"
,
"DECKCOUNT_SIDE"
,
"DECKCOUNT_EXTRA"
,
}
for
_
,
param
in
ipairs
(
params
)
do
local
val
=
os.getenv
(
"YGOPRO_"
..
param
)
if
val
and
tonumber
(
val
)
then
defines
{
param
..
"="
..
tonumber
(
val
)
}
end
end
files
{
"gframe.cpp"
,
"config.h"
,
"game.cpp"
,
"game.h"
,
"myfilesystem.h"
,
...
...
gframe/tag_duel.cpp
View file @
7774f410
...
...
@@ -686,8 +686,7 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) {
case
1
:
case
2
:
case
3
:
case
5
:
case
10
:
{
case
5
:
{
NetServer
::
SendBufferToPlayer
(
cur_player
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
break
;
}
...
...
@@ -708,7 +707,8 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) {
}
case
11
:
case
12
:
case
13
:
{
case
13
:
case
10
:
{
for
(
int
i
=
0
;
i
<
4
;
++
i
)
NetServer
::
SendBufferToPlayer
(
players
[
i
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
for
(
auto
oit
=
observers
.
begin
();
oit
!=
observers
.
end
();
++
oit
)
...
...
lflist.conf
View file @
7774f410
This diff is collapsed.
Click to expand it.
premake4.lua
View file @
7774f410
...
...
@@ -2,7 +2,6 @@ solution "ygo"
location
"build"
language
"C++"
objdir
"obj"
--startproject "ygopro"
configurations
{
"Release"
,
"Debug"
}
defines
{
"LUA_COMPAT_5_2"
,
"YGOPRO_SERVER_MODE"
}
--, "YGOPRO_LUA_SAVE" }
...
...
strings.conf
View file @
7774f410
...
...
@@ -311,6 +311,7 @@
!
system
1261
大师规则2
!
system
1262
大师规则3
!
system
1263
新大师规则
!
system
1264
大师规则
2020
!
system
1270
卡片信息
!
system
1271
消息记录
!
system
1272
清除记录
...
...
@@ -417,7 +418,6 @@
!
system
1380
人机模式
!
system
1381
残局模式
!
system
1382
人机信息:
!
system
1383
使用旧规则(大师规则3)
!
system
1384
电脑锁定出剪刀
!
system
1385
列表为空,可能未安装合适的人机
!
system
1386
使用正则表达式搜索卡片
...
...
@@ -1019,3 +1019,4 @@
!
setname
0
x138
巨石遗物 メガリス
!
setname
0
x139
守护神官 守護神官
!
setname
0
x13a
拟声 オノマト
!
setname
0
x13b
叛逆 リベリオン
system.conf
View file @
7774f410
...
...
@@ -20,6 +20,7 @@ autochain = 0
waitchain
=
0
mute_opponent
=
0
mute_spectators
=
0
default_rule
=
0
hide_setname
=
0
hide_hint_button
=
0
#control_mode = 0: Key A/S/D/R Chain Buttons. control_mode = 1: MouseLeft/MouseRight/NULL/F9 Without Chain Buttons
...
...
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