Skip to content

Commit

Permalink
Merge branch 'master' into wip-translator
Browse files Browse the repository at this point in the history
  • Loading branch information
Wohlstand committed Jan 4, 2025
2 parents 1994e25 + ac4d2e8 commit 74b7458
Show file tree
Hide file tree
Showing 37 changed files with 1,022 additions and 230 deletions.
16 changes: 15 additions & 1 deletion Editor/common_features/items.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,20 @@ void Items::getItemGFX(const obj_wld_generic *inObj, QPixmap &outImg, bool whole
TPL_getItemGFX(inObj, outImg, whole, targetSize, imgType);
}

void Items::getItemGFXCW(int itemType, unsigned long ItemID, QPixmap &outImg, bool whole, QSize targetSize)
{
LevelEdit *l_edit = MainWinConnect::pMainWin->activeLvlEditWin();
WorldEdit *w_edit = MainWinConnect::pMainWin->activeWldEditWin();
QGraphicsScene *scene = nullptr;

if(l_edit)
scene = l_edit->scene;
else if(w_edit)
scene = w_edit->scene;

getItemGFX(itemType, ItemID, outImg, scene, whole, targetSize);
}

void Items::getItemGFX(int itemType, unsigned long ItemID, QPixmap &outImg, QGraphicsScene *scene, bool whole, QSize targetSize)
{
LvlScene *scene_lvl = dynamic_cast<LvlScene *>(scene);
Expand Down Expand Up @@ -224,7 +238,7 @@ QString Items::getTilesetToolTip(int itemType, unsigned long ItemID, QGraphicsSc
return "";
}

int Items::getItemType(QString type)
int Items::getItemType(const QString &type)
{
int target = 0;

Expand Down
15 changes: 13 additions & 2 deletions Editor/common_features/items.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@
class Items
{
public:

/*!
* \brief Retreives sprite or single frame of the requested element using currently active window, no scene needed
* \param [__in] itemType Type of the element (Block, BGO, NPC, Terrain tile, World map scenery, Path tile, Level tile)
* \param [__in] ItemID ID of requested element
* \param [__out] outImg Target Pixmap where will be stored requested sprite
* \param [__in] whole Retreive entire srite, overwise single default frame will be retured
* \param [__in] targetSize Scale image to requested size, if 0:0 sent, image will be returned as-is
*/
static void getItemGFXCW(int itemType, unsigned long ItemID, QPixmap &outImg, bool whole=false, QSize targetSize=QSize(0,0));

/*!
* \brief Retreives sprite or single frame of the requested element
* \param [__in] itemType Type of the element (Block, BGO, NPC, Terrain tile, World map scenery, Path tile, Level tile)
Expand All @@ -19,7 +30,7 @@ class Items
* \param [__in] whole Retreive entire srite, overwise single default frame will be retured
* \param [__in] targetSize Scale image to requested size, if 0:0 sent, image will be returned as-is
*/
static void getItemGFX(int itemType, unsigned long ItemID, QPixmap &outImg, QGraphicsScene *scene=NULL, bool whole=false, QSize targetSize=QSize(0,0));
static void getItemGFX(int itemType, unsigned long ItemID, QPixmap &outImg, QGraphicsScene *scene=nullptr, bool whole=false, QSize targetSize=QSize(0,0));

/*!
* \brief Retreives sprite or single frame of the block object configuration
Expand Down Expand Up @@ -65,7 +76,7 @@ class Items
* \param type String contains a word which specifies item type
* \return Item type ID enumerated value
*/
static int getItemType(QString type);
static int getItemType(const QString &type);
};

#endif // ITEMS_H
18 changes: 18 additions & 0 deletions Editor/languages/editor_bg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7713,6 +7713,24 @@ Reason: %1
<source>[Unknown type]</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Set custom health level</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Reserved item</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>&lt;Unknown&gt;</source>
<comment>Unknown NPC from the list</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>[No item]</source>
<comment>Reserve box of player contains no item</comment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>TheXTechEngine</name>
Expand Down
54 changes: 39 additions & 15 deletions Editor/languages/editor_bs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7761,12 +7761,12 @@ Do you want to abort current testing process?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../main_window/testing/testing.cpp" line="272"/>
<location filename="../main_window/testing/testing.cpp" line="288"/>
<source>World map testing of saved file</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../main_window/testing/testing.cpp" line="273"/>
<location filename="../main_window/testing/testing.cpp" line="289"/>
<source>File is not saved!
Do you want to save file or you want to run test of copy which is currently saved on the disk?</source>
<translation type="unfinished"></translation>
Expand Down Expand Up @@ -9678,34 +9678,46 @@ File: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../main_window/testing/testing_settings.ui" line="434"/>
<location filename="../main_window/testing/testing_settings.ui" line="432"/>
<location filename="../main_window/testing/testing_settings.ui" line="677"/>
<source>Set custom health level</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../main_window/testing/testing_settings.ui" line="439"/>
<location filename="../main_window/testing/testing_settings.ui" line="471"/>
<source>Reserved item</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../main_window/testing/testing_settings.ui" line="465"/>
<source>2 Player settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../main_window/testing/testing_settings.ui" line="279"/>
<location filename="../main_window/testing/testing_settings.ui" line="492"/>
<location filename="../main_window/testing/testing_settings.ui" line="294"/>
<location filename="../main_window/testing/testing_settings.ui" line="544"/>
<source>PLSET_State</source>
<comment>Character</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../main_window/testing/testing_settings.ui" line="243"/>
<location filename="../main_window/testing/testing_settings.ui" line="499"/>
<location filename="../main_window/testing/testing_settings.ui" line="340"/>
<location filename="../main_window/testing/testing_settings.ui" line="530"/>
<source>PLSET_Character</source>
<comment>Character</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../main_window/testing/testing_settings.ui" line="411"/>
<location filename="../main_window/testing/testing_settings.ui" line="559"/>
<location filename="../main_window/testing/testing_settings.ui" line="274"/>
<location filename="../main_window/testing/testing_settings.ui" line="537"/>
<source>PLSET_VehicleID</source>
<comment>translate as &quot;Vehicle&quot;</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../main_window/testing/testing_settings.ui" line="418"/>
<location filename="../main_window/testing/testing_settings.ui" line="566"/>
<location filename="../main_window/testing/testing_settings.ui" line="396"/>
<location filename="../main_window/testing/testing_settings.ui" line="636"/>
<source>PLSET_VehicleType</source>
<comment>translate as &quot;Vehicle type&quot;</comment>
<translation type="unfinished"></translation>
Expand Down Expand Up @@ -9818,17 +9830,29 @@ File: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../main_window/testing/testing_settings.cpp" line="209"/>
<location filename="../main_window/testing/testing_settings.cpp" line="210"/>
<location filename="../main_window/testing/testing_settings.cpp" line="254"/>
<location filename="../main_window/testing/testing_settings.cpp" line="255"/>
<source>[No vehicle]</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../main_window/testing/testing_settings.cpp" line="238"/>
<location filename="../main_window/testing/testing_settings.cpp" line="239"/>
<location filename="../main_window/testing/testing_settings.cpp" line="283"/>
<location filename="../main_window/testing/testing_settings.cpp" line="284"/>
<source>[Unknown type]</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../main_window/testing/testing_settings.cpp" line="325"/>
<source>&lt;Unknown&gt;</source>
<comment>Unknown NPC from the list</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../main_window/testing/testing_settings.cpp" line="327"/>
<source>[No item]</source>
<comment>Reserve box of player contains no item</comment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>TheXTechEngine</name>
Expand Down
18 changes: 18 additions & 0 deletions Editor/languages/editor_de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7709,6 +7709,24 @@ Reason: %1
<source>[Unknown type]</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Set custom health level</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Reserved item</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>&lt;Unknown&gt;</source>
<comment>Unknown NPC from the list</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>[No item]</source>
<comment>Reserve box of player contains no item</comment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>TheXTechEngine</name>
Expand Down
18 changes: 18 additions & 0 deletions Editor/languages/editor_en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7869,6 +7869,24 @@ Reason: %1
<source>[Unknown type]</source>
<translation>[Unknown type]</translation>
</message>
<message>
<source>Set custom health level</source>
<translation>Set custom health level</translation>
</message>
<message>
<source>Reserved item</source>
<translation>Reserved item</translation>
</message>
<message>
<source>&lt;Unknown&gt;</source>
<comment>Unknown NPC from the list</comment>
<translation>&lt;Unknown&gt;</translation>
</message>
<message>
<source>[No item]</source>
<comment>Reserve box of player contains no item</comment>
<translation>[No item]</translation>
</message>
</context>
<context>
<name>TheXTechEngine</name>
Expand Down
18 changes: 18 additions & 0 deletions Editor/languages/editor_es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7773,6 +7773,24 @@ Reason: %1
<source>[Unknown type]</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Set custom health level</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Reserved item</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>&lt;Unknown&gt;</source>
<comment>Unknown NPC from the list</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>[No item]</source>
<comment>Reserve box of player contains no item</comment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>TheXTechEngine</name>
Expand Down
18 changes: 18 additions & 0 deletions Editor/languages/editor_fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7787,6 +7787,24 @@ Reason: %1
<source>[Unknown type]</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Set custom health level</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Reserved item</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>&lt;Unknown&gt;</source>
<comment>Unknown NPC from the list</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>[No item]</source>
<comment>Reserve box of player contains no item</comment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>TheXTechEngine</name>
Expand Down
18 changes: 18 additions & 0 deletions Editor/languages/editor_he-il.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7667,6 +7667,24 @@ Reason: %1
<source>[Unknown type]</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Set custom health level</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Reserved item</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>&lt;Unknown&gt;</source>
<comment>Unknown NPC from the list</comment>
<translation type="unfinished"></translation>
</message>
<message>
<source>[No item]</source>
<comment>Reserve box of player contains no item</comment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>TheXTechEngine</name>
Expand Down
Loading

0 comments on commit 74b7458

Please sign in to comment.