Store screenshots now render at real phone and tablet density (--screenshot-ui-scale), show the painted Wim Hof, Sun Salutation and Meditation cards, an Upward salute pose and showcase habits instead of test fixtures. Descriptions in all five store locales name the actual practices, patterns and habit features. TODO.md tracks the marketing plan.
91 lines
2.7 KiB
Ziran
91 lines
2.7 KiB
Ziran
#import, file "../src/app/screenshot_request.zi";
|
|
|
|
#program_export
|
|
Answer :: () -> s32 {
|
|
defaults: [1]string
|
|
defaults[0] = "inbe"
|
|
request := ScreenshotParse(defaults[:], 200, 700, 5, true)
|
|
if !request.valid || request.active != 0 ||
|
|
request.width != 320 || request.height != 700 ||
|
|
request.theme_id != SCREENSHOT_THEME_CURRENT ||
|
|
!ScreenshotSceneEquals(request.scene[:], "home") {
|
|
return -1
|
|
}
|
|
|
|
args: [13]string
|
|
args[0] = "inbe"
|
|
args[1] = "--unknown"
|
|
args[2] = "--screenshot"
|
|
args[3] = "capture.png"
|
|
args[4] = "--screenshot-scene"
|
|
args[5] = "tutorial_whm_step2"
|
|
args[6] = "--screenshot-width"
|
|
args[7] = "1024"
|
|
args[8] = "--screenshot-height"
|
|
args[9] = "480"
|
|
args[10] = "--screenshot-theme"
|
|
args[11] = "3"
|
|
args[12] = "--screenshot-dark"
|
|
request = ScreenshotParse(args[:], 800, 600, 5, true)
|
|
if !request.valid || request.active != 1 ||
|
|
request.width != 1024 || request.height != 480 ||
|
|
request.theme_id != 3 || request.dark_mode != 0 ||
|
|
!ScreenshotSceneEquals(request.scene[:], "tutorial_whm_step2") ||
|
|
ScreenshotWarmupFrames(request) != 150 {
|
|
return -2
|
|
}
|
|
|
|
args[6] = "--screenshot-width"
|
|
args[7] = "99999999999999999"
|
|
request = ScreenshotParse(args[:], 800, 600, 5, true)
|
|
if request.width != 800 {
|
|
return -3
|
|
}
|
|
args[7] = "-1"
|
|
args[10] = "--screenshot-theme"
|
|
args[11] = "99"
|
|
request = ScreenshotParse(args[:], 800, 600, 5, true)
|
|
if request.width != 320 || request.theme_id != SCREENSHOT_THEME_CURRENT {
|
|
return -4
|
|
}
|
|
|
|
disabled := ScreenshotParse(args[:], 800, 600, 5, false)
|
|
if disabled.active != 0 || disabled.valid {
|
|
return -5
|
|
}
|
|
if ScreenshotParseInt("-2147483648", 1) != -2147483648 ||
|
|
ScreenshotParseInt("+7suffix", 1) != 7 ||
|
|
ScreenshotParseInt("not-a-number", 9) != 9 {
|
|
return -6
|
|
}
|
|
if request.ui_scale_tenths != 0 {
|
|
return -8
|
|
}
|
|
args[12] = "--screenshot-ui-scale"
|
|
request = ScreenshotParse(args[:], 800, 600, 5, true)
|
|
if request.ui_scale_tenths != 0 {
|
|
return -9
|
|
}
|
|
scaled: [5]string
|
|
scaled[0] = "inbe"
|
|
scaled[1] = "--screenshot"
|
|
scaled[2] = "capture.png"
|
|
scaled[3] = "--screenshot-ui-scale"
|
|
scaled[4] = "25"
|
|
request = ScreenshotParse(scaled[:], 800, 600, 5, true)
|
|
if !request.valid || request.ui_scale_tenths != 25 {
|
|
return -10
|
|
}
|
|
scaled[4] = "26"
|
|
request = ScreenshotParse(scaled[:], 800, 600, 5, true)
|
|
if request.ui_scale_tenths != 0 {
|
|
return -11
|
|
}
|
|
args[3] = ""
|
|
request = ScreenshotParse(args[:], 800, 600, 5, true)
|
|
if request.active != 1 || request.valid {
|
|
return -7
|
|
}
|
|
return 42
|
|
}
|