diff --git a/src/editor/g_map.pas b/src/editor/g_map.pas
index 792f258c43bb41a22a472eaf166e062391ddde1e..0c35d481384f5164798248af97a007c9244106b7 100644 (file)
--- a/src/editor/g_map.pas
+++ b/src/editor/g_map.pas
fn := fn + Res;
end
else
- fn := EditorDir + 'wads/' + Res;
+ fn := WadsDir + DirectorySeparator + Res;
g_CreateTextureWAD(SKY_TEXTURE, fn);
end;
NH := 0;
MainForm.pbLoad.Position := 0;
- MainForm.lLoad.Caption := _lc[I_LOAD_WAD];
+ MainForm.lLoad.Caption := MsgLoadWad;
Application.ProcessMessages();
// Читаем ресурс карты
MapReader := TMapReader_1.Create();
- MainForm.lLoad.Caption := _lc[I_LOAD_MAP];
+ MainForm.lLoad.Caption := MsgLoadMap;
Application.ProcessMessages();
MapReader.LoadMap(pData);
begin
MainForm.pbLoad.Position := 0;
MainForm.pbLoad.Max := Length(textures);
- MainForm.lLoad.Caption := _lc[I_LOAD_TEXTURES];
+ MainForm.lLoad.Caption := MsgLoadTextures;
for a := 0 to High(textures) do
begin
if _fn = '' then
TextureRes := FileName + ustr
else
- TextureRes := EditorDir+'wads/'+ustr;
+ TextureRes := WadsDir + DirectorySeparator + ustr;
Error := False;
begin
MainForm.pbLoad.Position := 0;
MainForm.pbLoad.Max := Length(panels);
- MainForm.lLoad.Caption := _lc[I_LOAD_PANELS];
+ MainForm.lLoad.Caption := MsgLoadPanels;
for a := 0 to High(panels) do
begin
begin
MainForm.pbLoad.Position := 0;
MainForm.pbLoad.Max := Length(items);
- MainForm.lLoad.Caption := _lc[I_LOAD_ITEMS];
+ MainForm.lLoad.Caption := MsgLoadItems;
for a := 0 to High(items) do
begin
begin
MainForm.pbLoad.Position := 0;
MainForm.pbLoad.Max := Length(monsters);
- MainForm.lLoad.Caption := _lc[I_LOAD_MONSTERS];
+ MainForm.lLoad.Caption := MsgLoadMonsters;
for a := 0 to High(monsters) do
begin
begin
MainForm.pbLoad.Position := 0;
MainForm.pbLoad.Max := Length(areas);
- MainForm.lLoad.Caption := _lc[I_LOAD_AREAS];
+ MainForm.lLoad.Caption := MsgLoadAreas;
for a := 0 to High(areas) do
begin
begin
MainForm.pbLoad.Position := 0;
MainForm.pbLoad.Max := Length(triggers);
- MainForm.lLoad.Caption := _lc[I_LOAD_TRIGGERS];
+ MainForm.lLoad.Caption := MsgLoadTriggers;
for a := 0 to High(triggers) do
begin
// Открытие карты:
MainForm.pbLoad.Position := 0;
- MainForm.lLoad.Caption := _lc[I_LOAD_MAP];;
+ MainForm.lLoad.Caption := MsgLoadMap;;
Application.ProcessMessages();
map := TConfig.CreateFile(_FileName);
MainForm.pbLoad.Max := i;
MainForm.pbLoad.Position := 0;
- MainForm.lLoad.Caption := _lc[I_LOAD_TEXTURES];
+ MainForm.lLoad.Caption := MsgLoadTextures;
for a := 1 to i do
begin
MainForm.pbLoad.StepIt();
Application.ProcessMessages();
- s := TexturePrefix + UpperCase(map.ReadStr('Textures', 'TextureName'+IntToStr(a), ''));
+ s := TexturePrefix + UpperCase(win2utf(map.ReadStr('Textures', 'TextureName'+IntToStr(a), '')));
if s = TexturePrefix then
Continue;
// Нет такой текстуры - ищем в WAD карты:
- if not g_CreateTextureWAD(s, EditorDir+'wads/'+s) then
+ if not g_CreateTextureWAD(s, WadsDir + DirectorySeparator + s) then
begin
s := ExtractFileName(_FileName);
Delete(s, Length(s)-3, 4);
s := UpperCase(s) + '.WAD:TEXTURES\'+ UpperCase(win2utf(map.ReadStr('Textures', 'TextureName'+IntToStr(a), '')));
- if not g_CreateTextureWAD(s, EditorDir+'wads/'+s) then
+ if not g_CreateTextureWAD(s, WadsDir + DirectorySeparator + s) then
Continue;
end;
MainForm.pbLoad.Max := i;
MainForm.pbLoad.Position := 0;
- MainForm.lLoad.Caption := _lc[I_LOAD_PANELS];
+ MainForm.lLoad.Caption := MsgLoadPanels;
for a := 1 to i do
begin
if not map.SectionExists(section) then
Continue;
+ panel := Default(TPanel);
panel.X := map.ReadInt(section, 'X1', 0);
panel.Y := map.ReadInt(section, 'Y1', 0);
panel.Height := map.ReadInt(section, 'Height', 16);
end;
panel.Alpha := map.ReadInt(section, 'Alpha', 0);
+ panel.Blending := false;
// Текстура панели:
if panel.PanelType in [PANEL_WALL, PANEL_BACK, PANEL_FORE, PANEL_STEP] then
begin
- s := TexturePrefix + UpperCase(map.ReadStr(section, 'TextureName', ''));
+ s := TexturePrefix + UpperCase(win2utf(map.ReadStr(section, 'TextureName', '')));
if g_GetTexture(s, panel.TextureID) then
begin
MainForm.pbLoad.Max := i;
MainForm.pbLoad.Position := 0;
- MainForm.lLoad.Caption := _lc[I_LOAD_ITEMS];
+ MainForm.lLoad.Caption := MsgLoadItems;
for a := 1 to i do
begin
if not map.SectionExists(section) then
Continue;
+ item := Default(TItem);
item.X := map.ReadInt(section, 'X', 0);
item.Y := map.ReadInt(section, 'Y', 0);
item.ItemType := ITEMSCONVERT[map.ReadInt(section, 'Type', 0)];
MainForm.pbLoad.Max := i;
MainForm.pbLoad.Position := 0;
- MainForm.lLoad.Caption := _lc[I_LOAD_AREAS];
+ MainForm.lLoad.Caption := MsgLoadAreas;
for a := 1 to i do
begin
if not map.SectionExists(section) then
Continue;
+ area := Default(TArea);
area.X := map.ReadInt(section, 'X', 0);
area.Y := map.ReadInt(section, 'Y', 0);
area.AreaType := map.ReadInt(section, 'Type', 0);
end;
// Чтение параметров карты:
+ gMapInfo := Default(TMapInfo);
with gMapInfo do
begin
- Name := map.ReadStr('MapOptions', 'MapName', '');
- Description := map.ReadStr('MapOptions', 'MapDescription', '');
+ Name := win2utf(map.ReadStr('MapOptions', 'MapName', ''));
+ Description := win2utf(map.ReadStr('MapOptions', 'MapDescription', ''));
Author := '';
MusicName := DefaultMusRes;
SkyName := DefaultSkyRes;
SetLength(Description, 256);
end;
+ LoadSky(gMapInfo.SkyName);
+
map.Free();
Result := True;
SetLength(gTriggers, 0);
gTriggers := nil;
- with gMapInfo do
- begin
- Name := '';
- Description := '';
- Author := '';
- MusicName := '';
- SkyName := '';
- FileName := '';
- Height := 1600;
- Width := 1600;
- end;
+ gMapInfo := Default(TMapInfo);
+ gMapInfo.Width := 1600;
+ gMapInfo.Height := 1600;
with MainForm.lbTextureList do
begin