Skip to content

Commit

Permalink
Merge branch 'master' into editor-resource-setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ihhub authored Dec 18, 2024
2 parents 001cdeb + d9569c8 commit dedb7fe
Show file tree
Hide file tree
Showing 13 changed files with 545 additions and 46 deletions.
2 changes: 2 additions & 0 deletions VisualStudio/fheroes2/sources.props
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
<ClCompile Include="src\fheroes2\editor\editor_options.cpp" />
<ClCompile Include="src\fheroes2\editor\editor_rumor_window.cpp" />
<ClCompile Include="src\fheroes2\editor\editor_save_map_window.cpp" />
<ClCompile Include="src\fheroes2\editor\editor_spell_selection.cpp" />
<ClCompile Include="src\fheroes2\editor\editor_sphinx_window.cpp" />
<ClCompile Include="src\fheroes2\editor\editor_ui_helper.cpp" />
<ClCompile Include="src\fheroes2\editor\history_manager.cpp" />
Expand Down Expand Up @@ -327,6 +328,7 @@
<ClInclude Include="src\fheroes2\editor\editor_options.h" />
<ClInclude Include="src\fheroes2\editor\editor_rumor_window.h" />
<ClInclude Include="src\fheroes2\editor\editor_save_map_window.h" />
<ClInclude Include="src\fheroes2\editor\editor_spell_selection.h" />
<ClInclude Include="src\fheroes2\editor\editor_sphinx_window.h" />
<ClInclude Include="src\fheroes2\editor\editor_ui_helper.h" />
<ClInclude Include="src\fheroes2\editor\history_manager.h" />
Expand Down
4 changes: 4 additions & 0 deletions docs/README_android.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ performed (the cell/cells to be moved to, the angle of attack and the cells subj
affected by this spell, potential damage, and so on). The second touch event is confirmatory, and performs the corresponding
action if and only if this action exactly corresponds to the action that the first touch demonstrates.

To make it easier to select the angle of attack on touchscreens, you can "draw" the angle by swiping your finger from the cell you
intend to attack from, to the cell occupied by the enemy unit. Next, you should remove your finger from the screen, double-check
your planned attack, and then confirm the action by touching the target cell with your finger again.

## Android specific notes
Fullscreen is enabled by default. To have the info bar with the clock visible you can disable fullscreen mode within the
main menu settings under "Graphics".
Expand Down
2 changes: 1 addition & 1 deletion docs/json/lang_ru.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"schemaVersion":1,"label":"Russian","message":"99%","color":"green"}
{"schemaVersion":1,"label":"Russian","message":"100%","color":"green"}
Binary file modified files/data/resurrection.h2d
Binary file not shown.
77 changes: 34 additions & 43 deletions files/lang/ru.po
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Russian translation of fheroes2
# Copyright (C) 2021 - 2023 fheroes2 team <[email protected]>
# Copyright (C) 2021 - 2024 fheroes2 team <[email protected]>
# Copyright (C) 2009 Igor Orlov <[email protected]>
# Copyright (C) 2009 Andrey Afletdinov <[email protected]>
# This file is distributed under the same license as the fheroes2 package.
Expand All @@ -9,7 +9,7 @@ msgstr ""
"Project-Id-Version: fheroes2\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-12-10 01:42+0000\n"
"PO-Revision-Date: 2024-10-04 15:32+0300\n"
"PO-Revision-Date: 2024-12-15 16:55+0300\n"
"Last-Translator: fheroes2 team <[email protected]>\n"
"Language-Team: <[email protected]> <>\n"
"Language: ru\n"
Expand Down Expand Up @@ -326,7 +326,7 @@ msgid "EVENTS"
msgstr "СОБЫТИЯ"

msgid "LANGUAGE"
msgstr ""
msgstr "ЯЗЫК"

msgid "Warrior"
msgstr "Воин"
Expand Down Expand Up @@ -499,7 +499,7 @@ msgstr ""
"Сфера Отрицания лишила возможности использовать любые заклинания в битве."

msgid "You cannot cast spells without a commanding hero."
msgstr ""
msgstr "Вы не можете произносить заклинания без героя на Вашей стороне."

msgid "You have already cast a spell this round."
msgstr "Вы уже использовали магию на этом ходу."
Expand Down Expand Up @@ -3243,9 +3243,8 @@ msgstr "Устанавливает скорость прокрутки окна
msgid "Select Game Language:"
msgstr "Выберите язык игры:"

#, fuzzy
msgid "Select Language:"
msgstr "Выберите язык игры:"
msgstr "Выберите язык:"

msgid "Click to choose the selected language."
msgstr "Нажмите, чтобы применить выбранный язык интерфейса игры."
Expand Down Expand Up @@ -3661,12 +3660,14 @@ msgstr "Цена верности"
msgid "Resurrection"
msgstr "Возрождение"

#, fuzzy
msgid ""
"\n"
"\n"
"Language:\n"
msgstr "Язык"
msgstr ""
"\n"
"\n"
"Язык:\n"

msgid "Lose all your heroes and towns."
msgstr "Потерять всех героев и все города."
Expand Down Expand Up @@ -4567,6 +4568,9 @@ msgid ""
"%{newLanguage}. Some texts might not be displayed properly after this. Do "
"you want to proceed?"
msgstr ""
"Текущий язык карты - %{oldLanguage}. Вы собираетесь сменить его на "
"%{newLanguage}, после чего некоторые сообщения могут отображаться "
"некорректно. Вы хотите продолжить?"

msgid "Change Map Name"
msgstr "Изменить название карты"
Expand All @@ -4589,9 +4593,8 @@ msgstr "Нажмите, чтобы отредактировать календа
msgid "Events"
msgstr "События"

#, fuzzy
msgid "Click to change the language of the map."
msgstr "Изменить язык интерфейса."
msgstr "Изменить язык, используемый на карте."

msgid "Click to change your map name."
msgstr "Нажмите, чтобы изменить название Вашей карты."
Expand Down Expand Up @@ -6214,12 +6217,14 @@ msgid "Keyboard|ABC"
msgstr "АБВ"

msgid "The entered value is invalid."
msgstr ""
msgstr "Введено некорректное значение."

msgid ""
"The entered value is out of range.\n"
"It should be not less than %{minValue} and not more than %{maxValue}."
msgstr ""
"Введённое значение находится за пределами допустимого диапазона.\n"
"Оно должно быть не менее %{minValue} и не более %{maxValue}."

msgid "Kingdom Income"
msgstr "Доход королевства"
Expand Down Expand Up @@ -7770,23 +7775,23 @@ msgstr ""
"\"Есть у меня загадка для тебя,\" - сказал Сфинкс. \"Ответишь верно - "
"получишь награду. Ошибешься - и я тебя съем. Принимаешь ли ты мой вызов?"

#, fuzzy
msgid ""
"The Sphinx asks you the following riddle:\n"
"\n"
"'"
msgstr ""
"Сфинкс загадал Вам следующую загадку: \n"
"Сфинкс загадал Вам следующую загадку:\n"
"\n"
"'%{riddle}'\n"
"\n"
"Ваш ответ?"
"'"

msgid ""
"sphinx|'\n"
"\n"
"Your answer?"
msgstr ""
"'\n"
"\n"
"Ваш ответ?"

msgid ""
"\"You guessed incorrectly,\" the Sphinx says, smiling. The Sphinx swipes at "
Expand Down Expand Up @@ -8728,10 +8733,10 @@ msgid "speed|Instant"
msgstr "Мгновенная"

msgid "Click this button to adjust the level of zoom."
msgstr ""
msgstr "Нажмите эту кнопку, чтобы изменить коэффициент масштабирования."

msgid "Zoom"
msgstr ""
msgstr "Масштаб"

msgid "week|Squirrel"
msgstr "Белки"
Expand Down Expand Up @@ -9721,7 +9726,7 @@ msgid "% immunity to %{spell} spell"
msgstr "% устойчивости к заклинанию %{spell}"

msgid "% damage from Elemental spells"
msgstr "% урона от заклинаний"
msgstr "% урона от заклинаний стихий"

msgid "% damage from %{spell} spell"
msgstr "% урона от заклинания %{spell}"
Expand Down Expand Up @@ -9792,49 +9797,35 @@ msgstr "Элементаль"
msgid "No Morale"
msgstr "Нет морали"

#, fuzzy
msgid "Earth creature"
msgstr "Нанять существ"
msgstr "Земное существо"

#, fuzzy
msgid "Air creature"
msgstr "Нанять существ"
msgstr "Воздушное существо"

#, fuzzy
msgid "Fire creature"
msgstr "Нанять существ"
msgstr "Огненное существо"

#, fuzzy
msgid "Water creature"
msgstr "Озеро"
msgstr "Водное существо"

#, fuzzy
msgid "Double damage from Fire spells"
msgstr "200% урона от заклинаний огня"
msgstr "Двойной урон от заклинаний огня"

#, fuzzy
msgid "Double damage from Cold spells"
msgstr "200% урона от заклинаний холода"
msgstr "Двойной урон от заклинаний холода"

#, fuzzy
msgid "Double damage from Earth creatures"
msgstr ""
"Снимает действия всех заклинаний, как полезных, так и вредных, со всех "
"присутствующих на поле боя отрядов."
msgstr "Двойной урон от земных существ"

#, fuzzy
msgid "Double damage from Air creatures"
msgstr "Двойной урон по нежити"
msgstr "Двойной урон от воздушных существ"

#, fuzzy
msgid "Double damage from Fire creatures"
msgstr "200% урона от заклинаний огня"
msgstr "Двойной урон от огненных существ"

#, fuzzy
msgid "Double damage from Water creatures"
msgstr ""
"Снимает действия всех заклинаний, как полезных, так и вредных, со всех "
"присутствующих на поле боя отрядов."
msgstr "Двойной урон от водных существ"

msgid "Lightning"
msgstr "Молния"
Expand Down
14 changes: 13 additions & 1 deletion src/fheroes2/agg/agg_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5101,13 +5101,25 @@ namespace
auto & images = _icnVsSprite[id];
if ( images.size() == 218 ) {
// Add 2 extra river deltas. Each delta has 7 parts.
images.resize( 218 + 14 );
// Add a new Stone Liths with 3 more images.
images.resize( 218 + 14 + 3 );

for ( size_t i = 0; i < 14; ++i ) {
images[218 + i].resize( images[i].height(), images[i].width() );
fheroes2::Transpose( images[i], images[218 + i] );
images[218 + i].setPosition( images[i].y(), images[i].x() );
}

fheroes2::Sprite temp;
fheroes2::h2d::readImage( "circular_stone_liths_center.image", temp );

images[232].resize( 32, 32 );
images[232].reset();
Copy( temp, 0, 0, images[232], 0, 0, temp.width(), temp.height() );
Copy( images[116], 0, temp.height(), images[232], 0, temp.height(), images[116].width(), images[116].height() - temp.height() );

fheroes2::h2d::readImage( "circular_stone_liths_left.image", images[233] );
fheroes2::h2d::readImage( "circular_stone_liths_top.image", images[234] );
}

return true;
Expand Down
51 changes: 51 additions & 0 deletions src/fheroes2/editor/editor_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#include "editor_map_specs_window.h"
#include "editor_object_popup_window.h"
#include "editor_save_map_window.h"
#include "editor_spell_selection.h"
#include "editor_sphinx_window.h"
#include "game.h"
#include "game_delays.h"
Expand Down Expand Up @@ -410,6 +411,25 @@ namespace

needRedraw = true;
}
else if ( objectIter->group == Maps::ObjectGroup::ADVENTURE_POWER_UPS ) {
const auto & objects = Maps::getObjectsByGroup( objectIter->group );

assert( objectIter->index < objects.size() );
const auto objectType = objects[objectIter->index].objectType;
switch ( objectType ) {
case MP2::OBJ_SHRINE_FIRST_CIRCLE:
case MP2::OBJ_SHRINE_SECOND_CIRCLE:
case MP2::OBJ_SHRINE_THIRD_CIRCLE:
// We cannot assert non-existing metadata as these objects could have been created by an older Editor version.
mapFormat.shrineMetadata.erase( objectIter->id );
break;
default:
break;
}

objectIter = mapTile.objects.erase( objectIter );
needRedraw = true;
}
else {
objectIter = mapTile.objects.erase( objectIter );
needRedraw = true;
Expand Down Expand Up @@ -1382,6 +1402,37 @@ namespace Interface
action.commit();
}
}
else if ( objectType == MP2::OBJ_SHRINE_FIRST_CIRCLE || objectType == MP2::OBJ_SHRINE_SECOND_CIRCLE || objectType == MP2::OBJ_SHRINE_THIRD_CIRCLE ) {
auto shrineMetadata = _mapFormat.shrineMetadata.find( object.id );
if ( shrineMetadata == _mapFormat.shrineMetadata.end() ) {
_mapFormat.shrineMetadata[object.id] = {};
}

auto & originalMetadata = _mapFormat.shrineMetadata[object.id];
auto newMetadata = originalMetadata;

int spellLevel = 0;
if ( objectType == MP2::OBJ_SHRINE_FIRST_CIRCLE ) {
spellLevel = 1;
}
else if ( objectType == MP2::OBJ_SHRINE_SECOND_CIRCLE ) {
spellLevel = 2;
}
else if ( objectType == MP2::OBJ_SHRINE_THIRD_CIRCLE ) {
spellLevel = 3;
}
else {
assert( 0 );
spellLevel = 1;
}

if ( Editor::openSpellSelectionWindow( MP2::StringObject( objectType ), spellLevel, newMetadata.allowedSpells )
&& originalMetadata.allowedSpells != newMetadata.allowedSpells ) {
fheroes2::ActionCreator action( _historyManager, _mapFormat );
originalMetadata = std::move( newMetadata );
action.commit();
}
}
else {
std::string msg = _( "%{object} has no properties to change." );
StringReplace( msg, "%{object}", MP2::StringObject( objectType ) );
Expand Down
Loading

0 comments on commit dedb7fe

Please sign in to comment.