Commit d8ab2d6e authored by nanahira's avatar nanahira

Merge branch 'server' into 2pick

parents e69938eb 666ca9e4
......@@ -30,7 +30,6 @@
/Magic*
/pics
/Printer
/script
/ygopro-*
/*-Cards
......@@ -77,6 +76,8 @@
/.vscode
/bak/
/temp
[Tt]humbs.cdb
/PrinterData.txt
/ygopro_*.bat
/ygopro_*.sh
......@@ -11,15 +11,8 @@ addons:
- libsqlite3-dev
before_install:
- git submodule update --init --recursive
- wget 'http://www.lua.org/ftp/lua-5.3.4.tar.gz'
- tar zxf lua-5.3.4.tar.gz
- cd lua-5.3.4
- make linux test
- sudo make install
- cd ..
- wget -O - https://github.com/premake/premake-core/releases/download/v5.0.0-alpha12/premake-5.0.0-alpha12-linux.tar.gz | tar zfx -
- wget -O - https://www.lua.org/ftp/lua-5.3.4.tar.gz | tar zfx -; cd lua-5.3.4; sudo make linux install; cd ..
script:
- ./premake5 gmake
- cd build
......
......@@ -11,7 +11,7 @@
* gcc
* premake5
* libevent
* lua5.2
* lua5.3
* sqlite3
* 可参考本项目 [.travis.yml](https://github.com/mycard/ygopro/blob/server/.travis.yml) 中的脚本
......@@ -20,7 +20,7 @@
* Visual Studio
* premake5
* libevent
* lua5.2
* lua5.3
* sqlite3
* 可参考本项目 [appveyor.yml](https://github.com/mycard/ygopro/blob/server/appveyor.yml) 中的脚本
......
version: '{build}'
skip_tags: true
install:
- git submodule update --init --recursive
......@@ -25,9 +27,6 @@ install:
# let premake happy
- xcopy /E premake\* .
# patch lua
# - patch -p0 < lua\lua.patch
# premake
- premake5 vs2015
......@@ -40,72 +39,23 @@ build:
after_build:
- ps: move bin\release\ygopro.exe .
- git clone https://github.com/Smile-DK/ygopro-svrelease
- bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://github.com/purerosefallen/ygopro-server/archive/master.zip ; exit 0"
- 7z x ygopro-server-master.zip
- mv -f ygopro-server-master ygopro-server
- bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://nodejs.org/dist/v9.1.0/node-v9.1.0-win-x64.zip ; exit 0"
- bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://github.com/MicrosoftArchive/redis/releases/download/win-3.2.100/Redis-x64-3.2.100.zip ; exit 0"
- bash -c "curl --retry 5 --connect-timeout 30 --location --remote-header-name --remote-name https://github.com/purerosefallen/windbot/archive/master.zip ; exit 0"
- 7z x windbot-master.zip
- cd windbot-master
- msbuild /property:Configuration=Release /property:OutDir=../ygopro-server/windbot
- cd ../ygopro-server
- mkdir ygopro
- cd ygopro
- mkdir replay
- mv -f ../../gframe .
- mv -f ../../ocgcore .
- mv -f ../../premake .
- mv -f ../../event .
- mv -f ../../lua .
- mv -f ../../sqlite3 .
- mv -f ../../script .
- mv -f ../../cards.cdb .
- mv -f ../../textures .
- mv -f ../../premake4.lua .
- mv -f ../../premake5.lua .
- mv -f ../../lflist.conf .
- mv -f ../../strings.conf .
- mv -f ../../system.conf .
- cp -rf ../../ygopro.exe .
- mv -f ../../premake5.exe .
- cd ..
- mkdir redis
- cd redis
- cp -rf ../../Redis-x64-3.2.100.zip .
- 7z x Redis-x64-3.2.100.zip
- rm -rf Redis-x64-3.2.100.zip
- cd ..
- cp -rf ygopro/cards.cdb windbot
- cp -rf config_build config
- cp -rf ../node-v9.1.0-win-x64.zip .
- 7z x node-v9.1.0-win-x64.zip
- rm -rf node-v9.1.0-win-x64.zip
- cp -rf node-v9.1.0-win-x64/* .
- rm -rf node-v9.1.0-win-x64
- npm install
- npm install pm2@latest -g
- npm install ws
- npm install redis
- 7z a -mx9 -xr!.git* ../ygopro-server.7z ./*
- cd ..
test: off
artifacts:
- path: ygopro.exe
name: ygopro
- path: ygopro-server.7z
name: ygopro-server
name: ygopro server mode
deploy:
release: win
description: 'Automatic build commit $(APPVEYOR_REPO_COMMIT) $(APPVEYOR_REPO_COMMIT_TIMESTAMP)'
provider: GitHub
force_update: true
auth_token:
secure: EQ9miMjfX/QAoBvgc6D+JLmHatLyxOEKZ/uo68QijxWW5Gp4MzB/pOH9+u2GlDVO
on:
branch: server
cache:
- premake-5.0.0-alpha12-windows.zip
......@@ -114,5 +64,3 @@ cache:
- irrlicht-1.8.4.zip
- lua-5.3.4.tar.gz
- sqlite-amalgamation-3210000.zip
- Redis-x64-3.2.100.zip
No preview for this file type
#include "CConfigMap.h"
core::stringc CConfigMap::getConfig( const core::stringc& name )
{
core::map<core::stringc,core::stringc>::Node* node = Map.find(name);
if ( node == 0 )
return core::stringc();
return node->getValue();
}
s32 CConfigMap::getConfigAsInt( const core::stringc& name )
{
core::stringc cfg = getConfig(name);
if ( cfg.size() == 0 )
return 0;
s32 x = 0;
sscanf( cfg.c_str(), "%d", &x );
return x;
}
f32 CConfigMap::getConfigAsFloat( const core::stringc& name )
{
core::stringc cfg = getConfig(name);
if ( cfg.size() == 0 )
return 0;
f32 x = 0.0f;
sscanf( cfg.c_str(), "%f", &x );
return x;
}
core::vector2df CConfigMap::getConfigAsVector2df( const core::stringc& name )
{
core::stringc cfg = getConfig(name);
if ( cfg.size() == 0 )
return core::vector2df(0,0);
core::vector2df vec;
sscanf( cfg.c_str(), "%f , %f", &vec.X, &vec.Y );
return vec;
}
core::vector3df CConfigMap::getConfigAsVector3df( const core::stringc& name )
{
core::stringc cfg = getConfig(name);
if ( cfg.size() == 0 )
return core::vector3df(0,0,0);
core::vector3df vec;
sscanf( cfg.c_str(), "%f , %f , %f", &vec.X, &vec.Y, &vec.Z );
return vec;
}
bool CConfigMap::hasConfig( const core::stringc& name )
{
core::map<core::stringc,core::stringc>::Node* node = Map.find(name);
return ( node != 0 );
}
void CConfigMap::setConfig( const core::stringc& name, const core::stringc& value )
{
Map.set(name,value);
}
#ifndef CCONFIGMAP_H_
#define CCONFIGMAP_H_
#include <irrMap.h>
#include <irrString.h>
#include <irrTypes.h>
#include <vector2d.h>
#include <vector3d.h>
using namespace irr;
class CConfigMap
{
public:
core::stringc getConfig( const core::stringc& name );
s32 getConfigAsInt( const core::stringc& name );
f32 getConfigAsFloat( const core::stringc& name );
core::vector2df getConfigAsVector2df( const core::stringc& name );
core::vector3df getConfigAsVector3df( const core::stringc& name );
bool hasConfig( const core::stringc& name );
void setConfig( const core::stringc& name, const core::stringc& value );
private:
core::map<core::stringc,core::stringc> Map;
};
#endif
#include "CGUIProgressBar.h"
#include <IGUIEnvironment.h>
#include "CImageGUISkin.h"
#include <IGUIFont.h>
namespace irr
{
namespace gui
{
CGUIProgressBar::CGUIProgressBar( IGUIElement* parent, IGUIEnvironment* environment, const core::rect<s32>& rectangle, s32 id,bool bind )
: IGUIElement( EGUIET_ELEMENT, environment, parent, id, rectangle )
{
FilledRatio = 0.0f;
FillColor = video::SColor(255,255,0,0);
EmptyColor = video::SColor();
AutomaticTextFormat = L"%2.0f %%";
bindColorsToSkin = bind;
}
void CGUIProgressBar::setAutomaticText( const wchar_t* text )
{
AutomaticTextFormat = text? text:L"";
if ( AutomaticTextFormat != L"" )
{
wchar_t* buffer = new wchar_t[ AutomaticTextFormat.size() + 10 ];
swprintf( buffer, AutomaticTextFormat.size() + 10, AutomaticTextFormat.c_str(), 100*FilledRatio );
Text = buffer;
delete buffer;
}
}
void CGUIProgressBar::setFillColor( video::SColor fill )
{
FillColor = fill;
}
video::SColor CGUIProgressBar::getFillColor() const
{
return FillColor;
}
void CGUIProgressBar::setEmptyColor( video::SColor empty )
{
EmptyColor = empty;
}
video::SColor CGUIProgressBar::getEmptyColor() const
{
return EmptyColor;
}
void CGUIProgressBar::setProgress( f32 progress )
{
FilledRatio = progress;
if ( AutomaticTextFormat != L"" )
{
wchar_t* buffer = new wchar_t[ AutomaticTextFormat.size() + 10 ];
swprintf( buffer, AutomaticTextFormat.size() + 10, AutomaticTextFormat.c_str(), 100*FilledRatio );
Text = buffer;
delete buffer;
}
}
f32 CGUIProgressBar::getProgress() const
{
return FilledRatio;
}
void CGUIProgressBar::draw()
{
CImageGUISkin* skin = static_cast<CImageGUISkin*>( Environment->getSkin() );
// Madoc added these changes to let the progress bar get its fill colors from the skin
if(bindColorsToSkin) {
EmptyColor = ((gui::SImageGUISkinConfig)skin->getConfig()).ProgressBar.Color;
FillColor = ((gui::SImageGUISkinConfig)skin->getConfig()).ProgressBarFilled.Color;
}
// End Madoc changes
skin->drawHorizontalProgressBar( this, AbsoluteRect, &AbsoluteClippingRect, FilledRatio, FillColor, EmptyColor );
// Draw text in center
skin->getFont(EGDF_DEFAULT)->draw( Text.c_str(), AbsoluteRect, skin->getColor(EGDC_BUTTON_TEXT), true, true, &AbsoluteClippingRect );
}
}
}
#ifndef CGUIPROGRESSBAR_H_
#define CGUIPROGRESSBAR_H_
#include <IGUIElement.h>
#include <SColor.h>
namespace irr
{
namespace gui
{
/*!
* A horizontal progess bar. ONLY works with CImageGUISkin applied - will fail
* if another skin is used.
*/
class CGUIProgressBar : public IGUIElement
{
public:
// If you want your progress bar colors to be independent of the skin set bind to false -- Madoc
CGUIProgressBar( IGUIElement* parent, IGUIEnvironment* environment, const core::rect<s32>& rectangle, s32 id=-1 ,bool bind=true);
//! Automatically updates the progress bar's text every time the progress changes.
//! Set format to NULL or an empty string to disable automatic text.
void setAutomaticText( const wchar_t* format );
void setFillColor( video::SColor fill );
video::SColor getFillColor() const;
void setEmptyColor( video::SColor empty );
video::SColor getEmptyColor() const;
void setProgress( f32 progress );
f32 getProgress() const;
virtual void draw();
private:
video::SColor FillColor;
video::SColor EmptyColor;
bool bindColorsToSkin;
f32 FilledRatio;
core::stringw AutomaticTextFormat;
};
} // namespace gui
} // namespace irr
#endif
This diff is collapsed.
#ifndef __C_GUISKIN_SYSTEM_H_INCLUDED__
#define __C_GUISKIN_SYSTEM_H_INCLUDED__
#ifdef _WIN32
#include <irrlicht.h>
#endif
#include "CImageGUISkin.h"
#include "CGUIProgressBar.h"
//#include "SkinLoader.h"
#include "../CXMLRegistry/CXMLRegistry.h"
#ifndef _WIN32
// gcc dosnt do 'debug'
#ifndef _DEBUG
#define _DEBUG
#endif
#endif
#define SKINSYSTEM_SKINFILE "/skin.xml"
using namespace irr;
class CGUISkinSystem {
private :
IrrlichtDevice *device;
io::IFileSystem *fs;
io::path skinsPath;
core::array<core::stringw> skinsList;
CXMLRegistry *registry;
gui::CImageGUISkin* loadSkinFromFile(const c8 *skinfile);
void ParseGUIElementStyle(gui::SImageGUIElementStyle& elem, const core::stringc& name,bool nullcolors=false);
bool checkSkinColor(gui::EGUI_DEFAULT_COLOR colToSet,const wchar_t *context,gui::CImageGUISkin *skin);
bool checkSkinSize(gui::EGUI_DEFAULT_SIZE sizeToSet,const wchar_t *context,const wchar_t *key,gui::CImageGUISkin *skin);
bool loadProperty(core::stringw key,gui::CImageGUISkin *skin);
public:
// Constructor
// path = Path to skins
// dev = Irrlicht device
CGUISkinSystem(core::string<wchar_t> path,IrrlichtDevice *dev);
~CGUISkinSystem();
core::array<core::stringw> listSkins();
bool loadSkinList();
bool applySkin(const wchar_t *skinname);
gui::CGUIProgressBar *addProgressBar(gui::IGUIElement *parent,core::rect<s32> rect,bool bindColorsToSkin=true);
// Gets property from current skin
core::stringw getProperty(core::stringw key);
bool populateTreeView(gui::IGUITreeView *control,const core::stringc& skinname);
};
#endif
This diff is collapsed.
#ifndef CIMAGEGUISKIN_H_
#define CIMAGEGUISKIN_H_
#include <IGUISkin.h>
#include <irrString.h>
#include <irrMap.h>
#include <IGUISpriteBank.h>
namespace irr
{
namespace video
{
class IVideoDriver;
class ITexture;
}
namespace gui
{
struct SImageGUIElementStyle
{
struct SBorder
{
s32 Top, Left, Bottom, Right;
SBorder() : Top(0), Left(0), Bottom(0), Right(0) {}
};
SBorder SrcBorder;
SBorder DstBorder;
video::ITexture* Texture;
video::SColor Color;
SImageGUIElementStyle() : Texture(0), Color(255,255,255,255) {}
};
struct SImageGUISkinConfig
{
SImageGUIElementStyle SunkenPane, Window, Button, ButtonPressed, ButtonDisabled, ProgressBar, ProgressBarFilled, TabButton, TabButtonPressed, TabBody, MenuBar, MenuPane, MenuPressed, CheckBox, CheckBoxDisabled, ComboBox, ComboBoxDisabled;
video::SColor CheckBoxColor;
};
class CImageGUISkin : public IGUISkin
{
public:
CImageGUISkin( video::IVideoDriver* videoDriver, IGUISkin* fallbackSkin );
virtual ~CImageGUISkin();
void loadConfig( const SImageGUISkinConfig& config );
//! returns default color
virtual video::SColor getColor(EGUI_DEFAULT_COLOR color) const;
//! sets a default color
virtual void setColor(EGUI_DEFAULT_COLOR which, video::SColor newColor);
//! returns default color
virtual s32 getSize(EGUI_DEFAULT_SIZE size) const;
//! Returns a default text.
virtual const wchar_t* getDefaultText(EGUI_DEFAULT_TEXT text) const;
//! Sets a default text.
virtual void setDefaultText(EGUI_DEFAULT_TEXT which, const wchar_t* newText);
//! sets a default size
virtual void setSize(EGUI_DEFAULT_SIZE which, s32 size);
//! returns the default font
virtual IGUIFont* getFont(EGUI_DEFAULT_FONT defaultFont) const;
//! sets a default font
virtual void setFont(IGUIFont* font, EGUI_DEFAULT_FONT defaultFont);
//! returns the sprite bank
virtual IGUISpriteBank* getSpriteBank() const;
//! sets the sprite bank
virtual void setSpriteBank(IGUISpriteBank* bank);
virtual u32 getIcon(EGUI_DEFAULT_ICON icon) const;
virtual void setIcon(EGUI_DEFAULT_ICON icon, u32 index);
virtual void draw3DButtonPaneStandard(IGUIElement* element,
const core::rect<s32>& rect,
const core::rect<s32>* clip=0);
virtual void draw3DButtonPanePressed(IGUIElement* element,
const core::rect<s32>& rect,
const core::rect<s32>* clip=0);
virtual void draw3DSunkenPane(IGUIElement* element,
video::SColor bgcolor, bool flat, bool fillBackGround,
const core::rect<s32>& rect,
const core::rect<s32>* clip=0);
/* Updates for irrlicht 1.7 by Mamnarock
virtual core::rect<s32> draw3DWindowBackground(IGUIElement* element,
bool drawTitleBar, video::SColor titleBarColor,
const core::rect<s32>& rect,
const core::rect<s32>* clip=0);
*/
virtual core::rect<s32> draw3DWindowBackground(IGUIElement* element,
bool drawTitleBar, video::SColor titleBarColor,
const core::rect<s32>& rect,
const core::rect<s32>* clip=0,
core::rect<s32>* checkClientArea=0);
virtual void draw3DMenuPane(IGUIElement* element,
const core::rect<s32>& rect,
const core::rect<s32>* clip=0);
virtual void draw3DToolBar(IGUIElement* element,
const core::rect<s32>& rect,
const core::rect<s32>* clip=0);
virtual void draw3DTabButton(IGUIElement* element, bool active,
const core::rect<s32>& rect, const core::rect<s32>* clip=0, EGUI_ALIGNMENT alignment=EGUIA_UPPERLEFT);
virtual void draw3DTabBody(IGUIElement* element, bool border, bool background,
const core::rect<s32>& rect, const core::rect<s32>* clip=0,s32 tabHeight=-1, gui::EGUI_ALIGNMENT alignment=EGUIA_UPPERLEFT );
virtual void drawIcon(IGUIElement* element, EGUI_DEFAULT_ICON icon,
const core::position2di position, u32 starttime=0, u32 currenttime=0,
bool loop=false, const core::rect<s32>* clip=0);
// Madoc - I had to add some things
// Exposes config so we can get the progress bar colors
virtual SImageGUISkinConfig getConfig() { return Config; }
// End Madoc adds
virtual void drawHorizontalProgressBar( IGUIElement* element, const core::rect<s32>& rectangle, const core::rect<s32>* clip,
f32 filledRatio, video::SColor fillColor, video::SColor emptyColor );
virtual void draw2DRectangle(IGUIElement* element, const video::SColor &color,
const core::rect<s32>& pos, const core::rect<s32>* clip = 0);
virtual void setProperty(core::stringw key, core::stringw value);
virtual core::stringw getProperty(core::stringw key);
private:
void drawElementStyle( const SImageGUIElementStyle& elem, const core::rect<s32>& rect, const core::rect<s32>* clip, video::SColor* color=0 );
video::IVideoDriver* VideoDriver;
IGUISkin* FallbackSkin;
SImageGUISkinConfig Config;
core::map<core::stringw,core::stringw> properties;
};
}
}
#endif
#ifndef _CLIP_RECTS_H_
#define _CLIP_RECTS_H_
#include <rect.h>
namespace irr
{
//! Workaround for a bug in IVideoDriver::draw2DImage( ITexture* tex, rect<s32> dstRect, rect<s32> srcRect, rect<s32>* clip, SColor* colors, bool alpha )
//! It modifies dstRect and srcRect so the resulting dstRect is entirely inside the clipping rect.
//! srcRect is scaled so the same part of the image is displayed.
//! Returns false if dstRect is entirely outside clip, or true if at least some of it is inside.
inline bool clipRects( core::rect<s32>& dstRect, core::rect<s32>& srcRect, const core::rect<s32>& clip )
{
// Clip left side
if ( dstRect.UpperLeftCorner.X < clip.UpperLeftCorner.X )
{
s32 w = clip.UpperLeftCorner.X - dstRect.UpperLeftCorner.X;
f32 percentRemoved = (f32)w / (f32)dstRect.getWidth();
dstRect.UpperLeftCorner.X = clip.UpperLeftCorner.X;
srcRect.UpperLeftCorner.X += (s32)(percentRemoved * srcRect.getWidth());
}
// Clip top side
if ( dstRect.UpperLeftCorner.Y < clip.UpperLeftCorner.Y )
{
s32 w = clip.UpperLeftCorner.Y - dstRect.UpperLeftCorner.Y;
f32 percentRemoved = (f32)w / (f32)dstRect.getHeight();
dstRect.UpperLeftCorner.Y = clip.UpperLeftCorner.Y;
srcRect.UpperLeftCorner.Y += (s32)(percentRemoved * srcRect.getHeight());
}
// Clip right side
if ( dstRect.LowerRightCorner.X > clip.LowerRightCorner.X )
{
s32 w = dstRect.LowerRightCorner.X - clip.LowerRightCorner.X;
f32 percentRemoved = (f32)w / (f32)dstRect.getWidth();
dstRect.LowerRightCorner.X = clip.LowerRightCorner.X;
srcRect.LowerRightCorner.X -= (s32)(percentRemoved * srcRect.getWidth());
}
// Clip bottom side
if ( dstRect.LowerRightCorner.Y > clip.LowerRightCorner.Y )
{
s32 w = dstRect.LowerRightCorner.Y - clip.LowerRightCorner.Y;
f32 percentRemoved = (f32)w / (f32)dstRect.getHeight();
dstRect.LowerRightCorner.Y = clip.LowerRightCorner.Y;
srcRect.LowerRightCorner.Y -= (s32)(percentRemoved * srcRect.getHeight());
}
return ( dstRect.getWidth() > 0 && dstRect.getHeight() > 0 );
}
} // namespace irr
#endif
#include "CXMLNode.h"
CXMLNODETYPE CXMLNode::getType() { return type; }
void CXMLNode::setType(CXMLNODETYPE newtype) { type = newtype; }
void CXMLNode::setName(const wchar_t* newname) { name = newname; }
const wchar_t* CXMLNode::getName() { return name.c_str(); }
CXMLNode *CXMLNode::getThis() { return this; }
void CXMLNode::setValue(const wchar_t* newvalue) {
value = newvalue;
}
CXMLNode *CXMLNode::getParent() {
return parent;
}
void CXMLNode::setParent(CXMLNode *newparent) {
parent = newparent;
}
/*
bool CXMLNode::getValueAsBool() {
if(!value.size()) return false;
if(value.equals_ignore_case((core::stringw)"true")) return true;
return false;
}
s32 CXMLNode::getValueAsInt() {
if(!value.size()) return 0;
return _wtoi(value.c_str());
}
const wchar_t* CXMLNode::getValueAsCStr() {
if(!value.size()) return false;
return value.c_str();
}
*/
/*
u16 CXMLNode::getChildCount() {
return children.getSize();
}
irr::core::list<CXMLNode*>::Iterator CXMLNode::getFirstChild() {
//if(children.empty()) return 0;
return children.begin();
}
irr::core::list<CXMLNode*>::Iterator CXMLNode::getLastChild() {
//if(children.empty()) return 0;
return children.getLast();
}
*/
const wchar_t* CXMLNode::getValue() {
return value.c_str();
}
void CXMLNode::addChild(CXMLNode *newchild) {
children.push_back(newchild);
}
void CXMLNode::drop() {
if(children.getSize() != 0) {
core::list<CXMLNode*>::Iterator it;
for( it = children.begin(); it != children.end(); it++ ) {
( *it )->drop();
}
children.clear();
}
}
CXMLNode *CXMLNode::findChildByName(const wchar_t *name) {
core::list<CXMLNode*>::Iterator it;
core::stringw tmp;
CXMLNode *node = NULL;
tmp = name;
for( it = children.begin(); it != children.end(); it++ ) {
if(tmp.equals_ignore_case((*it)->getName())) {
node = (*it);
break;
}
}
return node;
}
core::array<const wchar_t*> *CXMLNode::listChildrenByType(CXMLNODETYPE nodetype) {
core::array<const wchar_t*> *ret = new core::array<const wchar_t*>;
//core::stringw construct = L"";
core::list<CXMLNode*>::Iterator it;
for( it = children.begin(); it != children.end(); it++ ) {
if((*it)->getType() == nodetype) {
ret->push_front((*it)->getName());
}
}
return ret;
}
core::array<const wchar_t*> *CXMLNode::listNonNodeChildren() {
return listChildrenByType(CXMLNODETYPE_VALUE);
}
core::array<const wchar_t*> *CXMLNode::listNodeChildren() {
return listChildrenByType(CXMLNODETYPE_NODE);
}
void CXMLNode::populateTreeView(irr::gui::IGUITreeViewNode *node) {
irr::gui::IGUITreeViewNode *myNode;
irr::core::stringw myText;
core::list<CXMLNode*>::Iterator it;
// If I'm a value, I have nothing to add, my parent will do that
if(type == CXMLNODETYPE_VALUE) return;
// So I'm a node, if im not the toplevel node, write me
if(parent != NULL) {
//myText = L"(Key) ";
myText += getName();
myNode = node->addChildBack(myText.c_str());
}
else
myNode = node;
// If I dont have children, I'm done
if(children.empty()) return;
// setup my children
for( it = children.begin(); it != children.end(); it++ ) {
switch((*it)->getType()) {
case CXMLNODETYPE_NODE :
myText = L"";
myText += (core::stringw)(*it)->getName();
(*it)->populateTreeView(myNode);
break;
case CXMLNODETYPE_VALUE :
myText = L"";
myText += (core::stringw)(*it)->getName();
myText += L":";
myText += (core::stringw)(*it)->getValue();
myNode->addChildBack(myText.c_str());
}
}
}
void CXMLNode::writeOut(io::IXMLWriter* xml) {
core::array<core::stringw> names;
core::array<core::stringw> values;
core::list<CXMLNode*>::Iterator it;
bool nodeChildren = false;
// If I'm a value, I have nothing to write, I'll be written by my parent
if(type == CXMLNODETYPE_VALUE) return;
// If I'm a node with no values, which also means no children write as empty and return
if(children.empty()) {
xml->writeElement(name.c_str(),true);
xml->writeLineBreak();
return;
}
// Need to figure out myself first
for( it = children.begin(); it != children.end(); it++ ) {
// cache all my values for writing, and set a flag if I have node children, ie non empty
switch((*it)->getType()) {
case CXMLNODETYPE_VALUE:
names.push_front((core::stringw)(*it)->getName());
values.push_front((core::stringw)(*it)->getValue());
break;
case CXMLNODETYPE_NODE:
nodeChildren = true;
}
}
// At this point I just need to write myself
xml->writeElement(name.c_str(),nodeChildren?false:true,names,values);
xml->writeLineBreak();
// Now I need to see if I have to tell my node children to write
if(!nodeChildren) return;
for( it = children.begin(); it != children.end(); it++ ) {
// If I have a node child, tell it to write, recursion made easy!
if((*it)->getType() == CXMLNODETYPE_NODE) {
(*it)->writeOut(xml);
}
}
xml->writeClosingTag(name.c_str());
xml->writeLineBreak();
}
\ No newline at end of file
// Madoc 05/09
#ifndef __C_XMLNODE_H_INCLUDED__
#define __C_XMLNODE_H_INCLUDED__
#include <irrlicht.h>
using namespace irr;
enum CXMLNODETYPE {
CXMLNODETYPE_VALUE,
CXMLNODETYPE_NODE,
//CXMLNODETYPE_COMMENT
};
class CXMLNode {
public :
/* Decided to move this up to the registry object, reduce mem use.
s32 getValueAsInt();
const wchar_t* getValueAsCStr();
bool getValueAsBool();
*/
CXMLNODETYPE getType();
const wchar_t* getName();
const wchar_t* getValue();
void setType(CXMLNODETYPE newtype);
void setName(const wchar_t* newname);
void setValue(const wchar_t* newvalue);
void addChild(CXMLNode *newchild);
void writeOut(irr::io::IXMLWriter* xml);
void populateTreeView(irr::gui::IGUITreeViewNode *node);
//u16 getChildCount();
void drop();
/*
irr::core::list<CXMLNode*>::Iterator getFirstChild();
// get last is not get end point, this causes problems with iterators
// Screw it, I'll keep all pointers internal
irr::core::list<CXMLNode*>::Iterator getLastChild();
*/
// Careful with these, mem leak waiting to happen
// Maby I should steal IReferenceCounted from irrlicht, would at
// least give me autodetection of mem leaks
core::array<const wchar_t *> *listNonNodeChildren();
core::array<const wchar_t *> *listNodeChildren();
CXMLNode *getThis();
CXMLNode *findChildByName(const wchar_t *name);
CXMLNode *getParent();
void setParent(CXMLNode *newparent);
private :
CXMLNode *parent;
irr::core::stringw value;
irr::core::stringw name;
CXMLNODETYPE type;
irr::core::list<CXMLNode*> children;
irr::core::array<const wchar_t *> *listChildrenByType(CXMLNODETYPE nodetype);
};
#endif
#include "CXMLRegistry.h"
#ifndef _WIN32
inline int _wtoi(const wchar_t * str){
return (int)wcstol(str, 0, 10);
}
#endif
CXMLRegistry::CXMLRegistry(io::IFileSystem *fsys) {
fileSystem = fsys;
fileSystem->grab();
registry = NULL;
}
CXMLRegistry::~CXMLRegistry() {
if(registry != NULL) registry->drop();
fileSystem->drop();
}
bool CXMLRegistry::isTopLevelNode(const wchar_t *node) {
if(registry->findChildByName(node)) return true;
else return false;
}
CXMLNode *CXMLRegistry::resolveContext(const wchar_t* context) {
core::stringw sContext;
CXMLNode *currentNode;
u16 start;
s16 end;
if(!context) return currentContext;
sContext = context;
if(sContext.size() == 0) return 0;
// Make sure the context ends in a /
if(sContext.lastChar() != L'/')
sContext += L'/';
start = 0;
end = sContext.findFirst('/');
// Theres no values in the top level nodes
if(end == -1) return 0;
currentNode = registry;
while(end != -1) {
currentNode = currentNode->findChildByName(sContext.subString(start,end-start).c_str());
if(currentNode == NULL) return NULL;
start = end+1;
end = sContext.findNext('/',start);
}
return currentNode;
}
void CXMLRegistry::setContext(const wchar_t *context) { currentContext = resolveContext(context); }
const wchar_t *CXMLRegistry::convertBoolToText(bool boolval) {
if(boolval) return L"true";
else return L"false";
}
bool CXMLRegistry::convertTextToBool(const wchar_t *textval) {
if(((core::stringw)textval).equals_ignore_case(L"true")) return true;
return false;
}
bool CXMLRegistry::setValue(const wchar_t *index, bool boolval, const wchar_t *context) {
return setValue(index,convertBoolToText(boolval),context);
}
bool CXMLRegistry::setValue(const wchar_t *index, u16 intval, const wchar_t *context) {
return setValue(index,((core::stringw)intval).c_str(),context);
}
bool CXMLRegistry::setValue(const wchar_t *index, const wchar_t * txtval, const wchar_t *context) {
CXMLNode *targetNode;
targetNode = resolveContext(context);
if(!targetNode) return false;
targetNode = targetNode->findChildByName(index);
if(!targetNode) return false;
targetNode->setValue(txtval);
return true;
}
bool CXMLRegistry::populateTreeView(irr::gui::IGUITreeView *control, const wchar_t *context) {
CXMLNode *targetNode = NULL;
if(context == 0)
targetNode = registry;
else
targetNode = resolveContext(context);
if(!targetNode) return false;
targetNode->populateTreeView(control->getRoot());
return true;
}
bool CXMLRegistry::getValueAsBool(const wchar_t *index, const wchar_t *context) {
return convertTextToBool(getValueAsCStr(index,context));
}
// little more robust
u16 CXMLRegistry::getValueAsInt(const wchar_t *index, const wchar_t *context) {
core::stringw tmp = getValueAsCStr(index,context);
if(tmp.equals_ignore_case("")) return 0;
else return _wtoi(tmp.c_str());
}
core::array<const wchar_t*>* CXMLRegistry::listNonNodeChildren(const wchar_t *node,const wchar_t *context) {
CXMLNode *targetNode;
targetNode = resolveContext(context);
if(!targetNode) return 0;
return targetNode->listNonNodeChildren();
}
core::array<const wchar_t*>* CXMLRegistry::listNodeChildren(const wchar_t *node,const wchar_t *context) {
CXMLNode *targetNode;
targetNode = resolveContext(context);
if(!targetNode) return 0;
return targetNode->listNodeChildren();
}
//BROKEN
/*
const irr::c8 *CXMLRegistry::getValueAsCharCStr(const wchar_t *index, const wchar_t *context) {
irr::core::stringc temp;
temp = getValueAsCStr(index,context);
return (const irr::c8 *)temp.c_str();
}
*/
const wchar_t *CXMLRegistry::getValueAsCStr(const wchar_t *index, const wchar_t *context) {
CXMLNode *targetNode;
targetNode = resolveContext(context);
if(!targetNode) return 0;
targetNode = targetNode->findChildByName(index);
if(!targetNode) return 0;
return targetNode->getValue();
}
irr::core::rect<u32> CXMLRegistry::getValueAsRect(const wchar_t *context) {
CXMLNode *targetNode = resolveContext(context);
irr::u32 tx,ty,bx,by;
if(!targetNode) return irr::core::rect<u32>(0,0,0,0);
tx = _wtoi(targetNode->findChildByName(L"tlx")->getValue());
ty = _wtoi(targetNode->findChildByName(L"tly")->getValue());
bx = _wtoi(targetNode->findChildByName(L"brx")->getValue());
by = _wtoi(targetNode->findChildByName(L"bry")->getValue());
// Hrm what to return on err, cant return null, 0,0,0,0 might be a real loc
// Its u32, maby some HUGE value? maxint?
// Still takes out a value but its less likely
if(!tx || !ty || !bx || !by) return irr::core::rect<u32>(0,0,0,0);
else return irr::core::rect<u32>(tx,ty,bx,by);
}
// Made more robust
irr::video::SColor CXMLRegistry::getValueAsColor(const wchar_t *context) {
CXMLNode *targetNode = resolveContext(context);
if(!targetNode) return NULL;
irr::u32 r,g,b,a;
irr::core::stringw tmp;
tmp = targetNode->findChildByName(L"r")->getValue();
if(tmp.size()) r = _wtoi(tmp.c_str());
tmp = targetNode->findChildByName(L"g")->getValue();
if(tmp.size()) g = _wtoi(tmp.c_str());
tmp = targetNode->findChildByName(L"b")->getValue();
if(tmp.size()) b = _wtoi(tmp.c_str());
tmp = targetNode->findChildByName(L"a")->getValue();
if(tmp.size()) a = _wtoi(tmp.c_str());
return irr::video::SColor(a,r,g,b);
}
bool CXMLRegistry::writeFile(const irr::c8 *fname,const c8 *path) {
io::IXMLWriter* xml;
CXMLNode *currentnode = 0;
core::stringw wstmp;
core::stringc fileName;
wstmp = fname;
currentnode = registry->findChildByName(wstmp.c_str());
if(!currentnode) return false;
fileName = path;
fileName += fname;
fileName += ".xml";
xml = fileSystem->createXMLWriter(fileName.c_str());
xml->writeXMLHeader();
currentnode->writeOut(xml);
// Get rid of double top level end tag
//xml->writeClosingTag(currentnode->getName());
//xml->writeLineBreak();
//if(xml) xml->drop();
delete xml;
return true;
}
// check current folder, if there isnt anything in current, use default
const c8 *CXMLRegistry::resolveConfigPath(const c8 *fname) {
core::string <c8> filename;
bool useCurrent = true;
filename = "config/current/";
filename += fname;
filename += ".xml";
if(!fileSystem->existFile(filename.c_str())) {
useCurrent = false;
}
return useCurrent?"config/current/":"config/defaults/";
}
bool CXMLRegistry::loadConfigFile(const c8 *fname) {
return loadFile(fname, resolveConfigPath(fname));
}
bool CXMLRegistry::writeConfigFile(const c8 *fname) {
return writeFile(fname,"config/current/");
}
// This is tricky, we have to keep track of which nodes are 'open'
bool CXMLRegistry::loadFile(const c8 *fname, const c8 *path) {
io::IXMLReader* xml;
CXMLNode *currentNode = 0;
CXMLNode *topNode = 0;
CXMLNode *currentParent;
core::string <c8> filename;
filename = path;
filename += fname;
// If it dosnt end in .xml add it
if(!filename.subString(filename.size()-4,4).equals_ignore_case(".xml"))
filename += ".xml";
xml = fileSystem->createXMLReader(filename.c_str());
if(!registry) {
registry = new CXMLNode;
registry->setName(L"TopLevelNode");
registry->setType(CXMLNODETYPE_NODE);
}
while(xml && xml->read()) {
CXMLNode *newNode = 0;
switch(xml->getNodeType()) {
case io::EXN_ELEMENT :
u16 i;
newNode = new CXMLNode;
newNode->setName(xml->getNodeName());
newNode->setType(CXMLNODETYPE_NODE);
if(!topNode) {
newNode->setParent(NULL);
registry->addChild(newNode);
topNode = newNode;
currentParent = newNode;
}
else {
newNode->setParent(currentParent);
currentParent->addChild(newNode);
if(!xml->isEmptyElement())
currentParent = newNode;
}
currentNode = newNode;
i = xml->getAttributeCount();
while(i--) {
newNode = new CXMLNode;
newNode->setName(xml->getAttributeName(i));
newNode->setType(CXMLNODETYPE_VALUE);
newNode->setValue(xml->getAttributeValue(i));
currentNode->addChild(newNode);
}
break;
case io::EXN_ELEMENT_END :
// NEVER go back further then the topNode
// Even if the XML is screwed up
if(currentParent->getParent() != NULL)
currentParent = currentParent->getParent();
break;
/*
case io::EXN_COMMENT :
newNode = new CXMLNode;
newNode->setType(CXMLNODETYPE_COMMENT);
//newNode->setValue(xml->getNodeType
currentNode->addChild(newNode);
break;
*/
}
}
//if(xml) xml->drop();
// Documentation says delete not drop
delete xml;
// To support loading multiple files or 'hives' have to
// see if this load ADDED any to decide succcessful or not
if(topNode == 0) return false;
return true;
}
\ No newline at end of file
// Madoc 05/09
#ifndef __C_XMLREGISTRY_H_INCLUDED__
#define __C_XMLREGISTRY_H_INCLUDED__
#include <irrlicht.h>
using namespace irr;
#include "CXMLNode.h"
//File->
// Node1->
// Name1/Value
// Node2->
// Name2/Value
// Oddity: Very little error checking, crashes if you look at it funny
// Oddity: When using setValue ala setValue("someindex",100); compiler cant tell if 100 is a bool or an int, silly compiler,
// casting to u16 works ala setValue("someindex",(u16)100); I see why, but its still silly, and casts are slow
class CXMLRegistry {
public:
CXMLRegistry(io::IFileSystem *fsys);
~CXMLRegistry();
bool loadFile(const c8 *fname, const c8 *path);
bool loadConfigFile(const c8 *fname);
bool writeFile(const c8 *fname, const c8 *path);
bool writeConfigFile(const c8 *fname);
const wchar_t *getValueAsCStr(const wchar_t *index,const wchar_t *context = 0);
// Dosnt work, just declare a stringc and assign the wchar_t to it
//const irr::c8 *getValueAsCharCStr(const wchar_t *index,const wchar_t *context = 0);
bool getValueAsBool(const wchar_t *index, const wchar_t *context = 0);
u16 getValueAsInt(const wchar_t *index, const wchar_t *context = 0);
// This one only takes a context because its going to read 4 childrens values
irr::core::rect<u32> getValueAsRect(const wchar_t *context = 0);
// This one only takes a context because its going to read 4 childrens values
video::SColor getValueAsColor(const wchar_t *context = 0);
irr::core::array<const wchar_t*> *listNonNodeChildren(const wchar_t *node,const wchar_t *context = 0);
irr::core::array<const wchar_t*> *listNodeChildren(const wchar_t *node,const wchar_t *context = 0);
bool setValue(const wchar_t *index, bool boolval, const wchar_t *context = 0);
bool setValue(const wchar_t *index, u16 intval, const wchar_t *context = 0);
bool setValue(const wchar_t *index, const wchar_t *txtval,const wchar_t *context = 0);
// Speed improvement, why search if we want multiple values from the same context
void setContext(const wchar_t *context);
bool isTopLevelNode(const wchar_t *node);
bool populateTreeView(irr::gui::IGUITreeView *control,const wchar_t *context = 0);
// TODO: These are trivial to do, just dont need them yet
// renameNode(context(?),TYPE)
// deleteNode(context(?) (CAREFUL WITH CHILDREN)
// addNode(context, value, type)
// CXMLNODETYPE_COMMENT
// Loading/saving of CDATA, easiest would be just save it in the value of
// the CXMLNODETYPE_NODE their accosicated with.
// make registry inherit node instead of containing an instance of it.
// context(?) might be tricky with CXMLNODETYPE_VALUE
//
//
private:
io::IFileSystem* fileSystem;
CXMLNode* registry;
CXMLNode* currentContext;
const wchar_t *convertBoolToText(bool boolval);
bool convertTextToBool(const wchar_t* textval);
CXMLNode *resolveContext(const wchar_t* context);
const irr::c8 *resolveConfigPath(const irr::c8 *fname);
};
#endif
......@@ -1088,7 +1088,7 @@ bool ClientField::ShowSelectSum(bool panelmode) {
select_ready = false;
}
if (select_ready) {
ShowCancelOrFinishButton(1);
ShowCancelOrFinishButton(2);
} else {
ShowCancelOrFinishButton(0);
}
......
......@@ -55,8 +55,8 @@ public:
int select_max;
int must_select_count;
int select_sumval;
int select_cancelable;
int select_mode;
bool select_cancelable;
bool select_panalmode;
bool select_ready;
int announce_count;
......
......@@ -177,6 +177,46 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
}
break;
}
case BUTTON_RENAME_DECK: {
int sel = mainGame->cbDBDecks->getSelected();
if(sel == -1)
break;
mainGame->gMutex.Lock();
mainGame->wRenameDeck->setText(dataManager.GetSysString(1367));
mainGame->ebREName->setText(mainGame->cbDBDecks->getItem(sel));
mainGame->PopupElement(mainGame->wRenameDeck);
mainGame->gMutex.Unlock();
prev_operation = id;
prev_sel = sel;
break;
}
case BUTTON_RENAME_DECK_SAVE: {
mainGame->HideElement(mainGame->wRenameDeck);
if(prev_operation == BUTTON_RENAME_DECK) {
wchar_t newname[256];
BufferIO::CopyWStr(mainGame->ebREName->getText(), newname, 256);
if(mywcsncasecmp(newname + wcslen(newname) - 4, L"", 4)) {
myswprintf(newname, L"%ls", mainGame->ebREName->getText());
}
if(DeckManager::RenameDeck(mainGame->cbDBDecks->getItem(prev_sel), newname)) {
mainGame->RefreshDeck(mainGame->cbDBDecks);
mainGame->cbDBDecks->setSelected(prev_sel);
mainGame->stACMessage->setText(dataManager.GetSysString(1366));
mainGame->PopupElement(mainGame->wACMessage, 20);
} else {
mainGame->env->addMessageBox(L"", dataManager.GetSysString(1365));
}
}
prev_operation = 0;
prev_sel = -1;
break;
}
case BUTTON_RENAME_DECK_CANCEL: {
mainGame->HideElement(mainGame->wRenameDeck);
prev_operation = 0;
prev_sel = -1;
break;
}
case BUTTON_DELETE_DECK: {
int sel = mainGame->cbDBDecks->getSelected();
if(sel == -1)
......@@ -369,7 +409,8 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
break;
}
int sel = mainGame->cbDBDecks->getSelected();
deckManager.LoadDeck(mainGame->cbDBDecks->getItem(sel));
if(sel >= 0)
deckManager.LoadDeck(mainGame->cbDBDecks->getItem(sel));
prev_deck = sel;
is_modified = false;
break;
......@@ -777,7 +818,7 @@ void DeckBuilder::FilterCards() {
results.clear();
const wchar_t* pstr = mainGame->ebCardName->getText();
int trycode = BufferIO::GetVal(pstr);
if (dataManager.GetData(trycode, 0)) {
if(dataManager.GetData(trycode, 0)) {
auto ptr = dataManager.GetCodePointer(trycode); // verified by GetData()
results.push_back(ptr);
mainGame->scrFilter->setVisible(false);
......@@ -791,16 +832,14 @@ void DeckBuilder::FilterCards() {
size_t element_start = 0;
while (1) {
size_t element_end = str.find_first_of(L' ', element_start);
if (element_end == std::wstring::npos) {
if (element_end == std::wstring::npos)
break;
}
size_t length = element_end - element_start;
if(length > 0) {
query_elements.push_back(str.substr(element_start, length));
element_start = element_end + 1;
} else {
} else
element_start++;
}
}
query_elements.push_back(str.substr(element_start));
std::unordered_map<std::wstring, unsigned int> set_code_map;
......@@ -817,73 +856,72 @@ void DeckBuilder::FilterCards() {
query_elements.erase(*elements_track_iterator);
}
auto strpointer = dataManager._strings.begin();
for (code_pointer ptr = dataManager._datas.begin(); ptr != dataManager._datas.end(); ++ptr, ++strpointer) {
for(code_pointer ptr = dataManager._datas.begin(); ptr != dataManager._datas.end(); ++ptr, ++strpointer) {
const CardDataC& data = ptr->second;
const CardString& text = strpointer->second;
if (data.type & TYPE_TOKEN)
if(data.type & TYPE_TOKEN)
continue;
switch (filter_type) {
switch(filter_type) {
case 1: {
if (!(data.type & TYPE_MONSTER) || (data.type & filter_type2) != filter_type2)
if(!(data.type & TYPE_MONSTER) || (data.type & filter_type2) != filter_type2)
continue;
if (filter_race && data.race != filter_race)
if(filter_race && data.race != filter_race)
continue;
if (filter_attrib && data.attribute != filter_attrib)
if(filter_attrib && data.attribute != filter_attrib)
continue;
if (filter_atktype) {
if ((filter_atktype == 1 && data.attack != filter_atk) || (filter_atktype == 2 && data.attack < filter_atk)
|| (filter_atktype == 3 && data.attack <= filter_atk) || (filter_atktype == 4 && (data.attack > filter_atk || data.attack < 0))
|| (filter_atktype == 5 && (data.attack >= filter_atk || data.attack < 0)) || (filter_atktype == 6 && data.attack != -2))
if(filter_atktype) {
if((filter_atktype == 1 && data.attack != filter_atk) || (filter_atktype == 2 && data.attack < filter_atk)
|| (filter_atktype == 3 && data.attack <= filter_atk) || (filter_atktype == 4 && (data.attack > filter_atk || data.attack < 0))
|| (filter_atktype == 5 && (data.attack >= filter_atk || data.attack < 0)) || (filter_atktype == 6 && data.attack != -2))
continue;
}
if(filter_deftype) {
if((filter_deftype == 1 && data.defense != filter_def) || (filter_deftype == 2 && data.defense < filter_def)
|| (filter_deftype == 3 && data.defense <= filter_def) || (filter_deftype == 4 && (data.defense > filter_def || data.defense < 0))
|| (filter_deftype == 5 && (data.defense >= filter_def || data.defense < 0)) || (filter_deftype == 6 && data.defense != -2)
|| (data.type & TYPE_LINK))
|| (filter_deftype == 3 && data.defense <= filter_def) || (filter_deftype == 4 && (data.defense > filter_def || data.defense < 0))
|| (filter_deftype == 5 && (data.defense >= filter_def || data.defense < 0)) || (filter_deftype == 6 && data.defense != -2)
|| (data.type & TYPE_LINK))
continue;
}
if (filter_lvtype) {
if ((filter_lvtype == 1 && data.level != filter_lv) || (filter_lvtype == 2 && data.level < filter_lv)
|| (filter_lvtype == 3 && data.level <= filter_lv) || (filter_lvtype == 4 && data.level > filter_lv)
|| (filter_lvtype == 5 && data.level >= filter_lv) || filter_lvtype == 6)
if(filter_lvtype) {
if((filter_lvtype == 1 && data.level != filter_lv) || (filter_lvtype == 2 && data.level < filter_lv)
|| (filter_lvtype == 3 && data.level <= filter_lv) || (filter_lvtype == 4 && data.level > filter_lv)
|| (filter_lvtype == 5 && data.level >= filter_lv) || filter_lvtype == 6)
continue;
}
if(filter_scltype) {
if((filter_scltype == 1 && data.lscale != filter_scl) || (filter_scltype == 2 && data.lscale < filter_scl)
|| (filter_scltype == 3 && data.lscale <= filter_scl) || (filter_scltype == 4 && (data.lscale > filter_scl || data.lscale == 0))
|| (filter_scltype == 5 && (data.lscale >= filter_scl || data.lscale == 0)) || filter_scltype == 6
|| !(data.type & TYPE_PENDULUM))
|| (filter_scltype == 3 && data.lscale <= filter_scl) || (filter_scltype == 4 && (data.lscale > filter_scl || data.lscale == 0))
|| (filter_scltype == 5 && (data.lscale >= filter_scl || data.lscale == 0)) || filter_scltype == 6
|| !(data.type & TYPE_PENDULUM))
continue;
}
break;
}
case 2: {
if (!(data.type & TYPE_SPELL))
if(!(data.type & TYPE_SPELL))
continue;
if (filter_type2 && data.type != filter_type2)
if(filter_type2 && data.type != filter_type2)
continue;
break;
}
case 3: {
if (!(data.type & TYPE_TRAP))
if(!(data.type & TYPE_TRAP))
continue;
if (filter_type2 && data.type != filter_type2)
if(filter_type2 && data.type != filter_type2)
continue;
break;
}
}
if (filter_effect && !(data.category & filter_effect))
if(filter_effect && !(data.category & filter_effect))
continue;
if(filter_marks && (data.link_marker & filter_marks)!= filter_marks)
continue;
if(filter_lm) {
if(filter_lm <= 3 && (!filterList->count(ptr->first) || (*filterList)[ptr->first] != filter_lm - 1))
continue;
if (filter_lm == 4 && data.ot != 1)
if(filter_lm == 4 && data.ot != 1)
continue;
if (filter_lm == 5 && data.ot != 2)
if(filter_lm == 5 && data.ot != 2)
continue;
if(filter_lm == 6 && data.ot != 3)
continue;
......@@ -912,19 +950,17 @@ void DeckBuilder::FilterCards() {
}
}
}
if (is_target) {
if (is_target)
results.push_back(ptr);
} else {
else
continue;
}
}
myswprintf(result_string, L"%d", results.size());
if (results.size() > 7) {
if(results.size() > 7) {
mainGame->scrFilter->setVisible(true);
mainGame->scrFilter->setMax(results.size() - 7);
mainGame->scrFilter->setPos(0);
}
else {
} else {
mainGame->scrFilter->setVisible(false);
mainGame->scrFilter->setPos(0);
}
......
......@@ -90,6 +90,23 @@ void DeckManager::LoadLFList() {
nolimit.content = new std::unordered_map<int, int>;
_lfList.push_back(nolimit);
}
bool DeckManager::RenameDeck(const wchar_t* oldname, const wchar_t* newname) {
wchar_t oldfname[256];
wchar_t newfname[256];
myswprintf(oldfname, L"./deck/%ls.ydk", oldname);
myswprintf(newfname, L"./deck/%ls.ydk", newname);
#ifdef WIN32
BOOL result = MoveFileW(oldfname, newfname);
return !!result;
#else
char oldfilefn[256];
char newfilefn[256];
BufferIO::EncodeUTF8(oldfname, oldfilefn);
BufferIO::EncodeUTF8(newfname, newfilefn);
int result = rename(oldfilefn, newfilefn);
return result == 0;
#endif
}
wchar_t* DeckManager::GetLFListName(int lfhash) {
for(size_t i = 0; i < _lfList.size(); ++i) {
if(_lfList[i].hash == (unsigned int)lfhash) {
......@@ -298,4 +315,28 @@ bool DeckManager::DeleteDeck(Deck& deck, const wchar_t* name) {
return result == 0;
#endif
}
const wchar_t* DeckManager::GetMainFormatString() {
myswprintf(DeckFormatBuffer, L"%d ( %d / %d / %d )", deckManager.current_deck.main.size(), GetTypeCount(deckManager.current_deck.main, TYPE_MONSTER), GetTypeCount(deckManager.current_deck.main, TYPE_SPELL), GetTypeCount(deckManager.current_deck.main, TYPE_TRAP));
wchar_t* result = DeckFormatBuffer;
return result;
}
const wchar_t* DeckManager::GetExtraFormatString() {
myswprintf(DeckFormatBuffer, L"%d ( %d / %d / %d / %d )", deckManager.current_deck.extra.size(), GetTypeCount(deckManager.current_deck.extra, TYPE_FUSION), GetTypeCount(deckManager.current_deck.extra, TYPE_SYNCHRO), GetTypeCount(deckManager.current_deck.extra, TYPE_XYZ), GetTypeCount(deckManager.current_deck.extra, TYPE_LINK));
wchar_t* result = DeckFormatBuffer;
return result;
}
const wchar_t* DeckManager::GetSideFormatString() {
myswprintf(DeckFormatBuffer, L"%d ( %d / %d / %d / %d )", deckManager.current_deck.side.size(), GetTypeCount(deckManager.current_deck.side, TYPE_MONSTER), GetTypeCount(deckManager.current_deck.side, TYPE_SPELL), GetTypeCount(deckManager.current_deck.side, TYPE_TRAP), GetTypeCount(deckManager.current_deck.side, TYPE_FUSION | TYPE_SYNCHRO | TYPE_XYZ | TYPE_LINK));
wchar_t* result = DeckFormatBuffer;
return result;
}
int DeckManager::GetTypeCount(std::vector<code_pointer> list, unsigned int ctype) {
int res = 0;
for(size_t i = 0; i < list.size(); ++i) {
code_pointer cur = list[i];
if(cur->second.type & ctype)
res++;
}
return res;
}
}
......@@ -44,6 +44,12 @@ public:
bool LoadDeck(const wchar_t* file);
bool SaveDeck(Deck& deck, const wchar_t* name);
bool DeleteDeck(Deck& deck, const wchar_t* name);
static bool RenameDeck(const wchar_t* oldname, const wchar_t* newname);
wchar_t DeckFormatBuffer[128];
const wchar_t* GetMainFormatString();
const wchar_t* GetSideFormatString();
const wchar_t* GetExtraFormatString();
int GetTypeCount(std::vector<code_pointer> list, unsigned int ctype);
};
extern DeckManager deckManager;
......
......@@ -948,12 +948,13 @@ void Game::DrawSpec() {
showChat = false;
hideChatTimer--;
}
int maxChatLines = dInfo.isStarted ? 5 : 8;
for(int i = 0; i < maxChatLines; ++i) {
for(int i = 0; i < 8; ++i) {
static unsigned int chatColor[] = {0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff8080ff, 0xffff4040, 0xffff4040,
0xffff4040, 0xff40ff40, 0xff4040ff, 0xff40ffff, 0xffff40ff, 0xffffff40, 0xffffffff, 0xff808080, 0xff404040};
if(chatTiming[i]) {
chatTiming[i]--;
if(mainGame->dInfo.isStarted && i >= 5)
continue;
if(!showChat && i > 2)
continue;
int w = textFont->getDimension(chatMsg[i].c_str()).Width;
......@@ -1111,10 +1112,10 @@ void Game::DrawThumb(code_pointer cp, position2di pos, std::unordered_map<int, i
void Game::DrawDeckBd() {
wchar_t textBuffer[64];
//main deck
driver->draw2DRectangle(Resize(310, 137, 410, 157), 0x400000ff, 0x400000ff, 0x40000000, 0x40000000);
driver->draw2DRectangleOutline(Resize(309, 136, 410, 157));
DrawShadowText(textFont, dataManager.GetSysString(1330), Resize(315, 137, 410, 157), Resize(1, 1, 1, 1), 0xffffffff, 0xff000000, false, true);
DrawShadowText(numFont, dataManager.numStrings[deckManager.current_deck.main.size()], Resize(380, 138, 440, 158), Resize(1, 1, 1, 1), 0xffffffff, 0xff000000, false, true);
driver->draw2DRectangle(Resize(310, 137, 510, 157), 0x400000ff, 0x400000ff, 0x40000000, 0x40000000);
driver->draw2DRectangleOutline(Resize(309, 136, 510, 157));
DrawShadowText(textFont, dataManager.GetSysString(1330), Resize(315, 137, 510, 157), Resize(1, 1, 1, 1), 0xffffffff, 0xff000000, false, true);
DrawShadowText(numFont, deckManager.GetMainFormatString(), Resize(380, 138, 540, 158), Resize(1, 1, 1, 1), 0xffffffff, 0xff000000, false, true);
driver->draw2DRectangle(Resize(310, 160, 797, 436), 0x400000ff, 0x400000ff, 0x40000000, 0x40000000);
driver->draw2DRectangleOutline(Resize(309, 159, 797, 436));
int lx;
......@@ -1132,10 +1133,10 @@ void Game::DrawDeckBd() {
driver->draw2DRectangleOutline(Resize(313 + (i % lx) * dx, 163 + (i / lx) * 68, 359 + (i % lx) * dx, 228 + (i / lx) * 68));
}
//extra deck
driver->draw2DRectangle(Resize(310, 440, 410, 460), 0x400000ff, 0x400000ff, 0x40000000, 0x40000000);
driver->draw2DRectangleOutline(Resize(309, 439, 410, 460));
DrawShadowText(textFont, dataManager.GetSysString(1331), Resize(315, 440, 410, 460), Resize(1, 1, 1, 1), 0xffffffff, 0xff000000, false, true);
DrawShadowText(numFont, dataManager.numStrings[deckManager.current_deck.extra.size()], Resize(380, 441, 440, 461), Resize(1, 1, 1, 1), 0xffffffff, 0xff000000, false, true);
driver->draw2DRectangle(Resize(310, 440, 510, 460), 0x400000ff, 0x400000ff, 0x40000000, 0x40000000);
driver->draw2DRectangleOutline(Resize(309, 439, 510, 460));
DrawShadowText(textFont, dataManager.GetSysString(1331), Resize(315, 440, 510, 460), Resize(1, 1, 1, 1), 0xffffffff, 0xff000000, false, true);
DrawShadowText(numFont, deckManager.GetExtraFormatString(), Resize(380, 441, 540, 461), Resize(1, 1, 1, 1), 0xffffffff, 0xff000000, false, true);
driver->draw2DRectangle(Resize(310, 463, 797, 533), 0x400000ff, 0x400000ff, 0x40000000, 0x40000000);
driver->draw2DRectangleOutline(Resize(309, 462, 797, 533));
if(deckManager.current_deck.extra.size() <= 10)
......@@ -1147,10 +1148,10 @@ void Game::DrawDeckBd() {
driver->draw2DRectangleOutline(Resize(313 + i * dx, 465, 359 + i * dx, 531));
}
//side deck
driver->draw2DRectangle(Resize(310, 537, 410, 557), 0x400000ff, 0x400000ff, 0x40000000, 0x40000000);
driver->draw2DRectangleOutline(Resize(309, 536, 410, 557));
DrawShadowText(textFont, dataManager.GetSysString(1332), Resize(315, 537, 410, 557), Resize(1, 1, 1, 1), 0xffffffff, 0xff000000, false, true);
DrawShadowText(numFont, dataManager.numStrings[deckManager.current_deck.side.size()], Resize(380, 538, 440, 558), Resize(1, 1, 1, 1), 0xffffffff, 0xff000000, false, true);
driver->draw2DRectangle(Resize(310, 537, 510, 557), 0x400000ff, 0x400000ff, 0x40000000, 0x40000000);
driver->draw2DRectangleOutline(Resize(309, 536, 510, 557));
DrawShadowText(textFont, dataManager.GetSysString(1332), Resize(315, 537, 510, 557), Resize(1, 1, 1, 1), 0xffffffff, 0xff000000, false, true);
DrawShadowText(numFont, deckManager.GetSideFormatString(), Resize(380, 538, 540, 558), Resize(1, 1, 1, 1), 0xffffffff, 0xff000000, false, true);
driver->draw2DRectangle(Resize(310, 560, 797, 630), 0x400000ff, 0x400000ff, 0x40000000, 0x40000000);
driver->draw2DRectangleOutline(Resize(309, 559, 797, 630));
if(deckManager.current_deck.side.size() <= 10)
......
This diff is collapsed.
......@@ -464,6 +464,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
list_command = COMMAND_SPSUMMON;
mainGame->wCardSelect->setText(dataManager.GetSysString(509));
ShowSelectCard();
select_ready = false;
ShowCancelOrFinishButton(1);
}
break;
......@@ -958,18 +959,6 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
UpdateDeclarableCode(true);
break;
}
case EDITBOX_CHAT: {
if(mainGame->dInfo.isReplay)
break;
const wchar_t* input = mainGame->ebChatInput->getText();
if(input[0]) {
unsigned short msgbuf[256];
int len = BufferIO::CopyWStr(input, msgbuf, 256);
DuelClient::SendBufferToServer(CTOS_CHAT, msgbuf, (len + 1) * sizeof(short));
mainGame->ebChatInput->setText(L"");
}
break;
}
}
break;
}
......@@ -1680,6 +1669,17 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
}
break;
}
case irr::KEY_KEY_Z: {
if(!mainGame->dInfo.isReplay && !mainGame->HasFocus(EGUIET_EDIT_BOX)) {
mainGame->dInfo.isReplaySkiping = event.KeyInput.PressedDown;
if(mainGame->dInfo.isStarted && !mainGame->dInfo.isReplaySkiping) {
mainGame->gMutex.Lock();
mainGame->dField.RefreshAllCards();
mainGame->gMutex.Unlock();
}
}
break;
}
case irr::KEY_F1:
case irr::KEY_F2:
case irr::KEY_F3:
......@@ -1765,13 +1765,17 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
s32 id = event.GUIEvent.Caller->getID();
switch(event.GUIEvent.EventType) {
case irr::gui::EGET_ELEMENT_HOVERED: {
if(event.GUIEvent.Caller->getType() == EGUIET_EDIT_BOX)
if(event.GUIEvent.Caller->getType() == EGUIET_EDIT_BOX) {
mainGame->SetCursor(event.GUIEvent.Caller->isEnabled() ? ECI_IBEAM : ECI_NORMAL);
return true;
}
break;
}
case irr::gui::EGET_ELEMENT_LEFT: {
if(event.GUIEvent.Caller->getType() == EGUIET_EDIT_BOX)
if(event.GUIEvent.Caller->getType() == EGUIET_EDIT_BOX) {
mainGame->SetCursor(ECI_NORMAL);
return true;
}
break;
}
case irr::gui::EGET_BUTTON_CLICKED: {
......@@ -1807,6 +1811,16 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
break;
}
#endif
case CHECKBOX_DISABLE_CHAT: {
bool show = !mainGame->is_building;
mainGame->wChat->setVisible(show);
/*
if(!show)
mainGame->ClearChatMsg();
*/
return true;
break;
}
}
break;
}
......@@ -1861,6 +1875,24 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
}
break;
}
case irr::gui::EGET_EDITBOX_ENTER: {
switch(id) {
case EDITBOX_CHAT: {
if(mainGame->dInfo.isReplay)
break;
const wchar_t* input = mainGame->ebChatInput->getText();
if(input[0]) {
unsigned short msgbuf[256];
int len = BufferIO::CopyWStr(input, msgbuf, 256);
DuelClient::SendBufferToServer(CTOS_CHAT, msgbuf, (len + 1) * sizeof(short));
mainGame->ebChatInput->setText(L"");
return true;
}
break;
}
}
break;
}
default: break;
}
break;
......
......@@ -14,6 +14,7 @@
#include "duelclient.h"
#include "netserver.h"
#include "single_mode.h"
#include <sstream>
#endif //YGOPRO_SERVER_MODE
#ifndef _WIN32
......@@ -96,6 +97,23 @@ bool Game::Initialize() {
device = irr::createDeviceEx(params);
if(!device)
return false;
// Apply skin
if(gameConf.skin_index) {
wchar_t skin_dir[16];
myswprintf(skin_dir, L"skin");
skinSystem = new CGUISkinSystem(skin_dir, device);
core::array<core::stringw> skins = skinSystem->listSkins();
size_t count = skins.size();
if(count > 0) {
int index = -1;
if(gameConf.skin_index < 0)
index = rand() % count;
else if((size_t)gameConf.skin_index <= skins.size())
index = skins.size() - gameConf.skin_index; // reverse index
if(index >= 0)
skinSystem->applySkin(skins[index].c_str());
}
}
linePatternD3D = 0;
linePatternGL = 0x0f0f;
waitFrame = 0;
......@@ -333,7 +351,7 @@ bool Game::Initialize() {
//system
irr::gui::IGUITab* tabSystem = wInfos->addTab(dataManager.GetSysString(1273));
posY = 20;
chkIgnore1 = env->addCheckBox(false, rect<s32>(posX, posY, posX + 260, posY + 25), tabSystem, -1, dataManager.GetSysString(1290));
chkIgnore1 = env->addCheckBox(false, rect<s32>(posX, posY, posX + 260, posY + 25), tabSystem, CHECKBOX_DISABLE_CHAT, dataManager.GetSysString(1290));
chkIgnore1->setChecked(gameConf.chkIgnore1 != 0);
posY += 30;
chkIgnore2 = env->addCheckBox(false, rect<s32>(posX, posY, posX + 260, posY + 25), tabSystem, -1, dataManager.GetSysString(1291));
......@@ -540,11 +558,21 @@ bool Game::Initialize() {
btnSideSort->setVisible(false);
btnSideReload = env->addButton(rect<s32>(440, 100, 500, 130), 0, BUTTON_SIDE_RELOAD, dataManager.GetSysString(1309));
btnSideReload->setVisible(false);
btnRenameDeck = env->addButton(rect<s32>(170, 99, 220, 120), wDeckEdit, BUTTON_RENAME_DECK, dataManager.GetSysString(1362));
//
scrFilter = env->addScrollBar(false, recti(999, 161, 1019, 629), 0, SCROLL_FILTER);
scrFilter->setLargeStep(10);
scrFilter->setSmallStep(1);
scrFilter->setVisible(false);
//rename deck
wRenameDeck = env->addWindow(rect<s32>(510, 200, 820, 320), false, dataManager.GetSysString(1367));
wRenameDeck->getCloseButton()->setVisible(false);
wRenameDeck->setVisible(false);
env->addStaticText(dataManager.GetSysString(1368), rect<s32>(20, 25, 290, 45), false, false, wRenameDeck);
ebREName = env->addEditBox(L"", rect<s32>(20, 50, 290, 70), true, wRenameDeck, -1);
ebREName->setTextAlignment(irr::gui::EGUIA_CENTER, irr::gui::EGUIA_CENTER);
btnREYes = env->addButton(rect<s32>(70, 80, 140, 105), wRenameDeck, BUTTON_RENAME_DECK_SAVE, dataManager.GetSysString(1341));
btnRENo = env->addButton(rect<s32>(170, 80, 240, 105), wRenameDeck, BUTTON_RENAME_DECK_CANCEL, dataManager.GetSysString(1212));
//sort type
wSort = env->addStaticText(L"", rect<s32>(930, 132, 1020, 156), true, false, 0, -1, true);
cbSortType = env->addComboBox(rect<s32>(10, 2, 85, 22), wSort, COMBOBOX_SORTTYPE);
......@@ -1163,6 +1191,7 @@ void Game::LoadConfig() {
gameConf.window_height = 640;
gameConf.resize_popup_menu = false;
gameConf.chkEnablePScale = 1;
gameConf.skin_index = -1;
if(fp) {
while(fgets(linebuf, 256, fp)) {
sscanf(linebuf, "%s = %s", strbuf, valbuf);
......@@ -1248,6 +1277,8 @@ void Game::LoadConfig() {
gameConf.resize_popup_menu = atoi(valbuf) > 0;
} else if(!strcmp(strbuf, "enable_pendulum_scale")) {
gameConf.chkEnablePScale = atoi(valbuf);
} else if (!strcmp(strbuf, "skin_index")) {
gameConf.skin_index = atoi(valbuf);
} else {
// options allowing multiple words
sscanf(linebuf, "%s = %240[^\n]", strbuf, valbuf);
......@@ -1351,6 +1382,8 @@ void Game::LoadConfig() {
gameConf.resize_popup_menu = atoi(valbuf) > 0;
} else if(!strcmp(strbuf, "enable_pendulum_scale")) {
gameConf.chkEnablePScale = atoi(valbuf);
} else if (!strcmp(strbuf, "skin_index")) {
gameConf.skin_index = atoi(valbuf);
} else {
// options allowing multiple words
sscanf(linebuf, "%s = %240[^\n]", strbuf, valbuf);
......@@ -1435,6 +1468,7 @@ void Game::SaveConfig() {
fprintf(fp, "window_height = %d\n", gameConf.window_height);
fprintf(fp, "resize_popup_menu = %d\n", gameConf.resize_popup_menu ? 1 : 0);
fprintf(fp, "enable_pendulum_scale = %d\n", ((mainGame->chkEnablePScale->isChecked()) ? 1 : 0));
fprintf(fp, "skin_index = %d\n", gameConf.skin_index);
fclose(fp);
}
void Game::ShowCardInfo(int code, bool resize) {
......@@ -1570,6 +1604,11 @@ void Game::AddChatMsg(wchar_t* msg, int player) {
}
chatMsg[0].append(msg);
}
void Game::ClearChatMsg() {
for(int i = 7; i >= 0; --i) {
chatTiming[i] = 0;
}
}
#endif //YGOPRO_SERVER_MODE
void Game::AddDebugMsg(char* msg)
{
......@@ -1728,6 +1767,7 @@ void Game::OnResize() {
btnSideSort->setRelativePosition(Resize(375, 100, 435, 130));
btnSideReload->setRelativePosition(Resize(440, 100, 500, 130));
btnDeleteDeck->setRelativePosition(Resize(225, 95, 290, 120));
btnRenameDeck->setRelativePosition(Resize(170, 99, 220, 120));
wLanWindow->setRelativePosition(ResizeWin(220, 100, 800, 520));
wCreateHost->setRelativePosition(ResizeWin(320, 100, 700, 520));
......@@ -1749,7 +1789,7 @@ void Game::OnResize() {
wANRace->setRelativePosition(ResizeWin(480, 200, 850, 410));
wReplaySave->setRelativePosition(ResizeWin(510, 200, 820, 320));
stHintMsg->setRelativePosition(ResizeWin(500, 60, 820, 90));
//sound / music volume bar
scrSoundVolume->setRelativePosition(recti(20 + 126, 200 + 4, 20 + (300 * xScale) - 40, 200 + 21));
scrMusicVolume->setRelativePosition(recti(20 + 126, 230 + 4, 20 + (300 * xScale) - 40, 230 + 21));
......@@ -1771,8 +1811,8 @@ void Game::OnResize() {
btnReset->setRelativePosition(recti(1, 1, width, height));
}
wCardImg->setRelativePosition(Resize(1, 1, 1 + CARD_IMG_WIDTH + 20, 1 + CARD_IMG_HEIGHT + 18));
imgCard->setRelativePosition(Resize(10, 9, 10 + CARD_IMG_WIDTH, 9 + CARD_IMG_HEIGHT));
wCardImg->setRelativePosition(ResizeCard(1, 1, 20, 18));
imgCard->setRelativePosition(ResizeCard(10, 9, 0, 0));
wInfos->setRelativePosition(Resize(1, 275, 301, 639));
stName->setRelativePosition(recti(10, 10, 287 * xScale, 32));
lstLog->setRelativePosition(Resize(10, 10, 290, 290));
......@@ -1856,6 +1896,18 @@ recti Game::ResizeElem(s32 x, s32 y, s32 x2, s32 y2) {
y2 = sy + y;
return recti(x, y, x2, y2);
}
recti Game::ResizeCard(s32 x, s32 y, s32 x2, s32 y2) {
float mul = xScale;
if(xScale > yScale)
mul = yScale;
s32 sx = CARD_IMG_WIDTH * mul + x2 * xScale;
s32 sy = CARD_IMG_HEIGHT * mul + y2 * yScale;
x = x * xScale;
y = y * yScale;
x2 = sx + x;
y2 = sy + y;
return recti(x, y, x2, y2);
}
void Game::SetWindowsIcon() {
#ifdef _WIN32
HINSTANCE hInstance = (HINSTANCE)GetModuleHandleW(NULL);
......
......@@ -6,6 +6,7 @@
#include "client_field.h"
#include "deck_con.h"
#include "menu_handler.h"
#include "CGUISkinSystem/CGUISkinSystem.h"
#else
#include "netserver.h"
#endif //YGOPRO_SERVER_MODE
......@@ -57,6 +58,7 @@ struct Config {
double music_volume;
int music_mode;
int chkEnablePScale;
int skin_index;
};
struct DuelInfo {
......@@ -155,6 +157,7 @@ public:
void SaveConfig();
void ShowCardInfo(int code, bool resize = false);
void AddChatMsg(wchar_t* msg, int player);
void ClearChatMsg();
void AddDebugMsg(char* msgbuf);
void ClearTextures();
void CloseDuelWindow();
......@@ -174,6 +177,7 @@ public:
position2di ResizeReverse(s32 x, s32 y);
recti ResizeElem(s32 x, s32 y, s32 x2, s32 y2);
recti ResizeWin(s32 x, s32 y, s32 x2, s32 y2, bool chat = false);
recti ResizeCard(s32 x, s32 y, s32 x2, s32 y2);
void SetWindowsIcon();
void FlashWindow();
......@@ -230,6 +234,8 @@ public:
irr::core::dimension2d<irr::u32> window_size;
float xScale;
float yScale;
CGUISkinSystem *skinSystem;
ClientField dField;
DeckBuilder deckBuilder;
......@@ -464,6 +470,12 @@ public:
irr::gui::IGUIStaticText* stStar;
irr::gui::IGUIStaticText* stSearch;
irr::gui::IGUIStaticText* stScale;
irr::gui::IGUIButton* btnRenameDeck;
//deck rename
irr::gui::IGUIWindow* wRenameDeck;
irr::gui::IGUIEditBox* ebREName;
irr::gui::IGUIButton* btnREYes;
irr::gui::IGUIButton* btnRENo;
//filter
irr::gui::IGUIStaticText* wFilter;
irr::gui::IGUIScrollBar* scrFilter;
......@@ -668,6 +680,7 @@ extern HostInfo game_info;
#define CHECKBOX_ENABLE_SOUND 361
#define CHECKBOX_ENABLE_MUSIC 362
#define SCROLL_VOLUME 363
#define CHECKBOX_DISABLE_CHAT 364
#define COMBOBOX_SORTTYPE 370
#define COMBOBOX_LIMIT 371
......@@ -675,6 +688,10 @@ extern HostInfo game_info;
#define BUTTON_MARKS_FILTER 380
#define BUTTON_MARKERS_OK 381
#define BUTTON_RENAME_DECK 386
#define BUTTON_RENAME_DECK_SAVE 387
#define BUTTON_RENAME_DECK_CANCEL 388
#define TEXTURE_DUEL 0
#define TEXTURE_DECK 1
#define TEXTURE_MENU 2
......
......@@ -60,7 +60,7 @@ bool ImageManager::Initial() {
if(!tBackGround_deck)
tBackGround_deck = GetRandomImage(TEXTURE_DUEL);
if(!tBackGround_deck)
tBackGround_deck = tBackGround;
tBackGround_deck = tBackGround;
tField[0] = driver->getTexture("textures/field2.png");
tFieldTransparent[0] = driver->getTexture("textures/field-transparent2.png");
tField[1] = driver->getTexture("textures/field3.png");
......
......@@ -27,6 +27,8 @@ void UpdateDeck() {
DuelClient::SendBufferToServer(CTOS_UPDATE_DECK, deckbuf, pdeck - deckbuf);
}
bool MenuHandler::OnEvent(const irr::SEvent& event) {
if(mainGame->dField.OnCommonEvent(event))
return false;
switch(event.EventType) {
case irr::EET_GUI_EVENT: {
irr::gui::IGUIElement* caller = event.GUIEvent.Caller;
......@@ -40,16 +42,6 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
break;
}
switch(event.GUIEvent.EventType) {
case irr::gui::EGET_ELEMENT_HOVERED: {
if(event.GUIEvent.Caller->getType() == EGUIET_EDIT_BOX)
mainGame->SetCursor(event.GUIEvent.Caller->isEnabled() ? ECI_IBEAM : ECI_NORMAL);
break;
}
case irr::gui::EGET_ELEMENT_LEFT: {
if(event.GUIEvent.Caller->getType() == EGUIET_EDIT_BOX)
mainGame->SetCursor(ECI_NORMAL);
break;
}
case irr::gui::EGET_BUTTON_CLICKED: {
if(id < 110)
soundManager.PlaySoundEffect(SOUND_MENU);
......@@ -510,49 +502,6 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
}
break;
}
case irr::gui::EGET_EDITBOX_ENTER: {
switch(id) {
case EDITBOX_CHAT: {
if(mainGame->dInfo.isReplay)
break;
const wchar_t* input = mainGame->ebChatInput->getText();
if(input[0]) {
unsigned short msgbuf[256];
if(mainGame->dInfo.isStarted) {
if(mainGame->dInfo.player_type < 7) {
if(mainGame->dInfo.isTag && (mainGame->dInfo.player_type % 2))
mainGame->AddChatMsg((wchar_t*)input, 2);
else
mainGame->AddChatMsg((wchar_t*)input, 0);
} else
mainGame->AddChatMsg((wchar_t*)input, 10);
} else
mainGame->AddChatMsg((wchar_t*)input, 7);
int len = BufferIO::CopyWStr(input, msgbuf, 256);
DuelClient::SendBufferToServer(CTOS_CHAT, msgbuf, (len + 1) * sizeof(short));
mainGame->ebChatInput->setText(L"");
}
break;
}
}
break;
}
default: break;
}
break;
}
case irr::EET_KEY_INPUT_EVENT: {
switch(event.KeyInput.Key) {
case irr::KEY_KEY_R: {
if(!event.KeyInput.PressedDown && !mainGame->HasFocus(EGUIET_EDIT_BOX))
mainGame->textFont->setTransparency(true);
break;
}
case irr::KEY_ESCAPE: {
if(!mainGame->HasFocus(EGUIET_EDIT_BOX))
mainGame->device->minimizeWindow();
break;
}
default: break;
}
break;
......
......@@ -5,8 +5,7 @@ solution "ygo"
startproject "ygopro"
configurations { "Debug", "Release" }
defines { "LUA_COMPAT_5_2" }
defines { "LUA_COMPAT_5_2" }
configuration "windows"
defines { "WIN32", "_WIN32" }
......
Open [Your ygopro folder]\system.conf with a text editor.
Change the following settings:
use_d3d = 1
use_skin = 1
To make your own skin just replace the images in this skin folder.
\ No newline at end of file
<?xml version="1.0"?>
<!-- Config file for the GUI Skin (CImageGUISkin) -->
<!-- Source border is the border width (in pixels) on the texture. -->
<!-- Dest border is the border width on the screen (also in pixels). -->
<!-- Order of elements dosn't matter -->
<!-- <NodeNames> are not case sensitive -->
<!-- attribute= ARE case sensitive -->
<!-- Texture = filename -->
<!-- SrcBorder = top,left,bottom,right -->
<!-- DstBorder = top,left,bottom,right -->
<Skin>
<Properties>
<Name data="Blue Shine Theme" />
<Author data="TheCongressman" />
<Version data="2.0.0" />
<Date data="July 31th, 2013"/>
<Desc data="Blue Shine Theme"/>
<Fallback skin="EGST_WINDOWS_CLASSIC" />
<Font texture="fontTahoma.png" />
</Properties>
<Global guialpha="255">
<!--<EGDC_3D_DARK_SHADOW a="255" r="255" g="255" b="255" /> --> <!-- Dark shadow for three-dimensional display elements. -->
<!--<EGDC_3D_SHADOW a="255" r="255" g="255" b="255" /> --> <!-- Shadow color for three-dimensional display elements (for edges facing away from the light source). -->
<EGDC_3D_FACE a="255" r="255" g="255" b="255" /> <!-- Face color for three-dimensional display elements and for dialog box backgrounds. -->
<!--<EGDC_3D_HIGH_LIGHT a="255" r="255" g="255" b="255" /> --> <!-- Highlight color for three-dimensional display elements (for edges facing the light source.). -->
<!--<EGDC_3D_LIGHT a="255" r="255" g="255" b="255" /> --> <!-- Light color for three-dimensional display elements (for edges facing the light source.). -->
<!--<EGDC_ACTIVE_BORDER a="255" r="255" g="0" b="0" />--> <!-- Active window border. -->
<EGDC_ACTIVE_CAPTION a="255" r="255" g="255" b="255" /> <!-- Active window title bar text -->
<!--<EGDC_APP_WORKSPACE a="255" r="255" g="255" b="255" />--> <!-- Background color of multiple document interface (MDI) applications. -->
<EGDC_BUTTON_TEXT a="255" r="255" g="255" b="255" /> <!-- Text on a button. -->
<EGDC_GRAY_TEXT a="255" r="194" g="0" b="0" /> <!-- Grayed (disabled) text. -->
<!--<EGDC_HIGH_LIGHT a="255" r="255" g="255" b="255" /> --> <!-- Item(s) selected in a control. -->
<EGDC_HIGH_LIGHT_TEXT a="255" r="255" g="255" b="255" /> <!-- Text of item(s) selected in a control. -->
<!--<EGDC_INACTIVE_BORDER a="255" r="255" g="255" b="255" /> --> <!-- Inactive window border. -->
<!--<EGDC_INACTIVE_CAPTION a="255" r="255" g="255" b="255" /> --> <!-- Inactive window caption. -->
<!--<EGDC_TOOLTIP a="255" r="255" g="255" b="255" /> --> <!-- Tool tip text color. -->
<EGDC_TOOLTIP_BACKGROUND a="255" r="255" g="255" b="255" /> <!-- Tool tip background color. -->
<!--<EGDC_SCROLLBAR a="150" r="255" g="255" b="255" /> --> <!-- Scrollbar gray area. This ONLY applies to the default scrollbar, if you want to change the colors of the graphical one, change the color attributes in the section near the bottom -->
<EGDC_WINDOW a="255" r="255" g="255" b="255" /> <!-- Window background. -->
<EGDC_WINDOW_SYMBOL a="255" r="255" g="255" b="255" /> <!-- Window symbols like on close buttons, scroll bars and check boxes. -->
<!--<EGDC_ICON a="255" r="255" g="255" b="255" /> --> <!-- Icons in a list or tree. -->
<!--<EGDC_ICON_HIGH_LIGHT a="255" r="255" g="255" b="255" /> --> <!-- Selected icons in a list or tree. -->
<Caption tbardistancex="2" tbardistancey="9" />
<WindowButton width="24" />
<CheckBoxColor a="-31" r="6" g="195" b="236" />
</Global>
<Button texture="button.png">
<SrcBorder tlx="3" tly="3" brx="3" bry="3" />
<DstBorder tlx="3" tly="3" brx="3" bry="3" />
<Pressed texture="ButtonPressed.png">
<SrcBorder tlx="3" tly="3" brx="3" bry="3" />
<DstBorder tlx="3" tly="3" brx="3" bry="3" />
<Color r="255" g="255" b="255" a="255" />
</Pressed>
<ButtonDisabled texture="ButtonDisabled.png">
<SrcBorder tlx="3" tly="3" brx="3" bry="3" />
<DstBorder tlx="3" tly="3" brx="3" bry="3" />
<Color r="255" g="255" b="255" a="255" />
</ButtonDisabled>
</Button>
<MenuBar texture="MenuBar.png">
<SrcBorder tlx="3" tly="3" brx="3" bry="3" />
<DstBorder tlx="3" tly="3" brx="3" bry="3" />
<MenuPane texture="MenuPane.png">
<SrcBorder tlx="3" tly="3" brx="3" bry="3" />
<DstBorder tlx="3" tly="3" brx="3" bry="3" />
<Color r="255" g="255" b="255" a="255" />
</MenuPane>
<MenuPressed texture="MenuPressed.png">
<SrcBorder tlx="3" tly="3" brx="3" bry="3" />
<DstBorder tlx="3" tly="3" brx="3" bry="3" />
<Color r="255" g="255" b="255" a="255" />
</MenuPressed>
</MenuBar>
<CheckBox texture="CheckBox.png">
<SrcBorder tlx="1" tly="1" brx="1" bry="1" />
<DstBorder tlx="1" tly="1" brx="1" bry="1" />
<CheckBoxDisabled texture="CheckBoxDisabled.png">
<SrcBorder tlx="1" tly="1" brx="1" bry="1" />
<DstBorder tlx="1" tly="1" brx="1" bry="1" />
</CheckBoxDisabled>
</CheckBox>
<ComboBox texture="sunkenpane.png">
<SrcBorder tlx="1" tly="1" brx="1" bry="1" />
<DstBorder tlx="1" tly="1" brx="1" bry="1" />
<ComboBoxDisabled texture="CheckBoxDisabled.png">
<SrcBorder tlx="1" tly="1" brx="1" bry="1" />
<DstBorder tlx="1" tly="1" brx="1" bry="1" />
</ComboBoxDisabled>
</ComboBox>
<SunkenPane texture="sunkenpane.png">
<SrcBorder tlx="10" tly="10" brx="10" bry="10" />
<DstBorder tlx="10" tly="10" brx="10" bry="10" />
</SunkenPane>
<TabControl texture="TabControl.png">
<SrcBorder tlx="10" tly="10" brx="10" bry="10" />
<DstBorder tlx="10" tly="10" brx="10" bry="10" />
<TabButton texture="TabButton.png">
<SrcBorder tlx="3" tly="3" brx="3" bry="3" />
<DstBorder tlx="3" tly="3" brx="3" bry="3" />
</TabButton>
<TabButtonPressed texture="TabButtonPressed.png">
<SrcBorder tlx="3" tly="3" brx="3" bry="3" />
<DstBorder tlx="3" tly="3" brx="3" bry="3" />
</TabButtonPressed>
</TabControl>
<Window texture="windowbg.png">
<SrcBorder tlx="25" tly="10" brx="10" bry="10" />
<DstBorder tlx="25" tly="10" brx="10" bry="10" />
</Window>
<ProgressBar texture="gauge1.png">
<SrcBorder tlx="16" tly="16" brx="16" bry="16" />
<DstBorder tlx="16" tly="16" brx="16" bry="16" />
<Color a="255" r="255" g="255" b="255"/>
<Filled texture="gauge2.png">
<SrcBorder tlx="16" tly="16" brx="16" bry="16" />
<DstBorder tlx="16" tly="16" brx="16" bry="16" />
<Color a="255" r="255" g="255" b="255" />
</Filled>
</ProgressBar>
</Skin>
Open [Your ygopro folder]\system.conf with a text editor.
Change the following settings:
use_d3d = 1
use_skin = 1
To make your own skin just replace the images in this skin folder.
\ No newline at end of file
<?xml version="1.0"?>
<!-- Config file for the GUI Skin (CImageGUISkin) -->
<!-- Source border is the border width (in pixels) on the texture. -->
<!-- Dest border is the border width on the screen (also in pixels). -->
<!-- Order of elements dosn't matter -->
<!-- <NodeNames> are not case sensitive -->
<!-- attribute= ARE case sensitive -->
<!-- Texture = filename -->
<!-- SrcBorder = top,left,bottom,right -->
<!-- DstBorder = top,left,bottom,right -->
<Skin>
<Properties>
<Name data="Dark Red Phoenix" />
<Author data="sAsUk3" />
<Version data="1.0" />
<Date data="17-May-2013"/>
<Desc data="A skin that looks like Windows XP"/>
<Fallback skin="Dark Red Phoenix" />
<Font texture="fontTahoma.png" />
</Properties>
<Global guialpha="255">
<EGDC_3D_DARK_SHADOW a="255" r="255" g="255" b="255" /> --> <!-- Dark shadow for three-dimensional display elements. -->
<EGDC_3D_SHADOW a="255" r="255" g="255" b="255" /> --> <!-- Shadow color for three-dimensional display elements (for edges facing away from the light source). -->
<EGDC_3D_FACE a="255" r="255" g="255" b="255" /> --> <!-- Face color for three-dimensional display elements and for dialog box backgrounds. -->
<EGDC_3D_HIGH_LIGHT a="255" r="255" g="255" b="255" /> --> <!-- Highlight color for three-dimensional display elements (for edges facing the light source.). -->
<EGDC_3D_LIGHT a="255" r="255" g="255" b="255" /> --> <!-- Light color for three-dimensional display elements (for edges facing the light source.). -->
<EGDC_ACTIVE_BORDER a="255" r="255" g="0" b="0" /> --> <!-- Active window border. -->
<EGDC_ACTIVE_CAPTION a="255" r="255" g="255" b="255" /> --> <!-- Active window title bar text -->
<EGDC_APP_WORKSPACE a="255" r="255" g="255" b="255" /> --> <!-- Background color of multiple document interface (MDI) applications. -->
<EGDC_BUTTON_TEXT a="255" r="255" g="255" b="0" /> --> <!-- Text on a button. -->
<EGDC_GRAY_TEXT a="255" r="255" g="255" b="255" /> --> <!-- Grayed (disabled) text. -->
<EGDC_HIGH_LIGHT a="255" r="255" g="255" b="255" /> --> <!-- Item(s) selected in a control. -->
<EGDC_HIGH_LIGHT_TEXT a="255" r="255" g="255" b="255" /> --> <!-- Text of item(s) selected in a control. -->
<EGDC_INACTIVE_BORDER a="255" r="255" g="255" b="255" /> --> <!-- Inactive window border. -->
<EGDC_INACTIVE_CAPTION a="255" r="255" g="255" b="255" /> --> <!-- Inactive window caption. -->
<EGDC_TOOLTIP a="255" r="255" g="255" b="255" /> --> <!-- Tool tip text color. -->
<EGDC_TOOLTIP_BACKGROUND a="255" r="255" g="255" b="255" /> --> <!-- Tool tip background color. -->
<EGDC_SCROLLBAR a="255" r="255" g="255" b="255" /> --> <!-- Scrollbar gray area. This ONLY applies to the default scrollbar, if you want to change the colors of the graphical one, change the color attributes in the section near the bottom -->
<EGDC_WINDOW a="255" r="40" g="40" b="40" /> --> <!-- Window background. -->
<EGDC_WINDOW_SYMBOL a="255" r="255" g="255" b="255" /> --> <!-- Window symbols like on close buttons, scroll bars and check boxes. -->
<EGDC_ICON a="255" r="255" g="255" b="255" /> --> <!-- Icons in a list or tree. -->
<EGDC_ICON_HIGH_LIGHT a="255" r="255" g="255" b="255" /> --> <!-- Selected icons in a list or tree. -->
<Caption tbardistancex="2" tbardistancey="9" />
<WindowButton width="24" />
<CheckBoxColor a="255" r="33" g="161" b="33" />
</Global>
<Button texture="button.png">
<SrcBorder tlx="3" tly="3" brx="3" bry="3" />
<DstBorder tlx="3" tly="3" brx="3" bry="3" />
<Pressed texture="ButtonPressed.png">
<SrcBorder tlx="3" tly="3" brx="3" bry="3" />
<DstBorder tlx="3" tly="3" brx="3" bry="3" />
<Color r="255" g="255" b="255" a="255" />
</Pressed>
<ButtonDisabled texture="ButtonDisabled.png">
<SrcBorder tlx="3" tly="3" brx="3" bry="3" />
<DstBorder tlx="3" tly="3" brx="3" bry="3" />
<Color r="255" g="255" b="255" a="255" />
</ButtonDisabled>
</Button>
<MenuBar texture="MenuBar.png">
<SrcBorder tlx="3" tly="3" brx="3" bry="3" />
<DstBorder tlx="3" tly="3" brx="3" bry="3" />
<MenuPane texture="MenuPane.png">
<SrcBorder tlx="3" tly="3" brx="3" bry="3" />
<DstBorder tlx="3" tly="3" brx="3" bry="3" />
<Color r="255" g="255" b="255" a="255" />
</MenuPane>
<MenuPressed texture="MenuPressed.png">
<SrcBorder tlx="3" tly="3" brx="3" bry="3" />
<DstBorder tlx="3" tly="3" brx="3" bry="3" />
<Color r="255" g="255" b="255" a="255" />
</MenuPressed>
</MenuBar>
<CheckBox texture="CheckBox.png">
<SrcBorder tlx="1" tly="1" brx="1" bry="1" />
<DstBorder tlx="1" tly="1" brx="1" bry="1" />
<CheckBoxDisabled texture="CheckBoxDisabled.png">
<SrcBorder tlx="1" tly="1" brx="1" bry="1" />
<DstBorder tlx="1" tly="1" brx="1" bry="1" />
</CheckBoxDisabled>
</CheckBox>
<ComboBox texture="sunkenpane.png">
<SrcBorder tlx="1" tly="1" brx="1" bry="1" />
<DstBorder tlx="1" tly="1" brx="1" bry="1" />
<ComboBoxDisabled texture="CheckBoxDisabled.png">
<SrcBorder tlx="1" tly="1" brx="1" bry="1" />
<DstBorder tlx="1" tly="1" brx="1" bry="1" />
</ComboBoxDisabled>
</ComboBox>
<SunkenPane texture="sunkenpane.png">
<SrcBorder tlx="10" tly="10" brx="10" bry="10" />
<DstBorder tlx="10" tly="10" brx="10" bry="10" />
</SunkenPane>
<TabControl texture="TabControl.png">
<SrcBorder tlx="10" tly="10" brx="10" bry="10" />
<DstBorder tlx="10" tly="10" brx="10" bry="10" />
<TabButton texture="TabButton.png">
<SrcBorder tlx="3" tly="3" brx="3" bry="3" />
<DstBorder tlx="3" tly="3" brx="3" bry="3" />
</TabButton>
<TabButtonPressed texture="TabButtonPressed.png">
<SrcBorder tlx="3" tly="3" brx="3" bry="3" />
<DstBorder tlx="3" tly="3" brx="3" bry="3" />
</TabButtonPressed>
</TabControl>
<Window texture="windowbg.png">
<SrcBorder tlx="25" tly="10" brx="10" bry="10" />
<DstBorder tlx="25" tly="10" brx="10" bry="10" />
</Window>
<ProgressBar texture="gauge1.png">
<SrcBorder tlx="16" tly="16" brx="16" bry="16" />
<DstBorder tlx="16" tly="16" brx="16" bry="16" />
<Color a="150" r="255" g="255" b="255"/>
<Filled texture="gauge2.png">
<SrcBorder tlx="16" tly="16" brx="16" bry="16" />
<DstBorder tlx="16" tly="16" brx="16" bry="16" />
<Color a="255" r="255" g="255" b="255" />
</Filled>
</ProgressBar>
</Skin>
<?xml version="1.0"?>
<!-- Config file for the GUI Skin (CImageGUISkin) -->
<!-- Source border is the border width (in pixels) on the texture -->
<!-- Dest border is the border width on the screen (also in pixels) -->
<!-- Order of elements dosn't matter -->
<!-- <NodeNames> are not case sensitive -->
<!-- attribute = ARE case sensitive -->
<!-- Texture = filename -->
<!-- SrcBorder = top,left,bottom,right -->
<!-- DstBorder = top,left,bottom,right -->
<Skin>
<Properties>
<Name data="YGOPro Skin" />
<Author data="calo001" />
<Version data="1.0" />
<Date data="21-Jul-2014"/>
<Desc data="A elegance skin"/>
<Fallback skin="" />
<Font texture="fontTahoma.png" />
</Properties>
<Global guialpha="255">
<EGDC_3D_DARK_SHADOW a="255" r="140" g="140" b="140" />
<EGDC_3D_SHADOW a="255" r="255" g="255" b="255" />
<EGDC_3D_FACE a="255" r="255" g="255" b="255" />
<EGDC_3D_HIGH_LIGHT a="255" r="250" g="250" b="250" />
<EGDC_3D_LIGHT a="255" r="255" g="255" b="255" />
<EGDC_ACTIVE_BORDER a="255" r="200" g="200" b="200" />
<EGDC_ACTIVE_CAPTION a="255" r="35" g="45" b="95" />
<EGDC_APP_WORKSPACE a="255" r="255" g="255" b="255" />
<EGDC_BUTTON_TEXT a="0" r="0" g="0" b="0" />
<EGDC_GRAY_TEXT a="255" r="60" g="60" b="60" />
<EGDC_HIGH_LIGHT a="0" r="0" g="0" b="0" />
<EGDC_HIGH_LIGHT_TEXT a="255" r="255" g="255" b="255" />
<EGDC_INACTIVE_BORDER a="0" r="255" g="255" b="255" />
<EGDC_INACTIVE_CAPTION a="255" r="75" g="75" b="95" />
<EGDC_TOOLTIP a="255" r="40" g="40" b="40" />
<EGDC_TOOLTIP_BACKGROUND a="150" r="70" g="190" b="240" />
<EGDC_SCROLLBAR a="255" r="200" g="200" b="200" />
<EGDC_WINDOW a="255" r="255" g="255" b="255" />
<EGDC_WINDOW_SYMBOL a="255" r="0" g="0" b="0" />
<EGDC_ICON a="255" r="45" g="70" b="135" />
<EGDC_ICON_HIGH_LIGHT a="255" r="70" g="190" b="240" />
<Caption tbardistancex="4" tbardistancey="8" />
<WindowButton width="24" />
<CheckBoxColor a="255" r="33" g="161" b="33" />
</Global>
<Button texture="button.png">
<SrcBorder tlx="3" tly="3" brx="3" bry="3" />
<DstBorder tlx="3" tly="3" brx="3" bry="3" />
<Pressed texture="ButtonPressed.png">
<SrcBorder tlx="3" tly="3" brx="3" bry="3" />
<DstBorder tlx="3" tly="3" brx="3" bry="3" />
<Color r="255" g="255" b="255" a="255" />
</Pressed>
<ButtonDisabled texture="ButtonDisabled.png">
<SrcBorder tlx="3" tly="3" brx="3" bry="3" />
<DstBorder tlx="3" tly="3" brx="3" bry="3" />
<Color r="255" g="255" b="255" a="255" />
</ButtonDisabled>
</Button>
<MenuBar texture="MenuBar.png">
<SrcBorder tlx="3" tly="3" brx="3" bry="3" />
<DstBorder tlx="3" tly="3" brx="3" bry="3" />
<MenuPane texture="MenuPane.png">
<SrcBorder tlx="3" tly="3" brx="3" bry="3" />
<DstBorder tlx="3" tly="3" brx="3" bry="3" />
<Color r="255" g="255" b="255" a="255" />
</MenuPane>
<MenuPressed texture="MenuPressed.png">
<SrcBorder tlx="3" tly="3" brx="3" bry="3" />
<DstBorder tlx="3" tly="3" brx="3" bry="3" />
<Color r="255" g="255" b="255" a="255" />
</MenuPressed>
</MenuBar>
<CheckBox texture="CheckBox.png">
<SrcBorder tlx="1" tly="1" brx="1" bry="1" />
<DstBorder tlx="1" tly="1" brx="1" bry="1" />
<CheckBoxDisabled texture="CheckBoxDisabled.png">
<SrcBorder tlx="1" tly="1" brx="1" bry="1" />
<DstBorder tlx="1" tly="1" brx="1" bry="1" />
</CheckBoxDisabled>
</CheckBox>
<ComboBox texture="ComboBox.png">
<SrcBorder tlx="1" tly="1" brx="1" bry="1" />
<DstBorder tlx="1" tly="1" brx="1" bry="1" />
<ComboBoxDisabled texture="ComboBoxDisabled.png">
<SrcBorder tlx="1" tly="1" brx="1" bry="1" />
<DstBorder tlx="1" tly="1" brx="1" bry="1" />
</ComboBoxDisabled>
</ComboBox>
<SunkenPane texture="sunkenpane.png">
<SrcBorder tlx="10" tly="10" brx="10" bry="10" />
<DstBorder tlx="10" tly="10" brx="10" bry="10" />
</SunkenPane>
<TabControl texture="TabControl.png">
<SrcBorder tlx="10" tly="10" brx="10" bry="10" />
<DstBorder tlx="10" tly="10" brx="10" bry="10" />
<TabButton texture="TabButton.png">
<SrcBorder tlx="3" tly="3" brx="3" bry="3" />
<DstBorder tlx="3" tly="3" brx="3" bry="3" />
</TabButton>
<TabButtonPressed texture="TabButtonPressed.png">
<SrcBorder tlx="10" tly="10" brx="10" bry="10" />
<DstBorder tlx="10" tly="10" brx="10" bry="10" />
</TabButtonPressed>
</TabControl>
<Window texture="windowbg.png">
<SrcBorder tlx="25" tly="5" brx="5" bry="1" />
<DstBorder tlx="25" tly="5" brx="5" bry="1" />
</Window>
<ProgressBar texture="gauge1.png">
<SrcBorder tlx="16" tly="16" brx="16" bry="16" />
<DstBorder tlx="16" tly="16" brx="16" bry="16" />
<Color a="150" r="255" g="255" b="255"/>
<Filled texture="gauge2.png">
<SrcBorder tlx="16" tly="16" brx="16" bry="16" />
<DstBorder tlx="16" tly="16" brx="16" bry="16" />
<Color a="255" r="255" g="255" b="255" />
</Filled>
</ProgressBar>
</Skin>
\ No newline at end of file
Open [Your ygopro folder]\system.conf with a text editor.
Change the following settings:
use_d3d = 1
use_skin = 1
To make your own skin just replace the images in this skin folder.
\ No newline at end of file
<?xml version="1.0"?>
<!--r-->
<Skin>
<Properties>
<Name data="Win8" />
<Author data="247321453" />
<Version data="1.0" />
<Date data="13-Jan-2010"/>
<Desc data="A skin that looks like Windows 8"/>
<Fallback skin="EGST_WINDOWS_CLASSIC" />
<Font texture="fontTahoma.png" />
</Properties>
<Global guialpha="255">
<!--<EGDC_3D_DARK_SHADOW a="255" r="255" g="255" b="255" /> --> <!-- Dark shadow for three-dimensional display elements. -->
<!--<EGDC_3D_SHADOW a="255" r="255" g="255" b="255" /> --> <!-- Shadow color for three-dimensional display elements (for edges facing away from the light source). -->
<EGDC_3D_FACE a="255" r="215" g="225" b="235" /> <!-- 界面,按钮颜色-->
<!--<EGDC_3D_HIGH_LIGHT a="255" r="255" g="255" b="255" /> --> <!-- Highlight color for three-dimensional display elements (for edges facing the light source.). -->
<!--<EGDC_3D_LIGHT a="255" r="255" g="255" b="255" /> --> <!-- Light color for three-dimensional display elements (for edges facing the light source.). -->
<!--<EGDC_ACTIVE_BORDER a="255" r="255" g="0" b="0" />--> <!-- Active window border. -->
<EGDC_ACTIVE_CAPTION a="255" r="255" g="255" b="0" /> <!-- 标题颜色 -->
<!--<EGDC_APP_WORKSPACE a="255" r="255" g="255" b="255" />--> <!-- Background color of multiple document interface (MDI) applications. -->
<!--<EGDC_BUTTON_TEXT a="255" r="255" g="255" b="255" /> --> <!-- Text on a button. -->
<EGDC_GRAY_TEXT a="255" r="0" g="0" b="0" /> <!-- 不能点的选项颜色 -->
<!--<EGDC_HIGH_LIGHT a="255" r="255" g="255" b="255" /> --> <!-- Item(s) selected in a control. -->
<EGDC_HIGH_LIGHT_TEXT a="255" r="255" g="255" b="0" /> <!-- 选项的选中颜色 -->
<!--<EGDC_INACTIVE_BORDER a="150" r="255" g="255" b="255" /> --> <!-- Inactive window border. -->
<!--<EGDC_INACTIVE_CAPTION a="150" r="255" g="255" b="255" /> --> <!-- Inactive window caption. -->
<!--<EGDC_TOOLTIP a="150" r="255" g="255" b="255" /> --> <!-- Tool tip text color. -->
<!--<EGDC_TOOLTIP_BACKGROUND a="150" r="255" g="255" b="255" /> --> <!-- Tool tip background color. -->
<!--<EGDC_SCROLLBAR a="150" r="255" g="255" b="255" /> --> <!-- Scrollbar gray area. This ONLY applies to the default scrollbar, if you want to change the colors of the graphical one, change the color attributes in the section near the bottom -->
<EGDC_WINDOW a="240" r="255" g="255" b="255" /> <!-- 输入框颜色 -->
<EGDC_WINDOW_SYMBOL a="255" r="0" g="0" b="0" /> <!-- 关闭按钮,选项按钮颜色-->
<!--<EGDC_ICON a="255" r="255" g="255" b="255" /> --> <!-- Icons in a list or tree. -->
<!--<EGDC_ICON_HIGH_LIGHT a="255" r="255" g="255" b="255" /> --> <!-- Selected icons in a list or tree. -->
<Caption tbardistancex="2" tbardistancey="9" />
<WindowButton width="24" />
<CheckBoxColor a="255" r="33" g="161" b="33" />
</Global>
<Button texture="button.png">
<SrcBorder tlx="3" tly="3" brx="3" bry="3" />
<DstBorder tlx="3" tly="3" brx="3" bry="3" />
<Pressed texture="ButtonPressed.png">
<SrcBorder tlx="3" tly="3" brx="3" bry="3" />
<DstBorder tlx="3" tly="3" brx="3" bry="3" />
<Color a="250" r="255" g="255" b="255" />
</Pressed>
<ButtonDisabled texture="ButtonDisabled.png">
<SrcBorder tlx="3" tly="3" brx="3" bry="3" />
<DstBorder tlx="3" tly="3" brx="3" bry="3" />
</ButtonDisabled>
</Button>
<MenuBar texture="MenuBar.png">
<SrcBorder tlx="3" tly="3" brx="3" bry="3" />
<DstBorder tlx="3" tly="3" brx="3" bry="3" />
<MenuPane texture="MenuPane.png">
<SrcBorder tlx="3" tly="3" brx="3" bry="3" />
<DstBorder tlx="3" tly="3" brx="3" bry="3" />
<Color r="255" g="255" b="255" a="255" />
</MenuPane>
<MenuPressed texture="MenuPressed.png">
<SrcBorder tlx="3" tly="3" brx="3" bry="3" />
<DstBorder tlx="3" tly="3" brx="3" bry="3" />
<Color r="255" g="255" b="255" a="255" />
</MenuPressed>
</MenuBar>
<CheckBox texture="CheckBox.png">
<SrcBorder tlx="1" tly="1" brx="1" bry="1" />
<DstBorder tlx="1" tly="1" brx="1" bry="1" />
<CheckBoxDisabled texture="CheckBoxDisabled.png">
<SrcBorder tlx="1" tly="1" brx="1" bry="1" />
<DstBorder tlx="1" tly="1" brx="1" bry="1" />
</CheckBoxDisabled>
</CheckBox>
<ComboBox texture="sunkenpane.png">
<SrcBorder tlx="1" tly="1" brx="1" bry="1" />
<DstBorder tlx="1" tly="1" brx="1" bry="1" />
<ComboBoxDisabled texture="CheckBoxDisabled.png">
<SrcBorder tlx="1" tly="1" brx="1" bry="1" />
<DstBorder tlx="1" tly="1" brx="1" bry="1" />
</ComboBoxDisabled>
</ComboBox>
<SunkenPane texture="sunkenpane.png">
<SrcBorder tlx="10" tly="10" brx="10" bry="10" />
<DstBorder tlx="10" tly="10" brx="10" bry="10" />
</SunkenPane>
<TabControl texture="TabControl.png">
<SrcBorder tlx="10" tly="10" brx="10" bry="10" />
<DstBorder tlx="10" tly="10" brx="10" bry="10" />
<TabButton texture="TabButton.png">
<SrcBorder tlx="3" tly="3" brx="3" bry="3" />
<DstBorder tlx="3" tly="3" brx="3" bry="3" />
<Color a="200" r="255" g="255" b="255" />
</TabButton>
<TabButtonPressed texture="TabButtonPressed.png">
<SrcBorder tlx="3" tly="3" brx="3" bry="3" />
<DstBorder tlx="3" tly="3" brx="3" bry="3" />
</TabButtonPressed>
</TabControl>
<Window texture="windowbg.png">
<SrcBorder tlx="25" tly="10" brx="10" bry="10" />
<DstBorder tlx="25" tly="10" brx="10" bry="10" />
</Window>
<ProgressBar texture="gauge1.png">
<SrcBorder tlx="16" tly="16" brx="16" bry="16" />
<DstBorder tlx="16" tly="16" brx="16" bry="16" />
<Color a="150" r="255" g="255" b="255"/>
<Filled texture="gauge2.png">
<SrcBorder tlx="16" tly="16" brx="16" bry="16" />
<DstBorder tlx="16" tly="16" brx="16" bry="16" />
<Color a="255" r="255" g="255" b="255" />
</Filled>
</ProgressBar>
</Skin>
......@@ -378,6 +378,9 @@
!system 1363 是否删除这个录像?
!system 1364 重命名录像
!system 1365 重命名失败,可能存在同名文件
!system 1366 重命名成功
!system 1367 重命名卡组
!system 1368 卡组文件:
!system 1370 星数↑
!system 1371 攻击↑
!system 1372 守备↑
......@@ -532,6 +535,7 @@
!counter 0x1045 鳞粉指示物
!counter 0x46 指示物(刚鬼死斗)
!counter 0x47 指示物(限制代码)
!counter 0x48 指示物(连接死亡炮塔)
#setnames, using tab for comment
!setname 0x1 正义盟军 AOJ
!setname 0x2 次世代 ジェネクス
......@@ -892,3 +896,5 @@
!setname 0x114 空牙团 空牙団
!setname 0x115 闪刀 閃刀
!setname 0x1115 闪刀姬 閃刀姫
!setname 0x116 圣像骑士 パラディオン
!setname 0x117 魔神仪 魔神儀
......@@ -42,3 +42,4 @@ window_width = 1024
window_height = 640
resize_popup_menu = 0
enable_pendulum_scale = 1
skin_index = -1
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