This commit is contained in:
Daveo 2000-11-28 14:34:42 +00:00
parent 81c8d618c9
commit c94e338dd7
10 changed files with 139 additions and 179 deletions

View File

@ -56,10 +56,7 @@ CMultiBar *ParamBar=Frm->GetParamBar();
ParamBar->RemoveAll();
// Add default parram bar items
ParamBar->Add(Frm->GetLayerList(),IDD_LAYER_LIST_DIALOG,TRUE,TRUE);
ParamBar->Add(Frm->GetTileSetDlg(),IDD_TILESET_DIALOG,TRUE,TRUE);
UpdateParamBar();
// Layer[ActiveLayer]->InitGUI(this);
// ParamBar->Update();
UpdateAll(NULL);
}
@ -338,15 +335,8 @@ CToolBar *ToolBar=Frm->GetToolBar();
CMultiBar *ParamBar=Frm->GetParamBar();
ParamBar->RemoveAll();
// Add default parram bar items
if (TileViewFlag)
{
// TileBank.InitGUI(this);
}
else
{
Layer[ActiveLayer]->InitGUI(this);
}
Layer[ActiveLayer]->UpdateGUI(this);
ParamBar->Update();
@ -440,9 +430,9 @@ void CCore::TileBankReload()
void CCore::TileBankSet()
{
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
CTileSetDlg *TileSetDlg=(CTileSetDlg*)Frm->GetDialog(IDD_TILESET_DIALOG);
CLayerTileGUI *Dlg=(CLayerTileGUI*)Frm->GetDialog(IDD_LAYERTILE_GUI);
TileBank.SetCurrent(TileSetDlg->TileSetList.GetCurSel());
TileBank.SetCurrent(Dlg->m_List.GetCurSel());
}
/*****************************************************************************/
@ -507,7 +497,6 @@ void CCore::UpdateGUI(CMapEditView *View)
UpdateLayerGUI(View);
UpdateGrid(View);
TileBank.UpdateGUI(this,TileViewFlag);
Layer[ActiveLayer]->UpdateGUI(this);
}

View File

@ -54,6 +54,8 @@ public:
// TileBank
void UpdateTileView(CMapEditView *View,BOOL Toggle=FALSE);
void UpdateTileViewGUI() {TileBank.UpdateGUI(this,TileViewFlag);}
CTileBank &GetTileBank() {return(TileBank);}
CTile &GetTile(int Bank,int TileNo) {return(TileBank.GetTile(Bank,TileNo));}
void TileBankLoad(char *Filename);

View File

@ -36,7 +36,14 @@ CLayerTile::CLayerTile(char *_Name,int Width,int Height,float MapDiv,float ZDiv,
VisibleFlag=TRUE;
Mode=MouseModePaint;
if (ResizeFlag)
{
Map.SetSize(Width/MapDiv,Height/MapDiv,TRUE);
}
else
{
Map.SetSize(Width,Height,TRUE);
}
}
/*****************************************************************************/
@ -284,34 +291,31 @@ void CLayerTile::InitGUI(CCore *Core)
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
CMultiBar *ParamBar=Frm->GetParamBar();
ParamBar->Add(Frm->GetGfxToolBar(),IDD_GFXTOOLBAR,TRUE);
ParamBar->Add(Frm->GetLayerTileGUI(),IDD_LAYERTILE_GUI,TRUE);
}
/*****************************************************************************/
void CLayerTile::UpdateGUI(CCore *Core)
{
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
CGfxToolBar *GfxDlg=(CGfxToolBar *)Frm->GetDialog(IDD_GFXTOOLBAR);
CLayerTileGUI *Dlg=(CLayerTileGUI *)Frm->GetDialog(IDD_LAYERTILE_GUI);
if (GfxDlg)
if (Dlg)
{
GfxDlg->ResetButtons();
Dlg->ResetButtons();
switch(Mode)
{
case MouseModePaint:
GfxDlg->SetButtonState(CGfxToolBar::PAINT,TRUE);
Dlg->SetButtonState(CLayerTileGUI::PAINT,TRUE);
break;
case MouseModeSelect:
GfxDlg->SetButtonState(CGfxToolBar::SELECT,TRUE);
break;
case MouseModePicker:
GfxDlg->SetButtonState(CGfxToolBar::PICKER,TRUE);
Dlg->SetButtonState(CLayerTileGUI::SELECT,TRUE);
break;
default:
break;
}
}
Core->UpdateTileViewGUI();
}
/*****************************************************************************/
@ -337,8 +341,6 @@ BOOL CLayerTile::InitMode()
break;
case MouseModeSelect:
break;
case MouseModePicker:
break;
default:
break;
}
@ -354,8 +356,6 @@ BOOL CLayerTile::ExitMode()
break;
case MouseModeSelect:
break;
case MouseModePicker:
break;
default:
break;
}
@ -376,8 +376,6 @@ CTileBank &TileBank=Core->GetTileBank();
break;
case MouseModeSelect:
break;
case MouseModePicker:
break;
default:
break;
}
@ -398,8 +396,6 @@ CTileBank &TileBank=Core->GetTileBank();
break;
case MouseModeSelect:
break;
case MouseModePicker:
break;
default:
break;
}
@ -423,8 +419,6 @@ CTileBank &TileBank=Core->GetTileBank();
break;
case MouseModeSelect:
break;
case MouseModePicker:
break;
default:
break;
}
@ -441,8 +435,6 @@ void CLayerTile::RenderCursor(CCore *Core,Vec &CamPos,BOOL Is3d)
break;
case MouseModeSelect:
break;
case MouseModePicker:
break;
default:
break;
}

View File

@ -7,8 +7,7 @@
#include "MultiBar.h"
#include "LayerList.h"
#include "TileSetDlg.h"
#include "GfxToolBar.h"
#include "LayerTileGUI.h"
#if _MSC_VER > 1000
#pragma once
@ -39,8 +38,8 @@ public:
// Param Bar
CMultiBar *GetParamBar() {return(&ParamBar);}
CDialog &GetLayerList() {return(LayerList);}
CDialog &GetTileSetDlg() {return(TileSetDlg);}
CDialog &GetGfxToolBar() {return(GfxToolBar);}
CDialog &GetLayerTileGUI() {return(LayerTileGUI);}
// Operations
public:
@ -65,8 +64,8 @@ protected: // control bar embedded members
CMultiBar ParamBar;
// Sub Dialogs
CLayerList LayerList;
CTileSetDlg TileSetDlg;
CGfxToolBar GfxToolBar;
CLayerTileGUI LayerTileGUI;
// Generated message map functions
protected:
//{{AFX_MSG(CMainFrame)

View File

@ -2,7 +2,7 @@
[General Info]
Version=1
LastClass=CMapEditView
LastClass=CLayerTileGUI
LastTemplate=CDialog
NewFileInclude1=#include "stdafx.h"
NewFileInclude2=#include "mapedit.h"
@ -17,22 +17,21 @@ Class5=CAboutDlg
Class6=CMapEditDoc
Class7=CMapEditView
ResourceCount=10
ResourceCount=9
Resource1=IDR_MAINFRAME (English (U.S.))
Resource2=IDD_MULTIBAR (English (U.S.))
Resource3=IDD_GFXTOOLBAR
Resource2=IDD_ABOUTBOX (English (U.S.))
Resource3=IDD_MULTIBAR (English (U.S.))
Resource4=IDD_DIALOGBAR (English (U.S.))
Resource5=IDD_LAYER_LIST_DIALOG
Resource5=IDR_TOOLBAR (English (U.S.))
Class8=CMultiBar
Resource6=IDD_ABOUTBOX (English (U.S.))
Resource6=IDD_LAYER_LIST_DIALOG
Resource7=IDR_MAPEDITYPE (English (U.S.))
Class9=CLayerList
Class10=CTileSetDlg
Resource8=IDD_TILESET_DIALOG
Class10=CMapSizeDlg
Resource8=IDD_LAYERTILE_GUI
Class11=CGfxToolBar
Resource9=IDR_TOOLBAR (English (U.S.))
Class12=CMapSizeDlg
Resource10=IDD_MAPSIZE
Class12=CLayerTileGUI
Resource9=IDD_MAPSIZE
[CLS:CChildFrame]
Type=0
@ -217,23 +216,6 @@ Filter=D
VirtualFilter=dWC
LastObject=CLayerList
[DLG:IDD_TILESET_DIALOG]
Type=1
Class=CTileSetDlg
ControlCount=3
Control1=IDC_TILESETDLG_COMBO,combobox,1342242819
Control2=IDC_TILESETDLG_BTN_UPDATE,button,1342242816
Control3=IDC_TILESETDLG_BTN_LOAD,button,1342242816
[CLS:CTileSetDlg]
Type=0
HeaderFile=TileSetDlg.h
ImplementationFile=TileSetDlg.cpp
BaseClass=CDialog
Filter=D
VirtualFilter=dWC
LastObject=IDC_TILESETDLG_COMBO
[CLS:CGfxToolBar]
Type=0
HeaderFile=GfxToolBar.h
@ -243,14 +225,6 @@ Filter=D
LastObject=CGfxToolBar
VirtualFilter=dWC
[DLG:IDD_GFXTOOLBAR]
Type=1
Class=CGfxToolBar
ControlCount=3
Control1=IDD_GFXTOOLBAR_PAINT,button,1342177344
Control2=IDD_GFXTOOLBAR_SELECT,button,1476395072
Control3=IDD_GFXTOOLBAR_PICKER,button,1476395072
[DLG:IDD_MAPSIZE]
Type=1
Class=CMapSizeDlg
@ -271,3 +245,22 @@ BaseClass=CDialog
Filter=D
VirtualFilter=dWC
[DLG:IDD_LAYERTILE_GUI]
Type=1
Class=CLayerTileGUI
ControlCount=5
Control1=IDD_LAYERTILE_LIST,combobox,1342242819
Control2=IDD_LAYERTILE_BTN_UPDATE,button,1342242816
Control3=IDD_LAYERTILE_BTN_LOAD,button,1342242816
Control4=IDD_LAYERTILE_BTN_PAINT,button,1342177344
Control5=IDD_LAYERTILE_BTN_SELECT,button,1476395072
[CLS:CLayerTileGUI]
Type=0
HeaderFile=LayerTileGUI.h
ImplementationFile=LayerTileGUI.cpp
BaseClass=CDialog
Filter=D
VirtualFilter=dWC
LastObject=IDD_LAYERTILE_LIST

View File

@ -444,9 +444,6 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
// remains consistent on all systems.
IDI_PAINT ICON DISCARDABLE "res\\paint.ico"
IDI_SELECT ICON DISCARDABLE "res\\select.ico"
IDI_PICKER ICON DISCARDABLE "res\\picker.ico"
IDI_MIRRORY ICON DISCARDABLE "res\\mirrory.ico"
IDI_MIRRORX ICON DISCARDABLE "res\\mirrorx.ico"
/////////////////////////////////////////////////////////////////////////////
//
@ -462,25 +459,17 @@ BEGIN
WS_TABSTOP
END
IDD_TILESET_DIALOG DIALOG DISCARDABLE 0, 0, 151, 46
IDD_LAYERTILE_GUI DIALOG DISCARDABLE 0, 0, 151, 81
STYLE WS_CHILD
FONT 8, "MS Sans Serif"
BEGIN
COMBOBOX IDC_TILESETDLG_COMBO,7,7,138,322,CBS_DROPDOWNLIST |
COMBOBOX IDD_LAYERTILE_LIST,7,7,138,322,CBS_DROPDOWNLIST |
WS_TABSTOP
PUSHBUTTON "Update",IDC_TILESETDLG_BTN_UPDATE,80,25,65,15
PUSHBUTTON "Load",IDC_TILESETDLG_BTN_LOAD,5,25,70,15
END
IDD_GFXTOOLBAR DIALOG DISCARDABLE 0, 0, 156, 26
STYLE DS_CONTROL | WS_CHILD
FONT 8, "MS Sans Serif"
BEGIN
PUSHBUTTON "P",IDD_GFXTOOLBAR_PAINT,5,5,15,15,BS_ICON | NOT
PUSHBUTTON "Update",IDD_LAYERTILE_BTN_UPDATE,80,25,65,15
PUSHBUTTON "Load",IDD_LAYERTILE_BTN_LOAD,5,25,70,15
PUSHBUTTON "P",IDD_LAYERTILE_BTN_PAINT,5,45,15,15,BS_ICON | NOT
WS_TABSTOP
PUSHBUTTON "S",IDD_GFXTOOLBAR_SELECT,20,5,15,15,BS_ICON |
WS_DISABLED | NOT WS_TABSTOP
PUSHBUTTON "Pk",IDD_GFXTOOLBAR_PICKER,35,5,15,15,BS_ICON |
PUSHBUTTON "S",IDD_LAYERTILE_BTN_SELECT,20,45,15,15,BS_ICON |
WS_DISABLED | NOT WS_TABSTOP
END
@ -518,20 +507,12 @@ BEGIN
BOTTOMMARGIN, 87
END
IDD_TILESET_DIALOG, DIALOG
IDD_LAYERTILE_GUI, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 144
TOPMARGIN, 7
BOTTOMMARGIN, 39
END
IDD_GFXTOOLBAR, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 149
TOPMARGIN, 7
BOTTOMMARGIN, 19
BOTTOMMARGIN, 74
END
IDD_MAPSIZE, DIALOG

View File

@ -157,42 +157,42 @@ void CMapEditDoc::ToggleTileView(CMapEditView *View)
{
Core.UpdateTileView(View,TRUE);
Core.UpdateAll(View);
theApp.GetMainWnd()->SetFocus(); // Put control back to Window :o)
FocusView();
}
/*********************************************************************************/
void CMapEditDoc::ToggleGrid(CMapEditView *View)
{
Core.UpdateGrid(View,TRUE);
theApp.GetMainWnd()->SetFocus(); // Put control back to Window :o)
FocusView();
}
/*********************************************************************************/
void CMapEditDoc::MirrorX(CMapEditView *View)
{
Core.MirrorX(View);
theApp.GetMainWnd()->SetFocus(); // Put control back to Window :o)
FocusView();
}
/*********************************************************************************/
void CMapEditDoc::MirrorY(CMapEditView *View)
{
Core.MirrorY(View);
theApp.GetMainWnd()->SetFocus(); // Put control back to Window :o)
FocusView();
}
/*********************************************************************************/
void CMapEditDoc::SetMode(int NewMode)
{
Core.SetMode(NewMode);
theApp.GetMainWnd()->SetFocus(); // Put control back to Window :o)
FocusView();
}
/*********************************************************************************/
void CMapEditDoc::SetLayer(int Layer)
{
Core.SetLayer(Layer);
theApp.GetMainWnd()->SetFocus(); // Put control back to Window :o)
FocusView();
}
/*********************************************************************************/
@ -201,7 +201,7 @@ void CMapEditDoc::SetLayer(int Layer)
void CMapEditDoc::OnExportAgb()
{
char BASED_CODE AGBFilter[]= "AGB Data Type (*.c)|*.c|All Files (*.*)|*.*||";
CFileDialog Dlg(TRUE,NULL,NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,AGBFilter);
CFileDialog Dlg(FALSE,"*.c",NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,AGBFilter);
if (Dlg.DoModal()!=IDOK) return;
@ -232,7 +232,7 @@ char Filename[256];
sprintf(Filename,"%s",Dlg.GetPathName());
Core.TileBankLoad(Filename);
UpdateAllViews(NULL);
theApp.GetMainWnd()->SetFocus(); // Put control back to Window :o)
FocusView();
}
/*********************************************************************************/
@ -240,7 +240,7 @@ void CMapEditDoc::TileBankReload()
{
Core.TileBankReload();
UpdateAllViews(NULL);
theApp.GetMainWnd()->SetFocus(); // Put control back to Window :o)
FocusView();
}
/*********************************************************************************/
@ -248,7 +248,7 @@ void CMapEditDoc::TileBankSet()
{
Core.TileBankSet();
UpdateAllViews(NULL);
theApp.GetMainWnd()->SetFocus(); // Put control back to Window :o)
FocusView();
}
/*********************************************************************************/
@ -281,3 +281,10 @@ void CMapEditDoc::Toggle2d3d(CMapEditView *View)
{
Core.Toggle2d3d(View);
}
/*********************************************************************************/
void CMapEditDoc::FocusView()
{
theApp.GetMainWnd()->SetFocus(); // Put control back to Window :o)
}

View File

@ -22,6 +22,7 @@ public:
void UpdateView(CMapEditView *View);
void Render(CMapEditView *View);
void UpdateAll(CMapEditView *View);
void FocusView();
// Windows Messages Thru Point
void LButtonControl(CMapEditView *View,UINT nFlags, CPoint &point,BOOL DownFlag);

View File

@ -19,7 +19,7 @@
#include "MapEditDoc.h"
#include "MapEditView.h"
#include "MainFrm.h"
#include "TileSetDlg.h"
#include "LayerTileGui.h"
/*****************************************************************************/
@ -111,7 +111,7 @@ int ListSize=TileSet.size();
CTileSet &ThisSet=TileSet[i];
char Filename[256+64];
sprintf(Filename,"%s%s.%s",ThisSet.GetPath(),ThisSet.GetName(),"Gin");
sprintf(Filename,"%s%s%s",ThisSet.GetPath(),ThisSet.GetName(),ThisSet.GetExt());
File->Write(Filename,256+64);
}
@ -121,6 +121,7 @@ int ListSize=TileSet.size();
void CTileBank::AddTileSet(char *Filename)
{
int ListSize=TileSet.size();
TileSet.push_back(CTileSet(Filename,ListSize));
LoadFlag=TRUE;
}
@ -194,25 +195,26 @@ void CTileBank::FindCursorPos(CCore *Core,CMapEditView *View,Vec &CamPos,CPoint
void CTileBank::UpdateGUI(CCore *Core,BOOL IsTileView)
{
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
CTileSetDlg *TileSetDlg=(CTileSetDlg*)Frm->GetDialog(IDD_TILESET_DIALOG);
CLayerTileGUI *Dlg=(CLayerTileGUI*)Frm->GetDialog(IDD_LAYERTILE_GUI);
int ListSize=TileSet.size();
ASSERT(TileSetDlg);
TileSetDlg->TileSetList.ResetContent();
if (Dlg)
{
Dlg->m_List.ResetContent();
if (ListSize)
{
for (int i=0; i<ListSize; i++)
{
TileSetDlg->TileSetList.AddString(TileSet[i].GetName());
Dlg->m_List.AddString(TileSet[i].GetName());
}
TileSetDlg->TileSetList.SetCurSel(CurrentSet);
Dlg->m_List.SetCurSel(CurrentSet);
}
else
{
IsTileView=FALSE;
}
TileSetDlg->TileSetList.EnableWindow(IsTileView);
Dlg->m_List.EnableWindow(IsTileView);
}
}
/*****************************************************************************/
@ -334,7 +336,6 @@ int Width=ThisBmp.Width/16;
int Height=ThisBmp.Height/16;
u8 Buffer[16*16*3];
NewTex.Width=16;
NewTex.Height=16;
NewTex.RGB=Buffer;

View File

@ -9,22 +9,17 @@
#define IDR_TOOLBAR 128
#define IDR_MAPEDITYPE 129
#define IDD_LAYER_LIST_DIALOG 147
#define IDD_TILESET_DIALOG 148
#define IDD_GFXTOOLBAR 151
#define IDD_LAYERTILE_GUI 148
#define IDI_PAINT 152
#define IDI_SELECT 153
#define IDI_PICKER 154
#define IDI_MIRRORY 165
#define IDI_MIRRORX 166
#define IDD_MAPSIZE 167
#define IDC_TOOLBAR_COMBO 1018
#define IDC_LAYER_LIST 1019
#define IDC_TILESETDLG_BTN_UPDATE 1029
#define IDC_TILESETDLG_COMBO 1030
#define IDD_GFXTOOLBAR_PAINT 1031
#define IDC_TILESETDLG_BTN_LOAD 1031
#define IDD_GFXTOOLBAR_SELECT 1032
#define IDD_GFXTOOLBAR_PICKER 1033
#define IDD_LAYERTILE_BTN_UPDATE 1029
#define IDD_LAYERTILE_LIST 1030
#define IDD_LAYERTILE_BTN_LOAD 1031
#define IDD_LAYERTILE_BTN_SELECT 1032
#define IDD_LAYERTILE_BTN_PAINT 1034
#define IDC_MAPSIZE_WIDTH 1037
#define IDC_MAPSIZE_WIDTH_TEXT 1038
#define IDC_MAPSIZE_HEIGHT_TEXT 1039