parent
c5e40dae1b
commit
bc55854b83
@ -1,16 +1,35 @@ |
||||
#include "FiestaOnlineEditor.h" |
||||
|
||||
ItemEditor::ItemEditor(FiestaOnlineEditor*pge,vi2d pos,vi2d size) |
||||
:Window(pge,pos,size){} |
||||
ItemEditor::ItemEditor(FiestaOnlineEditor*pge,std::string windowTitle,vi2d pos,vi2d size) |
||||
:Window(pge,windowTitle,pos,size){} |
||||
|
||||
void ItemEditor::Load(std::string basePath){ |
||||
ItemInfo.Load(basePath+"/ItemInfo.shn"); |
||||
} |
||||
|
||||
void ItemEditor::Update(FiestaOnlineEditor*pge,float fElapsedTime){ |
||||
|
||||
bool updateRequired=false; |
||||
if(pge->GetKey(UP).bHeld){ |
||||
pos.y-=32*fElapsedTime; |
||||
updateRequired=true; |
||||
} |
||||
if(pge->GetKey(DOWN).bHeld){ |
||||
pos.y+=32*fElapsedTime; |
||||
updateRequired=true; |
||||
} |
||||
if(pge->GetKey(RIGHT).bHeld){ |
||||
pos.x+=32*fElapsedTime; |
||||
updateRequired=true; |
||||
} |
||||
if(pge->GetKey(LEFT).bHeld){ |
||||
pos.x-=32*fElapsedTime; |
||||
updateRequired=true; |
||||
} |
||||
if(updateRequired){ |
||||
InternalRefresh(pge); |
||||
} |
||||
} |
||||
|
||||
void ItemEditor::Refresh(FiestaOnlineEditor*pge){ |
||||
pge->DrawRect(vi2d{32,size.y-9},{16,16},WHITE); |
||||
pge->DrawRect(pos,{16,16},WHITE); |
||||
} |
Loading…
Reference in new issue