Skip to content

Commit

Permalink
On first run, set scale to 2 if screen size is large enough
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob1 committed May 15, 2015
1 parent 0a2b606 commit cee08b2
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
5 changes: 5 additions & 0 deletions src/PowderToySDL.cpp
Expand Up @@ -834,6 +834,11 @@ int main(int argc, char * argv[])
tempScale = 1;

SDLOpen();
if (Client::Ref().IsFirstRun() && desktopWidth > WINDOWW*2 && desktopHeight > WINDOWH*2)
{
tempScale = 2;
Client::Ref().SetPref("Scale", 2);
}
#ifdef WIN
LoadWindowPosition(tempScale);
#endif
Expand Down
8 changes: 8 additions & 0 deletions src/client/Client.cpp
Expand Up @@ -126,7 +126,10 @@ Client::Client():
#ifndef MACOSX
configFile.close();
#endif
firstRun = false;
}
else
firstRun = true;
}

void Client::Initialise(std::string proxyString)
Expand Down Expand Up @@ -173,6 +176,11 @@ void Client::Initialise(std::string proxyString)
}
}

bool Client::IsFirstRun()
{
return firstRun;
}

bool Client::DoInstallation()
{
#if defined(WIN)
Expand Down
5 changes: 3 additions & 2 deletions src/client/Client.h
Expand Up @@ -50,14 +50,14 @@ class ClientListener;
class Client: public Singleton<Client> {
private:
std::string messageOfTheDay;
std::vector<std::pair<std::string, std::string> > serverNotifications;
std::vector<std::pair<std::string, std::string> > serverNotifications;

void * versionCheckRequest;
bool updateAvailable;
UpdateInfo updateInfo;


std::string lastError;
bool firstRun;

std::list<std::string> stampIDs;
unsigned lastStampTime;
Expand Down Expand Up @@ -108,6 +108,7 @@ class Client: public Singleton<Client> {

void Initialise(std::string proxyString);
void SetProxy(std::string proxy);
bool IsFirstRun();

int MakeDirectory(const char * dirname);
bool WriteFile(std::vector<unsigned char> fileData, std::string filename);
Expand Down
3 changes: 1 addition & 2 deletions src/gui/game/GameController.cpp
Expand Up @@ -753,9 +753,8 @@ void GameController::Tick()
((LuaScriptInterface*)commandInterface)->Init();
#endif
#if !defined(MACOSX) && !defined(NO_INSTALL_CHECK)
if(!Client::Ref().GetPrefBool("InstallCheck", false))
if (Client::Ref().IsFirstRun())
{
Client::Ref().SetPref("InstallCheck", true);
Install();
}
#endif
Expand Down

0 comments on commit cee08b2

Please sign in to comment.