Merge branch 'master' of github.com:FacialTurd/PowderToypp

This commit is contained in:
build.powdertoy.co.uk 2012-07-19 18:08:34 +01:00
commit d328b84b13
136 changed files with 860 additions and 194 deletions

View File

@ -211,11 +211,31 @@ void Client::notifyUpdateAvailable()
}
}
void Client::notifyAuthUserChanged()
{
for (std::vector<ClientListener*>::iterator iterator = listeners.begin(), end = listeners.end(); iterator != end; ++iterator)
{
(*iterator)->NotifyAuthUserChanged(this);
}
}
void Client::AddListener(ClientListener * listener)
{
listeners.push_back(listener);
}
void Client::RemoveListener(ClientListener * listener)
{
for (std::vector<ClientListener*>::iterator iterator = listeners.begin(), end = listeners.end(); iterator != end; ++iterator)
{
if((*iterator) == listener)
{
listeners.erase(iterator);
return;
}
}
}
void Client::Shutdown()
{
ClearThumbnailRequests();
@ -256,6 +276,7 @@ Client::~Client()
void Client::SetAuthUser(User user)
{
authUser = user;
notifyAuthUserChanged();
}
User Client::GetAuthUser()
@ -664,6 +685,67 @@ failure:
return RequestFailure;
}
RequestStatus Client::AddComment(int saveID, std::string comment)
{
lastError = "";
std::vector<string> * tags = NULL;
std::stringstream urlStream;
char * data = NULL;
int dataStatus, dataLength;
urlStream << "http://" << SERVER << "/Browse/Comments.json?ID=" << saveID << "&Key=" << authUser.SessionKey;
if(authUser.ID)
{
std::stringstream userIDStream;
userIDStream << authUser.ID;
char * postNames[] = { "Comment", NULL };
char * postDatas[] = { (char*)(comment.c_str()) };
int postLengths[] = { comment.length() };
data = http_multipart_post((char *)urlStream.str().c_str(), postNames, postDatas, postLengths, (char *)(userIDStream.str().c_str()), NULL, (char *)(authUser.SessionID.c_str()), &dataStatus, &dataLength);
}
else
{
lastError = "Not authenticated";
return RequestFailure;
}
if(dataStatus == 200 && data)
{
try
{
std::istringstream dataStream(data);
json::Object objDocument;
json::Reader::Read(objDocument, dataStream);
int status = ((json::Number)objDocument["Status"]).Value();
if(status!=1)
{
lastError = ((json::Number)objDocument["Error"]).Value();
}
if(status!=1)
goto failure;
}
catch (json::Exception &e)
{
lastError = "Could not read response";
goto failure;
}
}
else
{
lastError = http_ret_text(dataStatus);
goto failure;
}
if(data)
free(data);
return RequestOkay;
failure:
if(data)
free(data);
return RequestFailure;
}
RequestStatus Client::FavouriteSave(int saveID, bool favourite)
{
lastError = "";

View File

@ -67,6 +67,7 @@ private:
void updateStamps();
static vector<std::string> explodePropertyString(std::string property);
void notifyUpdateAvailable();
void notifyAuthUserChanged();
//Config file handle
json::Object configDocument;
@ -79,6 +80,7 @@ public:
~Client();
void AddListener(ClientListener * listener);
void RemoveListener(ClientListener * listener);
RequestStatus ExecVote(int saveID, int direction);
RequestStatus UploadSave(SaveInfo * save);
@ -90,6 +92,8 @@ public:
int GetStampsCount();
SaveFile * GetFirstStamp();
RequestStatus AddComment(int saveID, std::string comment);
unsigned char * GetSaveData(int saveID, int saveDate, int & dataLength);
LoginStatus Login(string username, string password, User & user);
void ClearThumbnailRequests();

View File

@ -16,6 +16,7 @@ public:
virtual ~ClientListener() {}
virtual void NotifyUpdateAvailable(Client * sender) {}
virtual void NotifyAuthUserChanged(Client * sender) {}
};

View File

@ -16,8 +16,8 @@ public:
unsigned char Blue;
unsigned char Alpha;
DecorationTool(ToolType decoMode_, string name, int r, int g, int b):
Tool(0, name, r, g, b),
DecorationTool(ToolType decoMode_, string name, string description, int r, int g, int b):
Tool(0, name, description, r, g, b),
decoMode(decoMode_),
Red(0),
Green(0),

View File

@ -402,6 +402,15 @@ void GameController::Exit()
HasDone = true;
}
void GameController::LoadRenderPreset(RenderPreset preset)
{
Renderer * renderer = gameModel->GetRenderer();
gameModel->SetInfoTip(preset.Name);
renderer->SetRenderMode(preset.RenderModes);
renderer->SetDisplayMode(preset.DisplayModes);
renderer->SetColourMode(preset.ColourMode);
}
void GameController::Update()
{
ui::Point pos = gameView->GetMousePosition();
@ -681,7 +690,18 @@ void GameController::NotifyUpdateAvailable(Client * sender)
}
};
gameModel->AddNotification(new UpdateNotification(this, "A new version is available - click here to download"));
switch(sender->GetUpdateInfo().Type)
{
case UpdateInfo::Snapshot:
gameModel->AddNotification(new UpdateNotification(this, std::string("A new snapshot is available - click here to update")));
break;
case UpdateInfo::Stable:
gameModel->AddNotification(new UpdateNotification(this, std::string("A new version is available - click here to update")));
break;
case UpdateInfo::Beta:
gameModel->AddNotification(new UpdateNotification(this, std::string("A new beta is available - click here to update")));
break;
}
}
void GameController::RemoveNotification(Notification * notification)

View File

@ -17,6 +17,7 @@
#include "cat/LuaScriptInterface.h"
#include "options/OptionsController.h"
#include "client/ClientListener.h"
#include "RenderPreset.h"
#include "Menu.h"
using namespace std;
@ -63,6 +64,7 @@ public:
void Tick();
void Exit();
void LoadRenderPreset(RenderPreset preset);
void SetZoomEnabled(bool zoomEnable);
void SetZoomPosition(ui::Point position);
void AdjustBrushSize(int direction, bool logarithmic = false);

View File

@ -61,7 +61,15 @@ GameModel::GameModel():
{
if(sim->elements[i].MenuSection < 12 && sim->elements[i].Enabled && sim->elements[i].MenuVisible)
{
Tool * tempTool = new ElementTool(i, sim->elements[i].Name, PIXR(sim->elements[i].Colour), PIXG(sim->elements[i].Colour), PIXB(sim->elements[i].Colour));
Tool * tempTool;
if(i == PT_LIGH)
{
tempTool = new Element_LIGH_Tool(i, sim->elements[i].Name, sim->elements[i].Description, PIXR(sim->elements[i].Colour), PIXG(sim->elements[i].Colour), PIXB(sim->elements[i].Colour));
}
else
{
tempTool = new ElementTool(i, sim->elements[i].Name, sim->elements[i].Description, PIXR(sim->elements[i].Colour), PIXG(sim->elements[i].Colour), PIXB(sim->elements[i].Colour));
}
menuList[sim->elements[i].MenuSection]->AddTool(tempTool);
}
}
@ -69,14 +77,14 @@ GameModel::GameModel():
//Build menu for GOL types
for(int i = 0; i < NGOL; i++)
{
Tool * tempTool = new GolTool(i, sim->gmenu[i].name, PIXR(sim->gmenu[i].colour), PIXG(sim->gmenu[i].colour), PIXB(sim->gmenu[i].colour));
Tool * tempTool = new GolTool(i, sim->gmenu[i].name, std::string(sim->gmenu[i].description), PIXR(sim->gmenu[i].colour), PIXG(sim->gmenu[i].colour), PIXB(sim->gmenu[i].colour));
menuList[SC_LIFE]->AddTool(tempTool);
}
//Build other menus from wall data
for(int i = 0; i < UI_WALLCOUNT; i++)
{
Tool * tempTool = new WallTool(i, "", PIXR(sim->wtypes[i].colour), PIXG(sim->wtypes[i].colour), PIXB(sim->wtypes[i].colour));
Tool * tempTool = new WallTool(i, "", std::string(sim->wtypes[i].descs), PIXR(sim->wtypes[i].colour), PIXG(sim->wtypes[i].colour), PIXB(sim->wtypes[i].colour));
menuList[SC_WALL]->AddTool(tempTool);
//sim->wtypes[i]
}
@ -88,17 +96,18 @@ GameModel::GameModel():
//Build menu for simtools
for(int i = 0; i < sim->tools.size(); i++)
{
Tool * tempTool = new Tool(i, sim->tools[i]->Name, PIXR(sim->tools[i]->Colour), PIXG(sim->tools[i]->Colour), PIXB(sim->tools[i]->Colour));
Tool * tempTool;
tempTool = new Tool(i, sim->tools[i]->Name, sim->tools[i]->Description, PIXR(sim->tools[i]->Colour), PIXG(sim->tools[i]->Colour), PIXB(sim->tools[i]->Colour));
menuList[SC_TOOL]->AddTool(tempTool);
}
//Add decoration tools to menu
menuList[SC_DECO]->AddTool(new DecorationTool(DecorationTool::BlendAdd, "ADD", 0, 0, 0));
menuList[SC_DECO]->AddTool(new DecorationTool(DecorationTool::BlendRemove, "SUB", 0, 0, 0));
menuList[SC_DECO]->AddTool(new DecorationTool(DecorationTool::BlendMultiply, "MUL", 0, 0, 0));
menuList[SC_DECO]->AddTool(new DecorationTool(DecorationTool::BlendDivide, "DIV", 0, 0, 0));
menuList[SC_DECO]->AddTool(new DecorationTool(DecorationTool::BlendSmudge, "SMDG", 0, 0, 0));
menuList[SC_DECO]->AddTool(new DecorationTool(DecorationTool::BlendSet, "SET", 0, 0, 0));
menuList[SC_DECO]->AddTool(new DecorationTool(DecorationTool::BlendAdd, "ADD", "Colour blending: Add", 0, 0, 0));
menuList[SC_DECO]->AddTool(new DecorationTool(DecorationTool::BlendRemove, "SUB", "Colour blending: Subtract", 0, 0, 0));
menuList[SC_DECO]->AddTool(new DecorationTool(DecorationTool::BlendMultiply, "MUL", "Colour blending: Multiply", 0, 0, 0));
menuList[SC_DECO]->AddTool(new DecorationTool(DecorationTool::BlendDivide, "DIV", "Colour blending: Divide" , 0, 0, 0));
menuList[SC_DECO]->AddTool(new DecorationTool(DecorationTool::BlendSmudge, "SMDG", "Smudge colour", 0, 0, 0));
menuList[SC_DECO]->AddTool(new DecorationTool(DecorationTool::BlendSet, "SET", "Set colour (No blending)", 0, 0, 0));
//Set default brush palette
brushList.push_back(new EllipseBrush(ui::Point(4, 4)));
@ -517,6 +526,28 @@ void GameModel::RemoveNotification(Notification * notification)
notifyNotificationsChanged();
}
void GameModel::SetToolTip(std::string text)
{
toolTip = text;
notifyToolTipChanged();
}
void GameModel::SetInfoTip(std::string text)
{
infoTip = text;
notifyInfoTipChanged();
}
std::string GameModel::GetToolTip()
{
return toolTip;
}
std::string GameModel::GetInfoTip()
{
return infoTip;
}
void GameModel::notifyNotificationsChanged()
{
for(std::vector<GameView*>::iterator iter = observers.begin(); iter != observers.end(); ++iter)
@ -644,3 +675,19 @@ void GameModel::notifyLogChanged(string entry)
observers[i]->NotifyLogChanged(this, entry);
}
}
void GameModel::notifyInfoTipChanged()
{
for(int i = 0; i < observers.size(); i++)
{
observers[i]->NotifyInfoTipChanged(this);
}
}
void GameModel::notifyToolTipChanged()
{
for(int i = 0; i < observers.size(); i++)
{
observers[i]->NotifyToolTipChanged(this);
}
}

View File

@ -53,6 +53,9 @@ private:
User currentUser;
bool colourSelector;
ui::Colour colour;
std::string infoTip;
std::string toolTip;
//bool zoomEnabled;
void notifyRendererChanged();
void notifySimulationChanged();
@ -71,6 +74,8 @@ private:
void notifyColourSelectorVisibilityChanged();
void notifyNotificationsChanged();
void notifyLogChanged(string entry);
void notifyInfoTipChanged();
void notifyToolTipChanged();
public:
GameModel();
~GameModel();
@ -81,6 +86,11 @@ public:
void SetColourSelectorColour(ui::Colour colour);
ui::Colour GetColourSelectorColour();
void SetToolTip(std::string text);
void SetInfoTip(std::string text);
std::string GetToolTip();
std::string GetInfoTip();
void SetVote(int direction);
SaveInfo * GetSave();
Brush * GetBrush();

View File

@ -33,7 +33,11 @@ GameView::GameView():
placeSaveThumb(NULL),
mousePosition(0, 0),
lastOffset(0),
drawSnap(false)
drawSnap(false),
toolTip(""),
infoTip(""),
infoTipPresence(0),
toolTipPosition(-1, -1)
{
int currentX = 1;
@ -255,6 +259,59 @@ GameView::GameView():
tempButton->Appearance.Margin = ui::Border(0, 2, 3, 2);
tempButton->SetActionCallback(new ElementSearchAction(this));
AddComponent(tempButton);
//Render mode presets. Possibly load from config in future?
renderModePresets = new RenderPreset[10];
renderModePresets[0].Name = "Alternative Velocity Display";
renderModePresets[0].RenderModes.push_back(RENDER_EFFE);
renderModePresets[0].RenderModes.push_back(RENDER_BASC);
renderModePresets[0].DisplayModes.push_back(DISPLAY_AIRC);
renderModePresets[1].Name = "Velocity Display";
renderModePresets[1].RenderModes.push_back(RENDER_EFFE);
renderModePresets[1].RenderModes.push_back(RENDER_BASC);
renderModePresets[1].DisplayModes.push_back(DISPLAY_AIRV);
renderModePresets[2].Name = "Pressure Display";
renderModePresets[2].RenderModes.push_back(RENDER_EFFE);
renderModePresets[2].RenderModes.push_back(RENDER_BASC);
renderModePresets[2].DisplayModes.push_back(DISPLAY_AIRP);
renderModePresets[3].Name = "Persistent Display";
renderModePresets[3].RenderModes.push_back(RENDER_EFFE);
renderModePresets[3].RenderModes.push_back(RENDER_BASC);
renderModePresets[3].DisplayModes.push_back(DISPLAY_PERS);
renderModePresets[4].Name = "Fire Display";
renderModePresets[4].RenderModes.push_back(RENDER_FIRE);
renderModePresets[4].RenderModes.push_back(RENDER_EFFE);
renderModePresets[4].RenderModes.push_back(RENDER_BASC);
renderModePresets[5].Name = "Blob Display";
renderModePresets[5].RenderModes.push_back(RENDER_FIRE);
renderModePresets[5].RenderModes.push_back(RENDER_EFFE);
renderModePresets[5].RenderModes.push_back(RENDER_BLOB);
renderModePresets[6].Name = "Heat Display";
renderModePresets[6].RenderModes.push_back(RENDER_BASC);
renderModePresets[6].DisplayModes.push_back(DISPLAY_AIRH);
renderModePresets[6].ColourMode = COLOUR_HEAT;
renderModePresets[7].Name = "Fancy Display";
renderModePresets[7].RenderModes.push_back(RENDER_FIRE);
renderModePresets[7].RenderModes.push_back(RENDER_GLOW);
renderModePresets[7].RenderModes.push_back(RENDER_BLUR);
renderModePresets[7].RenderModes.push_back(RENDER_EFFE);
renderModePresets[7].RenderModes.push_back(RENDER_BASC);
renderModePresets[7].DisplayModes.push_back(DISPLAY_WARP);
renderModePresets[8].Name = "Nothing Display";
renderModePresets[8].RenderModes.push_back(RENDER_BASC);
renderModePresets[9].Name = "Heat Gradient Display";
renderModePresets[9].RenderModes.push_back(RENDER_BASC);
renderModePresets[9].ColourMode = COLOUR_GRAD;
}
class GameView::MenuAction: public ui::ButtonAction
@ -308,7 +365,7 @@ void GameView::NotifyMenuListChanged(GameModel * sender)
std::string tempString = "";
Menu * item = *iter;
tempString += item->GetIcon();
ui::Button * tempButton = new ui::Button(ui::Point(XRES+BARSIZE-16, currentY), ui::Point(15, 15), tempString);
ui::Button * tempButton = new ui::Button(ui::Point(XRES+BARSIZE-16, currentY), ui::Point(15, 15), tempString, item->GetDescription());
tempButton->Appearance.Margin = ui::Border(0, 2, 3, 2);
tempButton->SetTogglable(true);
tempButton->SetActionCallback(new MenuAction(this, item));
@ -379,7 +436,7 @@ void GameView::NotifyToolListChanged(GameModel * sender)
for(int i = 0; i < toolList.size(); i++)
{
//ToolButton * tempButton = new ToolButton(ui::Point(XRES+1, currentY), ui::Point(28, 15), toolList[i]->GetName());
ToolButton * tempButton = new ToolButton(ui::Point(currentX, YRES+1), ui::Point(30, 18), toolList[i]->GetName());
ToolButton * tempButton = new ToolButton(ui::Point(currentX, YRES+1), ui::Point(30, 18), toolList[i]->GetName(), toolList[i]->GetDescription());
//currentY -= 17;
currentX -= 31;
tempButton->SetActionCallback(new ToolAction(this, toolList[i]));
@ -467,6 +524,17 @@ void GameView::NotifyPausedChanged(GameModel * sender)
pauseButton->SetToggleState(sender->GetPaused());
}
void GameView::NotifyToolTipChanged(GameModel * sender)
{
toolTip = sender->GetToolTip();
}
void GameView::NotifyInfoTipChanged(GameModel * sender)
{
infoTip = sender->GetInfoTip();
infoTipPresence = 120;
}
void GameView::NotifySaveChanged(GameModel * sender)
{
if(sender->GetSave())
@ -675,6 +743,12 @@ void GameView::OnMouseUp(int x, int y, unsigned button)
}
}
void GameView::ToolTip(ui::Component * sender, ui::Point mousePosition, std::string toolTip)
{
this->toolTip = toolTip;
toolTipPosition = ui::Point(Size.X-27-Graphics::textwidth((char*)toolTip.c_str()), Size.Y-MENUSIZE-10);
}
void GameView::OnMouseWheel(int x, int y, int d)
{
if(!d)
@ -819,6 +893,11 @@ void GameView::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool
c->AdjustBrushSize(-1, true);
break;
}
if(key >= '0' && key <= '9')
{
c->LoadRenderPreset(renderModePresets[key-'0']);
}
}
void GameView::OnKeyRelease(int key, Uint16 character, bool shift, bool ctrl, bool alt)
@ -864,6 +943,12 @@ void GameView::OnTick(float dt)
{
c->DrawFill(toolIndex, currentMouse);
}
if(infoTipPresence>0)
{
infoTipPresence -= int(dt)>0?int(dt):1;
if(infoTipPresence<0)
infoTipPresence = 0;
}
c->Update();
if(lastLogEntry > -0.1f)
lastLogEntry -= 0.16*dt;
@ -975,16 +1060,18 @@ void GameView::NotifyNotificationsChanged(GameModel * sender)
}
};
for(std::vector<ui::Component*>::iterator iter = notificationComponents.begin(); iter != notificationComponents.end(); ++iter) {
RemoveComponent(*iter);
delete *iter;
for(std::vector<ui::Component*>::const_iterator iter = notificationComponents.begin(), end = notificationComponents.end(); iter != end; ++iter) {
ui::Component * cNotification = *iter;
RemoveComponent(cNotification);
delete cNotification;
}
notificationComponents.clear();
std::vector<Notification*> notifications = sender->GetNotifications();
int currentY = YRES-17;
for(std::vector<Notification*>::iterator iter = notifications.begin(); iter != notifications.end(); ++iter)
for(std::vector<Notification*>::iterator iter = notifications.begin(), end = notifications.end(); iter != end; ++iter)
{
int width = (Graphics::textwidth((*iter)->Message.c_str()))+8;
ui::Button * tempButton = new ui::Button(ui::Point(XRES-width-22, currentY), ui::Point(width, 15), (*iter)->Message);
@ -1046,13 +1133,7 @@ void GameView::OnDraw()
if(ren)
{
ren->clearScreen(1.0f);
ren->draw_air();
ren->render_parts();
ren->render_fire();
ren->draw_grav();
ren->DrawWalls();
ren->DrawSigns();
ren->FinaliseParts();
ren->RenderBegin();
if(activeBrush && currentMouse.X > 0 && currentMouse.X < XRES && currentMouse.Y > 0 && currentMouse.Y < YRES)
{
ui::Point finalCurrentMouse = c->PointTranslate(currentMouse);
@ -1082,7 +1163,7 @@ void GameView::OnDraw()
activeBrush->RenderPoint(g, finalCurrentMouse);
}
}
ren->RenderZoom();
ren->RenderEnd();
if(selectMode!=SelectNone)
{
@ -1167,6 +1248,17 @@ void GameView::OnDraw()
sampleInfo << ", Ctype: " << c->ElementResolve(sample.ctype);
g->drawtext(XRES+BARSIZE-(10+Graphics::textwidth((char*)sampleInfo.str().c_str())), 10, (const char*)sampleInfo.str().c_str(), 255, 255, 255, 255);
if(infoTipPresence)
{
int infoTipAlpha = (infoTipPresence>50?50:infoTipPresence)*5;
g->drawtext((XRES-Graphics::textwidth((char*)infoTip.c_str()))/2, (YRES/2)-2, (char*)infoTip.c_str(), 255, 255, 255, infoTipAlpha);
}
if(toolTipPosition.X!=-1 && toolTipPosition.Y!=-1 && toolTip.length())
{
g->drawtext(toolTipPosition.X, toolTipPosition.Y, (char*)toolTip.c_str(), 255, 255, 255, 255);
}
}
ui::Point GameView::lineSnapCoords(ui::Point point1, ui::Point point2)

View File

@ -12,6 +12,7 @@
#include "interface/Button.h"
#include "interface/Slider.h"
#include "ToolButton.h"
#include "RenderPreset.h"
#include "Brush.h"
using namespace std;
@ -37,6 +38,12 @@ private:
bool zoomCursorFixed;
bool drawSnap;
int toolIndex;
int infoTipPresence;
std::string toolTip;
ui::Point toolTipPosition;
std::string infoTip;
queue<ui::Point*> pointQueue;
GameController * c;
Renderer * ren;
@ -76,6 +83,8 @@ private:
ui::Point mousePosition;
RenderPreset * renderModePresets;
Thumbnail * placeSaveThumb;
Particle sample;
@ -108,6 +117,11 @@ public:
void NotifyPlaceSaveChanged(GameModel * sender);
void NotifyNotificationsChanged(GameModel * sender);
void NotifyLogChanged(GameModel * sender, string entry);
void NotifyToolTipChanged(GameModel * sender);
void NotifyInfoTipChanged(GameModel * sender);
virtual void ToolTip(ui::Component * sender, ui::Point mousePosition, std::string toolTip);
virtual void OnMouseMove(int x, int y, int dx, int dy);
virtual void OnMouseDown(int x, int y, unsigned button);
virtual void OnMouseUp(int x, int y, unsigned button);

19
src/game/RenderPreset.h Normal file
View File

@ -0,0 +1,19 @@
#ifndef RENDER_PRESET_H
#define RENDER_PRESET_H
class RenderPreset
{
public:
std::string Name;
std::vector<unsigned int> RenderModes;
std::vector<unsigned int> DisplayModes;
unsigned int ColourMode;
RenderPreset(): Name(""), ColourMode(0) {}
RenderPreset(std::string name, std::vector<unsigned int> renderModes, std::vector<unsigned int> displayModes, unsigned int colourMode):
Name(name),
RenderModes(renderModes),
DisplayModes(displayModes),
ColourMode(colourMode)
{}
};
#endif

View File

@ -12,15 +12,17 @@
using namespace std;
Tool::Tool(int id, string name, int r, int g, int b):
Tool::Tool(int id, string name, string description, int r, int g, int b):
toolID(id),
toolName(name),
toolDescription(description),
colRed(r),
colGreen(g),
colBlue(b)
{
}
string Tool::GetName() { return toolName; }
string Tool::GetDescription() { return toolDescription; }
Tool::~Tool() {}
void Tool::Click(Simulation * sim, Brush * brush, ui::Point position) { }
void Tool::Draw(Simulation * sim, Brush * brush, ui::Point position) {
@ -34,8 +36,8 @@ void Tool::DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Po
}
void Tool::DrawFill(Simulation * sim, Brush * brush, ui::Point position) {};
ElementTool::ElementTool(int id, string name, int r, int g, int b):
Tool(id, name, r, g, b)
ElementTool::ElementTool(int id, string name, string description, int r, int g, int b):
Tool(id, name, description, r, g, b)
{
}
ElementTool::~ElementTool() {}
@ -53,8 +55,8 @@ void ElementTool::DrawFill(Simulation * sim, Brush * brush, ui::Point position)
}
WallTool::WallTool(int id, string name, int r, int g, int b):
Tool(id, name, r, g, b)
WallTool::WallTool(int id, string name, string description, int r, int g, int b):
Tool(id, name, description, r, g, b)
{
}
WallTool::~WallTool() {}
@ -72,8 +74,8 @@ void WallTool::DrawFill(Simulation * sim, Brush * brush, ui::Point position) {
}
GolTool::GolTool(int id, string name, int r, int g, int b):
Tool(id, name, r, g, b)
GolTool::GolTool(int id, string name, string description, int r, int g, int b):
Tool(id, name, description, r, g, b)
{
}
GolTool::~GolTool() {}
@ -90,5 +92,14 @@ void GolTool::DrawFill(Simulation * sim, Brush * brush, ui::Point position) {
sim->FloodParts(position.X, position.Y, PT_LIFE|(toolID<<8), -1, -1, 0);
}
void Element_LIGH_Tool::Draw(Simulation * sim, Brush * brush, ui::Point position)
{
int p = sim->create_part(-2, position.X, position.Y, toolID);
if (p != -1)
{
sim->parts[p].life = brush->GetRadius().X+brush->GetRadius().Y;
if (sim->parts[p].life > 55)
sim->parts[p].life = 55;
sim->parts[p].temp = sim->parts[p].life*150; // temperature of the lighting shows the power of the lighting
}
}

View File

@ -22,9 +22,11 @@ class Tool
protected:
int toolID;
string toolName;
string toolDescription;
public:
Tool(int id, string name, int r, int g, int b);
Tool(int id, string name, string description, int r, int g, int b);
string GetName();
string GetDescription();
virtual ~Tool();
virtual void Click(Simulation * sim, Brush * brush, ui::Point position);
virtual void Draw(Simulation * sim, Brush * brush, ui::Point position);
@ -38,7 +40,7 @@ class SignTool: public Tool
{
public:
SignTool():
Tool(0, "SIGN", 0, 0, 0)
Tool(0, "SIGN", "Sign. Click a sign to edit or anywhere else to create a new one", 0, 0, 0)
{
}
virtual ~SignTool() {}
@ -53,7 +55,7 @@ class PropertyTool: public Tool
{
public:
PropertyTool():
Tool(0, "PROP", 0, 0, 0)
Tool(0, "PROP", "Property Edit. Click to alter the properties of elements in the field", 0, 0, 0)
{
}
virtual ~PropertyTool() {}
@ -64,10 +66,25 @@ public:
virtual void DrawFill(Simulation * sim, Brush * brush, ui::Point position) { }
};
class Element_LIGH_Tool: public Tool
{
public:
Element_LIGH_Tool(int id, string name, string description, int r, int g, int b):
Tool(id, name, description, r, g, b)
{
}
virtual ~Element_LIGH_Tool() {}
virtual void Draw(Simulation * sim, Brush * brush, ui::Point position);
virtual void Click(Simulation * sim, Brush * brush, ui::Point position) { }
virtual void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) { }
virtual void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) { }
virtual void DrawFill(Simulation * sim, Brush * brush, ui::Point position) { }
};
class ElementTool: public Tool
{
public:
ElementTool(int id, string name, int r, int g, int b);
ElementTool(int id, string name, string description, int r, int g, int b);
virtual ~ElementTool();
virtual void Draw(Simulation * sim, Brush * brush, ui::Point position);
virtual void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2);
@ -78,7 +95,7 @@ public:
class WallTool: public Tool
{
public:
WallTool(int id, string name, int r, int g, int b);
WallTool(int id, string name, string description, int r, int g, int b);
virtual ~WallTool();
virtual void Draw(Simulation * sim, Brush * brush, ui::Point position);
virtual void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2);
@ -89,7 +106,7 @@ public:
class GolTool: public Tool
{
public:
GolTool(int id, string name, int r, int g, int b);
GolTool(int id, string name, string description, int r, int g, int b);
virtual ~GolTool();
virtual void Draw(Simulation * sim, Brush * brush, ui::Point position);
virtual void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2);

View File

@ -8,8 +8,8 @@
#include "ToolButton.h"
#include "interface/Keys.h"
ToolButton::ToolButton(ui::Point position, ui::Point size, std::string text_):
ui::Button(position, size, text_)
ToolButton::ToolButton(ui::Point position, ui::Point size, std::string text_, std::string toolTip):
ui::Button(position, size, text_, toolTip)
{
SetSelectionState(-1);
Appearance.BorderActive = ui::Colour(255, 0, 0);

View File

@ -13,7 +13,7 @@
class ToolButton: public ui::Button {
int currentSelection;
public:
ToolButton(ui::Point position, ui::Point size, std::string text_);
ToolButton(ui::Point position, ui::Point size, std::string text_, std::string toolTip = "");
virtual void OnMouseUp(int x, int y, unsigned int button);
virtual void OnMouseClick(int x, int y, unsigned int button);
virtual void Draw(const ui::Point& screenPos);

View File

@ -35,6 +35,29 @@ extern "C"
#define drawrect(args) g->drawrect(args)
#endif
void Renderer::RenderBegin()
{
draw_air();
render_parts();
render_fire();
draw_grav();
DrawWalls();
DrawSigns();
#ifndef OGLR
RenderZoom();
FinaliseParts();
#endif
}
void Renderer::RenderEnd()
{
#ifdef OGLR
RenderZoom();
FinaliseParts();
#endif
}
void Renderer::clearScreen(float alpha)
{
#ifdef OGLR
@ -245,7 +268,7 @@ void Renderer::FinaliseParts()
}
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDisable( GL_TEXTURE_2D );
#else
#elif defined(OGLI)
g->draw_image(vid, 0, 0, VIDXRES, VIDYRES, 255);
#endif
}
@ -254,7 +277,7 @@ void Renderer::RenderZoom()
{
if(!zoomEnabled)
return;
#ifdef OGLR
#if defined(OGLR)
int sdl_scale = 1;
int origBlendSrc, origBlendDst;
float zcx1, zcx0, zcy1, zcy0, yfactor, xfactor, i; //X-Factor is shit, btw
@ -344,8 +367,8 @@ void Renderer::RenderZoom()
int x, y, i, j;
pixel pix;
pixel * img = vid;
drawrect(zoomWindowPosition.X-2, zoomWindowPosition.Y-2, zoomScopeSize*ZFACTOR+2, zoomScopeSize*ZFACTOR+2, 192, 192, 192, 255);
drawrect(zoomWindowPosition.X-1, zoomWindowPosition.Y-1, zoomScopeSize*ZFACTOR, zoomScopeSize*ZFACTOR, 0, 0, 0, 255);
drawrect(zoomWindowPosition.X-2, zoomWindowPosition.Y-2, zoomScopeSize*ZFACTOR+4, zoomScopeSize*ZFACTOR+4, 192, 192, 192, 255);
drawrect(zoomWindowPosition.X-1, zoomWindowPosition.Y-1, zoomScopeSize*ZFACTOR+2, zoomScopeSize*ZFACTOR+2, 0, 0, 0, 255);
clearrect(zoomWindowPosition.X, zoomWindowPosition.Y, zoomScopeSize*ZFACTOR, zoomScopeSize*ZFACTOR);
for (j=0; j<zoomScopeSize; j++)
for (i=0; i<zoomScopeSize; i++)
@ -617,6 +640,8 @@ void Renderer::render_gravlensing()
void Renderer::render_fire()
{
#ifndef OGLR
if(!(render_mode & FIREMODE))
return;
int i,j,x,y,r,g,b,nx,ny;
for (j=0; j<YRES/CELL; j++)
for (i=0; i<XRES/CELL; i++)
@ -2093,9 +2118,24 @@ Renderer::Renderer(Graphics * g, Simulation * sim):
void Renderer::CompileRenderMode()
{
int old_render_mode = render_mode;
render_mode = 0;
for(int i = 0; i < render_modes.size(); i++)
render_mode |= render_modes[i];
//If firemode is removed, clear the fire display
if(!(render_mode & FIREMODE) && (old_render_mode & FIREMODE))
{
ClearAccumulation();
}
}
void Renderer::ClearAccumulation()
{
//Fire
std::fill(fire_r[0]+0, fire_r[(YRES/CELL)-1]+((XRES/CELL)-1), 0);
std::fill(fire_g[0]+0, fire_g[(YRES/CELL)-1]+((XRES/CELL)-1), 0);
std::fill(fire_b[0]+0, fire_b[(YRES/CELL)-1]+((XRES/CELL)-1), 0);
}
void Renderer::AddRenderMode(unsigned int mode)

View File

@ -55,6 +55,9 @@ public:
int ZFACTOR;
//Renderers
void RenderBegin();
void RenderEnd();
void RenderZoom();
void DrawWalls();
void DrawSigns();
@ -67,6 +70,8 @@ public:
void draw_grav();
void draw_other();
void FinaliseParts();
void ClearAccumulation();
void clearScreen(float alpha);
//class SolidsRenderer;

View File

@ -13,7 +13,7 @@
namespace ui {
Button::Button(Point position, Point size, std::string buttonText):
Button::Button(Point position, Point size, std::string buttonText, std::string toolTip):
Component(position, size),
ButtonText(buttonText),
isMouseInside(false),
@ -21,7 +21,8 @@ Button::Button(Point position, Point size, std::string buttonText):
isTogglable(false),
toggle(false),
actionCallback(NULL),
Enabled(true)
Enabled(true),
toolTip(toolTip)
{
TextPosition();
}
@ -141,6 +142,10 @@ void Button::OnMouseEnter(int x, int y)
return;
if(actionCallback)
actionCallback->MouseEnterCallback(this);
if(toolTip.length()>0 && GetParentWindow())
{
GetParentWindow()->ToolTip(this, ui::Point(x, y), toolTip);
}
}

View File

@ -27,7 +27,7 @@ public:
class Button : public Component
{
public:
Button(Point position = Point(0, 0), Point size = Point(0, 0), std::string buttonText = "");
Button(Point position = Point(0, 0), Point size = Point(0, 0), std::string buttonText = "", std::string toolTip = "");
virtual ~Button();
bool Toggleable;
@ -55,6 +55,7 @@ public:
void SetIcon(Icon icon);
protected:
std::string toolTip;
std::string buttonDisplayText;
std::string ButtonText;

View File

@ -79,7 +79,7 @@ void Component::TextPosition(std::string displayText)
switch(Appearance.VerticalAlign)
{
case ui::Appearance::AlignTop:
textPosition.Y = Appearance.Margin.Top;
textPosition.Y = Appearance.Margin.Top+2;
break;
case ui::Appearance::AlignMiddle:
textPosition.Y = Appearance.Margin.Top+((textAreaHeight-textHeight)/2);

View File

@ -8,13 +8,15 @@
using namespace ui;
Textbox::Textbox(Point position, Point size, std::string textboxText):
Textbox::Textbox(Point position, Point size, std::string textboxText, std::string textboxPlaceholder):
Label(position, size, ""),
actionCallback(NULL),
masked(false),
border(true),
mouseDown(false)
{
placeHolder = textboxPlaceholder;
SetText(textboxText);
cursor = text.length();
}
@ -25,6 +27,11 @@ Textbox::~Textbox()
delete actionCallback;
}
void Textbox::SetPlaceholder(std::string text)
{
placeHolder = text;
}
void Textbox::SetText(std::string newText)
{
backingText = newText;
@ -40,11 +47,11 @@ void Textbox::SetText(std::string newText)
if(cursor)
{
cursorPosition = Graphics::textnwidth((char *)text.c_str(), cursor);
Graphics::PositionAtCharIndex(multiline?((char*)textLines.c_str()):((char*)text.c_str()), cursor, cursorPositionX, cursorPositionY);
}
else
{
cursorPosition = 0;
cursorPositionY = cursorPositionX = 0;
}
}
@ -173,25 +180,25 @@ void Textbox::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool
if(cursor)
{
cursorPosition = Graphics::textnwidth((char *)text.c_str(), cursor);
Graphics::PositionAtCharIndex(multiline?((char*)textLines.c_str()):((char*)text.c_str()), cursor, cursorPositionX, cursorPositionY);
}
else
{
cursorPosition = 0;
cursorPositionY = cursorPositionX = 0;
}
}
void Textbox::OnMouseClick(int x, int y, unsigned button)
{
mouseDown = true;
cursor = Graphics::CharIndexAtPosition((char*)text.c_str(), x-textPosition.X, y-textPosition.Y);
cursor = Graphics::CharIndexAtPosition(multiline?((char*)textLines.c_str()):((char*)text.c_str()), x-textPosition.X, y-textPosition.Y);
if(cursor)
{
cursorPosition = Graphics::textnwidth((char *)text.c_str(), cursor);
Graphics::PositionAtCharIndex(multiline?((char*)textLines.c_str()):((char*)text.c_str()), cursor, cursorPositionX, cursorPositionY);
}
else
{
cursorPosition = 0;
cursorPositionY = cursorPositionX = 0;
}
Label::OnMouseClick(x, y, button);
}
@ -206,14 +213,14 @@ void Textbox::OnMouseMoved(int localx, int localy, int dx, int dy)
{
if(mouseDown)
{
cursor = Graphics::CharIndexAtPosition((char*)text.c_str(), localx-textPosition.X, localy-textPosition.Y);
cursor = Graphics::CharIndexAtPosition(multiline?((char*)textLines.c_str()):((char*)text.c_str()), localx-textPosition.X, localy-textPosition.Y);
if(cursor)
{
cursorPosition = Graphics::textnwidth((char *)text.c_str(), cursor);
Graphics::PositionAtCharIndex(multiline?((char*)textLines.c_str()):((char*)text.c_str()), cursor, cursorPositionX, cursorPositionY);
}
else
{
cursorPosition = 0;
cursorPositionY = cursorPositionX = 0;
}
}
Label::OnMouseMoved(localx, localy, dx, dy);
@ -227,10 +234,14 @@ void Textbox::Draw(const Point& screenPos)
if(IsFocused())
{
if(border) g->drawrect(screenPos.X, screenPos.Y, Size.X, Size.Y, 255, 255, 255, 255);
g->draw_line(screenPos.X+textPosition.X+cursorPosition, screenPos.Y+3, screenPos.X+textPosition.X+cursorPosition, screenPos.Y+12, 255, 255, 255, XRES+BARSIZE);
g->draw_line(screenPos.X+textPosition.X+cursorPositionX+1, screenPos.Y-2+textPosition.Y+cursorPositionY, screenPos.X+textPosition.X+cursorPositionX+1, screenPos.Y+10+textPosition.Y+cursorPositionY, 255, 255, 255, XRES+BARSIZE);
}
else
{
if(!text.length())
{
g->drawtext(screenPos.X+textPosition.X, screenPos.Y+textPosition.Y, placeHolder, textColour.Red, textColour.Green, textColour.Blue, 170);
}
if(border) g->drawrect(screenPos.X, screenPos.Y, Size.X, Size.Y, 160, 160, 160, 255);
}
}

View File

@ -22,17 +22,20 @@ class Textbox : public Label
protected:
bool mouseDown;
bool masked, border;
int cursor, cursorPosition;
int cursor, cursorPositionX, cursorPositionY;
TextboxAction *actionCallback;
std::string backingText;
std::string placeHolder;
public:
Textbox(Point position, Point size, std::string textboxText);
Textbox(Point position, Point size, std::string textboxText = "", std::string textboxPlaceholder = "");
virtual ~Textbox();
virtual void SetDisplayText(std::string text);
virtual void SetText(std::string text);
virtual std::string GetText();
virtual void SetPlaceholder(std::string text);
void SetBorder(bool border) { this->border = border; };
void SetHidden(bool hidden) { masked = hidden; }
bool GetHidden() { return masked; }

View File

@ -46,6 +46,8 @@ enum ChromeStyle
// Remove a component from state. NOTE: This WILL free component from memory.
void RemoveComponent(unsigned idx);
virtual void ToolTip(Component * sender, ui::Point mousePosition, std::string toolTip) {}
virtual void DoInitialized();
virtual void DoExit();
virtual void DoTick(float dt);

View File

@ -7,6 +7,7 @@
#include "LoginController.h"
#include "client/User.h"
#include "client/Client.h"
LoginController::LoginController(ControllerCallback * callback):
HasExited(false)
@ -40,6 +41,10 @@ void LoginController::Exit()
}
if(callback)
callback->ControllerExit();
else
{
Client::Ref().SetAuthUser(loginModel->GetUser());
}
HasExited = true;
}

View File

@ -12,11 +12,13 @@
#include "PreviewModel.h"
#include "PreviewModelException.h"
#include "dialogues/ErrorMessage.h"
#include "login/LoginController.h"
#include "Controller.h"
PreviewController::PreviewController(int saveID, ControllerCallback * callback):
HasExited(false),
saveId(saveID)
saveId(saveID),
loginWindow(NULL)
{
previewModel = new PreviewModel();
previewView = new PreviewView();
@ -25,11 +27,24 @@ PreviewController::PreviewController(int saveID, ControllerCallback * callback):
previewModel->UpdateSave(saveID, 0);
if(Client::Ref().GetAuthUser().ID)
{
previewModel->SetCommentBoxEnabled(true);
}
Client::Ref().AddListener(this);
this->callback = callback;
}
void PreviewController::Update()
{
if(loginWindow && loginWindow->HasExited == true)
{
delete loginWindow;
loginWindow = NULL;
}
try
{
previewModel->Update();
@ -45,6 +60,37 @@ void PreviewController::Update()
}
}
void PreviewController::SubmitComment(std::string comment)
{
if(comment.length() < 4)
{
new ErrorMessage("Error", "Comment is too short");
}
else
{
RequestStatus status = Client::Ref().AddComment(saveId, comment);
if(status != RequestOkay)
{
new ErrorMessage("Error Submitting comment", Client::Ref().GetLastError());
}
else
{
previewModel->UpdateComments(1);
}
}
}
void PreviewController::ShowLogin()
{
loginWindow = new LoginController();
ui::Engine::Ref().ShowWindow(loginWindow->GetView());
}
void PreviewController::NotifyAuthUserChanged(Client * sender)
{
previewModel->SetCommentBoxEnabled(sender->GetAuthUser().ID);
}
SaveInfo * PreviewController::GetSave()
{
return previewModel->GetSave();
@ -114,6 +160,7 @@ PreviewController::~PreviewController() {
{
ui::Engine::Ref().CloseWindow();
}
Client::Ref().RemoveListener(this);
delete previewModel;
delete previewView;
if(callback)

View File

@ -12,26 +12,33 @@
#include "preview/PreviewView.h"
#include "Controller.h"
#include "client/SaveInfo.h"
#include "client/ClientListener.h"
class LoginController;
class PreviewModel;
class PreviewView;
class PreviewController {
class PreviewController: public ClientListener {
int saveId;
PreviewModel * previewModel;
PreviewView * previewView;
LoginController * loginWindow;
ControllerCallback * callback;
public:
virtual void NotifyAuthUserChanged(Client * sender);
bool HasExited;
PreviewController(int saveID, ControllerCallback * callback);
void Exit();
void DoOpen();
void OpenInBrowser();
void Report(std::string message);
void ShowLogin();
bool GetDoOpen();
SaveInfo * GetSave();
PreviewView * GetView() { return previewView; }
void Update();
void FavouriteSave();
void SubmitComment(std::string comment);
void NextCommentPage();
void PrevCommentPage();

View File

@ -21,7 +21,8 @@ PreviewModel::PreviewModel():
updateSaveCommentsWorking(false),
updateSaveCommentsFinished(false),
commentsTotal(0),
commentsPageNumber(1)
commentsPageNumber(1),
commentBoxEnabled(false)
{
// TODO Auto-generated constructor stub
@ -77,6 +78,20 @@ void PreviewModel::SetFavourite(bool favourite)
}
}
bool PreviewModel::GetCommentBoxEnabled()
{
return commentBoxEnabled;
}
void PreviewModel::SetCommentBoxEnabled(bool enabledState)
{
if(enabledState != commentBoxEnabled)
{
commentBoxEnabled = enabledState;
notifyCommentBoxEnabledChanged();
}
}
void PreviewModel::UpdateSave(int saveID, int saveDate)
{
this->tSaveID = saveID;
@ -189,6 +204,14 @@ void PreviewModel::notifySaveChanged()
}
}
void PreviewModel::notifyCommentBoxEnabledChanged()
{
for(int i = 0; i < observers.size(); i++)
{
observers[i]->NotifyCommentBoxEnabledChanged(this);
}
}
void PreviewModel::notifyCommentsPageChanged()
{
for(int i = 0; i < observers.size(); i++)
@ -210,6 +233,7 @@ void PreviewModel::AddObserver(PreviewView * observer) {
observer->NotifySaveChanged(this);
observer->NotifyCommentsChanged(this);
observer->NotifyCommentsPageChanged(this);
observer->NotifyCommentBoxEnabledChanged(this);
}
void PreviewModel::Update()

View File

@ -27,6 +27,7 @@ struct SaveData
class PreviewView;
class PreviewModel {
bool doOpen;
bool commentBoxEnabled;
vector<PreviewView*> observers;
SaveInfo * save;
vector<char> saveDataBuffer;
@ -34,6 +35,7 @@ class PreviewModel {
void notifySaveChanged();
void notifySaveCommentsChanged();
void notifyCommentsPageChanged();
void notifyCommentBoxEnabledChanged();
//Background retrieval
int tSaveID;
@ -66,6 +68,9 @@ public:
SaveInfo * GetSave();
std::vector<SaveComment*> * GetComments();
bool GetCommentBoxEnabled();
void SetCommentBoxEnabled(bool enabledState);
bool GetCommentsLoaded();
int GetCommentsPageNum();
int GetCommentsPageCount();

View File

@ -13,9 +13,42 @@
#include "simulation/SaveRenderer.h"
#include "interface/Point.h"
#include "interface/Window.h"
#include "interface/Textbox.h"
#include "Style.h"
#include "search/Thumbnail.h"
class PreviewView::LoginAction: public ui::ButtonAction
{
PreviewView * v;
public:
LoginAction(PreviewView * v_){ v = v_; }
virtual void ActionCallback(ui::Button * sender)
{
v->c->ShowLogin();
}
};
class PreviewView::SubmitCommentAction: public ui::ButtonAction
{
PreviewView * v;
public:
SubmitCommentAction(PreviewView * v_){ v = v_; }
virtual void ActionCallback(ui::Button * sender)
{
v->submitComment();
}
};
class PreviewView::AutoCommentSizeAction: public ui::TextboxAction
{
PreviewView * v;
public:
AutoCommentSizeAction(PreviewView * v): v(v) {}
virtual void TextChangedCallback(ui::Textbox * sender) {
v->commentBoxAutoHeight();
}
};
PreviewView::PreviewView():
ui::Window(ui::Point(-1, -1), ui::Point((XRES/2)+200, (YRES/2)+150)),
savePreview(NULL),
@ -24,7 +57,10 @@ PreviewView::PreviewView():
commentsVel(0),
maxOffset(0),
commentsBegin(true),
commentsEnd(false)
commentsEnd(false),
addCommentBox(NULL),
submitCommentButton(NULL),
commentBoxHeight(20)
{
class OpenAction: public ui::ButtonAction
{
@ -118,11 +154,42 @@ PreviewView::PreviewView():
authorDateLabel->Appearance.HorizontalAlign = ui::Appearance::AlignLeft; authorDateLabel->Appearance.VerticalAlign = ui::Appearance::AlignBottom;
AddComponent(authorDateLabel);
pageInfo = new ui::Label(ui::Point((XRES/2) + 5, Size.Y-15), ui::Point(Size.X-((XRES/2) + 10), 15), "Page 1 of 1");
pageInfo = new ui::Label(ui::Point((XRES/2) + 5, Size.Y+1), ui::Point(Size.X-((XRES/2) + 10), 15), "Page 1 of 1");
pageInfo->Appearance.HorizontalAlign = ui::Appearance::AlignCentre; authorDateLabel->Appearance.VerticalAlign = ui::Appearance::AlignMiddle;
AddComponent(pageInfo);
}
void PreviewView::commentBoxAutoHeight()
{
if(!addCommentBox)
return;
int textWidth = Graphics::textwidth(addCommentBox->GetText().c_str());
if(textWidth+5 > Size.X-(XRES/2)-48)
{
commentBoxHeight = 58;
addCommentBox->SetMultiline(true);
addCommentBox->Appearance.VerticalAlign = ui::Appearance::AlignTop;
commentBoxPositionX = (XRES/2)+4;
commentBoxPositionY = Size.Y-58;
commentBoxSizeX = Size.X-(XRES/2)-8;
commentBoxSizeY = 37;
}
else
{
commentBoxHeight = 20;
addCommentBox->SetMultiline(false);
addCommentBox->Appearance.VerticalAlign = ui::Appearance::AlignMiddle;
commentBoxPositionX = (XRES/2)+4;
commentBoxPositionY = Size.Y-19;
commentBoxSizeX = Size.X-(XRES/2)-48;
commentBoxSizeY = 17;
}
displayComments(commentsOffset);
}
void PreviewView::DoDraw()
{
Window::DoDraw();
@ -149,7 +216,7 @@ void PreviewView::OnDraw()
g->draw_image(savePreview->Data, (Position.X+1)+(((XRES/2)-savePreview->Size.X)/2), (Position.Y+1)+(((YRES/2)-savePreview->Size.Y)/2), savePreview->Size.X, savePreview->Size.Y, 255);
}
g->drawrect(Position.X, Position.Y, (XRES/2)+1, (YRES/2)+1, 255, 255, 255, 100);
g->draw_line(Position.X+XRES/2, Position.Y+1, Position.X+XRES/2, Position.Y+Size.Y-2, 200, 200, 200, 255);
g->draw_line(Position.X+1+XRES/2, Position.Y+1, Position.X+XRES/2, Position.Y+Size.Y-2, 200, 200, 200, 255);
g->draw_line(Position.X+1, Position.Y+12+YRES/2, Position.X-1+XRES/2, Position.Y+12+YRES/2, 100, 100, 100,255);
@ -213,6 +280,42 @@ void PreviewView::OnTick(float dt)
displayComments(commentsOffset);
}
if(addCommentBox)
{
ui::Point positionDiff = ui::Point(commentBoxPositionX, commentBoxPositionY)-addCommentBox->Position;
ui::Point sizeDiff = ui::Point(commentBoxSizeX, commentBoxSizeY)-addCommentBox->Size;
if(positionDiff.X!=0)
{
int xdiff = positionDiff.X/5;
if(xdiff == 0)
xdiff = 1*isign(positionDiff.X);
addCommentBox->Position.X += xdiff;
}
if(positionDiff.Y!=0)
{
int ydiff = positionDiff.Y/5;
if(ydiff == 0)
ydiff = 1*isign(positionDiff.Y);
addCommentBox->Position.Y += ydiff;
}
if(sizeDiff.X!=0)
{
int xdiff = sizeDiff.X/5;
if(xdiff == 0)
xdiff = 1*isign(sizeDiff.X);
addCommentBox->Size.X += xdiff;
}
if(sizeDiff.Y!=0)
{
int ydiff = sizeDiff.Y/5;
if(ydiff == 0)
ydiff = 1*isign(sizeDiff.Y);
addCommentBox->Size.Y += ydiff;
}
}
c->Update();
}
@ -269,6 +372,23 @@ void PreviewView::NotifySaveChanged(PreviewModel * sender)
}
}
void PreviewView::submitComment()
{
if(addCommentBox)
{
std::string comment = std::string(addCommentBox->GetText());
submitCommentButton->Enabled = false;
addCommentBox->SetText("");
addCommentBox->SetPlaceholder("Submitting comment");
FocusComponent(NULL);
c->SubmitComment(comment);
addCommentBox->SetPlaceholder("Add comment");
submitCommentButton->Enabled = true;
}
}
void PreviewView::displayComments(int yOffset)
{
for(int i = 0; i < commentComponents.size(); i++)
@ -289,10 +409,10 @@ void PreviewView::displayComments(int yOffset)
tempUsername->Appearance.HorizontalAlign = ui::Appearance::AlignLeft; tempUsername->Appearance.VerticalAlign = ui::Appearance::AlignBottom;
currentY += 16;
if(currentY > Size.Y || usernameY < 0)
if(currentY+5 > Size.Y-commentBoxHeight || usernameY < 0)
{
delete tempUsername;
if(currentY > Size.Y)
if(currentY+5 > Size.Y-commentBoxHeight)
break;
}
else
@ -308,10 +428,10 @@ void PreviewView::displayComments(int yOffset)
tempComment->SetTextColour(ui::Colour(180, 180, 180));
currentY += tempComment->Size.Y+4;
if(currentY > Size.Y || commentY < 0)
if(currentY+5 > Size.Y-commentBoxHeight || commentY < 0)
{
delete tempComment;
if(currentY > Size.Y)
if(currentY+5 > Size.Y-commentBoxHeight)
break;
}
else
@ -323,6 +443,44 @@ void PreviewView::displayComments(int yOffset)
}
}
void PreviewView::NotifyCommentBoxEnabledChanged(PreviewModel * sender)
{
if(addCommentBox)
{
RemoveComponent(addCommentBox);
addCommentBox = NULL;
delete addCommentBox;
}
if(submitCommentButton)
{
RemoveComponent(submitCommentButton);
submitCommentButton = NULL;
delete submitCommentButton;
}
if(sender->GetCommentBoxEnabled())
{
commentBoxPositionX = (XRES/2)+4;
commentBoxPositionY = Size.Y-19;
commentBoxSizeX = Size.X-(XRES/2)-48;
commentBoxSizeY = 17;
addCommentBox = new ui::Textbox(ui::Point((XRES/2)+4, Size.Y-19), ui::Point(Size.X-(XRES/2)-48, 17), "", "Add Comment");
addCommentBox->SetActionCallback(new AutoCommentSizeAction(this));
addCommentBox->Appearance.HorizontalAlign = ui::Appearance::AlignLeft;
AddComponent(addCommentBox);
submitCommentButton = new ui::Button(ui::Point(Size.X-40, Size.Y-19), ui::Point(40, 19), "Submit");
submitCommentButton->SetActionCallback(new SubmitCommentAction(this));
//submitCommentButton->Enabled = false;
AddComponent(submitCommentButton);
}
else
{
submitCommentButton = new ui::Button(ui::Point(XRES/2, Size.Y-19), ui::Point(Size.X-(XRES/2), 19), "Login to comment");
submitCommentButton->SetActionCallback(new LoginAction(this));
AddComponent(submitCommentButton);
}
}
void PreviewView::NotifyCommentsPageChanged(PreviewModel * sender)
{
std::stringstream pageInfoStream;
@ -361,7 +519,7 @@ void PreviewView::NotifyCommentsChanged(PreviewModel * sender)
}
maxOffset = (maxY-Size.Y)+16;
maxOffset = (maxY-(Size.Y-commentBoxHeight))+16;
commentsBegin = true;
commentsEnd = false;
commentsOffset = 0;

View File

@ -16,16 +16,22 @@
#include "interface/Button.h"
#include "search/Thumbnail.h"
#include "interface/Label.h"
#include "interface/Textbox.h"
class PreviewModel;
class PreviewController;
class PreviewView: public ui::Window {
class SubmitCommentAction;
class LoginAction;
class AutoCommentSizeAction;
PreviewController * c;
Thumbnail * savePreview;
ui::Button * openButton;
ui::Button * browserOpenButton;
ui::Button * favButton;
ui::Button * reportButton;
ui::Button * submitCommentButton;
ui::Textbox * addCommentBox;
ui::Label * saveNameLabel;
ui::Label * authorDateLabel;
ui::Label * pageInfo;
@ -43,13 +49,22 @@ class PreviewView: public ui::Window {
float commentsOffset;
float commentsVel;
int commentBoxHeight;
float commentBoxPositionX;
float commentBoxPositionY;
float commentBoxSizeX;
float commentBoxSizeY;
void displayComments(int yOffset);
void commentBoxAutoHeight();
void submitComment();
public:
void AttachController(PreviewController * controller) { c = controller;}
PreviewView();
void NotifySaveChanged(PreviewModel * sender);
void NotifyCommentsChanged(PreviewModel * sender);
void NotifyCommentsPageChanged(PreviewModel * sender);
void NotifyCommentBoxEnabledChanged(PreviewModel * sender);
virtual void OnDraw();
virtual void DoDraw();
virtual void OnTick(float dt);

View File

@ -240,13 +240,8 @@ void RenderView::OnDraw()
if(ren)
{
ren->clearScreen(1.0f);
ren->draw_air();
ren->render_parts();
ren->render_fire();
ren->draw_grav();
ren->DrawWalls();
ren->DrawSigns();
ren->FinaliseParts();
ren->RenderBegin();
ren->RenderEnd();
}
g->draw_line(0, YRES, XRES-1, YRES, 255, 255, 255, XRES+BARSIZE);
g->draw_line(180, YRES, 180, YRES+MENUSIZE, 200, 200, 200, XRES+BARSIZE);

View File

@ -55,9 +55,12 @@ Thumbnail * SaveRenderer::Render(GameSave * save)
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo);
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
ren->clearScreen(1.0f);
ren->render_parts();
ren->FinaliseParts();
ren->ClearAccumulation();
ren->RenderBegin();
ren->RenderEnd();
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
glTranslated(0, -MENUSIZE, 0);
@ -90,8 +93,10 @@ Thumbnail * SaveRenderer::Render(GameSave * save)
pixel * pData = NULL;
pixel * dst;
pixel * src = g->vid;
ren->render_parts();
ren->FinaliseParts();
ren->ClearAccumulation();
ren->RenderBegin();
ren->RenderEnd();
pData = (pixel *)malloc(PIXELSIZE * ((width*CELL)*(height*CELL)));
dst = pData;

View File

@ -43,7 +43,7 @@ Element_116::Element_116()
HighTemperatureTransition = NT;
Update = NULL;
Graphics = NULL;
}
Element_116::~Element_116() {}

View File

@ -43,7 +43,7 @@ Element_146::Element_146()
HighTemperatureTransition = NT;
Update = NULL;
Graphics = NULL;
}
Element_146::~Element_146() {}

View File

@ -43,7 +43,7 @@ Element_147::Element_147()
HighTemperatureTransition = NT;
Update = NULL;
Graphics = NULL;
}
Element_147::~Element_147() {}

View File

@ -43,7 +43,7 @@ Element_AMTR::Element_AMTR()
HighTemperatureTransition = NT;
Update = &Element_AMTR::update;
Graphics = NULL;
}
//#TPT-Directive ElementHeader Element_AMTR static int update(UPDATE_FUNC_ARGS)

View File

@ -43,7 +43,7 @@ Element_ANAR::Element_ANAR()
HighTemperatureTransition = NT;
Update = &Element_ANAR::update;
Graphics = NULL;
}
//#TPT-Directive ElementHeader Element_ANAR static int update(UPDATE_FUNC_ARGS)

View File

@ -43,7 +43,7 @@ Element_ARAY::Element_ARAY()
HighTemperatureTransition = NT;
Update = &Element_ARAY::update;
Graphics = NULL;
}
//#TPT-Directive ElementHeader Element_ARAY static int update(UPDATE_FUNC_ARGS)

View File

@ -43,7 +43,7 @@ Element_BANG::Element_BANG()
HighTemperatureTransition = NT;
Update = &Element_BANG::update;
Graphics = NULL;
}
//#TPT-Directive ElementHeader Element_BANG static int update(UPDATE_FUNC_ARGS)

View File

@ -43,7 +43,7 @@ Element_BCLN::Element_BCLN()
HighTemperatureTransition = NT;
Update = &Element_BCLN::update;
Graphics = NULL;
}
//#TPT-Directive ElementHeader Element_BCLN static int update(UPDATE_FUNC_ARGS)

View File

@ -43,7 +43,7 @@ Element_BGLA::Element_BGLA()
HighTemperatureTransition = PT_LAVA;
Update = NULL;
Graphics = NULL;
}
Element_BGLA::~Element_BGLA() {}

View File

@ -43,7 +43,7 @@ Element_BHOL::Element_BHOL()
HighTemperatureTransition = NT;
Update = NULL;
Graphics = NULL;
}
Element_BHOL::~Element_BHOL() {}

View File

@ -43,7 +43,7 @@ Element_BMTL::Element_BMTL()
HighTemperatureTransition = PT_LAVA;
Update = &Element_BMTL::update;
Graphics = NULL;
}
//#TPT-Directive ElementHeader Element_BMTL static int update(UPDATE_FUNC_ARGS)

View File

@ -43,7 +43,7 @@ Element_BOYL::Element_BOYL()
HighTemperatureTransition = NT;
Update = &Element_BOYL::update;
Graphics = NULL;
}
//#TPT-Directive ElementHeader Element_BOYL static int update(UPDATE_FUNC_ARGS)

View File

@ -43,7 +43,7 @@ Element_BRCK::Element_BRCK()
HighTemperatureTransition = PT_LAVA;
Update = NULL;
Graphics = NULL;
}
Element_BRCK::~Element_BRCK() {}

View File

@ -43,7 +43,7 @@ Element_BREC::Element_BREC()
HighTemperatureTransition = NT;
Update = &Element_BREC::update;
Graphics = NULL;
}
//#TPT-Directive ElementHeader Element_BREC static int update(UPDATE_FUNC_ARGS)

View File

@ -43,7 +43,7 @@ Element_BRMT::Element_BRMT()
HighTemperatureTransition = PT_LAVA;
Update = &Element_BRMT::update;
Graphics = NULL;
}
//#TPT-Directive ElementHeader Element_BRMT static int update(UPDATE_FUNC_ARGS)

View File

@ -43,7 +43,7 @@ Element_BTRY::Element_BTRY()
HighTemperatureTransition = PT_PLSM;
Update = &Element_BTRY::update;
Graphics = NULL;
}
//#TPT-Directive ElementHeader Element_BTRY static int update(UPDATE_FUNC_ARGS)

View File

@ -43,7 +43,7 @@ Element_C5::Element_C5()
HighTemperatureTransition = NT;
Update = &Element_C5::update;
Graphics = NULL;
}
//#TPT-Directive ElementHeader Element_C5 static int update(UPDATE_FUNC_ARGS)

View File

@ -43,7 +43,7 @@ Element_CAUS::Element_CAUS()
HighTemperatureTransition = NT;
Update = &Element_CAUS::update;
Graphics = NULL;
}
//#TPT-Directive ElementHeader Element_CAUS static int update(UPDATE_FUNC_ARGS)

View File

@ -43,7 +43,7 @@ Element_CLNE::Element_CLNE()
HighTemperatureTransition = NT;
Update = &Element_CLNE::update;
Graphics = NULL;
}
//#TPT-Directive ElementHeader Element_CLNE static int update(UPDATE_FUNC_ARGS)

View File

@ -43,7 +43,7 @@ Element_CNCT::Element_CNCT()
HighTemperatureTransition = PT_LAVA;
Update = NULL;
Graphics = NULL;
}
Element_CNCT::~Element_CNCT() {}

View File

@ -43,7 +43,7 @@ Element_CO2::Element_CO2()
HighTemperatureTransition = NT;
Update = &Element_CO2::update;
Graphics = NULL;
}
//#TPT-Directive ElementHeader Element_CO2 static int update(UPDATE_FUNC_ARGS)

View File

@ -43,7 +43,7 @@ Element_CONV::Element_CONV()
HighTemperatureTransition = NT;
Update = &Element_CONV::update;
Graphics = NULL;
}
//#TPT-Directive ElementHeader Element_CONV static int update(UPDATE_FUNC_ARGS)

View File

@ -43,7 +43,7 @@ Element_DESL::Element_DESL()
HighTemperatureTransition = PT_FIRE;
Update = NULL;
Graphics = NULL;
}
Element_DESL::~Element_DESL() {}

View File

@ -43,7 +43,7 @@ Element_DMND::Element_DMND()
HighTemperatureTransition = NT;
Update = NULL;
Graphics = NULL;
}
Element_DMND::~Element_DMND() {}

View File

@ -43,7 +43,7 @@ Element_DRIC::Element_DRIC()
HighTemperatureTransition = PT_CO2;
Update = NULL;
Graphics = NULL;
}
Element_DRIC::~Element_DRIC() {}

View File

@ -43,7 +43,7 @@ Element_DSTW::Element_DSTW()
HighTemperatureTransition = PT_WTRV;
Update = &Element_DSTW::update;
Graphics = NULL;
}
//#TPT-Directive ElementHeader Element_DSTW static int update(UPDATE_FUNC_ARGS)

View File

@ -43,7 +43,7 @@ Element_DYST::Element_DYST()
HighTemperatureTransition = PT_DUST;
Update = NULL;
Graphics = NULL;
}
Element_DYST::~Element_DYST() {}

View File

@ -43,7 +43,7 @@ Element_ETRD::Element_ETRD()
HighTemperatureTransition = NT;
Update = NULL;
Graphics = NULL;
}
Element_ETRD::~Element_ETRD() {}

View File

@ -43,7 +43,7 @@ Element_FOG::Element_FOG()
HighTemperatureTransition = PT_WTRV;
Update = &Element_FOG::update;
Graphics = NULL;
}
//#TPT-Directive ElementHeader Element_FOG static int update(UPDATE_FUNC_ARGS)

View File

@ -43,7 +43,7 @@ Element_FRAY::Element_FRAY()
HighTemperatureTransition = NT;
Update = &Element_FRAY::update;
Graphics = NULL;
}
//#TPT-Directive ElementHeader Element_FRAY static int update(UPDATE_FUNC_ARGS)

View File

@ -43,7 +43,7 @@ Element_FRZW::Element_FRZW()
HighTemperatureTransition = PT_ICEI;
Update = &Element_FRZW::update;
Graphics = NULL;
}
//#TPT-Directive ElementHeader Element_FRZW static int update(UPDATE_FUNC_ARGS)

View File

@ -43,7 +43,7 @@ Element_FRZZ::Element_FRZZ()
HighTemperatureTransition = NT;
Update = &Element_FRZZ::update;
Graphics = NULL;
}
//#TPT-Directive ElementHeader Element_FRZZ static int update(UPDATE_FUNC_ARGS)

View File

@ -43,7 +43,7 @@ Element_FSEP::Element_FSEP()
HighTemperatureTransition = NT;
Update = &Element_FSEP::update;
Graphics = NULL;
}
//#TPT-Directive ElementHeader Element_FSEP static int update(UPDATE_FUNC_ARGS)

View File

@ -43,7 +43,7 @@ Element_FUSE::Element_FUSE()
HighTemperatureTransition = NT;
Update = &Element_FUSE::update;
Graphics = NULL;
}
//#TPT-Directive ElementHeader Element_FUSE static int update(UPDATE_FUNC_ARGS)

View File

@ -43,7 +43,7 @@ Element_FWRK::Element_FWRK()
HighTemperatureTransition = NT;
Update = &Element_FWRK::update;
Graphics = NULL;
}
//#TPT-Directive ElementHeader Element_FWRK static int update(UPDATE_FUNC_ARGS)

View File

@ -43,7 +43,7 @@ Element_GAS::Element_GAS()
HighTemperatureTransition = PT_FIRE;
Update = NULL;
Graphics = NULL;
}
Element_GAS::~Element_GAS() {}

View File

@ -43,7 +43,7 @@ Element_GLAS::Element_GLAS()
HighTemperatureTransition = PT_LAVA;
Update = &Element_GLAS::update;
Graphics = NULL;
}
//#TPT-Directive ElementHeader Element_GLAS static int update(UPDATE_FUNC_ARGS)

View File

@ -43,7 +43,7 @@ Element_GOO::Element_GOO()
HighTemperatureTransition = NT;
Update = &Element_GOO::update;
Graphics = NULL;
}
//#TPT-Directive ElementHeader Element_GOO static int update(UPDATE_FUNC_ARGS)

View File

@ -43,7 +43,7 @@ Element_GUNP::Element_GUNP()
HighTemperatureTransition = PT_FIRE;
Update = NULL;
Graphics = NULL;
}
Element_GUNP::~Element_GUNP() {}

View File

@ -43,7 +43,7 @@ Element_H2::Element_H2()
HighTemperatureTransition = NT;
Update = &Element_H2::update;
Graphics = NULL;
}
//#TPT-Directive ElementHeader Element_H2 static int update(UPDATE_FUNC_ARGS)

View File

@ -43,7 +43,7 @@ Element_ICEI::Element_ICEI()
HighTemperatureTransition = ST;
Update = &Element_ICEI::update;
Graphics = NULL;
}
//#TPT-Directive ElementHeader Element_ICEI static int update(UPDATE_FUNC_ARGS)

View File

@ -43,7 +43,7 @@ Element_IGNT::Element_IGNT()
HighTemperatureTransition = PT_FIRE;
Update = &Element_IGNT::update;
Graphics = NULL;
}
//#TPT-Directive ElementHeader Element_IGNT static int update(UPDATE_FUNC_ARGS)

View File

@ -43,7 +43,7 @@ Element_INSL::Element_INSL()
HighTemperatureTransition = NT;
Update = NULL;
Graphics = NULL;
}
Element_INSL::~Element_INSL() {}

View File

@ -43,7 +43,7 @@ Element_INST::Element_INST()
HighTemperatureTransition = NT;
Update = NULL;
Graphics = NULL;
}
Element_INST::~Element_INST() {}

View File

@ -43,7 +43,7 @@ Element_INWR::Element_INWR()
HighTemperatureTransition = PT_LAVA;
Update = NULL;
Graphics = NULL;
}
Element_INWR::~Element_INWR() {}

View File

@ -43,7 +43,7 @@ Element_IRON::Element_IRON()
HighTemperatureTransition = PT_LAVA;
Update = &Element_IRON::update;
Graphics = NULL;
}
//#TPT-Directive ElementHeader Element_IRON static int update(UPDATE_FUNC_ARGS)

View File

@ -43,7 +43,7 @@ Element_ISOZ::Element_ISOZ()
HighTemperatureTransition = NT;
Update = &Element_ISOZ::update;
Graphics = NULL;
}
//#TPT-Directive ElementHeader Element_ISOZ static int update(UPDATE_FUNC_ARGS)

View File

@ -43,7 +43,7 @@ Element_ISZS::Element_ISZS()
HighTemperatureTransition = PT_ISOZ;
Update = &Element_ISZS::update;
Graphics = NULL;
}
//#TPT-Directive ElementHeader Element_ISZS static int update(UPDATE_FUNC_ARGS)

View File

@ -1,4 +1,8 @@
#include "simulation/Elements.h"
bool Element_GOL_colourInit = false;
pixel Element_GOL_colour[NGOL];
//#TPT-Directive ElementClass Element_LIFE PT_LIFE 78
Element_LIFE::Element_LIFE()
{
@ -44,8 +48,23 @@ Element_LIFE::Element_LIFE()
Update = NULL;
Graphics = &Element_LIFE::graphics;
if(!Element_GOL_colourInit)
{
Element_GOL_colourInit = true;
int golMenuCount;
gol_menu * golMenuT = LoadGOLMenu(golMenuCount);
for(int i = 0; i < golMenuCount && i < NGOL; i++)
{
Element_GOL_colour[i] = golMenuT[i].colour;
}
free(golMenuT);
}
}
//#TPT-Directive ElementHeader Element_LIFE static int graphics(GRAPHICS_FUNC_ARGS)
int Element_LIFE::graphics(GRAPHICS_FUNC_ARGS)
@ -94,7 +113,7 @@ int Element_LIFE::graphics(GRAPHICS_FUNC_ARGS)
else
pc = PIXRGB(255, 255, 0);
} else {
pc = PIXRGB(255, 255, 0);//sim->gmenu[cpart->ctype].colour;
pc = Element_GOL_colour[cpart->ctype];
}
*colr = PIXR(pc);
*colg = PIXG(pc);

View File

@ -43,7 +43,7 @@ Element_LNTG::Element_LNTG()
HighTemperatureTransition = PT_NONE;
Update = NULL;
Graphics = NULL;
}
Element_LNTG::~Element_LNTG() {}

View File

@ -43,7 +43,7 @@ Element_LO2::Element_LO2()
HighTemperatureTransition = PT_O2;
Update = NULL;
Graphics = NULL;
}
Element_LO2::~Element_LO2() {}

View File

@ -43,7 +43,7 @@ Element_LOLZ::Element_LOLZ()
HighTemperatureTransition = NT;
Update = &Element_LOLZ::update;
Graphics = NULL;
}
//#TPT-Directive ElementHeader Element_LOLZ static int update(UPDATE_FUNC_ARGS)

View File

@ -43,7 +43,7 @@ Element_LOVE::Element_LOVE()
HighTemperatureTransition = NT;
Update = &Element_LOVE::update;
Graphics = NULL;
}
//#TPT-Directive ElementHeader Element_LOVE static int update(UPDATE_FUNC_ARGS)

View File

@ -43,7 +43,7 @@ Element_LRBD::Element_LRBD()
HighTemperatureTransition = PT_FIRE;
Update = NULL;
Graphics = NULL;
}
Element_LRBD::~Element_LRBD() {}

View File

@ -43,7 +43,7 @@ Element_MERC::Element_MERC()
HighTemperatureTransition = NT;
Update = &Element_MERC::update;
Graphics = NULL;
}
//#TPT-Directive ElementHeader Element_MERC static int update(UPDATE_FUNC_ARGS)

View File

@ -43,7 +43,7 @@ Element_METL::Element_METL()
HighTemperatureTransition = PT_LAVA;
Update = NULL;
Graphics = NULL;
}
Element_METL::~Element_METL() {}

View File

@ -43,7 +43,7 @@ Element_MORT::Element_MORT()
HighTemperatureTransition = NT;
Update = &Element_MORT::update;
Graphics = NULL;
}
//#TPT-Directive ElementHeader Element_MORT static int update(UPDATE_FUNC_ARGS)

View File

@ -43,7 +43,7 @@ Element_MWAX::Element_MWAX()
HighTemperatureTransition = PT_FIRE;
Update = NULL;
Graphics = NULL;
}
Element_MWAX::~Element_MWAX() {}

View File

@ -43,7 +43,7 @@ Element_NBHL::Element_NBHL()
HighTemperatureTransition = NT;
Update = &Element_NBHL::update;
Graphics = NULL;
}
//#TPT-Directive ElementHeader Element_NBHL static int update(UPDATE_FUNC_ARGS)

View File

@ -43,7 +43,7 @@ Element_NBLE::Element_NBLE()
HighTemperatureTransition = NT;
Update = &Element_NBLE::update;
Graphics = NULL;
}
//#TPT-Directive ElementHeader Element_NBLE static int update(UPDATE_FUNC_ARGS)

View File

@ -43,7 +43,7 @@ Element_NICE::Element_NICE()
HighTemperatureTransition = PT_LNTG;
Update = NULL;
Graphics = NULL;
}
Element_NICE::~Element_NICE() {}

View File

@ -43,7 +43,7 @@ Element_NITR::Element_NITR()
HighTemperatureTransition = PT_FIRE;
Update = NULL;
Graphics = NULL;
}
Element_NITR::~Element_NITR() {}

View File

@ -43,7 +43,7 @@ Element_NONE::Element_NONE()
HighTemperatureTransition = NT;
Update = NULL;
Graphics = NULL;
}
Element_NONE::~Element_NONE() {}

View File

@ -43,7 +43,7 @@ Element_NSCN::Element_NSCN()
HighTemperatureTransition = PT_LAVA;
Update = NULL;
Graphics = NULL;
}
Element_NSCN::~Element_NSCN() {}

View File

@ -43,7 +43,7 @@ Element_NTCT::Element_NTCT()
HighTemperatureTransition = PT_LAVA;
Update = &Element_NTCT::update;
Graphics = NULL;
}
//#TPT-Directive ElementHeader Element_NTCT static int update(UPDATE_FUNC_ARGS)

View File

@ -43,7 +43,7 @@ Element_NWHL::Element_NWHL()
HighTemperatureTransition = NT;
Update = &Element_NWHL::update;
Graphics = NULL;
}
//#TPT-Directive ElementHeader Element_NWHL static int update(UPDATE_FUNC_ARGS)

View File

@ -43,7 +43,7 @@ Element_O2::Element_O2()
HighTemperatureTransition = NT;
Update = &Element_O2::update;
Graphics = NULL;
}
//#TPT-Directive ElementHeader Element_O2 static int update(UPDATE_FUNC_ARGS)

View File

@ -43,7 +43,7 @@ Element_OIL::Element_OIL()
HighTemperatureTransition = PT_GAS;
Update = NULL;
Graphics = NULL;
}
Element_OIL::~Element_OIL() {}

Some files were not shown because too many files have changed in this diff Show More