Changed icon
This commit is contained in:
@@ -16,6 +16,10 @@ DataModelInstance::DataModelInstance(void)
|
||||
mouseButton1Down = false;
|
||||
showMessage = false;
|
||||
canDelete = false;
|
||||
winMessage = "You Won!";
|
||||
loseMessage = "You Lost. Try Again";
|
||||
timer = 60.0F;
|
||||
score = 0;
|
||||
}
|
||||
|
||||
DataModelInstance::~DataModelInstance(void)
|
||||
@@ -69,3 +73,59 @@ Instance* DataModelInstance::getGuiRoot()
|
||||
{
|
||||
return guiRoot;
|
||||
}
|
||||
|
||||
char timerTxt[12];
|
||||
char scoreTxt[12];
|
||||
std::vector<PROPGRIDITEM> DataModelInstance::getProperties()
|
||||
{
|
||||
std::vector<PROPGRIDITEM> properties = Instance::getProperties();
|
||||
|
||||
|
||||
|
||||
properties.push_back(createPGI("Messages",
|
||||
"WinMessage",
|
||||
"The message that shows when the player wins.",
|
||||
(LPARAM)winMessage.c_str(),
|
||||
PIT_EDIT));
|
||||
properties.push_back(createPGI("Messages",
|
||||
"LoseMessage",
|
||||
"The message that shows when the player loses.",
|
||||
(LPARAM)loseMessage.c_str(),
|
||||
PIT_EDIT));
|
||||
|
||||
|
||||
sprintf(timerTxt, "%g", timer);
|
||||
sprintf(scoreTxt, "%d", score);
|
||||
properties.push_back(createPGI("Gameplay",
|
||||
"InitialTimerValue",
|
||||
"The ammount of time in seconds the player has to complete this level.\r\n\r\nPut 0 if time is limitless.",
|
||||
(LPARAM)timerTxt,
|
||||
PIT_EDIT));
|
||||
properties.push_back(createPGI("Gameplay",
|
||||
"InitialScoreValue",
|
||||
"The ammount of points the player starts with.",
|
||||
(LPARAM)scoreTxt,
|
||||
PIT_EDIT));
|
||||
return properties;
|
||||
}
|
||||
void DataModelInstance::PropUpdate(LPPROPGRIDITEM &pItem)
|
||||
{
|
||||
if(strcmp(pItem->lpszPropName, "InitialTimerValue") == 0)
|
||||
{
|
||||
timer = atoi((LPSTR)pItem->lpCurValue);
|
||||
}
|
||||
if(strcmp(pItem->lpszPropName, "InitialScoreValue") == 0)
|
||||
{
|
||||
score = atof((LPSTR)pItem->lpCurValue);
|
||||
}
|
||||
if(strcmp(pItem->lpszPropName, "LoseMessage") == 0)
|
||||
{
|
||||
loseMessage = (LPSTR)pItem->lpCurValue;
|
||||
}
|
||||
if(strcmp(pItem->lpszPropName, "WinMessage") == 0)
|
||||
{
|
||||
winMessage = (LPSTR)pItem->lpCurValue;
|
||||
}
|
||||
else
|
||||
Instance::PropUpdate(pItem);
|
||||
}
|
||||
Reference in New Issue
Block a user