forked from ac-custom-shaders-patch/acc-lua-internal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
164 changed files
with
21,229 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
.vscode | ||
.vscode | ||
*.kn5 | ||
data.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
local carDir = ac.getFolder(ac.FolderID.ContentCars)..'/'..ac.getCarID(car.index) | ||
local info = io.load(carDir..'/ui/ui_car.json') | ||
local description = string.match(info, 'description".-"(.-)"'):gsub('<br>', '\n'):gsub('[\r\t]', ''):gsub('\n\n\n', '\n\n'):trim() | ||
|
||
local skinsDir = carDir..'/skins' | ||
local firstSkin = skinsDir..'/'..ac.getCarSkinID(0)..'/preview.jpg' | ||
|
||
return function (dt) | ||
ui.drawRectFilled(0, ui.windowSize(), rgbm.colors.black) | ||
system.scrollList(dt, function () | ||
ui.image(firstSkin, vec2(1022, 575) * (math.min(400, ui.availableSpaceX()) / 1022)) | ||
ui.offsetCursorY(40) | ||
ui.dwriteText(string.format('Driven distance: %.1f km', car.distanceDrivenTotalKm), 18) | ||
ui.dwriteText(string.format('Fuel: %.0f L', car.fuel), 18) | ||
ui.offsetCursorY(30) | ||
ui.dwriteTextWrapped(description, 14) | ||
end) | ||
end |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[ABOUT] | ||
NAME = Car Info | ||
AUTHOR = x4fab | ||
VERSION = 1.0 | ||
DESCRIPTION = Information about car |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
local brand = ac.getCarBrand(0) | ||
if car.year < 2015 or #brand < 3 or #brand > 9 or brand:sub(1, 1):upper() ~= brand:sub(1, 1) or brand:match('[^A-Za-z ]') then | ||
error('Might not be fitting app for this car') | ||
end | ||
|
||
local brandColors = { | ||
['Audi'] = rgbm.colors.black | ||
} | ||
|
||
system.runningApp().name = 'My '..brand | ||
|
||
-- Alternative way of making a dynamic icon: just set it to an extra canvas. Works well here, | ||
-- because it only needs to be updated once. | ||
system.runningApp().icon = ui.ExtraCanvas(64):clear(rgbm.colors.transparent):update(function (dt) | ||
ui.setAsynchronousImagesLoading(false) | ||
ui.drawCircleFilled(32, 30.3, brandColors[brand] or rgbm.colors.white, 30) | ||
ui.renderTexture({ | ||
filename = ac.getFolder(ac.FolderID.ContentCars)..'/'..ac.getCarID(0)..'/ui/badge.png', | ||
p1 = vec2(0, 0), | ||
p2 = vec2(64, 64), | ||
uv1 = vec2(-0.15, -0.15), | ||
uv2 = vec2(1.3, 1.3), | ||
mask1 = io.relative('icon.png'), | ||
mask1Flags = render.TextureMaskFlags.UseAlpha | ||
}) | ||
end) |
Oops, something went wrong.