From ad4f571cd14e467d98528eb7f56b3e66de4d8158 Mon Sep 17 00:00:00 2001 From: mkwong98 Date: Wed, 13 Jan 2021 00:43:39 +0800 Subject: [PATCH] Add looping to background --- hdnesPackEditor/coreData.cpp | 4 +- hdnesPackEditor/gameObjNode.cpp | 29 +- hdnesPackEditor/gameObjNode.h | 8 +- hdnesPackEditor/hdnesPackEditor.depend | 12 +- hdnesPackEditor/hdnesPackEditor.fbp | 1001 ++++++++++++++++++- hdnesPackEditor/hdnesPackEditor.layout | 678 ++++++------- hdnesPackEditor/hdnesPackEditormainForm.cpp | 83 +- hdnesPackEditor/hdnesPackEditormainForm.h | 6 + hdnesPackEditor/mainForm.cpp | 86 ++ hdnesPackEditor/mainForm.h | 21 + 10 files changed, 1540 insertions(+), 388 deletions(-) diff --git a/hdnesPackEditor/coreData.cpp b/hdnesPackEditor/coreData.cpp index 62bcd62..a8bfd51 100644 --- a/hdnesPackEditor/coreData.cpp +++ b/hdnesPackEditor/coreData.cpp @@ -264,10 +264,10 @@ void coreData::readScreen(string screenId){ isSprite = (token != "Background"); break; case 1: - t.objCoordX = atoi(token.c_str()); + t.objCoordX = atoi(token.c_str()) - 128; break; case 2: - t.objCoordY = atoi(token.c_str()); + t.objCoordY = atoi(token.c_str()) - 120; break; case 3: t.id.readID(token, true); diff --git a/hdnesPackEditor/gameObjNode.cpp b/hdnesPackEditor/gameObjNode.cpp index 584fe8d..c50339c 100644 --- a/hdnesPackEditor/gameObjNode.cpp +++ b/hdnesPackEditor/gameObjNode.cpp @@ -23,6 +23,12 @@ gameObjNode::gameObjNode() vScrollRate = 0; fileName = ""; showBehindBgSprites = false; + offsetX = 0; + offsetY = 0; + moveX = 0; + moveY = 0; + moveFreq = 0; + moveCount = 0; frameRange f; f.frameCnt = 1; @@ -121,6 +127,16 @@ void gameObjNode::load(fstream& file, wxTreeItemId newItm){ else if(lineHdr == ""){ showBehindBgSprites = (lineTail == "Y"); } + else if(lineHdr == ""){ + offsetX = atoi(tailStrs[0].c_str()); + offsetY = atoi(tailStrs[1].c_str()); + } + else if(lineHdr == ""){ + moveX = atoi(tailStrs[0].c_str()); + moveY = atoi(tailStrs[1].c_str()); + moveFreq = atoi(tailStrs[2].c_str()); + moveCount = atoi(tailStrs[3].c_str()); + } else if(lineHdr == ""){ getline(file, line); while(line != ""){ @@ -225,6 +241,8 @@ void gameObjNode::save(fstream& file, wxTreeItemId newItm){ file << "" << fileName << "\n"; file << "" << hScrollRate << "," << vScrollRate << "\n"; file << "" << (showBehindBgSprites ? "Y" : "N") << "\n"; + file << "" << offsetX << "," << offsetY << "\n"; + file << "" << moveX << "," << moveY << "," << moveFreq << "," << moveCount << "\n"; } } else{ @@ -308,6 +326,13 @@ gameObjNode* gameObjNode::clone(){ n->fileName = fileName; n->hScrollRate = hScrollRate; n->vScrollRate = vScrollRate; + n->showBehindBgSprites = showBehindBgSprites; + n->offsetX = offsetY; + n->offsetY = offsetY; + n->moveX = moveX; + n->moveY = moveY; + n->moveFreq = moveFreq; + n->moveCount = moveCount; n->updatePalettes(); n->updateImages(); return n; @@ -323,9 +348,9 @@ string gameObjNode::writeConditionNames(){ return stream.str(); } -string gameObjNode::writeLine(){ +string gameObjNode::writeLine(int frameID){ stringstream stream; - stream << fileName << "," << brightness << "," << hScrollRate << "," << vScrollRate << "," << (coreData::cData->verNo >= 106 ? (showBehindBgSprites ? "0" : "10") : (showBehindBgSprites ? "Y" : "N")) ; + stream << fileName << "," << brightness << "," << hScrollRate << "," << vScrollRate << "," << (coreData::cData->verNo >= 106 ? (showBehindBgSprites ? "0" : "10") : (showBehindBgSprites ? "Y" : "N")) << "," << offsetX + (frameID * moveX) << "," << offsetY + (frameID * moveY); return stream.str(); } diff --git a/hdnesPackEditor/gameObjNode.h b/hdnesPackEditor/gameObjNode.h index 7919f06..7522d46 100644 --- a/hdnesPackEditor/gameObjNode.h +++ b/hdnesPackEditor/gameObjNode.h @@ -55,6 +55,12 @@ class gameObjNode : public wxTreeItemData double vScrollRate; string fileName; bool showBehindBgSprites; + int offsetX; + int offsetY; + int moveX; + int moveY; + int moveFreq; + int moveCount; vector tiles; vector swaps; @@ -77,7 +83,7 @@ class gameObjNode : public wxTreeItemData void updatePalettes(); void updateImages(); gameObjNode* clone(); - string writeLine(); + string writeLine(int frameID); string writeConditionNames(); protected: diff --git a/hdnesPackEditor/hdnesPackEditor.depend b/hdnesPackEditor/hdnesPackEditor.depend index 1ac5ee3..31bfda7 100644 --- a/hdnesPackEditor/hdnesPackEditor.depend +++ b/hdnesPackEditor/hdnesPackEditor.depend @@ -7245,7 +7245,7 @@ 1561782682 d:\work\hdnes\trunk\hdnespackeditor\image.h "common.h" -1608983034 d:\work\hdnes\trunk\hdnespackeditor\hdnespackeditormainform.h +1609862968 d:\work\hdnes\trunk\hdnespackeditor\hdnespackeditormainform.h "common.h" "mainForm.h" "colourDialogClient.h" @@ -7254,7 +7254,7 @@ "gameObjNode.h" "classList.h" -1606273669 d:\work\hdnes\trunk\hdnespackeditor\mainform.h +1609859670 d:\work\hdnes\trunk\hdnespackeditor\mainform.h @@ -7512,7 +7512,7 @@ 1561782682 d:\work\hdnes\trunk\hdnespackeditor\colourdialogclient.h -1609229127 d:\work\hdnes\trunk\hdnespackeditor\gameobjnode.h +1610017787 d:\work\hdnes\trunk\hdnespackeditor\gameobjnode.h "common.h" "gameTile.h" @@ -7520,7 +7520,7 @@ 1561782682 d:\work\hdnes\trunk\hdnespackeditor\hdnespackeditornewprojectdialog.h "mainForm.h" -1606278618 source:d:\work\hdnes\trunk\hdnespackeditor\gameobjnode.cpp +1610018956 source:d:\work\hdnes\trunk\hdnespackeditor\gameobjnode.cpp "coreData.h" "gameObjNode.h" "gameTile.h" @@ -7575,7 +7575,7 @@ "wx/gdicmn.h" "wx/dialog.h" -1609229868 source:d:\work\hdnes\trunk\hdnespackeditor\hdnespackeditormainform.cpp +1610022814 source:d:\work\hdnes\trunk\hdnespackeditor\hdnespackeditormainform.cpp "hdnesPackEditormainForm.h" "hdnesPackEditornewProjectDialog.h" "hdnesPackEditorcolourSelectDialog.h" @@ -7666,7 +7666,7 @@ "hdnesPackEditormainForm.h" "main.h" -1606273669 source:d:\work\hdnes\trunk\hdnespackeditor\mainform.cpp +1609859670 source:d:\work\hdnes\trunk\hdnespackeditor\mainform.cpp "mainForm.h" 1604761296 source:d:\work\hdnes\trunk\hdnespackeditor\paletteswap.cpp diff --git a/hdnesPackEditor/hdnesPackEditor.fbp b/hdnesPackEditor/hdnesPackEditor.fbp index ea1d0f8..8e4bd15 100644 --- a/hdnesPackEditor/hdnesPackEditor.fbp +++ b/hdnesPackEditor/hdnesPackEditor.fbp @@ -27,7 +27,7 @@ UI 0 0 - + 0 wxAUI_MGR_DEFAULT @@ -220,16 +220,16 @@ - + bSizer5 wxVERTICAL none - + 5 wxEXPAND | wxALL 1 - + 1 1 1 @@ -282,11 +282,11 @@ - + Game Objects 1 - + 1 1 1 @@ -337,16 +337,16 @@ wxTAB_TRAVERSAL - + bSizer12 wxHORIZONTAL none - + 5 wxEXPAND 1 - + 1 1 1 @@ -525,8 +525,8 @@ - - + + 1 1 1 @@ -577,16 +577,16 @@ wxTAB_TRAVERSAL - + bSizer38 wxVERTICAL none - + 5 wxEXPAND | wxALL 1 - + 1 1 1 @@ -4293,11 +4293,11 @@ - + Background 0 - + 1 1 1 @@ -4348,7 +4348,7 @@ wxTAB_TRAVERSAL - + bSizer59 wxVERTICAL @@ -4437,7 +4437,7 @@ - + 5 wxEXPAND 0 @@ -5251,6 +5251,967 @@ + + 5 + wxEXPAND + 0 + + + bSizer721 + wxHORIZONTAL + none + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Offset x: + 0 + + 0 + + + 0 + + 1 + m_staticText65 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + txtBGOffsetX + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + BGImageOffsetX + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + + 0 + + 1 + m_staticText66 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Offset y: + 0 + + 0 + + + 0 + + 1 + m_staticText67 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + + 0 + + 1 + txtBGOffsetY + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + BGImageOffsetY + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + + 0 + + 1 + m_staticText68 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + + + 5 + wxEXPAND + 0 + + + bSizer73 + wxHORIZONTAL + none + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Move + 0 + + 0 + + + 0 + + 1 + m_staticText69 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + 70,-1 + + + 0 + + 1 + txtBGMoveX + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + BGImageMoveX + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + pixels left and + 0 + + 0 + + + 0 + + 1 + m_staticText70 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + 70,-1 + + + 0 + + 1 + txtBGMoveY + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + BGImageMoveY + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + pixels up every + 0 + + 0 + + + 0 + + 1 + m_staticText71 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + 70,-1 + + + 0 + + 1 + txtBGMoveFreq + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + BGImageMoveFreq + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + frames + 0 + + 0 + + + 0 + + 1 + m_staticText72 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + 70,-1 + + + 0 + + 1 + txtBGMoveCount + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + BGImageMoveCount + + + + 5 + wxALL + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + times then reset. + 0 + + 0 + + + 0 + + 1 + m_staticText73 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 wxEXPAND | wxALL @@ -15985,7 +16946,7 @@ - + 0 wxAUI_MGR_DEFAULT @@ -16011,7 +16972,7 @@ - + bSizer71 wxHORIZONTAL diff --git a/hdnesPackEditor/hdnesPackEditor.layout b/hdnesPackEditor/hdnesPackEditor.layout index 6760828..1e8d30f 100644 --- a/hdnesPackEditor/hdnesPackEditor.layout +++ b/hdnesPackEditor/hdnesPackEditor.layout @@ -1,325 +1,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -330,34 +12,45 @@ - + - - - - - - - - - - - - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + @@ -371,24 +64,39 @@ - + - - - - - - + - - + - + - + + + + + + + + + + + + + + + + + + + + + + @@ -400,12 +108,282 @@ - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hdnesPackEditor/hdnesPackEditormainForm.cpp b/hdnesPackEditor/hdnesPackEditormainForm.cpp index e7a760c..3451c37 100644 --- a/hdnesPackEditor/hdnesPackEditormainForm.cpp +++ b/hdnesPackEditor/hdnesPackEditormainForm.cpp @@ -1718,7 +1718,12 @@ void hdnesPackEditormainForm::refreshBGImage(){ spnBGHScrollRate->SetValue(ndata->hScrollRate * 100); spnBGVScrollRate->SetValue(ndata->vScrollRate * 100); chkBgShowBehind->SetValue(ndata->showBehindBgSprites); - + txtBGOffsetX->SetValue(main::intToStr(ndata->offsetX)); + txtBGOffsetY->SetValue(main::intToStr(ndata->offsetY)); + txtBGMoveX->SetValue(main::intToStr(ndata->moveX)); + txtBGMoveY->SetValue(main::intToStr(ndata->moveY)); + txtBGMoveFreq->SetValue(main::intToStr(ndata->moveFreq)); + txtBGMoveCount->SetValue(main::intToStr(ndata->moveCount)); loadConditions(); drawBGImage(); @@ -2616,13 +2621,29 @@ void hdnesPackEditormainForm::genGameObjItemTilePack(fstream& file, wxTreeItemId } } else if(node->nodeType == GAME_OBJ_NODE_TYPE_BGIMAGE && withCondition){ - if(node->conditions.size() > 0){ - file << "["; - file << node->writeConditionNames(); - file << "]"; + if(node->moveCount > 1 && node->moveFreq > 0 ){ + for(int i = node->moveCount - 1; i >= 0; i--){ + file << "" << node->nodeName << "ani" << i << ",frameRange," << node->moveCount * node->moveFreq << "," << i * node->moveFreq << "\n"; + file << "["; + if(node->conditions.size() > 0){ + file << node->writeConditionNames(); + file << "&"; + } + file << node->nodeName << "ani" << i ; + file << "]"; + //write line + file << "" << node->writeLine(i) << "\n"; + } + } + else{ + if(node->conditions.size() > 0){ + file << "["; + file << node->writeConditionNames(); + file << "]"; + } + //write line + file << "" << node->writeLine(0) << "\n"; } - //write line - file << "" << node->writeLine() << "\n"; } else{ genChildGameObjsTilePack(file, item, withCondition); @@ -3174,6 +3195,54 @@ void hdnesPackEditormainForm::BGImageShowBehindClicked( wxCommandEvent& event ) } } +void hdnesPackEditormainForm::BGImageOffsetX( wxCommandEvent& event ){ + gameObjNode* ndata = getGameObjsSelectedObjectTreeNode(); + if(ndata){ + ndata->offsetX = atoi(txtBGOffsetX->GetValue()); + dataChanged(); + } +} + +void hdnesPackEditormainForm::BGImageOffsetY( wxCommandEvent& event ){ + gameObjNode* ndata = getGameObjsSelectedObjectTreeNode(); + if(ndata){ + ndata->offsetY = atoi(txtBGOffsetY->GetValue()); + dataChanged(); + } +} + +void hdnesPackEditormainForm::BGImageMoveX( wxCommandEvent& event ){ + gameObjNode* ndata = getGameObjsSelectedObjectTreeNode(); + if(ndata){ + ndata->moveX = atoi(txtBGMoveX->GetValue()); + dataChanged(); + } +} + +void hdnesPackEditormainForm::BGImageMoveY( wxCommandEvent& event ){ + gameObjNode* ndata = getGameObjsSelectedObjectTreeNode(); + if(ndata){ + ndata->moveY = atoi(txtBGMoveY->GetValue()); + dataChanged(); + } +} + +void hdnesPackEditormainForm::BGImageMoveFreq( wxCommandEvent& event ){ + gameObjNode* ndata = getGameObjsSelectedObjectTreeNode(); + if(ndata){ + ndata->moveFreq = atoi(txtBGMoveFreq->GetValue()); + dataChanged(); + } +} + +void hdnesPackEditormainForm::BGImageMoveCount( wxCommandEvent& event ){ + gameObjNode* ndata = getGameObjsSelectedObjectTreeNode(); + if(ndata){ + ndata->moveCount = atoi(txtBGMoveCount->GetValue()); + dataChanged(); + } +} + void hdnesPackEditormainForm::initHDImg(){ lstHDImg->AppendColumn(wxString("Name")); diff --git a/hdnesPackEditor/hdnesPackEditormainForm.h b/hdnesPackEditor/hdnesPackEditormainForm.h index a36e22a..460ce68 100644 --- a/hdnesPackEditor/hdnesPackEditormainForm.h +++ b/hdnesPackEditor/hdnesPackEditormainForm.h @@ -98,6 +98,12 @@ class hdnesPackEditormainForm : public mainForm, public colourDialogClient, publ void BGImageHScrollRate( wxSpinEvent& event ); void BGImageVScrollRate( wxSpinEvent& event ); void BGImageShowBehindClicked( wxCommandEvent& event ); + void BGImageOffsetX( wxCommandEvent& event ); + void BGImageOffsetY( wxCommandEvent& event ); + void BGImageMoveX( wxCommandEvent& event ); + void BGImageMoveY( wxCommandEvent& event ); + void BGImageMoveFreq( wxCommandEvent& event ); + void BGImageMoveCount( wxCommandEvent& event ); void SwapSeleted( wxListEvent& event ); diff --git a/hdnesPackEditor/mainForm.cpp b/hdnesPackEditor/mainForm.cpp index 16dc6e9..696bb03 100644 --- a/hdnesPackEditor/mainForm.cpp +++ b/hdnesPackEditor/mainForm.cpp @@ -550,6 +550,80 @@ mainForm::mainForm( wxWindow* parent, wxWindowID id, const wxString& title, cons bSizer59->Add( bSizer61, 0, wxEXPAND, 5 ); + wxBoxSizer* bSizer721; + bSizer721 = new wxBoxSizer( wxHORIZONTAL ); + + m_staticText65 = new wxStaticText( pnlBGImage, wxID_ANY, wxT("Offset x:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText65->Wrap( -1 ); + bSizer721->Add( m_staticText65, 0, wxALL, 5 ); + + txtBGOffsetX = new wxTextCtrl( pnlBGImage, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + bSizer721->Add( txtBGOffsetX, 0, wxALL, 5 ); + + m_staticText66 = new wxStaticText( pnlBGImage, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText66->Wrap( -1 ); + bSizer721->Add( m_staticText66, 0, wxALL, 5 ); + + m_staticText67 = new wxStaticText( pnlBGImage, wxID_ANY, wxT("Offset y:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText67->Wrap( -1 ); + bSizer721->Add( m_staticText67, 0, wxALL, 5 ); + + txtBGOffsetY = new wxTextCtrl( pnlBGImage, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + bSizer721->Add( txtBGOffsetY, 0, wxALL, 5 ); + + m_staticText68 = new wxStaticText( pnlBGImage, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText68->Wrap( -1 ); + bSizer721->Add( m_staticText68, 0, wxALL, 5 ); + + + bSizer59->Add( bSizer721, 0, wxEXPAND, 5 ); + + wxBoxSizer* bSizer73; + bSizer73 = new wxBoxSizer( wxHORIZONTAL ); + + m_staticText69 = new wxStaticText( pnlBGImage, wxID_ANY, wxT("Move"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText69->Wrap( -1 ); + bSizer73->Add( m_staticText69, 0, wxALL, 5 ); + + txtBGMoveX = new wxTextCtrl( pnlBGImage, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + txtBGMoveX->SetMaxSize( wxSize( 70,-1 ) ); + + bSizer73->Add( txtBGMoveX, 0, wxALL, 5 ); + + m_staticText70 = new wxStaticText( pnlBGImage, wxID_ANY, wxT("pixels left and "), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText70->Wrap( -1 ); + bSizer73->Add( m_staticText70, 0, wxALL, 5 ); + + txtBGMoveY = new wxTextCtrl( pnlBGImage, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + txtBGMoveY->SetMaxSize( wxSize( 70,-1 ) ); + + bSizer73->Add( txtBGMoveY, 0, wxALL, 5 ); + + m_staticText71 = new wxStaticText( pnlBGImage, wxID_ANY, wxT("pixels up every "), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText71->Wrap( -1 ); + bSizer73->Add( m_staticText71, 0, wxALL, 5 ); + + txtBGMoveFreq = new wxTextCtrl( pnlBGImage, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + txtBGMoveFreq->SetMaxSize( wxSize( 70,-1 ) ); + + bSizer73->Add( txtBGMoveFreq, 0, wxALL, 5 ); + + m_staticText72 = new wxStaticText( pnlBGImage, wxID_ANY, wxT("frames"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText72->Wrap( -1 ); + bSizer73->Add( m_staticText72, 0, wxALL, 5 ); + + txtBGMoveCount = new wxTextCtrl( pnlBGImage, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + txtBGMoveCount->SetMaxSize( wxSize( 70,-1 ) ); + + bSizer73->Add( txtBGMoveCount, 0, wxALL, 5 ); + + m_staticText73 = new wxStaticText( pnlBGImage, wxID_ANY, wxT("times then reset."), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText73->Wrap( -1 ); + bSizer73->Add( m_staticText73, 1, wxALL, 5 ); + + + bSizer59->Add( bSizer73, 0, wxEXPAND, 5 ); + pnlBGImageDisplay = new wxPanel( pnlBGImage, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); bSizer59->Add( pnlBGImageDisplay, 1, wxEXPAND | wxALL, 5 ); @@ -1105,6 +1179,12 @@ mainForm::mainForm( wxWindow* parent, wxWindowID id, const wxString& title, cons spnBGHScrollRate->Connect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( mainForm::BGImageHScrollRate ), NULL, this ); spnBGVScrollRate->Connect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( mainForm::BGImageVScrollRate ), NULL, this ); chkBgShowBehind->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( mainForm::BGImageShowBehindClicked ), NULL, this ); + txtBGOffsetX->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( mainForm::BGImageOffsetX ), NULL, this ); + txtBGOffsetY->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( mainForm::BGImageOffsetY ), NULL, this ); + txtBGMoveX->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( mainForm::BGImageMoveX ), NULL, this ); + txtBGMoveY->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( mainForm::BGImageMoveY ), NULL, this ); + txtBGMoveFreq->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( mainForm::BGImageMoveFreq ), NULL, this ); + txtBGMoveCount->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( mainForm::BGImageMoveCount ), NULL, this ); lstConditions->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( mainForm::ConditionSelected ), NULL, this ); cboConditionType->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( mainForm::ConditionTypeSelect ), NULL, this ); cmdConditionAdd->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( mainForm::ConditionAdd ), NULL, this ); @@ -1239,6 +1319,12 @@ mainForm::~mainForm() spnBGHScrollRate->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( mainForm::BGImageHScrollRate ), NULL, this ); spnBGVScrollRate->Disconnect( wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEventHandler( mainForm::BGImageVScrollRate ), NULL, this ); chkBgShowBehind->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( mainForm::BGImageShowBehindClicked ), NULL, this ); + txtBGOffsetX->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( mainForm::BGImageOffsetX ), NULL, this ); + txtBGOffsetY->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( mainForm::BGImageOffsetY ), NULL, this ); + txtBGMoveX->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( mainForm::BGImageMoveX ), NULL, this ); + txtBGMoveY->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( mainForm::BGImageMoveY ), NULL, this ); + txtBGMoveFreq->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( mainForm::BGImageMoveFreq ), NULL, this ); + txtBGMoveCount->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( mainForm::BGImageMoveCount ), NULL, this ); lstConditions->Disconnect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( mainForm::ConditionSelected ), NULL, this ); cboConditionType->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( mainForm::ConditionTypeSelect ), NULL, this ); cmdConditionAdd->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( mainForm::ConditionAdd ), NULL, this ); diff --git a/hdnesPackEditor/mainForm.h b/hdnesPackEditor/mainForm.h index ff4e6f0..1ea5999 100644 --- a/hdnesPackEditor/mainForm.h +++ b/hdnesPackEditor/mainForm.h @@ -126,6 +126,21 @@ class mainForm : public wxFrame wxSpinCtrl* spnBGVScrollRate; wxStaticText* m_staticText59; wxCheckBox* chkBgShowBehind; + wxStaticText* m_staticText65; + wxTextCtrl* txtBGOffsetX; + wxStaticText* m_staticText66; + wxStaticText* m_staticText67; + wxTextCtrl* txtBGOffsetY; + wxStaticText* m_staticText68; + wxStaticText* m_staticText69; + wxTextCtrl* txtBGMoveX; + wxStaticText* m_staticText70; + wxTextCtrl* txtBGMoveY; + wxStaticText* m_staticText71; + wxTextCtrl* txtBGMoveFreq; + wxStaticText* m_staticText72; + wxTextCtrl* txtBGMoveCount; + wxStaticText* m_staticText73; wxPanel* pnlBGImageDisplay; wxPanel* pnlConditions; wxListCtrl* lstConditions; @@ -262,6 +277,12 @@ class mainForm : public wxFrame virtual void BGImageHScrollRate( wxSpinEvent& event ) { event.Skip(); } virtual void BGImageVScrollRate( wxSpinEvent& event ) { event.Skip(); } virtual void BGImageShowBehindClicked( wxCommandEvent& event ) { event.Skip(); } + virtual void BGImageOffsetX( wxCommandEvent& event ) { event.Skip(); } + virtual void BGImageOffsetY( wxCommandEvent& event ) { event.Skip(); } + virtual void BGImageMoveX( wxCommandEvent& event ) { event.Skip(); } + virtual void BGImageMoveY( wxCommandEvent& event ) { event.Skip(); } + virtual void BGImageMoveFreq( wxCommandEvent& event ) { event.Skip(); } + virtual void BGImageMoveCount( wxCommandEvent& event ) { event.Skip(); } virtual void ConditionSelected( wxListEvent& event ) { event.Skip(); } virtual void ConditionTypeSelect( wxCommandEvent& event ) { event.Skip(); } virtual void ConditionAdd( wxCommandEvent& event ) { event.Skip(); }