Advertisement
Auios

Multiwinia Scroll Bar

Sep 26th, 2016
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.19 KB | None | 0 0
  1. //Multiwinia achievements window for scroll bar.
  2. //GameMenuWindow.cpp
  3. //Line: 3,252
  4. //at void GameMenuWindow::...
  5.  
  6. //Scroll bar at line 3,297 and 3,298
  7.  
  8. void GameMenuWindow::SetupAchievementsPage()
  9. {
  10. float leftX, leftY, leftW, leftH;
  11. float rightX, rightY, rightW, rightH;
  12. float titleX, titleY, titleW, titleH;
  13. float fontLarge, fontMed, fontSmall;
  14. float buttonW, buttonH, gap;
  15. GetPosition_LeftBox(leftX, leftY, leftW, leftH );
  16. GetPosition_RightBox(rightX, rightY, rightW, rightH );
  17. GetPosition_TitleBar(titleX, titleY, titleW, titleH );
  18. GetFontSizes( fontLarge, fontMed, fontSmall );
  19. GetButtonSizes( buttonW, buttonH, gap );
  20.  
  21. float x = leftX + (leftW-buttonW)/2.0f;
  22. float y = leftY + buttonH;
  23. float fontSize = fontMed;
  24.  
  25. float buttonX = x;
  26.  
  27. buttonW = (titleW / 2.0f) * 0.9f;
  28.  
  29. m_serverX = buttonX;
  30. m_serverY = y;
  31. m_serverW = titleW * 0.9f;
  32. m_serverH = (g_app->m_renderer->ScreenH()/16) * 1.6f; // 64 pixels is height of achievement images
  33. m_serverFontSize = fontSmall;
  34. m_serverGap = m_serverH;
  35. m_serverButtonOrderStartIndex = m_buttonOrder.Size();
  36.  
  37. float yPos = leftY;
  38.  
  39. yPos += buttonH * 0.5f;
  40. GameMenuTitleButton *title = new GameMenuTitleButton();
  41. title->SetShortProperties( "title", leftX+10, leftY+10, titleW-20, buttonH*1.5f, LANGUAGEPHRASE("multiwinia_menu_achievements") );
  42. title->m_fontSize = fontMed;
  43. RegisterButton( title );
  44. yPos += buttonH*1.5f;
  45.  
  46. m_serverY = yPos;
  47.  
  48. int scrollbarW = buttonH / 2.0f;
  49. int scrollbarX = leftX + titleW - (scrollbarW + 10);// 10 + buttonW;
  50. int scrollbarY = m_serverY;//leftY+10+buttonH*1.6f;
  51. int scrollbarH = (leftY + leftH - buttonH * 2)-scrollbarY;
  52.  
  53. m_scrollBar = new ScrollBar(this);
  54. m_scrollBar->Create("scrollBar", scrollbarX, scrollbarY, scrollbarW, scrollbarH, 0, 10 );
  55.  
  56. yPos = leftY + leftH - buttonH * 2;
  57.  
  58. GameMenuButton *button = new BackPageButton( PageMain );
  59. button->SetShortProperties( "multiwinia_menu_back", buttonX, yPos, buttonW, buttonH, LANGUAGEPHRASE("multiwinia_menu_back") );
  60. button->m_fontSize = fontSize;
  61. RegisterButton( button );
  62. m_buttonOrder.PutData( button );
  63.  
  64. m_setupAchievementsPage = false;
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement