Mercurial > mm7
comparison Engine/Spells/CastSpellInfo.cpp @ 2544:c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
author | a.parshin |
---|---|
date | Mon, 11 May 2015 09:51:04 +0200 |
parents | b6140dfeac27 |
children | f2a8ed07e921 |
comparison
equal
deleted
inserted
replaced
2543:b6140dfeac27 | 2544:c674d547cc7c |
---|---|
3501 { | 3501 { |
3502 if ( a5 & 2 ) | 3502 if ( a5 & 2 ) |
3503 { | 3503 { |
3504 if ( pGUIWindow_Settings ) | 3504 if ( pGUIWindow_Settings ) |
3505 return; | 3505 return; |
3506 pGUIWindow_Settings = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_CastSpell, (int)&pCastSpellInfo[result], 0); | 3506 pGUIWindow_Settings = new OnCastTargetedSpell(0, 0, window->GetWidth(), window->GetHeight(), (int)&pCastSpellInfo[result], 0); |
3507 pGUIWindow_Settings->CreateButton(52, 422, 35, 0, 2, 0, UIMSG_CastSpell_Character_Big_Improvement, 0, 49, "", 0); | 3507 pGUIWindow_Settings->CreateButton(52, 422, 35, 0, 2, 0, UIMSG_CastSpell_Character_Big_Improvement, 0, 49, "", 0); |
3508 pGUIWindow_Settings->CreateButton(165, 422, 35, 0, 2, 0, UIMSG_CastSpell_Character_Big_Improvement, 1, 50, "", 0); | 3508 pGUIWindow_Settings->CreateButton(165, 422, 35, 0, 2, 0, UIMSG_CastSpell_Character_Big_Improvement, 1, 50, "", 0); |
3509 pGUIWindow_Settings->CreateButton(280, 422, 35, 0, 2, 0, UIMSG_CastSpell_Character_Big_Improvement, 2, 51, "", 0); | 3509 pGUIWindow_Settings->CreateButton(280, 422, 35, 0, 2, 0, UIMSG_CastSpell_Character_Big_Improvement, 2, 51, "", 0); |
3510 pGUIWindow_Settings->CreateButton(390, 422, 35, 0, 2, 0, UIMSG_CastSpell_Character_Big_Improvement, 3, 52, "", 0); | 3510 pGUIWindow_Settings->CreateButton(390, 422, 35, 0, 2, 0, UIMSG_CastSpell_Character_Big_Improvement, 3, 52, "", 0); |
3511 pParty->sub_421B2C_PlaceInInventory_or_DropPickedItem(); | 3511 pParty->sub_421B2C_PlaceInInventory_or_DropPickedItem(); |
3514 if ( a5 & 8 ) | 3514 if ( a5 & 8 ) |
3515 { | 3515 { |
3516 if ( pGUIWindow_Settings ) | 3516 if ( pGUIWindow_Settings ) |
3517 return; | 3517 return; |
3518 | 3518 |
3519 pGUIWindow_Settings = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_CastSpell, (int)&pCastSpellInfo[result], 0); | 3519 pGUIWindow_Settings = new OnCastTargetedSpell(0, 0, window->GetWidth(), window->GetHeight(), (int)&pCastSpellInfo[result], 0); |
3520 pGUIWindow_Settings->CreateButton(game_viewport_x, game_viewport_y, game_viewport_width, game_viewport_height, 1, 0, UIMSG_CastSpell_Shoot_Monster, 0, 0, "", 0); | 3520 pGUIWindow_Settings->CreateButton(game_viewport_x, game_viewport_y, game_viewport_width, game_viewport_height, 1, 0, UIMSG_CastSpell_Shoot_Monster, 0, 0, "", 0); |
3521 pParty->sub_421B2C_PlaceInInventory_or_DropPickedItem(); | 3521 pParty->sub_421B2C_PlaceInInventory_or_DropPickedItem(); |
3522 return; | 3522 return; |
3523 } | 3523 } |
3524 if ( a5 & 0x40 ) | 3524 if ( a5 & 0x40 ) |
3525 { | 3525 { |
3526 if ( pGUIWindow_Settings ) | 3526 if ( pGUIWindow_Settings ) |
3527 return; | 3527 return; |
3528 | 3528 |
3529 pGUIWindow_Settings = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_CastSpell, (int)&pCastSpellInfo[result], 0); | 3529 pGUIWindow_Settings = new OnCastTargetedSpell(0, 0, window->GetWidth(), window->GetHeight(), (int)&pCastSpellInfo[result], 0); |
3530 pGUIWindow_Settings->CreateButton(game_viewport_x, game_viewport_y, game_viewport_width, game_viewport_height, 1, 0, UIMSG_CastSpell_Telekinesis, 0, 0, "", 0); | 3530 pGUIWindow_Settings->CreateButton(game_viewport_x, game_viewport_y, game_viewport_width, game_viewport_height, 1, 0, UIMSG_CastSpell_Telekinesis, 0, 0, "", 0); |
3531 pParty->sub_421B2C_PlaceInInventory_or_DropPickedItem(); | 3531 pParty->sub_421B2C_PlaceInInventory_or_DropPickedItem(); |
3532 return; | 3532 return; |
3533 } | 3533 } |
3534 if ( (char)a5 < 0 ) | 3534 if ( (char)a5 < 0 ) |
3546 } | 3546 } |
3547 if ( HIBYTE(a5) & 1 ) | 3547 if ( HIBYTE(a5) & 1 ) |
3548 { | 3548 { |
3549 if ( pGUIWindow_Settings ) | 3549 if ( pGUIWindow_Settings ) |
3550 return; | 3550 return; |
3551 pGUIWindow_Settings = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_CastSpell, (int)&pCastSpellInfo[result], 0); | 3551 pGUIWindow_Settings = new OnCastTargetedSpell(0, 0, window->GetWidth(), window->GetHeight(), (int)&pCastSpellInfo[result], 0); |
3552 pGUIWindow_Settings->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_CastSpell_Character_Small_Improvement, 0, 0x31u, "", 0); | 3552 pGUIWindow_Settings->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_CastSpell_Character_Small_Improvement, 0, 0x31u, "", 0); |
3553 pGUIWindow_Settings->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_CastSpell_Character_Small_Improvement, 1, 0x32u, "", 0); | 3553 pGUIWindow_Settings->CreateButton(0xA5u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_CastSpell_Character_Small_Improvement, 1, 0x32u, "", 0); |
3554 pGUIWindow_Settings->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_CastSpell_Character_Small_Improvement, 2, 0x33u, "", 0); | 3554 pGUIWindow_Settings->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_CastSpell_Character_Small_Improvement, 2, 0x33u, "", 0); |
3555 pGUIWindow_Settings->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_CastSpell_Character_Small_Improvement, 3, 0x34u, "", 0); | 3555 pGUIWindow_Settings->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, UIMSG_CastSpell_Character_Small_Improvement, 3, 0x34u, "", 0); |
3556 pGUIWindow_Settings->CreateButton(8, 8, game_viewport_width, game_viewport_height, 1, 0, UIMSG_CastSpell_Monster_Improvement, 0, 0, "", NULL); | 3556 pGUIWindow_Settings->CreateButton(8, 8, game_viewport_width, game_viewport_height, 1, 0, UIMSG_CastSpell_Monster_Improvement, 0, 0, "", NULL); |
3557 pParty->sub_421B2C_PlaceInInventory_or_DropPickedItem(); | 3557 pParty->sub_421B2C_PlaceInInventory_or_DropPickedItem(); |
3558 } | 3558 } |
3559 if ( HIBYTE(a5) & 2 && !pGUIWindow_Settings ) | 3559 if ( HIBYTE(a5) & 2 && !pGUIWindow_Settings ) |
3560 { | 3560 { |
3561 pGUIWindow_Settings = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_CastSpell, (int)&pCastSpellInfo[result], 0); | 3561 pGUIWindow_Settings = new OnCastTargetedSpell(0, 0, window->GetWidth(), window->GetHeight(), (int)&pCastSpellInfo[result], 0); |
3562 pBtn_NPCLeft = pGUIWindow_Settings->CreateButton(469, 178, | 3562 pBtn_NPCLeft = pGUIWindow_Settings->CreateButton(469, 178, |
3563 pIcons_LOD->GetTexture(uTextureID_Btn_NPCLeft)->uTextureWidth, | 3563 pIcons_LOD->GetTexture(uTextureID_Btn_NPCLeft)->uTextureWidth, |
3564 pIcons_LOD->GetTexture(uTextureID_Btn_NPCLeft)->uTextureHeight, | 3564 pIcons_LOD->GetTexture(uTextureID_Btn_NPCLeft)->uTextureHeight, |
3565 1, 0, UIMSG_ScrollNPCPanel, 0, 0, "", | 3565 1, 0, UIMSG_ScrollNPCPanel, 0, 0, "", |
3566 pIcons_LOD->GetTexture(uTextureID_Btn_NPCLeft), 0); | 3566 pIcons_LOD->GetTexture(uTextureID_Btn_NPCLeft), 0); |