Skip to content

Commit

Permalink
chore: remove is prefix from constructors (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
carlos-menezes authored Apr 7, 2024
1 parent 65fe62d commit 4252afd
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions client/js/compatibility/classes/webview.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ class WebView extends alt.WebView {

let instance = null;
if (args.length == 4) {
const [_, isOverlay, pos, size] = args;
instance = alt.WebView.create({ url, isOverlay, pos, size });
const [_, overlay, pos, size] = args;
instance = alt.WebView.create({ url, overlay, pos, size });
} else if (args.length == 3 && isObject(args[2])) {
const [_, pos, size] = args;
instance = alt.WebView.create({ url, pos, size });
Expand All @@ -30,8 +30,8 @@ class WebView extends alt.WebView {
const [_, pos] = args;
alt.WebView.create({ url, pos });
} else if (args.length == 2) {
const isOverlay = args[1];
instance = alt.WebView.create({ url, isOverlay });
const overlay = args[1];
instance = alt.WebView.create({ url, overlay });
} else {
instance = alt.WebView.create({ url });
}
Expand Down
2 changes: 1 addition & 1 deletion client/src/factories/AudioFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ static js::FactoryHandler audioFactory(alt::IBaseObject::Type::AUDIO, [](js::Obj
float volume;
if(!args.Get("volume", volume)) return nullptr;

bool isRadio = args.Get<bool>("isRadio", false);
bool isRadio = args.Get<bool>("radio", false);
bool clearCache = args.Get<bool>("clearCache", true);

js::IResource* resource = args.GetResource();
Expand Down
4 changes: 2 additions & 2 deletions client/src/factories/WebViewFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ static js::FactoryHandler webViewFactory(alt::IBaseObject::Type::WEBVIEW, [](js:
{
alt::Vector2i pos = args.Get<alt::Vector2i>("pos", {0, 0});
alt::Vector2i size = args.Get<alt::Vector2i>("size", {0, 0});
bool isVisible = args.Get("isVisible", true);
bool isOverlay = args.Get("isOverlay", false);
bool isVisible = args.Get("visible", true);
bool isOverlay = args.Get("overlay", false);

return alt::ICore::Instance().CreateWebView(url, pos, size, isVisible, isOverlay, args.GetResource()->GetResource());
}
Expand Down
6 changes: 3 additions & 3 deletions types/client/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ declare module "@altv/client" {
export interface AudioCreateOptions {
source: string;
volume: number;
isRadio?: boolean; // default: false
radio?: boolean; // default: false
clearCache?: boolean; // default: true
}

Expand Down Expand Up @@ -1234,8 +1234,8 @@ declare module "@altv/client" {
url: string;
pos?: altShared.IVector2; // default: { x: 0, y: 0 }
size?: altShared.IVector2; // default: { x: 0, y: 0 }
isVisible?: boolean; // default: true
isOverlay?: boolean; // default: false
visible?: boolean; // default: true
overlay?: boolean; // default: false
}

export abstract class WebView extends BaseObject {
Expand Down

0 comments on commit 4252afd

Please sign in to comment.