#include "CGuiTableGroup.hpp" #include "CGuiAnimController.hpp" #include "CGuiLogicalEventTrigger.hpp" namespace urde { typedef bool(CGuiTableGroup::*FMAF)(CGuiFunctionDef* def, CGuiControllerInfo* info); static std::unordered_map WidgetFnMap; void CGuiTableGroup::LoadWidgetFnMap() { WidgetFnMap.emplace(std::make_pair(21, &CGuiTableGroup::MAF_SelectNextColumn)); WidgetFnMap.emplace(std::make_pair(22, &CGuiTableGroup::MAF_SelectPrevColumn)); WidgetFnMap.emplace(std::make_pair(23, &CGuiTableGroup::MAF_SelectNextRow)); WidgetFnMap.emplace(std::make_pair(24, &CGuiTableGroup::MAF_SelectPrevRow)); WidgetFnMap.emplace(std::make_pair(25, &CGuiTableGroup::MAF_SelectNextColumnSkipUnActivated)); WidgetFnMap.emplace(std::make_pair(26, &CGuiTableGroup::MAF_SelectPrevColumnSkipUnActivated)); WidgetFnMap.emplace(std::make_pair(27, &CGuiTableGroup::MAF_SelectNextRowSkipUnActivated)); WidgetFnMap.emplace(std::make_pair(28, &CGuiTableGroup::MAF_SelectPrevRowSkipUnActivated)); WidgetFnMap.emplace(std::make_pair(29, &CGuiTableGroup::MAF_SelectColumnAtIndex)); WidgetFnMap.emplace(std::make_pair(30, &CGuiTableGroup::MAF_SelectRowAtIndex)); WidgetFnMap.emplace(std::make_pair(31, &CGuiTableGroup::MAF_InitializeTable)); WidgetFnMap.emplace(std::make_pair(32, &CGuiTableGroup::MAF_MenuAdvance)); WidgetFnMap.emplace(std::make_pair(33, &CGuiTableGroup::MAF_MenuCancel)); } void CGuiVirtualBox::GetDifference(int a, int b, int& aOut, int& bOut) { if (a < x0_) { aOut = a - x0_; } else { if (a > x0_ + x8_) aOut = a - x0_ + x8_; else aOut = 0; } if (b < x4_) { bOut = b - x4_; } else { if (b > x4_ + xc_) bOut = b - x4_ + xc_; else bOut = 0; } } bool CGuiVirtualBox::ShiftHorizontal(int a, bool b) { bool ret = false; FillCellsInBox(x24_.get()); int r31 = x4_ + a; if (r31 < 0) { ret = true; if (b) x4_ = x14_ - xc_; else x4_ = 0; } else { if (r31 + xc_ > x14_) { ret = true; if (b) x4_ = 0; else x4_ = x14_ - xc_; } else x4_ = r31; } FillCellsInBox(x20_.get()); ResolveTransitionCells(); return ret; } bool CGuiVirtualBox::ShiftVertical(int a, bool b) { bool ret = false; FillCellsInBox(x24_.get()); int r31 = x0_ + a; if (r31 < 0) { ret = true; if (b) x0_ = x10_ - x8_; else x0_ = 0; } else { if (r31 + x8_ > x10_) { ret = true; if (b) x0_ = 0; else x0_ = x10_ - x8_; } else x0_ = r31; } FillCellsInBox(x20_.get()); ResolveTransitionCells(); return ret; } void CGuiVirtualBox::ResolveTransitionCells() { int prod = x8_ * xc_; x1c_ = 0; for (int i=0 ; iParseBaseInfo(frame, in, parms); return ret; } }