Commit 4c5de5d4 authored by mercury233's avatar mercury233

rename

parent 0cbdcdf0
......@@ -59,8 +59,8 @@ static bool check_set_code(const CardDataC& data, int set_code) {
return res;
}
inline bool isHavePopupWindow() {
return mainGame->wQuery->isVisible() || mainGame->wCategories->isVisible() || mainGame->wLinkMarks->isVisible() || mainGame->wManageDeck->isVisible();
inline bool havePopupWindow() {
return mainGame->wQuery->isVisible() || mainGame->wCategories->isVisible() || mainGame->wLinkMarks->isVisible() || mainGame->wDeckManage->isVisible();
}
inline void refreshDeckList() {
irr::gui::IGUIListBox* lstCategories = mainGame->lstCategories;
......@@ -89,7 +89,7 @@ inline void changeCategory(int catesel) {
mainGame->deckBuilder.prev_category = catesel;
mainGame->deckBuilder.prev_deck = 0;
}
inline void showManageDeck() {
inline void showDeckManage() {
mainGame->RefreshCategoryDeck(mainGame->cbDBCategory, mainGame->cbDBDecks, false);
mainGame->cbDBCategory->setSelected(mainGame->deckBuilder.prev_category);
mainGame->RefreshDeck(mainGame->cbDBCategory, mainGame->cbDBDecks);
......@@ -108,7 +108,7 @@ inline void showManageDeck() {
lstCategories->setSelected(mainGame->deckBuilder.prev_category);
refreshDeckList();
mainGame->lstDecks->setSelected(mainGame->deckBuilder.prev_deck);
mainGame->PopupElement(mainGame->wManageDeck);
mainGame->PopupElement(mainGame->wDeckManage);
}
void DeckBuilder::Initialize() {
......@@ -127,7 +127,7 @@ void DeckBuilder::Initialize() {
mainGame->btnSideSort->setVisible(false);
mainGame->btnSideReload->setVisible(false);
filterList = deckManager._lfList[0].content;
mainGame->cbDBLFList->setSelected(0);
mainGame->cbLFList->setSelected(0);
ClearSearch();
mouse_pos.set(0, 0);
hovered_code = 0;
......@@ -180,14 +180,14 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
if(((mainGame->wCategories->isVisible() && id != BUTTON_CATEGORY_OK) ||
(mainGame->wQuery->isVisible() && id != BUTTON_YES && id != BUTTON_NO) ||
(mainGame->wLinkMarks->isVisible() && id != BUTTON_MARKERS_OK) ||
(mainGame->wManageDeck->isVisible() && !(id >= WINDOW_MANAGE_DECK && id <= LISTBOX_CATEGORY_DECKS)))
(mainGame->wDeckManage->isVisible() && !(id >= WINDOW_DECK_MANAGE && id <= COMBOBOX_LFLIST)))
&& event.GUIEvent.EventType != irr::gui::EGET_COMBO_BOX_CHANGED) {
break;
}
switch(event.GUIEvent.EventType) {
case irr::gui::EGET_ELEMENT_CLOSED: {
if(id == WINDOW_MANAGE_DECK) {
mainGame->HideElement(mainGame->wManageDeck);
if(id == WINDOW_DECK_MANAGE) {
mainGame->HideElement(mainGame->wDeckManage);
return true;
break;
}
......@@ -314,7 +314,7 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
prev_operation = id;
break;
}
showManageDeck();
showDeckManage();
break;
}
case BUTTON_SIDE_OK: {
......@@ -385,7 +385,7 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
prev_deck = decksel;
is_modified = false;
} else if(prev_operation == BUTTON_MANAGE_DECK) {
showManageDeck();
showDeckManage();
}
prev_operation = 0;
break;
......@@ -460,12 +460,12 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
}
case irr::gui::EGET_COMBO_BOX_CHANGED: {
switch(id) {
case COMBOBOX_DBLFLIST: {
filterList = deckManager._lfList[mainGame->cbDBLFList->getSelected()].content;
case COMBOBOX_LFLIST: {
filterList = deckManager._lfList[mainGame->cbLFList->getSelected()].content;
break;
}
case COMBOBOX_DBCATEGORY: {
if(isHavePopupWindow()) {
if(havePopupWindow()) {
mainGame->cbDBCategory->setSelected(prev_category);
break;
}
......@@ -488,7 +488,7 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
break;
}
case COMBOBOX_DBDECKS: {
if(isHavePopupWindow()) {
if(havePopupWindow()) {
mainGame->cbDBDecks->setSelected(prev_deck);
break;
}
......@@ -639,7 +639,7 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
changeCategory(catesel);
break;
}
case LISTBOX_CATEGORY_DECKS: {
case LISTBOX_DECKS: {
int decksel = mainGame->lstDecks->getSelected();
mainGame->cbDBDecks->setSelected(decksel);
if(decksel == -1)
......@@ -665,7 +665,7 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
irr::gui::IGUIElement* root = mainGame->env->getRootGUIElement();
if(root->getElementFromPoint(mouse_pos) != root)
break;
if(isHavePopupWindow())
if(havePopupWindow())
break;
if(hovered_pos == 0 || hovered_seq == -1)
break;
......@@ -729,7 +729,7 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
}
break;
}
if(isHavePopupWindow())
if(havePopupWindow())
break;
if(!is_draging) {
if(hovered_pos == 0 || hovered_seq == -1)
......@@ -769,7 +769,7 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
case irr::EMIE_MMOUSE_LEFT_UP: {
if (mainGame->is_siding)
break;
if (isHavePopupWindow())
if (havePopupWindow())
break;
if (hovered_pos == 0 || hovered_seq == -1)
break;
......
......@@ -498,30 +498,31 @@ bool Game::Initialize() {
wDeckEdit = env->addStaticText(L"", rect<s32>(309, 5, 605, 130), true, false, 0, -1, true);
wDeckEdit->setVisible(false);
btnManageDeck = env->addButton(rect<s32>(225, 5, 290, 30), wDeckEdit, BUTTON_MANAGE_DECK, L"管理");
wManageDeck = env->addWindow(rect<s32>(310, 135, 800, 465), false, L"管理卡组", 0, WINDOW_MANAGE_DECK);
wManageDeck->setVisible(false);
lstCategories = env->addListBox(rect<s32>(10, 30, 170, 320), wManageDeck, LISTBOX_CATEGORIES, true);
lstDecks = env->addListBox(rect<s32>(180, 30, 340, 320), wManageDeck, LISTBOX_CATEGORY_DECKS, true);
wDeckManage = env->addWindow(rect<s32>(310, 135, 800, 465), false, L"管理卡组", 0, WINDOW_DECK_MANAGE);
wDeckManage->setVisible(false);
lstCategories = env->addListBox(rect<s32>(10, 30, 170, 320), wDeckManage, LISTBOX_CATEGORIES, true);
lstDecks = env->addListBox(rect<s32>(180, 30, 340, 320), wDeckManage, LISTBOX_DECKS, true);
posY = 30;
btnNewCategory = env->addButton(rect<s32>(350, posY, 480, posY + 25), wManageDeck, BUTTON_NEW_CATEGORY, L"新建分类");
btnNewCategory = env->addButton(rect<s32>(350, posY, 480, posY + 25), wDeckManage, BUTTON_NEW_CATEGORY, L"新建分类");
posY += 30;
btnRenameCategory = env->addButton(rect<s32>(350, posY, 480, posY + 25), wManageDeck, BUTTON_RENAME_CATEGORY, L"重命名分类");
btnRenameCategory = env->addButton(rect<s32>(350, posY, 480, posY + 25), wDeckManage, BUTTON_RENAME_CATEGORY, L"重命名分类");
posY += 30;
btnDeleteCategory = env->addButton(rect<s32>(350, posY, 480, posY + 25), wManageDeck, BUTTON_DELETE_CATEGORY, L"删除分类");
btnDeleteCategory = env->addButton(rect<s32>(350, posY, 480, posY + 25), wDeckManage, BUTTON_DELETE_CATEGORY, L"删除分类");
posY += 30;
btnNewDeck = env->addButton(rect<s32>(350, posY, 480, posY + 25), wManageDeck, BUTTON_NEW_DECK, L"新建卡组");
btnNewDeck = env->addButton(rect<s32>(350, posY, 480, posY + 25), wDeckManage, BUTTON_NEW_DECK, L"新建卡组");
posY += 30;
btnRenameDeck = env->addButton(rect<s32>(350, posY, 480, posY + 25), wManageDeck, BUTTON_RENAME_DECK, L"重命名卡组");
btnRenameDeck = env->addButton(rect<s32>(350, posY, 480, posY + 25), wDeckManage, BUTTON_RENAME_DECK, L"重命名卡组");
posY += 30;
btnManageDeleteDeck = env->addButton(rect<s32>(350, posY, 480, posY + 25), wManageDeck, BUTTON_DELETE_DECK_MANAGE, L"删除卡组");
btnDMDeleteDeck = env->addButton(rect<s32>(350, posY, 480, posY + 25), wDeckManage, BUTTON_DELETE_DECK_DM, L"删除卡组");
posY += 30;
btnMoveDeck = env->addButton(rect<s32>(350, posY, 480, posY + 25), wManageDeck, BUTTON_MOVE_DECK, L"移动到分类");
btnMoveDeck = env->addButton(rect<s32>(350, posY, 480, posY + 25), wDeckManage, BUTTON_MOVE_DECK, L"移动到分类");
posY += 30;
btnCopyDeck = env->addButton(rect<s32>(350, posY, 480, posY + 25), wManageDeck, BUTTON_COPY_DECK, L"复制到分类");
btnCopyDeck = env->addButton(rect<s32>(350, posY, 480, posY + 25), wDeckManage, BUTTON_COPY_DECK, L"复制到分类");
posY += 55;
//env->addStaticText(dataManager.GetSysString(1300), rect<s32>(350, posY, 440, posY + 25), false, false, wManageDeck);
cbDBLFList = env->addComboBox(rect<s32>(350, posY, 480, posY + 25), wManageDeck, COMBOBOX_DBLFLIST);
cbDBLFList->setMaxSelectionRows(10);
cbLFList = env->addComboBox(rect<s32>(350, posY, 480, posY + 25), wDeckManage, COMBOBOX_LFLIST);
cbLFList->setMaxSelectionRows(10);
for(unsigned int i = 0; i < deckManager._lfList.size(); ++i)
cbLFList->addItem(deckManager._lfList[i].listName);
stDBCategory = env->addStaticText(dataManager.GetSysString(1300), rect<s32>(10, 9, 100, 29), false, false, wDeckEdit);
cbDBCategory = env->addComboBox(rect<s32>(80, 5, 220, 30), wDeckEdit, COMBOBOX_DBCATEGORY);
......@@ -529,8 +530,6 @@ bool Game::Initialize() {
stDeck = env->addStaticText(dataManager.GetSysString(1301), rect<s32>(10, 39, 100, 59), false, false, wDeckEdit);
cbDBDecks = env->addComboBox(rect<s32>(80, 35, 220, 60), wDeckEdit, COMBOBOX_DBDECKS);
cbDBDecks->setMaxSelectionRows(15);
for(unsigned int i = 0; i < deckManager._lfList.size(); ++i)
cbDBLFList->addItem(deckManager._lfList[i].listName);
btnSaveDeck = env->addButton(rect<s32>(225, 35, 290, 60), wDeckEdit, BUTTON_SAVE_DECK, dataManager.GetSysString(1302));
ebDeckname = env->addEditBox(L"", rect<s32>(80, 65, 220, 90), true, wDeckEdit, -1);
ebDeckname->setTextAlignment(irr::gui::EGUIA_CENTER, irr::gui::EGUIA_CENTER);
......@@ -1594,7 +1593,7 @@ void Game::OnResize() {
ebDeckname->setRelativePosition(Resize(80, 65, 220, 90));
cbDBCategory->setRelativePosition(Resize(80, 5, 220, 30));
btnManageDeck->setRelativePosition(Resize(225, 5, 290, 30));
wManageDeck->setRelativePosition(ResizeWin(310, 135, 800, 465));
wDeckManage->setRelativePosition(ResizeWin(310, 135, 800, 465));
wSort->setRelativePosition(Resize(930, 132, 1020, 156));
cbSortType->setRelativePosition(Resize(10, 2, 85, 22));
......
......@@ -480,18 +480,23 @@ public:
irr::gui::IGUIStaticText* stSearch;
irr::gui::IGUIStaticText* stScale;
//deck manage
irr::gui::IGUIWindow* wManageDeck;
irr::gui::IGUIWindow* wDeckManage;
irr::gui::IGUIListBox* lstCategories;
irr::gui::IGUIListBox* lstDecks;
irr::gui::IGUIComboBox* cbDBLFList;
irr::gui::IGUIButton* btnNewCategory;
irr::gui::IGUIButton* btnRenameCategory;
irr::gui::IGUIButton* btnDeleteCategory;
irr::gui::IGUIButton* btnNewDeck;
irr::gui::IGUIButton* btnRenameDeck;
irr::gui::IGUIButton* btnManageDeleteDeck;
irr::gui::IGUIButton* btnDMDeleteDeck;
irr::gui::IGUIButton* btnMoveDeck;
irr::gui::IGUIButton* btnCopyDeck;
irr::gui::IGUIWindow* wDMQuery;
irr::gui::IGUIEditBox* ebDMName;
irr::gui::IGUIComboBox* cbDMCategory;
irr::gui::IGUIButton* btnDMYes;
irr::gui::IGUIButton* btnDMNo;
irr::gui::IGUIComboBox* cbLFList;
//filter
irr::gui::IGUIStaticText* wFilter;
irr::gui::IGUIScrollBar* scrFilter;
......@@ -702,18 +707,20 @@ extern Game* mainGame;
#define BUTTON_MARKERS_OK 323
#define COMBOBOX_SORTTYPE 324
#define WINDOW_MANAGE_DECK 330
#define WINDOW_DECK_MANAGE 330
#define BUTTON_NEW_CATEGORY 331
#define BUTTON_RENAME_CATEGORY 332
#define BUTTON_DELETE_CATEGORY 333
#define BUTTON_NEW_DECK 334
#define BUTTON_RENAME_DECK 335
#define BUTTON_DELETE_DECK_MANAGE 336
#define BUTTON_DELETE_DECK_DM 336
#define BUTTON_MOVE_DECK 337
#define BUTTON_COPY_DECK 338
#define COMBOBOX_DBLFLIST 339
#define LISTBOX_CATEGORIES 340
#define LISTBOX_CATEGORY_DECKS 341
#define LISTBOX_CATEGORIES 339
#define LISTBOX_DECKS 340
#define BUTTON_DM_OK 341
#define BUTTON_DM_CANCEL 342
#define COMBOBOX_LFLIST 349
#define CHECKBOX_AUTO_SEARCH 360
#define CHECKBOX_ENABLE_SOUND 361
......
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