From 2c9620afac1b97de36f43af1aed9e48fc0aa50c2 Mon Sep 17 00:00:00 2001
From: chaosua <544218+chaosua@users.noreply.github.com>
Date: Sat, 27 Jan 2024 14:58:28 +0200
Subject: [PATCH] * fix searching in Search tabs (Quest, Creature, Gameobject,
Item) -removed duplicated IDs (was depended on how many locales it have)
---
MainUnit.dfm | 57 +++++++++++++++++-
MainUnit.pas | 138 ++++++++++++++++++++++++++++---------------
SettingsUnit.dfm | 21 ++++---
SettingsUnit.pas | 1 +
Truice.dproj | 4 +-
trinity_revision.txt | 4 +-
version.txt | 2 +-
7 files changed, 167 insertions(+), 60 deletions(-)
diff --git a/MainUnit.dfm b/MainUnit.dfm
index de1ef6d..4213518 100644
--- a/MainUnit.dfm
+++ b/MainUnit.dfm
@@ -33,6 +33,8 @@ object MainForm: TMainForm
Font.Style = []
ParentFont = False
TabOrder = 0
+ ExplicitWidth = 952
+ ExplicitHeight = 692
object tsQuest: TTabSheet
Caption = 'Quest'
ImageIndex = 1
@@ -448,6 +450,7 @@ object MainForm: TMainForm
Width = 300
end>
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 1
@@ -5203,6 +5206,7 @@ object MainForm: TMainForm
Width = 80
end>
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 0
@@ -5262,6 +5266,7 @@ object MainForm: TMainForm
Width = 70
end>
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 1
@@ -5457,6 +5462,7 @@ object MainForm: TMainForm
Width = 80
end>
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 0
@@ -5516,6 +5522,7 @@ object MainForm: TMainForm
Width = 70
end>
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 1
@@ -6061,6 +6068,7 @@ object MainForm: TMainForm
Width = 40
end>
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 1
@@ -7931,6 +7939,7 @@ object MainForm: TMainForm
Width = 100
end>
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 0
@@ -8440,6 +8449,7 @@ object MainForm: TMainForm
Width = 135
end>
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 1
@@ -8834,6 +8844,7 @@ object MainForm: TMainForm
AutoSize = True
Caption = 'VerifiedBuild'
end>
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 0
@@ -9281,6 +9292,7 @@ object MainForm: TMainForm
Width = 200
end>
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 0
@@ -9741,6 +9753,7 @@ object MainForm: TMainForm
Width = 200
end>
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 0
@@ -10199,6 +10212,7 @@ object MainForm: TMainForm
Width = 200
end>
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 0
@@ -10644,6 +10658,7 @@ object MainForm: TMainForm
Width = 120
end>
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 0
@@ -11064,6 +11079,7 @@ object MainForm: TMainForm
item
end>
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 0
@@ -11343,6 +11359,7 @@ object MainForm: TMainForm
Width = 180
end>
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 0
@@ -12413,6 +12430,7 @@ object MainForm: TMainForm
Width = 80
end>
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 0
@@ -12469,6 +12487,7 @@ object MainForm: TMainForm
Width = 80
end>
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 0
@@ -12525,6 +12544,7 @@ object MainForm: TMainForm
Width = 80
end>
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 0
@@ -12793,6 +12813,7 @@ object MainForm: TMainForm
Caption = 'VerifiedBuild'
end>
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 0
@@ -13095,6 +13116,7 @@ object MainForm: TMainForm
AutoSize = True
Caption = 'VerifiedBuild'
end>
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 0
@@ -13378,6 +13400,7 @@ object MainForm: TMainForm
AutoSize = True
Caption = 'VerifiedBuild'
end>
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 0
@@ -13559,6 +13582,7 @@ object MainForm: TMainForm
Align = alTop
BevelOuter = bvNone
TabOrder = 0
+ ExplicitWidth = 944
end
object PageControl4: TPageControl
Left = 0
@@ -13568,6 +13592,8 @@ object MainForm: TMainForm
ActivePage = tsGOQuestItem
Align = alClient
TabOrder = 1
+ ExplicitWidth = 944
+ ExplicitHeight = 659
object tsSearchGO: TTabSheet
Caption = 'Search'
object Panel6: TPanel
@@ -13829,6 +13855,7 @@ object MainForm: TMainForm
Caption = 'Count'
end>
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 1
@@ -14894,6 +14921,7 @@ object MainForm: TMainForm
Width = 100
end>
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 0
@@ -15467,6 +15495,7 @@ object MainForm: TMainForm
Width = 20
end>
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 0
@@ -15733,6 +15762,7 @@ object MainForm: TMainForm
Width = 80
end>
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 0
@@ -15788,6 +15818,7 @@ object MainForm: TMainForm
Width = 80
end>
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 0
@@ -15843,6 +15874,7 @@ object MainForm: TMainForm
Width = 80
end>
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 0
@@ -16094,7 +16126,7 @@ object MainForm: TMainForm
ViewStyle = vsReport
OnChange = lvgoqiGOQuestItemChange
OnSelectItem = lvgoqiGOQuestItemSelectItem
- ColumnsOrder = '0=171,1=168,2=168,3=168'
+ ColumnsOrder = '0=166,1=163,2=163,3=163'
ExtendedColumns = <
item
end
@@ -16104,6 +16136,7 @@ object MainForm: TMainForm
end
item
end>
+ ExplicitWidth = 655
end
object edgoqiGameObjectEntry: TLabeledEdit
Left = 64
@@ -16729,6 +16762,7 @@ object MainForm: TMainForm
Font.Name = 'MS Sans Serif'
Font.Style = []
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
ParentFont = False
@@ -20622,6 +20656,7 @@ object MainForm: TMainForm
Width = 200
end>
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 0
@@ -21087,6 +21122,7 @@ object MainForm: TMainForm
Width = 150
end>
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 0
@@ -21552,6 +21588,7 @@ object MainForm: TMainForm
Width = 150
end>
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 0
@@ -22008,6 +22045,7 @@ object MainForm: TMainForm
Width = 150
end>
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 0
@@ -22470,6 +22508,7 @@ object MainForm: TMainForm
Width = 150
end>
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 0
@@ -22941,6 +22980,7 @@ object MainForm: TMainForm
Width = 90
end>
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 0
@@ -23050,6 +23090,7 @@ object MainForm: TMainForm
Width = 150
end>
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 0
@@ -23136,6 +23177,7 @@ object MainForm: TMainForm
Width = 80
end>
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 0
@@ -23191,6 +23233,7 @@ object MainForm: TMainForm
Width = 80
end>
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 0
@@ -23246,6 +23289,7 @@ object MainForm: TMainForm
Width = 80
end>
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 0
@@ -23301,6 +23345,7 @@ object MainForm: TMainForm
Width = 80
end>
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 0
@@ -23356,6 +23401,7 @@ object MainForm: TMainForm
Width = 80
end>
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 0
@@ -23953,6 +23999,7 @@ object MainForm: TMainForm
item
end>
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 0
@@ -24890,6 +24937,7 @@ object MainForm: TMainForm
Width = 135
end>
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 0
@@ -25497,6 +25545,7 @@ object MainForm: TMainForm
Width = 200
end>
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 2
@@ -25818,6 +25867,7 @@ object MainForm: TMainForm
Caption = 'VerifiedBuild'
end>
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 0
@@ -26632,6 +26682,7 @@ object MainForm: TMainForm
end>
Enabled = False
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 0
@@ -26675,6 +26726,7 @@ object MainForm: TMainForm
end>
Enabled = False
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 2
@@ -26838,6 +26890,7 @@ object MainForm: TMainForm
Width = 65
end>
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 0
@@ -27402,6 +27455,7 @@ object MainForm: TMainForm
Width = 60
end>
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 1
@@ -28631,6 +28685,7 @@ object MainForm: TMainForm
Width = 250
end>
HideSelection = False
+ Items.ItemData = {}
ReadOnly = True
RowSelect = True
TabOrder = 2
diff --git a/MainUnit.pas b/MainUnit.pas
index b094234..57de70b 100644
--- a/MainUnit.pas
+++ b/MainUnit.pas
@@ -21,7 +21,7 @@ interface
VERSION_1 = '2'; //*10000
VERSION_2 = '1'; //*100
VERSION_3 = '6';
- VERSION_4 = '11';
+ VERSION_4 = '13';
VERSION_EXE = VERSION_1 + '.' + VERSION_2 + '.' + VERSION_3 + '.' + VERSION_4;
SCRIPT_TAB_NO_QUEST = 6;
@@ -2505,7 +2505,6 @@ procedure TMainForm.SearchQuest;
end;
ID := edQuestID.Text;
- //Locales :=
QTilte := edQuestTitle.Text;
QTilte := StringReplace(QTilte, '''', '\''', [rfReplaceAll]);
QTilte := StringReplace(QTilte, ' ', '%', [rfReplaceAll]);
@@ -2522,10 +2521,17 @@ procedure TMainForm.SearchQuest;
if QTilte<>'%%' then
begin
- if WhereStr<> '' then
- WhereStr := Format('%s AND ((qt.`LogTitle` LIKE ''%s'') OR (lq.title LIKE ''%1:s''))',[WhereStr, QTilte])
- else
- WhereStr := Format('WHERE ((qt.`LogTitle` LIKE ''%s'')OR (lq.title LIKE ''%0:s''))',[QTilte]);
+ if loc<>'enUS' then begin
+ if WhereStr<> '' then
+ WhereStr := Format('%s AND ((qt.`LogTitle` LIKE ''%s'') OR (lq.`title` LIKE ''%1:s'' AND lq.`locale`=''%2:s''))',[WhereStr, QTilte, loc])
+ else
+ WhereStr := Format('WHERE ((qt.`LogTitle` LIKE ''%s'') OR (lq.`title` LIKE ''%0:s'' AND lq.`locale`=''%1:s''))',[QTilte, loc]);
+ end else begin
+ if WhereStr<> '' then
+ WhereStr := Format('%s AND `LogTitle` LIKE ''%s'' ',[WhereStr, QTilte])
+ else
+ WhereStr := Format('WHERE `LogTitle` LIKE ''%s''',[QTilte]);
+ end;
end;
if qgq<>'' then
@@ -2594,7 +2600,13 @@ procedure TMainForm.SearchQuest;
if Trim(WhereStr)='' then
if MessageDlg(dmMain.Text[134], mtConfirmation, mbYesNoCancel, -1)<>mrYes then Exit;
- QueryStr := Format('SELECT * FROM quest_template qt LEFT OUTER JOIN quest_template_locale lq ON qt.ID=lq.Id %s',[WhereStr]);
+ if loc<>'enUS' then
+ QueryStr := Format('SELECT qt.`ID`, MAX(qt.`LogTitle`) AS `LogTitle`, MAX(''%s'') AS `locale`, '+
+ '(SELECT `Title` FROM `quest_template_locale` WHERE `ID` = qt.`ID` AND `locale` = ''%0:s'') AS `Title`, '+
+ '(SELECT `Details` FROM `quest_template_locale` WHERE `ID` = qt.`ID` AND `locale` = ''%0:s'') AS `Details` '+
+ 'FROM `quest_template` qt LEFT OUTER JOIN `quest_template_locale` lq ON qt.`ID` = lq.`ID` '+
+ ' %1:s GROUP BY qt.`ID`',[loc, WhereStr])
+ else QueryStr := Format('SELECT `ID`, `LogTitle`, `QuestDescription` as `Details` FROM `quest_template` qt %s',[WhereStr]);
MyQuery.SQL.Text := QueryStr;
lvQuest.Items.BeginUpdate;
@@ -2609,6 +2621,7 @@ procedure TMainForm.SearchQuest;
begin
Field := MyQuery.FindField(lvQuest.Columns[i].Caption);
t := '';
+ if (i=1) AND (loc='enUS') then t:=loc;
if Assigned(Field) then
begin
t := Field.AsString;
@@ -4297,18 +4310,32 @@ procedure TMainForm.SearchCreature;
if CName<>'%%' then
begin
- if WhereStr<> '' then
- WhereStr := Format('%s AND ((ct.`name` LIKE ''%s'') OR (lc.`name` LIKE ''%1:s''))',[WhereStr, CName])
- else
- WhereStr := Format('WHERE ((ct.`name` LIKE ''%s'') OR (lc.`name` LIKE ''%0:s''))',[CName]);
+ if loc<>'enUS' then begin
+ if WhereStr<> '' then
+ WhereStr := Format('%s AND ((ct.`name` LIKE ''%s'') OR (lc.`name` LIKE ''%1:s'' AND lc.`locale`=''%2:s''))',[WhereStr, CName, loc])
+ else
+ WhereStr := Format('WHERE ((ct.`name` LIKE ''%s'') OR (lc.`name` LIKE ''%0:s'' AND lc.`locale`=''%1:s''))',[CName, loc]);
+ end else begin
+ if WhereStr<> '' then
+ WhereStr := Format('%s AND `name` LIKE ''%s'' ',[WhereStr, CName])
+ else
+ WhereStr := Format('WHERE `name` LIKE ''%s''',[CName]);
+ end;
end;
if CSubName<>'%%' then
begin
- if WhereStr<> '' then
- WhereStr := Format('%s AND ((ct.`subname` LIKE ''%s'') OR (lc.`subname` LIKE ''%1:s''))',[WhereStr, CSubName])
- else
- WhereStr := Format('WHERE ((ct.`subname` LIKE ''%s'') OR (lc.`subname` LIKE ''%0:s''))',[CSubName]);
+ if loc<>'enUS' then begin
+ if WhereStr<> '' then
+ WhereStr := Format('%s AND ((ct.`subname` LIKE ''%s'') OR (lc.`subname` LIKE ''%1:s'' AND lc.`locale`=''%2:s''))',[WhereStr, CSubName, loc])
+ else
+ WhereStr := Format('WHERE ((ct.`subname` LIKE ''%s'') OR (lc.`subname` LIKE ''%0:s'' AND lc.`locale`=''%1:s''))',[CSubName, loc]);
+ end else begin
+ if WhereStr<> '' then
+ WhereStr := Format('%s AND `subname` LIKE ''%s'' ',[WhereStr, CSubName])
+ else
+ WhereStr := Format('WHERE `subname` LIKE ''%s''',[CSubName]);
+ end;
end;
npcflag := edSearchCreaturenpcflag.Text;
@@ -4352,7 +4379,16 @@ procedure TMainForm.SearchCreature;
if Trim(WhereStr)='' then
if MessageDlg(dmMain.Text[134], mtConfirmation, mbYesNoCancel, -1)<>mrYes then Exit;
- QueryStr := Format('SELECT *,(SELECT count(guid) from `creature` where creature.id = ct.entry) as `Count` FROM `creature_template` ct LEFT OUTER JOIN creature_template_locale lc ON ct.entry=lc.entry %s',[WhereStr]);
+ if loc<>'enUS' then
+ QueryStr := Format('SELECT ct.`entry`, MAX(ct.`name`) as `name`, MAX(ct.`subname`) as `subname`, ct.`npcflag`, ct.`minlevel`, ct.`maxlevel`, '+
+ '(SELECT count(guid) from `creature` where creature.`id` = ct.`entry`) as `Count`, '+
+ '(SELECT `Title` FROM `creature_template_locale` WHERE `entry` = ct.`entry` AND `locale` = ''%0:s'') AS Title '+
+ 'FROM `creature_template` ct LEFT OUTER JOIN creature_template_locale lc ON ct.`entry`=lc.`entry` %s'+
+ 'GROUP BY ct.`entry`',[loc, WhereStr])
+ else QueryStr := Format('SELECT `entry`, `name`, `subname`, `npcflag`, `minlevel`, `maxlevel`, '+
+ '(SELECT count(guid) from `creature` where creature.`id` = ct.`entry`) as `Count` '+
+ 'FROM `creature_template` ct %s',[WhereStr]);
+
MyQuery.SQL.Text := QueryStr;
lvSearchCreature.Items.BeginUpdate;
try
@@ -6735,10 +6771,17 @@ procedure TMainForm.SearchGO;
if CName<>'%%' then
begin
- if WhereStr<> '' then
- WhereStr := Format('%s AND ((gt.`name` LIKE ''%s'') OR (lg.`name` LIKE ''%1:s''))',[WhereStr, CName])
- else
- WhereStr := Format('WHERE ((gt.`name` LIKE ''%s'') OR (lg.`name` LIKE ''%0:s''))',[CName]);
+ if loc<>'enUS' then begin
+ if WhereStr<> '' then
+ WhereStr := Format('%s AND ((gt.`name` LIKE ''%s'') OR (lg.`name` LIKE ''%1:s'' AND lg.`locale`=''%2:s'' ))',[WhereStr, CName, loc])
+ else
+ WhereStr := Format('WHERE ((gt.`name` LIKE ''%s'') OR (lg.`name` LIKE ''%0:s'' AND lg.`locale`=''%1:s'' ))',[CName, loc]);
+ end else begin
+ if WhereStr<> '' then
+ WhereStr := Format('%s AND `name` LIKE ''%s'' ',[WhereStr, CName])
+ else
+ WhereStr := Format('WHERE `name` LIKE ''%s''',[CName]);
+ end;
end;
type_ := StrToIntDef(edSearchGOtype.Text,-1);
@@ -6789,7 +6832,16 @@ procedure TMainForm.SearchGO;
if Trim(WhereStr)='' then
if MessageDlg(dmMain.Text[134], mtConfirmation, mbYesNoCancel, -1)<>mrYes then Exit;
- QueryStr := Format('SELECT *, (SELECT count(guid) from `gameobject` where gameobject.id = gt.entry) as `Count` FROM `gameobject_template` gt LEFT OUTER JOIN `gameobject_template_locale` lg ON gt.entry=lg.entry %s',[WhereStr]);
+ if loc<>'enUS' then
+ QueryStr := Format('SELECT gt.`entry`, MAX(gt.`name`) as `name`, gt.`type`, '+
+ '(SELECT `faction` from `gameobject_template_addon` WHERE gameobject_template_addon.`entry` = gt.`entry`) as `faction`, '+
+ '(SELECT count(guid) from `gameobject` where gameobject.`id` = gt.`entry`) as `Count` '+
+ 'FROM `gameobject_template` gt LEFT OUTER JOIN `gameobject_template_locale` lg ON gt.`entry`=lg.`entry` %s '+
+ 'GROUP BY gt.`entry`',[WhereStr])
+ else QueryStr := Format('SELECT `entry`, `name`, `type`, '+
+ '(SELECT `faction` from `gameobject_template_addon` WHERE gameobject_template_addon.`entry` = gt.`entry`) as `faction`, '+
+ '(SELECT count(guid) from `gameobject` where gameobject.`id` = gt.`entry`) as `Count` '+
+ 'FROM `gameobject_template` gt %s',[WhereStr]);
MyQuery.SQL.Text := QueryStr;
lvSearchGO.Items.BeginUpdate;
@@ -9289,20 +9341,17 @@ procedure TMainForm.SearchItem;
if Name<>'%%' then
begin
- if (loc<>'enUS') then begin
- if (WhereStr<> '') then
- WhereStr := Format('%s AND ((it.`name` LIKE ''%s'') OR (li.`name` LIKE ''%1:s'' AND li.`locale` = ''%s''))',[WhereStr, Name, loc])
- else
- WhereStr := Format('WHERE ((it.`name` LIKE ''%s'') OR (li.`name` LIKE ''%0:s'' AND li.`locale` = ''%s''))',[Name, loc]);
- end
- else begin
- if (WhereStr<> '') then
- WhereStr := Format('%s AND (it.`name` LIKE ''%s'')',[WhereStr, Name])
- else
- WhereStr := Format('WHERE (it.`name` LIKE ''%s'')',[Name]);
- end;
-
-
+ if loc<>'enUS' then begin
+ if WhereStr<> '' then
+ WhereStr := Format('%s AND ((it.`name` LIKE ''%s'') OR (li.`name` LIKE ''%1:s'' AND li.`locale`=''%2:s''))',[WhereStr, Name, loc])
+ else
+ WhereStr := Format('WHERE ((it.`name` LIKE ''%s'') OR (li.`name` LIKE ''%0:s'' AND li.`locale`=''%1:s''))',[Name, loc]);
+ end else begin
+ if WhereStr<> '' then
+ WhereStr := Format('%s AND `name` LIKE ''%s'' ',[WhereStr, Name])
+ else
+ WhereStr := Format('WHERE `name` LIKE ''%s''',[Name]);
+ end;
end;
class_ := StrToIntDef(edSearchItemClass.Text, -1);
@@ -9371,18 +9420,13 @@ procedure TMainForm.SearchItem;
if Trim(WhereStr)='' then
if MessageDlg(dmMain.Text[134], mtConfirmation, mbYesNoCancel, -1)<>mrYes then Exit;
- if (loc<>'enUS') then begin
- if (Name<>'%%') then begin
- if ID<>'' then
- QueryStr := Format('SELECT * FROM `item_template` it LEFT OUTER JOIN item_template_locale li ON it.entry=li.ID %s LIMIT 1',[WhereStr])
- else
- QueryStr := Format('SELECT * FROM `item_template` it LEFT OUTER JOIN item_template_locale li ON it.entry=li.ID %s',[WhereStr])
- end
- else
- QueryStr := Format('SELECT * FROM `item_template` it %s',[WhereStr])
- end
- else
- QueryStr := Format('SELECT * FROM `item_template` it %s',[WhereStr]);
+ if loc<>'enUS' then
+ QueryStr := Format('SELECT it.`entry`, MAX(it.`name`) as `name`, it.`class`, it.`subclass`, it.`Quality`, it.`InventoryType`, '+
+ 'it.`itemset`, it.`RequiredLevel` '+
+ 'FROM `item_template` it LEFT OUTER JOIN `item_template_locale` li ON it.`entry`=li.`ID` %s'+
+ 'GROUP BY it.`entry`',[WhereStr])
+ else QueryStr := Format('SELECT `entry`, `name`, `class`, `subclass`, `Quality`, `InventoryType`, '+
+ '`itemset`, `RequiredLevel` FROM `item_template` %s',[WhereStr]);
MyQuery.SQL.Text := QueryStr;
lvSearchItem.Items.BeginUpdate;
diff --git a/SettingsUnit.dfm b/SettingsUnit.dfm
index e50384c..6c1f7b0 100644
--- a/SettingsUnit.dfm
+++ b/SettingsUnit.dfm
@@ -459,9 +459,9 @@ object SettingsForm: TSettingsForm
object lbLanguage: TLabel
Left = 16
Top = 16
- Width = 48
+ Width = 134
Height = 13
- Caption = 'Language'
+ Caption = 'Language ( Truice interface)'
end
object lbLocales: TLabel
Left = 16
@@ -472,6 +472,13 @@ object SettingsForm: TSettingsForm
'Locales (Quest locales tab will load proper translation if exist' +
's)'
end
+ object lblovales2: TLabel
+ Left = 16
+ Top = 83
+ Width = 255
+ Height = 13
+ Caption = 'Affects Search Tabs (search names in *_locale tables)'
+ end
object cbxLanguage: TComboBox
Left = 16
Top = 35
@@ -482,7 +489,7 @@ object SettingsForm: TSettingsForm
end
object cbxLocales: TComboBox
Left = 16
- Top = 83
+ Top = 102
Width = 313
Height = 21
Style = csDropDownList
@@ -677,7 +684,7 @@ object SettingsForm: TSettingsForm
350
41)
object btOK: TButton
- Left = 180
+ Left = 176
Top = 6
Width = 75
Height = 25
@@ -686,10 +693,10 @@ object SettingsForm: TSettingsForm
ModalResult = 1
TabOrder = 0
OnClick = btOKClick
- ExplicitLeft = 176
+ ExplicitLeft = 172
end
object btCancel: TButton
- Left = 261
+ Left = 257
Top = 6
Width = 75
Height = 25
@@ -698,7 +705,7 @@ object SettingsForm: TSettingsForm
Caption = 'Cancel'
ModalResult = 2
TabOrder = 1
- ExplicitLeft = 257
+ ExplicitLeft = 253
end
end
end
diff --git a/SettingsUnit.pas b/SettingsUnit.pas
index 2b1bc59..404f6fb 100644
--- a/SettingsUnit.pas
+++ b/SettingsUnit.pas
@@ -52,6 +52,7 @@ TSettingsForm = class(TForm)
lbDBCLocale: TLabel;
cbxLocales: TComboBox;
lbLocales: TLabel;
+ lblovales2: TLabel;
procedure FormCreate(Sender: TObject);
procedure btDelClick(Sender: TObject);
procedure btUpClick(Sender: TObject);
diff --git a/Truice.dproj b/Truice.dproj
index 07895fc..061feee 100644
--- a/Truice.dproj
+++ b/Truice.dproj
@@ -128,14 +128,14 @@
LeakChecking;$(DCC_Define)
1033
true
- CompanyName=;FileVersion=2.1.6.9;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=2.1.6.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName)
+ CompanyName=;FileVersion=2.1.6.13;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=2.1.6.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName)
2
3
Debug
true
false
6
- 9
+ 13
system
diff --git a/trinity_revision.txt b/trinity_revision.txt
index 2647f09..584007d 100644
--- a/trinity_revision.txt
+++ b/trinity_revision.txt
@@ -1,4 +1,4 @@
Truice DB Structure last checked against revision
-4ac2241403ca9fd12f14d71f87214e044fb0f592 30.12.2023
-[2023_12_03_00_world.sql]
+b4783d6cace49ae0cfe2b0d5059ba776840b307b 27.01.2024
+[2024_01_20_00_world.sql]
diff --git a/version.txt b/version.txt
index b04e869..ca3d01d 100644
--- a/version.txt
+++ b/version.txt
@@ -1 +1 @@
-2.1.6.9
\ No newline at end of file
+2.1.6.13
\ No newline at end of file