Berserker
Posts: 16164
|
|
14.07.2020 18:51 |
|
Archer30
Posts: 927
|
|
15.07.2020 13:03 |
|
daemon_n
Posts: 4271
|
|
15.07.2020 14:22 |
|
Archer30
Posts: 927
|
daemon, doesn't think so. The Chinese characters and non-Chinese were align with different position, that's the problem.
Take a look at the bracket in the middle, that's where the worst part is:
W/o WND:
W/ WND:

Edit: I believe that WOG CN makes some tweaks to characters so that all character get along quite well. But since WoG Native were introduced, this was broken. It has to be resolved from WoG CN plugin anyway.
Latest ERA mods and scripts in development - My GitHub
(This post was last modified: 15.07.2020 18:02 by Archer30.)
|
|
15.07.2020 14:32 |
|
Berserker
Posts: 16164
|
Code:
posEnd:=i;
startX:=x;
startY:=y+FontHeight*Row;
case mode of
0,4,8 :startX:=x;
1,5,9 :startX:=x+((Width-l) div 2);
2,6,10:startX:=x+Width-l;
end;
case mode of
0,1,2,3:startY:=y+(FontHeight)*Row;
4,5,6,7:begin
if height<MaxRow*(FontHeight) then
begin
if height<(FontHeight+FontHeight) then
StartY:=y+(FontHeight*Row)+(height-FontHeight)div 2
else startY:=y+(FontHeight)*Row;
end else startY:=y+(FontHeight)*Row+(height-MaxRow*(FontHeight))div 2;
end;
8,9,10,11:begin
if height<MaxRow*(FontHeight) then
begin
if height<(FontHeight+FontHeight) then
StartY:=y+(FontHeight*Row)+(height-FontHeight)
else startY:=y+(FontHeight)*Row;
end
else startY:=y+(FontHeight)*Row+height-MaxRow*(FontHeight);
end;
end;
Chinese plugin is written almost without comments.
Скачать Герои 3 Эра и всё, что с ней связано / ERA 2.46f для старых модов
Поддержать проект
|
|
15.07.2020 15:45 |
|
Archer30
Posts: 927
|
|
15.07.2020 17:11 |
|
Berserker
Posts: 16164
|
|
15.07.2020 17:38 |
|
Zur13
Posts: 223
|
Я не знаю в правильную ли тему пишу, просто меня несколько утомило постоянно мышкой выбирать нужный пункт в диалогах с кучей чекбоксов нельзя ли в ЭРА добавить возможность выбора нужного пункта (чекбокса) в диалогах типа !!IF:G с помощью клавиатуры например клавишами [1]-[0],[-],[=]?
|
|
18.07.2020 20:34 |
|
wessonsm
Posts: 823
|
Есть прекрасная опция "ErmLegacySupport" в ERA 2, но кажется, она не совсем работает так, как надо...
Я еще не проверял, но проверю.
y-переменные должны обнулятся, x-переменные должны наследоваться, и обнуляться должны только не объявленные, и только при вызове из триггера, а не из функции. При вызове из функции должны наследоваться, в !!DO должны обнуляться только в первом цикле при вызове из триггера (не из функции!!), в остальных случаях должны наследоваться...
Куча старых скриптов работает неправильно из-за этого...
|
|
18.07.2020 20:54 |
|
RoseKavalier
Posts: 118
|
@Archer30
Is hdmod being used? It might be a text filtering option.
CN plugin doesn't draw English characters, it lets the game handle it... which means hdmod would adjust its position if that's what is happening.
Code:
if (byte(str[i]) > 160) then begin
[...]
else begin
EngTextOut(hfont,byte(str[i]),Surface,cx,cy, ColorB + ColorSel);
cx:=cx+GetEngCharWidth(byte(str[i]),hfont);
end;
Other than that Native Dialogs use a custom font which doesn't line up with "normal" English fonts.

EDIT: in fact, medium font is 16 pixels high, the provided one is 15 pixels high.
(This post was last modified: 18.07.2020 23:22 by RoseKavalier.)
|
|
18.07.2020 23:17 |
|
Archer30
Posts: 927
|
RoseKavalier, thanks for so much help! HD mod does nothing to my test results though. The performance are exactly the same with or without HD.
I agree that CN plugin only draws Chinese characters, but since ERA seem to have different way of handling characters, it makes some difference for different dialogs.
Check this out:

non-ERA specific dialog (aka this dialog is also available in SoD) in ERA
As you might notice, the bracket from this dialog has different style comparing it in English SoD. All brackets for non-ERA specific dialogs look like this, much better than in WoG Native Dialogs. How does this work? This is the best result I would like to achieve with text in WND.
Hmmm, so my best bet would be editing all characters from custom fonts of WND? Can I appoint another font that combo with Chinese characters better?
Latest ERA mods and scripts in development - My GitHub
(This post was last modified: 19.07.2020 00:43 by Archer30.)
|
|
19.07.2020 00:09 |
|
RoseKavalier
Posts: 118
|
To my eye those brackets look worse, lacks shadow and lack curvature (:
Try swapping out native dialog pac's fonts, see if that makes any difference. Also hdmod started inserting its own fonts at some point, they can be renamed or deleted safely.
igrik would be better placed to comment, but as far as I can tell his code doesn't change the way fonts are drawn, it just changes which fonts get selected.
gu7979gu's font 'detection' is not very safe, it checks 4 first characters or font name and compares against 'bigf' (BIGFONT) and then 'tiny' (TINYFONT) otherwise assumes MEDFONT. Native dialogs changes a lot of existing fonts, no idea if that can have an impact by failing to detect correct font.
Code:
procedure SetFont(hfont:integer;var Width,Height:integer);stdcall;
begin
if pInteger(hfont+4)^=1718053218 then // bigf in hex
begin
Width:=Font24Width;
Height:=Font24Height;
end else
if pInteger(hfont+4)^=2037279092 then // tiny in hex
begin
Width:=FontTinyWidth;
Height:=FontTinyHeight;
end else
begin
Width:=Font12Width;
Height:=Font12Height;
end;
end;
(This post was last modified: 19.07.2020 01:07 by RoseKavalier.)
|
|
19.07.2020 01:06 |
|
Archer30
Posts: 927
|
RoseKavalier, thank you so much for the enlightment, problem solved! I just copied the small/med/bigfont from Chinese WoG and renamed to xxxfont2.fnt, now all worked out.
Well, can't say you are wrong. but this is what HoMM 3 official Chinese versions look like. Ppl get used to this font since 20 years ago.
Latest ERA mods and scripts in development - My GitHub
|
|
19.07.2020 13:38 |
|
Berserker
Posts: 16164
|
RoseKavalier, thanks, indeed! It's really not reliable way to detect tiny/med/big using first 4 bytes.
(19.07.2020 17:43)Zur13 Wrote: почему триггеры !?FU77007 и !?FU77006 из ЭРЫ срабатывают именно в таком порядке, сначала триггер фазы регенерации отряда перед получением хода, а только потом решение какой отряд будет ходить? У меня проблема в том, что триггер !?FU77007 срабатывает для одного стека, а потом я в триггере !?FU77006 меняю стек который получит ход и всё, получается что 77007 сработал для одного стека, а ходит другой стек. Внутри моего мода это половина проблемы и можно как-то костылей набросать, а вот если другой мод будет менять порядок ходов, то для моего мода это вызовет очень большие проблемы. Считаю что такое поведение в корне неверно, есть ли какой-то другой способ выполнить действия перед передачей управления определенному стеку на поле боя?
Zur13, я, если получится, гляну, почему так вышло неудобно, что регенерация до определения очерёдности идёт. Тоже столкнулся в скриптах с такой проблемой.
Скачать Герои 3 Эра и всё, что с ней связано / ERA 2.46f для старых модов
Поддержать проект
|
|
20.07.2020 22:12 |
|
Berserker
Posts: 16164
|
(18.07.2020 20:54)wessonsm Wrote: Есть прекрасная опция "ErmLegacySupport" в ERA 2, но кажется, она не совсем работает так, как надо...
Я еще не проверял, но проверю.
y-переменные должны обнулятся, x-переменные должны наследоваться, и обнуляться должны только не объявленные, и только при вызове из триггера, а не из функции. При вызове из функции должны наследоваться, в !!DO должны обнуляться только в первом цикле при вызове из триггера (не из функции!!), в остальных случаях должны наследоваться...
Куча старых скриптов работает неправильно из-за этого...
[+] Improved "ErmLegacySupport" option. Negative z-variables are not local for classic FU1..FU29999. Negative z-variables are not nulled on FU1..FU29999 enter and other quirks. Old WoG scripts bug count decreased.
[+] Added "ErmLegacySupport" option in heroes3.ini. If set to 1, compatibility with old ERM scripts will be better at the cost of ~15% ERM performance decrease. Options forces local variables reset before each !?XX trigger, even in DO-loops.
Мы про Эру 2 говорим? В основном проблема в скриптах была в использовании y- и x как глобальных переменных, что в корне не верно. y- поведение возвращено только для оригинальных неименованных функций из диапазона 1..30000. Время уже уходить от старых костылей.
Скачать Герои 3 Эра и всё, что с ней связано / ERA 2.46f для старых модов
Поддержать проект
|
|
21.07.2020 12:29 |
|