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

chore: remove is prefix from constructors #202

Merged
merged 16 commits into from
Apr 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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