-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved MI_PacksField to a separate file
- Loading branch information
Showing
10 changed files
with
67 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#include "MI_PacksField.h" | ||
|
||
#include "FileList.h" | ||
#include "input.h" | ||
|
||
|
||
MI_PacksField::MI_PacksField(gfxSprite* nspr, short x, short y, std::string name, short width, short indent, SimpleFileList* pList, MenuCodeEnum code) | ||
: MI_AnnouncerField(nspr, x, y, std::move(name), width, indent, pList) | ||
, itemChangedCode(code) | ||
{} | ||
|
||
|
||
MenuCodeEnum MI_PacksField::SendInput(CPlayerInput* playerInput) | ||
{ | ||
int iLastIndex = list->GetCurrentIndex(); | ||
MenuCodeEnum code = MI_AnnouncerField::SendInput(playerInput); | ||
|
||
if (MENU_CODE_UNSELECT_ITEM == code) | ||
return code; | ||
|
||
MenuCodeEnum returnCode = MENU_CODE_NONE; | ||
if (iLastIndex != list->GetCurrentIndex()) | ||
returnCode = itemChangedCode; | ||
|
||
for (int iPlayer = 0; iPlayer < 4; iPlayer++) { | ||
if (playerInput->outputControls[iPlayer].menu_right.fPressed || playerInput->outputControls[iPlayer].menu_down.fPressed) | ||
return returnCode; | ||
|
||
if (playerInput->outputControls[iPlayer].menu_left.fPressed || playerInput->outputControls[iPlayer].menu_up.fPressed) | ||
return returnCode; | ||
|
||
if (playerInput->outputControls[iPlayer].menu_random.fPressed) | ||
return returnCode; | ||
} | ||
|
||
return MENU_CODE_NONE; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#pragma once | ||
|
||
#include "MI_AnnouncerField.h" | ||
|
||
|
||
class MI_PacksField : public MI_AnnouncerField { | ||
public: | ||
MI_PacksField(gfxSprite* nspr, short x, short y, std::string name, short width, short indent, SimpleFileList* pList, MenuCodeEnum code); | ||
|
||
MenuCodeEnum SendInput(CPlayerInput * playerInput) override; | ||
|
||
private: | ||
const MenuCodeEnum itemChangedCode = MENU_CODE_NONE; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters