Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quest translations do not update w/paging #2966

Open
DeMatt opened this issue Mar 28, 2020 · 18 comments · Fixed by #2971
Open

Quest translations do not update w/paging #2966

DeMatt opened this issue Mar 28, 2020 · 18 comments · Fixed by #2971
Labels

Comments

@DeMatt
Copy link

DeMatt commented Mar 28, 2020

Versions:

Chrome: 80.0.3987.149
OS: Windows 7 SP 1 64-bit
KC3 Kai: 34.4.4
Build: webstore
Game Mode: "Customize DMM Website" (the default)

Steps to reproduce:

Log in, go to the ingame Quests page, select a duration with more than 5 quests (e.g. "Once"), and then move from the first page to any other. Alternatively, instead of moving, use the new "Type" tabs at the upper-right.

Actual behaviour:

Quest translation overlay does not update to match the quests underneath.

Expected behaviour:

Quest translation overlay updates to match the quests underneath.

Screenshots (if applicable):

Quest translation overlay
As seen here, page 1 of the "Others" duration contained five quests, four of which are Arsenal quests. Moving to page 2 did not change the overlay, thus the translations do not match the quests being displayed.

Other comments:

The game used to load from the server when you changed pages, as well as when you changed durations. While it still loads when you change duration, it no longer loads when changing pages (or using the new "Type" tabs). I suspect this is the reason why the overlay isn't updating.

@sinsinpub
Copy link
Contributor

i've no idea if who is working on this... if no injection into game client's pixi event system, stick to our legacy overlay method, the solution might be:

  • Add invisible overlay 'button' to cover all those paginated buttons/numbers/quest type buttons
  • These overlay buttons don't inherit pointer-events: none attribute, use pointer-events: auto instead
  • In these buttons' event handler, simulate (mouse/touch/pointer) click event to underlying game canvas, and ofz do the same things with game client does, that update contents of TL overlay based on pages/types selected

the snippet of click event pass through might be (not tested on real game yet):

$(".overlay_button").on("click", function(e) {
	console.debug("Button clicked", e);
	// do the same thing that game does
	
	// hide this button first
	$(this).hide();
	// simulate the same position click event on canvas so that the game still work
	const elm = document.elementFromPoint(e.clientX, e.clientY);
	const ev = new window.MouseEvent("click", {
		'view': window,
		'bubbles': true,
		'cancelable': true,
		'clientX': e.clientX,
		'clientY': e.clientY,
		'screenX': e.screenX,
		'screenY': e.screenY,
	});
	elm.dispatchEvent(ev);
	// show this button again
	$(this).show();
});

if i'm working on this method, my poor network might slow progress...

@HitomaruKonpaku
Copy link
Member

@sinsinpub How about this?

image

@sinsinpub
Copy link
Contributor

@HitomaruKonpaku no sure if people who can't read Japanese are able to match the English list in the panel with the in-game screen list? specially when selected period tab is not All?

@HitomaruKonpaku
Copy link
Member

@sinsinpub I can add page number for more clarify

specially when selected period tab is not All?

I dont understand this part

@sinsinpub
Copy link
Contributor

i meant the left-side tabs for All, Daily, Weekly... things....
nevermind, as long as the list is following the api result's list, should be ok.
if add such a tab to panel, perhaps put it between Battle and Exped?
and remember add an option item to Settings for hiding it, since not all people need this.

@HitomaruKonpaku
Copy link
Member

i meant the left-side tabs for All, Daily, Weekly... things....
nevermind, as long as the list is following the api result's list, should be ok.

Yea it following api result

if add such a tab to panel, perhaps put it between Battle and Exped?
and remember add an option item to Settings for hiding it, since not all people need this.

will do

@tinefanforvettel
Copy link

I had same problem too I no have idea to get out of this

@mikenzb
Copy link
Contributor

mikenzb commented Apr 4, 2020

Wait for the 34.5.0 release, @tinefanforvettel

Hopefully in about a week due to chrome webstore delays and such, however that could be postponed etc.

@tinefanforvettel
Copy link

Wait for the 34.5.0 release,
well when? I get dizzy

@tossaponk
Copy link

tossaponk commented Apr 21, 2020

After a lot of debugging, I managed to write a code that hook into the PIXI event emitter and successfully intercept the new quest page and filter change event.

I have no experience in developing this extension, so someone here who have can use the code below.

Inject the code below as content script into the game page to intercept event.
The code is already tested and proven to work on current version.

(function(){
	var PIXIEventEmitter = PIXI.utils.EventEmitter;
	var _emit = PIXIEventEmitter.prototype.emit;
	
	PIXIEventEmitter.prototype.emit = function EmitterHook(t, e, r, n, i, o){
		if( t == "pointerup" ){
			if( e && e.type == "pointerup" && e.currentTarget ){
				if( e.currentTarget._page_no !== undefined ){
					console.log( "Quest page changed to " + e.currentTarget._page_no );
				}
				else if( e.currentTarget._filter !== undefined ){
					if( !e.currentTarget._selected )
						console.log( "Quest filter changed to " + e.currentTarget._filter );
					else
						console.log( "Quest filter unset" );
				}
				else if( e.currentTarget.parent && e.currentTarget.parent._next == e.currentTarget ){
					console.log( "Quest page next" );
				}
				else if( e.currentTarget.parent && e.currentTarget.parent._prev == e.currentTarget ){
					console.log( "Quest page prev" );
				}
				else if( e.currentTarget.parent && e.currentTarget.parent._first == e.currentTarget ){
					console.log( "Quest page first" );
				}
				else if( e.currentTarget.parent && e.currentTarget.parent._last == e.currentTarget ){
					console.log( "Quest page last" );
				}
			}
		}
		_emit.apply( this, arguments );
	}
})();

@tinefanforvettel
Copy link

How to use this code?

@tossaponk
Copy link

How to use this code?

Replace a console log with event message to KC3 extension to notify it about the page change. I don't know how to implement it at the moment because I don't have a lot of experience with chrome extension. Someone within the KC3 development team should have an idea how to implement it.

@tinefanforvettel
Copy link

Replace a console log with event message to KC3 extension to notify it about the page change
Console log?
image

@tossaponk
Copy link

Replace a console log with event message to KC3 extension to notify it about the page change
Console log?
image

If you want to try to see how it work then you should try copying the code and paste it then execute it in the console after selecting the game frame first, or make your own extension to inject the code into the game frame.
Untitled

@tossaponk
Copy link

I've already made a working branch on my own fork, so have a look.
tossaponk@8ec003b

I think it's a bit of a dirty fix. Someone here maybe able to do it better. It even uses the hidden option that enabled the game code hooking.

@tinefanforvettel
Copy link

Not defined

@kannasama
Copy link

Just happened across the issue today myself, and I'd like to add that it appears it's more than just the translation overlay, it also affects the quest counter overlay:
overlays

@Giocovier
Copy link

Giocovier commented Aug 26, 2020

Just would like to bump this that the issue is still appearing in 34.8.0.
Versions : 85.0.4183.83 (Official Build) (64-bit)
Windows 10 OS Version 2004 (OS Build 19041.450)
KC3 v34.8.0 from Chrome Store; Mode : Customize DMM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants