mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-08-01 10:56:42 +02:00
Move patchPollGamepads code to external file
This commit is contained in:
@@ -61,3 +61,5 @@ export namespace BxEvent {
|
||||
target.dispatchEvent(event);
|
||||
}
|
||||
}
|
||||
|
||||
(window as any).BxEvent = BxEvent;
|
||||
|
@@ -65,3 +65,15 @@ export function hashCode(str: string): number {
|
||||
|
||||
return hash;
|
||||
}
|
||||
|
||||
|
||||
export function renderString(str: string, obj: any){
|
||||
return str.replace(/\$\{.+?\}/g, match => {
|
||||
const key = match.substring(2, match.length - 1);
|
||||
if (key in obj) {
|
||||
return obj[key];
|
||||
}
|
||||
|
||||
return match;
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user