Commit ffbcbaab authored by mercury233's avatar mercury233

Merge branch 'master' of https://github.com/Fluorohydride/ygopro

parents 712f9cd6 9b3a65f9
## ygopro
## YGOPro
A script engine for "yu-gi-oh!" and sample gui
[中文说明](https://github.com/Fluorohydride/ygopro/wiki/%E4%B8%AD%E6%96%87%E8%AF%B4%E6%98%8E)
###Keys:
### Keys:
* ESC: Minimize the window.
* A: Holding down this button will let the system stop at every timing.
* S: Holding down this button will let the system skip every timing.
* R: Fix the font error.
* D: Holding down this button will let the system stop at available timing.
* R: Fix the font glitch.
* F1~F4: Show the cards in your grave, banished zone, extra deck, xyz materials.
* F5~F8: Show the cards in your opponent's grave, banished zone, extra deck, xyz materials.
###Color in card list:
####Background:
### Color in card list:
#### Background:
* White = your card, Grey = your opponent's card
####Text:
#### Text:
Cards in deck, extra deck and banished zone:
* Black = face-up, Blue = face-down
Xyz materials:
* Black = default, Blue = the owner of the xyz material is different from its controller
###Sequence:
### Sequence:
* Monster Zone: 1~5, starting from the left hand side.
* Spell & Trap Zone: 1~5, starting from the left hand side.
* Field Zone: 6
* Pendulum Zone: 7~8, starting from the left hand side.
* Pendulum Zone: 0~1, starting from the left hand side.
* The others: 1~n, starting from the bottom.
###Deck edit page:
### Deck edit page:
* All numeric textboxs: They support >, =, <, >=, <= signs.
* Card name: Search card names and texts by default, $foo will only search foo in card names, and @foo will search cards of "foo" archetype(due to translation, card name contains "foo" does not mean that card is "foo" card).
### Command-line options:
* -j: Join the host in system.conf file.
* -d: Enter the deck edit page.
* -r: Enter the replay mode page.
* -s: Enter the single mode page.
* -efoo: Load foo as the extra database.
* `-e foo.cdb`: Load foo.cdb as the extra database.
* `-n nickname`: Set the nickname.
* `-h 192.168.0.2`: Set the host to join in LAN mode.
* `-p 7911`: Set the port to join in LAN mode.
* `-w abc`: Set the password to join in LAN mode.
* `-d`: Enter the deck edit page.
* `-d deck`: If used along with `-j` it mean select the deck, or it will open the deck to edit.
* `-c`: Create host with default settings.
* `-j`: Join the host specified in above, or if absent, lasthost in system.conf file.
* `-r`: Enter the replay mode page.
* `-r replay.yrp`: Load the replay.yrp in replay mode.
* `-s`: Enter the single mode page.
* `-s puzzle.lua`: Load the puzzle.lua in single mode.
* `-k`: Keep when duel finished. See below.
#### Note:
* `-c` `-j` `-e` `-r` `-s` shoule be the last parameter, because any parameters after it will get ignored.
* `-d` `-c` `-j` `-e` `-r` `-s` will make YGOPro automatically exit when the duel or deck editing is finished. This is useful for some launchers. If you want to keep it, add `-k` before them.
* `-d` `-r` `-s` support full path of file, or just filename. But remember deck filename should NOT have extension when replay and single filename MUST have extension.
### Directories:
* pics: .jpg card images(177*254).
......
......@@ -153,7 +153,7 @@ void SGUITTGlyph::preload(u32 char_index, FT_Face face, video::IVideoDriver* dri
}
glyph_page = parent->getLastGlyphPageIndex();
u32 texture_side_length = page->texture->getOriginalSize().Width;
u32 texture_side_length = page->texture_size.Width;
core::vector2di page_position(
(page->used_slots % (texture_side_length / font_size)) * font_size,
(page->used_slots / (texture_side_length / font_size)) * font_size
......@@ -230,7 +230,7 @@ CGUITTFont* CGUITTFont::create(IrrlichtDevice *device, const io::path& filename,
//! Constructor.
CGUITTFont::CGUITTFont(IGUIEnvironment *env)
: use_monochrome(false), use_transparency(true), use_hinting(true), use_auto_hinting(true),
batch_load_size(1), Device(0), Environment(env), Driver(0), GlobalKerningWidth(0), GlobalKerningHeight(0) {
batch_load_size(1), Device(0), Environment(env), Driver(0), GlobalKerningWidth(0), GlobalKerningHeight(0), supposed_line_height(0) {
#ifdef _DEBUG
setDebugName("CGUITTFont");
#endif
......@@ -345,6 +345,24 @@ bool CGUITTFont::load(const io::path& filename, const u32 size, const bool antia
getGlyphIndexByChar((uchar32_t)0);
batch_load_size = old_size;
// Calculate the supposed line height of this font (of this size) --
// Not using FT_SizeMetric::ascender or height, but actually by testing some of the glyphs,
// to see what should give a reasonable not cluttered line height.
// The ascender or height info may as well just be arbitrary ones.
// Get the maximum font height. Unfortunately, we have to do this hack as
// Irrlicht will draw things wrong. In FreeType, the font size is the
// maximum size for a single glyph, but that glyph may hang "under" the
// draw line, increasing the total font height to beyond the set size.
// Irrlicht does not understand this concept when drawing fonts. Also, I
// add +1 to give it a 1 pixel blank border. This makes things like
// tooltips look nicer.
s32 test1 = getHeightFromCharacter((uchar32_t)'g') + 1;
s32 test2 = getHeightFromCharacter((uchar32_t)'j') + 1;
s32 test3 = getHeightFromCharacter((uchar32_t)0x55B5) + 1;
supposed_line_height = core::max_(test1, core::max_(test2, test3));
return true;
}
......@@ -443,9 +461,8 @@ CGUITTGlyphPage* CGUITTFont::createGlyphPage(const u8& pixel_mode) {
if (page_texture_size.Width > max_texture_size.Width || page_texture_size.Height > max_texture_size.Height)
page_texture_size = max_texture_size;
if (!page->createPageTexture(pixel_mode, page_texture_size))
// TODO: add error message?
return 0;
page->texture_size = page_texture_size;
page->pixel_mode = pixel_mode;
if (page) {
// Determine the number of glyph slots on the page and add it to the list of pages.
......@@ -522,7 +539,7 @@ void CGUITTFont::draw(const core::stringw& text, const core::rect<s32>& position
if (lineBreak) {
previousChar = 0;
offset.Y += font_metrics.ascender / 64;
offset.Y += supposed_line_height; //font_metrics.ascender / 64;
offset.X = position.UpperLeftCorner.X;
if (hcenter)
......@@ -577,20 +594,8 @@ core::dimension2d<u32> CGUITTFont::getDimension(const wchar_t* text) const {
}
core::dimension2d<u32> CGUITTFont::getDimension(const core::ustring& text) const {
// Get the maximum font height. Unfortunately, we have to do this hack as
// Irrlicht will draw things wrong. In FreeType, the font size is the
// maximum size for a single glyph, but that glyph may hang "under" the
// draw line, increasing the total font height to beyond the set size.
// Irrlicht does not understand this concept when drawing fonts. Also, I
// add +1 to give it a 1 pixel blank border. This makes things like
// tooltips look nicer.
s32 test1 = getHeightFromCharacter((uchar32_t)'g') + 1;
s32 test2 = getHeightFromCharacter((uchar32_t)'j') + 1;
s32 test3 = getHeightFromCharacter((uchar32_t)'_') + 1;
s32 max_font_height = core::max_(test1, core::max_(test2, test3));
core::dimension2d<u32> text_dimension(0, max_font_height);
core::dimension2d<u32> line(0, max_font_height);
core::dimension2d<u32> text_dimension(0, supposed_line_height);
core::dimension2d<u32> line(0, supposed_line_height);
uchar32_t previousChar = 0;
core::ustring::const_iterator iter = text.begin();
......@@ -619,7 +624,7 @@ core::dimension2d<u32> CGUITTFont::getDimension(const core::ustring& text) const
if (text_dimension.Width < line.Width)
text_dimension.Width = line.Width;
line.Width = 0;
line.Height = max_font_height;
line.Height = supposed_line_height;
continue;
}
line.Width += getWidthFromCharacter(p);
......@@ -938,7 +943,7 @@ core::array<scene::ISceneNode*> CGUITTFont::addTextSceneNode(const wchar_t* text
if (line_break) {
previous_char = 0;
offset.Y -= tt_face->size->metrics.ascender / 64;
offset.Y -= supposed_line_height; //tt_face->size->metrics.ascender / 64;
offset.X = start_point.X;
if (center)
offset.X += (text_size.Width - getDimensionUntilEndOfLine(text + 1).Width) >> 1;
......
......@@ -143,6 +143,12 @@ public:
void updateTexture() {
if (!dirty) return;
if (!texture) {
if (!createPageTexture(pixel_mode, texture_size))
// TODO: add error message?
return;
}
void* ptr = texture->lock();
video::ECOLOR_FORMAT format = texture->getColorFormat();
core::dimension2du size = texture->getOriginalSize();
......@@ -176,6 +182,9 @@ public:
core::array<core::vector2di> render_positions;
core::array<core::recti> render_source_rects;
core::dimension2du texture_size;
u8 pixel_mode;
private:
core::array<const SGUITTGlyph*> glyph_to_be_paged;
video::IVideoDriver* driver;
......@@ -368,6 +377,7 @@ private:
s32 GlobalKerningWidth;
s32 GlobalKerningHeight;
s32 supposed_line_height;
core::ustring Invisible;
};
......
......@@ -16,6 +16,7 @@ ClientCard::ClientCard() {
is_selected = false;
is_showequip = false;
is_showtarget = false;
is_showchaintarget = false;
is_highlighting = false;
is_disabled = false;
is_reversed = false;
......@@ -27,6 +28,7 @@ ClientCard::ClientCard() {
alias = 0;
level = 0;
rank = 0;
link = 0;
race = 0;
attribute = 0;
attack = 0;
......@@ -35,11 +37,13 @@ ClientCard::ClientCard() {
base_defense = 0;
lscale = 0;
rscale = 0;
link_marker = 0;
cHint = 0;
chValue = 0;
atkstring[0] = 0;
defstring[0] = 0;
lvstring[0] = 0;
linkstring[0] = 0;
rscstring[0] = 0;
lscstring[0] = 0;
overlayTarget = 0;
......@@ -101,7 +105,10 @@ void ClientCard::UpdateInfo(char* buf) {
}
if(flag & QUERY_DEFENSE) {
defense = BufferIO::ReadInt32(buf);
if(defense < 0) {
if(type & TYPE_LINK) {
defstring[0] = '-';
defstring[1] = 0;
} else if(defense < 0) {
defstring[0] = '?';
defstring[1] = 0;
} else
......@@ -162,6 +169,17 @@ void ClientCard::UpdateInfo(char* buf) {
rscale = BufferIO::ReadInt32(buf);
myswprintf(rscstring, L"%d", rscale);
}
if(flag & QUERY_LINK) {
pdata = BufferIO::ReadInt32(buf);
if (link != (unsigned int)pdata) {
link = pdata;
}
myswprintf(linkstring, L"L\x2012%d", link);
pdata = BufferIO::ReadInt32(buf);
if (link_marker != (unsigned int)pdata) {
link_marker = pdata;
}
}
}
void ClientCard::ClearTarget() {
for(auto cit = cardTarget.begin(); cit != cardTarget.end(); ++cit) {
......@@ -197,8 +215,8 @@ bool ClientCard::deck_sort_lv(code_pointer p1, code_pointer p2) {
if((p1->second.type & 0x7) != (p2->second.type & 0x7))
return (p1->second.type & 0x7) < (p2->second.type & 0x7);
if((p1->second.type & 0x7) == 1) {
int type1 = (p1->second.type & 0x8020c0) ? (p1->second.type & 0x8020c1) : (p1->second.type & 0x31);
int type2 = (p2->second.type & 0x8020c0) ? (p2->second.type & 0x8020c1) : (p2->second.type & 0x31);
int type1 = (p1->second.type & 0x48020c0) ? (p1->second.type & 0x48020c1) : (p1->second.type & 0x31);
int type2 = (p2->second.type & 0x48020c0) ? (p2->second.type & 0x48020c1) : (p2->second.type & 0x31);
if(type1 != type2)
return type1 < type2;
if(p1->second.level != p2->second.level)
......@@ -223,8 +241,8 @@ bool ClientCard::deck_sort_atk(code_pointer p1, code_pointer p2) {
return p1->second.defense > p2->second.defense;
if(p1->second.level != p2->second.level)
return p1->second.level > p2->second.level;
int type1 = (p1->second.type & 0x8020c0) ? (p1->second.type & 0x8020c1) : (p1->second.type & 0x31);
int type2 = (p2->second.type & 0x8020c0) ? (p2->second.type & 0x8020c1) : (p2->second.type & 0x31);
int type1 = (p1->second.type & 0x48020c0) ? (p1->second.type & 0x48020c1) : (p1->second.type & 0x31);
int type2 = (p2->second.type & 0x48020c0) ? (p2->second.type & 0x48020c1) : (p2->second.type & 0x31);
if(type1 != type2)
return type1 < type2;
return p1->first < p2->first;
......@@ -243,8 +261,8 @@ bool ClientCard::deck_sort_def(code_pointer p1, code_pointer p2) {
return p1->second.attack > p2->second.attack;
if(p1->second.level != p2->second.level)
return p1->second.level > p2->second.level;
int type1 = (p1->second.type & 0x8020c0) ? (p1->second.type & 0x8020c1) : (p1->second.type & 0x31);
int type2 = (p2->second.type & 0x8020c0) ? (p2->second.type & 0x8020c1) : (p2->second.type & 0x31);
int type1 = (p1->second.type & 0x48020c0) ? (p1->second.type & 0x48020c1) : (p1->second.type & 0x31);
int type2 = (p2->second.type & 0x48020c0) ? (p2->second.type & 0x48020c1) : (p2->second.type & 0x31);
if(type1 != type2)
return type1 < type2;
return p1->first < p2->first;
......
......@@ -20,6 +20,7 @@ struct CardData {
int defense;
unsigned int lscale;
unsigned int rscale;
unsigned int link_marker;
};
struct CardDataC {
unsigned int code;
......@@ -33,6 +34,7 @@ struct CardDataC {
int defense;
unsigned int lscale;
unsigned int rscale;
unsigned int link_marker;
unsigned int ot;
unsigned int category;
};
......@@ -45,7 +47,6 @@ typedef std::unordered_map<unsigned int, CardDataC>::const_iterator code_pointer
class ClientCard {
public:
irr::video::ITexture* curTexture;
irr::core::matrix4 mTransform;
irr::core::vector3df curPos;
irr::core::vector3df curRot;
......@@ -61,6 +62,7 @@ public:
bool is_selected;
bool is_showequip;
bool is_showtarget;
bool is_showchaintarget;
bool is_highlighting;
bool is_reversed;
u32 code;
......@@ -69,6 +71,7 @@ public:
u32 type;
u32 level;
u32 rank;
u32 link;
u32 attribute;
u32 race;
s32 attack;
......@@ -77,6 +80,7 @@ public:
s32 base_defense;
u32 lscale;
u32 rscale;
u32 link_marker;
u32 reason;
u32 select_seq;
u8 owner;
......@@ -102,6 +106,7 @@ public:
wchar_t atkstring[16];
wchar_t defstring[16];
wchar_t lvstring[16];
wchar_t linkstring[16];
wchar_t lscstring[16];
wchar_t rscstring[16];
......
This diff is collapsed.
......@@ -3,12 +3,13 @@
#include "config.h"
#include <vector>
#include <set>
namespace ygo {
class ClientCard;
struct ChainInfo{
struct ChainInfo {
irr::core::vector3df chain_pos;
ClientCard* chain_card;
int code;
......@@ -17,6 +18,7 @@ struct ChainInfo{
int location;
int sequence;
bool solved;
std::set<ClientCard*> target;
};
class ClientField: public irr::IEventReceiver {
......@@ -128,10 +130,12 @@ public:
int list_command;
virtual bool OnEvent(const irr::SEvent& event);
virtual bool OnCommonEvent(const irr::SEvent& event);
void GetHoverField(int x, int y);
void ShowMenu(int flag, int x, int y);
void UpdateChainButtons();
void ShowCancelOrFinishButton(int buttonOp);
void SetShowMark(ClientCard* pcard, bool enable);
void SetResponseSelectedCards() const;
};
......
......@@ -4,7 +4,7 @@
#pragma once
#define _IRR_STATIC_LIB_
#define _IRR_COMPILE_WITH_DX9_DEV_PACK
#define IRR_COMPILE_WITH_DX9_DEV_PACK
#ifdef _WIN32
#include <WinSock2.h>
......@@ -28,6 +28,7 @@
#include <arpa/inet.h>
#include <netdb.h>
#include <unistd.h>
#include <locale.h>
#define SD_BOTH 2
#define SOCKET int
......
......@@ -31,6 +31,11 @@ bool DataManager::LoadDB(const char* file) {
cd.type = sqlite3_column_int(pStmt, 4);
cd.attack = sqlite3_column_int(pStmt, 5);
cd.defense = sqlite3_column_int(pStmt, 6);
if(cd.type & TYPE_LINK) {
cd.link_marker = cd.defense;
cd.defense = 0;
} else
cd.link_marker = 0;
unsigned int level = sqlite3_column_int(pStmt, 7);
cd.level = level & 0xff;
cd.lscale = (level >> 24) & 0xff;
......@@ -73,39 +78,26 @@ bool DataManager::LoadStrings(const char* file) {
char linebuf[256];
char strbuf[256];
int value;
fseek(fp, 0, SEEK_END);
int fsize = ftell(fp);
fseek(fp, 0, SEEK_SET);
fgets(linebuf, 256, fp);
while(ftell(fp) < fsize) {
fgets(linebuf, 256, fp);
while(fgets(linebuf, 256, fp)) {
if(linebuf[0] != '!')
continue;
sscanf(linebuf, "!%s", strbuf);
if(!strcmp(strbuf, "system")) {
sscanf(&linebuf[7], "%d %240[^\n]", &value, strbuf);
int len = BufferIO::DecodeUTF8(strbuf, strBuffer);
wchar_t* pbuf = new wchar_t[len + 1];
wcscpy(pbuf, strBuffer);
_sysStrings[value] = pbuf;
BufferIO::DecodeUTF8(strbuf, strBuffer);
_sysStrings[value] = strBuffer;
} else if(!strcmp(strbuf, "victory")) {
sscanf(&linebuf[8], "%x %240[^\n]", &value, strbuf);
int len = BufferIO::DecodeUTF8(strbuf, strBuffer);
wchar_t* pbuf = new wchar_t[len + 1];
wcscpy(pbuf, strBuffer);
_victoryStrings[value] = pbuf;
BufferIO::DecodeUTF8(strbuf, strBuffer);
_victoryStrings[value] = strBuffer;
} else if(!strcmp(strbuf, "counter")) {
sscanf(&linebuf[8], "%x %240[^\n]", &value, strbuf);
int len = BufferIO::DecodeUTF8(strbuf, strBuffer);
wchar_t* pbuf = new wchar_t[len + 1];
wcscpy(pbuf, strBuffer);
_counterStrings[value] = pbuf;
BufferIO::DecodeUTF8(strbuf, strBuffer);
_counterStrings[value] = strBuffer;
} else if(!strcmp(strbuf, "setname")) {
sscanf(&linebuf[8], "%x %240[^\t\n]", &value, strbuf);//using tab for comment
int len = BufferIO::DecodeUTF8(strbuf, strBuffer);
wchar_t* pbuf = new wchar_t[len + 1];
wcscpy(pbuf, strBuffer);
_setnameStrings[value] = pbuf;
BufferIO::DecodeUTF8(strbuf, strBuffer);
_setnameStrings[value] = strBuffer;
}
}
fclose(fp);
......@@ -170,33 +162,35 @@ const wchar_t* DataManager::GetDesc(int strCode) {
return unknown_string;
}
const wchar_t* DataManager::GetSysString(int code) {
if(code < 0 || code >= 2048 || _sysStrings[code] == 0)
if(code < 0 || code >= 2048)
return unknown_string;
return _sysStrings[code];
auto csit = _sysStrings.find(code);
if(csit == _sysStrings.end())
return unknown_string;
return csit->second.c_str();
}
const wchar_t* DataManager::GetVictoryString(int code) {
auto csit = _victoryStrings.find(code);
if(csit == _victoryStrings.end())
return unknown_string;
return csit->second;
return csit->second.c_str();
}
const wchar_t* DataManager::GetCounterName(int code) {
auto csit = _counterStrings.find(code);
if(csit == _counterStrings.end())
return unknown_string;
return csit->second;
return csit->second.c_str();
}
const wchar_t* DataManager::GetSetName(int code) {
auto csit = _setnameStrings.find(code);
if(csit == _setnameStrings.end())
return NULL;
return csit->second;
return csit->second.c_str();
}
unsigned int DataManager::GetSetCode(const wchar_t* setname) {
wchar_t strbuff[256];
for(auto csit = _setnameStrings.begin(); csit != _setnameStrings.end(); ++csit) {
swscanf(csit->second, L"%[^|]", strbuff);//setname|extra info
if(wcscmp(strbuff, setname) == 0)
auto xpos = csit->second.find_first_of(L'|');//setname|extra info
if(csit->second.compare(0, xpos, setname) == 0)
return csit->first;
}
return 0;
......@@ -267,7 +261,7 @@ const wchar_t* DataManager::FormatType(int type) {
wchar_t* p = tpBuffer;
unsigned filter = 1;
int i = 1050;
for(; filter != 0x4000000; filter <<= 1, ++i) {
for(; filter != 0x8000000; filter <<= 1, ++i) {
if(type & filter) {
BufferIO::CopyWStrRef(GetSysString(i), p, 16);
*p = L'|';
......@@ -285,7 +279,7 @@ const wchar_t* DataManager::FormatSetName(unsigned long long setcode) {
for(int i = 0; i < 4; ++i) {
const wchar_t* setname = GetSetName((setcode >> i * 16) & 0xffff);
if(setname) {
BufferIO::CopyWStrRef(setname, p, 16);
BufferIO::CopyWStrRef(setname, p, 32);
*p = L'|';
*++p = 0;
}
......@@ -296,6 +290,27 @@ const wchar_t* DataManager::FormatSetName(unsigned long long setcode) {
return unknown_string;
return scBuffer;
}
const wchar_t* DataManager::FormatLinkMarker(int link_marker) {
wchar_t* p = lmBuffer;
*p = 0;
if(link_marker & LINK_MARKER_TOP_LEFT)
BufferIO::CopyWStrRef(L"[\u2196]", p, 4);
if(link_marker & LINK_MARKER_TOP)
BufferIO::CopyWStrRef(L"[\u2191]", p, 4);
if(link_marker & LINK_MARKER_TOP_RIGHT)
BufferIO::CopyWStrRef(L"[\u2197]", p, 4);
if(link_marker & LINK_MARKER_LEFT)
BufferIO::CopyWStrRef(L"[\u2190]", p, 4);
if(link_marker & LINK_MARKER_RIGHT)
BufferIO::CopyWStrRef(L"[\u2192]", p, 4);
if(link_marker & LINK_MARKER_BOTTOM_LEFT)
BufferIO::CopyWStrRef(L"[\u2199]", p, 4);
if(link_marker & LINK_MARKER_BOTTOM)
BufferIO::CopyWStrRef(L"[\u2193]", p, 4);
if(link_marker & LINK_MARKER_BOTTOM_RIGHT)
BufferIO::CopyWStrRef(L"[\u2198]", p, 4);
return lmBuffer;
}
int DataManager::CardReader(int code, void* pData) {
if(!dataManager.GetData(code, (CardData*)pData))
memset(pData, 0, sizeof(CardData));
......
......@@ -31,20 +31,22 @@ public:
const wchar_t* FormatRace(int race);
const wchar_t* FormatType(int type);
const wchar_t* FormatSetName(unsigned long long setcode);
const wchar_t* FormatLinkMarker(int link_marker);
std::unordered_map<unsigned int, CardDataC> _datas;
std::unordered_map<unsigned int, CardString> _strings;
std::unordered_map<unsigned int, wchar_t*> _counterStrings;
std::unordered_map<unsigned int, wchar_t*> _victoryStrings;
std::unordered_map<unsigned int, wchar_t*> _setnameStrings;
std::unordered_map<unsigned int, std::wstring> _counterStrings;
std::unordered_map<unsigned int, std::wstring> _victoryStrings;
std::unordered_map<unsigned int, std::wstring> _setnameStrings;
std::unordered_map<unsigned int, std::wstring> _sysStrings;
wchar_t* _sysStrings[2048];
wchar_t numStrings[256][4];
wchar_t numBuffer[6];
wchar_t attBuffer[128];
wchar_t racBuffer[128];
wchar_t tpBuffer[128];
wchar_t scBuffer[128];
wchar_t lmBuffer[32];
static wchar_t strBuffer[4096];
static const wchar_t* unknown_string;
......
This diff is collapsed.
......@@ -11,11 +11,26 @@ namespace ygo {
class DeckBuilder: public irr::IEventReceiver {
public:
virtual bool OnEvent(const irr::SEvent& event);
void Initialize();
void Terminate();
void GetHoveredCard();
void FilterCards();
void StartFilter();
void ClearFilter();
void InstantSearch();
void ClearSearch();
void SortList();
bool CardNameContains(const wchar_t *haystack, const wchar_t *needle);
bool push_main(code_pointer pointer, int seq = -1);
bool push_extra(code_pointer pointer, int seq = -1);
bool push_side(code_pointer pointer, int seq = -1);
void pop_main(int seq);
void pop_extra(int seq);
void pop_side(int seq);
bool check_limit(code_pointer pointer);
long long filter_effect;
unsigned int filter_type;
unsigned int filter_type2;
......@@ -29,20 +44,25 @@ public:
unsigned int filter_lv;
unsigned int filter_scltype;
unsigned int filter_scl;
unsigned int filter_marks;
int filter_lm;
position2di mouse_pos;
int hovered_code;
int hovered_pos;
int hovered_seq;
int is_lastcard;
int click_pos;
bool is_draging;
bool is_starting_dragging;
int dragx;
int dragy;
size_t pre_mainc;
size_t pre_extrac;
size_t pre_sidec;
code_pointer draging_pointer;
bool is_deleting;
bool is_clearing;
int prev_deck;
s32 prev_operation;
bool is_modified;
std::unordered_map<int, int>* filterList;
std::vector<code_pointer> results;
......
......@@ -13,12 +13,7 @@ void DeckManager::LoadLFList() {
char linebuf[256];
wchar_t strBuffer[256];
if(fp) {
fseek(fp, 0, SEEK_END);
int fsize = ftell(fp);
fseek(fp, 0, SEEK_SET);
fgets(linebuf, 256, fp);
while(ftell(fp) < fsize) {
fgets(linebuf, 256, fp);
while(fgets(linebuf, 256, fp)) {
if(linebuf[0] == '#')
continue;
int p = 0, sa = 0, code, count;
......@@ -84,7 +79,7 @@ int DeckManager::CheckLFList(Deck& deck, int lfhash, bool allow_ocg, bool allow_
code_pointer cit = deck.main[i];
if((!allow_ocg && (cit->second.ot == 0x1)) || (!allow_tcg && (cit->second.ot == 0x2)))
return cit->first;
if(cit->second.type & (TYPE_FUSION | TYPE_SYNCHRO | TYPE_XYZ | TYPE_TOKEN))
if(cit->second.type & (TYPE_FUSION | TYPE_SYNCHRO | TYPE_XYZ | TYPE_TOKEN | TYPE_LINK))
return 1;
int code = cit->second.alias ? cit->second.alias : cit->first;
ccount[code]++;
......@@ -127,7 +122,7 @@ void DeckManager::LoadDeck(Deck& deck, int* dbuf, int mainc, int sidec) {
continue;
if(cd.type & TYPE_TOKEN)
continue;
else if(cd.type & 0x802040 && deck.extra.size() < 15) {
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) {
deck.main.push_back(dataManager.GetCodePointer(code));
......@@ -191,12 +186,7 @@ bool DeckManager::LoadDeck(const wchar_t* file) {
int cardlist[128];
bool is_side = false;
char linebuf[256];
fseek(fp, 0, SEEK_END);
int fsize = ftell(fp);
fseek(fp, 0, SEEK_SET);
fgets(linebuf, 256, fp);
while(ftell(fp) < fsize && ct < 128) {
fgets(linebuf, 256, fp);
while(fgets(linebuf, 256, fp) && ct < 128) {
if(linebuf[0] == '!') {
is_side = true;
continue;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -13,6 +13,7 @@ namespace ygo {
struct Config {
bool use_d3d;
bool use_image_scale;
unsigned short antialias;
unsigned short serverport;
unsigned char textfontsize;
......@@ -25,7 +26,8 @@ struct Config {
wchar_t numfont[256];
wchar_t roompass[20];
//settings
int chkAutoPos;
int chkMAutoPos;
int chkSTAutoPos;
int chkRandomPos;
int chkAutoChain;
int chkWaitChain;
......@@ -36,6 +38,8 @@ struct Config {
int control_mode;
int draw_field_spell;
int separate_clear_button;
int auto_search_limit;
int chkIgnoreDeckChanges;
};
struct DuelInfo {
......@@ -48,6 +52,7 @@ struct DuelInfo {
bool is_shuffling;
bool tag_player[2];
int lp[2];
int duel_rule;
int turn;
short curMsg;
wchar_t hostname[20];
......@@ -88,11 +93,15 @@ public:
void RefreshSingleplay();
void DrawSelectionLine(irr::video::S3DVertex* vec, bool strip, int width, float* cv);
void DrawBackGround();
void DrawLinkedZones(ClientCard* pcard);
void CheckMutual(ClientCard* pcard, int mark);
void DrawCards();
void DrawCard(ClientCard* pcard);
void DrawMisc();
void DrawStatus(ClientCard* pcard, int x1, int y1, int x2, int y2);
void DrawGUI();
void DrawSpec();
void DrawBackImage(irr::video::ITexture* texture);
void ShowElement(irr::gui::IGUIElement* element, int autoframe = 0);
void HideElement(irr::gui::IGUIElement* element, bool set_action = false);
void PopupElement(irr::gui::IGUIElement* element, int hideframe = 0);
......@@ -103,6 +112,7 @@ public:
void SaveConfig();
void ShowCardInfo(int code);
void AddChatMsg(wchar_t* msg, int player);
void AddDebugMsg(char* msgbuf);
void ClearTextures();
void CloseDuelWindow();
......@@ -196,12 +206,15 @@ public:
irr::gui::IGUIStaticText* stSetName;
irr::gui::IGUIStaticText* stText;
irr::gui::IGUIScrollBar* scrCardText;
irr::gui::IGUICheckBox* chkAutoPos;
irr::gui::IGUICheckBox* chkMAutoPos;
irr::gui::IGUICheckBox* chkSTAutoPos;
irr::gui::IGUICheckBox* chkRandomPos;
irr::gui::IGUICheckBox* chkAutoChain;
irr::gui::IGUICheckBox* chkWaitChain;
irr::gui::IGUICheckBox* chkHideSetname;
irr::gui::IGUICheckBox* chkHideHintButton;
irr::gui::IGUICheckBox* chkIgnoreDeckChanges;
irr::gui::IGUICheckBox* chkAutoSearch;
irr::gui::IGUIListBox* lstLog;
irr::gui::IGUIButton* btnClearLog;
irr::gui::IGUIButton* btnSaveLog;
......@@ -235,7 +248,7 @@ public:
irr::gui::IGUIEditBox* ebDrawCount;
irr::gui::IGUIEditBox* ebServerName;
irr::gui::IGUIEditBox* ebServerPass;
irr::gui::IGUICheckBox* chkEnablePriority;
irr::gui::IGUIComboBox* cbDuelRule;
irr::gui::IGUICheckBox* chkNoCheckDeck;
irr::gui::IGUICheckBox* chkNoShuffleDeck;
irr::gui::IGUIButton* btnHostConfirm;
......@@ -250,6 +263,8 @@ public:
irr::gui::IGUIComboBox* cbDeckSelect;
irr::gui::IGUIStaticText* stHostPrepRule;
irr::gui::IGUIStaticText* stHostPrepOB;
irr::gui::IGUIButton* btnHostPrepReady;
irr::gui::IGUIButton* btnHostPrepNotReady;
irr::gui::IGUIButton* btnHostPrepStart;
irr::gui::IGUIButton* btnHostPrepCancel;
//replay
......@@ -344,9 +359,7 @@ public:
irr::gui::IGUICheckBox* chkIgnore2;
//phase button
irr::gui::IGUIStaticText* wPhase;
irr::gui::IGUIButton* btnDP;
irr::gui::IGUIButton* btnSP;
irr::gui::IGUIButton* btnM1;
irr::gui::IGUIButton* btnPhaseStatus;
irr::gui::IGUIButton* btnBP;
irr::gui::IGUIButton* btnM2;
irr::gui::IGUIButton* btnEP;
......@@ -381,6 +394,10 @@ public:
irr::gui::IGUIWindow* wCategories;
irr::gui::IGUICheckBox* chkCategory[32];
irr::gui::IGUIButton* btnCategoryOK;
irr::gui::IGUIButton* btnMarksFilter;
irr::gui::IGUIWindow* wLinkMarks;
irr::gui::IGUIButton* btnMark[8];
irr::gui::IGUIButton* btnMarksOK;
//sort type
irr::gui::IGUIStaticText* wSort;
irr::gui::IGUIComboBox* cbSortType;
......@@ -399,6 +416,8 @@ public:
irr::gui::IGUIButton* btnReplaySwap;
//surrender/leave
irr::gui::IGUIButton* btnLeaveGame;
//swap
irr::gui::IGUIButton* btnSpectatorSwap;
//chain control
irr::gui::IGUIButton* btnChainIgnore;
irr::gui::IGUIButton* btnChainAlways;
......@@ -411,6 +430,11 @@ extern Game* mainGame;
}
#define CARD_IMG_WIDTH 177
#define CARD_IMG_HEIGHT 254
#define CARD_THUMB_WIDTH 44
#define CARD_THUMB_HEIGHT 64
#define UEVENT_EXIT 0x1
#define UEVENT_TOWINDOW 0x2
......@@ -446,6 +470,8 @@ extern Game* mainGame;
#define BUTTON_HP_CANCEL 123
#define BUTTON_HP_KICK 124
#define CHECKBOX_HP_READY 125
#define BUTTON_HP_READY 126
#define BUTTON_HP_NOTREADY 127
#define LISTBOX_REPLAY_LIST 130
#define BUTTON_LOAD_REPLAY 131
#define BUTTON_CANCEL_REPLAY 132
......@@ -496,6 +522,7 @@ extern Game* mainGame;
#define BUTTON_CHAIN_ALWAYS 265
#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
......@@ -518,11 +545,14 @@ extern Game* mainGame;
#define BUTTON_SIDE_OK 309
#define BUTTON_SHUFFLE_DECK 310
#define COMBOBOX_MAINTYPE 311
#define BUTTON_EFFECT_FILTER 312
#define BUTTON_START_FILTER 313
#define SCROLL_FILTER 314
#define EDITBOX_KEYWORD 315
#define BUTTON_CLEAR_FILTER 316
#define COMBOBOX_SECONDTYPE 312
#define BUTTON_EFFECT_FILTER 313
#define BUTTON_START_FILTER 314
#define SCROLL_FILTER 315
#define EDITBOX_KEYWORD 316
#define BUTTON_CLEAR_FILTER 317
#define COMBOBOX_ATTRIBUTE 318
#define COMBOBOX_RACE 319
#define BUTTON_REPLAY_START 320
#define BUTTON_REPLAY_PAUSE 321
#define BUTTON_REPLAY_STEP 322
......@@ -534,5 +564,12 @@ extern Game* mainGame;
#define LISTBOX_SINGLEPLAY_LIST 350
#define BUTTON_LOAD_SINGLEPLAY 351
#define BUTTON_CANCEL_SINGLEPLAY 352
#define CHECKBOX_AUTO_SEARCH 360
#define COMBOBOX_SORTTYPE 370
#define COMBOBOX_LIMIT 371
#define BUTTON_MARKS_FILTER 380
#define BUTTON_MARKERS_OK 381
#define DEFAULT_DUEL_RULE 4
#endif // GAME_H
......@@ -2,6 +2,9 @@
#include "game.h"
#include "data_manager.h"
#include <event2/thread.h>
#ifdef __APPLE__
#import <CoreFoundation/CoreFoundation.h>
#endif
int enable_log = 0;
bool exit_on_return = false;
......@@ -33,12 +36,26 @@ void ClickButton(irr::gui::IGUIElement* btn) {
}
int main(int argc, char* argv[]) {
#ifndef _WIN32
setlocale(LC_CTYPE, "UTF-8");
#endif
#ifdef __APPLE__
CFURLRef bundle_url = CFBundleCopyBundleURL(CFBundleGetMainBundle());
CFURLRef bundle_base_url = CFURLCreateCopyDeletingLastPathComponent(NULL, bundle_url);
CFRelease(bundle_url);
CFStringRef path = CFURLCopyFileSystemPath(bundle_base_url, kCFURLPOSIXPathStyle);
CFRelease(bundle_base_url);
chdir(CFStringGetCStringPtr(path, kCFStringEncodingUTF8));
CFRelease(path);
#endif //__APPLE__
#ifdef _WIN32
#ifndef _DEBUG
wchar_t exepath[MAX_PATH];
GetModuleFileNameW(NULL, exepath, MAX_PATH);
wchar_t* p = wcsrchr(exepath, '\\');
*p = '\0';
SetCurrentDirectoryW(exepath);
#endif //_DEBUG
#endif //_WIN32
#ifdef _WIN32
WORD wVersionRequested;
......@@ -94,12 +111,12 @@ int main(int argc, char* argv[]) {
} else if(!strcmp(argv[i], "-k")) { // Keep on return
exit_on_return = false;
keep_on_return = true;
} else if(!strcmp(argv[i], "-j")) { // Join host
exit_on_return = !keep_on_return;
ClickButton(ygo::mainGame->btnLanMode);
ClickButton(ygo::mainGame->btnJoinHost);
break;
} else if(!strcmp(argv[i], "-d")) { // Deck
if(i + 2 < argc) { // select deck
++i;
GetParameterW(ygo::mainGame->gameConf.lastdeck, &argv[i][0]);
continue;
} else { // open deck
exit_on_return = !keep_on_return;
if(i < argc) {
open_file = true;
......@@ -107,6 +124,17 @@ int main(int argc, char* argv[]) {
}
ClickButton(ygo::mainGame->btnDeckEdit);
break;
}
} else if(!strcmp(argv[i], "-c")) { // Create host
exit_on_return = !keep_on_return;
ygo::mainGame->HideElement(ygo::mainGame->wMainMenu);
ClickButton(ygo::mainGame->btnHostConfirm);
break;
} else if(!strcmp(argv[i], "-j")) { // Join host
exit_on_return = !keep_on_return;
ClickButton(ygo::mainGame->btnLanMode);
ClickButton(ygo::mainGame->btnJoinHost);
break;
} else if(!strcmp(argv[i], "-r")) { // Replay
exit_on_return = !keep_on_return;
if(i < argc) {
......
This diff is collapsed.
......@@ -13,6 +13,7 @@ public:
void SetDevice(irr::IrrlichtDevice* dev);
void ClearTexture();
void RemoveTexture(int code);
irr::video::ITexture* GetTextureFromFile(char* file, s32 width, s32 height);
irr::video::ITexture* GetTexture(int code);
irr::video::ITexture* GetTextureThumb(int code);
irr::video::ITexture* GetTextureField(int code);
......@@ -34,14 +35,15 @@ public:
irr::video::ITexture* tMask;
irr::video::ITexture* tEquip;
irr::video::ITexture* tTarget;
irr::video::ITexture* tChainTarget;
irr::video::ITexture* tLim;
irr::video::ITexture* tOT;
irr::video::ITexture* tHand[3];
irr::video::ITexture* tBackGround;
irr::video::ITexture* tBackGround_menu;
irr::video::ITexture* tBackGround_deck;
irr::video::ITexture* tField;
irr::video::ITexture* tFieldTransparent;
irr::video::ITexture* tField[2];
irr::video::ITexture* tFieldTransparent[2];
};
extern ImageManager imageManager;
......
This diff is collapsed.
......@@ -19,12 +19,18 @@ public:
S3DVertex vFieldSpell[4];
S3DVertex vFieldSpell1[4];
S3DVertex vFieldSpell2[4];
S3DVertex vBackLine[76];
S3DVertex vFields[140];
//S3DVertex vBackLine[76];
S3DVertex vFieldDeck[2][4];
S3DVertex vFieldGrave[2][2][4];
S3DVertex vFieldExtra[2][4];
S3DVertex vFieldRemove[2][2][4];
S3DVertex vFieldMzone[2][7][4];
S3DVertex vFieldSzone[2][8][2][4];
irr::core::vector3df vFieldContiAct[4];
S3DVertex vArrow[40];
SColor c2d[4];
u16 iRectangle[6];
u16 iBackLine[116];
//u16 iBackLine[116];
u16 iArrow[40];
irr::video::SMaterial mCard;
irr::video::SMaterial mTexture;
......
......@@ -10,6 +10,21 @@
namespace ygo {
void UpdateDeck() {
BufferIO::CopyWStr(mainGame->cbDeckSelect->getItem(mainGame->cbDeckSelect->getSelected()),
mainGame->gameConf.lastdeck, 64);
char deckbuf[1024];
char* pdeck = deckbuf;
BufferIO::WriteInt32(pdeck, deckManager.current_deck.main.size() + deckManager.current_deck.extra.size());
BufferIO::WriteInt32(pdeck, deckManager.current_deck.side.size());
for(size_t i = 0; i < deckManager.current_deck.main.size(); ++i)
BufferIO::WriteInt32(pdeck, deckManager.current_deck.main[i]->first);
for(size_t i = 0; i < deckManager.current_deck.extra.size(); ++i)
BufferIO::WriteInt32(pdeck, deckManager.current_deck.extra[i]->first);
for(size_t i = 0; i < deckManager.current_deck.side.size(); ++i)
BufferIO::WriteInt32(pdeck, deckManager.current_deck.side[i]->first);
DuelClient::SendBufferToServer(CTOS_UPDATE_DECK, deckbuf, pdeck - deckbuf);
}
bool MenuHandler::OnEvent(const irr::SEvent& event) {
switch(event.EventType) {
case irr::EET_GUI_EVENT: {
......@@ -108,6 +123,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
break;
}
case BUTTON_HP_DUELIST: {
mainGame->cbDeckSelect->setEnabled(true);
DuelClient::SendPacketToServer(CTOS_HS_TODUELIST);
break;
}
......@@ -127,10 +143,22 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
DuelClient::SendPacketToServer(CTOS_HS_KICK, csk);
break;
}
case BUTTON_HP_START: {
if(!mainGame->chkHostPrepReady[0]->isChecked()
|| !mainGame->chkHostPrepReady[1]->isChecked())
case BUTTON_HP_READY: {
if(mainGame->cbDeckSelect->getSelected() == -1 ||
!deckManager.LoadDeck(mainGame->cbDeckSelect->getItem(mainGame->cbDeckSelect->getSelected()))) {
break;
}
UpdateDeck();
DuelClient::SendPacketToServer(CTOS_HS_READY);
mainGame->cbDeckSelect->setEnabled(false);
break;
}
case BUTTON_HP_NOTREADY: {
DuelClient::SendPacketToServer(CTOS_HS_NOTREADY);
mainGame->cbDeckSelect->setEnabled(true);
break;
}
case BUTTON_HP_START: {
DuelClient::SendPacketToServer(CTOS_HS_START);
break;
}
......@@ -185,9 +213,6 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
mainGame->btnReplayStep->setVisible(false);
mainGame->btnReplayUndo->setVisible(false);
mainGame->wPhase->setVisible(true);
mainGame->dField.panel = 0;
mainGame->dField.hovered_card = 0;
mainGame->dField.clicked_card = 0;
mainGame->dField.Clear();
mainGame->HideElement(mainGame->wReplay);
mainGame->device->setEventReceiver(&mainGame->dField);
......@@ -243,43 +268,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
mainGame->ebDeckname->setText(L"");
}
mainGame->HideElement(mainGame->wMainMenu);
mainGame->is_building = true;
mainGame->is_siding = false;
mainGame->wInfos->setVisible(true);
mainGame->wCardImg->setVisible(true);
mainGame->wDeckEdit->setVisible(true);
mainGame->wFilter->setVisible(true);
mainGame->wSort->setVisible(true);
mainGame->btnLeaveGame->setVisible(true);
mainGame->btnLeaveGame->setText(dataManager.GetSysString(1306));
mainGame->btnSideOK->setVisible(false);
mainGame->deckBuilder.filterList = deckManager._lfList[0].content;
mainGame->cbDBLFList->setSelected(0);
mainGame->cbCardType->setSelected(0);
mainGame->cbCardType2->setSelected(0);
mainGame->cbAttribute->setSelected(0);
mainGame->cbRace->setSelected(0);
mainGame->ebAttack->setText(L"");
mainGame->ebDefense->setText(L"");
mainGame->ebStar->setText(L"");
mainGame->ebScale->setText(L"");
mainGame->cbCardType2->setEnabled(false);
mainGame->cbAttribute->setEnabled(false);
mainGame->cbRace->setEnabled(false);
mainGame->ebAttack->setEnabled(false);
mainGame->ebDefense->setEnabled(false);
mainGame->ebStar->setEnabled(false);
mainGame->ebScale->setEnabled(false);
mainGame->deckBuilder.filter_effect = 0;
mainGame->deckBuilder.result_string[0] = L'0';
mainGame->deckBuilder.result_string[1] = 0;
mainGame->deckBuilder.results.clear();
mainGame->deckBuilder.is_draging = false;
mainGame->deckBuilder.is_deleting = false;
mainGame->deckBuilder.is_clearing = false;
mainGame->device->setEventReceiver(&mainGame->deckBuilder);
for(int i = 0; i < 32; ++i)
mainGame->chkCategory[i]->setChecked(false);
mainGame->deckBuilder.Initialize();
break;
}
}
......@@ -313,11 +302,11 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
myswprintf(infobuf, L"%d/%d/%d %02d:%02d:%02d\n", st->tm_year + 1900, st->tm_mon + 1, st->tm_mday, st->tm_hour, st->tm_min, st->tm_sec);
repinfo.append(infobuf);
wchar_t namebuf[4][20];
BufferIO::CopyWStr((unsigned short*)&ReplayMode::cur_replay.replay_data[0], namebuf[0], 20);
BufferIO::CopyWStr((unsigned short*)&ReplayMode::cur_replay.replay_data[40], namebuf[1], 20);
ReplayMode::cur_replay.ReadName(namebuf[0]);
ReplayMode::cur_replay.ReadName(namebuf[1]);
if(ReplayMode::cur_replay.pheader.flag & REPLAY_TAG) {
BufferIO::CopyWStr((unsigned short*)&ReplayMode::cur_replay.replay_data[80], namebuf[2], 20);
BufferIO::CopyWStr((unsigned short*)&ReplayMode::cur_replay.replay_data[120], namebuf[3], 20);
ReplayMode::cur_replay.ReadName(namebuf[2]);
ReplayMode::cur_replay.ReadName(namebuf[3]);
}
if(ReplayMode::cur_replay.pheader.flag & REPLAY_TAG)
myswprintf(infobuf, L"%ls\n%ls\n===VS===\n%ls\n%ls\n", namebuf[0], namebuf[1], namebuf[2], namebuf[3]);
......@@ -343,19 +332,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
static_cast<irr::gui::IGUICheckBox*>(caller)->setChecked(false);
break;
}
BufferIO::CopyWStr(mainGame->cbDeckSelect->getItem(mainGame->cbDeckSelect->getSelected()),
mainGame->gameConf.lastdeck, 64);
char deckbuf[1024];
char* pdeck = deckbuf;
BufferIO::WriteInt32(pdeck, deckManager.current_deck.main.size() + deckManager.current_deck.extra.size());
BufferIO::WriteInt32(pdeck, deckManager.current_deck.side.size());
for(size_t i = 0; i < deckManager.current_deck.main.size(); ++i)
BufferIO::WriteInt32(pdeck, deckManager.current_deck.main[i]->first);
for(size_t i = 0; i < deckManager.current_deck.extra.size(); ++i)
BufferIO::WriteInt32(pdeck, deckManager.current_deck.extra[i]->first);
for(size_t i = 0; i < deckManager.current_deck.side.size(); ++i)
BufferIO::WriteInt32(pdeck, deckManager.current_deck.side[i]->first);
DuelClient::SendBufferToServer(CTOS_UPDATE_DECK, deckbuf, pdeck - deckbuf);
UpdateDeck();
DuelClient::SendPacketToServer(CTOS_HS_READY);
mainGame->cbDeckSelect->setEnabled(false);
} else {
......
......@@ -15,7 +15,7 @@ struct HostInfo {
unsigned int lflist;
unsigned char rule;
unsigned char mode;
bool enable_priority;
unsigned char duel_rule;
bool no_check_deck;
bool no_shuffle_deck;
unsigned int start_lp;
......
This diff is collapsed.
......@@ -36,6 +36,7 @@ public:
bool OpenReplay(const wchar_t* name);
static bool CheckReplay(const wchar_t* name);
bool ReadNextResponse(unsigned char resp[64]);
void ReadName(wchar_t* data);
void ReadHeader(ReplayHeader& header);
void ReadData(void* data, unsigned int length);
int ReadInt32();
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Subproject commit 2182420064fd752750c282b64217183563b13453
Subproject commit 1f1d9cba25969e85760185a3fbb6f2070beba1aa
Subproject commit 5bac33f528c7838f1909fd4e460d1b9d5308bdf8
Subproject commit a880e460e6b641590b9657c0769735b2267a9029
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment