summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: aac9a5a)
raw | patch | inline | side by side (parent: aac9a5a)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Thu, 25 May 2023 13:00:44 +0000 (16:00 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Thu, 25 May 2023 13:00:44 +0000 (16:00 +0300) |
src/editor/Editor.lpi | patch | blob | history | |
src/editor/f_main.lfm | patch | blob | history | |
src/editor/f_main.pas | patch | blob | history | |
src/editor/g_language.pas | patch | blob | history |
diff --git a/src/editor/Editor.lpi b/src/editor/Editor.lpi
index ad2ecd7a66559ba01f9768d07e6efe1041eb9924..1354cd3e31a746655c6aeae35fee632b0788d514 100644 (file)
--- a/src/editor/Editor.lpi
+++ b/src/editor/Editor.lpi
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
- <Version Value="11"/>
+ <Version Value="12"/>
<General>
<Flags>
<MainUnitHasUsesSectionForAllUnits Value="False"/>
<MainUnitHasCreateFormStatements Value="False"/>
<MainUnitHasTitleStatement Value="False"/>
+ <CompatibilityMode Value="True"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
- <MainUnit Value="0"/>
<Title Value="Editor"/>
<ResourceType Value="res"/>
<UseXPManifest Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
- <GenerateDebugInfo Value="True"/>
<DebugInfoType Value="dsDwarf2Set"/>
- <UseValgrind Value="False"/>
- <StripSymbols Value="False"/>
</Debugging>
<LinkSmart Value="True"/>
<Options>
<Linking>
<Debugging>
<UseHeaptrc Value="True"/>
- <TrashVariables Value="False"/>
- <UseValgrind Value="False"/>
</Debugging>
<Options>
<Win32>
diff --git a/src/editor/f_main.lfm b/src/editor/f_main.lfm
index 9598f105109476fdd8c44361bcd3e5dd4d83c33f..238c1122fd4396ea9cfee8683ac9950d3d911796 100644 (file)
--- a/src/editor/f_main.lfm
+++ b/src/editor/f_main.lfm
object MainForm: TMainForm
- Left = 432
+ Left = 221
Height = 480
- Top = 732
+ Top = 232
Width = 672
AllowDropFiles = True
Caption = '2'
- ClientHeight = 453
+ ClientHeight = 480
ClientWidth = 672
Color = clBtnFace
Constraints.MinHeight = 480
OnKeyDown = FormKeyDown
OnKeyUp = FormKeyUp
OnResize = FormResize
+ OnWindowStateChange = FormWindowStateChange
LCLVersion = '2.2.4.0'
object Splitter1: TSplitter
Left = 518
- Height = 284
+ Height = 317
Top = 34
Width = 5
Align = alRight
Cursor = crVSplit
Left = 0
Height = 3
- Top = 318
+ Top = 351
Width = 672
Align = alBottom
MinSize = 64
end
object PanelProps: TPanel
Left = 523
- Height = 284
+ Height = 317
Top = 34
Width = 149
Align = alRight
BevelInner = bvRaised
BevelOuter = bvLowered
- ClientHeight = 284
+ ClientHeight = 317
ClientWidth = 149
TabOrder = 0
object vleObjectProperty: TValueListEditor
Left = 2
- Height = 250
+ Height = 283
Top = 2
Width = 145
Align = alClient
object PanelPropApply: TPanel
Left = 2
Height = 30
- Top = 252
+ Top = 285
Width = 145
Align = alBottom
BevelOuter = bvNone
end
object PanelMap: TPanel
Left = 0
- Height = 284
+ Height = 317
Top = 34
Width = 518
Align = alClient
BevelOuter = bvNone
- ClientHeight = 284
+ ClientHeight = 317
ClientWidth = 518
TabOrder = 1
object sbHorizontal: TScrollBar
Left = 0
Height = 16
- Top = 268
+ Top = 301
Width = 518
Align = alBottom
LargeChange = 256
end
object sbVertical: TScrollBar
Left = 502
- Height = 268
+ Height = 301
Top = 0
Width = 16
Align = alRight
end
object RenderPanel: TOpenGLControl
Left = 0
- Height = 268
+ Height = 301
Top = 0
Width = 502
Align = alClient
end
object StatusBar: TStatusBar
Left = 0
- Height = 21
- Top = 432
+ Height = 15
+ Top = 465
Width = 672
AutoHint = True
Panels = <
object PanelObjs: TPanel
Left = 0
Height = 111
- Top = 321
+ Top = 354
Width = 672
Align = alBottom
BevelInner = bvRaised
TabOrder = 0
object tsPanels: TTabSheet
Caption = 'Панели'
- ClientHeight = 77
- ClientWidth = 664
+ ClientHeight = 68
+ ClientWidth = 662
ImageIndex = 12
object lbTextureList: TListBox
Left = 206
- Height = 77
+ Height = 70
Hint = 'Список текстур'
Top = 0
- Width = 246
+ Width = 244
Align = alClient
Constraints.MaxHeight = 600
Constraints.MinHeight = 70
ItemHeight = 13
OnClick = lbTextureListClick
OnDrawItem = lbTextureListDrawItem
+ Options = [lboDrawFocusRect]
Style = lbOwnerDrawFixed
TabOrder = 0
- TopIndex = -1
end
object PanelTextures: TPanel
- Left = 452
- Height = 77
+ Left = 450
+ Height = 68
Top = 0
Width = 212
Align = alRight
BevelOuter = bvNone
- ClientHeight = 77
+ ClientHeight = 68
ClientWidth = 212
TabOrder = 1
object LabelTxH: TLabel
Left = 33
- Height = 14
+ Height = 13
Top = 22
- Width = 105
+ Width = 95
Caption = 'Высота текстуры:'
ParentColor = False
end
object LabelTxW: TLabel
Left = 33
- Height = 14
+ Height = 13
Top = 0
- Width = 109
+ Width = 101
Caption = 'Ширина текстуры:'
ParentColor = False
end
end
object cbPreview: TCheckBox
Left = 35
- Height = 21
+ Height = 18
Top = 54
- Width = 187
+ Width = 205
Caption = 'Предварительный просмотр'
TabOrder = 0
end
end
object PanelPanelType: TPanel
Left = 0
- Height = 77
+ Height = 68
Top = 0
Width = 206
Align = alLeft
BevelOuter = bvNone
- ClientHeight = 77
+ ClientHeight = 68
ClientWidth = 206
TabOrder = 2
object lbPanelType: TListBox
Left = 0
- Height = 77
+ Height = 68
Hint = 'Тип панели'
Top = 0
Width = 201
'Блокиратор монстров'
)
ItemHeight = 20
+ Options = [lboDrawFocusRect]
TabOrder = 0
end
end
end
object tsItems: TTabSheet
Caption = 'Предметы'
- ClientHeight = 77
- ClientWidth = 664
+ ClientHeight = 68
+ ClientWidth = 662
ImageIndex = 4
object lbItemList: TListBox
Left = 0
- Height = 77
+ Height = 68
Hint = 'Список предметов'
Top = 0
Width = 201
'Бутылек здоровья'
'Часть брони'
)
- ItemHeight = 0
+ ItemHeight = 20
+ Options = [lboDrawFocusRect]
TabOrder = 0
- TopIndex = -1
end
object cbOnlyDM: TCheckBox
Left = 208
- Height = 21
+ Height = 18
Top = 0
- Width = 110
+ Width = 102
Caption = 'Только в DM'
TabOrder = 1
end
object cbFall: TCheckBox
Left = 208
- Height = 21
+ Height = 18
Top = 16
- Width = 74
+ Width = 67
Caption = 'Падает'
TabOrder = 2
end
end
object tsMonsters: TTabSheet
Caption = 'Монстры'
- ClientHeight = 77
- ClientWidth = 664
+ ClientHeight = 68
+ ClientWidth = 662
ImageIndex = 15
object lbMonsterList: TListBox
Left = 0
- Height = 77
+ Height = 68
Hint = 'Список монстров'
Top = 0
Width = 201
'Робот'
'Приколист'
)
- ItemHeight = 0
+ ItemHeight = 20
+ Options = [lboDrawFocusRect]
TabOrder = 0
- TopIndex = -1
end
object rbMonsterLeft: TRadioButton
Left = 208
- Height = 21
+ Height = 18
Top = 0
- Width = 65
+ Width = 58
Caption = 'Влево'
Checked = True
TabOrder = 1
end
object rbMonsterRight: TRadioButton
Left = 208
- Height = 21
+ Height = 18
Top = 16
- Width = 73
+ Width = 66
Caption = 'Вправо'
TabOrder = 2
end
end
object tsAreas: TTabSheet
Caption = 'Области'
- ClientHeight = 77
- ClientWidth = 664
+ ClientHeight = 68
+ ClientWidth = 662
ImageIndex = 3
object lbAreasList: TListBox
Left = 0
- Height = 77
+ Height = 68
Hint = 'Список областей'
Top = 0
Width = 201
'Красная команда'
'Синяя команда'
)
- ItemHeight = 0
+ ItemHeight = 20
+ Options = [lboDrawFocusRect]
TabOrder = 0
- TopIndex = -1
end
object rbAreaLeft: TRadioButton
Left = 208
- Height = 21
+ Height = 18
Top = 0
- Width = 65
+ Width = 58
Caption = 'Влево'
Checked = True
TabOrder = 1
end
object rbAreaRight: TRadioButton
Left = 208
- Height = 21
+ Height = 18
Top = 16
- Width = 73
+ Width = 66
Caption = 'Вправо'
TabOrder = 2
end
end
object tsTriggers: TTabSheet
Caption = 'Триггеры'
- ClientHeight = 77
- ClientWidth = 664
+ ClientHeight = 68
+ ClientWidth = 662
ImageIndex = 6
object lbTriggersList: TListBox
Left = 0
- Height = 77
+ Height = 68
Hint = 'Список триггеров'
Top = 0
Width = 201
'Создать предмет'
'Музыка'
)
- ItemHeight = 0
+ ItemHeight = 20
+ Options = [lboDrawFocusRect]
TabOrder = 0
- TopIndex = -1
end
object clbActivationType: TCheckListBox
Left = 201
- Height = 77
+ Height = 68
Hint = 'Тип активации триггера'
Top = 0
Width = 128
'Выстрел'
'Монстров нет'
)
- ItemHeight = 0
+ ItemHeight = 20
TabOrder = 1
- TopIndex = -1
Data = {
06000000000000000000
}
end
object clbKeys: TCheckListBox
Left = 329
- Height = 77
+ Height = 68
Hint = 'Ключи для активации'
Top = 0
Width = 128
'Красная команда'
'Синяя команда'
)
- ItemHeight = 0
+ ItemHeight = 20
TabOrder = 2
- TopIndex = -1
Data = {
050000000000000000
}
DefaultExt = '.dfz'
Filter = 'Карты Doom 2D: Forever (*.dfz, *.dfzip, *.zip, *.wad)|*.dfz;*.dfzip;*.zip;*.wad|Старые карты Doom 2D: Forever 0.30 (*.ini)|*.ini|Все файлы (*.*)|*.*'
Options = [ofHideReadOnly, ofNoChangeDir, ofPathMustExist, ofFileMustExist, ofEnableSizing, ofDontAddToRecent]
- left = 32
- top = 64
+ Left = 32
+ Top = 64
end
object ImageList: TImageList
- left = 32
- top = 101
+ Left = 32
+ Top = 101
Bitmap = {
4C7A1E00000010000000100000003A1000000000000078DAED5D4DAC234711F6
D1471FDFD512A018118209903884102C72F101212B512483E06090001F22300A
DefaultExt = '.dfz'
Filter = 'Карты Doom 2D: Forever (*.dfz)|*.dfz|Карты Doom 2D: Forever (*.dfzip)|*.dfzip|Карты Doom 2D: Forever (*.zip)|*.zip|Карты Doom 2D: Forever (*.wad)|*.wad|Все файлы (*.*)|*.*'
Options = [ofHideReadOnly, ofNoChangeDir, ofPathMustExist, ofNoReadOnlyReturn, ofEnableSizing, ofDontAddToRecent]
- left = 64
- top = 64
+ Left = 64
+ Top = 64
end
object MainMenu: TMainMenu
Images = ImageList
- left = 96
- top = 64
+ Left = 96
+ Top = 64
+ object miApple: TMenuItem
+ Caption = ''
+ Enabled = False
+ Visible = False
+ object miAppleAbout: TMenuItem
+ Caption = 'About Editor'
+ OnClick = aAboutExecute
+ end
+ object miAppleLine0: TMenuItem
+ Caption = '-'
+ end
+ object miApplePref: TMenuItem
+ Caption = 'Preferences...'
+ ShortCut = 4284
+ OnClick = aEditorOptionsExecute
+ end
+ object miAppleLine1: TMenuItem
+ Caption = '-'
+ end
+ end
object miMenuFile: TMenuItem
- Caption = 'Файл'
+ Caption = 'File'
object miNewMap: TMenuItem
- Caption = 'Новая карта'
+ Caption = 'New'
ImageIndex = 0
ShortCut = 16462
OnClick = aNewMapExecute
end
object miOpenMap: TMenuItem
- Caption = 'Открыть карту'
+ Caption = 'Open...'
ImageIndex = 1
ShortCut = 16463
OnClick = aOpenMapExecute
end
+ object miMacRecentSubMenu: TMenuItem
+ Caption = 'Open Recent'
+ Enabled = False
+ Visible = False
+ object miMacRecentEnd: TMenuItem
+ Caption = '-'
+ end
+ object miMacRecentClear: TMenuItem
+ Caption = 'Clear Recent'
+ OnClick = miMacRecentClearClick
+ end
+ end
+ object Separator1: TMenuItem
+ Caption = '-'
+ end
object miSaveMap: TMenuItem
- Caption = 'Сохранить карту'
+ Caption = 'Save'
ImageIndex = 2
ShortCut = 16467
OnClick = aSaveMapExecute
end
object miSaveMapAs: TMenuItem
- Caption = 'Сохранить карту как...'
+ Caption = 'Save As...'
ImageIndex = 21
OnClick = aSaveMapAsExecute
end
object miOpenWadMap: TMenuItem
- Caption = 'Выбрать карту'
+ Caption = 'Select Map...'
ImageIndex = 28
OnClick = miOpenWadMapClick
end
- object miLine1: TMenuItem
- Caption = '-'
- end
object miReopenMap: TMenuItem
- Caption = 'Открыть заново'
+ Caption = 'Revert to Saved'
ImageIndex = 1
ShortCut = 116
OnClick = miReopenMapClick
end
+ object miLine1: TMenuItem
+ Caption = '-'
+ end
object miSaveMiniMap: TMenuItem
- Caption = 'Сохранить мини-карту'
+ Caption = 'Export Minimap...'
ImageIndex = 22
OnClick = miSaveMiniMapClick
end
object miDeleteMap: TMenuItem
- Caption = 'Удалить карту из WAD...'
+ Caption = 'Delete from WAD...'
ImageIndex = 11
OnClick = aDeleteMap
end
object miPackMap: TMenuItem
- Caption = 'Упаковать карту'
+ Caption = 'Pack to WAD...'
ImageIndex = 26
OnClick = miPackMapClick
end
+ object miWinRecentStart: TMenuItem
+ Caption = '-'
+ Enabled = False
+ Visible = False
+ end
+ object miWinRecent: TMenuItem
+ Caption = 'Recent Files'
+ Enabled = False
+ Visible = False
+ end
object miLine2: TMenuItem
Caption = '-'
+ Enabled = False
+ Visible = False
end
object miExit: TMenuItem
- Caption = 'Выход'
+ Caption = 'Exit'
+ Enabled = False
ImageIndex = 10
ShortCut = 121
+ Visible = False
OnClick = aExitExecute
end
end
object miMenuEdit: TMenuItem
- Caption = 'Правка'
+ Caption = 'Edit'
object miUndo: TMenuItem
- Caption = 'Отменить'
+ Caption = 'Undo'
Enabled = False
ImageIndex = 5
ShortCut = 16474
Caption = '-'
end
object miCopy: TMenuItem
- Caption = 'Копировать объект'
+ Caption = 'Copy'
Enabled = False
ImageIndex = 8
ShortCut = 16451
OnClick = aCopyObjectExecute
end
object miCut: TMenuItem
- Caption = 'Вырезать объект'
+ Caption = 'Cut'
Enabled = False
ImageIndex = 7
ShortCut = 16472
OnClick = aCutObjectExecute
end
object miPaste: TMenuItem
- Caption = 'Вставить объект'
+ Caption = 'Paste'
ImageIndex = 9
ShortCut = 16470
OnClick = aPasteObjectExecute
Caption = '-'
end
object miSelectAll: TMenuItem
- Caption = 'Выделить все объекты'
+ Caption = 'Select All'
ImageIndex = 24
ShortCut = 16449
OnClick = aSelectAllExecute
object miLine5: TMenuItem
Caption = '-'
end
+ object miSnapToGrid: TMenuItem
+ Caption = 'Snap to Grid'
+ ImageIndex = 20
+ ShortCut = 16465
+ OnClick = miSnapToGridClick
+ end
+ object miSwitchGrid: TMenuItem
+ Caption = 'Switch Grid Granularity'
+ ImageIndex = 19
+ ShortCut = 16453
+ OnClick = miSwitchGridClick
+ end
+ object Separator2: TMenuItem
+ Caption = '-'
+ end
object miToFore: TMenuItem
- Caption = 'Передвинуть вперед'
+ Caption = 'Bring to Front'
Enabled = False
ImageIndex = 25
ShortCut = 16605
OnClick = aMoveToFore
end
object miToBack: TMenuItem
- Caption = 'Передвинуть назад'
+ Caption = 'Send to Back'
Enabled = False
ImageIndex = 13
ShortCut = 16603
OnClick = aMoveToBack
end
- end
- object miMenuTools: TMenuItem
- Caption = 'Инструменты'
- object miSnapToGrid: TMenuItem
- Caption = 'Привязка к сетке'
- ImageIndex = 20
- ShortCut = 16465
- OnClick = miSnapToGridClick
+ object miLine6: TMenuItem
+ Caption = '-'
end
- object miMiniMap: TMenuItem
- Caption = 'Мини-карта'
+ object miMapOptions: TMenuItem
+ Caption = 'Map Properties...'
ImageIndex = 14
- ShortCut = 16471
- OnClick = miMiniMapClick
- end
- object miSwitchGrid: TMenuItem
- Caption = 'Переключить сетку'
- ImageIndex = 19
- ShortCut = 16453
- OnClick = miSwitchGridClick
+ ShortCut = 16461
+ OnClick = aMapOptionsExecute
end
- object miShowEdges: TMenuItem
- Caption = 'Границы карты'
- ImageIndex = 29
- OnClick = miShowEdgesClick
+ object miOptions: TMenuItem
+ Caption = 'Preferences...'
+ Enabled = False
+ ImageIndex = 16
+ Visible = False
+ OnClick = aEditorOptionsExecute
end
+ end
+ object miMenuView: TMenuItem
+ Caption = 'View'
object miLayers: TMenuItem
- Caption = 'Слои'
+ Caption = 'Show Layers'
ImageIndex = 25
object miLayer1: TMenuItem
Caption = 'Фон'
OnClick = miLayer9Click
end
end
+ object miViewLine1: TMenuItem
+ Caption = '-'
+ end
+ object miMiniMap: TMenuItem
+ Caption = 'Show Minimap'
+ ImageIndex = 14
+ ShortCut = 16471
+ OnClick = miMiniMapClick
+ end
+ object miShowEdges: TMenuItem
+ Caption = 'Show Map Bounds'
+ ImageIndex = 29
+ OnClick = miShowEdgesClick
+ end
+ object miViewLine2: TMenuItem
+ Caption = '-'
+ end
+ object miMapPreview: TMenuItem
+ Caption = 'Preview Mode'
+ ImageIndex = 23
+ ShortCut = 9
+ OnClick = miMapPreviewClick
+ end
end
object miMenuService: TMenuItem
- Caption = 'Сервис'
+ Caption = 'Service'
object miCheckMap: TMenuItem
- Caption = 'Проверка карты'
+ Caption = 'Analyse Map...'
ImageIndex = 17
OnClick = aCheckMapExecute
end
object miOptimmization: TMenuItem
- Caption = 'Оптимизация карты'
+ Caption = 'Optimize Map...'
ImageIndex = 18
OnClick = aOptimizeExecute
end
- object miMapPreview: TMenuItem
- Caption = 'Предварительный просмотр'
- ImageIndex = 23
- ShortCut = 9
- OnClick = miMapPreviewClick
- end
object miTestMap: TMenuItem
- Caption = 'Тест карты в игре'
+ Caption = 'Run Test'
ImageIndex = 27
OnClick = miTestMapClick
end
end
- object miMenuSettings: TMenuItem
- Caption = 'Настройка'
- object miMapOptions: TMenuItem
- Caption = 'Карта'
- ImageIndex = 14
- ShortCut = 16461
- OnClick = aMapOptionsExecute
- end
- object miLine6: TMenuItem
- Caption = '-'
+ object miMenuWindow: TMenuItem
+ Caption = 'Window'
+ Enabled = False
+ Visible = False
+ object miMacMinimize: TMenuItem
+ Caption = 'Minimize'
+ ShortCut = 4173
+ OnClick = miMacMinimizeClick
end
- object miOptions: TMenuItem
- Caption = 'Редактор'
- ImageIndex = 16
- OnClick = aEditorOptionsExecute
+ object miMacZoom: TMenuItem
+ Caption = 'Zoom'
+ OnClick = miMacZoomClick
end
end
object miMenuHelp: TMenuItem
- Caption = 'Справка'
+ Caption = 'Help'
object miAbout: TMenuItem
- Caption = 'О программе'
+ Caption = 'About Editor'
+ Enabled = False
ImageIndex = 16
+ Visible = False
OnClick = aAboutExecute
end
end
- object miHidden1: TMenuItem
+ object miMenuHidden: TMenuItem
Caption = 'hidden'
Visible = False
object minexttab: TMenuItem
end
object pmShow: TPopupMenu
Images = ImageList
- left = 128
- top = 64
+ Left = 128
+ Top = 64
object miLayerP1: TMenuItem
Caption = 'Фон'
Checked = True
object ilToolbar: TImageList
Height = 24
Width = 24
- left = 64
- top = 101
+ Left = 64
+ Top = 101
Bitmap = {
4C7A090000001800000018000000810800000000000078DAED9C4D6C13471886
73E4C021C71C9020200E415C0C17A2860A0511513797BAD046A610D1084465A4
'ColorS=F0FBFF'
'ColorT=A4A0A0'
)
- left = 64
- top = 146
+ Left = 64
+ Top = 146
end
object MapTestTimer: TTimer
OnTimer = MapTestCheck
- left = 192
- top = 64
+ Left = 192
+ Top = 64
end
end
diff --git a/src/editor/f_main.pas b/src/editor/f_main.pas
index 5fbd3607212f2c5d05c74a6a5ea1283fcbba5bb9..790a646a334b9ff69700d3237260483e6baf427b 100644 (file)
--- a/src/editor/f_main.pas
+++ b/src/editor/f_main.pas
lLoad: TLabel;
// Главное меню:
MainMenu: TMainMenu;
+ // Apple menu:
+ miApple: TMenuItem;
+ miAppleAbout: TMenuItem;
+ miAppleLine0: TMenuItem;
+ miApplePref: TMenuItem;
+ miAppleLine1: TMenuItem;
// "Файл":
miMenuFile: TMenuItem;
miNewMap: TMenuItem;
miOpenMap: TMenuItem;
miSaveMap: TMenuItem;
miSaveMapAs: TMenuItem;
+ miMacRecentSubMenu: TMenuItem;
+ miMacRecentClear: TMenuItem;
miOpenWadMap: TMenuItem;
miLine1: TMenuItem;
miReopenMap: TMenuItem;
miSaveMiniMap: TMenuItem;
miDeleteMap: TMenuItem;
miPackMap: TMenuItem;
+ miWinRecent: TMenuItem;
miLine2: TMenuItem;
miExit: TMenuItem;
// "Правка":
miLine5: TMenuItem;
miToFore: TMenuItem;
miToBack: TMenuItem;
- // "Инструменты":
- miMenuTools: TMenuItem;
- miSnapToGrid: TMenuItem;
- miMiniMap: TMenuItem;
- miSwitchGrid: TMenuItem;
+ // View menu:
+ miMenuView: TMenuItem;
miShowEdges: TMenuItem;
miLayers: TMenuItem;
miLayer1: TMenuItem;
miLayer7: TMenuItem;
miLayer8: TMenuItem;
miLayer9: TMenuItem;
+ miViewLine1: TMenuItem;
+ miMiniMap: TMenuItem;
+ miViewLine2: TMenuItem;
+ miMapPreview: TMenuItem;
+ miSnapToGrid: TMenuItem;
+ miSwitchGrid: TMenuItem;
+ miLine6: TMenuItem;
+ miOptions: TMenuItem;
+ miMapOptions: TMenuItem;
// "Сервис":
miMenuService: TMenuItem;
miCheckMap: TMenuItem;
miOptimmization: TMenuItem;
- miMapPreview: TMenuItem;
miTestMap: TMenuItem;
- // "Настройка":
- miMenuSettings: TMenuItem;
- miMapOptions: TMenuItem;
- miLine6: TMenuItem;
- miOptions: TMenuItem;
+ // Window menu:
+ miMenuWindow: TMenuItem;
+ miMacMinimize: TMenuItem;
+ miMacZoom: TMenuItem;
// "Справка":
miMenuHelp: TMenuItem;
miAbout: TMenuItem;
// Скрытый пункт меню для Ctrl+Tab:
- miHidden1: TMenuItem;
+ miMenuHidden: TMenuItem;
minexttab: TMenuItem;
// Панель инструментов:
pbLoad: TProgressBar;
pLoadProgress: TPanel;
RenderPanel: TOpenGLControl;
+ Separator1: TMenuItem;
+ miMacRecentEnd: TMenuItem;
+ miWinRecentStart: TMenuItem;
+ Separator2: TMenuItem;
tbNewMap: TToolButton;
tbOpenMap: TToolButton;
tbSaveMap: TToolButton;
procedure FormDropFiles(Sender: TObject; const FileNames: array of String);
procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
procedure FormResize(Sender: TObject);
+ procedure FormWindowStateChange(Sender: TObject);
+ procedure miMacRecentClearClick(Sender: TObject);
+ procedure miMacZoomClick(Sender: TObject);
procedure lbTextureListClick(Sender: TObject);
procedure lbTextureListDrawItem(Control: TWinControl; Index: Integer;
ARect: TRect; State: TOwnerDrawState);
+ procedure miMacMinimizeClick(Sender: TObject);
procedure miReopenMapClick(Sender: TObject);
procedure RenderPanelMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
procedure RenderPanelMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
procedure miSaveMiniMapClick(Sender: TObject);
procedure bClearTextureClick(Sender: TObject);
procedure miPackMapClick(Sender: TObject);
- procedure aRecentFileExecute(Sender: TObject);
procedure miTestMapClick(Sender: TObject);
procedure sbVerticalScroll(Sender: TObject; ScrollCode: TScrollCode;
var ScrollPos: Integer);
private
procedure Draw();
procedure OnIdle(Sender: TObject; var Done: Boolean);
+ procedure RefillRecentMenu (menu: TMenuItem; start: Integer; fmt: AnsiString);
public
procedure RefreshRecentMenu();
procedure OpenMapFile(FileName: String);
begin
ShowMap := not ShowMap;
MainForm.tbShowMap.Down := ShowMap;
+ MainForm.miMiniMap.Checked := ShowMap;
end;
procedure ShowEdges();
drEdge[3] := 255
else
drEdge[3] := gAlphaEdge;
+ MainForm.miShowEdges.Checked := drEdge[3] <> 255;
end;
function SelectedTexture(): String;
//Закончились вспомогательные процедуры
//----------------------------------------
-procedure TMainForm.RefreshRecentMenu();
-var
- i: Integer;
- MI: TMenuItem;
+type
+ TRecentHandler = class
+ private
+ FForm: TMainForm;
+ FPath: String;
+ public
+ constructor Create (form: TMainForm; path: String);
+ procedure Execute (Sender: TObject);
+ end;
+
+constructor TRecentHandler.Create (form: TMainForm; path: String);
begin
-// Лишние запомненные карты:
- while RecentFiles.Count > RecentCount do
- RecentFiles.Delete(RecentFiles.Count-1);
+ Assert(form <> nil);
+ FForm := form;
+ FPath := path;
+end;
+
+procedure TRecentHandler.Execute (Sender: TObject);
+ var fn: AnsiString;
+begin
+ fn := g_ExtractWadName(FPath);
+ if FileExists(fn) then
+ OpenMap(fn, g_ExtractFilePathName(FPath))
+ else
+ Application.MessageBox('', 'File not available anymore', MB_OK);
+// if Application.MessageBox(PChar(_lc[I_MSG_DEL_RECENT_PROMT]), PChar(_lc[I_MSG_DEL_RECENT]), MB_ICONQUESTION or MB_YESNO) = idYes then
+// begin
+// RecentFiles.Delete(n);
+// RefreshRecentMenu();
+// end;
+end;
-// Лишние строки меню:
- while MainMenu.Items[0].Count > RECENT_FILES_MENU_START do
- MainMenu.Items[0].Delete(MainMenu.Items[0].Count-1);
+procedure TMainForm.RefillRecentMenu (menu: TMenuItem; start: Integer; fmt: AnsiString);
+ var i: Integer; MI: TMenuItem; cb: TMethod; h: TRecentHandler; s: AnsiString;
+begin
+ Assert(menu <> nil);
+ Assert(start >= 0);
+ Assert(start <= menu.Count);
-// Отделение списка карт от строки "Выход":
- if RecentFiles.Count > 0 then
+ // clear all recent entries from menu
+ i := start;
+ while i < menu.Count do
begin
- MI := TMenuItem.Create(MainMenu.Items[0]);
- MI.Caption := '-';
- MainMenu.Items[0].Add(MI);
+ MI := menu.Items[i];
+ cb := TMethod(MI.OnClick);
+ if cb.Code = @TRecentHandler.Execute then
+ begin
+ // this is recent menu entry
+ // remove it and free callback handler
+ h := TRecentHandler(cb.Data);
+ menu.Delete(i);
+ MI.Free();
+ h.Free();
+ end
+ else
+ Inc(i);
end;
-// Добавление в меню списка запомненных карт:
- for i := 0 to RecentFiles.Count-1 do
+ // fill with a new ones
+ for i := 0 to RecentFiles.Count - 1 do
begin
- MI := TMenuItem.Create(MainMenu.Items[0]);
- MI.Caption := IntToStr(i+1) + ' ' + RecentFiles[i];
- MI.OnClick := aRecentFileExecute;
- MainMenu.Items[0].Add(MI);
+ s := RecentFiles[i];
+ h := TRecentHandler.Create(self, s);
+ MI := TMenuItem.Create(menu);
+ MI.Caption := Format(fmt, [i + 1, g_ExtractWadNameNoPath(s), g_ExtractFilePathName(s)]);
+ MI.OnClick := h.Execute;
+ menu.Insert(start + i, MI);
end;
end;
-procedure TMainForm.aRecentFileExecute(Sender: TObject);
-var
- n: Integer;
- fn, s: String;
-begin
- s := LowerCase((Sender as TMenuItem).Caption);
- Delete(s, Pos('&', s), 1);
- s := Trim(Copy(s, 1, 2));
- n := StrToIntDef(s, 0) - 1;
- if (n >= 0) and (n <= RecentFiles.Count) then
+procedure TMainForm.RefreshRecentMenu();
+ var start: Integer;
+begin
+ while RecentFiles.Count > RecentCount do
+ RecentFiles.Delete(RecentFiles.Count - 1);
+
+ if miMacRecentSubMenu.Visible then
begin
- fn := g_ExtractWadName(RecentFiles[n]);
- if FileExists(fn) then
- begin
- s := g_ExtractFilePathName(RecentFiles[n]);
- OpenMap(fn, s)
- end
- else if Application.MessageBox(PChar(_lc[I_MSG_DEL_RECENT_PROMT]), PChar(_lc[I_MSG_DEL_RECENT]), MB_ICONQUESTION or MB_YESNO) = idYes then
- begin
- RecentFiles.Delete(n);
- RefreshRecentMenu();
- end
- end
+ // Reconstruct OSX-like recent list
+ RefillRecentMenu(miMacRecentSubMenu, 0, '%1:s - %2:s');
+ miMacRecentEnd.Enabled := RecentFiles.Count <> 0;
+ miMacRecentEnd.Visible := RecentFiles.Count <> 0;
+ end;
+
+ if miWinRecentStart.Visible then
+ begin
+ // Reconstruct Windows-like recent list
+ start := miMenuFile.IndexOf(miWinRecent);
+ if start < 0 then start := miMenuFile.Count else start := start + 1;
+ RefillRecentMenu(miMenuFile, start, '%0:d %1:s:%2:s');
+ miWinRecent.Enabled := False;
+ miWinRecent.Visible := RecentFiles.Count = 0;
+ end;
+end;
+
+procedure TMainForm.miMacRecentClearClick(Sender: TObject);
+begin
+ RecentFiles.Clear();
+ RefreshRecentMenu();
end;
procedure TMainForm.aEditorOptionsExecute(Sender: TObject);
begin
Randomize();
+ {$IFDEF DARWIN}
+ miApple.Enabled := True;
+ miApple.Visible := True;
+ miMacRecentSubMenu.Enabled := True;
+ miMacRecentSubMenu.Visible := True;
+ miWinRecentStart.Enabled := False;
+ miWinRecentStart.Visible := False;
+ miWinRecent.Enabled := False;
+ miWinRecent.Visible := False;
+ miLine2.Enabled := False;
+ miLine2.Visible := False;
+ miExit.Enabled := False;
+ miExit.Visible := False;
+ miOptions.Enabled := False;
+ miOptions.Visible := False;
+ miMenuWindow.Enabled := True;
+ miMenuWindow.Visible := True;
+ miAbout.Enabled := False;
+ miAbout.Visible := False;
+ {$ELSE}
+ miApple.Enabled := False;
+ miApple.Visible := False;
+ miMacRecentSubMenu.Enabled := False;
+ miMacRecentSubMenu.Visible := False;
+ miWinRecentStart.Enabled := True;
+ miWinRecentStart.Visible := True;
+ miWinRecent.Enabled := True;
+ miWinRecent.Visible := True;
+ miLine2.Enabled := True;
+ miLine2.Visible := True;
+ miExit.Enabled := True;
+ miExit.Visible := True;
+ miOptions.Enabled := True;
+ miOptions.Visible := True;
+ miMenuWindow.Enabled := False;
+ miMenuWindow.Visible := False;
+ miAbout.Enabled := True;
+ miAbout.Visible := True;
+ {$ENDIF}
+
+ miNewMap.ShortCut := ShortCut(VK_N, [ssModifier]);
+ miOpenMap.ShortCut := ShortCut(VK_O, [ssModifier]);
+ miSaveMap.ShortCut := ShortCut(VK_S, [ssModifier]);
+ {$IFDEF DARWIN}
+ miSaveMapAs.ShortCut := ShortCut(VK_S, [ssModifier, ssShift]);
+ miReopenMap.ShortCut := ShortCut(VK_F5, [ssModifier]);
+ {$ENDIF}
+ miUndo.ShortCut := ShortCut(VK_Z, [ssModifier]);
+ miCopy.ShortCut := ShortCut(VK_C, [ssModifier]);
+ miCut.ShortCut := ShortCut(VK_X, [ssModifier]);
+ miPaste.ShortCut := ShortCut(VK_V, [ssModifier]);
+ miSelectAll.ShortCut := ShortCut(VK_A, [ssModifier]);
+ miToFore.ShortCut := ShortCut(VK_LCL_CLOSE_BRACKET, [ssModifier]);
+ miToBack.ShortCut := ShortCut(VK_LCL_OPEN_BRACKET, [ssModifier]);
+ {$IFDEF DARWIN}
+ miMapOptions.Shortcut := ShortCut(VK_P, [ssModifier, ssAlt]);
+ selectall1.Shortcut := ShortCut(VK_A, [ssModifier, ssAlt]);
+ {$ENDIF}
+
e_WriteLog('Doom 2D: Forever Editor version ' + EDITOR_VERSION, MSG_NOTIFY);
e_WriteLog('Build date: ' + EDITOR_BUILDDATE + ' ' + EDITOR_BUILDTIME, MSG_NOTIFY);
e_WriteLog('Build hash: ' + g_GetBuildHash(), MSG_NOTIFY);
RecentFiles := TStringList.Create();
for i := 0 to RecentCount-1 do
begin
- s := config.ReadStr('RecentFiles', IntToStr(i+1), '');
+ {$IFDEF WINDOWS}
+ s := config.ReadStr('RecentFilesWin', IntToStr(i), '');
+ {$ELSE}
+ s := config.ReadStr('RecentFilesUnix', IntToStr(i), '');
+ {$ENDIF}
if s <> '' then
RecentFiles.Add(s);
end;
MapOffset.Y := -sbVertical.Position;
end;
+procedure TMainForm.FormWindowStateChange(Sender: TObject);
+ {$IFDEF DARWIN}
+ var e: Boolean;
+ {$ENDIF}
+begin
+ {$IFDEF DARWIN}
+ // deactivate all menus when main window minimized
+ e := self.WindowState <> wsMinimized;
+ miMenuFile.Enabled := e;
+ miMenuEdit.Enabled := e;
+ miMenuView.Enabled := e;
+ miMenuService.Enabled := e;
+ miMenuWindow.Enabled := e;
+ miMenuHelp.Enabled := e;
+ miMenuHidden.Enabled := e;
+ {$ENDIF}
+end;
+
procedure SelectNextObject(X, Y: Integer; ObjectType: Byte; ID: DWORD);
var
j, j_max: Integer;
procedure TMainForm.FormDestroy(Sender: TObject);
var
config: TConfig;
+ s: AnsiString;
i: Integer;
begin
config := TConfig.CreateFile(CfgFileName);
config.WriteInt('Editor', 'MonsterRectAlpha', gAlphaMonsterRect);
config.WriteInt('Editor', 'AreaRectAlpha', gAlphaAreaRect);
- for i := 0 to RecentCount-1 do
- if i < RecentFiles.Count then
- config.WriteStr('RecentFiles', IntToStr(i+1), RecentFiles[i])
- else
- config.WriteStr('RecentFiles', IntToStr(i+1), '');
+ for i := 0 to RecentCount - 1 do
+ begin
+ if i < RecentFiles.Count then s := RecentFiles[i] else s := '';
+ {$IFDEF WINDOWS}
+ config.WriteStr('RecentFilesWin', IntToStr(i), s);
+ {$ELSE}
+ config.WriteStr('RecentFilesUnix', IntToStr(i), s);
+ {$ENDIF}
+ end;
RecentFiles.Free();
config.SaveFile(CfgFileName);
end;
end;
+procedure TMainForm.miMacMinimizeClick(Sender: TObject);
+begin
+ self.WindowState := wsMinimized;
+ self.FormWindowStateChange(Sender);
+end;
+
+procedure TMainForm.miMacZoomClick(Sender: TObject);
+begin
+ if self.WindowState = wsMaximized then
+ self.WindowState := wsNormal
+ else
+ self.WindowState := wsMaximized;
+ self.FormWindowStateChange(Sender);
+end;
+
procedure TMainForm.miReopenMapClick(Sender: TObject);
var
FileName, Resource: String;
index 029ef181c9bbd5ca73a33c9787e3b640b99e9aa3..4d3ae7ed69acbbee655e126627a2d6ae45f6282f 100644 (file)
('MENU FILE', 'File',
'Файл'),
- ('MENU FILE NEW', 'New Map',
- 'Ð\9dоваÑ\8f каÑ\80Ñ\82а'),
- ('MENU FILE OPEN', 'Open Map',
- 'Открыть карту'),
- ('MENU FILE SAVE', 'Save Map',
- 'Сохранить карту'),
- ('MENU FILE SAVE AS', 'Save Map As...',
- 'Сохранить карту как...'),
- ('MENU FILE OPEN WAD', 'Select Map',
- 'Выбрать карту'),
- ('MENU FILE REOPEN', 'Reopen Map',
+ ('MENU FILE NEW', 'New',
+ 'СоздаÑ\82Ñ\8c'),
+ ('MENU FILE OPEN', 'Open...',
+ 'Открыть...'),
+ ('MENU FILE SAVE', 'Save',
+ 'Сохранить'),
+ ('MENU FILE SAVE AS', 'Save As...',
+ 'Сохранить как...'),
+ ('MENU FILE OPEN WAD', 'Select Map...',
+ 'Выбрать карту...'),
+ ('MENU FILE REOPEN', 'Revert to Saved',
'Открыть заново'),
- ('MENU FILE SAVE MINI', 'Save Mini-map',
- 'Сохранить мини-карту'),
- ('MENU FILE DELETE', 'Delete Map from WAD...',
- 'УдалиÑ\82Ñ\8c каÑ\80Ñ\82Ñ\83 из WAD...'),
- ('MENU FILE PACK MAP', 'Pack Map',
- 'УпаковаÑ\82Ñ\8c каÑ\80Ñ\82Ñ\83'),
+ ('MENU FILE SAVE MINI', 'Save Minimap...',
+ 'Сохранить мини-карту...'),
+ ('MENU FILE DELETE', 'Delete from WAD...',
+ 'Удалить из WAD...'),
+ ('MENU FILE PACK MAP', 'Pack to WAD...',
+ 'УпаковаÑ\82Ñ\8c в WAD...'),
('MENU FILE EXIT', 'Exit',
'Выход'),
'Инструменты'),
('MENU TOOLS SNAP GRID', 'Snap to Grid',
'Привязка к сетке'),
- ('MENU TOOLS MINIMAP', 'Show Mini-map',
- 'Ð\9cини-каÑ\80Ñ\82а'),
- ('MENU TOOLS STEP GRID', 'Switch Grid step',
- 'Сменить шаг сетки'),
- ('MENU TOOLS SHOW EDGES', 'Switch Map edges',
- 'Ð\93раницы карты'),
+ ('MENU TOOLS MINIMAP', 'Show Minimap',
+ 'Ð\9fоказаÑ\82Ñ\8c Ð\9cини-каÑ\80Ñ\82Ñ\83'),
+ ('MENU TOOLS STEP GRID', 'Switch Grid Granularity',
+ 'Ð\9fеÑ\80еклÑ\8eÑ\87ить шаг сетки'),
+ ('MENU TOOLS SHOW EDGES', 'Show Map Bounds',
+ 'Ð\9fоказÑ\8bваÑ\82Ñ\8c границы карты'),
('MENU TOOLS LAYERS', 'Layers',
'Слои'),
('MENU SERV', 'Service',
'Сервис'),
- ('MENU SERV TEST', 'Check the Map',
- 'Проверка карты'),
- ('MENU SERV OPT', 'Optimize the Map',
- 'Оптимизация карты'),
- ('MENU SERV PREVIEW', 'Map Preview',
+ ('MENU SERV TEST', 'Analyse Map...',
+ 'Проверка карты...'),
+ ('MENU SERV OPT', 'Optimize Map...',
+ 'Оптимизация карты...'),
+ ('MENU SERV PREVIEW', 'Preview Mode',
'Предварительный просмотр'),
- ('MENU SERV LAUNCH', 'In-game test',
+ ('MENU SERV LAUNCH', 'Run Test',
'Тест карты в игре'),
('MENU SETS', 'Settings',
'Настройка'),
- ('MENU SETS MAP', 'Map parameters',
- 'Ð\9fаÑ\80амеÑ\82Ñ\80Ñ\8b каÑ\80Ñ\82Ñ\8b'),
- ('MENU SETS EDITOR', 'Editor settings',
- 'Настройки редактора'),
+ ('MENU SETS MAP', 'Map Properties...',
+ 'СвойÑ\81Ñ\82ва каÑ\80Ñ\82Ñ\8b...'),
+ ('MENU SETS EDITOR', 'Preferences...',
+ 'Настройки...'),
('MENU SETS LAUNCH', 'In-game test settings',
'Настройки теста в игре'),
'Включить/Отключить отображение сетки'),
('MENU TB GRID STEP', 'Switch Grid step',
'Изменить шаг сетки'),
- ('MENU TB LAUNCH', 'In-game test',
+ ('MENU TB LAUNCH', 'Run Test',
'Тест карты в игре'),
('MENU LAUNCH SETS', 'Settings...',
'Выберите текстуру'),
('CAP KEYS', 'Keys',
'Ключи'),
- ('CAP TEST', 'Map Checking',
+ ('CAP TEST', 'Analyse Map',
'Проверка карты'),
- ('CAP OPT', 'Map Optimization',
+ ('CAP OPT', 'Optimize Map',
'Оптимизация карты'),
- ('CAP SETS', 'Map Parameters',
- 'Ð\9fаÑ\80амеÑ\82Ñ\80Ñ\8b карты'),
+ ('CAP SETS', 'Map Properties',
+ 'СвойÑ\81Ñ\82ва карты'),
('CAP LAUNCH', 'In-game test Settings',
'Настройки теста в игре'),
- ('CAP ES', 'Editor Settings',
+ ('CAP ES', 'Editor Preferences',
'Настройки редактора'),
('CAP PACK', 'Pack Map',
'Упаковать карту'),
('CAP SAVE', 'Save Map',
'Сохранить карту'),
- ('CAP MINI', 'Save Mini-map',
+ ('CAP MINI', 'Save Minimap',
'Сохранить мини-карту'),
('CAP SELECT', 'Select Map',
'Выберите карту'),
miToFore.Caption := _lc[I_MENU_EDIT_TO_FORE];
miToBack.Caption := _lc[I_MENU_EDIT_TO_BACK];
// "Инструменты":
- miMenuTools.Caption := _lc[I_MENU_TOOLS];
miSnapToGrid.Caption := _lc[I_MENU_TOOLS_SNAP_GRID];
miMiniMap.Caption := _lc[I_MENU_TOOLS_MINIMAP];
miSwitchGrid.Caption := _lc[I_MENU_TOOLS_STEP_GRID];
miLayer7.Caption := _lc[I_MENU_LAYER_MONSTER];
miLayer8.Caption := _lc[I_MENU_LAYER_AREA];
miLayer9.Caption := _lc[I_MENU_LAYER_TRIGGER];
+ miMapOptions.Caption := _lc[I_MENU_SETS_MAP];
+ miOptions.Caption := _lc[I_MENU_SETS_EDITOR];
// "Сервис":
miMenuService.Caption := _lc[I_MENU_SERV];
miCheckMap.Caption := _lc[I_MENU_SERV_TEST];
miOptimmization.Caption := _lc[I_MENU_SERV_OPT];
miMapPreview.Caption := _lc[I_MENU_SERV_PREVIEW];
miTestMap.Caption := _lc[I_MENU_SERV_LAUNCH];
- // "Настройка":
- miMenuSettings.Caption := _lc[I_MENU_SETS];
- miMapOptions.Caption := _lc[I_MENU_SETS_MAP];
- miOptions.Caption := _lc[I_MENU_SETS_EDITOR];
// "Справка":
miMenuHelp.Caption := _lc[I_MENU_HELP];
miAbout.Caption := _lc[I_MENU_HELP_ABOUT];