parent
a48e0f71e9
commit
168fc15b31
32
menu.ino
32
menu.ino
|
@ -160,3 +160,35 @@ void buildDrugMenu(const long extra[6]) {
|
||||||
menuCols = true;
|
menuCols = true;
|
||||||
menuSmall = col1Max + col2Max > 22;
|
menuSmall = col1Max + col2Max > 22;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int getMenuBackOut() {
|
||||||
|
// this whole thing could have been done so much better :(
|
||||||
|
// i suck at C++
|
||||||
|
switch (sGameState) {
|
||||||
|
case STATE_SELL_MENU:
|
||||||
|
case STATE_BORROW_INPUT:
|
||||||
|
case STATE_WITHDRAW_INPUT:
|
||||||
|
return 1;
|
||||||
|
case STATE_INVENTORY:
|
||||||
|
return 2;
|
||||||
|
case STATE_JET_MENU:
|
||||||
|
return 3;
|
||||||
|
case STATE_SHARK_MENU:
|
||||||
|
return 4;
|
||||||
|
case STATE_BANK_MENU:
|
||||||
|
return 5;
|
||||||
|
case STATE_BUY_QTY_INPUT:
|
||||||
|
case STATE_SELL_QTY_INPUT:
|
||||||
|
return sCurrentDrug;
|
||||||
|
case STATE_INFO_DIALOG:
|
||||||
|
switch (sPreviousGameState) {
|
||||||
|
case STATE_BUY_MENU:
|
||||||
|
case STATE_SELL_MENU:
|
||||||
|
return sCurrentDrug;
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
13
slangin.ino
13
slangin.ino
|
@ -198,6 +198,7 @@ void loop() {
|
||||||
buildDrugMenu(sDrugPrices);
|
buildDrugMenu(sDrugPrices);
|
||||||
drawMenu(menuSmall, menuCols, menuLength, menu);
|
drawMenu(menuSmall, menuCols, menuLength, menu);
|
||||||
drawMenuIndicator(menuSelected, menuSmall, menuCols, menuLength, menu, false);
|
drawMenuIndicator(menuSelected, menuSmall, menuCols, menuLength, menu, false);
|
||||||
|
drawDrugsOwned(menuSelected);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case STATE_JET_MENU: {
|
case STATE_JET_MENU: {
|
||||||
|
@ -437,6 +438,9 @@ void loop() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
drawMenuIndicator(menuSelected, menuSmall, menuCols, menuLength, menu, false);
|
drawMenuIndicator(menuSelected, menuSmall, menuCols, menuLength, menu, false);
|
||||||
|
if (sGameState == STATE_BUY_MENU || sGameState == STATE_SELL_MENU) {
|
||||||
|
drawDrugsOwned(menuSelected);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -669,3 +673,12 @@ void drawFightPrompt() {
|
||||||
arduboy.drawCircle(67, 58, 5, WHITE);
|
arduboy.drawCircle(67, 58, 5, WHITE);
|
||||||
arduboy.drawCircle(103, 58, 5, WHITE);
|
arduboy.drawCircle(103, 58, 5, WHITE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void drawDrugsOwned(Drug drug) {
|
||||||
|
// wipe old indicator
|
||||||
|
arduboy.fillRect(60, 9, 68, 12, BLACK);
|
||||||
|
String numStr = String(pInventory[drug]);
|
||||||
|
font3x5.setCursor(92 - numStr.length() * 4, 13);
|
||||||
|
font3x5.print("You own ");
|
||||||
|
font3x5.print(numStr);
|
||||||
|
}
|
||||||
|
|
32
states.ino
32
states.ino
|
@ -192,38 +192,6 @@ void newDayRandomEvent() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int getMenuBackOut() {
|
|
||||||
// this whole thing could have been done so much better :(
|
|
||||||
// i suck at C++
|
|
||||||
switch (sGameState) {
|
|
||||||
case STATE_SELL_MENU:
|
|
||||||
case STATE_BORROW_INPUT:
|
|
||||||
case STATE_WITHDRAW_INPUT:
|
|
||||||
return 1;
|
|
||||||
case STATE_INVENTORY:
|
|
||||||
return 2;
|
|
||||||
case STATE_JET_MENU:
|
|
||||||
return 3;
|
|
||||||
case STATE_SHARK_MENU:
|
|
||||||
return 4;
|
|
||||||
case STATE_BANK_MENU:
|
|
||||||
return 5;
|
|
||||||
case STATE_BUY_QTY_INPUT:
|
|
||||||
case STATE_SELL_QTY_INPUT:
|
|
||||||
return sCurrentDrug;
|
|
||||||
case STATE_INFO_DIALOG:
|
|
||||||
switch (sPreviousGameState) {
|
|
||||||
case STATE_BUY_MENU:
|
|
||||||
case STATE_SELL_MENU:
|
|
||||||
return sCurrentDrug;
|
|
||||||
default:
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void handleMenuAction() {
|
void handleMenuAction() {
|
||||||
screenInitialized = false;
|
screenInitialized = false;
|
||||||
switch (sGameState) {
|
switch (sGameState) {
|
||||||
|
|
Loading…
Reference in New Issue