Skip to content

Commit

Permalink
finish / fix ecb0895
Browse files Browse the repository at this point in the history
must have accidentally reverted Keys.h halfway through making it?
  • Loading branch information
jacob1 committed Jul 23, 2016
1 parent 21e0c40 commit f0f1040
Show file tree
Hide file tree
Showing 16 changed files with 397 additions and 203 deletions.
1 change: 1 addition & 0 deletions src/PowderToy.h
Expand Up @@ -7,3 +7,4 @@ std::string ClipboardPull();
int GetModifiers();
bool LoadWindowPosition(int scale);
void SetCursorEnabled(int enabled);
unsigned int GetTicks();
1 change: 1 addition & 0 deletions src/PowderToyRenderer.cpp
Expand Up @@ -22,6 +22,7 @@ void ClipboardPush(std::string) {}
std::string ClipboardPull() { return ""; }
int GetModifiers() { return 0; }
void SetCursorEnabled(int enabled) {}
unsigned int GetTicks() { return 0; }

void readFile(std::string filename, std::vector<char> & storage)
{
Expand Down
5 changes: 5 additions & 0 deletions src/PowderToySDL.cpp
Expand Up @@ -519,6 +519,11 @@ void SetCursorEnabled(int enabled)
SDL_ShowCursor(enabled);
}

unsigned int GetTicks()
{
return SDL_GetTicks();
}

std::map<std::string, std::string> readArguments(int argc, char * argv[])
{
std::map<std::string, std::string> arguments;
Expand Down
4 changes: 2 additions & 2 deletions src/gui/game/PropertyTool.cpp
Expand Up @@ -236,9 +236,9 @@ void PropertyWindow::OnDraw()

void PropertyWindow::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool alt)
{
if (key == KEY_UP)
if (key == SDLK_UP)
property->SetOption(property->GetOption().second-1);
else if (key == KEY_DOWN)
else if (key == SDLK_DOWN)
property->SetOption(property->GetOption().second+1);
}

Expand Down
7 changes: 4 additions & 3 deletions src/gui/game/ToolButton.cpp
@@ -1,5 +1,6 @@
#include "ToolButton.h"
#include "gui/interface/Keys.h"
#include "gui/interface/Mouse.h"
#include "Favorite.h"

ToolButton::ToolButton(ui::Point position, ui::Point size, std::string text_, std::string toolIdentifier, std::string toolTip):
Expand All @@ -25,11 +26,11 @@ void ToolButton::OnMouseUnclick(int x, int y, unsigned int button)
if(isButtonDown)
{
isButtonDown = false;
if(button == BUTTON_LEFT)
if(button == SDL_BUTTON_LEFT)
SetSelectionState(0);
if(button == BUTTON_RIGHT)
if(button == SDL_BUTTON_RIGHT)
SetSelectionState(1);
if(button == BUTTON_MIDDLE)
if(button == SDL_BUTTON_MIDDLE)
SetSelectionState(2);
DoAction();
}
Expand Down
3 changes: 2 additions & 1 deletion src/gui/interface/AvatarButton.cpp
Expand Up @@ -9,6 +9,7 @@
#include "graphics/Graphics.h"
#include "ContextMenu.h"
#include "Keys.h"
#include "Mouse.h"

namespace ui {

Expand Down Expand Up @@ -79,7 +80,7 @@ void AvatarButton::OnContextMenuAction(int item)

void AvatarButton::OnMouseClick(int x, int y, unsigned int button)
{
if(button == BUTTON_RIGHT)
if(button == SDL_BUTTON_RIGHT)
{
if(menu)
menu->Show(GetScreenPos() + ui::Point(x, y));
Expand Down

0 comments on commit f0f1040

Please sign in to comment.